NetSim Source Code Help
Loading...
Searching...
No Matches
Packet.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  stru_NetSim_Packet_AppLayer
 
struct  stru_NetSim_Packet_TransportLayer
 
struct  stru_NetSim_Packet_NetworkLayer
 
struct  stru_NetSim_Packet_MACLayer
 
struct  stru_NetSim_Packet_PhyLayer
 
struct  stru_packet_info
 
struct  stru_NetSim_Packet
 

Macros

#define MAXBUF   0x800
 
#define MAX_PACKET_TYPE_LEN   100
 
#define PACKET_ID(pPacket)   (pPacket)->nPacketId
 
#define PACKET_SERVICETYPE(pPacket)   (pPacket)->nServiceType
 
#define PACKET_EVENTTIME(pPacket)   (pPacket)->dEventTime
 
#define PACKET_SOURCE(pPacket)   (pPacket)->nSourceId
 
#define PACKET_DESTINATION(pPacket)   (pPacket)->nDestinationId
 
#define PACKET_TRANSMITTER(pPacket)   (pPacket)->nTransmitterId
 
#define PACKET_RECEIVER(pPacket)   (pPacket)->nReceiverId
 
#define PACKET_APPDATA(pPacket)   (pPacket)->pstruAppData
 
#define PACKET_TRXDATA(pPacket)   (pPacket)->pstruTransportData
 
#define PACKET_NWDATA(pPacket)   (pPacket)->pstruNetworkData
 
#define PACKET_MACDATA(pPacket)   (pPacket)->pstruMacData
 
#define PACKET_PHYDATA(pPacket)   (pPacket)->pstruPhyData
 
#define PACKET_PHYPROTOCOLDATA(pPacket)   PACKET_PHYDATA(pPacket)->Packet_PhyData
 
#define PACKET_MACPROTOCOLDATA(pPacket)   PACKET_MACDATA(pPacket)->Packet_MACProtocol
 
#define PACKET_NWPROTOCOLDATA(pPacket)   PACKET_NWDATA(pPacket)->Packet_NetworkProtocol
 
#define PACKET_TRXPROTOCOLDATA(pPacket)   PACKET_TRXDATA(pPacket)->Packet_TransportProtocol
 
#define PACKET_APPPROTOCOLDATA(pPacket)   PACKET_APPDATA(pPacket)->Packet_AppProtocol
 
#define PACKET_NEXTPACKET(pPacket)   (pPacket)->pstruNextPacket
 

Typedefs

typedef enum enum_ApplicationType APPLICATION_TYPE
 
typedef struct stru_packet_info PACKET_INFO
 
typedef struct stru_packet_infoPPACKET_INFO
 

Enumerations

enum  enum_SuppressionModel { SuppModel_NULL =0 , SuppModel_Deterministics =1 , SuppModel_MarkovChain }
 
enum  enum_Distribution {
  Distribution_NULL =0 , Distribution_Exponential =1 , Distribution_Uniform , Distribution_Triangular ,
  Distribution_Weibull , Distribution_Constant , Distribution_Backlog , Distribution_Normal ,
  Distribution_Gamma
}
 
enum  enum_PacketType {
  PacketType_Voice =1 , PacketType_CBR , PacketType_Custom , PacketType_DataBase ,
  PacketType_Video , PacketType_FTP , PacketType_HTTP , PacketType_EMAIL ,
  PacketType_Peer_to_Peer , PacketType_Erlang_Call , PacketType_Emulation , PacketType_Sensing ,
  PacketType_BSM , PacketType_COAP , PacketType_Control
}
 
enum  enum_ServiceType { ServiceType_NULL =0 , ServiceType_CBR =1 , ServiceType_VBR =2 }
 
enum  enum_PacketPriority { Priority_Low =2 , Priority_Normal =4 , Priority_Medium =6 , Priority_High =8 }
 
