00001 /********************************************/ 00002 /* NS2 Simulator for IEEE 802.15.4 */ 00003 /* (per P802.15.4/D18) */ 00004 /*------------------------------------------*/ 00005 /* by: Jianliang Zheng */ 00006 /* (zheng@ee.ccny.cuny.edu) */ 00007 /* Myung J. Lee */ 00008 /* (lee@ccny.cuny.edu) */ 00009 /* ~~~~~~~~~~~~~~~~~~~~~~~~~ */ 00010 /* SAIT-CUNY Joint Lab */ 00011 /********************************************/ 00012 00013 // File: p802_15_4trace.h 00014 // Mode: C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t 00015 00016 // $Header: /cvsroot/nsnam/ns-2/wpan/p802_15_4trace.h,v 1.1 2005/01/24 18:34:25 haldar Exp $ 00017 00018 /* 00019 * Copyright (c) 2003-2004 Samsung Advanced Institute of Technology and 00020 * The City University of New York. All rights reserved. 00021 * 00022 * Redistribution and use in source and binary forms, with or without 00023 * modification, are permitted provided that the following conditions 00024 * are met: 00025 * 1. Redistributions of source code must retain the above copyright 00026 * notice, this list of conditions and the following disclaimer. 00027 * 2. Redistributions in binary form must reproduce the above copyright 00028 * notice, this list of conditions and the following disclaimer in the 00029 * documentation and/or other materials provided with the distribution. 00030 * 3. All advertising materials mentioning features or use of this software 00031 * must display the following acknowledgement: 00032 * This product includes software developed by the Joint Lab of Samsung 00033 * Advanced Institute of Technology and The City University of New York. 00034 * 4. Neither the name of Samsung Advanced Institute of Technology nor of 00035 * The City University of New York may be used to endorse or promote 00036 * products derived from this software without specific prior written 00037 * permission. 00038 * 00039 * THIS SOFTWARE IS PROVIDED BY THE JOINT LAB OF SAMSUNG ADVANCED INSTITUTE 00040 * OF TECHNOLOGY AND THE CITY UNIVERSITY OF NEW YORK ``AS IS'' AND ANY EXPRESS 00041 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00042 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00043 * NO EVENT SHALL SAMSUNG ADVANCED INSTITUTE OR THE CITY UNIVERSITY OF NEW YORK 00044 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00045 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00046 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00047 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00048 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00049 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00050 */ 00051 00052 00053 #ifndef p802_15_4trace_h 00054 #define p802_15_4trace_h 00055 00056 #include <packet.h> 00057 00058 //#define MAC_Subtype_RTS 0x0B 00059 //#define MAC_Subtype_CTS 0x0C 00060 //#define MAC_Subtype_ACK 0x0D 00061 //#define MAC_Subtype_Data 0x00 00062 #define MAC_Subtype_Beacon 0x0f 00063 #define MAC_Subtype_Command_AssoReq 0x01 00064 #define MAC_Subtype_Command_AssoRsp 0x02 00065 #define MAC_Subtype_Command_DAssNtf 0x03 00066 #define MAC_Subtype_Command_DataReq 0x04 00067 #define MAC_Subtype_Command_PIDCNtf 0x05 00068 #define MAC_Subtype_Command_OrphNtf 0x06 00069 #define MAC_Subtype_Command_BconReq 0x07 00070 #define MAC_Subtype_Command_CoorRea 0x08 00071 #define MAC_Subtype_Command_GTSReq 0x09 00072 00073 int p802_15_4macSA(Packet *p); 00074 int p802_15_4macDA(Packet *p); 00075 u_int16_t p802_15_4hdr_type(Packet *p); 00076 int p802_15_4hdr_dst(char* hdr,int dst = -2); 00077 int p802_15_4hdr_src(char* hdr,int src = -2); 00078 int p802_15_4hdr_type(char* hdr, u_int16_t type = 0); 00079 void p802_15_4hdrDATA(Packet *p); 00080 void p802_15_4hdrACK(Packet *p); 00081 void p802_15_4hdrBeacon(Packet *p); 00082 void p802_15_4hdrCommand(Packet *p, u_int16_t type); 00083 const char *wpan_pName(Packet *p); 00084 00085 #endif 00086 00087 // End of file: p802_15_4trace.h