|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
43 .stat_segment_name =
"/net/udp-encap",
58 const ip46_address_t *
src_ip,
59 const ip46_address_t *
dst_ip,
83 ue->
ue_hdrs.
ip4.ue_ip4.ip_version_and_header_length = 0x45;
85 ue->
ue_hdrs.
ip4.ue_ip4.protocol = IP_PROTOCOL_UDP;
96 ue->
ue_hdrs.
ip6.ue_ip6.ip_version_traffic_class_and_flow_label =
97 clib_host_to_net_u32 (6 << 28);
99 ue->
ue_hdrs.
ip6.ue_ip6.protocol = IP_PROTOCOL_UDP;
203 u32 indent = va_arg (*args,
u32);
204 u32 details = va_arg (*args,
u32);
214 s =
format (s,
"ip:[src:%U, dst:%U] udp:[src:%d, dst:%d]",
219 clib_net_to_host_u16 (ue->
ue_hdrs.
ip4.ue_udp.src_port),
220 clib_net_to_host_u16 (ue->
ue_hdrs.
ip4.ue_udp.dst_port));
224 s =
format (s,
"ip:[src:%U, dst:%U] udp:[src:%d dst:%d]",
229 clib_net_to_host_u16 (ue->
ue_hdrs.
ip6.ue_udp.src_port),
230 clib_net_to_host_u16 (ue->
ue_hdrs.
ip6.ue_udp.dst_port));
233 s =
format (s,
" to:[%Ld:%Ld]]",
to.packets,
to.bytes);
261 u32 indent = va_arg (*args,
u32);
270 u32 details = va_arg (*args,
u32);
438 if (
unformat (line_input,
"index %d", &uei))
440 else if (
unformat (line_input,
"add"))
442 else if (
unformat (line_input,
"del"))
444 else if (
unformat (line_input,
"%U %U",
448 else if (
unformat (line_input,
"%U %U",
458 else if (
unformat (line_input,
"src-port-is-entropy"))
557 .short_help =
"udp encap [add|del] <id ID> <src-ip> <dst-ip> [<src-port>] <dst-port> [src-port-is-entropy] [table-id <table>]",
562 .path =
"show udp encap",
563 .short_help =
"show udp encap [ID]",
vlib_combined_counter_main_t udp_encap_counters
Stats for each UDP encap object.
#define FIB_PROTOCOL_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements.
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
static void udp_encap_restack(udp_encap_t *ue)
index_t dpoi_index
the index of objects of that type
vl_api_ip_port_and_mask_t dst_port
static udp_encap_t * udp_encap_from_fib_node(fib_node_t *node)
const static char *const udp4_encap_ip6_nodes[]
void udp_encap_get_stats(index_t uei, u64 *packets, u64 *bytes)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
index_t ue_fib_index
The FIB index in which the encap destination resides.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
udp_encap_t * udp_encap_pool
Pool of encaps.
void udp_encap_contribute_forwarding(index_t uei, dpo_proto_t proto, dpo_id_t *dpo)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void fib_entry_untrack(fib_node_index_t fei, u32 sibling)
Stop tracking a FIB entry.
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
vlib_main_t vlib_node_runtime_t * node
A FIB graph nodes virtual function table.
#define clib_error_return(e, args...)
walk_rc_t(* udp_encap_walk_cb_t)(index_t uei, void *ctx)
Callback function invoked when walking all encap objects.
static void udp_encap_dpo_unlock(dpo_id_t *dpo)
u32 fn_locks
Number of dependents on this node.
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
char * name
The counter collection's name.
The UDP encap representation.
clib_error_t * udp_encap_init(vlib_main_t *vm)
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.
const static char *const udp6_encap_bier_nodes[]
fib_node_index_t fib_entry_track(u32 fib_index, const fib_prefix_t *prefix, fib_node_type_t child_type, index_t child_index, u32 *sibling)
Trackers are used on FIB entries by objects that which to track the changing state of the entry.
#define STRUCT_OFFSET_OF(t, f)
const static char *const udp4_encap_bier_nodes[]
const static char *const udp4_encap_mpls_nodes[]
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
clib_error_t * udp_encap_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
Combined counter to hold both packets and byte differences.
static u8 * format_udp_encap_i(u8 *s, va_list *args)
udp_encap_fixup_flags_t ue_flags
Flags controlling fixup behaviour.
const static char *const udp6_encap_mpls_nodes[]
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
u32 fib_node_index_t
A typedef of a node index.
@ UDP_ENCAP_FIXUP_UDP_SRC_PORT_ENTROPY
UDP source port contains an entropy/hash value for load-balancing by downstream peers.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
clib_error_t * udp_encap_cli(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
enum udp_encap_fixup_flags_t_ udp_encap_fixup_flags_t
UDP encapsulation.
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
vl_api_ip_port_and_mask_t src_port
void udp_encap_unlock(index_t uei)
static udp_encap_t * udp_encap_get(index_t uei)
#define VLIB_CLI_COMMAND(x,...)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
dpo_lock_fn_t dv_lock
A reference counting lock function.
struct udp_encap_t_::@559::@561 ip6
fib_protocol_t ue_ip_proto
the protocol of the IP header imposed
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
#define CLIB_CACHE_LINE_BYTES
@ FIB_NODE_BACK_WALK_CONTINUE
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
fib_node_index_t ue_fib_entry_index
Tracking information for the IP destination.
struct udp_encap_t_::@559::@560 ip4
u8 * format_udp_encap(u8 *s, va_list *args)
const static fib_node_vft_t udp_encap_fib_vft
const static char *const udp6_encap_ip6_nodes[]
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
void udp_encap_walk(udp_encap_walk_cb_t cb, void *ctx)
Walk each of the encap objects.
#define pool_foreach_index(i, v)
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)
static fib_node_t * udp_encap_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
@ FIB_NODE_TYPE_UDP_ENCAP
dpo_type_t udp_encap_dpo_types[FIB_PROTOCOL_MAX]
Registered DPO types for the IP header encapsulated, v4 or v6.
description fragment has unexpected format
A collection of combined counters.
const static char *const udp6_encap_ip4_nodes[]
#define VLIB_INIT_FUNCTION(x)
const static char *const udp4_encap_ip4_nodes[]
static vlib_cli_command_t udp_encap_show_command
(constructor) VLIB_CLI_COMMAND (udp_encap_show_command)
dpo_id_t ue_dpo
The DPO used to forward to the next node in the VLIB graph.
void fib_node_lock(fib_node_t *node)
fib_protocol_t fp_proto
protocol type
fib_node_t ue_fib_node
linkage into the FIB graph
An node in the FIB graph.
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
A virtual function table regisitered for a DPO type.
void fib_node_unlock(fib_node_t *node)
static u16 ip4_header_checksum(ip4_header_t *i)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Context passed between object during a back walk.
static vlib_cli_command_t udp_encap_add_command
(constructor) VLIB_CLI_COMMAND (udp_encap_add_command)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
const static char *const *const udp6_encap_nodes[DPO_PROTO_NUM]
union udp_encap_t_::@559 ue_hdrs
The headers to paint, in packet painting order.
static u8 * format_udp_encap_dpo(u8 *s, va_list *args)
const static dpo_vft_t udp_encap_dpo_vft
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
void udp_encap_lock(index_t uei)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
Aggregate type for a prefix.
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.
static void udp_encap_dpo_lock(dpo_id_t *dpo)
const static char *const *const udp4_encap_nodes[DPO_PROTO_NUM]
vl_api_wireguard_peer_flags_t flags