rtnetlink.h 16 KB

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