p802_15_4trace.h File Reference

#include <packet.h>

Include dependency graph for p802_15_4trace.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MAC_Subtype_Beacon   0x0f
#define MAC_Subtype_Command_AssoReq   0x01
#define MAC_Subtype_Command_AssoRsp   0x02
#define MAC_Subtype_Command_BconReq   0x07
#define MAC_Subtype_Command_CoorRea   0x08
#define MAC_Subtype_Command_DAssNtf   0x03
#define MAC_Subtype_Command_DataReq   0x04
#define MAC_Subtype_Command_GTSReq   0x09
#define MAC_Subtype_Command_OrphNtf   0x06
#define MAC_Subtype_Command_PIDCNtf   0x05

Functions

int p802_15_4hdr_dst (char *hdr, int dst=-2)
int p802_15_4hdr_src (char *hdr, int src=-2)
int p802_15_4hdr_type (char *hdr, u_int16_t type=0)
u_int16_t p802_15_4hdr_type (Packet *p)
void p802_15_4hdrACK (Packet *p)
void p802_15_4hdrBeacon (Packet *p)
void p802_15_4hdrCommand (Packet *p, u_int16_t type)
void p802_15_4hdrDATA (Packet *p)
int p802_15_4macDA (Packet *p)
int p802_15_4macSA (Packet *p)
const char * wpan_pName (Packet *p)


Define Documentation

#define MAC_Subtype_Beacon   0x0f
 

Definition at line 62 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), p802_15_4hdrBeacon(), and wpan_pName().

#define MAC_Subtype_Command_AssoReq   0x01
 

Definition at line 63 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_AssoRsp   0x02
 

Definition at line 64 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_BconReq   0x07
 

Definition at line 69 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_CoorRea   0x08
 

Definition at line 70 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_DAssNtf   0x03
 

Definition at line 65 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_DataReq   0x04
 

Definition at line 66 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_GTSReq   0x09
 

Definition at line 71 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_OrphNtf   0x06
 

Definition at line 68 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().

#define MAC_Subtype_Command_PIDCNtf   0x05
 

Definition at line 67 of file p802_15_4trace.h.

Referenced by CMUTrace::nam_format(), and wpan_pName().


Function Documentation

int p802_15_4hdr_dst char *  hdr,
int  dst = -2
 

Definition at line 149 of file p802_15_4trace.cc.

References ETHER_ADDR, and STORE4BYTE.

Referenced by Mac802_15_4::hdr_dst().

00150 {
00151     struct hdr_mac802_11 *mh = (struct hdr_mac802_11*) hdr;
00152     if(dst > -2)
00153         STORE4BYTE(&dst, (mh->dh_da));
00154     return ETHER_ADDR(mh->dh_da);
00155 }

int p802_15_4hdr_src char *  hdr,
int  src = -2
 

Definition at line 157 of file p802_15_4trace.cc.

References ETHER_ADDR, and STORE4BYTE.

Referenced by Mac802_15_4::hdr_src().

00158 {
00159     struct hdr_mac802_11 *mh = (struct hdr_mac802_11*) hdr;
00160     if(src > -2)
00161         STORE4BYTE(&src, (mh->dh_sa));
00162     return ETHER_ADDR(mh->dh_sa);
00163 }

int p802_15_4hdr_type char *  hdr,
u_int16_t  type = 0
 

Definition at line 165 of file p802_15_4trace.cc.

References hdr_mac802_11::dh_body, GET2BYTE, and STORE2BYTE.

00166 {
00167     struct hdr_mac802_11 *mh = (struct hdr_mac802_11*) hdr;
00168     if(type)
00169         STORE2BYTE(&type,(mh->dh_body));
00170     return GET2BYTE(mh->dh_body);
00171 }

u_int16_t p802_15_4hdr_type Packet p  ) 
 

Definition at line 143 of file p802_15_4trace.cc.

References hdr_mac802_11::dh_body, GET2BYTE, and HDR_MAC802_11.

00144 {
00145     struct hdr_mac802_11 *mh = HDR_MAC802_11(p);
00146     return GET2BYTE(mh->dh_body);
00147 }

void p802_15_4hdrACK Packet p  ) 
 

Definition at line 184 of file p802_15_4trace.cc.

