FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
udp_encap.c File Reference
+ Include dependency graph for udp_encap.c:

Go to the source code of this file.

Functions

static void udp_encap_restack (udp_encap_t *ue)
 
index_t udp_encap_add_and_lock (fib_protocol_t proto, index_t fib_index, const ip46_address_t *src_ip, const ip46_address_t *dst_ip, u16 src_port, u16 dst_port, udp_encap_fixup_flags_t flags)
 
void udp_encap_contribute_forwarding (index_t uei, dpo_proto_t proto, dpo_id_t *dpo)
 
void udp_encap_lock (index_t uei)
 
void udp_encap_unlock (index_t uei)
 
static void udp_encap_dpo_lock (dpo_id_t *dpo)
 
static void udp_encap_dpo_unlock (dpo_id_t *dpo)
 
static u8format_udp_encap_i (u8 *s, va_list *args)
 
void udp_encap_get_stats (index_t uei, u64 *packets, u64 *bytes)
 
static u8format_udp_encap_dpo (u8 *s, va_list *args)
 
u8format_udp_encap (u8 *s, va_list *args)
 
static udp_encap_tudp_encap_from_fib_node (fib_node_t *node)
 
static fib_node_back_walk_rc_t udp_encap_fib_back_walk (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 Function definition to backwalk a FIB node. More...
 
static fib_node_tudp_encap_fib_node_get (fib_node_index_t index)
 Function definition to get a FIB node from its index. More...
 
static void udp_encap_fib_last_lock_gone (fib_node_t *node)
 Function definition to inform the FIB node that its last lock has gone. More...
 
clib_error_tudp_encap_init (vlib_main_t *vm)
 
clib_error_tudp_encap_cli (vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
 
void udp_encap_walk (udp_encap_walk_cb_t cb, void *ctx)
 Walk each of the encap objects. More...
 
clib_error_tudp_encap_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

dpo_type_t udp_encap_dpo_types [FIB_PROTOCOL_MAX]
 Registered DPO types for the IP header encapsulated, v4 or v6. More...
 
udp_encap_tudp_encap_pool
 Pool of encaps. More...
 
vlib_combined_counter_main_t udp_encap_counters
 Stats for each UDP encap object. More...
 
static const char *const udp4_encap_ip4_nodes []
 
static const char *const udp4_encap_ip6_nodes []
 
static const char *const udp4_encap_mpls_nodes []
 
static const char *const udp4_encap_bier_nodes []
 
static const char *const udp6_encap_ip4_nodes []
 
static const char *const udp6_encap_ip6_nodes []
 
static const char *const udp6_encap_mpls_nodes []
 
static const char *const udp6_encap_bier_nodes []
 
static const char *const *const udp4_encap_nodes [DPO_PROTO_NUM]
 
static const char *const *const udp6_encap_nodes [DPO_PROTO_NUM]
 
static const fib_node_vft_t udp_encap_fib_vft
 
static const dpo_vft_t udp_encap_dpo_vft
 
static vlib_cli_command_t udp_encap_add_command
 (constructor) VLIB_CLI_COMMAND (udp_encap_add_command) More...
 
static vlib_cli_command_t udp_encap_show_command
 (constructor) VLIB_CLI_COMMAND (udp_encap_show_command) More...
 

Function Documentation

◆ format_udp_encap()

u8* format_udp_encap ( u8 s,
va_list *  args 
)

Definition at line 267 of file udp_encap.c.

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

◆ format_udp_encap_dpo()

static u8* format_udp_encap_dpo ( u8 s,
va_list *  args 
)
static

Definition at line 258 of file udp_encap.c.

+ Here is the call graph for this function:

◆ format_udp_encap_i()

static u8* format_udp_encap_i ( u8 s,
va_list *  args 
)
static

Definition at line 200 of file udp_encap.c.

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

◆ udp_encap_add_and_lock()

index_t udp_encap_add_and_lock ( fib_protocol_t  proto,
index_t  fib_index,
const ip46_address_t *  src_ip,
const ip46_address_t *  dst_ip,
u16  src_port,
u16  dst_port,
udp_encap_fixup_flags_t  flags 
)

Definition at line 56 of file udp_encap.c.

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

◆ udp_encap_cli()

clib_error_t* udp_encap_cli ( vlib_main_t vm,
unformat_input_t main_input,
vlib_cli_command_t cmd 
)

Definition at line 413 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_contribute_forwarding()

void udp_encap_contribute_forwarding ( index_t  uei,
dpo_proto_t  proto,
dpo_id_t dpo 
)

Definition at line 131 of file udp_encap.c.

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

◆ udp_encap_dpo_lock()

static void udp_encap_dpo_lock ( dpo_id_t dpo)
static

Definition at line 180 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_dpo_unlock()

static void udp_encap_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 190 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_fib_back_walk()

static fib_node_back_walk_rc_t udp_encap_fib_back_walk ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Function definition to backwalk a FIB node.

Definition at line 287 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_fib_last_lock_gone()

static void udp_encap_fib_last_lock_gone ( fib_node_t node)
static

Function definition to inform the FIB node that its last lock has gone.

reset the stacked DPO to unlock it

Definition at line 311 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_fib_node_get()

static fib_node_t* udp_encap_fib_node_get ( fib_node_index_t  index)
static

Function definition to get a FIB node from its index.

Definition at line 298 of file udp_encap.c.

◆ udp_encap_from_fib_node()

static udp_encap_t* udp_encap_from_fib_node ( fib_node_t node)
static

Definition at line 276 of file udp_encap.c.

+ Here is the caller graph for this function:

◆ udp_encap_get_stats()

void udp_encap_get_stats ( index_t  uei,
u64 packets,
u64 bytes 
)

Definition at line 247 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_init()

clib_error_t* udp_encap_init ( vlib_main_t vm)

Definition at line 398 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_lock()

void udp_encap_lock ( index_t  uei)

Definition at line 149 of file udp_encap.c.

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

◆ udp_encap_restack()

static void udp_encap_restack ( udp_encap_t ue)
static

Definition at line 47 of file udp_encap.c.

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

◆ udp_encap_show()

clib_error_t* udp_encap_show ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)

Definition at line 520 of file udp_encap.c.

+ Here is the call graph for this function:

◆ udp_encap_unlock()

void udp_encap_unlock ( index_t  uei)

Definition at line 162 of file udp_encap.c.

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

◆ udp_encap_walk()

void udp_encap_walk ( udp_encap_walk_cb_t  cb,
void *  ctx 
)

Walk each of the encap objects.

Definition at line 506 of file udp_encap.c.

Variable Documentation

◆ udp4_encap_bier_nodes

const char* const udp4_encap_bier_nodes[]
static
Initial value:
= {
"udp4-encap",
NULL,
}

Definition at line 342 of file udp_encap.c.

◆ udp4_encap_ip4_nodes

const char* const udp4_encap_ip4_nodes[]
static
Initial value:
= {
"udp4-encap",
NULL,
}

Definition at line 327 of file udp_encap.c.

◆ udp4_encap_ip6_nodes

const char* const udp4_encap_ip6_nodes[]
static
Initial value:
= {
"udp4-encap",
NULL,
}

Definition at line 332 of file udp_encap.c.

◆ udp4_encap_mpls_nodes

const char* const udp4_encap_mpls_nodes[]
static
Initial value:
= {
"udp4-encap",
NULL,
}

Definition at line 337 of file udp_encap.c.

◆ udp4_encap_nodes

const char* const* const udp4_encap_nodes[DPO_PROTO_NUM]
static
Initial value:
= {
}
static const char *const udp4_encap_bier_nodes[]
Definition: udp_encap.c:342
static const char *const udp4_encap_ip4_nodes[]
Definition: udp_encap.c:327
static const char *const udp4_encap_mpls_nodes[]
Definition: udp_encap.c:337
static const char *const udp4_encap_ip6_nodes[]
Definition: udp_encap.c:332

Definition at line 367 of file udp_encap.c.

◆ udp6_encap_bier_nodes

const char* const udp6_encap_bier_nodes[]
static
Initial value:
= {
"udp6-encap",
NULL,
}

Definition at line 362 of file udp_encap.c.

◆ udp6_encap_ip4_nodes

const char* const udp6_encap_ip4_nodes[]
static
Initial value:
= {
"udp6-encap",
NULL,
}

Definition at line 347 of file udp_encap.c.

◆ udp6_encap_ip6_nodes

const char* const udp6_encap_ip6_nodes[]
static
Initial value:
= {
"udp6-encap",
NULL,
}

Definition at line 352 of file udp_encap.c.

◆ udp6_encap_mpls_nodes

const char* const udp6_encap_mpls_nodes[]
static
Initial value:
= {
"udp6-encap",
NULL,
}

Definition at line 357 of file udp_encap.c.

◆ udp6_encap_nodes

const char* const* const udp6_encap_nodes[DPO_PROTO_NUM]
static
Initial value:
= {
}
static const char *const udp6_encap_mpls_nodes[]
Definition: udp_encap.c:357
static const char *const udp6_encap_ip6_nodes[]
Definition: udp_encap.c:352
static const char *const udp6_encap_bier_nodes[]
Definition: udp_encap.c:362
static const char *const udp6_encap_ip4_nodes[]
Definition: udp_encap.c:347

Definition at line 374 of file udp_encap.c.

◆ udp_encap_add_command

vlib_cli_command_t udp_encap_add_command
static
Initial value:
= {
.path = "udp encap",
.short_help = "udp encap [add|del] <id ID> <src-ip> <dst-ip> [<src-port>] <dst-port> [src-port-is-entropy] [table-id <table>]",
.function = udp_encap_cli,
.is_mp_safe = 1,
}
clib_error_t * udp_encap_cli(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
Definition: udp_encap.c:413

(constructor) VLIB_CLI_COMMAND (udp_encap_add_command)

Definition at line 555 of file udp_encap.c.

◆ udp_encap_counters

vlib_combined_counter_main_t udp_encap_counters
Initial value:
= {
.name = "udp-encap",
.stat_segment_name = "/net/udp-encap",
}

Stats for each UDP encap object.

Definition at line 35 of file udp_encap.c.

◆ udp_encap_dpo_types

dpo_type_t udp_encap_dpo_types[FIB_PROTOCOL_MAX]

Registered DPO types for the IP header encapsulated, v4 or v6.

Definition at line 25 of file udp_encap.c.

◆ udp_encap_dpo_vft

const dpo_vft_t udp_encap_dpo_vft
static
Initial value:
= {
.dv_lock = udp_encap_dpo_lock,
.dv_unlock = udp_encap_dpo_unlock,
.dv_format = format_udp_encap_dpo,
}
static void udp_encap_dpo_lock(dpo_id_t *dpo)
Definition: udp_encap.c:180
static void udp_encap_dpo_unlock(dpo_id_t *dpo)
Definition: udp_encap.c:190
static u8 * format_udp_encap_dpo(u8 *s, va_list *args)
Definition: udp_encap.c:258

Definition at line 391 of file udp_encap.c.

◆ udp_encap_fib_vft

const fib_node_vft_t udp_encap_fib_vft
static
Initial value:
= {
.fnv_last_lock = udp_encap_fib_last_lock_gone,
.fnv_back_walk = udp_encap_fib_back_walk,
}
static fib_node_back_walk_rc_t udp_encap_fib_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Function definition to backwalk a FIB node.
Definition: udp_encap.c:287
static fib_node_t * udp_encap_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
Definition: udp_encap.c:298
static void udp_encap_fib_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.
Definition: udp_encap.c:311

Definition at line 385 of file udp_encap.c.

◆ udp_encap_pool

udp_encap_t* udp_encap_pool

Pool of encaps.

Definition at line 30 of file udp_encap.c.

◆ udp_encap_show_command

vlib_cli_command_t udp_encap_show_command
static
Initial value:
= {
.path = "show udp encap",
.short_help = "show udp encap [ID]",
.function = udp_encap_show,
.is_mp_safe = 1,
}
clib_error_t * udp_encap_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: udp_encap.c:520

(constructor) VLIB_CLI_COMMAND (udp_encap_show_command)

Definition at line 561 of file udp_encap.c.