FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
l2_vtr.c File Reference

Ethernet VLAN Tag Rewrite. More...

+ Include dependency graph for l2_vtr.c:

Go to the source code of this file.

Functions

clib_error_tl2_vtr_init (vlib_main_t *vm)
 Just a placeholder; ensures file is not eliminated by linker. More...
 
u32 l2pbb_configure (vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 vtr_op, u8 *b_dmac, u8 *b_smac, u16 b_vlanid, u32 i_sid, u16 vlan_outer_tag)
 
u32 l2vtr_configure (vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 vtr_op, u32 push_dot1q, u32 vtr_tag1, u32 vtr_tag2)
 Configure vtag tag rewrite on the given interface. More...
 
u32 l2vtr_get (vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 *vtr_op, u32 *push_dot1q, u32 *vtr_tag1, u32 *vtr_tag2)
 Get vtag tag rewrite on the given interface. More...
 
static clib_error_tint_l2_vtr (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Set subinterface vtr enable/disable. More...
 
u32 l2pbb_get (vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 *vtr_op, u16 *outer_tag, ethernet_header_t *eth_hdr, u16 *b_vlanid, u32 *i_sid)
 Get pbb tag rewrite on the given interface. More...
 
static clib_error_tint_l2_pbb_vtr (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 Set subinterface pbb vtr enable/disable. More...
 

Variables

static vlib_cli_command_t int_l2_vtr_cli
 (constructor) VLIB_CLI_COMMAND (int_l2_vtr_cli) More...
 
static vlib_cli_command_t int_l2_pbb_vtr_cli
 (constructor) VLIB_CLI_COMMAND (int_l2_pbb_vtr_cli) More...
 

Detailed Description

Ethernet VLAN Tag Rewrite.

VLAN tag rewrite provides the ability to change the VLAN tags on a packet. Existing tags can be popped, new tags can be pushed, and existing tags can be swapped with new tags. The rewrite feature is attached to a subinterface as input and output operations. The input operation is explicitly configured. The output operation is the symmetric opposite and is automatically derived from the input operation.

Definition in file l2_vtr.c.

Function Documentation

◆ int_l2_pbb_vtr()

static clib_error_t* int_l2_pbb_vtr ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Set subinterface pbb vtr enable/disable.

The CLI format is: set interface l2 pbb-tag-rewrite <interface> [disable | pop | push | translate_pbb_stag <outer_tag> dmac <address> smac <address> s_id <nn> [b_vlanid <nn>]]

Definition at line 753 of file l2_vtr.c.

+ Here is the call graph for this function:

◆ int_l2_vtr()

static clib_error_t* int_l2_vtr ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Set subinterface vtr enable/disable.

The CLI format is: set interface l2 tag-rewrite <interface> [disable | pop 1 | pop 2 | push {dot1q|dot1ad} <tag> [<tag>]]

"push" can also be replaced by "translate-{1|2}-{1|2}"

Definition at line 507 of file l2_vtr.c.

+ Here is the call graph for this function:

◆ l2_vtr_init()

clib_error_t* l2_vtr_init ( vlib_main_t vm)

Just a placeholder; ensures file is not eliminated by linker.

Definition at line 46 of file l2_vtr.c.

◆ l2pbb_configure()

u32 l2pbb_configure ( vlib_main_t vlib_main,
vnet_main_t vnet_main,
u32  sw_if_index,
u32  vtr_op,
u8 b_dmac,
u8 b_smac,
u16  b_vlanid,
u32  i_sid,
u16  vlan_outer_tag 
)

Definition at line 54 of file l2_vtr.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l2pbb_get()

u32 l2pbb_get ( vlib_main_t vlib_main,
vnet_main_t vnet_main,
u32  sw_if_index,
u32 vtr_op,
u16 outer_tag,
ethernet_header_t eth_hdr,
u16 b_vlanid,
u32 i_sid 
)

Get pbb tag rewrite on the given interface.

Return 1 if there is an error, 0 if ok

Definition at line 686 of file l2_vtr.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l2vtr_configure()

u32 l2vtr_configure ( vlib_main_t vlib_main,
vnet_main_t vnet_main,
u32  sw_if_index,
u32  vtr_op,
u32  push_dot1q,
u32  vtr_tag1,
u32  vtr_tag2 
)

Configure vtag tag rewrite on the given interface.

Return 1 if there is an error, 0 if ok

Definition at line 136 of file l2_vtr.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ l2vtr_get()

u32 l2vtr_get ( vlib_main_t vlib_main,
vnet_main_t vnet_main,
u32  sw_if_index,
u32 vtr_op,
u32 push_dot1q,
u32 vtr_tag1,
u32 vtr_tag2 
)

Get vtag tag rewrite on the given interface.

Return 1 if there is an error, 0 if ok

Definition at line 347 of file l2_vtr.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ int_l2_pbb_vtr_cli

vlib_cli_command_t int_l2_pbb_vtr_cli
static
Initial value:
= {
.path = "set interface l2 pbb-tag-rewrite",
.short_help = "set interface l2 pbb-tag-rewrite <interface> [disable | pop | push | translate_pbb_stag <outer_tag> dmac <address> smac <address> s_id <nn> [b_vlanid <nn>]]",
.function = int_l2_pbb_vtr,
}

(constructor) VLIB_CLI_COMMAND (int_l2_pbb_vtr_cli)

Definition at line 820 of file l2_vtr.c.

◆ int_l2_vtr_cli

vlib_cli_command_t int_l2_vtr_cli
static
Initial value:
= {
.path = "set interface l2 tag-rewrite",
.short_help = "set interface l2 tag-rewrite <interface> [disable | pop {1|2} | push {dot1q|dot1ad} <tag> <tag>]",
.function = int_l2_vtr,
}

(constructor) VLIB_CLI_COMMAND (int_l2_vtr_cli)

Definition at line 674 of file l2_vtr.c.

int_l2_pbb_vtr
static clib_error_t * int_l2_pbb_vtr(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface pbb vtr enable/disable.
Definition: l2_vtr.c:753
int_l2_vtr
static clib_error_t * int_l2_vtr(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface vtr enable/disable.
Definition: l2_vtr.c:507