FD.io VPP  v19.01.3-6-g70449b9b9
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 270 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 261 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 203 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 55 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 418 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 134 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 183 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 193 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 290 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 314 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 301 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 279 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 250 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 403 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 152 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 46 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 525 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 165 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 511 of file udp_encap.c.

Variable Documentation

◆ udp4_encap_bier_nodes

const char* const udp4_encap_bier_nodes[]
static
Initial value:
= {
"udp4-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 347 of file udp_encap.c.

◆ udp4_encap_ip4_nodes

const char* const udp4_encap_ip4_nodes[]
static
Initial value:
= {
"udp4-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 332 of file udp_encap.c.

◆ udp4_encap_ip6_nodes

const char* const udp4_encap_ip6_nodes[]
static
Initial value:
= {
"udp4-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 337 of file udp_encap.c.

◆ udp4_encap_mpls_nodes

const char* const udp4_encap_mpls_nodes[]
static
Initial value:
= {
"udp4-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 342 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:347
static const char *const udp4_encap_ip4_nodes[]
Definition: udp_encap.c:332
static const char *const udp4_encap_mpls_nodes[]
Definition: udp_encap.c:342
static const char *const udp4_encap_ip6_nodes[]
Definition: udp_encap.c:337

Definition at line 372 of file udp_encap.c.

◆ udp6_encap_bier_nodes

const char* const udp6_encap_bier_nodes[]
static
Initial value:
= {
"udp6-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 367 of file udp_encap.c.

◆ udp6_encap_ip4_nodes

const char* const udp6_encap_ip4_nodes[]
static
Initial value:
= {
"udp6-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 352 of file udp_encap.c.

◆ udp6_encap_ip6_nodes

const char* const udp6_encap_ip6_nodes[]
static
Initial value:
= {
"udp6-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 357 of file udp_encap.c.

◆ udp6_encap_mpls_nodes

const char* const udp6_encap_mpls_nodes[]
static
Initial value:
= {
"udp6-encap",
}
#define NULL
Definition: clib.h:58

Definition at line 362 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:362
static const char *const udp6_encap_ip6_nodes[]
Definition: udp_encap.c:357
static const char *const udp6_encap_bier_nodes[]
Definition: udp_encap.c:367
static const char *const udp6_encap_ip4_nodes[]
Definition: udp_encap.c:352

Definition at line 379 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:418

(constructor) VLIB_CLI_COMMAND (udp_encap_add_command)

Definition at line 560 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 34 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 24 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:183
static void udp_encap_dpo_unlock(dpo_id_t *dpo)
Definition: udp_encap.c:193
static u8 * format_udp_encap_dpo(u8 *s, va_list *args)
Definition: udp_encap.c:261

Definition at line 396 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:290
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:301
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:314

Definition at line 390 of file udp_encap.c.

◆ udp_encap_pool

udp_encap_t* udp_encap_pool

Pool of encaps.

Definition at line 29 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:525

(constructor) VLIB_CLI_COMMAND (udp_encap_show_command)

Definition at line 566 of file udp_encap.c.