enum  enum_Packet_QOS {
  QOS_UGS = 1 , QOS_rtPS , QOS_ertPS , QOS_nrtPS ,
  QOS_BE , QOS_GBR = QOS_UGS , QOS_NONGBR = QOS_BE
}
 
enum  enum_PacketStatus {
  PacketStatus_NoError =0 , PacketStatus_Error =1 , PacketStatus_Collided =2 , PacketStatus_Buffer_Dropped =3 ,
  PacketStatus_TTL_Expired =4 , PacketStatus_Dropped =5
}
 
enum  enum_Segment { Segment_FirstSegment =10 , Segment_ContinuingFragment =11 , Segment_LastFragment =01 , Segment_Unfragment =00 }
 
enum  enum_BUFFER { Buffer_Underflow , Buffer_Overflow }
 
enum  IP_PROTOCOL_NUMBER {
  IPPROTOCOL_NULL = 0x00 , IPPROTOCOL_ICMP = 0x01 , IPPROTOCOL_IGMP = 0x02 , IPPROTOCOL_TCP = 0x06 ,
  IPPROTOCOL_UDP = 0x11 , IPPROTOCOL_DSR = 0x30 , IPPROTOCOL_OSPF = 0x59 , IPPROTOCOL_PIM = 0x67
}
 
enum  enum_ApplicationType {
  TRAFFIC_NULL = 0 , TRAFFIC_DATA = 1 , TRAFFIC_CBR , TRAFFIC_VOICE ,
  TRAFFIC_VIDEO , TRAFFIC_FTP , TRAFFIC_HTTP , TRAFFIC_DATABASE ,
  TRAFFIC_CUSTOM , TRAFFIC_EMAIL , TRAFFIC_PEER_TO_PEER , TRAFFIC_ERLANG_CALL ,
  TRAFFIC_EMULATION , TRAFFIC_SENSING , TRAFFIC_BSM_APP , TRAFFIC_SENSOR_EMULATION ,
  TRAFFIC_COAP
}
 

Functions

NetSim_PACKETfn_NetSim_Packet_CreatePacket_dbg (int nLayer, int line, const char *file)
 
int fn_NetSim_Packet_FreeMacProtocolData (NetSim_PACKET *pstruPacket)
 
int fn_NetSim_Packet_FreePacket_dbg (NetSim_PACKET **pstruPacket, int line, const char *file)
 
int fn_NetSim_Packet_AddPacketToList_dbg (NetSim_BUFFER *pstruBuffer, NetSim_PACKET *pstruPacket, int nInsertionType, int line, const char *file)
 
bool fn_NetSim_GetBufferStatus (NetSim_BUFFER *pstruBuffer)
 
NetSim_PACKETfn_NetSim_Packet_GetPacketFromBuffer (NetSim_BUFFER *pstruBuffer, int nFlag)
 
PACKET_STATUS fn_NetSim_Packet_DecideError (double dBER, long double dPacketSize)
 
NetSim_PACKETfn_NetSim_Packet_CopyPacket_dbg (const NetSim_PACKET *pstruPacket, int line, const char *file)
 
NetSim_PACKETfn_NetSim_Packet_CopyPacketList_dbg (const NetSim_PACKET *pstruPacket, int line, const char *file)
 
int fn_NetSim_Packet_CopyPhyData (NetSim_PACKET *pstruDestPacket, const NetSim_PACKET *pstruSrcPacket, int, const char *)
 
int fn_NetSim_Packet_CopyMacData (NetSim_PACKET *pstruDestPacket, const NetSim_PACKET *pstruSrcPacket, int, const char *)
 
int fn_NetSim_Packet_CopyNWData (NetSim_PACKET *pstruDestPacket, NetSim_PACKET *pstruSrcPacket)
 
int fn_NetSim_Packet_CopyTransportData (NetSim_PACKET *pstruDestPacket, const NetSim_PACKET *pstruSrcPacket, int, const char *)
 
