libnl 3.5.0

Macros
VLAN Manipulation
Routing Library (libnl-route) » Traffic Control » Action

## Macros
#define | VLAN_F_VID (1 << 0)
#define | VLAN_F_PROTO (1 << 1)
#define | VLAN_F_PRIO (1 << 2)
#define | VLAN_F_ACT (1 << 3)
#define | VLAN_F_MODE (1 << 4)

## Attribute Modifications
int | rtnl_vlan_set_mode (struct rtnl_act *act, int mode)
| Set vlan mode. More...
int | rtnl_vlan_get_mode (struct rtnl_act *act, int *out_mode)
| Get vlan mode. More...
int | rtnl_vlan_set_action (struct rtnl_act *act, int action)
| Set general action. More...
int | rtnl_vlan_get_action (struct rtnl_act *act, int *out_action)
| Get general action. More...
int | rtnl_vlan_set_protocol (struct rtnl_act *act, uint16_t protocol)
| Set protocol. More...
int | rtnl_vlan_get_protocol (struct rtnl_act *act, uint16_t *out_protocol)
| Get protocol. More...
int | rtnl_vlan_set_vlan_id (struct rtnl_act *act, uint16_t vid)
| Set vlan id. More...
int | rtnl_vlan_get_vlan_id (struct rtnl_act *act, uint16_t *out_vid)
| Get vlan id. More...
int | rtnl_vlan_set_vlan_prio (struct rtnl_act *act, uint8_t prio)
| Set vlan prio. More...
int | rtnl_vlan_get_vlan_prio (struct rtnl_act *act, uint8_t *out_prio)
| Get vlan prio. More...

## Detailed Description

## Function Documentation

## ◆ rtnl_vlan_set_mode()

int rtnl_vlan_set_mode | ( | struct rtnl_act * | act,
|  | int | mode
| ) |  |

Set vlan mode.

Parameters

  act | vlan action
  mode | one of (TCA_VLAN_ACT_*: POP, PUSH, MODIFY)

Returns
  0 on success or a negative error code.

Definition at line 202 of file vlan.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_get_mode()

int rtnl_vlan_get_mode | ( | struct rtnl_act * | act,
|  | int * | out_mode
| ) |  |

Get vlan mode.

Parameters

  act | vlan action
  out_mode | vlan mode output paramter

Returns
  0 on success if the vlan mode was returned or a negative error code.

Definition at line 224 of file vlan.c.

References rtnl_tc_data_peek(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_set_action()

int rtnl_vlan_set_action | ( | struct rtnl_act * | act,
|  | int | action
| ) |  |

Set general action.

Parameters

  act | vlan action
  action | one of (TCA_ACT_*: PIPE, SHOT, GOTO_CHAIN, etc)

Returns
  0 on success or a negative error code.

Definition at line 244 of file vlan.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_get_action()

int rtnl_vlan_get_action | ( | struct rtnl_act * | act,
|  | int * | out_action
| ) |  |

Get general action.

Parameters

  act | vlan action
  out_action | output parameter

Returns
  general 0 if out_action was set or a negative error code.

Definition at line 263 of file vlan.c.

References rtnl_tc_data_peek(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_set_protocol()

int rtnl_vlan_set_protocol | ( | struct rtnl_act * | act,
|  | uint16_t | protocol
| ) |  |

Set protocol.

Parameters

  act | vlan action
  protocol | one of (ETH_P_8021Q || ETH_P_8021AD)

Returns
  0 on success or a negative error code.

Definition at line 283 of file vlan.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_get_protocol()

int rtnl_vlan_get_protocol | ( | struct rtnl_act * | act,
|  | uint16_t * | out_protocol
| ) |  |

Get protocol.

Parameters

  act | vlan action
  out_protocol | protocol output argument

Returns
  0 if the protocol was returned or a negative error code.

Definition at line 302 of file vlan.c.

References rtnl_tc_data_peek(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_set_vlan_id()

int rtnl_vlan_set_vlan_id | ( | struct rtnl_act * | act,
|  | uint16_t | vid
| ) |  |

Set vlan id.

Parameters

  act | vlan action
  vid | vlan id

Returns
  0 on success or a negative error code.

Definition at line 322 of file vlan.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_get_vlan_id()

int rtnl_vlan_get_vlan_id | ( | struct rtnl_act * | act,
|  | uint16_t * | out_vid
| ) |  |

Get vlan id.

Parameters

  act | vlan action
  out_vid | output vlan id

Returns
  0 if the vlan id was returned or a negative error code.

Definition at line 344 of file vlan.c.

References rtnl_tc_data_peek(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_set_vlan_prio()

int rtnl_vlan_set_vlan_prio | ( | struct rtnl_act * | act,
|  | uint8_t | prio
| ) |  |

Set vlan prio.

Parameters

  act | vlan action
  prio | vlan priority (0 - 7)

Returns
  0 on success or a negative error code.

Definition at line 364 of file vlan.c.

References rtnl_tc_data(), and TC_CAST.

Here is the call graph for this function:

## ◆ rtnl_vlan_get_vlan_prio()

int rtnl_vlan_get_vlan_prio | ( | struct rtnl_act * | act,
|  | uint8_t * | out_prio
| ) |  |

Get vlan prio.

Parameters

  act | vlan action
  out_prio | the output vlan prio

Returns
  0 if the vlan prio was returned or a negative error code.

Definition at line 386 of file vlan.c.

References rtnl_tc_data_peek(), and TC_CAST.

Here is the call graph for this function: