LibXenon
Bare-metal Xbox 360 homebrew library
Loading...
Searching...
No Matches
libxenon
drivers
lwip
netif
ppp
vjbsdhdr.h
Go to the documentation of this file.
1
#ifndef VJBSDHDR_H
2
#define VJBSDHDR_H
3
4
#include "
lwip/tcp.h
"
5
6
/*
7
* Structure of an internet header, naked of options.
8
*
9
* We declare ip_len and ip_off to be short, rather than u_short
10
* pragmatically since otherwise unsigned comparisons can result
11
* against negative integers quite easily, and fail in subtle ways.
12
*/
13
PACK_STRUCT_BEGIN
14
struct
ip
15
{
16
#if defined(NO_CHAR_BITFIELDS)
17
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... */
18
#else
19
#if BYTE_ORDER == LITTLE_ENDIAN
20
unsigned
ip_hl
:4,
/* header length */
21
ip_v
:4;
/* version */
22
#elif BYTE_ORDER == BIG_ENDIAN
23
unsigned
ip_v
:4,
/* version */
24
ip_hl
:4;
/* header length */
25
#else
26
COMPLAIN - NO BYTE ORDER SELECTED!
27
#endif
28
#endif
29
u_char
ip_tos
;
/* type of service */
30
u_short
ip_len
;
/* total length */
31
u_short
ip_id
;
/* identification */
32
u_short
ip_off
;
/* fragment offset field */
33
#define IP_DF 0x4000
/* dont fragment flag */
34
#define IP_MF 0x2000
/* more fragments flag */
35
#define IP_OFFMASK 0x1fff
/* mask for fragmenting bits */
36
u_char
ip_ttl
;
/* time to live */
37
u_char
ip_p
;
/* protocol */
38
u_short
ip_sum
;
/* checksum */
39
struct
in_addr
ip_src,
ip_dst
;
/* source and dest address */
40
};
41
PACK_STRUCT_END
42
43
typedef
u32_t
tcp_seq
;
44
45
/*
46
* TCP header.
47
* Per RFC 793, September, 1981.
48
*/
49
PACK_STRUCT_BEGIN
50
struct
tcphdr
51
{
52
u_short
th_sport
;
/* source port */
53
u_short
th_dport
;
/* destination port */
54
tcp_seq
th_seq
;
/* sequence number */
55
tcp_seq
th_ack
;
/* acknowledgement number */
56
#if defined(NO_CHAR_BITFIELDS)
57
u_char th_x2_off;
58
#else
59
#if BYTE_ORDER == LITTLE_ENDIAN
60
unsigned
th_x2
:4,
/* (unused) */
61
th_off
:4;
/* data offset */
62
#endif
63
#if BYTE_ORDER == BIG_ENDIAN
64
unsigned
th_off
:4,
/* data offset */
65
th_x2
:4;
/* (unused) */
66
#endif
67
#endif
68
u_char
th_flags
;
69
u_short
th_win
;
/* window */
70
u_short
th_sum
;
/* checksum */
71
u_short
th_urp
;
/* urgent pointer */
72
};
73
PACK_STRUCT_END
74
75
#endif
/* VJBSDHDR_H */
PACK_STRUCT_END
#define PACK_STRUCT_END
Definition:
arch.h:64
PACK_STRUCT_BEGIN
#define PACK_STRUCT_BEGIN
Definition:
arch.h:60
u32_t
unsigned int u32_t
Definition:
cc.h:42
in_addr
Definition:
inet.h:44
ip
Definition:
vjbsdhdr.h:15
ip::ip_p
u_char ip_p
Definition:
vjbsdhdr.h:37
ip::ip_v
unsigned ip_v
Definition:
vjbsdhdr.h:21
ip::ip_id
u_short ip_id
Definition:
vjbsdhdr.h:31
ip::ip_hl
unsigned ip_hl
Definition:
vjbsdhdr.h:20
ip::ip_dst
struct in_addr ip_src ip_dst
Definition:
vjbsdhdr.h:39
ip::ip_tos
u_char ip_tos
Definition:
vjbsdhdr.h:29
ip::ip_sum
u_short ip_sum
Definition:
vjbsdhdr.h:38
ip::ip_len
u_short ip_len
Definition:
vjbsdhdr.h:30
ip::ip_ttl
u_char ip_ttl
Definition:
vjbsdhdr.h:36
ip::ip_off
u_short ip_off
Definition:
vjbsdhdr.h:32
tcphdr
Definition:
vjbsdhdr.h:51
tcphdr::th_urp
u_short th_urp
Definition:
vjbsdhdr.h:71
tcphdr::th_x2
unsigned th_x2
Definition:
vjbsdhdr.h:60
tcphdr::th_win
u_short th_win
Definition:
vjbsdhdr.h:69
tcphdr::th_dport
u_short th_dport
Definition:
vjbsdhdr.h:53
tcphdr::th_flags
u_char th_flags
Definition:
vjbsdhdr.h:68
tcphdr::th_sum
u_short th_sum
Definition:
vjbsdhdr.h:70
tcphdr::th_seq
tcp_seq th_seq
Definition:
vjbsdhdr.h:54
tcphdr::th_ack
tcp_seq th_ack
Definition:
vjbsdhdr.h:55
tcphdr::th_off
unsigned th_off
Definition:
vjbsdhdr.h:61
tcphdr::th_sport
u_short th_sport
Definition:
vjbsdhdr.h:52
tcp.h
tcp_seq
PACK_STRUCT_END typedef u32_t tcp_seq
Definition:
vjbsdhdr.h:43
Generated by
1.9.5