int fn_NetSim_Packet_CopyAppData (NetSim_PACKET *pstruDestPacket, const NetSim_PACKET *pstruSrcPacket, int, const char *)
 
int fn_NetSim_WritePacketTrace_dbg (const NetSim_PACKET *pstruPacket, int line, const char *file)
 
int fnValidatePacket (const NetSim_PACKET *pstruPacket)
 
int fn_NetSim_Stack_FragmentPacket (NetSim_PACKET *pstruPacket, int nMSS)
 
double fnGetPacketSize (NetSim_PACKET *pstruData)
 
char * fn_NetSim_Config_GetPacketTypeAsString (PACKET_TYPE nPacketType)
 
char * fn_NetSim_Config_GetControlPacketType (const NetSim_PACKET *, char *type)
 
int fn_NetSim_Dispatch_to_emulator (NetSim_PACKET *packet)
 
unsigned int getPacketInfoSize ()
 
void add_dest_to_packet (NetSim_PACKET *packet, NETSIM_ID dest)
 
void add_destlist_to_packet (NetSim_PACKET *packet, NETSIM_ID *destlist, UINT count)
 
NETSIM_IDget_dest_from_packet (NetSim_PACKET *packet, UINT *count)
 
NETSIM_ID get_first_dest_from_packet (NetSim_PACKET *packet)
 
void remove_dest_from_packet (NetSim_PACKET *packet, NETSIM_ID dest)
 
bool isDestFoundinPacket (NetSim_PACKET *packet, NETSIM_ID dest)
 
bool isBroadcastPacket (NetSim_PACKET *packet)
 
bool isMulticastPacket (NetSim_PACKET *packet)
 
bool fn_NetSim_HWI_Send (NetSim_PACKET *packet)
 

Macro Definition Documentation

◆ MAX_PACKET_TYPE_LEN

#define MAX_PACKET_TYPE_LEN   100

Definition at line 252 of file Packet.h.

◆ MAXBUF

#define MAXBUF   0x800

Definition at line 241 of file Packet.h.

◆ PACKET_APPDATA

#define PACKET_APPDATA (   pPacket)    (pPacket)->pstruAppData

Definition at line 294 of file Packet.h.

◆ PACKET_APPPROTOCOLDATA

#define PACKET_APPPROTOCOLDATA (   pPacket)    PACKET_APPDATA(pPacket)->Packet_AppProtocol

Definition at line 303 of file Packet.h.

◆ PACKET_DESTINATION

#define PACKET_DESTINATION (   pPacket)    (pPacket)->nDestinationId

Definition at line 291 of file Packet.h.

◆ PACKET_EVENTTIME

#define PACKET_EVENTTIME (   pPacket)    (pPacket)->dEventTime

Definition at line 289 of file Packet.h.

◆ PACKET_ID

#define PACKET_ID (   pPacket)    (pPacket)->nPacketId

Definition at line 287 of file Packet.h.

◆ PACKET_MACDATA

#define PACKET_MACDATA (   pPacket)    (pPacket)->pstruMacData

Definition at line 297 of file Packet.h.

◆ PACKET_MACPROTOCOLDATA

#define PACKET_MACPROTOCOLDATA (   pPacket)    PACKET_MACDATA(pPacket)->Packet_MACProtocol

Definition at line 300 of file Packet.h.

◆ PACKET_NEXTPACKET

#define PACKET_NEXTPACKET (   pPacket)    (pPacket)->pstruNextPacket

Definition at line 304 of file Packet.h.

◆ PACKET_NWDATA

#define PACKET_NWDATA (   pPacket)    (pPacket)->pstruNetworkData

Definition at line 296 of file Packet.h.

◆ PACKET_NWPROTOCOLDATA

#define PACKET_NWPROTOCOLDATA (   pPacket)    PACKET_NWDATA(pPacket)->Packet_NetworkProtocol

