|
8 | 8 | // |
9 | 9 | typedef struct ip_hdr |
10 | 10 | { |
11 | | - unsigned char version; // 4-bit IPv4 version |
| 11 | + unsigned char ip_v; // 4-bit IPv4 version |
12 | 12 | // 4-bit header length (in 32-bit words) |
13 | 13 | unsigned char ip_tos; // IP type of service |
14 | | - unsigned short tot_len; // Total length |
15 | | - unsigned short id; // Unique identifier |
16 | | - unsigned short ihl; // Fragment offset field |
17 | | - unsigned char ttl; // Time to live |
18 | | - unsigned char protocol; // Protocol(TCP,UDP etc) |
19 | | - unsigned short check; // IP checksum |
20 | | - unsigned int saddr; // Source address |
21 | | - unsigned int daddr; // Source address |
| 14 | + unsigned short ip_len; // Total length |
| 15 | + unsigned short ip_id; // Unique identifier |
| 16 | + unsigned short ip_hl; // Fragment offset field |
| 17 | + unsigned char ip_ttl; // Time to live |
| 18 | + unsigned char ip_p; // Protocol(TCP,UDP etc) |
| 19 | + unsigned short ip_sum; // IP checksum |
| 20 | + unsigned int ip_src; // Source address |
| 21 | + unsigned int ip_dst; // Source address |
22 | 22 | } IPV4_HDR, * PIPV4_HDR, FAR* LPIPV4_HDR, iphdr; |
23 | 23 |
|
24 | 24 | // |
@@ -52,10 +52,10 @@ typedef struct ipv6_fragment_hdr |
52 | 52 | // |
53 | 53 | typedef struct udp_hdr |
54 | 54 | { |
55 | | - unsigned short source; // Source port no. |
56 | | - unsigned short dest; // Dest. port no. |
57 | | - unsigned short len; // Udp packet length |
58 | | - unsigned short check; // Udp checksum |
| 55 | + unsigned short uh_sport; // Source port no. |
| 56 | + unsigned short uh_dport; // Dest. port no. |
| 57 | + unsigned short uh_ulen; // Udp packet length |
| 58 | + unsigned short uh_sum; // Udp checksum |
59 | 59 | } UDP_HDR, * PUDP_HDR, udphdr; |
60 | 60 |
|
61 | 61 | // |
|
0 commit comments