rtnetlink.h 15 KB

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