References Packet::access(), ack_frame::af_fc, frame_control::fc_protocol_version, frame_control::fc_subtype, frame_control::fc_type, MAC_ProtocolVersion, MAC_Subtype_ACK, MAC_Type_Control, and hdr_mac::offset_.

Referenced by Mac802_15_4::constructACK().

00185 {
00186     struct ack_frame *af = (struct ack_frame*)p->access(hdr_mac::offset_);
00187 
00188     af->af_fc.fc_protocol_version = MAC_ProtocolVersion;
00189     af->af_fc.fc_type = MAC_Type_Control;
00190     af->af_fc.fc_subtype = MAC_Subtype_ACK;
00191 }

Here is the call graph for this function:

void p802_15_4hdrBeacon Packet p  ) 
 

Definition at line 193 of file p802_15_4trace.cc.

References hdr_mac802_11::dh_fc, frame_control::fc_protocol_version, frame_control::fc_subtype, frame_control::fc_type, HDR_MAC802_11, MAC_ProtocolVersion, MAC_Subtype_Beacon, and MAC_Type_Control.

Referenced by Mac802_15_4::beaconTxHandler(), and Mac802_15_4::recvCommand().

00194 {
00195     struct hdr_mac802_11* mh = HDR_MAC802_11(p);
00196 
00197     mh->dh_fc.fc_protocol_version = MAC_ProtocolVersion;
00198     mh->dh_fc.fc_type = MAC_Type_Control;       //doesn't really matter
00199     mh->dh_fc.fc_subtype = MAC_Subtype_Beacon;
00200 }

void p802_15_4hdrCommand Packet p,
u_int16_t  type
 

Definition at line 202 of file p802_15_4trace.cc.

References hdr_mac802_11::dh_fc, frame_control::fc_protocol_version, frame_control::fc_subtype, frame_control::fc_type, HDR_MAC802_11, MAC_ProtocolVersion, and MAC_Type_Control.

Referenced by Mac802_15_4::constructCommandHeader().

00203 {
00204     struct hdr_mac802_11* mh = HDR_MAC802_11(p);
00205 
00206     mh->dh_fc.fc_protocol_version = MAC_ProtocolVersion;
00207     mh->dh_fc.fc_type = MAC_Type_Control;       //doesn't really matter
00208     mh->dh_fc.fc_subtype = type;
00209 }

void p802_15_4hdrDATA Packet p  ) 
 

Definition at line 173 of file p802_15_4trace.cc.

References hdr_mac802_11::dh_fc, frame_control::fc_protocol_version, frame_control::fc_subtype, frame_control::fc_type, HDR_MAC802_11, MAC_ProtocolVersion, MAC_Subtype_Data, and MAC_Type_Data.

Referenced by Mac802_15_4::mcps_data_request().

00174 {
00175     struct hdr_mac802_11* mh = HDR_MAC802_11(p);
00176 
00177     //ch->size() += ETHER_HDR_LEN11;
00178 
00179     mh->dh_fc.fc_protocol_version = MAC_ProtocolVersion;
00180     mh->dh_fc.fc_type = MAC_Type_Data;
00181     mh->dh_fc.fc_subtype = MAC_Subtype_Data;
00182 }

int p802_15_4macDA Packet p  ) 
 

Definition at line 137 of file p802_15_4trace.cc.

References ETHER_ADDR, and HDR_MAC802_11.

Referenced by Mac802_15_4::backoffBoundHandler(), Mac802_15_4::beaconTxHandler(), Mac802_15_4::constructACK(), Mac802_15_4::constructCommandHeader(), Mac802_15_4::csmacaCallBack(), Phy802_15_4::PD_DATA_request(), Phy802_15_4::PLME_SET_request(), Phy802_15_4::PLME_SET_TRX_STATE_request(), Mac802_15_4::recv(), Phy802_15_4::recv(), Mac802_15_4::recvCommand(), Phy802_15_4::recvOverHandler(), Mac802_15_4::resetCounter(), Mac802_15_4::sendDown(), Phy802_15_4::sendOverHandler(), Mac802_15_4::taskFailed(), Mac802_15_4::taskSuccess(), Mac802_15_4::txBcnCmdDataHandler(), and Mac802_15_4::txHandler().

