]>
Commit | Line | Data |
---|---|---|
910773dc SH |
1 | #ifndef __LINUX_RTNETLINK_H |
2 | #define __LINUX_RTNETLINK_H | |
0633baa1 | 3 | |
67881151 | 4 | #include <linux/types.h> |
0633baa1 | 5 | #include <linux/netlink.h> |
ead2ba70 | 6 | #include <linux/if_link.h> |
5a8ba228 SH |
7 | #include <linux/if_addr.h> |
8 | #include <linux/neighbour.h> | |
0633baa1 | 9 | |
b4397f58 SH |
10 | /* rtnetlink families. Values up to 127 are reserved for real address |
11 | * families, values above 128 may be used arbitrarily. | |
12 | */ | |
13 | #define RTNL_FAMILY_IPMR 128 | |
14 | #define RTNL_FAMILY_IP6MR 129 | |
15 | #define RTNL_FAMILY_MAX 129 | |
16 | ||
0633baa1 SH |
17 | /**** |
18 | * Routing/neighbour discovery messages. | |
19 | ****/ | |
20 | ||
21 | /* Types of messages */ | |
22 | ||
091ed219 SH |
23 | enum { |
24 | RTM_BASE = 16, | |
25 | #define RTM_BASE RTM_BASE | |
26 | ||
27 | RTM_NEWLINK = 16, | |
28 | #define RTM_NEWLINK RTM_NEWLINK | |
29 | RTM_DELLINK, | |
30 | #define RTM_DELLINK RTM_DELLINK | |
31 | RTM_GETLINK, | |
32 | #define RTM_GETLINK RTM_GETLINK | |
33 | RTM_SETLINK, | |
34 | #define RTM_SETLINK RTM_SETLINK | |
35 | ||
36 | RTM_NEWADDR = 20, | |
37 | #define RTM_NEWADDR RTM_NEWADDR | |
38 | RTM_DELADDR, | |
39 | #define RTM_DELADDR RTM_DELADDR | |
40 | RTM_GETADDR, | |
41 | #define RTM_GETADDR RTM_GETADDR | |
42 | ||
43 | RTM_NEWROUTE = 24, | |
44 | #define RTM_NEWROUTE RTM_NEWROUTE | |
45 | RTM_DELROUTE, | |
46 | #define RTM_DELROUTE RTM_DELROUTE | |
47 | RTM_GETROUTE, | |
48 | #define RTM_GETROUTE RTM_GETROUTE | |
49 | ||
50 | RTM_NEWNEIGH = 28, | |
51 | #define RTM_NEWNEIGH RTM_NEWNEIGH | |
52 | RTM_DELNEIGH, | |
53 | #define RTM_DELNEIGH RTM_DELNEIGH | |
54 | RTM_GETNEIGH, | |
55 | #define RTM_GETNEIGH RTM_GETNEIGH | |
56 | ||
57 | RTM_NEWRULE = 32, | |
58 | #define RTM_NEWRULE RTM_NEWRULE | |
59 | RTM_DELRULE, | |
60 | #define RTM_DELRULE RTM_DELRULE | |
61 | RTM_GETRULE, | |
62 | #define RTM_GETRULE RTM_GETRULE | |
63 | ||
64 | RTM_NEWQDISC = 36, | |
65 | #define RTM_NEWQDISC RTM_NEWQDISC | |
66 | RTM_DELQDISC, | |
67 | #define RTM_DELQDISC RTM_DELQDISC | |
68 | RTM_GETQDISC, | |
69 | #define RTM_GETQDISC RTM_GETQDISC | |
70 | ||
71 | RTM_NEWTCLASS = 40, | |
72 | #define RTM_NEWTCLASS RTM_NEWTCLASS | |
73 | RTM_DELTCLASS, | |
74 | #define RTM_DELTCLASS RTM_DELTCLASS | |
75 | RTM_GETTCLASS, | |
76 | #define RTM_GETTCLASS RTM_GETTCLASS | |
77 | ||
78 | RTM_NEWTFILTER = 44, | |
79 | #define RTM_NEWTFILTER RTM_NEWTFILTER | |
80 | RTM_DELTFILTER, | |
81 | #define RTM_DELTFILTER RTM_DELTFILTER | |
82 | RTM_GETTFILTER, | |
83 | #define RTM_GETTFILTER RTM_GETTFILTER | |
84 | ||
85 | RTM_NEWACTION = 48, | |
86 | #define RTM_NEWACTION RTM_NEWACTION | |
87 | RTM_DELACTION, | |
88 | #define RTM_DELACTION RTM_DELACTION | |
89 | RTM_GETACTION, | |
90 | #define RTM_GETACTION RTM_GETACTION | |
91 | ||
92 | RTM_NEWPREFIX = 52, | |
93 | #define RTM_NEWPREFIX RTM_NEWPREFIX | |
091ed219 SH |
94 | |
95 | RTM_GETMULTICAST = 58, | |
96 | #define RTM_GETMULTICAST RTM_GETMULTICAST | |
97 | ||
98 | RTM_GETANYCAST = 62, | |
99 | #define RTM_GETANYCAST RTM_GETANYCAST | |
100 | ||
ea8fc104 SH |
101 | RTM_NEWNEIGHTBL = 64, |
102 | #define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL | |
103 | RTM_GETNEIGHTBL = 66, | |
104 | #define RTM_GETNEIGHTBL RTM_GETNEIGHTBL | |
105 | RTM_SETNEIGHTBL, | |
106 | #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL | |
107 | ||
5472ac6f SH |
108 | RTM_NEWNDUSEROPT = 68, |
109 | #define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT | |
110 | ||
70e6e38a SH |
111 | RTM_NEWADDRLABEL = 72, |
112 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL | |
113 | RTM_DELADDRLABEL, | |
8007bfb5 | 114 | #define RTM_DELADDRLABEL RTM_DELADDRLABEL |
70e6e38a SH |
115 | RTM_GETADDRLABEL, |
116 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL | |
117 | ||
67881151 SH |
118 | RTM_GETDCB = 78, |
119 | #define RTM_GETDCB RTM_GETDCB | |
120 | RTM_SETDCB, | |
121 | #define RTM_SETDCB RTM_SETDCB | |
122 | ||
910773dc SH |
123 | RTM_NEWNETCONF = 80, |
124 | #define RTM_NEWNETCONF RTM_NEWNETCONF | |
125 | RTM_GETNETCONF = 82, | |
126 | #define RTM_GETNETCONF RTM_GETNETCONF | |
127 | ||
9dca6767 CW |
128 | RTM_NEWMDB = 84, |
129 | #define RTM_NEWMDB RTM_NEWMDB | |
130 | RTM_DELMDB = 85, | |
131 | #define RTM_DELMDB RTM_DELMDB | |
910773dc SH |
132 | RTM_GETMDB = 86, |
133 | #define RTM_GETMDB RTM_GETMDB | |
134 | ||
ea8fc104 SH |
135 | __RTM_MAX, |
136 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | |
091ed219 | 137 | }; |
0633baa1 | 138 | |
ea8fc104 SH |
139 | #define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE) |
140 | #define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2) | |
141 | #define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2) | |
142 | ||
0633baa1 SH |
143 | /* |
144 | Generic structure for encapsulation of optional route information. | |
145 | It is reminiscent of sockaddr, but with sa_family replaced | |
146 | with attribute type. | |
147 | */ | |
148 | ||
ab322673 | 149 | struct rtattr { |
0633baa1 SH |
150 | unsigned short rta_len; |
151 | unsigned short rta_type; | |
152 | }; | |
153 | ||
154 | /* Macros to handle rtattributes */ | |
155 | ||
156 | #define RTA_ALIGNTO 4 | |
157 | #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) ) | |
158 | #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && \ | |
159 | (rta)->rta_len >= sizeof(struct rtattr) && \ | |
160 | (rta)->rta_len <= (len)) | |
161 | #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), \ | |
162 | (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len))) | |
163 | #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len)) | |
164 | #define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len)) | |
165 | #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0))) | |
166 | #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0)) | |
167 | ||
168 | ||
169 | ||
170 | ||
171 | /****************************************************************************** | |
172 | * Definitions used in routing table administration. | |
173 | ****/ | |
174 | ||
ab322673 | 175 | struct rtmsg { |
0633baa1 SH |
176 | unsigned char rtm_family; |
177 | unsigned char rtm_dst_len; | |
178 | unsigned char rtm_src_len; | |
179 | unsigned char rtm_tos; | |
180 | ||
181 | unsigned char rtm_table; /* Routing table id */ | |
182 | unsigned char rtm_protocol; /* Routing protocol; see below */ | |
183 | unsigned char rtm_scope; /* See below */ | |
184 | unsigned char rtm_type; /* See below */ | |
185 | ||
186 | unsigned rtm_flags; | |
187 | }; | |
188 | ||
189 | /* rtm_type */ | |
190 | ||
ab322673 | 191 | enum { |
0633baa1 SH |
192 | RTN_UNSPEC, |
193 | RTN_UNICAST, /* Gateway or direct route */ | |
194 | RTN_LOCAL, /* Accept locally */ | |
195 | RTN_BROADCAST, /* Accept locally as broadcast, | |
196 | send as broadcast */ | |
197 | RTN_ANYCAST, /* Accept locally as broadcast, | |
198 | but send as unicast */ | |
199 | RTN_MULTICAST, /* Multicast route */ | |
200 | RTN_BLACKHOLE, /* Drop */ | |
201 | RTN_UNREACHABLE, /* Destination is unreachable */ | |
202 | RTN_PROHIBIT, /* Administratively prohibited */ | |
203 | RTN_THROW, /* Not in this table */ | |
204 | RTN_NAT, /* Translate this address */ | |
205 | RTN_XRESOLVE, /* Use external resolver */ | |
206 | __RTN_MAX | |
207 | }; | |
208 | ||
209 | #define RTN_MAX (__RTN_MAX - 1) | |
210 | ||
211 | ||
212 | /* rtm_protocol */ | |
213 | ||
214 | #define RTPROT_UNSPEC 0 | |
215 | #define RTPROT_REDIRECT 1 /* Route installed by ICMP redirects; | |
216 | not used by current IPv4 */ | |
217 | #define RTPROT_KERNEL 2 /* Route installed by kernel */ | |
218 | #define RTPROT_BOOT 3 /* Route installed during boot */ | |
219 | #define RTPROT_STATIC 4 /* Route installed by administrator */ | |
220 | ||
221 | /* Values of protocol >= RTPROT_STATIC are not interpreted by kernel; | |
222 | they are just passed from user and back as is. | |
223 | It will be used by hypothetical multiple routing daemons. | |
224 | Note that protocol values should be standardized in order to | |
225 | avoid conflicts. | |
226 | */ | |
227 | ||
228 | #define RTPROT_GATED 8 /* Apparently, GateD */ | |
229 | #define RTPROT_RA 9 /* RDISC/ND router advertisements */ | |
230 | #define RTPROT_MRT 10 /* Merit MRT */ | |
231 | #define RTPROT_ZEBRA 11 /* Zebra */ | |
232 | #define RTPROT_BIRD 12 /* BIRD */ | |
233 | #define RTPROT_DNROUTED 13 /* DECnet routing daemon */ | |
234 | #define RTPROT_XORP 14 /* XORP */ | |
40b6c62c | 235 | #define RTPROT_NTK 15 /* Netsukuku */ |
67881151 | 236 | #define RTPROT_DHCP 16 /* DHCP client */ |
910773dc | 237 | #define RTPROT_MROUTED 17 /* Multicast daemon */ |
0633baa1 SH |
238 | |
239 | /* rtm_scope | |
240 | ||
241 | Really it is not scope, but sort of distance to the destination. | |
242 | NOWHERE are reserved for not existing destinations, HOST is our | |
243 | local addresses, LINK are destinations, located on directly attached | |
244 | link and UNIVERSE is everywhere in the Universe. | |
245 | ||
246 | Intermediate values are also possible f.e. interior routes | |
247 | could be assigned a value between UNIVERSE and LINK. | |
248 | */ | |
249 | ||
ab322673 | 250 | enum rt_scope_t { |
0633baa1 SH |
251 | RT_SCOPE_UNIVERSE=0, |
252 | /* User defined values */ | |
253 | RT_SCOPE_SITE=200, | |
254 | RT_SCOPE_LINK=253, | |
255 | RT_SCOPE_HOST=254, | |
256 | RT_SCOPE_NOWHERE=255 | |
257 | }; | |
258 | ||
259 | /* rtm_flags */ | |
260 | ||
261 | #define RTM_F_NOTIFY 0x100 /* Notify user of route change */ | |
262 | #define RTM_F_CLONED 0x200 /* This route is cloned */ | |
263 | #define RTM_F_EQUALIZE 0x400 /* Multipath equalizer: NI */ | |
264 | #define RTM_F_PREFIX 0x800 /* Prefix addresses */ | |
265 | ||
266 | /* Reserved table identifiers */ | |
267 | ||
ab322673 | 268 | enum rt_class_t { |
0633baa1 SH |
269 | RT_TABLE_UNSPEC=0, |
270 | /* User defined values */ | |
3ea2fb98 | 271 | RT_TABLE_COMPAT=252, |
0633baa1 SH |
272 | RT_TABLE_DEFAULT=253, |
273 | RT_TABLE_MAIN=254, | |
274 | RT_TABLE_LOCAL=255, | |
ead2ba70 | 275 | RT_TABLE_MAX=0xFFFFFFFF |
0633baa1 | 276 | }; |
0633baa1 SH |
277 | |
278 | ||
279 | /* Routing message attributes */ | |
280 | ||
ab322673 | 281 | enum rtattr_type_t { |
0633baa1 SH |
282 | RTA_UNSPEC, |
283 | RTA_DST, | |
284 | RTA_SRC, | |
285 | RTA_IIF, | |
286 | RTA_OIF, | |
287 | RTA_GATEWAY, | |
288 | RTA_PRIORITY, | |
289 | RTA_PREFSRC, | |
290 | RTA_METRICS, | |
291 | RTA_MULTIPATH, | |
3ea2fb98 | 292 | RTA_PROTOINFO, /* no longer used */ |
0633baa1 SH |
293 | RTA_FLOW, |
294 | RTA_CACHEINFO, | |
3ea2fb98 | 295 | RTA_SESSION, /* no longer used */ |
a6ffa8b0 | 296 | RTA_MP_ALGO, /* no longer used */ |
34e95647 | 297 | RTA_TABLE, |
04a9fc0a | 298 | RTA_MARK, |
910773dc | 299 | RTA_MFC_STATS, |
0633baa1 SH |
300 | __RTA_MAX |
301 | }; | |
302 | ||
303 | #define RTA_MAX (__RTA_MAX - 1) | |
304 | ||
305 | #define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg)))) | |
306 | #define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg)) | |
307 | ||
308 | /* RTM_MULTIPATH --- array of struct rtnexthop. | |
309 | * | |
310 | * "struct rtnexthop" describes all necessary nexthop information, | |
311 | * i.e. parameters of path to a destination via this nexthop. | |
312 | * | |
313 | * At the moment it is impossible to set different prefsrc, mtu, window | |
314 | * and rtt for different paths from multipath. | |
315 | */ | |
316 | ||
ab322673 | 317 | struct rtnexthop { |
0633baa1 SH |
318 | unsigned short rtnh_len; |
319 | unsigned char rtnh_flags; | |
320 | unsigned char rtnh_hops; | |
321 | int rtnh_ifindex; | |
322 | }; | |
323 | ||
324 | /* rtnh_flags */ | |
325 | ||
326 | #define RTNH_F_DEAD 1 /* Nexthop is dead (used by multipath) */ | |
327 | #define RTNH_F_PERVASIVE 2 /* Do recursive gateway lookup */ | |
328 | #define RTNH_F_ONLINK 4 /* Gateway is forced on link */ | |
329 | ||
330 | /* Macros to handle hexthops */ | |
331 | ||
332 | #define RTNH_ALIGNTO 4 | |
333 | #define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) ) | |
334 | #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && \ | |
335 | ((int)(rtnh)->rtnh_len) <= (len)) | |
336 | #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) | |
337 | #define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len)) | |
338 | #define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len)) | |
339 | #define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0))) | |
340 | ||
341 | /* RTM_CACHEINFO */ | |
342 | ||
ab322673 | 343 | struct rta_cacheinfo { |
0633baa1 SH |
344 | __u32 rta_clntref; |
345 | __u32 rta_lastuse; | |
346 | __s32 rta_expires; | |
347 | __u32 rta_error; | |
348 | __u32 rta_used; | |
349 | ||
350 | #define RTNETLINK_HAVE_PEERINFO 1 | |
351 | __u32 rta_id; | |
352 | __u32 rta_ts; | |
353 | __u32 rta_tsage; | |
354 | }; | |
355 | ||
356 | /* RTM_METRICS --- array of struct rtattr with types of RTAX_* */ | |
357 | ||
ab322673 | 358 | enum { |
0633baa1 SH |
359 | RTAX_UNSPEC, |
360 | #define RTAX_UNSPEC RTAX_UNSPEC | |
361 | RTAX_LOCK, | |
362 | #define RTAX_LOCK RTAX_LOCK | |
363 | RTAX_MTU, | |
364 | #define RTAX_MTU RTAX_MTU | |
365 | RTAX_WINDOW, | |
366 | #define RTAX_WINDOW RTAX_WINDOW | |
367 | RTAX_RTT, | |
368 | #define RTAX_RTT RTAX_RTT | |
369 | RTAX_RTTVAR, | |
370 | #define RTAX_RTTVAR RTAX_RTTVAR | |
371 | RTAX_SSTHRESH, | |
372 | #define RTAX_SSTHRESH RTAX_SSTHRESH | |
373 | RTAX_CWND, | |
374 | #define RTAX_CWND RTAX_CWND | |
375 | RTAX_ADVMSS, | |
376 | #define RTAX_ADVMSS RTAX_ADVMSS | |
377 | RTAX_REORDERING, | |
378 | #define RTAX_REORDERING RTAX_REORDERING | |
379 | RTAX_HOPLIMIT, | |
380 | #define RTAX_HOPLIMIT RTAX_HOPLIMIT | |
381 | RTAX_INITCWND, | |
382 | #define RTAX_INITCWND RTAX_INITCWND | |
383 | RTAX_FEATURES, | |
384 | #define RTAX_FEATURES RTAX_FEATURES | |
dfd26e1c SH |
385 | RTAX_RTO_MIN, |
386 | #define RTAX_RTO_MIN RTAX_RTO_MIN | |
8ecdcce0 SH |
387 | RTAX_INITRWND, |
388 | #define RTAX_INITRWND RTAX_INITRWND | |
0633baa1 SH |
389 | __RTAX_MAX |
390 | }; | |
391 | ||
392 | #define RTAX_MAX (__RTAX_MAX - 1) | |
393 | ||
394 | #define RTAX_FEATURE_ECN 0x00000001 | |
395 | #define RTAX_FEATURE_SACK 0x00000002 | |
396 | #define RTAX_FEATURE_TIMESTAMP 0x00000004 | |
206a0441 | 397 | #define RTAX_FEATURE_ALLFRAG 0x00000008 |
0633baa1 | 398 | |
ab322673 | 399 | struct rta_session { |
0633baa1 | 400 | __u8 proto; |
6864c1e7 SH |
401 | __u8 pad1; |
402 | __u16 pad2; | |
0633baa1 SH |
403 | |
404 | union { | |
405 | struct { | |
406 | __u16 sport; | |
407 | __u16 dport; | |
408 | } ports; | |
409 | ||
410 | struct { | |
411 | __u8 type; | |
412 | __u8 code; | |
413 | __u16 ident; | |
414 | } icmpt; | |
415 | ||
416 | __u32 spi; | |
417 | } u; | |
418 | }; | |
419 | ||
910773dc SH |
420 | struct rta_mfc_stats { |
421 | __u64 mfcs_packets; | |
422 | __u64 mfcs_bytes; | |
423 | __u64 mfcs_wrong_if; | |
424 | }; | |
425 | ||
0633baa1 SH |
426 | /**** |
427 | * General form of address family dependent message. | |
428 | ****/ | |
429 | ||
ab322673 | 430 | struct rtgenmsg { |
0633baa1 SH |
431 | unsigned char rtgen_family; |
432 | }; | |
433 | ||
434 | /***************************************************************** | |
435 | * Link layer specific messages. | |
436 | ****/ | |
437 | ||
438 | /* struct ifinfomsg | |
439 | * passes link level specific information, not dependent | |
440 | * on network protocol. | |
441 | */ | |
442 | ||
ab322673 | 443 | struct ifinfomsg { |
0633baa1 SH |
444 | unsigned char ifi_family; |
445 | unsigned char __ifi_pad; | |
446 | unsigned short ifi_type; /* ARPHRD_* */ | |
447 | int ifi_index; /* Link index */ | |
448 | unsigned ifi_flags; /* IFF_* flags */ | |
449 | unsigned ifi_change; /* IFF_* change mask */ | |
450 | }; | |
451 | ||
452 | /******************************************************************** | |
453 | * prefix information | |
454 | ****/ | |
455 | ||
ab322673 | 456 | struct prefixmsg { |
0633baa1 | 457 | unsigned char prefix_family; |
6864c1e7 SH |
458 | unsigned char prefix_pad1; |
459 | unsigned short prefix_pad2; | |
0633baa1 SH |
460 | int prefix_ifindex; |
461 | unsigned char prefix_type; | |
462 | unsigned char prefix_len; | |
463 | unsigned char prefix_flags; | |
6864c1e7 | 464 | unsigned char prefix_pad3; |
0633baa1 SH |
465 | }; |
466 | ||
467 | enum | |
468 | { | |
469 | PREFIX_UNSPEC, | |
470 | PREFIX_ADDRESS, | |
471 | PREFIX_CACHEINFO, | |
472 | __PREFIX_MAX | |
473 | }; | |
474 | ||
475 | #define PREFIX_MAX (__PREFIX_MAX - 1) | |
476 | ||
ab322673 | 477 | struct prefix_cacheinfo { |
0633baa1 SH |
478 | __u32 preferred_time; |
479 | __u32 valid_time; | |
480 | }; | |
481 | ||
0633baa1 SH |
482 | |
483 | /***************************************************************** | |
484 | * Traffic control messages. | |
485 | ****/ | |
486 | ||
ab322673 | 487 | struct tcmsg { |
0633baa1 SH |
488 | unsigned char tcm_family; |
489 | unsigned char tcm__pad1; | |
490 | unsigned short tcm__pad2; | |
491 | int tcm_ifindex; | |
492 | __u32 tcm_handle; | |
493 | __u32 tcm_parent; | |
494 | __u32 tcm_info; | |
495 | }; | |
496 | ||
ab322673 | 497 | enum { |
0633baa1 SH |
498 | TCA_UNSPEC, |
499 | TCA_KIND, | |
500 | TCA_OPTIONS, | |
501 | TCA_STATS, | |
502 | TCA_XSTATS, | |
503 | TCA_RATE, | |
504 | TCA_FCNT, | |
e5879dc6 | 505 | TCA_STATS2, |
19ecc16d | 506 | TCA_STAB, |
0633baa1 SH |
507 | __TCA_MAX |
508 | }; | |
509 | ||
510 | #define TCA_MAX (__TCA_MAX - 1) | |
511 | ||
512 | #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) | |
513 | #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) | |
514 | ||
5472ac6f SH |
515 | /******************************************************************** |
516 | * Neighbor Discovery userland options | |
517 | ****/ | |
518 | ||
ab322673 | 519 | struct nduseroptmsg { |
5472ac6f SH |
520 | unsigned char nduseropt_family; |
521 | unsigned char nduseropt_pad1; | |
522 | unsigned short nduseropt_opts_len; /* Total length of options */ | |
523 | int nduseropt_ifindex; | |
524 | __u8 nduseropt_icmp_type; | |
525 | __u8 nduseropt_icmp_code; | |
526 | unsigned short nduseropt_pad2; | |
527 | unsigned int nduseropt_pad3; | |
528 | /* Followed by one or more ND options */ | |
529 | }; | |
530 | ||
ab322673 | 531 | enum { |
5472ac6f SH |
532 | NDUSEROPT_UNSPEC, |
533 | NDUSEROPT_SRCADDR, | |
534 | __NDUSEROPT_MAX | |
535 | }; | |
536 | ||
537 | #define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1) | |
538 | ||
351efcde | 539 | /* RTnetlink multicast groups - backwards compatibility for userspace */ |
0633baa1 SH |
540 | #define RTMGRP_LINK 1 |
541 | #define RTMGRP_NOTIFY 2 | |
542 | #define RTMGRP_NEIGH 4 | |
543 | #define RTMGRP_TC 8 | |
544 | ||
545 | #define RTMGRP_IPV4_IFADDR 0x10 | |
546 | #define RTMGRP_IPV4_MROUTE 0x20 | |
547 | #define RTMGRP_IPV4_ROUTE 0x40 | |
8f8a3648 | 548 | #define RTMGRP_IPV4_RULE 0x80 |
0633baa1 SH |
549 | |
550 | #define RTMGRP_IPV6_IFADDR 0x100 | |
551 | #define RTMGRP_IPV6_MROUTE 0x200 | |
552 | #define RTMGRP_IPV6_ROUTE 0x400 | |
553 | #define RTMGRP_IPV6_IFINFO 0x800 | |
554 | ||
555 | #define RTMGRP_DECnet_IFADDR 0x1000 | |
556 | #define RTMGRP_DECnet_ROUTE 0x4000 | |
557 | ||
558 | #define RTMGRP_IPV6_PREFIX 0x20000 | |
559 | ||
351efcde SH |
560 | /* RTnetlink multicast groups */ |
561 | enum rtnetlink_groups { | |
562 | RTNLGRP_NONE, | |
563 | #define RTNLGRP_NONE RTNLGRP_NONE | |
564 | RTNLGRP_LINK, | |
565 | #define RTNLGRP_LINK RTNLGRP_LINK | |
566 | RTNLGRP_NOTIFY, | |
567 | #define RTNLGRP_NOTIFY RTNLGRP_NOTIFY | |
568 | RTNLGRP_NEIGH, | |
569 | #define RTNLGRP_NEIGH RTNLGRP_NEIGH | |
570 | RTNLGRP_TC, | |
571 | #define RTNLGRP_TC RTNLGRP_TC | |
572 | RTNLGRP_IPV4_IFADDR, | |
573 | #define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR | |
574 | RTNLGRP_IPV4_MROUTE, | |
575 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE | |
576 | RTNLGRP_IPV4_ROUTE, | |
577 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE | |
8f8a3648 SH |
578 | RTNLGRP_IPV4_RULE, |
579 | #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE | |
351efcde SH |
580 | RTNLGRP_IPV6_IFADDR, |
581 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR | |
582 | RTNLGRP_IPV6_MROUTE, | |
583 | #define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE | |
584 | RTNLGRP_IPV6_ROUTE, | |
585 | #define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE | |
586 | RTNLGRP_IPV6_IFINFO, | |
587 | #define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO | |
588 | RTNLGRP_DECnet_IFADDR, | |
589 | #define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR | |
09954dc6 | 590 | RTNLGRP_NOP2, |
351efcde SH |
591 | RTNLGRP_DECnet_ROUTE, |
592 | #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE | |
ead2ba70 SH |
593 | RTNLGRP_DECnet_RULE, |
594 | #define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE | |
09954dc6 | 595 | RTNLGRP_NOP4, |
351efcde SH |
596 | RTNLGRP_IPV6_PREFIX, |
597 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX | |
ead2ba70 SH |
598 | RTNLGRP_IPV6_RULE, |
599 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE | |
5472ac6f SH |
600 | RTNLGRP_ND_USEROPT, |
601 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT | |
05bfd165 SH |
602 | RTNLGRP_PHONET_IFADDR, |
603 | #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR | |
604 | RTNLGRP_PHONET_ROUTE, | |
605 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE | |
707f612c SH |
606 | RTNLGRP_DCB, |
607 | #define RTNLGRP_DCB RTNLGRP_DCB | |
910773dc SH |
608 | RTNLGRP_IPV4_NETCONF, |
609 | #define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF | |
610 | RTNLGRP_IPV6_NETCONF, | |
611 | #define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF | |
4a4ee616 CW |
612 | RTNLGRP_MDB, |
613 | #define RTNLGRP_MDB RTNLGRP_MDB | |
351efcde SH |
614 | __RTNLGRP_MAX |
615 | }; | |
616 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | |
617 | ||
0633baa1 | 618 | /* TC action piece */ |
ab322673 | 619 | struct tcamsg { |
0633baa1 SH |
620 | unsigned char tca_family; |
621 | unsigned char tca__pad1; | |
622 | unsigned short tca__pad2; | |
623 | }; | |
624 | #define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg)))) | |
625 | #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg)) | |
626 | #define TCA_ACT_TAB 1 /* attr type must be >=1 */ | |
627 | #define TCAA_MAX 1 | |
628 | ||
c23abafb SH |
629 | /* New extended info filters for IFLA_EXT_MASK */ |
630 | #define RTEXT_FILTER_VF (1 << 0) | |
609106d3 | 631 | #define RTEXT_FILTER_BRVLAN (1 << 1) |
c23abafb | 632 | |
0633baa1 SH |
633 | /* End of information exported to user level */ |
634 | ||
635 | ||
636 | ||
910773dc | 637 | #endif /* __LINUX_RTNETLINK_H */ |