VSF Documented
Main Page
Related Pages
Topics
Namespaces
Data Structures
Files
File List
Globals
source
shell
sys
linux
include
netinet
ip.h
Go to the documentation of this file.
1
#ifndef __VSF_LINUX_NETINET_IP_H__
2
#define __VSF_LINUX_NETINET_IP_H__
3
4
#include "
shell/sys/linux/vsf_linux_cfg.h
"
5
6
#if VSF_LINUX_CFG_RELATIVE_PATH == ENABLED
7
# include "../sys/types.h"
8
# include "
./in.h
"
9
#else
10
# include <
sys/types.h
>
11
# include <
netinet/in.h
>
12
#endif
13
// for byte order in arch
14
#include "
hal/arch/vsf_arch.h
"
15
// for stdint.h
16
#include "
utilities/vsf_utilities.h
"
17
18
#ifdef __cplusplus
19
extern
"C"
{
20
#endif
21
22
struct
timestamp
{
23
uint8_t
len
;
24
uint8_t
ptr
;
25
#if __BYTE_ORDER == __LITTLE_ENDIAN
26
unsigned
int
flags
: 4;
27
unsigned
int
overflow
: 4;
28
#else
29
unsigned
int
overflow
: 4;
30
unsigned
int
flags
: 4;
31
#endif
32
uint32_t
data
[9];
33
};
34
35
struct
iphdr
{
36
#if __BYTE_ORDER == __LITTLE_ENDIAN
37
unsigned
int
ihl
: 4;
38
unsigned
int
version
: 4;
39
#else
40
unsigned
int
version
: 4;
41
unsigned
int
ihl
: 4;
42
#endif
43
uint8_t
tos
;
44
uint16_t
tot_len
;
45
uint16_t
id
;
46
uint16_t
frag_off
;
47
uint8_t
ttl
;
48
uint8_t
procotol
;
49
uint16_t
check
;
50
uint32_t
saddr
;
51
uint32_t
daddr
;
52
};
53
54
struct
ip
{
55
#if __BYTE_ORDER == __LITTLE_ENDIAN
56
unsigned
int
ip_hl
: 4;
57
unsigned
int
ip_v
: 4;
58
#else
59
unsigned
int
ip_v
: 4;
60
unsigned
int
ip_hl
: 4;
61
#endif
62
uint8_t
ip_tos
;
63
uint16_t
ip_len
;
64
uint16_t
ip_id
;
65
uint16_t
ip_off
;
66
#define IP_RF 0x8000
67
#define IP_DF 0x4000
68
#define IP_MF 0x2000
69
#define IP_OFFMASK 0x1FFF
70
uint8_t
ip_ttl
;
71
uint8_t
ip_p
;
72
uint16_t
ip_sum
;
73
struct
in_addr
ip_src,
ip_dst
;
74
};
75
76
struct
ip_timestamp
{
77
uint8_t
ipt_code
;
78
uint8_t
ipt_len
;
79
uint8_t
ipt_ptr
;
80
#if __BYTE_ORDER == __LITTLE_ENDIAN
81
unsigned
int
ipt_flg
: 4;
82
unsigned
int
ipt_oflw
: 4;
83
#else
84
unsigned
int
ipt_oflw
: 4;
85
unsigned
int
ipt_flg
: 4;
86
#endif
87
uint32_t
data
[9];
88
};
89
90
#define IPVERSION 4
91
#define IP_MAXPACKET 65535
92
93
#define IPTOS_ECN_MASK 0x03
94
#define IPTOS_ECN(__X) ((__X) & IPTOS_ECN_MASK)
95
#define IPTOS_ECN_NOT_ECT 0x00
96
#define IPTOS_ECN_ECT1 0x01
97
#define IPTOS_ECN_ECT0 0x02
98
#define IPTOS_ECN_CE 0x03
99
100
#define IPTOS_DSCP_MASK 0xfc
101
#define IPTOS_DSCP(__X) ((__X) & IPTOS_DSCP_MASK)
102
#define IPTOS_DSCP_AF11 0x28
103
#define IPTOS_DSCP_AF12 0x30
104
#define IPTOS_DSCP_AF13 0x38
105
#define IPTOS_DSCP_AF21 0x48
106
#define IPTOS_DSCP_AF22 0x50
107
#define IPTOS_DSCP_AF23 0x58
108
#define IPTOS_DSCP_AF31 0x68
109
#define IPTOS_DSCP_AF32 0x70
110
#define IPTOS_DSCP_AF33 0x78
111
#define IPTOS_DSCP_AF41 0x88
112
#define IPTOS_DSCP_AF42 0x90
113
#define IPTOS_DSCP_AF43 0x98
114
#define IPTOS_DSCP_EF 0xb8
115
116
#define IPTOS_TOS_MASK 0x1E
117
#define IPTOS_TOS(__TOS) ((__TOS) & IPTOS_TOS_MASK)
118
#define IPTOS_LOWDELAY 0x10
119
#define IPTOS_THROUGHPUT 0x08
120
#define IPTOS_RELIABILITY 0x04
121
#define IPTOS_MINCOST 0x02
122
123
#define IPTOS_PREC_MASK 0xe0
124
#define IPTOS_PREC(__TOS) ((__TOS) & IPTOS_PREC_MASK)
125
#define IPTOS_PREC_NETCONTROL 0xe0
126
#define IPTOS_PREC_INTERNETCONTROL 0xc0
127
#define IPTOS_PREC_CRITIC_ECP 0xa0
128
#define IPTOS_PREC_FLASHOVERRIDE 0x80
129
#define IPTOS_PREC_FLASH 0x60
130
#define IPTOS_PREC_IMMEDIATE 0x40
131
#define IPTOS_PREC_PRIORITY 0x20
132
#define IPTOS_PREC_ROUTINE 0x00
133
134
#define IPOPT_COPY 0x80
135
#define IPOPT_CLASS_MASK 0x60
136
#define IPOPT_NUMBER_MASK 0x1F
137
138
#define IPOPT_COPIED(__O) ((__O) & IPOPT_COPY)
139
#define IPOPT_CLASS(__O) ((__O) & IPOPT_CLASS_MASK)
140
#define IPOPT_NUMBER(__O) ((__O) & IPOPT_NUMBER_MASK)
141
142
#define IPOPT_CONTROL 0x00
143
#define IPOPT_RESERVED1 0x20
144
#define IPOPT_DEBMEAS 0x40
145
#define IPOPT_MEASUREMENT IPOPT_DEBMEAS
146
#define IPOPT_RESERVED2 0x60
147
148
#define IPOPT_EOL 0
149
#define IPOPT_END IPOPT_EOL
150
#define IPOPT_NOP 1
151
#define IPOPT_NOOP IPOPT_NOP
152
153
#define IPOPT_RR 7
154
#define IPOPT_TS 68
155
#define IPOPT_TIMESTAMP IPOPT_TS
156
#define IPOPT_SECURITY 130
157
#define IPOPT_SEC IPOPT_SECURITY
158
#define IPOPT_LSRR 131
159
#define IPOPT_SATID 136
160
#define IPOPT_SID IPOPT_SATID
161
#define IPOPT_SSRR 137
162
#define IPOPT_RA 148
163
164
#define IPOPT_OPTVAL 0
165
#define IPOPT_OLEN 1
166
#define IPOPT_OFFSET 2
167
#define IPOPT_MINOFF 4
168
169
#define MAX_IPOPTLEN 40
170
171
#define IPOPT_TS_TSONLY 0
172
#define IPOPT_TS_TSANDADDR 1
173
#define IPOPT_TS_PRESPEC 3
174
175
#define IPOPT_SECUR_UNCLASS 0x0000
176
#define IPOPT_SECUR_CONFID 0xf135
177
#define IPOPT_SECUR_EFTO 0x789a
178
#define IPOPT_SECUR_MMMM 0xbc4d
179
#define IPOPT_SECUR_RESTR 0xaf13
180
#define IPOPT_SECUR_SECRET 0xd788
181
#define IPOPT_SECUR_TOPSECRET 0x6bc5
182
183
#define MAXTTL 255
184
#define IPDEFTTL 64
185
#define IPFRAGTTL 60
186
#define IPTTLDEC 1
187
188
#define IP_MSS 576
189
190
#ifdef __cplusplus
191
}
192
#endif
193
194
#endif
in.h
types.h
uint16_t
unsigned short uint16_t
Definition
lvgl.h:41
uint32_t
unsigned int uint32_t
Definition
lvgl.h:43
uint8_t
unsigned char uint8_t
Definition
lvgl.h:40
in_addr
Definition
in.h:115
ip_timestamp
Definition
ip.h:76
ip_timestamp::ipt_flg
unsigned int ipt_flg
Definition
ip.h:81
ip_timestamp::ipt_len
uint8_t ipt_len
Definition
ip.h:78
ip_timestamp::ipt_oflw
unsigned int ipt_oflw
Definition
ip.h:82
ip_timestamp::data
uint32_t data[9]
Definition
ip.h:87
ip_timestamp::ipt_ptr
uint8_t ipt_ptr
Definition
ip.h:79
ip_timestamp::ipt_code
uint8_t ipt_code
Definition
ip.h:77
ip
Definition
ip.h:54
ip::ip_id
uint16_t ip_id
Definition
ip.h:64
ip::ip_len
uint16_t ip_len
Definition
ip.h:63
ip::ip_sum
uint16_t ip_sum
Definition
ip.h:72
ip::ip_off
uint16_t ip_off
Definition
ip.h:65
ip::ip_dst
struct in_addr ip_src ip_dst
Definition
ip.h:73
ip::ip_ttl
uint8_t ip_ttl
Definition
ip.h:70
ip::ip_tos
uint8_t ip_tos
Definition
ip.h:62
ip::ip_v
unsigned int ip_v
Definition
ip.h:57
ip::ip_hl
unsigned int ip_hl
Definition
ip.h:56
ip::ip_p
uint8_t ip_p
Definition
ip.h:71
iphdr
Definition
ip.h:35
iphdr::frag_off
uint16_t frag_off
Definition
ip.h:46
iphdr::saddr
uint32_t saddr
Definition
ip.h:50
iphdr::tos
uint8_t tos
Definition
ip.h:43
iphdr::tot_len
uint16_t tot_len
Definition
ip.h:44
iphdr::check
uint16_t check
Definition
ip.h:49
iphdr::daddr
uint32_t daddr
Definition
ip.h:51
iphdr::ihl
unsigned int ihl
Definition
ip.h:37
iphdr::ttl
uint8_t ttl
Definition
ip.h:47
iphdr::id
uint16_t id
Definition
ip.h:45
iphdr::procotol
uint8_t procotol
Definition
ip.h:48
iphdr::version
unsigned int version
Definition
ip.h:38
timestamp
Definition
ip.h:22
timestamp::ptr
uint8_t ptr
Definition
ip.h:24
timestamp::overflow
unsigned int overflow
Definition
ip.h:27
timestamp::flags
unsigned int flags
Definition
ip.h:26
timestamp::data
uint32_t data[9]
Definition
ip.h:32
timestamp::len
uint8_t len
Definition
ip.h:23
vsf_arch.h
vsf_linux_cfg.h
vsf_utilities.h
Generated by
1.9.8