libnl 3.7.0

Virtual LAN link module. More...

VLAN Object

struct rtnl_linkrtnl_link_vlan_alloc (void)
 Allocate link object of type VLAN. More...
 
int rtnl_link_is_vlan (struct rtnl_link *link)
 Check if link is a VLAN link. More...
 
int rtnl_link_vlan_set_id (struct rtnl_link *link, uint16_t id)
 Set VLAN ID. More...
 
int rtnl_link_vlan_get_id (struct rtnl_link *link)
 Get VLAN Id. More...
 
int rtnl_link_vlan_set_protocol (struct rtnl_link *link, uint16_t protocol)
 Set VLAN protocol. More...
 
int rtnl_link_vlan_get_protocol (struct rtnl_link *link)
 Get VLAN protocol. More...
 
int rtnl_link_vlan_set_flags (struct rtnl_link *link, unsigned int flags)
 Set VLAN flags. More...
 
int rtnl_link_vlan_unset_flags (struct rtnl_link *link, unsigned int flags)
 Unset VLAN flags. More...
 
int rtnl_link_vlan_get_flags (struct rtnl_link *link)
 Get VLAN flags. More...
 

Quality of Service

int rtnl_link_vlan_set_ingress_map (struct rtnl_link *link, int from, uint32_t to)
 
uint32_t * rtnl_link_vlan_get_ingress_map (struct rtnl_link *link)
 
int rtnl_link_vlan_set_egress_map (struct rtnl_link *link, uint32_t from, int to)
 
struct vlan_maprtnl_link_vlan_get_egress_map (struct rtnl_link *link, int *negress)
 

Flag Translation

char * rtnl_link_vlan_flags2str (int flags, char *buf, size_t len)
 
int rtnl_link_vlan_str2flags (const char *name)
 

Detailed Description

Virtual LAN link module.

Link Type Name: "vlan"

VLAN Documentation (Netlink Routing Development Guide)

Function Documentation

◆ rtnl_link_vlan_alloc()

struct rtnl_link * rtnl_link_vlan_alloc ( void  )

Allocate link object of type VLAN.

Returns
Allocated link object or NULL.

Definition at line 397 of file vlan.c.

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

+ Here is the call graph for this function:

◆ rtnl_link_is_vlan()

int rtnl_link_is_vlan ( struct rtnl_link link)

Check if link is a VLAN link.

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

Definition at line 418 of file vlan.c.

◆ rtnl_link_vlan_set_id()

int rtnl_link_vlan_set_id ( struct rtnl_link link,
uint16_t  id 
)

Set VLAN ID.

Parameters
linkLink object
idVLAN identifier
Returns
0 on success or a negative error code

Definition at line 430 of file vlan.c.

◆ rtnl_link_vlan_get_id()

int rtnl_link_vlan_get_id ( struct rtnl_link link)

Get VLAN Id.

Parameters
linkLink object
Returns
VLAN id, 0 if not set or a negative error code.

Definition at line 448 of file vlan.c.

◆ rtnl_link_vlan_set_protocol()

int rtnl_link_vlan_set_protocol ( struct rtnl_link link,
uint16_t  protocol 
)

Set VLAN protocol.

Parameters
linkLink object
protocolVLAN protocol in network byte order. Probably you want to set it to something like htons(ETH_P_8021Q).
Returns
0 on success or a negative error code

Definition at line 468 of file vlan.c.

◆ rtnl_link_vlan_get_protocol()

int rtnl_link_vlan_get_protocol ( struct rtnl_link link)

Get VLAN protocol.

Parameters
linkLink object
Returns
VLAN protocol in network byte order like htons(ETH_P_8021Q), 0 if not set or a negative error code.

Definition at line 487 of file vlan.c.

◆ rtnl_link_vlan_set_flags()

int rtnl_link_vlan_set_flags ( struct rtnl_link link,
unsigned int  flags 
)

Set VLAN flags.

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

Definition at line 506 of file vlan.c.

◆ rtnl_link_vlan_unset_flags()

int rtnl_link_vlan_unset_flags ( struct rtnl_link link,
unsigned int  flags 
)

Unset VLAN flags.

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

Definition at line 526 of file vlan.c.

◆ rtnl_link_vlan_get_flags()

int rtnl_link_vlan_get_flags ( struct rtnl_link link)

Get VLAN flags.

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

Definition at line 545 of file vlan.c.

◆ rtnl_link_vlan_set_ingress_map()

int rtnl_link_vlan_set_ingress_map ( struct rtnl_link link,
int  from,
uint32_t  to 
)

Definition at line 561 of file vlan.c.

◆ rtnl_link_vlan_get_ingress_map()

uint32_t * rtnl_link_vlan_get_ingress_map ( struct rtnl_link link)

Definition at line 578 of file vlan.c.

◆ rtnl_link_vlan_set_egress_map()

int rtnl_link_vlan_set_egress_map ( struct rtnl_link link,
uint32_t  from,
int  to 
)

Definition at line 591 of file vlan.c.

◆ rtnl_link_vlan_get_egress_map()

struct vlan_map * rtnl_link_vlan_get_egress_map ( struct rtnl_link link,
int *  negress 
)

Definition at line 627 of file vlan.c.

◆ rtnl_link_vlan_flags2str()

char * rtnl_link_vlan_flags2str ( int  flags,
char *  buf,
size_t  len 
)

Definition at line 662 of file vlan.c.

◆ rtnl_link_vlan_str2flags()

int rtnl_link_vlan_str2flags ( const char *  name)

Definition at line 667 of file vlan.c.