|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
19 #include <vpp/app/version.h>
112 pi0 = to_next[0] =
from[0];
134 if (kv.
value != ~(0L))
139 next0 =
r->next_node_index;
160 n_left_to_next, pi0, next0);
165 return frame->n_vectors;
169 #define foreach_stn_ip_punt_error \
173 #define _(sym,str) STN_IP_punt_ERROR_##sym,
180 #define _(sym,string) string,
202 .name =
"stn-ip6-punt",
203 .vector_size =
sizeof (
u32),
214 .arc_name =
"ip6-punt",
215 .node_name =
"stn-ip6-punt",
237 .name =
"stn-ip4-punt",
238 .vector_size =
sizeof (
u32),
249 .arc_name =
"ip4-punt",
250 .node_name =
"stn-ip4-punt",
280 .version = VPP_BUILD_VER,
281 .description =
"VPP Steals the NIC (STN) for Container Integration",
320 .protocol = IP_PROTOCOL_UDP,
323 .type = PUNT_TYPE_L4,
338 u32 output_node_index =
368 return VNET_API_ERROR_NO_SUCH_ENTRY;
393 .path =
"show stn rules",
421 else if (
unformat (line_input,
"del"))
457 .short_help =
"address <addr> interface <iface> [del]",
static ethernet_header_t stn_ip6_ethernet_header
#define foreach_stn_ip_punt_error
static_always_inline u8 * format_stn_ip46_punt_trace(u8 *s, va_list *args, u8 is_ipv4)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static vlib_cli_command_t show_stn_rules_command
(constructor) VLIB_CLI_COMMAND (show_stn_rules_command)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
static vlib_node_registration_t stn_ip4_punt
INDENT-OFF
A registration, by a client, to direct punted traffic to a given node.
nat44_ei_hairpin_src_next_t next_index
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
void ip4_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
static void ip46_address_set_ip4(ip46_address_t *ip46, const ip4_address_t *ip)
static vlib_cli_command_t stn_rule_command
(constructor) VLIB_CLI_COMMAND (stn_rule_command)
vlib_main_t vlib_node_runtime_t * node
static u8 ip46_address_is_ip4(const ip46_address_t *ip46)
#define clib_error_return(e, args...)
static ethernet_header_t stn_ip4_ethernet_header
#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.
int stn_rule_add_del(stn_rule_add_del_args_t *args)
Add or delete an stn rule.
vnet_hw_if_output_node_runtime_t * r
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static u8 stn_hw_addr_local[6]
u8 del
Whether to delete the rule.
ip46_address_t address
Destination address of intercepted packets.
u32 sw_if_index
TX interface to send packets to.
#define pool_foreach(VAR, POOL)
Iterate through pool.
static uword stn_ip4_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
clib_error_t * stn_api_init(vlib_main_t *vm, stn_main_t *sm)
vnet_main_t * vnet_get_main(void)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static char * stn_ip_punt_error_strings[]
#define static_always_inline
u8 * format_stn_ip4_punt_trace(u8 *s, va_list *args)
INDENT-ON
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define VLIB_CLI_COMMAND(x,...)
static uword stn_ip6_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
struct _vlib_node_registration vlib_node_registration_t
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static_always_inline uword stn_ip46_punt_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 is_ipv4)
static vlib_node_t * vlib_get_next_node(vlib_main_t *vm, u32 node_index, u32 next_index)
Get vlib node by graph arc (next) index.
#define vec_free(V)
Free vector's memory (no header).
u32 vnet_tx_node_index_for_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
Definitions for punt infrastructure.
static clib_error_t * show_stn_rules_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * vnet_punt_add_del(vlib_main_t *vm, const punt_reg_t *pr, bool is_add)
static clib_error_t * stn_rule_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
format_function_t format_vnet_sw_if_index_name
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
format_function_t format_ip46_address
#define VLIB_INIT_FUNCTION(x)
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
u8 * format_stn_ip6_punt_trace(u8 *s, va_list *args)
clib_bihash_16_8_t rule_by_address_table
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static vlib_main_t * vlib_get_main(void)
#define VNET_FEATURES(...)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static vlib_node_registration_t stn_ip6_punt
INDENT-OFF
clib_error_t * stn_init(vlib_main_t *vm)
INDENT-ON
static u8 stn_hw_addr_dst[6]
static u8 * format_stn_rule(u8 *s, va_list *args)
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
VNET_FEATURE_INIT(stn_ip6_punt_feat_node, static)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)