#include <omnetpp.h>
#include "INETDefs.h"
#include "realtimescheduler.h"
#include "PacketParser.h"
Go to the source code of this file.
Classes | |
class | RealworldConnector |
RealworldConnector is a pseudo interface that allows communcation with the real world through the TunOutScheduler. More... | |
Defines | |
#define | BUFFERZITE mtu + 4 |
Functions | |
u_short | cksum (uint16_t *buf, int nbytes) |
helper funcition needed for computing checksums |
Definition in file RealworldConnector.h.
#define BUFFERZITE mtu + 4 |
Definition at line 72 of file RealworldConnector.h.
u_short cksum | ( | uint16_t * | buf, | |
int | nbytes | |||
) | [inline] |
helper funcition needed for computing checksums
buf | The buffer containing the data to be checksummed | |
nbytes | The length of the buffer in bytes |
Definition at line 39 of file RealworldConnector.h.
{ register unsigned long sum; u_short oddbyte; sum = 0; while (nbytes > 1) { sum += *buf++; nbytes -= 2; } if (nbytes == 1) { oddbyte = 0; *((u_char *) &oddbyte) = *(u_char *) buf; sum += oddbyte; } sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); return ~sum; }