24 #ifndef _REALWORLDCONNECTOR_H_
25 #define _REALWORLDCONNECTOR_H_
39 inline u_short
cksum(uint16_t *buf,
int nbytes)
41 register unsigned long sum;
52 *((u_char *) &oddbyte) = *(u_char *) buf;
56 sum = (sum >> 16) + (sum & 0xffff);
72 #define BUFFERZITE mtu + 4 // 4 bytes for packet information
89 virtual void transmitToNetwork(cPacket *msg);
90 virtual void updateDisplayString();
101 virtual char* encapsulate(cPacket *msg,
102 unsigned int* length,
104 socklen_t* addrlen) = 0;
115 virtual cPacket *decapsulate(
char* buf,
118 socklen_t addrlen) = 0;
124 virtual bool isApp() {
return false;}
130 virtual int numInitStages()
const
139 virtual void initialize(
int stage);
144 virtual void handleMessage(cMessage *msg);