FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
mpls.h File Reference
+ Include dependency graph for mpls.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mpls_eth_tunnel_t
 
struct  mpls_encap_t
 
struct  mpls_fib_t_
 
struct  mpls_main_t
 
struct  mpls_eth_tx_trace_t
 
struct  show_mpls_fib_t
 

Macros

#define mpls_error(n, s)   MPLS_ERROR_##n,
 
#define MPLS_FIB_DEFAULT_TABLE_ID   0
 
#define MPLS_FIB_KEY_SIZE   21
 Type exposure is to allow the DP fast/inlined access. More...
 
#define MPLS_FIB_DB_SIZE   (1 << (MPLS_FIB_KEY_SIZE-1))
 
#define VNET_MPLS_FEATURE_INIT(x, ...)
 
#define VNET_MPLS_TX_FEATURE_INIT(x, ...)
 
#define foreach_mpls_input_next
 
#define foreach_mpls_lookup_next
 
#define foreach_mpls_output_next   _(DROP, "error-drop")
 

Typedefs

typedef struct mpls_fib_t_ mpls_fib_t
 
typedef void(* mpls_interface_state_change_callback_t) (u32 sw_if_index, u32 is_enable)
 Definition of a callback for receiving MPLS interface state change notifications. More...
 

Enumerations

enum  mpls_error_t { mpls_error, mpls_error }
 
enum  mpls_input_next_t { MPLS_INPUT_N_NEXT }
 
enum  mpls_lookup_next_t { MPLS_LOOKUP_N_NEXT }
 
enum  mpls_output_next_t { MPLS_OUTPUT_N_NEXT }
 

Functions

clib_error_tmpls_feature_init (vlib_main_t *vm)
 
void mpls_sw_interface_enable_disable (mpls_main_t *mm, u32 sw_if_index, u8 is_enable)
 
u8 mpls_sw_interface_is_enabled (u32 sw_if_index)
 
mpls_encap_tmpls_encap_by_fib_and_dest (mpls_main_t *mm, u32 rx_fib, u32 dst_address)
 
int vnet_mpls_ethernet_add_del_tunnel (u8 *dst, ip4_address_t *intfc, u32 mask_width, u32 inner_fib_id, u32 tx_sw_if_index, u32 *tunnel_sw_if_index, u8 l2_only, u8 is_add)
 
int mpls_fib_reset_labels (u32 fib_id)
 
int vnet_mpls_add_del_encap (ip4_address_t *dest, u32 fib_id, u32 *labels_host_byte_order, u32 policy_tunnel_index, int no_dst_hash, u32 *indexp, int is_add)
 
int vnet_mpls_policy_tunnel_add_rewrite (mpls_main_t *mm, mpls_encap_t *e, u32 policy_tunnel_index)
 
u8format_mpls_eth_tx_trace (u8 *s, va_list *args)
 
int mpls_dest_cmp (void *a1, void *a2)
 
int mpls_fib_index_cmp (void *a1, void *a2)
 
int mpls_label_cmp (void *a1, void *a2)
 

Variables

mpls_main_t mpls_main
 
format_function_t format_mpls_protocol
 
format_function_t format_mpls_eth_header_with_length
 
format_function_t format_mpls_encap_index
 
format_function_t format_mpls_eos_bit
 
format_function_t format_mpls_unicast_header_net_byte_order
 
format_function_t format_mpls_unicast_label
 
format_function_t format_mpls_header
 
vlib_node_registration_t mpls_input_node
 (constructor) VLIB_REGISTER_NODE (mpls_input_node) More...
 
vlib_node_registration_t mpls_policy_encap_node
 (constructor) VLIB_REGISTER_NODE (mpls_policy_encap_node) More...
 
vlib_node_registration_t mpls_output_node
 (constructor) VLIB_REGISTER_NODE (mpls_output_node) More...
 
vlib_node_registration_t mpls_midchain_node
 (constructor) VLIB_REGISTER_NODE (mpls_midchain_node) More...
 
unformat_function_t unformat_mpls_protocol_host_byte_order
 
unformat_function_t unformat_mpls_protocol_net_byte_order
 
unformat_function_t unformat_mpls_label_net_byte_order
 
unformat_function_t unformat_mpls_unicast_label
 
unformat_function_t unformat_mpls_header
 
unformat_function_t unformat_pg_mpls_header
 

Macro Definition Documentation