00138 {
00139     struct hdr_mac802_11 *mh = HDR_MAC802_11(p);
00140     return ETHER_ADDR(mh->dh_da);
00141 }

int p802_15_4macSA Packet p  ) 
 

Definition at line 130 of file p802_15_4trace.cc.

References ETHER_ADDR, and HDR_MAC802_11.

Referenced by Mac802_15_4::beaconTxHandler(), Mac802_15_4::constructACK(), Mac802_15_4::csmacaCallBack(), Phy802_15_4::PD_DATA_request(), Phy802_15_4::PLME_SET_request(), Phy802_15_4::PLME_SET_TRX_STATE_request(), Mac802_15_4::recv(), Phy802_15_4::recv(), Mac802_15_4::recvAck(), Mac802_15_4::recvBeacon(), Mac802_15_4::recvCommand(), Mac802_15_4::recvData(), Phy802_15_4::recvOverHandler(), Phy802_15_4::sendOverHandler(), Mac802_15_4::taskFailed(), and Mac802_15_4::txHandler().

00131 {
00132     struct hdr_mac802_11 *mh = HDR_MAC802_11(p);
00133     return ETHER_ADDR(mh->dh_sa);
00134     
00135 }

const char* wpan_pName Packet p  ) 
 

Definition at line 213 of file p802_15_4trace.cc.

References hdr_mac802_11::dh_fc, frame_control::fc_subtype, HDR_CMN, HDR_MAC802_11, MAC_Subtype_ACK, MAC_Subtype_Beacon, MAC_Subtype_Command_AssoReq, MAC_Subtype_Command_AssoRsp, MAC_Subtype_Command_BconReq, MAC_Subtype_Command_CoorRea, MAC_Subtype_Command_DAssNtf, MAC_Subtype_Command_DataReq, MAC_Subtype_Command_GTSReq, MAC_Subtype_Command_OrphNtf, MAC_Subtype_Command_PIDCNtf, p_info::name(), packet_info, PT_MAC, and hdr_cmn::ptype().

Referenced by Mac802_15_4::csmacaCallBack(), Phy802_15_4::PD_DATA_request(), Phy802_15_4::PLME_SET_request(), Phy802_15_4::PLME_SET_TRX_STATE_request(), Mac802_15_4::recv(), Phy802_15_4::recv(), Mac802_15_4::recvCommand(), Mac802_15_4::recvData(), Phy802_15_4::recvOverHandler(), Phy802_15_4::sendOverHandler(), Mac802_15_4::taskFailed(), Mac802_15_4::txBcnCmdDataHandler(), and Mac802_15_4::txHandler().

00214 {
00215     struct hdr_cmn *ch = HDR_CMN(p);
00216     struct hdr_mac802_11 *mh = HDR_MAC802_11(p);
00217     return
00218     ((ch->ptype() == PT_MAC) ? (
00219       (mh->dh_fc.fc_subtype == MAC_Subtype_Beacon) ? "M_BEACON"  :          //Beacon
00220       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_AssoReq) ? "M_CM1_AssoReq"  :    //CMD: Association request
00221       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_AssoRsp) ? "M_CM2_AssoRsp"  :    //CMD: Association response
00222       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_DAssNtf) ? "M_CM3_DisaNtf"  :    //CMD: Disassociation notification
00223       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_DataReq) ? "M_CM4_DataReq"  :    //CMD: Data request
00224       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_PIDCNtf) ? "M_CM5_PidCNtf"  :    //CMD: PAN ID conflict notification
00225       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_OrphNtf) ? "M_CM6_OrphNtf"  :    //CMD: Orphan notification
00226       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_BconReq) ? "M_CM7_Bcn-Req"  :    //CMD: Beacon request
00227       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_CoorRea) ? "M_CM8_CoorRal"  :    //CMD: Coordinator realignment
00228       (mh->dh_fc.fc_subtype == MAC_Subtype_Command_GTSReq) ?  "M_CM9_GTS-Req"  :    //CMD: GTS request
00229       (mh->dh_fc.fc_subtype == MAC_Subtype_ACK) ? "M_ACK"  :            //Acknowledgement
00230       "M_UNKN"
00231       ) : packet_info.name(ch->ptype()));
00232 }

Here is the call graph for this function:


Generated on Tue Mar 6 16:56:48 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6