]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/lwIP_MCF5235_GCC/lwip/src/netif/ppp/vjbsdhdr.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / lwIP_MCF5235_GCC / lwip / src / netif / ppp / vjbsdhdr.h
1 #ifndef VJBSDHDR_H\r
2 #define VJBSDHDR_H\r
3 \r
4 #include "lwip/tcp.h"\r
5 \r
6 \r
7 /*\r
8  * Structure of an internet header, naked of options.\r
9  *\r
10  * We declare ip_len and ip_off to be short, rather than u_short\r
11  * pragmatically since otherwise unsigned comparisons can result\r
12  * against negative integers quite easily, and fail in subtle ways.\r
13  */\r
14 PACK_STRUCT_BEGIN\r
15 struct ip\r
16 {\r
17 #if defined(NO_CHAR_BITFIELDS)\r
18         u_char ip_hl_v; /* bug in GCC for mips means the bitfield stuff will sometimes break - so we use a char for both and get round it with macro's instead... */\r
19 #else\r
20 #if BYTE_ORDER == LITTLE_ENDIAN\r
21         unsigned ip_hl:4,                               /* header length */\r
22                 ip_v:4;                                         /* version */\r
23 #elif BYTE_ORDER == BIG_ENDIAN \r
24         unsigned ip_v:4,                                        /* version */\r
25                 ip_hl:4;                                        /* header length */\r
26 #else\r
27         COMPLAIN - NO BYTE ORDER SELECTED!\r
28 #endif\r
29 #endif\r
30         u_char  ip_tos;                                 /* type of service */\r
31         u_short ip_len;                                 /* total length */\r
32         u_short ip_id;                                  /* identification */\r
33         u_short ip_off;                                 /* fragment offset field */\r
34 #define IP_DF 0x4000                            /* dont fragment flag */\r
35 #define IP_MF 0x2000                            /* more fragments flag */\r
36 #define IP_OFFMASK 0x1fff                       /* mask for fragmenting bits */\r
37         u_char  ip_ttl;                                 /* time to live */\r
38         u_char  ip_p;                                   /* protocol */\r
39         u_short ip_sum;                                 /* checksum */\r
40         struct  in_addr ip_src,ip_dst;  /* source and dest address */\r
41 };\r
42 PACK_STRUCT_END\r
43 \r
44 typedef u32_t tcp_seq;\r
45 \r
46 /*\r
47  * TCP header.\r
48  * Per RFC 793, September, 1981.\r
49  */\r
50 PACK_STRUCT_BEGIN\r
51 struct tcphdr  \r
52 {\r
53         u_short th_sport;               /* source port */\r
54         u_short th_dport;               /* destination port */\r
55         tcp_seq th_seq;                 /* sequence number */\r
56         tcp_seq th_ack;                 /* acknowledgement number */\r
57 #if defined(NO_CHAR_BITFIELDS)\r
58         u_char th_x2_off;\r
59 #else\r
60 #if BYTE_ORDER == LITTLE_ENDIAN\r
61         unsigned        th_x2:4,                /* (unused) */\r
62                         th_off:4;               /* data offset */\r
63 #endif\r
64 #if BYTE_ORDER == BIG_ENDIAN \r
65         unsigned        th_off:4,               /* data offset */\r
66                         th_x2:4;                /* (unused) */\r
67 #endif\r
68 #endif\r
69         u_char  th_flags;\r
70         u_short th_win;                 /* window */\r
71         u_short th_sum;                 /* checksum */\r
72         u_short th_urp;                 /* urgent pointer */\r
73 };\r
74 PACK_STRUCT_END\r
75 \r
76 #endif /* VJBSDHDR_H */\r