blob: 1f00f0cd67907c43bd801139a255128952f35619 [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,
Ben Cheng224b54f2013-10-15 18:26:18 -0700162 __IFLA_MAX
163};
164
165
166#define IFLA_MAX (__IFLA_MAX - 1)
167
168/* backwards compatibility for userspace */
169#ifndef __KERNEL__
170#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
171#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
172#endif
173
174enum {
175 IFLA_INET_UNSPEC,
176 IFLA_INET_CONF,
177 __IFLA_INET_MAX,
178};
179
180#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
181
182/* ifi_flags.
183
184 IFF_* flags.
185
186 The only change is:
187 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
188 more not changeable by user. They describe link media
189 characteristics and set by device driver.
190
191 Comments:
192 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
193 - If neither of these three flags are set;
194 the interface is NBMA.
195
196 - IFF_MULTICAST does not mean anything special:
197 multicasts can be used on all not-NBMA links.
198 IFF_MULTICAST means that this media uses special encapsulation
199 for multicast frames. Apparently, all IFF_POINTOPOINT and
200 IFF_BROADCAST devices are able to use multicasts too.
201 */
202
203/* IFLA_LINK.
204 For usual devices it is equal ifi_index.
205 If it is a "virtual interface" (f.e. tunnel), ifi_link
206 can point to real physical interface (f.e. for bandwidth calculations),
207 or maybe 0, what means, that real media is unknown (usual
208 for IPIP tunnels, when route to endpoint is allowed to change)
209 */
210
211/* Subtype attributes for IFLA_PROTINFO */
212enum {
213 IFLA_INET6_UNSPEC,
214 IFLA_INET6_FLAGS, /* link flags */
215 IFLA_INET6_CONF, /* sysctl parameters */
216 IFLA_INET6_STATS, /* statistics */
217 IFLA_INET6_MCAST, /* MC things. What of them? */
218 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
219 IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */
220 IFLA_INET6_TOKEN, /* device token */
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800221 IFLA_INET6_ADDR_GEN_MODE, /* implicit address generator mode */
Ben Cheng224b54f2013-10-15 18:26:18 -0700222 __IFLA_INET6_MAX
223};
224
225#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
226
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800227enum in6_addr_gen_mode {
228 IN6_ADDR_GEN_MODE_EUI64,
229 IN6_ADDR_GEN_MODE_NONE,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800230 IN6_ADDR_GEN_MODE_STABLE_PRIVACY,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700231 IN6_ADDR_GEN_MODE_RANDOM,
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800232};
233
234/* Bridge section */
235
236enum {
237 IFLA_BR_UNSPEC,
238 IFLA_BR_FORWARD_DELAY,
239 IFLA_BR_HELLO_TIME,
240 IFLA_BR_MAX_AGE,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800241 IFLA_BR_AGEING_TIME,
242 IFLA_BR_STP_STATE,
243 IFLA_BR_PRIORITY,
244 IFLA_BR_VLAN_FILTERING,
245 IFLA_BR_VLAN_PROTOCOL,
246 IFLA_BR_GROUP_FWD_MASK,
247 IFLA_BR_ROOT_ID,
248 IFLA_BR_BRIDGE_ID,
249 IFLA_BR_ROOT_PORT,
250 IFLA_BR_ROOT_PATH_COST,
251 IFLA_BR_TOPOLOGY_CHANGE,
252 IFLA_BR_TOPOLOGY_CHANGE_DETECTED,
253 IFLA_BR_HELLO_TIMER,
254 IFLA_BR_TCN_TIMER,
255 IFLA_BR_TOPOLOGY_CHANGE_TIMER,
256 IFLA_BR_GC_TIMER,
257 IFLA_BR_GROUP_ADDR,
258 IFLA_BR_FDB_FLUSH,
259 IFLA_BR_MCAST_ROUTER,
260 IFLA_BR_MCAST_SNOOPING,
261 IFLA_BR_MCAST_QUERY_USE_IFADDR,
262 IFLA_BR_MCAST_QUERIER,
263 IFLA_BR_MCAST_HASH_ELASTICITY,
264 IFLA_BR_MCAST_HASH_MAX,
265 IFLA_BR_MCAST_LAST_MEMBER_CNT,
266 IFLA_BR_MCAST_STARTUP_QUERY_CNT,
267 IFLA_BR_MCAST_LAST_MEMBER_INTVL,
268 IFLA_BR_MCAST_MEMBERSHIP_INTVL,
269 IFLA_BR_MCAST_QUERIER_INTVL,
270 IFLA_BR_MCAST_QUERY_INTVL,
271 IFLA_BR_MCAST_QUERY_RESPONSE_INTVL,
272 IFLA_BR_MCAST_STARTUP_QUERY_INTVL,
273 IFLA_BR_NF_CALL_IPTABLES,
274 IFLA_BR_NF_CALL_IP6TABLES,
275 IFLA_BR_NF_CALL_ARPTABLES,
276 IFLA_BR_VLAN_DEFAULT_PVID,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700277 IFLA_BR_PAD,
278 IFLA_BR_VLAN_STATS_ENABLED,
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800279 IFLA_BR_MCAST_STATS_ENABLED,
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800280 IFLA_BR_MCAST_IGMP_VERSION,
281 IFLA_BR_MCAST_MLD_VERSION,
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800282 __IFLA_BR_MAX,
283};
284
285#define IFLA_BR_MAX (__IFLA_BR_MAX - 1)
286
Christopher Ferris12e1f282016-02-04 12:35:07 -0800287struct ifla_bridge_id {
288 __u8 prio[2];
289 __u8 addr[6]; /* ETH_ALEN */
290};
291
Ben Cheng224b54f2013-10-15 18:26:18 -0700292enum {
293 BRIDGE_MODE_UNSPEC,
294 BRIDGE_MODE_HAIRPIN,
295};
296
297enum {
298 IFLA_BRPORT_UNSPEC,
299 IFLA_BRPORT_STATE, /* Spanning tree state */
300 IFLA_BRPORT_PRIORITY, /* " priority */
301 IFLA_BRPORT_COST, /* " cost */
302 IFLA_BRPORT_MODE, /* mode (hairpin) */
303 IFLA_BRPORT_GUARD, /* bpdu guard */
304 IFLA_BRPORT_PROTECT, /* root port protection */
305 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
Christopher Ferrise0845012014-07-09 14:58:51 -0700306 IFLA_BRPORT_LEARNING, /* mac learning */
307 IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800308 IFLA_BRPORT_PROXYARP, /* proxy ARP */
309 IFLA_BRPORT_LEARNING_SYNC, /* mac learning sync from device */
310 IFLA_BRPORT_PROXYARP_WIFI, /* proxy ARP for Wi-Fi */
311 IFLA_BRPORT_ROOT_ID, /* designated root */
312 IFLA_BRPORT_BRIDGE_ID, /* designated bridge */
313 IFLA_BRPORT_DESIGNATED_PORT,
314 IFLA_BRPORT_DESIGNATED_COST,
315 IFLA_BRPORT_ID,
316 IFLA_BRPORT_NO,
317 IFLA_BRPORT_TOPOLOGY_CHANGE_ACK,
318 IFLA_BRPORT_CONFIG_PENDING,
319 IFLA_BRPORT_MESSAGE_AGE_TIMER,
320 IFLA_BRPORT_FORWARD_DELAY_TIMER,
321 IFLA_BRPORT_HOLD_TIMER,
322 IFLA_BRPORT_FLUSH,
323 IFLA_BRPORT_MULTICAST_ROUTER,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700324 IFLA_BRPORT_PAD,
Christopher Ferris33185402017-01-13 13:28:52 -0800325 IFLA_BRPORT_MCAST_FLOOD,
Christopher Ferris0543f742017-07-26 13:09:46 -0700326 IFLA_BRPORT_MCAST_TO_UCAST,
327 IFLA_BRPORT_VLAN_TUNNEL,
328 IFLA_BRPORT_BCAST_FLOOD,
Ben Cheng224b54f2013-10-15 18:26:18 -0700329 __IFLA_BRPORT_MAX
330};
331#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
332
333struct ifla_cacheinfo {
334 __u32 max_reasm_len;
335 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
336 __u32 reachable_time;
337 __u32 retrans_time;
338};
339
340enum {
341 IFLA_INFO_UNSPEC,
342 IFLA_INFO_KIND,
343 IFLA_INFO_DATA,
344 IFLA_INFO_XSTATS,
Christopher Ferrise0845012014-07-09 14:58:51 -0700345 IFLA_INFO_SLAVE_KIND,
346 IFLA_INFO_SLAVE_DATA,
Ben Cheng224b54f2013-10-15 18:26:18 -0700347 __IFLA_INFO_MAX,
348};
349
350#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
351
352/* VLAN section */
353
354enum {
355 IFLA_VLAN_UNSPEC,
356 IFLA_VLAN_ID,
357 IFLA_VLAN_FLAGS,
358 IFLA_VLAN_EGRESS_QOS,
359 IFLA_VLAN_INGRESS_QOS,
360 IFLA_VLAN_PROTOCOL,
361 __IFLA_VLAN_MAX,
362};
363
364#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
365
366struct ifla_vlan_flags {
367 __u32 flags;
368 __u32 mask;
369};
370
371enum {
372 IFLA_VLAN_QOS_UNSPEC,
373 IFLA_VLAN_QOS_MAPPING,
374 __IFLA_VLAN_QOS_MAX
375};
376
377#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
378
379struct ifla_vlan_qos_mapping {
380 __u32 from;
381 __u32 to;
382};
383
384/* MACVLAN section */
385enum {
386 IFLA_MACVLAN_UNSPEC,
387 IFLA_MACVLAN_MODE,
388 IFLA_MACVLAN_FLAGS,
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800389 IFLA_MACVLAN_MACADDR_MODE,
390 IFLA_MACVLAN_MACADDR,
391 IFLA_MACVLAN_MACADDR_DATA,
392 IFLA_MACVLAN_MACADDR_COUNT,
Ben Cheng224b54f2013-10-15 18:26:18 -0700393 __IFLA_MACVLAN_MAX,
394};
395
396#define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1)
397
398enum macvlan_mode {
399 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
400 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
401 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
402 MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
Christopher Ferris7c0b6392015-01-23 15:34:26 -0800403 MACVLAN_MODE_SOURCE = 16,/* use source MAC address list to assign */
404};
405
406enum macvlan_macaddr_mode {
407 MACVLAN_MACADDR_ADD,
408 MACVLAN_MACADDR_DEL,
409 MACVLAN_MACADDR_FLUSH,
410 MACVLAN_MACADDR_SET,
Ben Cheng224b54f2013-10-15 18:26:18 -0700411};
412
413#define MACVLAN_FLAG_NOPROMISC 1
414
Christopher Ferris12e1f282016-02-04 12:35:07 -0800415/* VRF section */
416enum {
417 IFLA_VRF_UNSPEC,
418 IFLA_VRF_TABLE,
419 __IFLA_VRF_MAX
420};
421
422#define IFLA_VRF_MAX (__IFLA_VRF_MAX - 1)
423
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700424enum {
425 IFLA_VRF_PORT_UNSPEC,
426 IFLA_VRF_PORT_TABLE,
427 __IFLA_VRF_PORT_MAX
428};
429
430#define IFLA_VRF_PORT_MAX (__IFLA_VRF_PORT_MAX - 1)
431
432/* MACSEC section */
433enum {
434 IFLA_MACSEC_UNSPEC,
435 IFLA_MACSEC_SCI,
436 IFLA_MACSEC_PORT,
437 IFLA_MACSEC_ICV_LEN,
438 IFLA_MACSEC_CIPHER_SUITE,
439 IFLA_MACSEC_WINDOW,
440 IFLA_MACSEC_ENCODING_SA,
441 IFLA_MACSEC_ENCRYPT,
442 IFLA_MACSEC_PROTECT,
443 IFLA_MACSEC_INC_SCI,
444 IFLA_MACSEC_ES,
445 IFLA_MACSEC_SCB,
446 IFLA_MACSEC_REPLAY_PROTECT,
447 IFLA_MACSEC_VALIDATION,
448 IFLA_MACSEC_PAD,
449 __IFLA_MACSEC_MAX,
450};
451
452#define IFLA_MACSEC_MAX (__IFLA_MACSEC_MAX - 1)
453
454enum macsec_validation_type {
455 MACSEC_VALIDATE_DISABLED = 0,
456 MACSEC_VALIDATE_CHECK = 1,
457 MACSEC_VALIDATE_STRICT = 2,
458 __MACSEC_VALIDATE_END,
459 MACSEC_VALIDATE_MAX = __MACSEC_VALIDATE_END - 1,
460};
461
Christopher Ferris12e1f282016-02-04 12:35:07 -0800462/* IPVLAN section */
463enum {
464 IFLA_IPVLAN_UNSPEC,
465 IFLA_IPVLAN_MODE,
466 __IFLA_IPVLAN_MAX
467};
468
469#define IFLA_IPVLAN_MAX (__IFLA_IPVLAN_MAX - 1)
470
471enum ipvlan_mode {
472 IPVLAN_MODE_L2 = 0,
473 IPVLAN_MODE_L3,
Christopher Ferris33185402017-01-13 13:28:52 -0800474 IPVLAN_MODE_L3S,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800475 IPVLAN_MODE_MAX
476};
477
Ben Cheng224b54f2013-10-15 18:26:18 -0700478/* VXLAN section */
479enum {
480 IFLA_VXLAN_UNSPEC,
481 IFLA_VXLAN_ID,
482 IFLA_VXLAN_GROUP, /* group or remote address */
483 IFLA_VXLAN_LINK,
484 IFLA_VXLAN_LOCAL,
485 IFLA_VXLAN_TTL,
486 IFLA_VXLAN_TOS,
487 IFLA_VXLAN_LEARNING,
488 IFLA_VXLAN_AGEING,
489 IFLA_VXLAN_LIMIT,
490 IFLA_VXLAN_PORT_RANGE, /* source port */
491 IFLA_VXLAN_PROXY,
492 IFLA_VXLAN_RSC,
493 IFLA_VXLAN_L2MISS,
494 IFLA_VXLAN_L3MISS,
495 IFLA_VXLAN_PORT, /* destination port */
Christopher Ferrise0845012014-07-09 14:58:51 -0700496 IFLA_VXLAN_GROUP6,
497 IFLA_VXLAN_LOCAL6,
Christopher Ferris31475242014-09-02 17:43:51 -0700498 IFLA_VXLAN_UDP_CSUM,
499 IFLA_VXLAN_UDP_ZERO_CSUM6_TX,
500 IFLA_VXLAN_UDP_ZERO_CSUM6_RX,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800501 IFLA_VXLAN_REMCSUM_TX,
502 IFLA_VXLAN_REMCSUM_RX,
503 IFLA_VXLAN_GBP,
504 IFLA_VXLAN_REMCSUM_NOPARTIAL,
505 IFLA_VXLAN_COLLECT_METADATA,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700506 IFLA_VXLAN_LABEL,
507 IFLA_VXLAN_GPE,
Ben Cheng224b54f2013-10-15 18:26:18 -0700508 __IFLA_VXLAN_MAX
509};
510#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
511
512struct ifla_vxlan_port_range {
513 __be16 low;
514 __be16 high;
515};
516
Christopher Ferris12e1f282016-02-04 12:35:07 -0800517/* GENEVE section */
518enum {
519 IFLA_GENEVE_UNSPEC,
520 IFLA_GENEVE_ID,
521 IFLA_GENEVE_REMOTE,
522 IFLA_GENEVE_TTL,
523 IFLA_GENEVE_TOS,
524 IFLA_GENEVE_PORT, /* destination port */
525 IFLA_GENEVE_COLLECT_METADATA,
526 IFLA_GENEVE_REMOTE6,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700527 IFLA_GENEVE_UDP_CSUM,
528 IFLA_GENEVE_UDP_ZERO_CSUM6_TX,
529 IFLA_GENEVE_UDP_ZERO_CSUM6_RX,
530 IFLA_GENEVE_LABEL,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800531 __IFLA_GENEVE_MAX
532};
533#define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
534
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700535/* PPP section */
536enum {
537 IFLA_PPP_UNSPEC,
538 IFLA_PPP_DEV_FD,
539 __IFLA_PPP_MAX
540};
541#define IFLA_PPP_MAX (__IFLA_PPP_MAX - 1)
542
543/* GTP section */
Christopher Ferris0543f742017-07-26 13:09:46 -0700544
545enum ifla_gtp_role {
546 GTP_ROLE_GGSN = 0,
547 GTP_ROLE_SGSN,
548};
549
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700550enum {
551 IFLA_GTP_UNSPEC,
552 IFLA_GTP_FD0,
553 IFLA_GTP_FD1,
554 IFLA_GTP_PDP_HASHSIZE,
Christopher Ferris0543f742017-07-26 13:09:46 -0700555 IFLA_GTP_ROLE,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700556 __IFLA_GTP_MAX,
557};
558#define IFLA_GTP_MAX (__IFLA_GTP_MAX - 1)
559
Christopher Ferrise0845012014-07-09 14:58:51 -0700560/* Bonding section */
561
562enum {
563 IFLA_BOND_UNSPEC,
564 IFLA_BOND_MODE,
565 IFLA_BOND_ACTIVE_SLAVE,
566 IFLA_BOND_MIIMON,
567 IFLA_BOND_UPDELAY,
568 IFLA_BOND_DOWNDELAY,
569 IFLA_BOND_USE_CARRIER,
570 IFLA_BOND_ARP_INTERVAL,
571 IFLA_BOND_ARP_IP_TARGET,
572 IFLA_BOND_ARP_VALIDATE,
573 IFLA_BOND_ARP_ALL_TARGETS,
574 IFLA_BOND_PRIMARY,
575 IFLA_BOND_PRIMARY_RESELECT,
576 IFLA_BOND_FAIL_OVER_MAC,
577 IFLA_BOND_XMIT_HASH_POLICY,
578 IFLA_BOND_RESEND_IGMP,
579 IFLA_BOND_NUM_PEER_NOTIF,
580 IFLA_BOND_ALL_SLAVES_ACTIVE,
581 IFLA_BOND_MIN_LINKS,
582 IFLA_BOND_LP_INTERVAL,
583 IFLA_BOND_PACKETS_PER_SLAVE,
584 IFLA_BOND_AD_LACP_RATE,
585 IFLA_BOND_AD_SELECT,
586 IFLA_BOND_AD_INFO,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800587 IFLA_BOND_AD_ACTOR_SYS_PRIO,
588 IFLA_BOND_AD_USER_PORT_KEY,
589 IFLA_BOND_AD_ACTOR_SYSTEM,
590 IFLA_BOND_TLB_DYNAMIC_LB,
Christopher Ferrise0845012014-07-09 14:58:51 -0700591 __IFLA_BOND_MAX,
592};
593
594#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
595
596enum {
597 IFLA_BOND_AD_INFO_UNSPEC,
598 IFLA_BOND_AD_INFO_AGGREGATOR,
599 IFLA_BOND_AD_INFO_NUM_PORTS,
600 IFLA_BOND_AD_INFO_ACTOR_KEY,
601 IFLA_BOND_AD_INFO_PARTNER_KEY,
602 IFLA_BOND_AD_INFO_PARTNER_MAC,
603 __IFLA_BOND_AD_INFO_MAX,
604};
605
606#define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
607
608enum {
609 IFLA_BOND_SLAVE_UNSPEC,
610 IFLA_BOND_SLAVE_STATE,
611 IFLA_BOND_SLAVE_MII_STATUS,
612 IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
613 IFLA_BOND_SLAVE_PERM_HWADDR,
614 IFLA_BOND_SLAVE_QUEUE_ID,
615 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800616 IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE,
617 IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE,
Christopher Ferrise0845012014-07-09 14:58:51 -0700618 __IFLA_BOND_SLAVE_MAX,
619};
620
621#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
622
Ben Cheng224b54f2013-10-15 18:26:18 -0700623/* SR-IOV virtual function management section */
624
625enum {
626 IFLA_VF_INFO_UNSPEC,
627 IFLA_VF_INFO,
628 __IFLA_VF_INFO_MAX,
629};
630
631#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
632
633enum {
634 IFLA_VF_UNSPEC,
635 IFLA_VF_MAC, /* Hardware queue specific attributes */
Christopher Ferris33185402017-01-13 13:28:52 -0800636 IFLA_VF_VLAN, /* VLAN ID and QoS */
Christopher Ferris31475242014-09-02 17:43:51 -0700637 IFLA_VF_TX_RATE, /* Max TX Bandwidth Allocation */
Ben Cheng224b54f2013-10-15 18:26:18 -0700638 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
Christopher Ferrise0845012014-07-09 14:58:51 -0700639 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
Christopher Ferris31475242014-09-02 17:43:51 -0700640 IFLA_VF_RATE, /* Min and Max TX Bandwidth Allocation */
Christopher Ferris12e1f282016-02-04 12:35:07 -0800641 IFLA_VF_RSS_QUERY_EN, /* RSS Redirection Table and Hash Key query
642 * on/off switch
643 */
644 IFLA_VF_STATS, /* network device statistics */
645 IFLA_VF_TRUST, /* Trust VF */
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700646 IFLA_VF_IB_NODE_GUID, /* VF Infiniband node GUID */
647 IFLA_VF_IB_PORT_GUID, /* VF Infiniband port GUID */
Christopher Ferris33185402017-01-13 13:28:52 -0800648 IFLA_VF_VLAN_LIST, /* nested list of vlans, option for QinQ */
Ben Cheng224b54f2013-10-15 18:26:18 -0700649 __IFLA_VF_MAX,
650};
651
652#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
653
654struct ifla_vf_mac {
655 __u32 vf;
656 __u8 mac[32]; /* MAX_ADDR_LEN */
657};
658
659struct ifla_vf_vlan {
660 __u32 vf;
661 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
662 __u32 qos;
663};
664
Christopher Ferris33185402017-01-13 13:28:52 -0800665enum {
666 IFLA_VF_VLAN_INFO_UNSPEC,
667 IFLA_VF_VLAN_INFO, /* VLAN ID, QoS and VLAN protocol */
668 __IFLA_VF_VLAN_INFO_MAX,
669};
670
671#define IFLA_VF_VLAN_INFO_MAX (__IFLA_VF_VLAN_INFO_MAX - 1)
672#define MAX_VLAN_LIST_LEN 1
673
674struct ifla_vf_vlan_info {
675 __u32 vf;
676 __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */
677 __u32 qos;
678 __be16 vlan_proto; /* VLAN protocol either 802.1Q or 802.1ad */
679};
680
Ben Cheng224b54f2013-10-15 18:26:18 -0700681struct ifla_vf_tx_rate {
682 __u32 vf;
683 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
684};
685
Christopher Ferris31475242014-09-02 17:43:51 -0700686struct ifla_vf_rate {
687 __u32 vf;
688 __u32 min_tx_rate; /* Min Bandwidth in Mbps */
689 __u32 max_tx_rate; /* Max Bandwidth in Mbps */
690};
691
Ben Cheng224b54f2013-10-15 18:26:18 -0700692struct ifla_vf_spoofchk {
693 __u32 vf;
694 __u32 setting;
695};
696
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700697struct ifla_vf_guid {
698 __u32 vf;
699 __u64 guid;
700};
701
Christopher Ferrise0845012014-07-09 14:58:51 -0700702enum {
703 IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
704 IFLA_VF_LINK_STATE_ENABLE, /* link always up */
705 IFLA_VF_LINK_STATE_DISABLE, /* link always down */
706 __IFLA_VF_LINK_STATE_MAX,
707};
708
709struct ifla_vf_link_state {
710 __u32 vf;
711 __u32 link_state;
712};
713
Christopher Ferris12e1f282016-02-04 12:35:07 -0800714struct ifla_vf_rss_query_en {
715 __u32 vf;
716 __u32 setting;
717};
718
719enum {
720 IFLA_VF_STATS_RX_PACKETS,
721 IFLA_VF_STATS_TX_PACKETS,
722 IFLA_VF_STATS_RX_BYTES,
723 IFLA_VF_STATS_TX_BYTES,
724 IFLA_VF_STATS_BROADCAST,
725 IFLA_VF_STATS_MULTICAST,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700726 IFLA_VF_STATS_PAD,
Christopher Ferris12e1f282016-02-04 12:35:07 -0800727 __IFLA_VF_STATS_MAX,
728};
729
730#define IFLA_VF_STATS_MAX (__IFLA_VF_STATS_MAX - 1)
731
732struct ifla_vf_trust {
733 __u32 vf;
734 __u32 setting;
735};
736
Ben Cheng224b54f2013-10-15 18:26:18 -0700737/* VF ports management section
738 *
739 * Nested layout of set/get msg is:
740 *
741 * [IFLA_NUM_VF]
742 * [IFLA_VF_PORTS]
743 * [IFLA_VF_PORT]
744 * [IFLA_PORT_*], ...
745 * [IFLA_VF_PORT]
746 * [IFLA_PORT_*], ...
747 * ...
748 * [IFLA_PORT_SELF]
749 * [IFLA_PORT_*], ...
750 */
751
752enum {
753 IFLA_VF_PORT_UNSPEC,
754 IFLA_VF_PORT, /* nest */
755 __IFLA_VF_PORT_MAX,
756};
757
758#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
759
760enum {
761 IFLA_PORT_UNSPEC,
762 IFLA_PORT_VF, /* __u32 */
763 IFLA_PORT_PROFILE, /* string */
764 IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
765 IFLA_PORT_INSTANCE_UUID, /* binary UUID */
766 IFLA_PORT_HOST_UUID, /* binary UUID */
767 IFLA_PORT_REQUEST, /* __u8 */
768 IFLA_PORT_RESPONSE, /* __u16, output only */
769 __IFLA_PORT_MAX,
770};
771
772#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
773
774#define PORT_PROFILE_MAX 40
775#define PORT_UUID_MAX 16
776#define PORT_SELF_VF -1
777
778enum {
779 PORT_REQUEST_PREASSOCIATE = 0,
780 PORT_REQUEST_PREASSOCIATE_RR,
781 PORT_REQUEST_ASSOCIATE,
782 PORT_REQUEST_DISASSOCIATE,
783};
784
785enum {
786 PORT_VDP_RESPONSE_SUCCESS = 0,
787 PORT_VDP_RESPONSE_INVALID_FORMAT,
788 PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
789 PORT_VDP_RESPONSE_UNUSED_VTID,
790 PORT_VDP_RESPONSE_VTID_VIOLATION,
791 PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
792 PORT_VDP_RESPONSE_OUT_OF_SYNC,
793 /* 0x08-0xFF reserved for future VDP use */
794 PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
795 PORT_PROFILE_RESPONSE_INPROGRESS,
796 PORT_PROFILE_RESPONSE_INVALID,
797 PORT_PROFILE_RESPONSE_BADSTATE,
798 PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
799 PORT_PROFILE_RESPONSE_ERROR,
800};
801
802struct ifla_port_vsi {
803 __u8 vsi_mgr_id;
804 __u8 vsi_type_id[3];
805 __u8 vsi_type_version;
806 __u8 pad[3];
807};
808
809
810/* IPoIB section */
811
812enum {
813 IFLA_IPOIB_UNSPEC,
814 IFLA_IPOIB_PKEY,
815 IFLA_IPOIB_MODE,
816 IFLA_IPOIB_UMCAST,
817 __IFLA_IPOIB_MAX
818};
819
820enum {
821 IPOIB_MODE_DATAGRAM = 0, /* using unreliable datagram QPs */
822 IPOIB_MODE_CONNECTED = 1, /* using connected QPs */
823};
824
825#define IFLA_IPOIB_MAX (__IFLA_IPOIB_MAX - 1)
826
Christopher Ferrise0845012014-07-09 14:58:51 -0700827
828/* HSR section */
829
830enum {
831 IFLA_HSR_UNSPEC,
832 IFLA_HSR_SLAVE1,
833 IFLA_HSR_SLAVE2,
834 IFLA_HSR_MULTICAST_SPEC, /* Last byte of supervision addr */
835 IFLA_HSR_SUPERVISION_ADDR, /* Supervision frame multicast addr */
836 IFLA_HSR_SEQ_NR,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700837 IFLA_HSR_VERSION, /* HSR version */
Christopher Ferrise0845012014-07-09 14:58:51 -0700838 __IFLA_HSR_MAX,
839};
840
841#define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
842
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700843/* STATS section */
844
845struct if_stats_msg {
846 __u8 family;
847 __u8 pad1;
848 __u16 pad2;
849 __u32 ifindex;
850 __u32 filter_mask;
851};
852
853/* A stats attribute can be netdev specific or a global stat.
854 * For netdev stats, lets use the prefix IFLA_STATS_LINK_*
855 */
856enum {
857 IFLA_STATS_UNSPEC, /* also used as 64bit pad attribute */
858 IFLA_STATS_LINK_64,
859 IFLA_STATS_LINK_XSTATS,
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800860 IFLA_STATS_LINK_XSTATS_SLAVE,
Christopher Ferris33185402017-01-13 13:28:52 -0800861 IFLA_STATS_LINK_OFFLOAD_XSTATS,
Christopher Ferris0543f742017-07-26 13:09:46 -0700862 IFLA_STATS_AF_SPEC,
Christopher Ferrisccfaccd2016-08-24 12:11:31 -0700863 __IFLA_STATS_MAX,
864};
865
866#define IFLA_STATS_MAX (__IFLA_STATS_MAX - 1)
867
868#define IFLA_STATS_FILTER_BIT(ATTR) (1 << (ATTR - 1))
869
870/* These are embedded into IFLA_STATS_LINK_XSTATS:
871 * [IFLA_STATS_LINK_XSTATS]
872 * -> [LINK_XSTATS_TYPE_xxx]
873 * -> [rtnl link type specific attributes]
874 */
875enum {
876 LINK_XSTATS_TYPE_UNSPEC,
877 LINK_XSTATS_TYPE_BRIDGE,
878 __LINK_XSTATS_TYPE_MAX
879};
880#define LINK_XSTATS_TYPE_MAX (__LINK_XSTATS_TYPE_MAX - 1)
881
Christopher Ferris33185402017-01-13 13:28:52 -0800882/* These are stats embedded into IFLA_STATS_LINK_OFFLOAD_XSTATS */
883enum {
884 IFLA_OFFLOAD_XSTATS_UNSPEC,
885 IFLA_OFFLOAD_XSTATS_CPU_HIT, /* struct rtnl_link_stats64 */
886 __IFLA_OFFLOAD_XSTATS_MAX
887};
888#define IFLA_OFFLOAD_XSTATS_MAX (__IFLA_OFFLOAD_XSTATS_MAX - 1)
889
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800890/* XDP section */
891
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800892#define XDP_FLAGS_UPDATE_IF_NOEXIST (1U << 0)
Christopher Ferris0543f742017-07-26 13:09:46 -0700893#define XDP_FLAGS_SKB_MODE (1U << 1)
894#define XDP_FLAGS_DRV_MODE (1U << 2)
Christopher Ferris25981132017-11-14 16:53:49 -0800895#define XDP_FLAGS_HW_MODE (1U << 3)
896#define XDP_FLAGS_MODES (XDP_FLAGS_SKB_MODE | \
897 XDP_FLAGS_DRV_MODE | \
898 XDP_FLAGS_HW_MODE)
Christopher Ferris0543f742017-07-26 13:09:46 -0700899#define XDP_FLAGS_MASK (XDP_FLAGS_UPDATE_IF_NOEXIST | \
Christopher Ferris25981132017-11-14 16:53:49 -0800900 XDP_FLAGS_MODES)
Christopher Ferris0543f742017-07-26 13:09:46 -0700901
902/* These are stored into IFLA_XDP_ATTACHED on dump. */
903enum {
904 XDP_ATTACHED_NONE = 0,
905 XDP_ATTACHED_DRV,
906 XDP_ATTACHED_SKB,
Christopher Ferris25981132017-11-14 16:53:49 -0800907 XDP_ATTACHED_HW,
Christopher Ferris0543f742017-07-26 13:09:46 -0700908};
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800909
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800910enum {
911 IFLA_XDP_UNSPEC,
912 IFLA_XDP_FD,
913 IFLA_XDP_ATTACHED,
Christopher Ferris2fd4b3c2017-02-21 12:32:08 -0800914 IFLA_XDP_FLAGS,
Christopher Ferris25981132017-11-14 16:53:49 -0800915 IFLA_XDP_PROG_ID,
Christopher Ferris6e3550f2016-12-12 14:51:18 -0800916 __IFLA_XDP_MAX,
917};
918
919#define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
920
Christopher Ferris25981132017-11-14 16:53:49 -0800921enum {
922 IFLA_EVENT_NONE,
923 IFLA_EVENT_REBOOT, /* internal reset / reboot */
924 IFLA_EVENT_FEATURES, /* change in offload features */
925 IFLA_EVENT_BONDING_FAILOVER, /* change in active slave */
926 IFLA_EVENT_NOTIFY_PEERS, /* re-sent grat. arp/ndisc */
927 IFLA_EVENT_IGMP_RESEND, /* re-sent IGMP JOIN */
928 IFLA_EVENT_BONDING_OPTIONS, /* change in bonding options */
929};
930
Ben Cheng224b54f2013-10-15 18:26:18 -0700931#endif /* _UAPI_LINUX_IF_LINK_H */