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 | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 136 | RTM_NEWCHAIN = 100, |
| 137 | #define RTM_NEWCHAIN RTM_NEWCHAIN |
| 138 | RTM_DELCHAIN, |
| 139 | #define RTM_DELCHAIN RTM_DELCHAIN |
| 140 | RTM_GETCHAIN, |
| 141 | #define RTM_GETCHAIN RTM_GETCHAIN |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 142 | RTM_NEWNEXTHOP = 104, |
| 143 | #define RTM_NEWNEXTHOP RTM_NEWNEXTHOP |
| 144 | RTM_DELNEXTHOP, |
| 145 | #define RTM_DELNEXTHOP RTM_DELNEXTHOP |
| 146 | RTM_GETNEXTHOP, |
| 147 | #define RTM_GETNEXTHOP RTM_GETNEXTHOP |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 148 | __RTM_MAX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 149 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
| 150 | }; |
| 151 | #define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE) |
| 152 | #define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 153 | #define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2) |
| 154 | struct rtattr { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 155 | unsigned short rta_len; |
| 156 | unsigned short rta_type; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 157 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 158 | #define RTA_ALIGNTO 4U |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 159 | #define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1)) |
| 160 | #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] | 161 | #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] | 162 | #define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len)) |
| 163 | #define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len)) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 164 | #define RTA_DATA(rta) ((void *) (((char *) (rta)) + RTA_LENGTH(0))) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 165 | #define RTA_PAYLOAD(rta) ((int) ((rta)->rta_len) - RTA_LENGTH(0)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 166 | struct rtmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 167 | unsigned char rtm_family; |
| 168 | unsigned char rtm_dst_len; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 169 | unsigned char rtm_src_len; |
| 170 | unsigned char rtm_tos; |
| 171 | unsigned char rtm_table; |
| 172 | unsigned char rtm_protocol; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 173 | unsigned char rtm_scope; |
| 174 | unsigned char rtm_type; |
| 175 | unsigned rtm_flags; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 176 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 177 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 178 | RTN_UNSPEC, |
| 179 | RTN_UNICAST, |
| 180 | RTN_LOCAL, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 181 | RTN_BROADCAST, |
| 182 | RTN_ANYCAST, |
| 183 | RTN_MULTICAST, |
| 184 | RTN_BLACKHOLE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 185 | RTN_UNREACHABLE, |
| 186 | RTN_PROHIBIT, |
| 187 | RTN_THROW, |
| 188 | RTN_NAT, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 189 | RTN_XRESOLVE, |
| 190 | __RTN_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 191 | }; |
| 192 | #define RTN_MAX (__RTN_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 193 | #define RTPROT_UNSPEC 0 |
| 194 | #define RTPROT_REDIRECT 1 |
| 195 | #define RTPROT_KERNEL 2 |
| 196 | #define RTPROT_BOOT 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 197 | #define RTPROT_STATIC 4 |
| 198 | #define RTPROT_GATED 8 |
| 199 | #define RTPROT_RA 9 |
| 200 | #define RTPROT_MRT 10 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 201 | #define RTPROT_ZEBRA 11 |
| 202 | #define RTPROT_BIRD 12 |
| 203 | #define RTPROT_DNROUTED 13 |
| 204 | #define RTPROT_XORP 14 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 205 | #define RTPROT_NTK 15 |
| 206 | #define RTPROT_DHCP 16 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 207 | #define RTPROT_MROUTED 17 |
| 208 | #define RTPROT_BABEL 42 |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 209 | #define RTPROT_BGP 186 |
| 210 | #define RTPROT_ISIS 187 |
| 211 | #define RTPROT_OSPF 188 |
| 212 | #define RTPROT_RIP 189 |
| 213 | #define RTPROT_EIGRP 192 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 214 | enum rt_scope_t { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 215 | RT_SCOPE_UNIVERSE = 0, |
| 216 | RT_SCOPE_SITE = 200, |
| 217 | RT_SCOPE_LINK = 253, |
| 218 | RT_SCOPE_HOST = 254, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 219 | RT_SCOPE_NOWHERE = 255 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 220 | }; |
| 221 | #define RTM_F_NOTIFY 0x100 |
| 222 | #define RTM_F_CLONED 0x200 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 223 | #define RTM_F_EQUALIZE 0x400 |
| 224 | #define RTM_F_PREFIX 0x800 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 225 | #define RTM_F_LOOKUP_TABLE 0x1000 |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 226 | #define RTM_F_FIB_MATCH 0x2000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 227 | enum rt_class_t { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 228 | RT_TABLE_UNSPEC = 0, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 229 | RT_TABLE_COMPAT = 252, |
| 230 | RT_TABLE_DEFAULT = 253, |
| 231 | RT_TABLE_MAIN = 254, |
| 232 | RT_TABLE_LOCAL = 255, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 233 | RT_TABLE_MAX = 0xFFFFFFFF |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 234 | }; |
| 235 | enum rtattr_type_t { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 236 | RTA_UNSPEC, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 237 | RTA_DST, |
| 238 | RTA_SRC, |
| 239 | RTA_IIF, |
| 240 | RTA_OIF, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 241 | RTA_GATEWAY, |
| 242 | RTA_PRIORITY, |
| 243 | RTA_PREFSRC, |
| 244 | RTA_METRICS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 245 | RTA_MULTIPATH, |
| 246 | RTA_PROTOINFO, |
| 247 | RTA_FLOW, |
| 248 | RTA_CACHEINFO, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 249 | RTA_SESSION, |
| 250 | RTA_MP_ALGO, |
| 251 | RTA_TABLE, |
| 252 | RTA_MARK, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 253 | RTA_MFC_STATS, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 254 | RTA_VIA, |
| 255 | RTA_NEWDST, |
| 256 | RTA_PREF, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 257 | RTA_ENCAP_TYPE, |
| 258 | RTA_ENCAP, |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 259 | RTA_EXPIRES, |
| 260 | RTA_PAD, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 261 | RTA_UID, |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 262 | RTA_TTL_PROPAGATE, |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 263 | RTA_IP_PROTO, |
| 264 | RTA_SPORT, |
| 265 | RTA_DPORT, |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 266 | RTA_NH_ID, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 267 | __RTA_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 268 | }; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 269 | #define RTA_MAX (__RTA_MAX - 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 270 | #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] | 271 | #define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct rtmsg)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 272 | struct rtnexthop { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 273 | unsigned short rtnh_len; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 274 | unsigned char rtnh_flags; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 275 | unsigned char rtnh_hops; |
| 276 | int rtnh_ifindex; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 277 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 278 | #define RTNH_F_DEAD 1 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 279 | #define RTNH_F_PERVASIVE 2 |
| 280 | #define RTNH_F_ONLINK 4 |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 281 | #define RTNH_F_OFFLOAD 8 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 282 | #define RTNH_F_LINKDOWN 16 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 283 | #define RTNH_F_UNRESOLVED 32 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 284 | #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] | 285 | #define RTNH_ALIGNTO 4 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 286 | #define RTNH_ALIGN(len) (((len) + RTNH_ALIGNTO - 1) & ~(RTNH_ALIGNTO - 1)) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 287 | #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] | 288 | #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] | 289 | #define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 290 | #define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len)) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 291 | #define RTNH_DATA(rtnh) ((struct rtattr *) (((char *) (rtnh)) + RTNH_LENGTH(0))) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 292 | struct rtvia { |
| 293 | __kernel_sa_family_t rtvia_family; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 294 | __u8 rtvia_addr[0]; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 295 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 296 | struct rta_cacheinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 297 | __u32 rta_clntref; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 298 | __u32 rta_lastuse; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 299 | __s32 rta_expires; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 300 | __u32 rta_error; |
| 301 | __u32 rta_used; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 302 | #define RTNETLINK_HAVE_PEERINFO 1 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 303 | __u32 rta_id; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 304 | __u32 rta_ts; |
| 305 | __u32 rta_tsage; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 306 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 307 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 308 | RTAX_UNSPEC, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 309 | #define RTAX_UNSPEC RTAX_UNSPEC |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 310 | RTAX_LOCK, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 311 | #define RTAX_LOCK RTAX_LOCK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 312 | RTAX_MTU, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 313 | #define RTAX_MTU RTAX_MTU |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 314 | RTAX_WINDOW, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 315 | #define RTAX_WINDOW RTAX_WINDOW |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 316 | RTAX_RTT, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 317 | #define RTAX_RTT RTAX_RTT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 318 | RTAX_RTTVAR, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 319 | #define RTAX_RTTVAR RTAX_RTTVAR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 320 | RTAX_SSTHRESH, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 321 | #define RTAX_SSTHRESH RTAX_SSTHRESH |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 322 | RTAX_CWND, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 323 | #define RTAX_CWND RTAX_CWND |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 324 | RTAX_ADVMSS, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 325 | #define RTAX_ADVMSS RTAX_ADVMSS |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 326 | RTAX_REORDERING, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 327 | #define RTAX_REORDERING RTAX_REORDERING |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 328 | RTAX_HOPLIMIT, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 329 | #define RTAX_HOPLIMIT RTAX_HOPLIMIT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 330 | RTAX_INITCWND, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 331 | #define RTAX_INITCWND RTAX_INITCWND |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 332 | RTAX_FEATURES, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 333 | #define RTAX_FEATURES RTAX_FEATURES |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 334 | RTAX_RTO_MIN, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 335 | #define RTAX_RTO_MIN RTAX_RTO_MIN |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 336 | RTAX_INITRWND, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 337 | #define RTAX_INITRWND RTAX_INITRWND |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 338 | RTAX_QUICKACK, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 339 | #define RTAX_QUICKACK RTAX_QUICKACK |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 340 | RTAX_CC_ALGO, |
| 341 | #define RTAX_CC_ALGO RTAX_CC_ALGO |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 342 | RTAX_FASTOPEN_NO_COOKIE, |
| 343 | #define RTAX_FASTOPEN_NO_COOKIE RTAX_FASTOPEN_NO_COOKIE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 344 | __RTAX_MAX |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 345 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 346 | #define RTAX_MAX (__RTAX_MAX - 1) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 347 | #define RTAX_FEATURE_ECN (1 << 0) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 348 | #define RTAX_FEATURE_SACK (1 << 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 349 | #define RTAX_FEATURE_TIMESTAMP (1 << 2) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 350 | #define RTAX_FEATURE_ALLFRAG (1 << 3) |
| 351 | #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] | 352 | struct rta_session { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 353 | __u8 proto; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 354 | __u8 pad1; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 355 | __u16 pad2; |
| 356 | union { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 357 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 358 | __u16 sport; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 359 | __u16 dport; |
| 360 | } ports; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 361 | struct { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 362 | __u8 type; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 363 | __u8 code; |
| 364 | __u16 ident; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 365 | } icmpt; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 366 | __u32 spi; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 367 | } u; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 368 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 369 | struct rta_mfc_stats { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 370 | __u64 mfcs_packets; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 371 | __u64 mfcs_bytes; |
| 372 | __u64 mfcs_wrong_if; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 373 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 374 | struct rtgenmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 375 | unsigned char rtgen_family; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 376 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 377 | struct ifinfomsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 378 | unsigned char ifi_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 379 | unsigned char __ifi_pad; |
| 380 | unsigned short ifi_type; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 381 | int ifi_index; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 382 | unsigned ifi_flags; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 383 | unsigned ifi_change; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 384 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 385 | struct prefixmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 386 | unsigned char prefix_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 387 | unsigned char prefix_pad1; |
| 388 | unsigned short prefix_pad2; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 389 | int prefix_ifindex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 390 | unsigned char prefix_type; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 391 | unsigned char prefix_len; |
| 392 | unsigned char prefix_flags; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 393 | unsigned char prefix_pad3; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 394 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 395 | enum { |
| 396 | PREFIX_UNSPEC, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 397 | PREFIX_ADDRESS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 398 | PREFIX_CACHEINFO, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 399 | __PREFIX_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 400 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 401 | #define PREFIX_MAX (__PREFIX_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 402 | struct prefix_cacheinfo { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 403 | __u32 preferred_time; |
| 404 | __u32 valid_time; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 405 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 406 | struct tcmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 407 | unsigned char tcm_family; |
| 408 | unsigned char tcm__pad1; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 409 | unsigned short tcm__pad2; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 410 | int tcm_ifindex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 411 | __u32 tcm_handle; |
| 412 | __u32 tcm_parent; |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 413 | #define tcm_block_index tcm_parent |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 414 | __u32 tcm_info; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 415 | }; |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 416 | #define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 417 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 418 | TCA_UNSPEC, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 419 | TCA_KIND, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 420 | TCA_OPTIONS, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 421 | TCA_STATS, |
| 422 | TCA_XSTATS, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 423 | TCA_RATE, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 424 | TCA_FCNT, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 425 | TCA_STATS2, |
| 426 | TCA_STAB, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 427 | TCA_PAD, |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 428 | TCA_DUMP_INVISIBLE, |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 429 | TCA_CHAIN, |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 430 | TCA_HW_OFFLOAD, |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 431 | TCA_INGRESS_BLOCK, |
| 432 | TCA_EGRESS_BLOCK, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 433 | __TCA_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 434 | }; |
| 435 | #define TCA_MAX (__TCA_MAX - 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 436 | #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] | 437 | #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcmsg)) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 438 | struct nduseroptmsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 439 | unsigned char nduseropt_family; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 440 | unsigned char nduseropt_pad1; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 441 | unsigned short nduseropt_opts_len; |
| 442 | int nduseropt_ifindex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 443 | __u8 nduseropt_icmp_type; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 444 | __u8 nduseropt_icmp_code; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 445 | unsigned short nduseropt_pad2; |
| 446 | unsigned int nduseropt_pad3; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 447 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 448 | enum { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 449 | NDUSEROPT_UNSPEC, |
| 450 | NDUSEROPT_SRCADDR, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 451 | __NDUSEROPT_MAX |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 452 | }; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 453 | #define NDUSEROPT_MAX (__NDUSEROPT_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 454 | #define RTMGRP_LINK 1 |
| 455 | #define RTMGRP_NOTIFY 2 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 456 | #define RTMGRP_NEIGH 4 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 457 | #define RTMGRP_TC 8 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 458 | #define RTMGRP_IPV4_IFADDR 0x10 |
| 459 | #define RTMGRP_IPV4_MROUTE 0x20 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 460 | #define RTMGRP_IPV4_ROUTE 0x40 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 461 | #define RTMGRP_IPV4_RULE 0x80 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 462 | #define RTMGRP_IPV6_IFADDR 0x100 |
| 463 | #define RTMGRP_IPV6_MROUTE 0x200 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 464 | #define RTMGRP_IPV6_ROUTE 0x400 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 465 | #define RTMGRP_IPV6_IFINFO 0x800 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 466 | #define RTMGRP_DECnet_IFADDR 0x1000 |
| 467 | #define RTMGRP_DECnet_ROUTE 0x4000 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 468 | #define RTMGRP_IPV6_PREFIX 0x20000 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 469 | enum rtnetlink_groups { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 470 | RTNLGRP_NONE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 471 | #define RTNLGRP_NONE RTNLGRP_NONE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 472 | RTNLGRP_LINK, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 473 | #define RTNLGRP_LINK RTNLGRP_LINK |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 474 | RTNLGRP_NOTIFY, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 475 | #define RTNLGRP_NOTIFY RTNLGRP_NOTIFY |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 476 | RTNLGRP_NEIGH, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 477 | #define RTNLGRP_NEIGH RTNLGRP_NEIGH |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 478 | RTNLGRP_TC, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 479 | #define RTNLGRP_TC RTNLGRP_TC |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 480 | RTNLGRP_IPV4_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 481 | #define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 482 | RTNLGRP_IPV4_MROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 483 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 484 | RTNLGRP_IPV4_ROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 485 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 486 | RTNLGRP_IPV4_RULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 487 | #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 488 | RTNLGRP_IPV6_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 489 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 490 | RTNLGRP_IPV6_MROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 491 | #define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 492 | RTNLGRP_IPV6_ROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 493 | #define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 494 | RTNLGRP_IPV6_IFINFO, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 495 | #define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 496 | RTNLGRP_DECnet_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 497 | #define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 498 | RTNLGRP_NOP2, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 499 | RTNLGRP_DECnet_ROUTE, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 500 | #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 501 | RTNLGRP_DECnet_RULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 502 | #define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 503 | RTNLGRP_NOP4, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 504 | RTNLGRP_IPV6_PREFIX, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 505 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 506 | RTNLGRP_IPV6_RULE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 507 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 508 | RTNLGRP_ND_USEROPT, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 509 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 510 | RTNLGRP_PHONET_IFADDR, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 511 | #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 512 | RTNLGRP_PHONET_ROUTE, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 513 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 514 | RTNLGRP_DCB, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 515 | #define RTNLGRP_DCB RTNLGRP_DCB |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 516 | RTNLGRP_IPV4_NETCONF, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 517 | #define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 518 | RTNLGRP_IPV6_NETCONF, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 519 | #define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 520 | RTNLGRP_MDB, |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 521 | #define RTNLGRP_MDB RTNLGRP_MDB |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 522 | RTNLGRP_MPLS_ROUTE, |
| 523 | #define RTNLGRP_MPLS_ROUTE RTNLGRP_MPLS_ROUTE |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 524 | RTNLGRP_NSID, |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 525 | #define RTNLGRP_NSID RTNLGRP_NSID |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 526 | RTNLGRP_MPLS_NETCONF, |
| 527 | #define RTNLGRP_MPLS_NETCONF RTNLGRP_MPLS_NETCONF |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 528 | RTNLGRP_IPV4_MROUTE_R, |
| 529 | #define RTNLGRP_IPV4_MROUTE_R RTNLGRP_IPV4_MROUTE_R |
| 530 | RTNLGRP_IPV6_MROUTE_R, |
| 531 | #define RTNLGRP_IPV6_MROUTE_R RTNLGRP_IPV6_MROUTE_R |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 532 | RTNLGRP_NEXTHOP, |
| 533 | #define RTNLGRP_NEXTHOP RTNLGRP_NEXTHOP |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 534 | __RTNLGRP_MAX |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 535 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 536 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 537 | struct tcamsg { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 538 | unsigned char tca_family; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 539 | unsigned char tca__pad1; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 540 | unsigned short tca__pad2; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 541 | }; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 542 | enum { |
| 543 | TCA_ROOT_UNSPEC, |
| 544 | TCA_ROOT_TAB, |
| 545 | #define TCA_ACT_TAB TCA_ROOT_TAB |
| 546 | #define TCAA_MAX TCA_ROOT_TAB |
| 547 | TCA_ROOT_FLAGS, |
| 548 | TCA_ROOT_COUNT, |
| 549 | TCA_ROOT_TIME_DELTA, |
| 550 | __TCA_ROOT_MAX, |
| 551 | #define TCA_ROOT_MAX (__TCA_ROOT_MAX - 1) |
| 552 | }; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 553 | #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] | 554 | #define TA_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct tcamsg)) |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 555 | #define TCA_FLAG_LARGE_DUMP_ON (1 << 0) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 556 | #define RTEXT_FILTER_VF (1 << 0) |
| 557 | #define RTEXT_FILTER_BRVLAN (1 << 1) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 558 | #define RTEXT_FILTER_BRVLAN_COMPRESSED (1 << 2) |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 559 | #define RTEXT_FILTER_SKIP_STATS (1 << 3) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 560 | #endif |