netfilter
firewalling, NAT, and packet mangling for linux
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
link.h File Reference
#include <netlink/netlink.h>
#include <netlink/cache.h>
#include <netlink/addr.h>
Include dependency graph for link.h:
This graph shows which files directly or indirectly include this file:

Macros

#define RTNL_LINK_STATS_MAX   (__RTNL_LINK_STATS_MAX - 1)
 

Enumerations

enum  rtnl_link_st {
  RTNL_LINK_RX_PACKETS,
  RTNL_LINK_TX_PACKETS,
  RTNL_LINK_RX_BYTES,
  RTNL_LINK_TX_BYTES,
  RTNL_LINK_RX_ERRORS,
  RTNL_LINK_TX_ERRORS,
  RTNL_LINK_RX_DROPPED,
  RTNL_LINK_TX_DROPPED,
  RTNL_LINK_RX_COMPRESSED,
  RTNL_LINK_TX_COMPRESSED,
  RTNL_LINK_RX_FIFO_ERR,
  RTNL_LINK_TX_FIFO_ERR,
  RTNL_LINK_RX_LEN_ERR,
  RTNL_LINK_RX_OVER_ERR,
  RTNL_LINK_RX_CRC_ERR,
  RTNL_LINK_RX_FRAME_ERR,
  RTNL_LINK_RX_MISSED_ERR,
  RTNL_LINK_TX_ABORT_ERR,
  RTNL_LINK_TX_CARRIER_ERR,
  RTNL_LINK_TX_HBEAT_ERR,
  RTNL_LINK_TX_WIN_ERR,
  RTNL_LINK_TX_COLLISIONS,
  RTNL_LINK_MULTICAST,
  __RTNL_LINK_STATS_MAX
}
 

Functions

struct rtnl_linkrtnl_link_alloc (void)
 
void rtnl_link_put (struct rtnl_link *)
 
void rtnl_link_free (struct rtnl_link *)
 
int rtnl_link_alloc_cache (struct nl_sock *, struct nl_cache **)
 Allocate link cache and fill in all configured links. More...
 
struct rtnl_linkrtnl_link_get (struct nl_cache *, int)
 Look up link by interface index in the provided cache. More...
 
struct rtnl_linkrtnl_link_get_by_name (struct nl_cache *, const char *)
 Look up link by link name in the provided cache. More...
 
int rtnl_link_build_change_request (struct rtnl_link *, struct rtnl_link *, int, struct nl_msg **)
 Builds a netlink change request message to change link attributes. More...
 
int rtnl_link_change (struct nl_sock *, struct rtnl_link *, struct rtnl_link *, int)
 Change link attributes. More...
 
char * rtnl_link_i2name (struct nl_cache *, int, char *, size_t)
 Translate an interface index to the corresponding link name. More...
 
int rtnl_link_name2i (struct nl_cache *, const char *)
 Translate a link name to the corresponding interface index. More...
 
char * rtnl_link_stat2str (int, char *, size_t)
 
int rtnl_link_str2stat (const char *)
 
char * rtnl_link_flags2str (int, char *, size_t)
 
int rtnl_link_str2flags (const char *)
 
char * rtnl_link_operstate2str (int, char *, size_t)
 
int rtnl_link_str2operstate (const char *)
 
char * rtnl_link_mode2str (int, char *, size_t)
 
int rtnl_link_str2mode (const char *)
 
void rtnl_link_set_qdisc (struct rtnl_link *, const char *)
 
char * rtnl_link_get_qdisc (struct rtnl_link *)
 
void rtnl_link_set_name (struct rtnl_link *, const char *)
 
char * rtnl_link_get_name (struct rtnl_link *)
 
void rtnl_link_set_flags (struct rtnl_link *, unsigned int)
 
void rtnl_link_unset_flags (struct rtnl_link *, unsigned int)
 
unsigned int rtnl_link_get_flags (struct rtnl_link *)
 
void rtnl_link_set_mtu (struct rtnl_link *, unsigned int)
 
unsigned int rtnl_link_get_mtu (struct rtnl_link *)
 
void rtnl_link_set_txqlen (struct rtnl_link *, unsigned int)
 
unsigned int rtnl_link_get_txqlen (struct rtnl_link *)
 
void rtnl_link_set_weight (struct rtnl_link *, unsigned int)
 
unsigned int rtnl_link_get_weight (struct rtnl_link *)
 
void rtnl_link_set_ifindex (struct rtnl_link *, int)
 
int rtnl_link_get_ifindex (struct rtnl_link *)
 
void rtnl_link_set_family (struct rtnl_link *, int)
 
int rtnl_link_get_family (struct rtnl_link *)
 
void rtnl_link_set_arptype (struct rtnl_link *, unsigned int)
 
unsigned int rtnl_link_get_arptype (struct rtnl_link *)
 
void rtnl_link_set_addr (struct rtnl_link *, struct nl_addr *)
 
struct nl_addrrtnl_link_get_addr (struct rtnl_link *)
 
void rtnl_link_set_broadcast (struct rtnl_link *, struct nl_addr *)
 
struct nl_addrrtnl_link_get_broadcast (struct rtnl_link *)
 
void rtnl_link_set_link (struct rtnl_link *, int)
 
int rtnl_link_get_link (struct rtnl_link *)
 
void rtnl_link_set_master (struct rtnl_link *, int)
 
int rtnl_link_get_master (struct rtnl_link *)
 
void rtnl_link_set_operstate (struct rtnl_link *, uint8_t)
 
uint8_t rtnl_link_get_operstate (struct rtnl_link *)
 
void rtnl_link_set_linkmode (struct rtnl_link *, uint8_t)
 
uint8_t rtnl_link_get_linkmode (struct rtnl_link *)
 
uint64_t rtnl_link_get_stat (struct rtnl_link *, int)
 
int rtnl_link_set_info_type (struct rtnl_link *, const char *)
 Specify the info type of a link. More...
 
char * rtnl_link_get_info_type (struct rtnl_link *)
 Return info type of a link. More...
 

Macro Definition Documentation

#define RTNL_LINK_STATS_MAX   (__RTNL_LINK_STATS_MAX - 1)

Referenced by rtnl_link_get_stat().

Enumeration Type Documentation

Enumerator
RTNL_LINK_RX_PACKETS 
RTNL_LINK_TX_PACKETS 
RTNL_LINK_RX_BYTES 
RTNL_LINK_TX_BYTES 
RTNL_LINK_RX_ERRORS 
RTNL_LINK_TX_ERRORS 
RTNL_LINK_RX_DROPPED 
RTNL_LINK_TX_DROPPED 
RTNL_LINK_RX_COMPRESSED 
RTNL_LINK_TX_COMPRESSED 
RTNL_LINK_RX_FIFO_ERR 
RTNL_LINK_TX_FIFO_ERR 
RTNL_LINK_RX_LEN_ERR 
RTNL_LINK_RX_OVER_ERR 
RTNL_LINK_RX_CRC_ERR 
RTNL_LINK_RX_FRAME_ERR 
RTNL_LINK_RX_MISSED_ERR 
RTNL_LINK_TX_ABORT_ERR 
RTNL_LINK_TX_CARRIER_ERR 
RTNL_LINK_TX_HBEAT_ERR 
RTNL_LINK_TX_WIN_ERR 
RTNL_LINK_TX_COLLISIONS 
RTNL_LINK_MULTICAST 
__RTNL_LINK_STATS_MAX 

Function Documentation

void rtnl_link_free ( struct rtnl_link )