#define foreach_mpls_input_next
Value:
_(DROP, "error-drop") \
_(LOOKUP, "mpls-lookup")
DROP
Definition: error.def:41

Definition at line 213 of file mpls.h.

#define foreach_mpls_lookup_next
Value:
_(DROP, "error-drop") \
_(IP4_INPUT, "ip4-input") \
_(L2_OUTPUT, "l2-output")
DROP
Definition: error.def:41

Definition at line 224 of file mpls.h.

#define foreach_mpls_output_next   _(DROP, "error-drop")

Definition at line 237 of file mpls.h.

#define mpls_error (   n,
 
)    MPLS_ERROR_##n,

Definition at line 27 of file mpls.h.

#define MPLS_FIB_DB_SIZE   (1 << (MPLS_FIB_KEY_SIZE-1))

Definition at line 63 of file mpls.h.

#define MPLS_FIB_DEFAULT_TABLE_ID   0

Definition at line 57 of file mpls.h.

#define MPLS_FIB_KEY_SIZE   21

Type exposure is to allow the DP fast/inlined access.

Definition at line 62 of file mpls.h.

#define VNET_MPLS_FEATURE_INIT (   x,
  ... 
)
Value:
__VA_ARGS__ vnet_feature_registration_t uc_##x; \
static void __vnet_add_feature_registration_uc_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_uc_##x (void) \
{ \
mpls_main_t * mm = &mpls_main; \
uc_##x.next = mm->next_feature[VNET_IP_RX_UNICAST_FEAT]; \
mm->next_feature[VNET_IP_RX_UNICAST_FEAT] = &uc_##x; \
} \
__VA_ARGS__ vnet_feature_registration_t uc_##x
mpls_main_t mpls_main
Definition: mpls.c:25
vnet_feature_registration_t * next_feature[VNET_N_IP_FEAT]
Definition: mpls.h:118
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object

Definition at line 133 of file mpls.h.

#define VNET_MPLS_TX_FEATURE_INIT (   x,
  ... 
)
Value:
__VA_ARGS__ vnet_feature_registration_t tx_##x; \
static void __vnet_add_feature_registration_tx_##x (void) \
__attribute__((__constructor__)) ; \
static void __vnet_add_feature_registration_tx_##x (void) \
{ \
mpls_main_t * mm = &mpls_main; \
tx_##x.next = mm->next_feature[VNET_IP_TX_FEAT]; \
mm->next_feature[VNET_IP_TX_FEAT] = &tx_##x; \
} \
__VA_ARGS__ vnet_feature_registration_t tx_##x
mpls_main_t mpls_main
Definition: mpls.c:25
vnet_feature_registration_t * next_feature[VNET_N_IP_FEAT]
Definition: mpls.h:118
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object

Definition at line 145 of file mpls.h.

Typedef Documentation

typedef struct mpls_fib_t_ mpls_fib_t
typedef void(* mpls_interface_state_change_callback_t) (u32 sw_if_index, u32 is_enable)

Definition of a callback for receiving MPLS interface state change notifications.

Definition at line 84 of file mpls.h.

Enumeration Type Documentation

Enumerator
mpls_error 
mpls_error 

Definition at line 26 of file mpls.h.

Enumerator
MPLS_INPUT_N_NEXT 

Definition at line 217 of file mpls.h.

Enumerator
MPLS_LOOKUP_N_NEXT 

Definition at line 230 of file mpls.h.

Enumerator
MPLS_OUTPUT_N_NEXT 

Definition at line 240 of file mpls.h.

Function Documentation

u8* format_mpls_eth_tx_trace ( u8 s,
va_list *  args 
)

Definition at line 124 of file mpls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mpls_dest_cmp ( void *  a1,
void *  a2 
)

Definition at line 395 of file mpls.c.

+ Here is the caller graph for this function:

mpls_encap_t* mpls_encap_by_fib_and_dest ( mpls_main_t mm,
u32  rx_fib,
u32  dst_address 
)

Definition at line 180 of file mpls.c.

+ Here is the caller graph for this function:

clib_error_t* mpls_feature_init ( vlib_main_t vm)

Definition at line 134 of file mpls_features.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int mpls_fib_index_cmp ( void *  a1,
void *  a2 
)

Definition at line 404 of file mpls.c.

+ Here is the caller graph for this function:

int mpls_fib_reset_labels ( u32  fib_id)

Definition at line 656 of file mpls.c.

int mpls_label_cmp ( void *  a1,
void *  a2 
)

Definition at line 413 of file mpls.c.

