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