9#include <netlink/netlink.h>
10#include <netlink/cache.h>
11#include <netlink/addr.h>
97 __RTNL_LINK_STATS_MAX,
100#define RTNL_LINK_STATS_MAX (__RTNL_LINK_STATS_MAX - 1)
137extern char * rtnl_link_stat2str(
int,
char *,
size_t);
138extern int rtnl_link_str2stat(
const char *);
141extern char * rtnl_link_flags2str(
int,
char *,
size_t);
142extern int rtnl_link_str2flags(
const char *);
144extern char * rtnl_link_operstate2str(uint8_t,
char *,
size_t);
145extern int rtnl_link_str2operstate(
const char *);
147extern char * rtnl_link_mode2str(uint8_t,
char *,
size_t);
148extern int rtnl_link_str2mode(
const char *);
151extern char * rtnl_link_carrier2str(uint8_t,
char *,
size_t);
152extern int rtnl_link_str2carrier(
const char *);
189extern void rtnl_link_set_link(
struct rtnl_link *,
int);
190extern int rtnl_link_get_link(
struct rtnl_link *);
241extern struct nl_data * rtnl_link_get_phys_switch_id(
struct rtnl_link *);
243extern void rtnl_link_set_ns_fd(
struct rtnl_link *,
int);
244extern int rtnl_link_get_ns_fd(
struct rtnl_link *);
245extern void rtnl_link_set_ns_pid(
struct rtnl_link *, pid_t);
246extern pid_t rtnl_link_get_ns_pid(
struct rtnl_link *);
253extern int rtnl_link_fill_info(
struct nl_msg *,
struct rtnl_link *);
254extern int rtnl_link_info_parse(
struct rtnl_link *,
struct nlattr **);
256extern int rtnl_link_has_vf_list(
struct rtnl_link *);
257extern void rtnl_link_set_vf_list(
struct rtnl_link *);
258extern void rtnl_link_unset_vf_list(
struct rtnl_link *);
int rtnl_link_release(struct nl_sock *, struct rtnl_link *)
Release slave link from its master.
int rtnl_link_add(struct nl_sock *, struct rtnl_link *, int)
Add virtual link.
void rtnl_link_set_broadcast(struct rtnl_link *, struct nl_addr *)
Set link layer broadcast address of link object.
void rtnl_link_set_carrier(struct rtnl_link *, uint8_t)
Set carrier of link object.
uint8_t rtnl_link_get_linkmode(struct rtnl_link *)
Return link mode of link object.
uint64_t rtnl_link_get_stat(struct rtnl_link *, rtnl_link_stat_id_t)
Return value of link statistics counter.
int rtnl_link_get_master(struct rtnl_link *)
Return master link of link object.
void rtnl_link_set_mtu(struct rtnl_link *, unsigned int)
Set Maximum Transmission Unit of link object.
int rtnl_link_set_link_netnsid(struct rtnl_link *link, int32_t link_netnsid)
Set the netnsid of the link.
uint32_t rtnl_link_get_num_rx_queues(struct rtnl_link *)
Return number of RX queues.
unsigned int rtnl_link_get_weight(struct rtnl_link *) __attribute__((deprecated))
int rtnl_link_release_ifindex(struct nl_sock *, int)
Release slave link from its master.
struct rtnl_link * rtnl_link_alloc(void)
Allocate link object.
void rtnl_link_set_addr(struct rtnl_link *, struct nl_addr *)
Set link layer address of link object.
void rtnl_link_set_arptype(struct rtnl_link *, unsigned int)
Set hardware type of link object.
void rtnl_link_unset_flags(struct rtnl_link *, unsigned int)
Unset flags of link object.
void rtnl_link_set_linkmode(struct rtnl_link *, uint8_t)
Set link mode of link object.
uint32_t rtnl_link_get_num_tx_queues(struct rtnl_link *)
Return number of TX queues.
uint32_t rtnl_link_get_group(struct rtnl_link *)
Return the group identifier of link object.
struct nl_data * rtnl_link_get_phys_port_id(struct rtnl_link *)
Return physical port id of link object.
const char * rtnl_link_get_slave_type(const struct rtnl_link *)
Return type of enslaved link.
uint8_t rtnl_link_get_operstate(struct rtnl_link *)
Return operational status of link object.
int rtnl_link_delete(struct nl_sock *, const struct rtnl_link *)
Delete link.
struct nl_addr * rtnl_link_get_broadcast(struct rtnl_link *)
Return link layer broadcast address of link object.
int rtnl_link_get_num_vf(struct rtnl_link *, uint32_t *)
Return number of PCI virtual functions of link object.
int rtnl_link_set_slave_type(struct rtnl_link *, const char *)
Set type of slave link object.
char * rtnl_link_get_phys_port_name(struct rtnl_link *)
Return physical port name of link object.
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.
void rtnl_link_set_weight(struct rtnl_link *, unsigned int) __attribute__((deprecated))
void rtnl_link_set_ifalias(struct rtnl_link *, const char *)
Set alias name of link object (SNMP IfAlias)
uint32_t rtnl_link_get_promiscuity(struct rtnl_link *)
Return link promiscuity count.
void rtnl_link_set_num_tx_queues(struct rtnl_link *, uint32_t)
Set number of TX queues.
int rtnl_link_build_add_request(struct rtnl_link *, int, struct nl_msg **)
Build a netlink message requesting the addition of new virtual link.
void rtnl_link_set_name(struct rtnl_link *, const char *)
Set name of link object.
char * rtnl_link_get_type(struct rtnl_link *)
Return type of link.
char * rtnl_link_get_qdisc(struct rtnl_link *)
Return name of queueing discipline of link object.
void rtnl_link_set_num_rx_queues(struct rtnl_link *, uint32_t)
Set number of RX queues.
struct rtnl_link * rtnl_link_get_by_name(struct nl_cache *, const char *)
Lookup link in cache by link name.
int rtnl_link_name2i(struct nl_cache *, const char *)
Translate link name to corresponding interface index.
int rtnl_link_alloc_cache(struct nl_sock *, int, struct nl_cache **)
Allocate link cache and fill in all configured links.
unsigned int rtnl_link_get_arptype(struct rtnl_link *)
Get hardware type of link object.
void rtnl_link_set_group(struct rtnl_link *, uint32_t)
Set the group identifier of a link object.
int rtnl_link_get_family(struct rtnl_link *)
Return address family of link object.
int rtnl_link_get_kernel(struct nl_sock *, int, const char *, struct rtnl_link **)
Get a link object directly from kernel.
void rtnl_link_set_flags(struct rtnl_link *, unsigned int)
Set flags of link object.
void rtnl_link_set_qdisc(struct rtnl_link *, const char *)
Set queueing discipline name of link object.
struct rtnl_link * rtnl_link_get(struct nl_cache *, int)
Lookup link in cache by interface index.
unsigned int rtnl_link_get_txqlen(struct rtnl_link *)
Return transmission queue length.
char * rtnl_link_get_name(struct rtnl_link *)
Return name of link object.
int rtnl_link_set_stat(struct rtnl_link *, rtnl_link_stat_id_t, const uint64_t)
Set value of link statistics counter.
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.
char * rtnl_link_get_info_type(struct rtnl_link *) __attribute__((deprecated))
int rtnl_link_enslave_ifindex(struct nl_sock *, int, int)
Enslave slave link to master link.
int rtnl_link_build_delete_request(const struct rtnl_link *, struct nl_msg **)
Build a netlink message requesting the deletion of a link.
void rtnl_link_set_operstate(struct rtnl_link *, uint8_t)
Set operational status of link object.
int rtnl_link_enslave(struct nl_sock *, struct rtnl_link *, struct rtnl_link *)
Enslave slave link to master link.
void rtnl_link_set_promiscuity(struct rtnl_link *, uint32_t)
Set link promiscuity count.
int rtnl_link_get_gso_max_segs(struct rtnl_link *, uint32_t *)
Return maximum number of segments for generic segmentation offload.
char * rtnl_link_i2name(struct nl_cache *, int, char *, size_t)
Translate interface index to corresponding link name.
void rtnl_link_set_family(struct rtnl_link *, int)
Set address family of link object.
uint8_t rtnl_link_get_carrier(struct rtnl_link *)
Return carrier status of link object.
void rtnl_link_put(struct rtnl_link *)
Return a link object reference.
int rtnl_link_set_type(struct rtnl_link *, const char *)
Set type of link object.
int rtnl_link_set_info_type(struct rtnl_link *, const char *) __attribute__((deprecated))
const char * rtnl_link_get_ifalias(struct rtnl_link *)
Return alias name of link object (SNMP IfAlias)
int rtnl_link_get_gso_max_size(struct rtnl_link *, uint32_t *)
Return maximum size for generic segmentation offload.
void rtnl_link_set_master(struct rtnl_link *, int)
Set master link of link object.
unsigned int rtnl_link_get_mtu(struct rtnl_link *)
Return maximum transmission unit of link object.
void rtnl_link_set_txqlen(struct rtnl_link *, unsigned int)
Set transmission queue length.
int rtnl_link_build_get_request(int, const char *, struct nl_msg **)
Construct RTM_GETLINK netlink message.
void rtnl_link_set_ifindex(struct rtnl_link *, int)
Set interface index of link object.
struct nl_addr * rtnl_link_get_addr(struct rtnl_link *)
Return link layer address of link object.
int rtnl_link_get_carrier_changes(struct rtnl_link *, uint32_t *)
Return carrier on/off changes of link object.
int rtnl_link_get_link_netnsid(const struct rtnl_link *link, int32_t *out_link_netnsid)
Get the netnsid of the link.
unsigned int rtnl_link_get_flags(struct rtnl_link *)
Return flags of link object.
int rtnl_link_get_ifindex(struct rtnl_link *)
Return interface index of link object.
int rtnl_link_change(struct nl_sock *, struct rtnl_link *, struct rtnl_link *, int)
Change link.
@ RTNL_LINK_IP6_INBCASTOCTETS
@ RTNL_LINK_RX_COMPRESSED
@ RTNL_LINK_REASM_OVERLAPS
@ RTNL_LINK_IP6_INTRUNCATEDPKTS
@ RTNL_LINK_IP6_INNOROUTES
@ RTNL_LINK_IP6_OUTMCASTOCTETS
@ RTNL_LINK_IP6_INMCASTPKTS
@ RTNL_LINK_IP6_OUTBCASTOCTETS
@ RTNL_LINK_IP6_INDELIVERS
@ RTNL_LINK_IP6_REASMTIMEOUT
@ RTNL_LINK_IP6_OUTOCTETS
@ RTNL_LINK_ICMP6_INERRORS
@ RTNL_LINK_IP6_FRAGFAILS
@ RTNL_LINK_ICMP6_OUTMSGS
@ RTNL_LINK_IP6_CSUMERRORS
@ RTNL_LINK_IP6_INUNKNOWNPROTOS
@ RTNL_LINK_ICMP6_CSUMERRORS
@ RTNL_LINK_IP6_INBCASTPKTS
@ RTNL_LINK_TX_COMPRESSED
@ RTNL_LINK_IP6_INHDRERRORS
@ RTNL_LINK_IP6_REASMREQDS
@ RTNL_LINK_TX_CARRIER_ERR
@ RTNL_LINK_RX_MISSED_ERR
@ RTNL_LINK_IP6_OUTFORWDATAGRAMS
@ RTNL_LINK_IP6_INDISCARDS
@ RTNL_LINK_IP6_NOECTPKTS
@ RTNL_LINK_IP6_OUTNOROUTES
@ RTNL_LINK_IP6_OUTDISCARDS
@ RTNL_LINK_IP6_FRAGCREATES
@ RTNL_LINK_ICMP6_OUTERRORS
@ RTNL_LINK_IP6_INMCASTOCTETS
@ RTNL_LINK_IP6_INADDRERRORS
@ RTNL_LINK_IP6_INTOOBIGERRORS
@ RTNL_LINK_IP6_OUTMCASTPKTS
@ RTNL_LINK_IP6_OUTBCASTPKTS
@ RTNL_LINK_IP6_REASMFAILS
Attribute validation policy.