void mpls_sw_interface_enable_disable ( mpls_main_t mm,
u32  sw_if_index,
u8  is_enable 
)

Definition at line 275 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8 mpls_sw_interface_is_enabled ( u32  sw_if_index)

Definition at line 264 of file interface.c.

int vnet_mpls_add_del_encap ( ip4_address_t dest,
u32  fib_id,
u32 labels_host_byte_order,
u32  policy_tunnel_index,
int  no_dst_hash,
u32 indexp,
int  is_add 
)

Definition at line 196 of file mpls.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_mpls_ethernet_add_del_tunnel ( u8 dst,
ip4_address_t intfc,
u32  mask_width,
u32  inner_fib_id,
u32  tx_sw_if_index,
u32 tunnel_sw_if_index,
u8  l2_only,
u8  is_add 
)

Definition at line 441 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vnet_mpls_policy_tunnel_add_rewrite ( mpls_main_t mm,
mpls_encap_t e,
u32  policy_tunnel_index 
)

Definition at line 754 of file interface.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

format_function_t format_mpls_encap_index

Definition at line 161 of file mpls.h.

format_function_t format_mpls_eos_bit

Definition at line 163 of file mpls.h.

format_function_t format_mpls_eth_header_with_length

Definition at line 160 of file mpls.h.

format_function_t format_mpls_header

Definition at line 166 of file mpls.h.

format_function_t format_mpls_protocol

Definition at line 159 of file mpls.h.

format_function_t format_mpls_unicast_header_net_byte_order

Definition at line 164 of file mpls.h.

format_function_t format_mpls_unicast_label

Definition at line 165 of file mpls.h.

vlib_node_registration_t mpls_input_node
Initial value:
= {
.function = mpls_input,
.name = "mpls-input",
.vector_size = sizeof (u32),
.runtime_data_bytes = sizeof(mpls_input_runtime_t),
.n_errors = MPLS_N_ERROR,
.error_strings = mpls_error_strings,
.n_next_nodes = MPLS_INPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_mpls_input_trace,
}
static uword mpls_input(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: node.c:155
#define foreach_mpls_input_next
Definition: mpls.h:213
format_function_t format_mpls_unicast_header_net_byte_order
Definition: mpls.h:164
static u8 * format_mpls_input_trace(u8 *s, va_list *args)
Definition: node.c:29
unsigned int u32
Definition: types.h:88
static char * mpls_error_strings[]
Definition: mpls_lookup.c:154

(constructor) VLIB_REGISTER_NODE (mpls_input_node)

Definition at line 168 of file node.c.

mpls_main_t mpls_main

Definition at line 25 of file mpls.c.

vlib_node_registration_t mpls_midchain_node

(constructor) VLIB_REGISTER_NODE (mpls_midchain_node)

Definition at line 206 of file mpls_output.c.

vlib_node_registration_t mpls_output_node

(constructor) VLIB_REGISTER_NODE (mpls_output_node)

Definition at line 178 of file mpls_output.c.

vlib_node_registration_t mpls_policy_encap_node
Initial value:
= {
.function = mpls_policy_encap,
.name = "mpls-policy-encap",
.vector_size = sizeof (u32),
.runtime_data_bytes = 0,
.n_next_nodes = MPLS_POLICY_ENCAP_N_NEXT,
.next_nodes = {
#define _(s,n)
},
}
u8 * format_mpls_policy_encap_trace(u8 *s, va_list *args)
Definition: policy_encap.c:28
#define foreach_mpls_policy_encap_next
Definition: policy_encap.c:42
static uword mpls_policy_encap(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: policy_encap.c:70
unsigned int u32
Definition: types.h:88
static char * mpls_policy_encap_error_strings[]
Definition: policy_encap.c:62

(constructor) VLIB_REGISTER_NODE (mpls_policy_encap_node)

Definition at line 136 of file policy_encap.c.

unformat_function_t unformat_mpls_header

Definition at line 181 of file mpls.h.

unformat_function_t unformat_mpls_label_net_byte_order

Definition at line 177 of file mpls.h.

unformat_function_t unformat_mpls_protocol_host_byte_order

Definition at line 175 of file mpls.h.

unformat_function_t unformat_mpls_protocol_net_byte_order

Definition at line 176 of file mpls.h.

unformat_function_t unformat_mpls_unicast_label

Definition at line 178 of file mpls.h.

unformat_function_t unformat_pg_mpls_header

Definition at line 182 of file mpls.h.