Definition at line 301 of file Packet.h.

◆ PACKET_PHYDATA

#define PACKET_PHYDATA (   pPacket)    (pPacket)->pstruPhyData

Definition at line 298 of file Packet.h.

◆ PACKET_PHYPROTOCOLDATA

#define PACKET_PHYPROTOCOLDATA (   pPacket)    PACKET_PHYDATA(pPacket)->Packet_PhyData

Definition at line 299 of file Packet.h.

◆ PACKET_RECEIVER

#define PACKET_RECEIVER (   pPacket)    (pPacket)->nReceiverId

Definition at line 293 of file Packet.h.

◆ PACKET_SERVICETYPE

#define PACKET_SERVICETYPE (   pPacket)    (pPacket)->nServiceType

Definition at line 288 of file Packet.h.

◆ PACKET_SOURCE

#define PACKET_SOURCE (   pPacket)    (pPacket)->nSourceId

Definition at line 290 of file Packet.h.

◆ PACKET_TRANSMITTER

#define PACKET_TRANSMITTER (   pPacket)    (pPacket)->nTransmitterId

Definition at line 292 of file Packet.h.

◆ PACKET_TRXDATA

#define PACKET_TRXDATA (   pPacket)    (pPacket)->pstruTransportData

Definition at line 295 of file Packet.h.

◆ PACKET_TRXPROTOCOLDATA

#define PACKET_TRXPROTOCOLDATA (   pPacket)    PACKET_TRXDATA(pPacket)->Packet_TransportProtocol

Definition at line 302 of file Packet.h.

Typedef Documentation

◆ APPLICATION_TYPE

◆ PACKET_INFO

typedef struct stru_packet_info PACKET_INFO

◆ PPACKET_INFO

typedef struct stru_packet_info* PPACKET_INFO

Enumeration Type Documentation

◆ enum_ApplicationType

Enumerator
TRAFFIC_NULL 
TRAFFIC_DATA 
TRAFFIC_CBR 
TRAFFIC_VOICE 
TRAFFIC_VIDEO 
TRAFFIC_FTP 
TRAFFIC_HTTP 
TRAFFIC_DATABASE 
TRAFFIC_CUSTOM 
TRAFFIC_EMAIL 
TRAFFIC_PEER_TO_PEER 
TRAFFIC_ERLANG_CALL 
TRAFFIC_EMULATION 
TRAFFIC_SENSING 
TRAFFIC_BSM_APP 
TRAFFIC_SENSOR_EMULATION 
TRAFFIC_COAP 

Definition at line 137 of file Packet.h.

◆ enum_BUFFER

Enumerator
Buffer_Underflow 
Buffer_Overflow 

Definition at line 118 of file Packet.h.

◆ enum_Distribution

Enumerator
Distribution_NULL 
Distribution_Exponential 
Distribution_Uniform 
Distribution_Triangular 
Distribution_Weibull 
Distribution_Constant 
Distribution_Backlog 
Distribution_Normal 
Distribution_Gamma 

Definition at line 37 of file Packet.h.

◆ enum_Packet_QOS

Enumerator
QOS_UGS 
QOS_rtPS 
QOS_ertPS 
QOS_nrtPS 
QOS_BE 
QOS_GBR 
QOS_NONGBR 

Definition at line 86 of file Packet.h.

◆ enum_PacketPriority

Enumerator
Priority_Low 
Priority_Normal 
Priority_Medium 
Priority_High 

Definition at line 77 of file Packet.h.

◆ enum_PacketStatus

Enumerator
PacketStatus_NoError 
PacketStatus_Error 
PacketStatus_Collided 
PacketStatus_Buffer_Dropped 
PacketStatus_TTL_Expired 
PacketStatus_Dropped 

Definition at line 99 of file Packet.h.

◆ enum_PacketType

