1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_RTNETLINK_H
13 #define __LINUX_RTNETLINK_H
15 #include <linux/netlink.h>
19 #define RTM_BASE RTM_BASE
22 #define RTM_NEWLINK RTM_NEWLINK
24 #define RTM_DELLINK RTM_DELLINK
26 #define RTM_GETLINK RTM_GETLINK
28 #define RTM_SETLINK RTM_SETLINK
31 #define RTM_NEWADDR RTM_NEWADDR
33 #define RTM_DELADDR RTM_DELADDR
35 #define RTM_GETADDR RTM_GETADDR
38 #define RTM_NEWROUTE RTM_NEWROUTE
40 #define RTM_DELROUTE RTM_DELROUTE
42 #define RTM_GETROUTE RTM_GETROUTE
45 #define RTM_NEWNEIGH RTM_NEWNEIGH
47 #define RTM_DELNEIGH RTM_DELNEIGH
49 #define RTM_GETNEIGH RTM_GETNEIGH
52 #define RTM_NEWRULE RTM_NEWRULE
54 #define RTM_DELRULE RTM_DELRULE
56 #define RTM_GETRULE RTM_GETRULE
59 #define RTM_NEWQDISC RTM_NEWQDISC
61 #define RTM_DELQDISC RTM_DELQDISC
63 #define RTM_GETQDISC RTM_GETQDISC
66 #define RTM_NEWTCLASS RTM_NEWTCLASS
68 #define RTM_DELTCLASS RTM_DELTCLASS
70 #define RTM_GETTCLASS RTM_GETTCLASS
73 #define RTM_NEWTFILTER RTM_NEWTFILTER
75 #define RTM_DELTFILTER RTM_DELTFILTER
77 #define RTM_GETTFILTER RTM_GETTFILTER
80 #define RTM_NEWACTION RTM_NEWACTION
82 #define RTM_DELACTION RTM_DELACTION
84 #define RTM_GETACTION RTM_GETACTION
87 #define RTM_NEWPREFIX RTM_NEWPREFIX
89 #define RTM_GETPREFIX RTM_GETPREFIX
91 RTM_GETMULTICAST = 58,
92 #define RTM_GETMULTICAST RTM_GETMULTICAST
95 #define RTM_GETANYCAST RTM_GETANYCAST
98 #define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
100 #define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
102 #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
105 #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
108 #define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
109 #define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
110 #define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
114 unsigned short rta_len;
115 unsigned short rta_type;
118 #define RTA_ALIGNTO 4
119 #define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
120 #define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) && (rta)->rta_len >= sizeof(struct rtattr) && (rta)->rta_len <= (len))
121 #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
122 #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
123 #define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
124 #define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
125 #define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
129 unsigned char rtm_family;
130 unsigned char rtm_dst_len;
131 unsigned char rtm_src_len;
132 unsigned char rtm_tos;
134 unsigned char rtm_table;
135 unsigned char rtm_protocol;
136 unsigned char rtm_scope;
137 unsigned char rtm_type;
159 #define RTN_MAX (__RTN_MAX - 1)
161 #define RTPROT_UNSPEC 0
162 #define RTPROT_REDIRECT 1
163 #define RTPROT_KERNEL 2
164 #define RTPROT_BOOT 3
165 #define RTPROT_STATIC 4
167 #define RTPROT_GATED 8
169 #define RTPROT_MRT 10
170 #define RTPROT_ZEBRA 11
171 #define RTPROT_BIRD 12
172 #define RTPROT_DNROUTED 13
173 #define RTPROT_XORP 14
174 #define RTPROT_NTK 15
186 #define RTM_F_NOTIFY 0x100
187 #define RTM_F_CLONED 0x200
188 #define RTM_F_EQUALIZE 0x400
189 #define RTM_F_PREFIX 0x800
195 RT_TABLE_DEFAULT=253,
200 #define RT_TABLE_MAX (__RT_TABLE_MAX - 1)
222 #define RTA_MAX (__RTA_MAX - 1)
224 #define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
225 #define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
229 unsigned short rtnh_len;
230 unsigned char rtnh_flags;
231 unsigned char rtnh_hops;
235 #define RTNH_F_DEAD 1
236 #define RTNH_F_PERVASIVE 2
237 #define RTNH_F_ONLINK 4
239 #define RTNH_ALIGNTO 4
240 #define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
241 #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && ((int)(rtnh)->rtnh_len) <= (len))
242 #define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
243 #define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
244 #define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
245 #define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
255 #define RTNETLINK_HAVE_PEERINFO 1
264 #define RTAX_UNSPEC RTAX_UNSPEC
266 #define RTAX_LOCK RTAX_LOCK
268 #define RTAX_MTU RTAX_MTU
270 #define RTAX_WINDOW RTAX_WINDOW
272 #define RTAX_RTT RTAX_RTT
274 #define RTAX_RTTVAR RTAX_RTTVAR
276 #define RTAX_SSTHRESH RTAX_SSTHRESH
278 #define RTAX_CWND RTAX_CWND
280 #define RTAX_ADVMSS RTAX_ADVMSS
282 #define RTAX_REORDERING RTAX_REORDERING
284 #define RTAX_HOPLIMIT RTAX_HOPLIMIT
286 #define RTAX_INITCWND RTAX_INITCWND
288 #define RTAX_FEATURES RTAX_FEATURES
292 #define RTAX_MAX (__RTAX_MAX - 1)
294 #define RTAX_FEATURE_ECN 0x00000001
295 #define RTAX_FEATURE_SACK 0x00000002
296 #define RTAX_FEATURE_TIMESTAMP 0x00000004
297 #define RTAX_FEATURE_ALLFRAG 0x00000008
323 unsigned char ifa_family;
324 unsigned char ifa_prefixlen;
325 unsigned char ifa_flags;
326 unsigned char ifa_scope;
343 #define IFA_MAX (__IFA_MAX - 1)
345 #define IFA_F_SECONDARY 0x01
346 #define IFA_F_TEMPORARY IFA_F_SECONDARY
348 #define IFA_F_DEPRECATED 0x20
349 #define IFA_F_TENTATIVE 0x40
350 #define IFA_F_PERMANENT 0x80
360 #define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
361 #define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
365 unsigned char ndm_family;
366 unsigned char ndm_pad1;
367 unsigned short ndm_pad2;
384 #define NDA_MAX (__NDA_MAX - 1)
386 #define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
387 #define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
389 #define NTF_PROXY 0x08
390 #define NTF_ROUTER 0x80
392 #define NUD_INCOMPLETE 0x01
393 #define NUD_REACHABLE 0x02
394 #define NUD_STALE 0x04
395 #define NUD_DELAY 0x08
396 #define NUD_PROBE 0x10
397 #define NUD_FAILED 0x20
399 #define NUD_NOARP 0x40
400 #define NUD_PERMANENT 0x80
401 #define NUD_NONE 0x00
415 __u64 ndts_hash_grows;
416 __u64 ndts_res_failed;
419 __u64 ndts_rcv_probes_mcast;
420 __u64 ndts_rcv_probes_ucast;
421 __u64 ndts_periodic_gc_runs;
422 __u64 ndts_forced_gc_runs;
429 NDTPA_REACHABLE_TIME,
430 NDTPA_BASE_REACHABLE_TIME,
433 NDTPA_DELAY_PROBE_TIME,
444 #define NDTPA_MAX (__NDTPA_MAX - 1)
456 __u16 ndtc_entry_size;
458 __u32 ndtc_last_flush;
459 __u32 ndtc_last_rand;
461 __u32 ndtc_hash_mask;
462 __u32 ndtc_hash_chain_gc;
463 __u32 ndtc_proxy_qlen;
478 #define NDTA_MAX (__NDTA_MAX - 1)
480 #define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg))))
481 #define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
485 unsigned char rtgen_family;
490 unsigned char ifi_family;
491 unsigned char __ifi_pad;
492 unsigned short ifi_type;
500 unsigned char prefix_family;
501 unsigned char prefix_pad1;
502 unsigned short prefix_pad2;
504 unsigned char prefix_type;
505 unsigned char prefix_len;
506 unsigned char prefix_flags;
507 unsigned char prefix_pad3;
518 #define PREFIX_MAX (__PREFIX_MAX - 1)
520 struct prefix_cacheinfo
522 __u32 preferred_time;
526 struct rtnl_link_stats
539 __u32 rx_length_errors;
540 __u32 rx_over_errors;
542 __u32 rx_frame_errors;
543 __u32 rx_fifo_errors;
544 __u32 rx_missed_errors;
546 __u32 tx_aborted_errors;
547 __u32 tx_carrier_errors;
548 __u32 tx_fifo_errors;
549 __u32 tx_heartbeat_errors;
550 __u32 tx_window_errors;
556 struct rtnl_link_ifmap
577 #define IFLA_COST IFLA_COST
579 #define IFLA_PRIORITY IFLA_PRIORITY
581 #define IFLA_MASTER IFLA_MASTER
583 #define IFLA_WIRELESS IFLA_WIRELESS
585 #define IFLA_PROTINFO IFLA_PROTINFO
587 #define IFLA_TXQLEN IFLA_TXQLEN
589 #define IFLA_MAP IFLA_MAP
591 #define IFLA_WEIGHT IFLA_WEIGHT
597 #define IFLA_MAX (__IFLA_MAX - 1)
599 #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
600 #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
609 IFLA_INET6_CACHEINFO,
613 #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
615 struct ifla_cacheinfo
619 __u32 reachable_time;
625 unsigned char tcm_family;
626 unsigned char tcm__pad1;
627 unsigned short tcm__pad2;
647 #define TCA_MAX (__TCA_MAX - 1)
649 #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
650 #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
652 #define RTMGRP_LINK 1
653 #define RTMGRP_NOTIFY 2
654 #define RTMGRP_NEIGH 4
657 #define RTMGRP_IPV4_IFADDR 0x10
658 #define RTMGRP_IPV4_MROUTE 0x20
659 #define RTMGRP_IPV4_ROUTE 0x40
660 #define RTMGRP_IPV4_RULE 0x80
662 #define RTMGRP_IPV6_IFADDR 0x100
663 #define RTMGRP_IPV6_MROUTE 0x200
664 #define RTMGRP_IPV6_ROUTE 0x400
665 #define RTMGRP_IPV6_IFINFO 0x800
667 #define RTMGRP_DECnet_IFADDR 0x1000
668 #define RTMGRP_DECnet_ROUTE 0x4000
670 #define RTMGRP_IPV6_PREFIX 0x20000
672 enum rtnetlink_groups {
674 #define RTNLGRP_NONE RTNLGRP_NONE
676 #define RTNLGRP_LINK RTNLGRP_LINK
678 #define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
680 #define RTNLGRP_NEIGH RTNLGRP_NEIGH
682 #define RTNLGRP_TC RTNLGRP_TC
684 #define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
686 #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
688 #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
690 #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
692 #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
694 #define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
696 #define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
698 #define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
699 RTNLGRP_DECnet_IFADDR,
700 #define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
702 RTNLGRP_DECnet_ROUTE,
703 #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
707 #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
710 #define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
714 unsigned char tca_family;
715 unsigned char tca__pad1;
716 unsigned short tca__pad2;
718 #define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
719 #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
720 #define TCA_ACT_TAB 1