libnl  3.2.24-rc1

MAC-based Virtual LAN link module. More...

MACVLAN Object

struct rtnl_linkrtnl_link_macvlan_alloc (void)
 Allocate link object of type MACVLAN. More...
 
int rtnl_link_is_macvlan (struct rtnl_link *link)
 Check if link is a MACVLAN link. More...
 
int rtnl_link_macvlan_set_mode (struct rtnl_link *link, uint32_t mode)
 Set MACVLAN MODE. More...
 
uint32_t rtnl_link_macvlan_get_mode (struct rtnl_link *link)
 Get MACVLAN Mode. More...
 
int rtnl_link_macvlan_set_flags (struct rtnl_link *link, uint16_t flags)
 Set MACVLAN flags. More...
 
int rtnl_link_macvlan_unset_flags (struct rtnl_link *link, uint16_t flags)
 Unset MACVLAN flags. More...
 
uint16_t rtnl_link_macvlan_get_flags (struct rtnl_link *link)
 Get MACVLAN flags. More...
 

Flag Translation

char * rtnl_link_macvlan_flags2str (int flags, char *buf, size_t len)
 
int rtnl_link_macvlan_str2flags (const char *name)
 

Mode Translation

char * rtnl_link_macvlan_mode2str (int mode, char *buf, size_t len)
 
int rtnl_link_macvlan_str2mode (const char *name)
 

Detailed Description

MAC-based Virtual LAN link module.

Link Type Name: "macvlan"

MACVLAN Documentation (Netlink Routing Development Guide)

Function Documentation

struct rtnl_link* rtnl_link_macvlan_alloc ( void  )
read

Allocate link object of type MACVLAN.

Returns
Allocated link object or NULL.

Definition at line 190 of file macvlan.c.

References rtnl_link_alloc(), rtnl_link_put(), and rtnl_link_set_type().

+ Here is the call graph for this function:

int rtnl_link_is_macvlan ( struct rtnl_link link)

Check if link is a MACVLAN link.

Parameters
linkLink object
Returns
True if link is a MACVLAN link, otherwise false is returned.

Definition at line 212 of file macvlan.c.

int rtnl_link_macvlan_set_mode ( struct rtnl_link link,
uint32_t  mode 
)

Set MACVLAN MODE.

Parameters
linkLink object
modeMACVLAN mode
Returns
0 on success or a negative error code

Definition at line 224 of file macvlan.c.

uint32_t rtnl_link_macvlan_get_mode ( struct rtnl_link link)

Get MACVLAN Mode.

Parameters
linkLink object
Returns
MACVLAN mode, 0 if not set or a negative error code.

Definition at line 242 of file macvlan.c.

int rtnl_link_macvlan_set_flags ( struct rtnl_link link,
uint16_t  flags 
)

Set MACVLAN flags.

Parameters
linkLink object
flagsMACVLAN flags
Returns
0 on success or a negative error code.

Definition at line 261 of file macvlan.c.

int rtnl_link_macvlan_unset_flags ( struct rtnl_link link,
uint16_t  flags 
)

Unset MACVLAN flags.

Parameters
linkLink object
flagsMACVLAN flags

Note: kernel currently only has a single flag and lacks flags_mask to indicate which flags shall be changed (it always all).

Returns
0 on success or a negative error code.

Definition at line 283 of file macvlan.c.

uint16_t rtnl_link_macvlan_get_flags ( struct rtnl_link link)

Get MACVLAN flags.

Parameters
linkLink object
Returns
MACVLAN flags, 0 if none set, or a negative error code.

Definition at line 301 of file macvlan.c.