Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 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. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI__LINUX_RTNETLINK_H |
| 20 | #define _UAPI__LINUX_RTNETLINK_H |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/netlink.h> |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #include <linux/if_link.h> |
| 24 | #include <linux/if_addr.h> |
| 25 | #include <linux/neighbour.h> |
| 26 | #define RTNL_FAMILY_IPMR 128 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define RTNL_FAMILY_IP6MR 129 |
| 28 | #define RTNL_FAMILY_MAX 129 |
| 29 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 30 | RTM_BASE = 16, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define RTM_BASE RTM_BASE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 32 | RTM_NEWLINK = 16, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 33 | #define RTM_NEWLINK RTM_NEWLINK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 34 | RTM_DELLINK, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | #define RTM_DELLINK RTM_DELLINK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 | RTM_GETLINK, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 37 | #define RTM_GETLINK RTM_GETLINK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 38 | RTM_SETLINK, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define RTM_SETLINK RTM_SETLINK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 40 | RTM_NEWADDR = 20, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 41 | #define RTM_NEWADDR RTM_NEWADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 42 | RTM_DELADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define RTM_DELADDR RTM_DELADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 44 | RTM_GETADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 45 | #define RTM_GETADDR RTM_GETADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 46 | RTM_NEWROUTE = 24, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define RTM_NEWROUTE RTM_NEWROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 48 | RTM_DELROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 49 | #define RTM_DELROUTE RTM_DELROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 50 | RTM_GETROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define RTM_GETROUTE RTM_GETROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 52 | RTM_NEWNEIGH = 28, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 53 | #define RTM_NEWNEIGH RTM_NEWNEIGH |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | RTM_DELNEIGH, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define RTM_DELNEIGH RTM_DELNEIGH |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 56 | RTM_GETNEIGH, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 57 | #define RTM_GETNEIGH RTM_GETNEIGH |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 58 | RTM_NEWRULE = 32, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 59 | #define RTM_NEWRULE RTM_NEWRULE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 60 | RTM_DELRULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 61 | #define RTM_DELRULE RTM_DELRULE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 62 | RTM_GETRULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 63 | #define RTM_GETRULE RTM_GETRULE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | RTM_NEWQDISC = 36, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 65 | #define RTM_NEWQDISC RTM_NEWQDISC |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 66 | RTM_DELQDISC, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 67 | #define RTM_DELQDISC RTM_DELQDISC |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | RTM_GETQDISC, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 69 | #define RTM_GETQDISC RTM_GETQDISC |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 70 | RTM_NEWTCLASS = 40, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 71 | #define RTM_NEWTCLASS RTM_NEWTCLASS |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | RTM_DELTCLASS, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 73 | #define RTM_DELTCLASS RTM_DELTCLASS |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 74 | RTM_GETTCLASS, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 75 | #define RTM_GETTCLASS RTM_GETTCLASS |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | RTM_NEWTFILTER = 44, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 77 | #define RTM_NEWTFILTER RTM_NEWTFILTER |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 78 | RTM_DELTFILTER, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 79 | #define RTM_DELTFILTER RTM_DELTFILTER |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | RTM_GETTFILTER, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 81 | #define RTM_GETTFILTER RTM_GETTFILTER |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 82 | RTM_NEWACTION = 48, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 83 | #define RTM_NEWACTION RTM_NEWACTION |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 84 | RTM_DELACTION, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 85 | #define RTM_DELACTION RTM_DELACTION |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 86 | RTM_GETACTION, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 87 | #define RTM_GETACTION RTM_GETACTION |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 | RTM_NEWPREFIX = 52, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | #define RTM_NEWPREFIX RTM_NEWPREFIX |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 90 | RTM_GETMULTICAST = 58, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 91 | #define RTM_GETMULTICAST RTM_GETMULTICAST |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 92 | RTM_GETANYCAST = 62, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 93 | #define RTM_GETANYCAST RTM_GETANYCAST |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 94 | RTM_NEWNEIGHTBL = 64, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 95 | #define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 96 | RTM_GETNEIGHTBL = 66, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 97 | #define RTM_GETNEIGHTBL RTM_GETNEIGHTBL |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 98 | RTM_SETNEIGHTBL, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 99 | #define RTM_SETNEIGHTBL RTM_SETNEIGHTBL |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 100 | RTM_NEWNDUSEROPT = 68, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 101 | #define RTM_NEWNDUSEROPT RTM_NEWNDUSEROPT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 102 | RTM_NEWADDRLABEL = 72, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 103 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 104 | RTM_DELADDRLABEL, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | #define RTM_DELADDRLABEL RTM_DELADDRLABEL |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 106 | RTM_GETADDRLABEL, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 107 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 108 | RTM_GETDCB = 78, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 109 | #define RTM_GETDCB RTM_GETDCB |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 110 | RTM_SETDCB, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 111 | #define RTM_SETDCB RTM_SETDCB |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 112 | RTM_NEWNETCONF = 80, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 113 | #define RTM_NEWNETCONF RTM_NEWNETCONF |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 114 | RTM_DELNETCONF, |
| 115 | #define RTM_DELNETCONF RTM_DELNETCONF |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 116 | RTM_GETNETCONF = 82, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 117 | #define RTM_GETNETCONF RTM_GETNETCONF |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 118 | RTM_NEWMDB = 84, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 119 | #define RTM_NEWMDB RTM_NEWMDB |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 120 | RTM_DELMDB = 85, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 121 | #define RTM_DELMDB RTM_DELMDB |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 122 | RTM_GETMDB = 86, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 123 | #define RTM_GETMDB RTM_GETMDB |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 124 | RTM_NEWNSID = 88, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 125 | #define RTM_NEWNSID RTM_NEWNSID |
| 126 | RTM_DELNSID = 89, |
| 127 | #define RTM_DELNSID RTM_DELNSID |
| 128 | RTM_GETNSID = 90, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 129 | #define RTM_GETNSID RTM_GETNSID |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 130 | RTM_NEWSTATS = 92, |
| 131 | #define RTM_NEWSTATS RTM_NEWSTATS |
| 132 | RTM_GETSTATS = 94, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 133 | #define RTM_GETSTATS RTM_GETSTATS |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 134 | RTM_NEWCACHEREPORT = 96, |
| 135 | #define RTM_NEWCACHEREPORT RTM_NEWCACHEREPORT |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 136 | __RTM_MAX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 137 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
| 138 | }; |
| 139 | #define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE) |
| 140 | #define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 141 | #define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2) |
| 142 | struct rtattr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 143 | unsigned short rta_len; |
| 144 | unsigned short rta_type; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 145 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 146 | #define RTA_ALIGNTO 4U |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 147 | #define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1)) |
| 148 | #define RTA_OK(rta,len) ((len) >= (int) sizeof(struct rtattr) && (rta)->rta_len >= sizeof(struct rtattr) && (rta)->rta_len <= (len)) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 149 | #define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len), (struct rtattr *) (((char *) (rta)) + RTA_ALIGN((rta)->rta_len))) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 150 | #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len)) |
| 151 | #define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len)) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 152 | #define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0))) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 153 | #define RTA_PAYLOAD(rta) ((int) ((rta)->rta_len) - RTA_LENGTH(0)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 154 | struct rtmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 155 | unsigned char rtm_family; |
| 156 | unsigned char rtm_dst_len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 157 | unsigned char rtm_src_len; |
| 158 | unsigned char rtm_tos; |
| 159 | unsigned char rtm_table; |
| 160 | unsigned char rtm_protocol; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 161 | unsigned char rtm_scope; |
| 162 | unsigned char rtm_type; |
| 163 | unsigned rtm_flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 164 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 165 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 166 | RTN_UNSPEC, |
| 167 | RTN_UNICAST, |
| 168 | RTN_LOCAL, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 169 | RTN_BROADCAST, |
| 170 | RTN_ANYCAST, |
| 171 | RTN_MULTICAST, |
| 172 | RTN_BLACKHOLE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 173 | RTN_UNREACHABLE, |
| 174 | RTN_PROHIBIT, |
| 175 | RTN_THROW, |
| 176 | RTN_NAT, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 177 | RTN_XRESOLVE, |
| 178 | __RTN_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 179 | }; |
| 180 | #define RTN_MAX (__RTN_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 181 | #define RTPROT_UNSPEC 0 |
| 182 | #define RTPROT_REDIRECT 1 |
| 183 | #define RTPROT_KERNEL 2 |
| 184 | #define RTPROT_BOOT 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 185 | #define RTPROT_STATIC 4 |
| 186 | #define RTPROT_GATED 8 |
| 187 | #define RTPROT_RA 9 |
| 188 | #define RTPROT_MRT 10 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 189 | #define RTPROT_ZEBRA 11 |
| 190 | #define RTPROT_BIRD 12 |
| 191 | #define RTPROT_DNROUTED 13 |
| 192 | #define RTPROT_XORP 14 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 193 | #define RTPROT_NTK 15 |
| 194 | #define RTPROT_DHCP 16 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 195 | #define RTPROT_MROUTED 17 |
| 196 | #define RTPROT_BABEL 42 |
| 197 | enum rt_scope_t { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 198 | RT_SCOPE_UNIVERSE = 0, |
| 199 | RT_SCOPE_SITE = 200, |
| 200 | RT_SCOPE_LINK = 253, |
| 201 | RT_SCOPE_HOST = 254, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 202 | RT_SCOPE_NOWHERE = 255 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 203 | }; |
| 204 | #define RTM_F_NOTIFY 0x100 |
| 205 | #define RTM_F_CLONED 0x200 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 206 | #define RTM_F_EQUALIZE 0x400 |
| 207 | #define RTM_F_PREFIX 0x800 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 208 | #define RTM_F_LOOKUP_TABLE 0x1000 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 209 | #define RTM_F_FIB_MATCH 0x2000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 210 | enum rt_class_t { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 211 | RT_TABLE_UNSPEC = 0, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 212 | RT_TABLE_COMPAT = 252, |
| 213 | RT_TABLE_DEFAULT = 253, |
| 214 | RT_TABLE_MAIN = 254, |
| 215 | RT_TABLE_LOCAL = 255, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 216 | RT_TABLE_MAX = 0xFFFFFFFF |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 217 | }; |
| 218 | enum rtattr_type_t { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 219 | RTA_UNSPEC, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 220 | RTA_DST, |
| 221 | RTA_SRC, |
| 222 | RTA_IIF, |
| 223 | RTA_OIF, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 224 | RTA_GATEWAY, |
| 225 | RTA_PRIORITY, |
| 226 | RTA_PREFSRC, |
| 227 | RTA_METRICS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 228 | RTA_MULTIPATH, |
| 229 | RTA_PROTOINFO, |
| 230 | RTA_FLOW, |
| 231 | RTA_CACHEINFO, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 232 | RTA_SESSION, |
| 233 | RTA_MP_ALGO, |
| 234 | RTA_TABLE, |
| 235 | RTA_MARK, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 236 | RTA_MFC_STATS, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 237 | RTA_VIA, |
| 238 | RTA_NEWDST, |
| 239 | RTA_PREF, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 240 | RTA_ENCAP_TYPE, |
| 241 | RTA_ENCAP, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 242 | RTA_EXPIRES, |
| 243 | RTA_PAD, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 244 | RTA_UID, |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 245 | RTA_TTL_PROPAGATE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 246 | __RTA_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 247 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 248 | #define RTA_MAX (__RTA_MAX - 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 249 | #define RTM_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct rtmsg)))) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 250 | #define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct rtmsg)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 251 | struct rtnexthop { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 252 | unsigned short rtnh_len; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 253 | unsigned char rtnh_flags; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 254 | unsigned char rtnh_hops; |
| 255 | int rtnh_ifindex; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 256 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 257 | #define RTNH_F_DEAD 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 258 | #define RTNH_F_PERVASIVE 2 |
| 259 | #define RTNH_F_ONLINK 4 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 260 | #define RTNH_F_OFFLOAD 8 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 261 | #define RTNH_F_LINKDOWN 16 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 262 | #define RTNH_F_UNRESOLVED 32 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 263 | #define RTNH_COMPARE_MASK (RTNH_F_DEAD | RTNH_F_LINKDOWN | RTNH_F_OFFLOAD) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 264 | #define RTNH_ALIGNTO 4 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 265 | #define RTNH_ALIGN(len) (((len) + RTNH_ALIGNTO - 1) & ~(RTNH_ALIGNTO - 1)) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 266 | #define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) && ((int) (rtnh)->rtnh_len) <= (len)) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 267 | #define RTNH_NEXT(rtnh) ((struct rtnexthop *) (((char *) (rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len))) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 268 | #define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 269 | #define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len)) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 270 | #define RTNH_DATA(rtnh) ((struct rtattr *) (((char *) (rtnh)) + RTNH_LENGTH(0))) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 271 | struct rtvia { |
| 272 | __kernel_sa_family_t rtvia_family; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 273 | __u8 rtvia_addr[0]; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 274 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 275 | struct rta_cacheinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 276 | __u32 rta_clntref; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 277 | __u32 rta_lastuse; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 278 | __s32 rta_expires; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 279 | __u32 rta_error; |
| 280 | __u32 rta_used; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 281 | #define RTNETLINK_HAVE_PEERINFO 1 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 282 | __u32 rta_id; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 283 | __u32 rta_ts; |
| 284 | __u32 rta_tsage; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 285 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 286 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 287 | RTAX_UNSPEC, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 288 | #define RTAX_UNSPEC RTAX_UNSPEC |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 289 | RTAX_LOCK, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 290 | #define RTAX_LOCK RTAX_LOCK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 291 | RTAX_MTU, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 292 | #define RTAX_MTU RTAX_MTU |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 293 | RTAX_WINDOW, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 294 | #define RTAX_WINDOW RTAX_WINDOW |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 295 | RTAX_RTT, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 296 | #define RTAX_RTT RTAX_RTT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 297 | RTAX_RTTVAR, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 298 | #define RTAX_RTTVAR RTAX_RTTVAR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 299 | RTAX_SSTHRESH, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 300 | #define RTAX_SSTHRESH RTAX_SSTHRESH |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 301 | RTAX_CWND, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 302 | #define RTAX_CWND RTAX_CWND |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 303 | RTAX_ADVMSS, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 304 | #define RTAX_ADVMSS RTAX_ADVMSS |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 305 | RTAX_REORDERING, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 306 | #define RTAX_REORDERING RTAX_REORDERING |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 307 | RTAX_HOPLIMIT, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 308 | #define RTAX_HOPLIMIT RTAX_HOPLIMIT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 309 | RTAX_INITCWND, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 310 | #define RTAX_INITCWND RTAX_INITCWND |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 311 | RTAX_FEATURES, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 312 | #define RTAX_FEATURES RTAX_FEATURES |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 313 | RTAX_RTO_MIN, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 314 | #define RTAX_RTO_MIN RTAX_RTO_MIN |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 315 | RTAX_INITRWND, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 316 | #define RTAX_INITRWND RTAX_INITRWND |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 317 | RTAX_QUICKACK, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 318 | #define RTAX_QUICKACK RTAX_QUICKACK |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 319 | RTAX_CC_ALGO, |
| 320 | #define RTAX_CC_ALGO RTAX_CC_ALGO |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 321 | RTAX_FASTOPEN_NO_COOKIE, |
| 322 | #define RTAX_FASTOPEN_NO_COOKIE RTAX_FASTOPEN_NO_COOKIE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 323 | __RTAX_MAX |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 324 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 325 | #define RTAX_MAX (__RTAX_MAX - 1) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 326 | #define RTAX_FEATURE_ECN (1 << 0) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 327 | #define RTAX_FEATURE_SACK (1 << 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 328 | #define RTAX_FEATURE_TIMESTAMP (1 << 2) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 329 | #define RTAX_FEATURE_ALLFRAG (1 << 3) |
| 330 | #define RTAX_FEATURE_MASK (RTAX_FEATURE_ECN | RTAX_FEATURE_SACK | RTAX_FEATURE_TIMESTAMP | RTAX_FEATURE_ALLFRAG) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 331 | struct rta_session { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 332 | __u8 proto; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 333 | __u8 pad1; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 334 | __u16 pad2; |
| 335 | union { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 336 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 337 | __u16 sport; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 338 | __u16 dport; |
| 339 | } ports; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 340 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 341 | __u8 type; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 342 | __u8 code; |
| 343 | __u16 ident; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 344 | } icmpt; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 345 | __u32 spi; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 346 | } u; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 347 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 348 | struct rta_mfc_stats { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 349 | __u64 mfcs_packets; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 350 | __u64 mfcs_bytes; |
| 351 | __u64 mfcs_wrong_if; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 352 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 353 | struct rtgenmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 354 | unsigned char rtgen_family; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 355 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 356 | struct ifinfomsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 357 | unsigned char ifi_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 358 | unsigned char __ifi_pad; |
| 359 | unsigned short ifi_type; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 360 | int ifi_index; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 361 | unsigned ifi_flags; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 362 | unsigned ifi_change; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 363 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 364 | struct prefixmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 365 | unsigned char prefix_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 366 | unsigned char prefix_pad1; |
| 367 | unsigned short prefix_pad2; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 368 | int prefix_ifindex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 369 | unsigned char prefix_type; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 370 | unsigned char prefix_len; |
| 371 | unsigned char prefix_flags; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 372 | unsigned char prefix_pad3; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 373 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 374 | enum { |
| 375 | PREFIX_UNSPEC, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 376 | PREFIX_ADDRESS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 377 | PREFIX_CACHEINFO, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 378 | __PREFIX_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 379 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 380 | #define PREFIX_MAX (__PREFIX_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 381 | struct prefix_cacheinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 382 | __u32 preferred_time; |
| 383 | __u32 valid_time; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 384 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 385 | struct tcmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 386 | unsigned char tcm_family; |
| 387 | unsigned char tcm__pad1; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 388 | unsigned short tcm__pad2; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 389 | int tcm_ifindex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 390 | __u32 tcm_handle; |
| 391 | __u32 tcm_parent; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 392 | __u32 tcm_info; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 393 | }; |
| 394 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 395 | TCA_UNSPEC, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 396 | TCA_KIND, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 397 | TCA_OPTIONS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 398 | TCA_STATS, |
| 399 | TCA_XSTATS, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 400 | TCA_RATE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 401 | TCA_FCNT, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 402 | TCA_STATS2, |
| 403 | TCA_STAB, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 404 | TCA_PAD, |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 405 | TCA_DUMP_INVISIBLE, |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 406 | TCA_CHAIN, |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 407 | TCA_HW_OFFLOAD, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 408 | __TCA_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 409 | }; |
| 410 | #define TCA_MAX (__TCA_MAX - 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 411 | #define TCA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 412 | #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcmsg)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 413 | struct nduseroptmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 414 | unsigned char nduseropt_family; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 415 | unsigned char nduseropt_pad1; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 416 | unsigned short nduseropt_opts_len; |
| 417 | int nduseropt_ifindex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 418 | __u8 nduseropt_icmp_type; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 419 | __u8 nduseropt_icmp_code; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 420 | unsigned short nduseropt_pad2; |
| 421 | unsigned int nduseropt_pad3; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 422 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 423 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 424 | NDUSEROPT_UNSPEC, |
| 425 | NDUSEROPT_SRCADDR, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 426 | __NDUSEROPT_MAX |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 427 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 428 | #define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 429 | #define RTMGRP_LINK 1 |
| 430 | #define RTMGRP_NOTIFY 2 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 431 | #define RTMGRP_NEIGH 4 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 432 | #define RTMGRP_TC 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 433 | #define RTMGRP_IPV4_IFADDR 0x10 |
| 434 | #define RTMGRP_IPV4_MROUTE 0x20 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 435 | #define RTMGRP_IPV4_ROUTE 0x40 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 436 | #define RTMGRP_IPV4_RULE 0x80 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 437 | #define RTMGRP_IPV6_IFADDR 0x100 |
| 438 | #define RTMGRP_IPV6_MROUTE 0x200 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 439 | #define RTMGRP_IPV6_ROUTE 0x400 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 440 | #define RTMGRP_IPV6_IFINFO 0x800 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 441 | #define RTMGRP_DECnet_IFADDR 0x1000 |
| 442 | #define RTMGRP_DECnet_ROUTE 0x4000 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 443 | #define RTMGRP_IPV6_PREFIX 0x20000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 444 | enum rtnetlink_groups { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 445 | RTNLGRP_NONE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 446 | #define RTNLGRP_NONE RTNLGRP_NONE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 447 | RTNLGRP_LINK, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 448 | #define RTNLGRP_LINK RTNLGRP_LINK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 449 | RTNLGRP_NOTIFY, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 450 | #define RTNLGRP_NOTIFY RTNLGRP_NOTIFY |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 451 | RTNLGRP_NEIGH, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 452 | #define RTNLGRP_NEIGH RTNLGRP_NEIGH |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 453 | RTNLGRP_TC, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 454 | #define RTNLGRP_TC RTNLGRP_TC |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 455 | RTNLGRP_IPV4_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 456 | #define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 457 | RTNLGRP_IPV4_MROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 458 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 459 | RTNLGRP_IPV4_ROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 460 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 461 | RTNLGRP_IPV4_RULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 462 | #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 463 | RTNLGRP_IPV6_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 464 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 465 | RTNLGRP_IPV6_MROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 466 | #define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 467 | RTNLGRP_IPV6_ROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 468 | #define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 469 | RTNLGRP_IPV6_IFINFO, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 470 | #define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 471 | RTNLGRP_DECnet_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 472 | #define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 473 | RTNLGRP_NOP2, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 474 | RTNLGRP_DECnet_ROUTE, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 475 | #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 476 | RTNLGRP_DECnet_RULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 477 | #define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 478 | RTNLGRP_NOP4, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 479 | RTNLGRP_IPV6_PREFIX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 480 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 481 | RTNLGRP_IPV6_RULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 482 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 483 | RTNLGRP_ND_USEROPT, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 484 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 485 | RTNLGRP_PHONET_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 486 | #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 487 | RTNLGRP_PHONET_ROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 488 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 489 | RTNLGRP_DCB, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 490 | #define RTNLGRP_DCB RTNLGRP_DCB |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 491 | RTNLGRP_IPV4_NETCONF, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 492 | #define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 493 | RTNLGRP_IPV6_NETCONF, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 494 | #define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 495 | RTNLGRP_MDB, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 496 | #define RTNLGRP_MDB RTNLGRP_MDB |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 497 | RTNLGRP_MPLS_ROUTE, |
| 498 | #define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 499 | RTNLGRP_NSID, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 500 | #define RTNLGRP_NSID RTNLGRP_NSID |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 501 | RTNLGRP_MPLS_NETCONF, |
| 502 | #define RTNLGRP_MPLS_NETCONF RTNLGRP_MPLS_NETCONF |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 503 | RTNLGRP_IPV4_MROUTE_R, |
| 504 | #define RTNLGRP_IPV4_MROUTE_R RTNLGRP_IPV4_MROUTE_R |
| 505 | RTNLGRP_IPV6_MROUTE_R, |
| 506 | #define RTNLGRP_IPV6_MROUTE_R RTNLGRP_IPV6_MROUTE_R |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 507 | __RTNLGRP_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 508 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 509 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 510 | struct tcamsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 511 | unsigned char tca_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 512 | unsigned char tca__pad1; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 513 | unsigned short tca__pad2; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 514 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 515 | enum { |
| 516 | TCA_ROOT_UNSPEC, |
| 517 | TCA_ROOT_TAB, |
| 518 | #define TCA_ACT_TAB TCA_ROOT_TAB |
| 519 | #define TCAA_MAX TCA_ROOT_TAB |
| 520 | TCA_ROOT_FLAGS, |
| 521 | TCA_ROOT_COUNT, |
| 522 | TCA_ROOT_TIME_DELTA, |
| 523 | __TCA_ROOT_MAX, |
| 524 | #define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1) |
| 525 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 526 | #define TA_RTA(r) ((struct rtattr *) (((char *) (r)) + NLMSG_ALIGN(sizeof(struct tcamsg)))) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 527 | #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcamsg)) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 528 | #define TCA_FLAG_LARGE_DUMP_ON (1 << 0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 529 | #define RTEXT_FILTER_VF (1 << 0) |
| 530 | #define RTEXT_FILTER_BRVLAN (1 << 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 531 | #define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 532 | #define RTEXT_FILTER_SKIP_STATS (1 << 3) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 533 | #endif |