|
Defines |
#define | CKSUM_CARRY(x) (x = (x >> 16) + (x & 0xffff), (~(x + (x >> 16)) & 0xffff)) |
Functions |
void | rst_initEth (struct ethhdr *ethhdr, unsigned char *dst, unsigned char *src, unsigned short proto) |
| Initialize an Ethernet header.
|
void | rst_initARPrequest (struct rst_arphdr *arphdr, unsigned char *senderMAC, unsigned int senderIP, unsigned int targetIP) |
| Initialize an ARP request header.
|
void | rst_initARPreply (struct rst_arphdr *arphdr, unsigned char *senderMAC, unsigned int senderIP, unsigned char *targetMAC, unsigned int targetIP) |
| Initialize an ARP reply header.
|
void | rst_initIP (struct iphdr *iphdr, unsigned short totalLen, unsigned char protocol, unsigned int srcAddr, unsigned int dstAddr) |
| Initialize an IP header.
|
void | rst_initICMP (struct icmphdr *icmphdr, unsigned char type) |
| Initialize an ICMP header.
|
void | rst_initTCP (struct tcphdr *tcphdr, unsigned short srcPort, unsigned short dstPort) |
| Initialize a TCP header.
|
void | rst_initUDP (struct udphdr *udphdr, unsigned short srcPort, unsigned short dstPort, unsigned short len) |
| Initialize a UDP header.
|
void | rst_initRbuf (struct rst_buf *rBuf, unsigned char *buf, int bufLen, unsigned int mask) |
| Initialize an rst_buf.
|
int | rst_verifyRbuf (struct rst_buf *rBuf) |
| Check that an rst_buf is safe, in the sense that a call to rst_htonp will not abort.
|
void | rst_htonp (struct rst_buf *rBuf) |
| Do host-to-network byte swapping and checksum calculation.
|
void | rst_ntohp (struct rst_buf *rBuf) |
| Parse an incoming packet and do network-to-host byte swapping.
|
unsigned char * | rst_ethData (struct rst_buf *rBuf) |
| Get the address of the Ethernet header in rBuf.
|
unsigned char * | rst_ipData (struct rst_buf *rBuf) |
| Get the address of the IP header in rBuf.
|
unsigned char * | rst_icmpData (struct rst_buf *rBuf) |
| Get the address of the ICMP header in rBuf.
|
unsigned char * | rst_tcpData (struct rst_buf *rBuf) |
| Get the address of the TCP header in rBuf.
|
unsigned char * | rst_udpData (struct rst_buf *rBuf) |
| Get the address of the UDP header in rBuf.
|
unsigned short | checksumCC (unsigned long sum) |
long | inChecksum (unsigned short *buf, int len) |
unsigned short | rst_getIPchecksum (struct iphdr *ip) |
| Compute an IP checksum.
|
unsigned short | rst_getICMPchecksum (struct icmphdr *icmp, unsigned short icmpLen) |
| Compute an ICMP checksum.
|
unsigned short | rst_getTCPchecksum (struct iphdr *iphdr, struct tcphdr *tcphdr, unsigned short tcpLen) |
| Compute an TCP checksum.
|
unsigned short | rst_getUDPchecksum (struct iphdr *iphdr, struct udphdr *udp, unsigned short udpLen) |
| Compute an UDP checksum.
|