1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
use super::uapi_types::*;
#[repr(C)]
pub union in6_un_t {
pub u6_addr8: [u8; 16],
pub u6_addr16: [be16_t; 8],
pub u6_addr32: [be32_t; 4],
}
#[repr(C)]
pub struct in6_addr_t {
pub in6_u: in6_un_t,
}
#[repr(C)]
pub struct sockaddr_in6_t {
pub sin6_family: u16,
pub sin6_port: be16_t,
pub sin6_flowinfo: be32_t,
pub sin6_addr: in6_addr_t,
pub sin6_scope_id: u32,
}
#[repr(C)]
pub struct ipv6_mreq_t {
pub ipv6mr_multiaddr: in6_addr_t,
pub ipv6mr_ifindex: i32,
}
#[repr(C)]
pub struct in6_flowlabel_req_t {
pub flr_dst: in6_addr_t,
pub flr_label: be32_t,
pub flr_action: u8,
pub flr_share: u8,
pub flr_flags: u16,
pub flr_expires: u16,
pub flr_linger: u16,
flr_pad: u32,
}
pub const IPV6_FL_A_GET: i32 = 0;
pub const IPV6_FL_A_PUT: i32 = 1;
pub const IPV6_FL_A_RENEW: i32 = 2;
pub const IPV6_FL_F_CREATE: i32 = 1;
pub const IPV6_FL_F_EXCL: i32 = 2;
pub const IPV6_FL_F_REFLECT: i32 = 4;
pub const IPV6_FL_F_REMOTE: i32 = 8;
pub const IPV6_FL_S_NONE: i32 = 0;
pub const IPV6_FL_S_EXCL: i32 = 1;
pub const IPV6_FL_S_PROCESS: i32 = 2;
pub const IPV6_FL_S_USER: i32 = 3;
pub const IPV6_FL_S_ANY: i32 = 255;
pub const IPV6_FLOWINFO_FLOWLABEL: i32 = 0x000fffff;
pub const IPV6_FLOWINFO_PRIORITY: i32 = 0x0ff00000;
pub const IPV6_PRIORITY_UNCHARACTERIZED: i32 = 0x0000;
pub const IPV6_PRIORITY_FILLER: i32 = 0x0100;
pub const IPV6_PRIORITY_UNATTENDED: i32 = 0x0200;
pub const IPV6_PRIORITY_RESERVED1: i32 = 0x0300;
pub const IPV6_PRIORITY_BULK: i32 = 0x0400;
pub const IPV6_PRIORITY_RESERVED2: i32 = 0x0500;
pub const IPV6_PRIORITY_INTERACTIVE: i32 = 0x0600;
pub const IPV6_PRIORITY_CONTROL: i32 = 0x0700;
pub const IPV6_PRIORITY_8: i32 = 0x0800;
pub const IPV6_PRIORITY_9: i32 = 0x0900;
pub const IPV6_PRIORITY_10: i32 = 0x0a00;
pub const IPV6_PRIORITY_11: i32 = 0x0b00;
pub const IPV6_PRIORITY_12: i32 = 0x0c00;
pub const IPV6_PRIORITY_13: i32 = 0x0d00;
pub const IPV6_PRIORITY_14: i32 = 0x0e00;
pub const IPV6_PRIORITY_15: i32 = 0x0f00;
pub const IPPROTO_HOPOPTS: i32 = 0;
pub const IPPROTO_ROUTING: i32 = 43;
pub const IPPROTO_FRAGMENT: i32 = 44;
pub const IPPROTO_ICMPV6: i32 = 58;
pub const IPPROTO_NONE: i32 = 59;
pub const IPPROTO_DSTOPTS: i32 = 60;
pub const IPPROTO_MH: i32 = 135;
pub const IPV6_TLV_PAD1: i32 = 0;
pub const IPV6_TLV_PADN: i32 = 1;
pub const IPV6_TLV_ROUTERALERT: i32 = 5;
pub const IPV6_TLV_CALIPSO: i32 = 7;
pub const IPV6_TLV_JUMBO: i32 = 194;
pub const IPV6_TLV_HAO: i32 = 201;
pub const IPV6_ADDRFORM: i32 = 1;
pub const IPV6_2292PKTINFO: i32 = 2;
pub const IPV6_2292HOPOPTS: i32 = 3;
pub const IPV6_2292DSTOPTS: i32 = 4;
pub const IPV6_2292RTHDR: i32 = 5;
pub const IPV6_2292PKTOPTIONS: i32 = 6;
pub const IPV6_CHECKSUM: i32 = 7;
pub const IPV6_2292HOPLIMIT: i32 = 8;
pub const IPV6_NEXTHOP: i32 = 9;
pub const IPV6_AUTHHDR: i32 = 10;
pub const IPV6_FLOWINFO: i32 = 11;
pub const IPV6_UNICAST_HOPS: i32 = 16;
pub const IPV6_MULTICAST_IF: i32 = 17;
pub const IPV6_MULTICAST_HOPS: i32 = 18;
pub const IPV6_MULTICAST_LOOP: i32 = 19;
pub const IPV6_ADD_MEMBERSHIP: i32 = 20;
pub const IPV6_DROP_MEMBERSHIP: i32 = 21;
pub const IPV6_ROUTER_ALERT: i32 = 22;
pub const IPV6_MTU_DISCOVER: i32 = 23;
pub const IPV6_MTU: i32 = 24;
pub const IPV6_RECVERR: i32 = 25;
pub const IPV6_V6ONLY: i32 = 26;
pub const IPV6_JOIN_ANYCAST: i32 = 27;
pub const IPV6_LEAVE_ANYCAST: i32 = 28;
pub const IPV6_MULTICAST_ALL: i32 = 29;
pub const IPV6_ROUTER_ALERT_ISOLATE: i32 = 30;
pub const IPV6_PMTUDISC_DONT: i32 = 0;
pub const IPV6_PMTUDISC_WANT: i32 = 1;
pub const IPV6_PMTUDISC_DO: i32 = 2;
pub const IPV6_PMTUDISC_PROBE: i32 = 3;
pub const IPV6_PMTUDISC_INTERFACE: i32 = 4;
pub const IPV6_PMTUDISC_OMIT: i32 = 5;
pub const IPV6_FLOWLABEL_MGR: i32 = 32;
pub const IPV6_FLOWINFO_SEND: i32 = 33;
pub const IPV6_IPSEC_POLICY: i32 = 34;
pub const IPV6_XFRM_POLICY: i32 = 35;
pub const IPV6_HDRINCL: i32 = 36;
pub const IPV6_RECVPKTINFO: i32 = 49;
pub const IPV6_PKTINFO: i32 = 50;
pub const IPV6_RECVHOPLIMIT: i32 = 51;
pub const IPV6_HOPLIMIT: i32 = 52;
pub const IPV6_RECVHOPOPTS: i32 = 53;
pub const IPV6_HOPOPTS: i32 = 54;
pub const IPV6_RTHDRDSTOPTS: i32 = 55;
pub const IPV6_RECVRTHDR: i32 = 56;
pub const IPV6_RTHDR: i32 = 57;
pub const IPV6_RECVDSTOPTS: i32 = 58;
pub const IPV6_DSTOPTS: i32 = 59;
pub const IPV6_RECVPATHMTU: i32 = 60;
pub const IPV6_PATHMTU: i32 = 61;
pub const IPV6_DONTFRAG: i32 = 62;
pub const IPV6_RECVTCLASS: i32 = 66;
pub const IPV6_TCLASS: i32 = 67;
pub const IPV6_AUTOFLOWLABEL: i32 = 70;
pub const IPV6_ADDR_PREFERENCES: i32 = 72;
pub const IPV6_PREFER_SRC_TMP: i32 = 0x0001;
pub const IPV6_PREFER_SRC_PUBLIC: i32 = 0x0002;
pub const IPV6_PREFER_SRC_PUBTMP_DEFAULT: i32 = 0x0100;
pub const IPV6_PREFER_SRC_COA: i32 = 0x0004;
pub const IPV6_PREFER_SRC_HOME: i32 = 0x0400;
pub const IPV6_PREFER_SRC_CGA: i32 = 0x0008;
pub const IPV6_PREFER_SRC_NONCGA: i32 = 0x0800;
pub const IPV6_MINHOPCOUNT: i32 = 73;
pub const IPV6_ORIGDSTADDR: i32 = 74;
pub const IPV6_RECVORIGDSTADDR: i32 = IPV6_ORIGDSTADDR;
pub const IPV6_TRANSPARENT: i32 = 75;
pub const IPV6_UNICAST_IF: i32 = 76;
pub const IPV6_RECVFRAGSIZE: i32 = 77;
pub const IPV6_FREEBIND: i32 = 78;