]> sjero.net Git - dccpping/blob - checksums.h
Separate out Address detection, packet building, and checksums. Can now send both...
[dccpping] / checksums.h
1 /******************************************************************************
2 Author: Samuel Jero <sj323707@ohio.edu>
3
4 Date: 10/2012
5
6 Description: IPv4 and IPv6 Checksum code
7 ******************************************************************************/
8 #ifndef CHECKUMS_H
9 #define CHECKSUMS_H
10
11 #include <ctype.h>
12 #include <sys/types.h>
13
14 #define IP4_ADDR_LEN    4
15 #define IP6_ADDR_LEN    16
16
17 u_int16_t ipv6_pseudohdr_chksum(unsigned char* buff, int len, unsigned char* dest, unsigned char* src, int type);
18 u_int16_t ipv4_pseudohdr_chksum(unsigned char* buff, int len, unsigned char* dest, unsigned char* src, int type);
19 u_int16_t ipv4_chksum(unsigned char* buff, int len);
20
21
22 #endif