libnl: /data/src/libnl/include/netlink/route/link.h Source File

libnl 3.12.0

link.h
1/* SPDX-License-Identifier: LGPL-2.1-only */
2/*
3 * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
4 */
5
6#ifndef NETLINK_LINK_H_
7#define NETLINK_LINK_H_
8
9#include <netlink/netlink.h>
10#include <netlink/cache.h>
11#include <netlink/addr.h>
12#include <sys/types.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/**
19 * @struct rtnl_link link.h "netlink/route/link.h"
20 * @brief Link object
21 * @implements nl_object
22 * @ingroup link
23 *
24 * @copydoc private_struct
25 */
26struct rtnl_link;
27
28/**
29 * @ingroup link
30 */
31 typedef enum {
32 RTNL_LINK_RX_PACKETS, /*!< Packets received */
33 RTNL_LINK_TX_PACKETS, /*!< Packets sent */
34 RTNL_LINK_RX_BYTES, /*!< Bytes received */
35 RTNL_LINK_TX_BYTES, /*!< Bytes sent */
36 RTNL_LINK_RX_ERRORS, /*!< Receive errors */
37 RTNL_LINK_TX_ERRORS, /*!< Send errors */
38 RTNL_LINK_RX_DROPPED, /*!< Received packets dropped */
39 RTNL_LINK_TX_DROPPED, /*!< Packets dropped during transmit */
40 RTNL_LINK_RX_COMPRESSED, /*!< Compressed packets received */
41 RTNL_LINK_TX_COMPRESSED, /*!< Compressed packets sent */
42 RTNL_LINK_RX_FIFO_ERR, /*!< Receive FIFO errors */
43 RTNL_LINK_TX_FIFO_ERR, /*!< Send FIFO errors */
44 RTNL_LINK_RX_LEN_ERR, /*!< Length errors */
45 RTNL_LINK_RX_OVER_ERR, /*!< Over errors */
46 RTNL_LINK_RX_CRC_ERR, /*!< CRC errors */
47 RTNL_LINK_RX_FRAME_ERR, /*!< Frame errors */
48 RTNL_LINK_RX_MISSED_ERR, /*!< Missed errors */
49 RTNL_LINK_TX_ABORT_ERR, /*!< Aborted errors */
50 RTNL_LINK_TX_CARRIER_ERR, /*!< Carrier errors */
51 RTNL_LINK_TX_HBEAT_ERR, /*!< Heartbeat errors */
52 RTNL_LINK_TX_WIN_ERR, /*!< Window errors */
53 RTNL_LINK_COLLISIONS, /*!< Send collisions */
54 RTNL_LINK_MULTICAST, /*!< Multicast */
55 RTNL_LINK_IP6_INPKTS, /*!< IPv6 SNMP InReceives */
56 RTNL_LINK_IP6_INHDRERRORS, /*!< IPv6 SNMP InHdrErrors */
57 RTNL_LINK_IP6_INTOOBIGERRORS, /*!< IPv6 SNMP InTooBigErrors */
58 RTNL_LINK_IP6_INNOROUTES, /*!< IPv6 SNMP InNoRoutes */
59 RTNL_LINK_IP6_INADDRERRORS, /*!< IPv6 SNMP InAddrErrors */
60 RTNL_LINK_IP6_INUNKNOWNPROTOS, /*!< IPv6 SNMP InUnknownProtos */
61 RTNL_LINK_IP6_INTRUNCATEDPKTS, /*!< IPv6 SNMP InTruncatedPkts */
62 RTNL_LINK_IP6_INDISCARDS, /*!< IPv6 SNMP InDiscards */
63 RTNL_LINK_IP6_INDELIVERS, /*!< IPv6 SNMP InDelivers */
64 RTNL_LINK_IP6_OUTFORWDATAGRAMS, /*!< IPv6 SNMP OutForwDatagrams */
65 RTNL_LINK_IP6_OUTPKTS, /*!< IPv6 SNMP OutRequests */
66 RTNL_LINK_IP6_OUTDISCARDS, /*!< IPv6 SNMP OutDiscards */
67 RTNL_LINK_IP6_OUTNOROUTES, /*!< IPv6 SNMP OutNoRoutes */
68 RTNL_LINK_IP6_REASMTIMEOUT, /*!< IPv6 SNMP ReasmTimeout */
69 RTNL_LINK_IP6_REASMREQDS, /*!< IPv6 SNMP ReasmReqds */
70 RTNL_LINK_IP6_REASMOKS, /*!< IPv6 SNMP ReasmOKs */
71 RTNL_LINK_IP6_REASMFAILS, /*!< IPv6 SNMP ReasmFails */
72 RTNL_LINK_IP6_FRAGOKS, /*!< IPv6 SNMP FragOKs */
73 RTNL_LINK_IP6_FRAGFAILS, /*!< IPv6 SNMP FragFails */
74 RTNL_LINK_IP6_FRAGCREATES, /*!< IPv6 SNMP FragCreates */
75 RTNL_LINK_IP6_INMCASTPKTS, /*!< IPv6 SNMP InMcastPkts */
76 RTNL_LINK_IP6_OUTMCASTPKTS, /*!< IPv6 SNMP OutMcastPkts */
77 RTNL_LINK_IP6_INBCASTPKTS, /*!< IPv6 SNMP InBcastPkts */
78 RTNL_LINK_IP6_OUTBCASTPKTS, /*!< IPv6 SNMP OutBcastPkts */
79 RTNL_LINK_IP6_INOCTETS, /*!< IPv6 SNMP InOctets */
80 RTNL_LINK_IP6_OUTOCTETS, /*!< IPv6 SNMP OutOctets */
81 RTNL_LINK_IP6_INMCASTOCTETS, /*!< IPv6 SNMP InMcastOctets */
82 RTNL_LINK_IP6_OUTMCASTOCTETS, /*!< IPv6 SNMP OutMcastOctets */
83 RTNL_LINK_IP6_INBCASTOCTETS, /*!< IPv6 SNMP InBcastOctets */
84 RTNL_LINK_IP6_OUTBCASTOCTETS, /*!< IPv6 SNMP OutBcastOctets */
85 RTNL_LINK_ICMP6_INMSGS, /*!< ICMPv6 SNMP InMsgs */
86 RTNL_LINK_ICMP6_INERRORS, /*!< ICMPv6 SNMP InErrors */
87 RTNL_LINK_ICMP6_OUTMSGS, /*!< ICMPv6 SNMP OutMsgs */
88 RTNL_LINK_ICMP6_OUTERRORS, /*!< ICMPv6 SNMP OutErrors */
89 RTNL_LINK_ICMP6_CSUMERRORS, /*!< ICMPv6 SNMP InCsumErrors */
90 RTNL_LINK_IP6_CSUMERRORS, /*!< IPv6 SNMP InCsumErrors */
91 RTNL_LINK_IP6_NOECTPKTS, /*!< IPv6 SNMP InNoECTPkts */
92 RTNL_LINK_IP6_ECT1PKTS, /*!< IPv6 SNMP InECT1Pkts */
93 RTNL_LINK_IP6_ECT0PKTS, /*!< IPv6 SNMP InECT0Pkts */
94 RTNL_LINK_IP6_CEPKTS, /*!< IPv6 SNMP InCEPkts */
95 RTNL_LINK_RX_NOHANDLER, /*!< Received packets dropped on inactive device */
96 RTNL_LINK_REASM_OVERLAPS, /*!< SNMP ReasmOverlaps */
97 __RTNL_LINK_STATS_MAX,
98} rtnl_link_stat_id_t;
99
100#define RTNL_LINK_STATS_MAX (__RTNL_LINK_STATS_MAX - 1)
101
102extern struct nla_policy rtln_link_policy[];
103
104extern struct rtnl_link *rtnl_link_alloc(void);
105extern void rtnl_link_put(struct rtnl_link *);
106
107extern int rtnl_link_alloc_cache(struct nl_sock *, int, struct nl_cache **);
108extern int rtnl_link_alloc_cache_flags(struct nl_sock *, int,
109 struct nl_cache **,
110 unsigned int flags);
111extern struct rtnl_link *rtnl_link_get(struct nl_cache *, int);
112extern struct rtnl_link *rtnl_link_get_by_name(struct nl_cache *, const char *);
113
114
115extern int rtnl_link_build_add_request(struct rtnl_link *, int,
116 struct nl_msg **);
117extern int rtnl_link_add(struct nl_sock *, struct rtnl_link *, int);
118extern int rtnl_link_build_change_request(struct rtnl_link *,
119 struct rtnl_link *, int,
120 struct nl_msg **);
121extern int rtnl_link_change(struct nl_sock *, struct rtnl_link *,
122 struct rtnl_link *, int);
123
124extern int rtnl_link_build_delete_request(const struct rtnl_link *,
125 struct nl_msg **);
126extern int rtnl_link_delete(struct nl_sock *, const struct rtnl_link *);
127extern int rtnl_link_build_get_request(int, const char *,
128 struct nl_msg **);
129extern int rtnl_link_get_kernel(struct nl_sock *, int, const char *,
130 struct rtnl_link **);
131
132/* Name <-> Index Translations */
133extern char * rtnl_link_i2name(struct nl_cache *, int, char *, size_t);
134extern int rtnl_link_name2i(struct nl_cache *, const char *);
135
136/* Name <-> Statistic Translations */
137extern char * rtnl_link_stat2str(int, char *, size_t);
138extern int rtnl_link_str2stat(const char *);
139
140/* Link Flags Translations */
141extern char * rtnl_link_flags2str(int, char *, size_t);
142extern int rtnl_link_str2flags(const char *);
143
144extern char * rtnl_link_operstate2str(uint8_t, char *, size_t);
145extern int rtnl_link_str2operstate(const char *);
146
147extern char * rtnl_link_mode2str(uint8_t, char *, size_t);
148extern int rtnl_link_str2mode(const char *);
149
150/* Carrier State Translations */
151extern char * rtnl_link_carrier2str(uint8_t, char *, size_t);
152extern int rtnl_link_str2carrier(const char *);
153
154/* Access Functions */
155extern void rtnl_link_set_qdisc(struct rtnl_link *, const char *);
156extern char * rtnl_link_get_qdisc(struct rtnl_link *);
157
158extern void rtnl_link_set_name(struct rtnl_link *, const char *);
159extern char * rtnl_link_get_name(struct rtnl_link *);
160
161extern void rtnl_link_set_group(struct rtnl_link *, uint32_t);
162extern uint32_t rtnl_link_get_group(struct rtnl_link *);
163
164extern void rtnl_link_set_flags(struct rtnl_link *, unsigned int);
165extern void rtnl_link_unset_flags(struct rtnl_link *, unsigned int);
166extern unsigned int rtnl_link_get_flags(struct rtnl_link *);
167
168extern void rtnl_link_set_mtu(struct rtnl_link *, unsigned int);
169extern unsigned int rtnl_link_get_mtu(struct rtnl_link *);
170
171extern void rtnl_link_set_txqlen(struct rtnl_link *, unsigned int);
172extern unsigned int rtnl_link_get_txqlen(struct rtnl_link *);
173
174extern void rtnl_link_set_ifindex(struct rtnl_link *, int);
175extern int rtnl_link_get_ifindex(struct rtnl_link *);
176
177extern void rtnl_link_set_family(struct rtnl_link *, int);
178extern int rtnl_link_get_family(struct rtnl_link *);
179
180extern void rtnl_link_set_arptype(struct rtnl_link *, unsigned int);
181extern unsigned int rtnl_link_get_arptype(struct rtnl_link *);
182
183extern void rtnl_link_set_addr(struct rtnl_link *, struct nl_addr *);
184extern struct nl_addr *rtnl_link_get_addr(struct rtnl_link *);
185
186extern struct nl_addr *rtnl_link_get_perm_addr(struct rtnl_link *);
187
188extern void rtnl_link_set_broadcast(struct rtnl_link *, struct nl_addr *);
189extern struct nl_addr *rtnl_link_get_broadcast(struct rtnl_link *);
190
191extern void rtnl_link_set_link(struct rtnl_link *, int);
192extern int rtnl_link_get_link(struct rtnl_link *);
193
194extern void rtnl_link_set_master(struct rtnl_link *, int);
195extern int rtnl_link_get_master(struct rtnl_link *);
196
197extern void rtnl_link_set_carrier(struct rtnl_link *, uint8_t);
198extern uint8_t rtnl_link_get_carrier(struct rtnl_link *);
199
200extern int rtnl_link_get_carrier_changes(struct rtnl_link *, uint32_t *);
201
202extern void rtnl_link_set_operstate(struct rtnl_link *, uint8_t);
203extern uint8_t rtnl_link_get_operstate(struct rtnl_link *);
204
205extern void rtnl_link_set_linkmode(struct rtnl_link *, uint8_t);
206extern uint8_t rtnl_link_get_linkmode(struct rtnl_link *);
207
208int rtnl_link_set_link_netnsid(struct rtnl_link *link, int32_t link_netnsid);
209int rtnl_link_get_link_netnsid(const struct rtnl_link *link, int32_t *out_link_netnsid);
210
211extern const char * rtnl_link_get_ifalias(struct rtnl_link *);
212extern void rtnl_link_set_ifalias(struct rtnl_link *, const char *);
213
214extern int rtnl_link_get_num_vf(struct rtnl_link *, uint32_t *);
215
216extern uint64_t rtnl_link_get_stat(struct rtnl_link *, rtnl_link_stat_id_t);
217extern int rtnl_link_set_stat(struct rtnl_link *, rtnl_link_stat_id_t,
218 const uint64_t);
219
220extern int rtnl_link_set_type(struct rtnl_link *, const char *);
221extern char * rtnl_link_get_type(struct rtnl_link *);
222
223extern int rtnl_link_set_slave_type(struct rtnl_link *, const char *);
224extern const char * rtnl_link_get_slave_type(const struct rtnl_link *);
225
226extern void rtnl_link_set_promiscuity(struct rtnl_link *, uint32_t);
227extern uint32_t rtnl_link_get_promiscuity(struct rtnl_link *);
228
229extern void rtnl_link_set_num_tx_queues(struct rtnl_link *, uint32_t);
230extern uint32_t rtnl_link_get_num_tx_queues(struct rtnl_link *);
231
232extern void rtnl_link_set_num_rx_queues(struct rtnl_link *, uint32_t);
233extern uint32_t rtnl_link_get_num_rx_queues(struct rtnl_link *);
234
235extern int rtnl_link_get_gso_max_segs(struct rtnl_link *, uint32_t *);
236
237extern int rtnl_link_get_gso_max_size(struct rtnl_link *, uint32_t *);
238
239extern struct nl_data * rtnl_link_get_phys_port_id(struct rtnl_link *);
240
241extern char* rtnl_link_get_phys_port_name(struct rtnl_link *);
242
243extern struct nl_data * rtnl_link_get_phys_switch_id(struct rtnl_link *);
244
245extern void rtnl_link_set_ns_fd(struct rtnl_link *, int);
246extern int rtnl_link_get_ns_fd(struct rtnl_link *);
247extern void rtnl_link_set_ns_pid(struct rtnl_link *, pid_t);
248extern pid_t rtnl_link_get_ns_pid(struct rtnl_link *);
249
250extern int rtnl_link_enslave_ifindex(struct nl_sock *, int, int);
251extern int rtnl_link_enslave(struct nl_sock *, struct rtnl_link *,
252 struct rtnl_link *);
253extern int rtnl_link_release_ifindex(struct nl_sock *, int);
254extern int rtnl_link_release(struct nl_sock *, struct rtnl_link *);
255extern int rtnl_link_fill_info(struct nl_msg *, struct rtnl_link *);
256extern int rtnl_link_info_parse(struct rtnl_link *, struct nlattr **);
257
258extern int rtnl_link_has_vf_list(struct rtnl_link *);
259extern void rtnl_link_set_vf_list(struct rtnl_link *);
260extern void rtnl_link_unset_vf_list(struct rtnl_link *);
261
262
263/* deprecated */
264extern int rtnl_link_set_info_type(struct rtnl_link *, const char *) __attribute__((deprecated));
265extern char * rtnl_link_get_info_type(struct rtnl_link *) __attribute__((deprecated));
266extern void rtnl_link_set_weight(struct rtnl_link *, unsigned int) __attribute__((deprecated));
267extern unsigned int rtnl_link_get_weight(struct rtnl_link *) __attribute__((deprecated));
268
269
270#ifdef __cplusplus
271}
272#endif
273
274#endif
rtnl_link_release
int rtnl_link_release(struct nl_sock *, struct rtnl_link *)
Release slave link from its master.
Definition link.c:2970
rtnl_link_add
int rtnl_link_add(struct nl_sock *, struct rtnl_link *, int)
Add virtual link.
Definition link.c:1710
rtnl_link_set_broadcast
void rtnl_link_set_broadcast(struct rtnl_link *, struct nl_addr *)
Set link layer broadcast address of link object.
Definition link.c:2072
rtnl_link_set_carrier
void rtnl_link_set_carrier(struct rtnl_link *, uint8_t)
Set carrier of link object.
Definition link.c:2361
rtnl_link_get_linkmode
uint8_t rtnl_link_get_linkmode(struct rtnl_link *)
Return link mode of link object.
Definition link.c:2446
rtnl_link_get_stat
uint64_t rtnl_link_get_stat(struct rtnl_link *, rtnl_link_stat_id_t)
Return value of link statistics counter.
Definition link.c:2545
rtnl_link_get_master
int rtnl_link_get_master(struct rtnl_link *)
Return master link of link object.
Definition link.c:2349
rtnl_link_set_mtu
void rtnl_link_set_mtu(struct rtnl_link *, unsigned int)
Set Maximum Transmission Unit of link object.
Definition link.c:2234
rtnl_link_set_link_netnsid
int rtnl_link_set_link_netnsid(struct rtnl_link *link, int32_t link_netnsid)
Set the netnsid of the link.
Definition link.c:2303
rtnl_link_get_num_rx_queues
uint32_t rtnl_link_get_num_rx_queues(struct rtnl_link *)
Return number of RX queues.
Definition link.c:2759
rtnl_link_get_weight
unsigned int rtnl_link_get_weight(struct rtnl_link *) __attribute__((deprecated))
Definition link.c:3199
rtnl_link_release_ifindex
int rtnl_link_release_ifindex(struct nl_sock *, int)
Release slave link from its master.
Definition link.c:2946
rtnl_link_alloc
struct rtnl_link * rtnl_link_alloc(void)
Allocate link object.
Definition link.c:1936
rtnl_link_set_addr
void rtnl_link_set_addr(struct rtnl_link *, struct nl_addr *)
Set link layer address of link object.
Definition link.c:2028
rtnl_link_set_arptype
void rtnl_link_set_arptype(struct rtnl_link *, unsigned int)
Set hardware type of link object.
Definition link.c:2176
rtnl_link_unset_flags
void rtnl_link_unset_flags(struct rtnl_link *, unsigned int)
Unset flags of link object.
Definition link.c:2114
rtnl_link_set_linkmode
void rtnl_link_set_linkmode(struct rtnl_link *, uint8_t)
Set link mode of link object.
Definition link.c:2432
rtnl_link_get_num_tx_queues
uint32_t rtnl_link_get_num_tx_queues(struct rtnl_link *)
Return number of TX queues.
Definition link.c:2728
rtnl_link_get_group
uint32_t rtnl_link_get_group(struct rtnl_link *)
Return the group identifier of link object.
Definition link.c:2000
rtnl_link_get_phys_port_id
struct nl_data * rtnl_link_get_phys_port_id(struct rtnl_link *)
Return physical port id of link object.
Definition link.c:2806
rtnl_link_get_slave_type
const char * rtnl_link_get_slave_type(const struct rtnl_link *)
Return type of enslaved link.
Definition link.c:2669
rtnl_link_get_operstate
uint8_t rtnl_link_get_operstate(struct rtnl_link *)
Return operational status of link object.
Definition link.c:2419
rtnl_link_delete
int rtnl_link_delete(struct nl_sock *, const struct rtnl_link *)
Delete link.
Definition link.c:1912
rtnl_link_get_broadcast
struct nl_addr * rtnl_link_get_broadcast(struct rtnl_link *)
Return link layer broadcast address of link object.
Definition link.c:2086
rtnl_link_get_num_vf
int rtnl_link_get_num_vf(struct rtnl_link *, uint32_t *)
Return number of PCI virtual functions of link object.
Definition link.c:2529
rtnl_link_set_slave_type
int rtnl_link_set_slave_type(struct rtnl_link *, const char *)
Set type of slave link object.
Definition link.c:2642
rtnl_link_get_phys_port_name
char * rtnl_link_get_phys_port_name(struct rtnl_link *)
Return physical port name of link object.
Definition link.c:2817
rtnl_link_build_change_request
int rtnl_link_build_change_request(struct rtnl_link *, struct rtnl_link *, int, struct nl_msg **)
Build a netlink message requesting the modification of link.
Definition link.c:1742
rtnl_link_set_weight
void rtnl_link_set_weight(struct rtnl_link *, unsigned int) __attribute__((deprecated))
Definition link.c:3190
rtnl_link_set_ifalias
void rtnl_link_set_ifalias(struct rtnl_link *, const char *)
Set alias name of link object (SNMP IfAlias)
Definition link.c:2476
rtnl_link_get_promiscuity
uint32_t rtnl_link_get_promiscuity(struct rtnl_link *)
Return link promiscuity count.
Definition link.c:2697
rtnl_link_set_num_tx_queues
void rtnl_link_set_num_tx_queues(struct rtnl_link *, uint32_t)
Set number of TX queues.
Definition link.c:2716
rtnl_link_build_add_request
int rtnl_link_build_add_request(struct rtnl_link *, int, struct nl_msg **)
Build a netlink message requesting the addition of new virtual link.
Definition link.c:1680
rtnl_link_set_name
void rtnl_link_set_name(struct rtnl_link *, const char *)
Set name of link object.
Definition link.c:1964
rtnl_link_get_type
char * rtnl_link_get_type(struct rtnl_link *)
Return type of link.
Definition link.c:2627
rtnl_link_get_qdisc
char * rtnl_link_get_qdisc(struct rtnl_link *)
Return name of queueing discipline of link object.
Definition link.c:2516
rtnl_link_set_num_rx_queues
void rtnl_link_set_num_rx_queues(struct rtnl_link *, uint32_t)
Set number of RX queues.
Definition link.c:2747
rtnl_link_get_by_name
struct rtnl_link * rtnl_link_get_by_name(struct nl_cache *, const char *)
Lookup link in cache by link name.
Definition link.c:1363
rtnl_link_name2i
int rtnl_link_name2i(struct nl_cache *, const char *)
Translate link name to corresponding interface index.
Definition link.c:1522
rtnl_link_alloc_cache
int rtnl_link_alloc_cache(struct nl_sock *, int, struct nl_cache **)
Allocate link cache and fill in all configured links.
Definition link.c:1310
rtnl_link_get_arptype
unsigned int rtnl_link_get_arptype(struct rtnl_link *)
Get hardware type of link object.
Definition link.c:2190
rtnl_link_set_group
void rtnl_link_set_group(struct rtnl_link *, uint32_t)
Set the group identifier of a link object.
Definition link.c:1988
rtnl_link_get_family
int rtnl_link_get_family(struct rtnl_link *)
Return address family of link object.
Definition link.c:2162
rtnl_link_get_kernel
int rtnl_link_get_kernel(struct nl_sock *, int, const char *, struct rtnl_link **)
Get a link object directly from kernel.
Definition link.c:1447
rtnl_link_set_flags
void rtnl_link_set_flags(struct rtnl_link *, unsigned int)
Set flags of link object.
Definition link.c:2099
rtnl_link_set_qdisc
void rtnl_link_set_qdisc(struct rtnl_link *, const char *)
Set queueing discipline name of link object.
Definition link.c:2502
rtnl_link_get
struct rtnl_link * rtnl_link_get(struct nl_cache *, int)
Lookup link in cache by interface index.
Definition link.c:1331
rtnl_link_get_txqlen
unsigned int rtnl_link_get_txqlen(struct rtnl_link *)
Return transmission queue length.
Definition link.c:2279
rtnl_link_get_name
char * rtnl_link_get_name(struct rtnl_link *)
Return name of link object.
Definition link.c:1978
rtnl_link_set_stat
int rtnl_link_set_stat(struct rtnl_link *, rtnl_link_stat_id_t, const uint64_t)
Set value of link statistics counter.
Definition link.c:2564
rtnl_link_alloc_cache_flags
int rtnl_link_alloc_cache_flags(struct nl_sock *, int, struct nl_cache **, unsigned int flags)
Allocate link cache and fill in all configured links.
Definition link.c:1262
rtnl_link_get_info_type
char * rtnl_link_get_info_type(struct rtnl_link *) __attribute__((deprecated))
Definition link.c:3182
rtnl_link_get_perm_addr
struct nl_addr * rtnl_link_get_perm_addr(struct rtnl_link *)
Return permanent link layer adress of link object.
Definition link.c:2055
rtnl_link_enslave_ifindex
int rtnl_link_enslave_ifindex(struct nl_sock *, int, int)
Enslave slave link to master link.
Definition link.c:2875
rtnl_link_build_delete_request
int rtnl_link_build_delete_request(const struct rtnl_link *, struct nl_msg **)
Build a netlink message requesting the deletion of a link.
Definition link.c:1863
rtnl_link_set_operstate
void rtnl_link_set_operstate(struct rtnl_link *, uint8_t)
Set operational status of link object.
Definition link.c:2405
rtnl_link_enslave
int rtnl_link_enslave(struct nl_sock *, struct rtnl_link *, struct rtnl_link *)
Enslave slave link to master link.
Definition link.c:2927
rtnl_link_set_promiscuity
void rtnl_link_set_promiscuity(struct rtnl_link *, uint32_t)
Set link promiscuity count.
Definition link.c:2684
rtnl_link_stat_id_t
rtnl_link_stat_id_t
Definition link.h:31
rtnl_link_get_gso_max_segs
int rtnl_link_get_gso_max_segs(struct rtnl_link *, uint32_t *)
Return maximum number of segments for generic segmentation offload.
Definition link.c:2771
rtnl_link_i2name
char * rtnl_link_i2name(struct nl_cache *, int, char *, size_t)
Translate interface index to corresponding link name.
Definition link.c:1499
rtnl_link_set_family
void rtnl_link_set_family(struct rtnl_link *, int)
Set address family of link object.
Definition link.c:2140
rtnl_link_get_carrier
uint8_t rtnl_link_get_carrier(struct rtnl_link *)
Return carrier status of link object.
Definition link.c:2374
rtnl_link_put
void rtnl_link_put(struct rtnl_link *)
Release a link object reference.
Definition link.c:1945
rtnl_link_set_type
int rtnl_link_set_type(struct rtnl_link *, const char *)
Set type of link object.
Definition link.c:2587
rtnl_link_set_info_type
int rtnl_link_set_info_type(struct rtnl_link *, const char *) __attribute__((deprecated))
Definition link.c:3174
rtnl_link_get_ifalias
const char * rtnl_link_get_ifalias(struct rtnl_link *)
Return alias name of link object (SNMP IfAlias)
Definition link.c:2459
rtnl_link_get_gso_max_size
int rtnl_link_get_gso_max_size(struct rtnl_link *, uint32_t *)
Return maximum size for generic segmentation offload.
Definition link.c:2789
rtnl_link_set_master
void rtnl_link_set_master(struct rtnl_link *, int)
Set master link of link object.
Definition link.c:2336
rtnl_link_get_mtu
unsigned int rtnl_link_get_mtu(struct rtnl_link *)
Return maximum transmission unit of link object.
Definition link.c:2248
rtnl_link_set_txqlen
void rtnl_link_set_txqlen(struct rtnl_link *, unsigned int)
Set transmission queue length.
Definition link.c:2263
rtnl_link_build_get_request
int rtnl_link_build_get_request(int, const char *, struct nl_msg **)
Construct RTM_GETLINK netlink message.
Definition link.c:1395
rtnl_link_set_ifindex
void rtnl_link_set_ifindex(struct rtnl_link *, int)
Set interface index of link object.
Definition link.c:2206
rtnl_link_get_addr
struct nl_addr * rtnl_link_get_addr(struct rtnl_link *)
Return link layer address of link object.
Definition link.c:2042
rtnl_link_get_carrier_changes
int rtnl_link_get_carrier_changes(struct rtnl_link *, uint32_t *)
Return carrier on/off changes of link object.
Definition link.c:2386
rtnl_link_get_link_netnsid
int rtnl_link_get_link_netnsid(const struct rtnl_link *link, int32_t *out_link_netnsid)
Get the netnsid of the link.
Definition link.c:2320
rtnl_link_get_flags
unsigned int rtnl_link_get_flags(struct rtnl_link *)
Return flags of link object.
Definition link.c:2130
rtnl_link_get_ifindex
int rtnl_link_get_ifindex(struct rtnl_link *)
Return interface index of link object.
Definition link.c:2221
rtnl_link_change
int rtnl_link_change(struct nl_sock *, struct rtnl_link *, struct rtnl_link *, int)
Change link.
Definition link.c:1813
RTNL_LINK_COLLISIONS
@ RTNL_LINK_COLLISIONS
Definition link.h:53
RTNL_LINK_IP6_INBCASTOCTETS
@ RTNL_LINK_IP6_INBCASTOCTETS
Definition link.h:83
RTNL_LINK_IP6_ECT0PKTS
@ RTNL_LINK_IP6_ECT0PKTS
Definition link.h:93
RTNL_LINK_RX_COMPRESSED
@ RTNL_LINK_RX_COMPRESSED
Definition link.h:40
RTNL_LINK_REASM_OVERLAPS
@ RTNL_LINK_REASM_OVERLAPS
Definition link.h:96
RTNL_LINK_IP6_INTRUNCATEDPKTS
@ RTNL_LINK_IP6_INTRUNCATEDPKTS
Definition link.h:61
RTNL_LINK_RX_LEN_ERR
@ RTNL_LINK_RX_LEN_ERR
Definition link.h:44
RTNL_LINK_ICMP6_INMSGS
@ RTNL_LINK_ICMP6_INMSGS
Definition link.h:85
RTNL_LINK_IP6_INNOROUTES
@ RTNL_LINK_IP6_INNOROUTES
Definition link.h:58
RTNL_LINK_IP6_OUTMCASTOCTETS
@ RTNL_LINK_IP6_OUTMCASTOCTETS
Definition link.h:82
RTNL_LINK_IP6_INMCASTPKTS
@ RTNL_LINK_IP6_INMCASTPKTS
Definition link.h:75
RTNL_LINK_IP6_REASMOKS
@ RTNL_LINK_IP6_REASMOKS
Definition link.h:70
RTNL_LINK_IP6_OUTBCASTOCTETS
@ RTNL_LINK_IP6_OUTBCASTOCTETS
Definition link.h:84
RTNL_LINK_IP6_INDELIVERS
@ RTNL_LINK_IP6_INDELIVERS
Definition link.h:63
RTNL_LINK_TX_DROPPED
@ RTNL_LINK_TX_DROPPED
Definition link.h:39
RTNL_LINK_IP6_REASMTIMEOUT
@ RTNL_LINK_IP6_REASMTIMEOUT
Definition link.h:68
RTNL_LINK_IP6_OUTPKTS
@ RTNL_LINK_IP6_OUTPKTS
Definition link.h:65
RTNL_LINK_IP6_OUTOCTETS
@ RTNL_LINK_IP6_OUTOCTETS
Definition link.h:80
RTNL_LINK_ICMP6_INERRORS
@ RTNL_LINK_ICMP6_INERRORS
Definition link.h:86
RTNL_LINK_IP6_FRAGFAILS
@ RTNL_LINK_IP6_FRAGFAILS
Definition link.h:73
RTNL_LINK_ICMP6_OUTMSGS
@ RTNL_LINK_ICMP6_OUTMSGS
Definition link.h:87
RTNL_LINK_IP6_CSUMERRORS
@ RTNL_LINK_IP6_CSUMERRORS
Definition link.h:90
RTNL_LINK_IP6_INUNKNOWNPROTOS
@ RTNL_LINK_IP6_INUNKNOWNPROTOS
Definition link.h:60
RTNL_LINK_ICMP6_CSUMERRORS
@ RTNL_LINK_ICMP6_CSUMERRORS
Definition link.h:89
RTNL_LINK_IP6_INPKTS
@ RTNL_LINK_IP6_INPKTS
Definition link.h:55
RTNL_LINK_RX_DROPPED
@ RTNL_LINK_RX_DROPPED
Definition link.h:38
RTNL_LINK_IP6_CEPKTS
@ RTNL_LINK_IP6_CEPKTS
Definition link.h:94
RTNL_LINK_IP6_INBCASTPKTS
@ RTNL_LINK_IP6_INBCASTPKTS
Definition link.h:77
RTNL_LINK_RX_FIFO_ERR
@ RTNL_LINK_RX_FIFO_ERR
Definition link.h:42
RTNL_LINK_TX_COMPRESSED
@ RTNL_LINK_TX_COMPRESSED
Definition link.h:41
RTNL_LINK_RX_ERRORS
@ RTNL_LINK_RX_ERRORS
Definition link.h:36
RTNL_LINK_RX_CRC_ERR
@ RTNL_LINK_RX_CRC_ERR
Definition link.h:46
RTNL_LINK_TX_HBEAT_ERR
@ RTNL_LINK_TX_HBEAT_ERR
Definition link.h:51
RTNL_LINK_IP6_INOCTETS
@ RTNL_LINK_IP6_INOCTETS
Definition link.h:79
RTNL_LINK_RX_NOHANDLER
@ RTNL_LINK_RX_NOHANDLER
Definition link.h:95
RTNL_LINK_RX_BYTES
@ RTNL_LINK_RX_BYTES
Definition link.h:34
RTNL_LINK_TX_BYTES
@ RTNL_LINK_TX_BYTES
Definition link.h:35
RTNL_LINK_IP6_INHDRERRORS
@ RTNL_LINK_IP6_INHDRERRORS
Definition link.h:56
RTNL_LINK_IP6_REASMREQDS
@ RTNL_LINK_IP6_REASMREQDS
Definition link.h:69
RTNL_LINK_TX_CARRIER_ERR
@ RTNL_LINK_TX_CARRIER_ERR
Definition link.h:50
RTNL_LINK_RX_MISSED_ERR
@ RTNL_LINK_RX_MISSED_ERR
Definition link.h:48
RTNL_LINK_IP6_OUTFORWDATAGRAMS
@ RTNL_LINK_IP6_OUTFORWDATAGRAMS
Definition link.h:64
RTNL_LINK_IP6_INDISCARDS
@ RTNL_LINK_IP6_INDISCARDS
Definition link.h:62
RTNL_LINK_IP6_NOECTPKTS
@ RTNL_LINK_IP6_NOECTPKTS
Definition link.h:91
RTNL_LINK_IP6_OUTNOROUTES
@ RTNL_LINK_IP6_OUTNOROUTES
Definition link.h:67
RTNL_LINK_IP6_OUTDISCARDS
@ RTNL_LINK_IP6_OUTDISCARDS
Definition link.h:66
RTNL_LINK_IP6_FRAGCREATES
@ RTNL_LINK_IP6_FRAGCREATES
Definition link.h:74
RTNL_LINK_ICMP6_OUTERRORS
@ RTNL_LINK_ICMP6_OUTERRORS
Definition link.h:88
RTNL_LINK_RX_OVER_ERR
@ RTNL_LINK_RX_OVER_ERR
Definition link.h:45
RTNL_LINK_IP6_INMCASTOCTETS
@ RTNL_LINK_IP6_INMCASTOCTETS
Definition link.h:81
RTNL_LINK_TX_ABORT_ERR
@ RTNL_LINK_TX_ABORT_ERR
Definition link.h:49
RTNL_LINK_IP6_INADDRERRORS
@ RTNL_LINK_IP6_INADDRERRORS
Definition link.h:59
RTNL_LINK_MULTICAST
@ RTNL_LINK_MULTICAST
Definition link.h:54
RTNL_LINK_IP6_ECT1PKTS
@ RTNL_LINK_IP6_ECT1PKTS
Definition link.h:92
RTNL_LINK_TX_FIFO_ERR
@ RTNL_LINK_TX_FIFO_ERR
Definition link.h:43
RTNL_LINK_TX_ERRORS
@ RTNL_LINK_TX_ERRORS
Definition link.h:37
RTNL_LINK_IP6_INTOOBIGERRORS
@ RTNL_LINK_IP6_INTOOBIGERRORS
Definition link.h:57
RTNL_LINK_RX_FRAME_ERR
@ RTNL_LINK_RX_FRAME_ERR
Definition link.h:47
RTNL_LINK_TX_WIN_ERR
@ RTNL_LINK_TX_WIN_ERR
Definition link.h:52
RTNL_LINK_RX_PACKETS
@ RTNL_LINK_RX_PACKETS
Definition link.h:32
RTNL_LINK_TX_PACKETS
@ RTNL_LINK_TX_PACKETS
Definition link.h:33
RTNL_LINK_IP6_OUTMCASTPKTS
@ RTNL_LINK_IP6_OUTMCASTPKTS
Definition link.h:76
RTNL_LINK_IP6_OUTBCASTPKTS
@ RTNL_LINK_IP6_OUTBCASTPKTS
Definition link.h:78
RTNL_LINK_IP6_FRAGOKS
@ RTNL_LINK_IP6_FRAGOKS
Definition link.h:72
RTNL_LINK_IP6_REASMFAILS
@ RTNL_LINK_IP6_REASMFAILS
Definition link.h:71
nla_policy
Attribute validation policy.
Definition attr.h:66
rtnl_link
Link object.
Definition nl-route.h:29