20#define COAP_REQUEST_SIZE 12
21#define COAP_ACK_SIZE 8
23#define COAP_ACT_REQUIRED_DEFAULT TRUE
24#define COAP_MULTICAST_RESPONSE_DEFAULT TRUE
25#define COAP_VARIABLE_RESPONSE_TIME_DEFAULT 5
26#define COAP_PIGGYBACKED_TIME_DEFAULT 2000
27#define COAP_ACK_RESPONSE_TIME_DEFAULT 1000
29#define COAP_ACK_TIMEOUT_DEFAULT 2000
30#define COAP_ACK_RANDOM_FACTOR_DEFAULT 1.5
31#define COAP_MAX_RETRANSMIT_DEFAULT 4
32#define COAP_NSTART_DEFAULT 1
33#define COAP_DEFAULT_LEISURE_DEFAULT 5
34#define COAP_PROBING_RATE_DEFAULT 1
186 fnNetSimError(
"In NETSIM, COAP application can't be configured as multicast.\n"
187 "Stopping application...\n");
242 pCOAPHeaderNew->
MessageID = rand() % 65535;
295 }
while (arrivalTime <= 0.0);
331 if (!strcmp(PacketType,
"COAP_RESPONSE")) {
338 }
while (size <= 0.0);
350 }
while (size <= 0.0);
390 pCOAPOptions =
calloc(1,
sizeof * pCOAPOptions);
394 pCOAPHeader->
Options = pCOAPOptions;
406 pCOAPHeader->
tokenvalue = rand() % 4294967296;
409 pCOAPOptions =
calloc(1,
sizeof * pCOAPOptions);
415 pCOAPHeader->
Options = pCOAPOptions;
NetSim_PACKET * fn_NetSim_Application_GeneratePacket(ptrAPPLICATION_INFO info, double ldArrivalTime, NETSIM_ID nSourceId, UINT destCount, NETSIM_ID *nDestination, unsigned long long int nPacketId, APPLICATION_TYPE nAppType, QUALITY_OF_SERVICE nQOS, unsigned int sourcePort, unsigned int destPort)
int fnCreateSocketBuffer(ptrAPPLICATION_INFO appInfo)
int fnDistribution(DISTRIBUTION nDistributionType, double *fDistOut, unsigned long *uSeed, unsigned long *uSeed1, double *args)
void fnCreatePort(ptrAPPLICATION_INFO info)
#define COAP_REQUEST_SIZE
int fn_NetSim_Application_COAP_Sent_ACK(ptrAPPLICATION_INFO pstruappinfo, NetSim_PACKET *pstruPacket)
COAP_Header * fn_NetSim_Application_COAP_CopyHeader(COAP_Header *src)
int fn_NetSim_Application_COAP_ProcessRequest(ptrAPPLICATION_INFO pstruappinfo, NetSim_PACKET *pstruPacket)
int fn_NetSim_Application_StartCOAPAPP(ptrAPPLICATION_INFO appInfo, double time)
int fn_NetSim_Application_COAP_Genrate_RequestPacket(ptrAPPLICATION_INFO appInfo, NETSIM_ID nSource, NETSIM_ID nDestination, double time, char *PacketType)
COAP_Header * fn_NetSim_Application_COAP_GenrateHeader(APP_COAP_INFO *info)
int fn_NetSim_Application_ConfigureCOAPTraffic(ptrAPPLICATION_INFO appInfo, void *xmlNetSimNode)
int fn_NetSim_Application_COAP_Genrate_Packet(ptrAPPLICATION_INFO pstruappinfo, NETSIM_ID nSourceId, NETSIM_ID nDestinationId, double size, char *PacketType)
int fn_NetSim_Application_COAP_Start(ptrAPPLICATION_INFO appInfo, NetSim_EVENTDETAILS *pstruEventDetails)
void fn_NetSim_Application_COAP_AppIn(ptrAPPLICATION_INFO pstruappinfo, NetSim_PACKET *pstruPacket)
#define fnNetSimError(x,...)
NETSIM_ID get_first_dest_from_packet(NetSim_PACKET *packet)
#define PROTOCOL_APPLICATION
char * fn_NetSim_xmlConfig_GetVal(void *xmlNetSimNode, const char *szName, int flag)
#define getXmlVar(var, name, xmlNode, flag, type, protocol)
#define DEVICE_TYPE(DeviceId)
DISTRIBUTION fn_NetSim_Config_GetDistribution(const char *szDistribution)
EXPORTED struct stru_NetSim_Network * NETWORK
EXPORTED struct stru_NetSim_EventDetails * pstruEventDetails
void * fn_NetSim_xmlGetChildElement(void *xmlNetSimNode, const char *childName, int count)
#define fnpAddEvent(pstruEvent)
Structure to store the COAP application information.
DISTRIBUTION pageIATDistribution
struct stru_NetSim_COAP_data * pCOAPData
DISTRIBUTION pageSizeDistribution
Structure to store application information.
APPLICATION_TYPE nAppType
TRANSMISSION_TYPE nTransmissionType
unsigned long long int nPacketId
unsigned int optionLength
unsigned int Response_tokenValue
unsigned int Request_tokenValue
unsigned int Request_messageID
unsigned int Response_Received
unsigned int RequestACK_Received
unsigned int Request_Received
unsigned int ResponseACK_Received
unsigned int Response_messageID
unsigned long ulSeed[SEED_COUNT]
struct stru_NetSim_Packet * pPacket
netsimDEVICE_TYPE nDeviceType
struct stru_NetSim_Device ** ppstruDeviceList
PACKET_FRAGMENT nPacketFragment
void * Packet_AppProtocol
APPLICATION_LAYER_PROTOCOL nApplicationProtocol
struct stru_NetSim_Packet_AppLayer * pstruAppData
char szPacketType[MAX_PACKET_TYPE_LEN]
unsigned int nControlDataType