Enumerator
PacketType_Voice 
PacketType_CBR 
PacketType_Custom 
PacketType_DataBase 
PacketType_Video 
PacketType_FTP 
PacketType_HTTP 
PacketType_EMAIL 
PacketType_Peer_to_Peer 
PacketType_Erlang_Call 
PacketType_Emulation 
PacketType_Sensing 
PacketType_BSM 
PacketType_COAP 
PacketType_Control 

Definition at line 50 of file Packet.h.

◆ enum_Segment

Enumerator
Segment_FirstSegment 
Segment_ContinuingFragment 
Segment_LastFragment 
Segment_Unfragment 

Definition at line 110 of file Packet.h.

◆ enum_ServiceType

Enumerator
ServiceType_NULL 
ServiceType_CBR 
ServiceType_VBR 

Definition at line 69 of file Packet.h.

◆ enum_SuppressionModel

Enumerator
SuppModel_NULL 
SuppModel_Deterministics 
SuppModel_MarkovChain 

Definition at line 30 of file Packet.h.

◆ IP_PROTOCOL_NUMBER

Enumerator
IPPROTOCOL_NULL 
IPPROTOCOL_ICMP 
IPPROTOCOL_IGMP 
IPPROTOCOL_TCP 
IPPROTOCOL_UDP 
IPPROTOCOL_DSR 
IPPROTOCOL_OSPF 
IPPROTOCOL_PIM 

Definition at line 124 of file Packet.h.

Function Documentation

◆ add_dest_to_packet()

void add_dest_to_packet ( NetSim_PACKET packet,
NETSIM_ID  dest 
)
Here is the caller graph for this function:

◆ add_destlist_to_packet()

void add_destlist_to_packet ( NetSim_PACKET packet,
NETSIM_ID destlist,
UINT  count 
)
Here is the caller graph for this function:

◆ fn_NetSim_Config_GetControlPacketType()

char * fn_NetSim_Config_GetControlPacketType ( const NetSim_PACKET ,
char *  type 
)
Here is the caller graph for this function:

◆ fn_NetSim_Config_GetPacketTypeAsString()

char * fn_NetSim_Config_GetPacketTypeAsString ( PACKET_TYPE  nPacketType)

◆ fn_NetSim_Dispatch_to_emulator()

int fn_NetSim_Dispatch_to_emulator ( NetSim_PACKET packet)
Here is the caller graph for this function:

◆ fn_NetSim_GetBufferStatus()

bool fn_NetSim_GetBufferStatus ( NetSim_BUFFER pstruBuffer)

Used to check whether any packet is there in buffer or not Return true if there is a packet in buffer Return false if there is no packet in buffer

This function is to check whether buffer list has any packet or not

Definition at line 41 of file Scheduling.c.

Here is the caller graph for this function:

◆ fn_NetSim_HWI_Send()

bool fn_NetSim_HWI_Send ( NetSim_PACKET packet)

◆ fn_NetSim_Packet_AddPacketToList_dbg()

int fn_NetSim_Packet_AddPacketToList_dbg ( NetSim_BUFFER pstruBuffer,
NetSim_PACKET pstruPacket,
int  nInsertionType,
int  line,
const char *  file 
)

◆ fn_NetSim_Packet_CopyAppData()

int fn_NetSim_Packet_CopyAppData ( NetSim_PACKET pstruDestPacket,
const NetSim_PACKET pstruSrcPacket,
int  ,
const char *   
)

◆ fn_NetSim_Packet_CopyMacData()

int fn_NetSim_Packet_CopyMacData ( NetSim_PACKET pstruDestPacket,
const NetSim_PACKET pstruSrcPacket,
int  ,
const char *   
)

◆ fn_NetSim_Packet_CopyNWData()

int fn_NetSim_Packet_CopyNWData ( NetSim_PACKET pstruDestPacket,
NetSim_PACKET pstruSrcPacket 
)

