libnl 3.5.0

VLAN
Routing Library (libnl-route) » Links (Interfaces)

Virtual LAN link module. More...

## VLAN Object
struct rtnl_link * | rtnl_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_map * | rtnl_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 392 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

  link | Link object

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

Definition at line 414 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

  link | Link object
  id | VLAN identifier

Returns
  0 on success or a negative error code

Definition at line 426 of file vlan.c.

## ◆ rtnl_link_vlan_get_id()

int rtnl_link_vlan_get_id | ( | struct rtnl_link * | link | ) |

Get VLAN Id.

Parameters

  link | Link object

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

Definition at line 444 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

  link | Link object
  protocol | VLAN 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 464 of file vlan.c.

## ◆ rtnl_link_vlan_get_protocol()

int rtnl_link_vlan_get_protocol | ( | struct rtnl_link * | link | ) |

Get VLAN protocol.

Parameters

  link | Link 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 483 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

  link | Link object
  flags | VLAN flags

Returns
  0 on success or a negative error code.

Definition at line 502 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

  link | Link object
  flags | VLAN flags

Returns
  0 on success or a negative error code.

Definition at line 522 of file vlan.c.

## ◆ rtnl_link_vlan_get_flags()

int rtnl_link_vlan_get_flags | ( | struct rtnl_link * | link | ) |

Get VLAN flags.

Parameters

  link | Link object

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

Definition at line 541 of file vlan.c.