5 #include <sys/socket.h>
7 #include <netinet/in.h>
12 // 14 (ethernet frame) + 20 bytes
16 unsigned char ethernettype[2]; // indicates layer 3 protocol type
21 unsigned char junk[9];
22 unsigned char protocol[1];
23 unsigned char checksum[2];
26 // for getting the address information both in binary format and long format
32 unsigned char dest[4];
38 // this is used to extract the IP address from the IP header in conventional form
40 unsigned char a1,a2,a3,a4;
44 void do_binary_to_string(unsigned char* ip,char* buffer);
45 void do_ipaddress_to_string(IPADDRESS ipaddress,char* buffer);
46 void do_binary_to_ipaddress(unsigned char* ip,IPADDRESS& ipaddress);
47 //char* return_ip_protocol(unsigned char protocol);