◆ fn_NetSim_Packet_CopyPacket_dbg()

NetSim_PACKET * fn_NetSim_Packet_CopyPacket_dbg ( const NetSim_PACKET pstruPacket,
int  line,
const char *  file 
)

◆ fn_NetSim_Packet_CopyPacketList_dbg()

NetSim_PACKET * fn_NetSim_Packet_CopyPacketList_dbg ( const NetSim_PACKET pstruPacket,
int  line,
const char *  file 
)

◆ fn_NetSim_Packet_CopyPhyData()

int fn_NetSim_Packet_CopyPhyData ( NetSim_PACKET pstruDestPacket,
const NetSim_PACKET pstruSrcPacket,
int  ,
const char *   
)

◆ fn_NetSim_Packet_CopyTransportData()

int fn_NetSim_Packet_CopyTransportData ( NetSim_PACKET pstruDestPacket,
const NetSim_PACKET pstruSrcPacket,
int  ,
const char *   
)

◆ fn_NetSim_Packet_CreatePacket_dbg()

NetSim_PACKET * fn_NetSim_Packet_CreatePacket_dbg ( int  nLayer,
int  line,
const char *  file 
)

◆ fn_NetSim_Packet_DecideError()

PACKET_STATUS fn_NetSim_Packet_DecideError ( double  dBER,
long double  dPacketSize 
)
Here is the caller graph for this function:

◆ fn_NetSim_Packet_FreeMacProtocolData()

int fn_NetSim_Packet_FreeMacProtocolData ( NetSim_PACKET pstruPacket)
Here is the caller graph for this function:

◆ fn_NetSim_Packet_FreePacket_dbg()

int fn_NetSim_Packet_FreePacket_dbg ( NetSim_PACKET **  pstruPacket,
int  line,
const char *  file 
)

◆ fn_NetSim_Packet_GetPacketFromBuffer()

NetSim_PACKET * fn_NetSim_Packet_GetPacketFromBuffer ( NetSim_BUFFER pstruBuffer,
int  nFlag 
)

Used to get a packet from list pass nFlag = 1 if want to move buffer pass nFlag = 0 if don't want to move buffer

Here is the caller graph for this function:

◆ fn_NetSim_Stack_FragmentPacket()

int fn_NetSim_Stack_FragmentPacket ( NetSim_PACKET pstruPacket,
int  nMSS 
)
Here is the caller graph for this function:

◆ fn_NetSim_WritePacketTrace_dbg()

int fn_NetSim_WritePacketTrace_dbg ( const NetSim_PACKET pstruPacket,
int  line,
const char *  file 
)

◆ fnGetPacketSize()

double fnGetPacketSize ( NetSim_PACKET pstruData)
Here is the caller graph for this function:

◆ fnValidatePacket()

int fnValidatePacket ( const NetSim_PACKET pstruPacket)
Here is the caller graph for this function:

◆ get_dest_from_packet()

NETSIM_ID * get_dest_from_packet ( NetSim_PACKET packet,
UINT count 
)
Here is the caller graph for this function:

◆ get_first_dest_from_packet()

NETSIM_ID get_first_dest_from_packet ( NetSim_PACKET packet)
Here is the caller graph for this function:

◆ getPacketInfoSize()

unsigned int getPacketInfoSize ( )

◆ isBroadcastPacket()

bool isBroadcastPacket ( NetSim_PACKET packet)
Here is the caller graph for this function:

◆ isDestFoundinPacket()

bool isDestFoundinPacket ( NetSim_PACKET packet,
NETSIM_ID  dest 
)
Here is the caller graph for this function:

◆ isMulticastPacket()

bool isMulticastPacket ( NetSim_PACKET packet)
Here is the caller graph for this function:

◆ remove_dest_from_packet()

void remove_dest_from_packet ( NetSim_PACKET packet,
NETSIM_ID  dest 
)
Here is the caller graph for this function: