FD.io VPP  v18.07-34-g55fbdb9
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 udp_encap_tudp_encap_get_w_id (u32 id)
 
static void udp_encap_restack (udp_encap_t *ue)
 
index_t udp_encap_add_and_lock (u32 id, 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 (u32 id, dpo_proto_t proto, dpo_id_t *dpo)
 
index_t udp_encap_find (u32 id)
 
void udp_encap_lock (u32 id)
 
void udp_encap_unlock_w_index (index_t uei)
 
void udp_encap_unlock (u32 id)
 
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...
 
uwordudp_encap_db
 Hash DB to map from client ID to VPP index. 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

u8* format_udp_encap ( u8 s,
va_list *  args 
)

Definition at line 332 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 323 of file udp_encap.c.

+ Here is the call graph for this function:

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

Definition at line 264 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

index_t udp_encap_add_and_lock ( u32  id,
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 67 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 491 of file udp_encap.c.

+ Here is the call graph for this function:

void udp_encap_contribute_forwarding ( u32  id,
dpo_proto_t  proto,
dpo_id_t dpo 
)

Definition at line 166 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void udp_encap_dpo_lock ( dpo_id_t dpo)
static

Definition at line 244 of file udp_encap.c.

+ Here is the call graph for this function:

static void udp_encap_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 254 of file udp_encap.c.

+ Here is the call graph for this function:

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 360 of file udp_encap.c.

+ Here is the call graph for this function:

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 384 of file udp_encap.c.

+ Here is the call graph for this function:

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 371 of file udp_encap.c.

index_t udp_encap_find ( u32  id)

Definition at line 187 of file udp_encap.c.

+ Here is the caller graph for this function:

static udp_encap_t* udp_encap_from_fib_node ( fib_node_t node)
static

Definition at line 349 of file udp_encap.c.

+ Here is the caller graph for this function:

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

Definition at line 312 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static udp_encap_t* udp_encap_get_w_id ( u32  id)
static

Definition at line 42 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* udp_encap_init ( vlib_main_t vm)

Definition at line 474 of file udp_encap.c.

+ Here is the call graph for this function:

void udp_encap_lock ( u32  id)

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:

static void udp_encap_restack ( udp_encap_t ue)
static

Definition at line 58 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 609 of file udp_encap.c.

+ Here is the call graph for this function:

void udp_encap_unlock ( u32  id)

Definition at line 231 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void udp_encap_unlock_w_index ( index_t  uei)

Definition at line 213 of file udp_encap.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void udp_encap_walk ( udp_encap_walk_cb_t  cb,
void *  ctx 
)

Walk each of the encap objects.

Definition at line 595 of file udp_encap.c.

+ Here is the caller graph for this function:

Variable Documentation

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

Definition at line 418 of file udp_encap.c.

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

Definition at line 403 of file udp_encap.c.

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

Definition at line 408 of file udp_encap.c.

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

Definition at line 413 of file udp_encap.c.

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:418
static const char *const udp4_encap_ip4_nodes[]
Definition: udp_encap.c:403
static const char *const udp4_encap_mpls_nodes[]
Definition: udp_encap.c:413
static const char *const udp4_encap_ip6_nodes[]
Definition: udp_encap.c:408

Definition at line 443 of file udp_encap.c.

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

Definition at line 438 of file udp_encap.c.

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

Definition at line 423 of file udp_encap.c.

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

Definition at line 428 of file udp_encap.c.

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

Definition at line 433 of file udp_encap.c.

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:433
static const char *const udp6_encap_ip6_nodes[]
Definition: udp_encap.c:428
static const char *const udp6_encap_bier_nodes[]
Definition: udp_encap.c:438
static const char *const udp6_encap_ip4_nodes[]
Definition: udp_encap.c:423

Definition at line 450 of file udp_encap.c.

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:491

(constructor) VLIB_CLI_COMMAND (udp_encap_add_command)

Definition at line 646 of file udp_encap.c.

vlib_combined_counter_main_t udp_encap_counters

Stats for each UDP encap object.

Definition at line 39 of file udp_encap.c.

uword* udp_encap_db

Hash DB to map from client ID to VPP index.

Definition at line 29 of file udp_encap.c.

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.

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:244
static void udp_encap_dpo_unlock(dpo_id_t *dpo)
Definition: udp_encap.c:254
static u8 * format_udp_encap_dpo(u8 *s, va_list *args)
Definition: udp_encap.c:323

Definition at line 467 of file udp_encap.c.

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:360
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:371
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:384

Definition at line 461 of file udp_encap.c.

udp_encap_t* udp_encap_pool

Pool of encaps.

Definition at line 34 of file udp_encap.c.

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:609

(constructor) VLIB_CLI_COMMAND (udp_encap_show_command)

Definition at line 652 of file udp_encap.c.