00001 #ifndef VJBSDHDR_H
00002 #define VJBSDHDR_H
00003
00004 #include "lwip/tcp.h"
00005
00006
00007
00008
00009
00010
00011
00012
00013 PACK_STRUCT_BEGIN
00014 struct ip
00015 {
00016 #if defined(NO_CHAR_BITFIELDS)
00017 u_char ip_hl_v;
00018 #else
00019 #if BYTE_ORDER == LITTLE_ENDIAN
00020 unsigned ip_hl:4,
00021 ip_v :4;
00022 #elif BYTE_ORDER == BIG_ENDIAN
00023 unsigned ip_v :4,
00024 ip_hl:4;
00025 #else
00026 COMPLAIN - NO BYTE ORDER SELECTED!
00027 #endif
00028 #endif
00029 u_char ip_tos;
00030 u_short ip_len;
00031 u_short ip_id;
00032 u_short ip_off;
00033 #define IP_DF 0x4000
00034 #define IP_MF 0x2000
00035 #define IP_OFFMASK 0x1fff
00036 u_char ip_ttl;
00037 u_char ip_p;
00038 u_short ip_sum;
00039 struct in_addr ip_src,ip_dst;
00040 };
00041 PACK_STRUCT_END
00042
00043 typedef u32_t tcp_seq;
00044
00045
00046
00047
00048
00049 PACK_STRUCT_BEGIN
00050 struct tcphdr
00051 {
00052 u_short th_sport;
00053 u_short th_dport;
00054 tcp_seq th_seq;
00055 tcp_seq th_ack;
00056 #if defined(NO_CHAR_BITFIELDS)
00057 u_char th_x2_off;
00058 #else
00059 #if BYTE_ORDER == LITTLE_ENDIAN
00060 unsigned th_x2 :4,
00061 th_off:4;
00062 #endif
00063 #if BYTE_ORDER == BIG_ENDIAN
00064 unsigned th_off:4,
00065 th_x2 :4;
00066 #endif
00067 #endif
00068 u_char th_flags;
00069 u_short th_win;
00070 u_short th_sum;
00071 u_short th_urp;
00072 };
00073 PACK_STRUCT_END
00074
00075 #endif