blob: 19fc02660e0c0e466a38cc4516f1054012b8e978 [file] [log] [blame]
Christopher Ferris25981132017-11-14 16:53:49 -08001/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
Ben Cheng224b54f2013-10-15 18:26:18 -07002#ifndef _UAPI_LINUX_IF_LINK_H
3#define _UAPI_LINUX_IF_LINK_H
4
5#include <linux/types.h>
6#include <linux/netlink.h>
7
8/* This struct should be in sync with struct rtnl_link_stats64 */
9struct rtnl_link_stats {
10 __u32 rx_packets; /* total packets received */
11 __u32 tx_packets; /* total packets transmitted */
12 __u32 rx_bytes; /* total bytes received */
13 __u32 tx_bytes; /* total bytes transmitted */
14 __u32 rx_errors; /* bad packets received */
15 __u32 tx_errors; /* packet transmit problems */
16 __u32 rx_dropped; /* no space in linux buffers */
17 __u32 tx_dropped; /* no space available in linux */
18 __u32 multicast; /* multicast packets received */
19 __u32 collisions;
20
21 /* detailed rx_errors: */
22 __u32 rx_length_errors;
23 __u32 rx_over_errors; /* receiver ring buff overflow */
24 __u32 rx_crc_errors; /* recved pkt with crc error */
25 __u32 rx_frame_errors; /* recv'd frame alignment error */
26 __u32 rx_fifo_errors; /* recv'r fifo overrun */
27 __u32 rx_missed_errors; /* receiver missed packet */
28
29 /* detailed tx_errors */
30 __u32 tx_aborted_errors;
31 __u32 tx_carrier_errors;
32 __u32 tx_fifo_errors;
33 __u32 tx_heartbeat_errors;
34 __u32 tx_window_errors;
35
36 /* for cslip etc */
37 __u32 rx_compressed;
38 __u32 tx_compressed;
Christopher Ferrisccfaccd2016-08-24 12:11:31 -070039
40 __u32 rx_nohandler; /* dropped, no handler found */
Ben Cheng224b54f2013-10-15 18:26:18 -070041};
42
43/* The main device statistics structure */
44struct rtnl_link_stats64 {
45 __u64 rx_packets; /* total packets received */
46 __u64 tx_packets; /* total packets transmitted */
47 __u64 rx_bytes; /* total bytes received */
48 __u64 tx_bytes; /* total bytes transmitted */
49 __u64 rx_errors; /* bad packets received */
50 __u64 tx_errors; /* packet transmit problems */
51 __u64 rx_dropped; /* no space in linux buffers */
52 __u64 tx_dropped; /* no space available in linux */
53 __u64 multicast; /* multicast packets received */
54 __u64 collisions;
55
56 /* detailed rx_errors: */
57 __u64 rx_length_errors;
58 __u64 rx_over_errors; /* receiver ring buff overflow */
59 __u64 rx_crc_errors; /* recved pkt with crc error */
60 __u64 rx_frame_errors; /* recv'd frame alignment error */
61 __u64 rx_fifo_errors; /* recv'r fifo overrun */
62 __u64 rx_missed_errors; /* receiver missed packet */
63
64 /* detailed tx_errors */
65 __u64 tx_aborted_errors;
66 __u64 tx_carrier_errors;
67 __u64 tx_fifo_errors;
68 __u64 tx_heartbeat_errors;
69 __u64 tx_window_errors;
70
71 /* for cslip etc */
72 __u64 rx_compressed;
73 __u64 tx_compressed;
Christopher Ferrisccfaccd2016-08-24 12:11:31 -070074
75 __u64 rx_nohandler; /* dropped, no handler found */
Ben Cheng224b54f2013-10-15 18:26:18 -070076};
77
78/* The struct should be in sync with struct ifmap */
79struct rtnl_link_ifmap {
80 __u64 mem_start;
81 __u64 mem_end;
82 __u64 base_addr;
83 __u16 irq;
84 __u8 dma;
85 __u8 port;
86};
87
88/*
89 * IFLA_AF_SPEC
90 * Contains nested attributes for address family specific attributes.
91 * Each address family may create a attribute with the address family
92 * number as type and create its own attribute structure in it.
93 *
94 * Example:
95 * [IFLA_AF_SPEC] = {
96 * [AF_INET] = {
97 * [IFLA_INET_CONF] = ...,
98 * },
99 * [AF_INET6] = {
100 * [IFLA_INET6_FLAGS] = ...,
101 * [IFLA_INET6_CONF] = ...,
102 * }
103 * }
104 */
105
106enum {
107 IFLA_UNSPEC,
108 IFLA_ADDRESS,
109 IFLA_BROADCAST,
110 IFLA_IFNAME,
111 IFLA_MTU,
112 IFLA_LINK,
113 IFLA_QDISC,
114 IFLA_STATS,
115 IFLA_COST,
116#define IFLA_COST IFLA_COST
117 IFLA_PRIORITY,
118#define IFLA_PRIORITY IFLA_PRIORITY
119 IFLA_MASTER,
120#define IFLA_MASTER IFLA_MASTER
121 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
122#define IFLA_WIRELESS IFLA_WIRELESS
123 IFLA_PROTINFO, /* Protocol specific information for a link */
124#define IFLA_PROTINFO IFLA_PROTINFO
125 IFLA_TXQLEN,
126#define IFLA_TXQLEN IFLA_TXQLEN
127 IFLA_MAP,
128#define IFLA_MAP IFLA_MAP
129 IFLA_WEIGHT,
130#define IFLA_WEIGHT IFLA_WEIGHT
131 IFLA_OPERSTATE,
132 IFLA_LINKMODE,
133 IFLA_LINKINFO,
134#define IFLA_LINKINFO IFLA_LINKINFO
135 IFLA_NET_NS_PID,
136 IFLA_IFALIAS,
137 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
138 IFLA_VFINFO_LIST,
139 IFLA_STATS64,
140 IFLA_VF_PORTS,
141 IFLA_PORT_SELF,
142 IFLA_AF_SPEC,
143 IFLA_GROUP, /* Group the device belongs to */
144 IFLA_NET_NS_FD,
145 IFLA_EXT_MASK, /* Extended info mask, VFs, etc */
146 IFLA_PROMISCUITY, /* Promiscuity count: > 0 means acts PROMISC */
147#define IFLA_PROMISCUITY IFLA_PROMISCUITY
148 IFLA_NUM_TX_QUEUES,
149 IFLA_NUM_RX_QUEUES,
150 IFLA_CARRIER,
Christopher Ferrise0845012014-07-09 14:58:51 -0700151 IFLA_PHYS_PORT_ID,
Christopher Ferris31475242014-09-02 17:43:51 -0700152 IFLA_CARRIER_CHANGES,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800153 IFLA_PHYS_SWITCH_ID,
154 IFLA_LINK_NETNSID,
155 IFLA_PHYS_PORT_NAME,
156 IFLA_PROTO_DOWN,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700157 IFLA_GSO_MAX_SEGS,
158 IFLA_GSO_MAX_SIZE,
159 IFLA_PAD,
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800160 IFLA_XDP,
Christopher Ferris25981132017-11-14 16:53:49 -0800161 IFLA_EVENT,
Christopher Ferrisa1a109e2018-01-31 15:03:12 -0800162 IFLA_NEW_NETNSID,
163 IFLA_IF_NETNSID,
Ben Cheng224b54f2013-10-15 18:26:18 -0700164 __IFLA_MAX
165};
166
167
168#define IFLA_MAX (__IFLA_MAX - 1)
169
170/* backwards compatibility for userspace */
171#ifndef __KERNEL__
172#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
173#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
174#endif
175
176enum {
177 IFLA_INET_UNSPEC,
178 IFLA_INET_CONF,
179 __IFLA_INET_MAX,
180};
181
182#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
183
184/* ifi_flags.
185
186 IFF_* flags.
187
188 The only change is:
189 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
190 more not changeable by user. They describe link media
191 characteristics and set by device driver.
192
193 Comments:
194 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
195 - If neither of these three flags are set;
196 the interface is NBMA.
197
198 - IFF_MULTICAST does not mean anything special:
199 multicasts can be used on all not-NBMA links.
200 IFF_MULTICAST means that this media uses special encapsulation
201 for multicast frames. Apparently, all IFF_POINTOPOINT and
202 IFF_BROADCAST devices are able to use multicasts too.
203 */
204
205/* IFLA_LINK.
206 For usual devices it is equal ifi_index.
207 If it is a "virtual interface" (f.e. tunnel), ifi_link
208 can point to real physical interface (f.e. for bandwidth calculations),
209 or maybe 0, what means, that real media is unknown (usual
210 for IPIP tunnels, when route to endpoint is allowed to change)
211 */
212
213/* Subtype attributes for IFLA_PROTINFO */
214enum {
215 IFLA_INET6_UNSPEC,
216 IFLA_INET6_FLAGS, /* link flags */
217 IFLA_INET6_CONF, /* sysctl parameters */
218 IFLA_INET6_STATS, /* statistics */
219 IFLA_INET6_MCAST, /* MC things. What of them? */
220 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
221 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
222 IFLA_INET6_TOKEN, /* device token */
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800223 IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
Ben Cheng224b54f2013-10-15 18:26:18 -0700224 __IFLA_INET6_MAX
225};
226
227#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
228
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800229enum in6_addr_gen_mode {
230 IN6_ADDR_GEN_MODE_EUI64,
231 IN6_ADDR_GEN_MODE_NONE,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800232 IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700233 IN6_ADDR_GEN_MODE_RANDOM,
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800234};
235
236/* Bridge section */
237
238enum {
239 IFLA_BR_UNSPEC,
240 IFLA_BR_FORWARD_DELAY,
241 IFLA_BR_HELLO_TIME,
242 IFLA_BR_MAX_AGE,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800243 IFLA_BR_AGEING_TIME,
244 IFLA_BR_STP_STATE,
245 IFLA_BR_PRIORITY,
246 IFLA_BR_VLAN_FILTERING,
247 IFLA_BR_VLAN_PROTOCOL,
248 IFLA_BR_GROUP_FWD_MASK,
249 IFLA_BR_ROOT_ID,
250 IFLA_BR_BRIDGE_ID,
251 IFLA_BR_ROOT_PORT,
252 IFLA_BR_ROOT_PATH_COST,
253 IFLA_BR_TOPOLOGY_CHANGE,
254 IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
255 IFLA_BR_HELLO_TIMER,
256 IFLA_BR_TCN_TIMER,
257 IFLA_BR_TOPOLOGY_CHANGE_TIMER,
258 IFLA_BR_GC_TIMER,
259 IFLA_BR_GROUP_ADDR,
260 IFLA_BR_FDB_FLUSH,
261 IFLA_BR_MCAST_ROUTER,
262 IFLA_BR_MCAST_SNOOPING,
263 IFLA_BR_MCAST_QUERY_USE_IFADDR,
264 IFLA_BR_MCAST_QUERIER,
265 IFLA_BR_MCAST_HASH_ELASTICITY,
266 IFLA_BR_MCAST_HASH_MAX,
267 IFLA_BR_MCAST_LAST_MEMBER_CNT,
268 IFLA_BR_MCAST_STARTUP_QUERY_CNT,
269 IFLA_BR_MCAST_LAST_MEMBER_INTVL,
270 IFLA_BR_MCAST_MEMBERSHIP_INTVL,
271 IFLA_BR_MCAST_QUERIER_INTVL,
272 IFLA_BR_MCAST_QUERY_INTVL,
273 IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
274 IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
275 IFLA_BR_NF_CALL_IPTABLES,
276 IFLA_BR_NF_CALL_IP6TABLES,
277 IFLA_BR_NF_CALL_ARPTABLES,
278 IFLA_BR_VLAN_DEFAULT_PVID,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700279 IFLA_BR_PAD,
280 IFLA_BR_VLAN_STATS_ENABLED,
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800281 IFLA_BR_MCAST_STATS_ENABLED,
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800282 IFLA_BR_MCAST_IGMP_VERSION,
283 IFLA_BR_MCAST_MLD_VERSION,
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800284 __IFLA_BR_MAX,
285};
286
287#define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
288
Christopher Ferris12e1f282016-02-04 12:35:07 -0800289struct ifla_bridge_id {
290 __u8 prio[2];
291 __u8 addr[6]; /* ETH_ALEN */
292};
293
Ben Cheng224b54f2013-10-15 18:26:18 -0700294enum {
295 BRIDGE_MODE_UNSPEC,
296 BRIDGE_MODE_HAIRPIN,
297};
298
299enum {
300 IFLA_BRPORT_UNSPEC,
301 IFLA_BRPORT_STATE, /* Spanning tree state */
302 IFLA_BRPORT_PRIORITY, /* " priority */
303 IFLA_BRPORT_COST, /* " cost */
304 IFLA_BRPORT_MODE, /* mode (hairpin) */
305 IFLA_BRPORT_GUARD, /* bpdu guard */
306 IFLA_BRPORT_PROTECT, /* root port protection */
307 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
Christopher Ferrise0845012014-07-09 14:58:51 -0700308 IFLA_BRPORT_LEARNING, /* mac learning */
309 IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800310 IFLA_BRPORT_PROXYARP, /* proxy ARP */
311 IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
312 IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
313 IFLA_BRPORT_ROOT_ID, /* designated root */
314 IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
315 IFLA_BRPORT_DESIGNATED_PORT,
316 IFLA_BRPORT_DESIGNATED_COST,
317 IFLA_BRPORT_ID,
318 IFLA_BRPORT_NO,
319 IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
320 IFLA_BRPORT_CONFIG_PENDING,
321 IFLA_BRPORT_MESSAGE_AGE_TIMER,
322 IFLA_BRPORT_FORWARD_DELAY_TIMER,
323 IFLA_BRPORT_HOLD_TIMER,
324 IFLA_BRPORT_FLUSH,
325 IFLA_BRPORT_MULTICAST_ROUTER,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700326 IFLA_BRPORT_PAD,
Christopher Ferris33185402017-01-13 13:28:52 -0800327 IFLA_BRPORT_MCAST_FLOOD,
Christopher Ferris0543f742017-07-26 13:09:46 -0700328 IFLA_BRPORT_MCAST_TO_UCAST,
329 IFLA_BRPORT_VLAN_TUNNEL,
330 IFLA_BRPORT_BCAST_FLOOD,
Christopher Ferrisa1a109e2018-01-31 15:03:12 -0800331 IFLA_BRPORT_GROUP_FWD_MASK,
332 IFLA_BRPORT_NEIGH_SUPPRESS,
Ben Cheng224b54f2013-10-15 18:26:18 -0700333 __IFLA_BRPORT_MAX
334};
335#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
336
337struct ifla_cacheinfo {
338 __u32 max_reasm_len;
339 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
340 __u32 reachable_time;
341 __u32 retrans_time;
342};
343
344enum {
345 IFLA_INFO_UNSPEC,
346 IFLA_INFO_KIND,
347 IFLA_INFO_DATA,
348 IFLA_INFO_XSTATS,
Christopher Ferrise0845012014-07-09 14:58:51 -0700349 IFLA_INFO_SLAVE_KIND,
350 IFLA_INFO_SLAVE_DATA,
Ben Cheng224b54f2013-10-15 18:26:18 -0700351 __IFLA_INFO_MAX,
352};
353
354#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
355
356/* VLAN section */
357
358enum {
359 IFLA_VLAN_UNSPEC,
360 IFLA_VLAN_ID,
361 IFLA_VLAN_FLAGS,
362 IFLA_VLAN_EGRESS_QOS,
363 IFLA_VLAN_INGRESS_QOS,
364 IFLA_VLAN_PROTOCOL,
365 __IFLA_VLAN_MAX,
366};
367
368#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
369
370struct ifla_vlan_flags {
371 __u32 flags;
372 __u32 mask;
373};
374
375enum {
376 IFLA_VLAN_QOS_UNSPEC,
377 IFLA_VLAN_QOS_MAPPING,
378 __IFLA_VLAN_QOS_MAX
379};
380
381#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
382
383struct ifla_vlan_qos_mapping {
384 __u32 from;
385 __u32 to;
386};
387
388/* MACVLAN section */
389enum {
390 IFLA_MACVLAN_UNSPEC,
391 IFLA_MACVLAN_MODE,
392 IFLA_MACVLAN_FLAGS,
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800393 IFLA_MACVLAN_MACADDR_MODE,
394 IFLA_MACVLAN_MACADDR,
395 IFLA_MACVLAN_MACADDR_DATA,
396 IFLA_MACVLAN_MACADDR_COUNT,
Ben Cheng224b54f2013-10-15 18:26:18 -0700397 __IFLA_MACVLAN_MAX,
398};
399
400#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
401
402enum macvlan_mode {
403 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
404 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
405 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
406 MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800407 MACVLAN_MODE_SOURCE = 16,/* use source MAC address list to assign */
408};
409
410enum macvlan_macaddr_mode {
411 MACVLAN_MACADDR_ADD,
412 MACVLAN_MACADDR_DEL,
413 MACVLAN_MACADDR_FLUSH,
414 MACVLAN_MACADDR_SET,
Ben Cheng224b54f2013-10-15 18:26:18 -0700415};
416
417#define MACVLAN_FLAG_NOPROMISC 1
418
Christopher Ferris12e1f282016-02-04 12:35:07 -0800419/* VRF section */
420enum {
421 IFLA_VRF_UNSPEC,
422 IFLA_VRF_TABLE,
423 __IFLA_VRF_MAX
424};
425
426#define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
427
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700428enum {
429 IFLA_VRF_PORT_UNSPEC,
430 IFLA_VRF_PORT_TABLE,
431 __IFLA_VRF_PORT_MAX
432};
433
434#define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
435
436/* MACSEC section */
437enum {
438 IFLA_MACSEC_UNSPEC,
439 IFLA_MACSEC_SCI,
440 IFLA_MACSEC_PORT,
441 IFLA_MACSEC_ICV_LEN,
442 IFLA_MACSEC_CIPHER_SUITE,
443 IFLA_MACSEC_WINDOW,
444 IFLA_MACSEC_ENCODING_SA,
445 IFLA_MACSEC_ENCRYPT,
446 IFLA_MACSEC_PROTECT,
447 IFLA_MACSEC_INC_SCI,
448 IFLA_MACSEC_ES,
449 IFLA_MACSEC_SCB,
450 IFLA_MACSEC_REPLAY_PROTECT,
451 IFLA_MACSEC_VALIDATION,
452 IFLA_MACSEC_PAD,
453 __IFLA_MACSEC_MAX,
454};
455
456#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
457
458enum macsec_validation_type {
459 MACSEC_VALIDATE_DISABLED = 0,
460 MACSEC_VALIDATE_CHECK = 1,
461 MACSEC_VALIDATE_STRICT = 2,
462 __MACSEC_VALIDATE_END,
463 MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
464};
465
Christopher Ferris12e1f282016-02-04 12:35:07 -0800466/* IPVLAN section */
467enum {
468 IFLA_IPVLAN_UNSPEC,
469 IFLA_IPVLAN_MODE,
Christopher Ferrisa1a109e2018-01-31 15:03:12 -0800470 IFLA_IPVLAN_FLAGS,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800471 __IFLA_IPVLAN_MAX
472};
473
474#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
475
476enum ipvlan_mode {
477 IPVLAN_MODE_L2 = 0,
478 IPVLAN_MODE_L3,
Christopher Ferris33185402017-01-13 13:28:52 -0800479 IPVLAN_MODE_L3S,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800480 IPVLAN_MODE_MAX
481};
482
Christopher Ferrisa1a109e2018-01-31 15:03:12 -0800483#define IPVLAN_F_PRIVATE 0x01
484#define IPVLAN_F_VEPA 0x02
485
Ben Cheng224b54f2013-10-15 18:26:18 -0700486/* VXLAN section */
487enum {
488 IFLA_VXLAN_UNSPEC,
489 IFLA_VXLAN_ID,
490 IFLA_VXLAN_GROUP, /* group or remote address */
491 IFLA_VXLAN_LINK,
492 IFLA_VXLAN_LOCAL,
493 IFLA_VXLAN_TTL,
494 IFLA_VXLAN_TOS,
495 IFLA_VXLAN_LEARNING,
496 IFLA_VXLAN_AGEING,
497 IFLA_VXLAN_LIMIT,
498 IFLA_VXLAN_PORT_RANGE, /* source port */
499 IFLA_VXLAN_PROXY,
500 IFLA_VXLAN_RSC,
501 IFLA_VXLAN_L2MISS,
502 IFLA_VXLAN_L3MISS,
503 IFLA_VXLAN_PORT, /* destination port */
Christopher Ferrise0845012014-07-09 14:58:51 -0700504 IFLA_VXLAN_GROUP6,
505 IFLA_VXLAN_LOCAL6,
Christopher Ferris31475242014-09-02 17:43:51 -0700506 IFLA_VXLAN_UDP_CSUM,
507 IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
508 IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800509 IFLA_VXLAN_REMCSUM_TX,
510 IFLA_VXLAN_REMCSUM_RX,
511 IFLA_VXLAN_GBP,
512 IFLA_VXLAN_REMCSUM_NOPARTIAL,
513 IFLA_VXLAN_COLLECT_METADATA,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700514 IFLA_VXLAN_LABEL,
515 IFLA_VXLAN_GPE,
Ben Cheng224b54f2013-10-15 18:26:18 -0700516 __IFLA_VXLAN_MAX
517};
518#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
519
520struct ifla_vxlan_port_range {
521 __be16 low;
522 __be16 high;
523};
524
Christopher Ferris12e1f282016-02-04 12:35:07 -0800525/* GENEVE section */
526enum {
527 IFLA_GENEVE_UNSPEC,
528 IFLA_GENEVE_ID,
529 IFLA_GENEVE_REMOTE,
530 IFLA_GENEVE_TTL,
531 IFLA_GENEVE_TOS,
532 IFLA_GENEVE_PORT, /* destination port */
533 IFLA_GENEVE_COLLECT_METADATA,
534 IFLA_GENEVE_REMOTE6,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700535 IFLA_GENEVE_UDP_CSUM,
536 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
537 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
538 IFLA_GENEVE_LABEL,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800539 __IFLA_GENEVE_MAX
540};
541#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
542
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700543/* PPP section */
544enum {
545 IFLA_PPP_UNSPEC,
546 IFLA_PPP_DEV_FD,
547 __IFLA_PPP_MAX
548};
549#define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
550
551/* GTP section */
Christopher Ferris0543f742017-07-26 13:09:46 -0700552
553enum ifla_gtp_role {
554 GTP_ROLE_GGSN = 0,
555 GTP_ROLE_SGSN,
556};
557
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700558enum {
559 IFLA_GTP_UNSPEC,
560 IFLA_GTP_FD0,
561 IFLA_GTP_FD1,
562 IFLA_GTP_PDP_HASHSIZE,
Christopher Ferris0543f742017-07-26 13:09:46 -0700563 IFLA_GTP_ROLE,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700564 __IFLA_GTP_MAX,
565};
566#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
567
Christopher Ferrise0845012014-07-09 14:58:51 -0700568/* Bonding section */
569
570enum {
571 IFLA_BOND_UNSPEC,
572 IFLA_BOND_MODE,
573 IFLA_BOND_ACTIVE_SLAVE,
574 IFLA_BOND_MIIMON,
575 IFLA_BOND_UPDELAY,
576 IFLA_BOND_DOWNDELAY,
577 IFLA_BOND_USE_CARRIER,
578 IFLA_BOND_ARP_INTERVAL,
579 IFLA_BOND_ARP_IP_TARGET,
580 IFLA_BOND_ARP_VALIDATE,
581 IFLA_BOND_ARP_ALL_TARGETS,
582 IFLA_BOND_PRIMARY,
583 IFLA_BOND_PRIMARY_RESELECT,
584 IFLA_BOND_FAIL_OVER_MAC,
585 IFLA_BOND_XMIT_HASH_POLICY,
586 IFLA_BOND_RESEND_IGMP,
587 IFLA_BOND_NUM_PEER_NOTIF,
588 IFLA_BOND_ALL_SLAVES_ACTIVE,
589 IFLA_BOND_MIN_LINKS,
590 IFLA_BOND_LP_INTERVAL,
591 IFLA_BOND_PACKETS_PER_SLAVE,
592 IFLA_BOND_AD_LACP_RATE,
593 IFLA_BOND_AD_SELECT,
594 IFLA_BOND_AD_INFO,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800595 IFLA_BOND_AD_ACTOR_SYS_PRIO,
596 IFLA_BOND_AD_USER_PORT_KEY,
597 IFLA_BOND_AD_ACTOR_SYSTEM,
598 IFLA_BOND_TLB_DYNAMIC_LB,
Christopher Ferrise0845012014-07-09 14:58:51 -0700599 __IFLA_BOND_MAX,
600};
601
602#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
603
604enum {
605 IFLA_BOND_AD_INFO_UNSPEC,
606 IFLA_BOND_AD_INFO_AGGREGATOR,
607 IFLA_BOND_AD_INFO_NUM_PORTS,
608 IFLA_BOND_AD_INFO_ACTOR_KEY,
609 IFLA_BOND_AD_INFO_PARTNER_KEY,
610 IFLA_BOND_AD_INFO_PARTNER_MAC,
611 __IFLA_BOND_AD_INFO_MAX,
612};
613
614#define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
615
616enum {
617 IFLA_BOND_SLAVE_UNSPEC,
618 IFLA_BOND_SLAVE_STATE,
619 IFLA_BOND_SLAVE_MII_STATUS,
620 IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
621 IFLA_BOND_SLAVE_PERM_HWADDR,
622 IFLA_BOND_SLAVE_QUEUE_ID,
623 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800624 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
625 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
Christopher Ferrise0845012014-07-09 14:58:51 -0700626 __IFLA_BOND_SLAVE_MAX,
627};
628
629#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
630
Ben Cheng224b54f2013-10-15 18:26:18 -0700631/* SR-IOV virtual function management section */
632
633enum {
634 IFLA_VF_INFO_UNSPEC,
635 IFLA_VF_INFO,
636 __IFLA_VF_INFO_MAX,
637};
638
639#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
640
641enum {
642 IFLA_VF_UNSPEC,
643 IFLA_VF_MAC, /* Hardware queue specific attributes */
Christopher Ferris33185402017-01-13 13:28:52 -0800644 IFLA_VF_VLAN, /* VLAN ID and QoS */
Christopher Ferris31475242014-09-02 17:43:51 -0700645 IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
Ben Cheng224b54f2013-10-15 18:26:18 -0700646 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
Christopher Ferrise0845012014-07-09 14:58:51 -0700647 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
Christopher Ferris31475242014-09-02 17:43:51 -0700648 IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800649 IFLA_VF_RSS_QUERY_EN, /* RSS Redirection Table and Hash Key query
650 * on/off switch
651 */
652 IFLA_VF_STATS, /* network device statistics */
653 IFLA_VF_TRUST, /* Trust VF */
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700654 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
655 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
Christopher Ferris33185402017-01-13 13:28:52 -0800656 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
Ben Cheng224b54f2013-10-15 18:26:18 -0700657 __IFLA_VF_MAX,
658};
659
660#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
661
662struct ifla_vf_mac {
663 __u32 vf;
664 __u8 mac[32]; /* MAX_ADDR_LEN */
665};
666
667struct ifla_vf_vlan {
668 __u32 vf;
669 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
670 __u32 qos;
671};
672
Christopher Ferris33185402017-01-13 13:28:52 -0800673enum {
674 IFLA_VF_VLAN_INFO_UNSPEC,
675 IFLA_VF_VLAN_INFO, /* VLAN ID, QoS and VLAN protocol */
676 __IFLA_VF_VLAN_INFO_MAX,
677};
678
679#define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
680#define MAX_VLAN_LIST_LEN 1
681
682struct ifla_vf_vlan_info {
683 __u32 vf;
684 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
685 __u32 qos;
686 __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
687};
688
Ben Cheng224b54f2013-10-15 18:26:18 -0700689struct ifla_vf_tx_rate {
690 __u32 vf;
691 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
692};
693
Christopher Ferris31475242014-09-02 17:43:51 -0700694struct ifla_vf_rate {
695 __u32 vf;
696 __u32 min_tx_rate; /* Min Bandwidth in Mbps */
697 __u32 max_tx_rate; /* Max Bandwidth in Mbps */
698};
699
Ben Cheng224b54f2013-10-15 18:26:18 -0700700struct ifla_vf_spoofchk {
701 __u32 vf;
702 __u32 setting;
703};
704
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700705struct ifla_vf_guid {
706 __u32 vf;
707 __u64 guid;
708};
709
Christopher Ferrise0845012014-07-09 14:58:51 -0700710enum {
711 IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
712 IFLA_VF_LINK_STATE_ENABLE, /* link always up */
713 IFLA_VF_LINK_STATE_DISABLE, /* link always down */
714 __IFLA_VF_LINK_STATE_MAX,
715};
716
717struct ifla_vf_link_state {
718 __u32 vf;
719 __u32 link_state;
720};
721
Christopher Ferris12e1f282016-02-04 12:35:07 -0800722struct ifla_vf_rss_query_en {
723 __u32 vf;
724 __u32 setting;
725};
726
727enum {
728 IFLA_VF_STATS_RX_PACKETS,
729 IFLA_VF_STATS_TX_PACKETS,
730 IFLA_VF_STATS_RX_BYTES,
731 IFLA_VF_STATS_TX_BYTES,
732 IFLA_VF_STATS_BROADCAST,
733 IFLA_VF_STATS_MULTICAST,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700734 IFLA_VF_STATS_PAD,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800735 __IFLA_VF_STATS_MAX,
736};
737
738#define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
739
740struct ifla_vf_trust {
741 __u32 vf;
742 __u32 setting;
743};
744
Ben Cheng224b54f2013-10-15 18:26:18 -0700745/* VF ports management section
746 *
747 * Nested layout of set/get msg is:
748 *
749 * [IFLA_NUM_VF]
750 * [IFLA_VF_PORTS]
751 * [IFLA_VF_PORT]
752 * [IFLA_PORT_*], ...
753 * [IFLA_VF_PORT]
754 * [IFLA_PORT_*], ...
755 * ...
756 * [IFLA_PORT_SELF]
757 * [IFLA_PORT_*], ...
758 */
759
760enum {
761 IFLA_VF_PORT_UNSPEC,
762 IFLA_VF_PORT, /* nest */
763 __IFLA_VF_PORT_MAX,
764};
765
766#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
767
768enum {
769 IFLA_PORT_UNSPEC,
770 IFLA_PORT_VF, /* __u32 */
771 IFLA_PORT_PROFILE, /* string */
772 IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
773 IFLA_PORT_INSTANCE_UUID, /* binary UUID */
774 IFLA_PORT_HOST_UUID, /* binary UUID */
775 IFLA_PORT_REQUEST, /* __u8 */
776 IFLA_PORT_RESPONSE, /* __u16, output only */
777 __IFLA_PORT_MAX,
778};
779
780#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
781
782#define PORT_PROFILE_MAX 40
783#define PORT_UUID_MAX 16
784#define PORT_SELF_VF -1
785
786enum {
787 PORT_REQUEST_PREASSOCIATE = 0,
788 PORT_REQUEST_PREASSOCIATE_RR,
789 PORT_REQUEST_ASSOCIATE,
790 PORT_REQUEST_DISASSOCIATE,
791};
792
793enum {
794 PORT_VDP_RESPONSE_SUCCESS = 0,
795 PORT_VDP_RESPONSE_INVALID_FORMAT,
796 PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
797 PORT_VDP_RESPONSE_UNUSED_VTID,
798 PORT_VDP_RESPONSE_VTID_VIOLATION,
799 PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
800 PORT_VDP_RESPONSE_OUT_OF_SYNC,
801 /* 0x08-0xFF reserved for future VDP use */
802 PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
803 PORT_PROFILE_RESPONSE_INPROGRESS,
804 PORT_PROFILE_RESPONSE_INVALID,
805 PORT_PROFILE_RESPONSE_BADSTATE,
806 PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
807 PORT_PROFILE_RESPONSE_ERROR,
808};
809
810struct ifla_port_vsi {
811 __u8 vsi_mgr_id;
812 __u8 vsi_type_id[3];
813 __u8 vsi_type_version;
814 __u8 pad[3];
815};
816
817
818/* IPoIB section */
819
820enum {
821 IFLA_IPOIB_UNSPEC,
822 IFLA_IPOIB_PKEY,
823 IFLA_IPOIB_MODE,
824 IFLA_IPOIB_UMCAST,
825 __IFLA_IPOIB_MAX
826};
827
828enum {
829 IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
830 IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
831};
832
833#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
834
Christopher Ferrise0845012014-07-09 14:58:51 -0700835
836/* HSR section */
837
838enum {
839 IFLA_HSR_UNSPEC,
840 IFLA_HSR_SLAVE1,
841 IFLA_HSR_SLAVE2,
842 IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */
843 IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
844 IFLA_HSR_SEQ_NR,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700845 IFLA_HSR_VERSION, /* HSR version */
Christopher Ferrise0845012014-07-09 14:58:51 -0700846 __IFLA_HSR_MAX,
847};
848
849#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
850
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700851/* STATS section */
852
853struct if_stats_msg {
854 __u8 family;
855 __u8 pad1;
856 __u16 pad2;
857 __u32 ifindex;
858 __u32 filter_mask;
859};
860
861/* A stats attribute can be netdev specific or a global stat.
862 * For netdev stats, lets use the prefix IFLA_STATS_LINK_*
863 */
864enum {
865 IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
866 IFLA_STATS_LINK_64,
867 IFLA_STATS_LINK_XSTATS,
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800868 IFLA_STATS_LINK_XSTATS_SLAVE,
Christopher Ferris33185402017-01-13 13:28:52 -0800869 IFLA_STATS_LINK_OFFLOAD_XSTATS,
Christopher Ferris0543f742017-07-26 13:09:46 -0700870 IFLA_STATS_AF_SPEC,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700871 __IFLA_STATS_MAX,
872};
873
874#define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
875
876#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
877
878/* These are embedded into IFLA_STATS_LINK_XSTATS:
879 * [IFLA_STATS_LINK_XSTATS]
880 * -> [LINK_XSTATS_TYPE_xxx]
881 * -> [rtnl link type specific attributes]
882 */
883enum {
884 LINK_XSTATS_TYPE_UNSPEC,
885 LINK_XSTATS_TYPE_BRIDGE,
886 __LINK_XSTATS_TYPE_MAX
887};
888#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
889
Christopher Ferris33185402017-01-13 13:28:52 -0800890/* These are stats embedded into IFLA_STATS_LINK_OFFLOAD_XSTATS */
891enum {
892 IFLA_OFFLOAD_XSTATS_UNSPEC,
893 IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
894 __IFLA_OFFLOAD_XSTATS_MAX
895};
896#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
897
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800898/* XDP section */
899
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800900#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
Christopher Ferris0543f742017-07-26 13:09:46 -0700901#define XDP_FLAGS_SKB_MODE (1U << 1)
902#define XDP_FLAGS_DRV_MODE (1U << 2)
Christopher Ferris25981132017-11-14 16:53:49 -0800903#define XDP_FLAGS_HW_MODE (1U << 3)
904#define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \
905 XDP_FLAGS_DRV_MODE | \
906 XDP_FLAGS_HW_MODE)
Christopher Ferris0543f742017-07-26 13:09:46 -0700907#define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \
Christopher Ferris25981132017-11-14 16:53:49 -0800908 XDP_FLAGS_MODES)
Christopher Ferris0543f742017-07-26 13:09:46 -0700909
910/* These are stored into IFLA_XDP_ATTACHED on dump. */
911enum {
912 XDP_ATTACHED_NONE = 0,
913 XDP_ATTACHED_DRV,
914 XDP_ATTACHED_SKB,
Christopher Ferris25981132017-11-14 16:53:49 -0800915 XDP_ATTACHED_HW,
Christopher Ferris0543f742017-07-26 13:09:46 -0700916};
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800917
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800918enum {
919 IFLA_XDP_UNSPEC,
920 IFLA_XDP_FD,
921 IFLA_XDP_ATTACHED,
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800922 IFLA_XDP_FLAGS,
Christopher Ferris25981132017-11-14 16:53:49 -0800923 IFLA_XDP_PROG_ID,
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800924 __IFLA_XDP_MAX,
925};
926
927#define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
928
Christopher Ferris25981132017-11-14 16:53:49 -0800929enum {
930 IFLA_EVENT_NONE,
931 IFLA_EVENT_REBOOT, /* internal reset / reboot */
932 IFLA_EVENT_FEATURES, /* change in offload features */
933 IFLA_EVENT_BONDING_FAILOVER, /* change in active slave */
934 IFLA_EVENT_NOTIFY_PEERS, /* re-sent grat. arp/ndisc */
935 IFLA_EVENT_IGMP_RESEND, /* re-sent IGMP JOIN */
936 IFLA_EVENT_BONDING_OPTIONS, /* change in bonding options */
937};
938
Ben Cheng224b54f2013-10-15 18:26:18 -0700939#endif /* _UAPI_LINUX_IF_LINK_H */