|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
103 l3xc->l3xc_proto = fproto;
128 l3xc->l3xc_sw_if_index,
129 1, &l3xci, sizeof (l3xci));
171 return (VNET_API_ERROR_INVALID_VALUE);
183 l3xc->l3xc_sw_if_index,
184 0, &l3xci, sizeof (l3xci));
219 else if (
unformat (line_input,
"ip6"))
221 else if (
unformat (line_input,
"ip4"))
223 else if (
unformat (line_input,
"del"))
225 else if (
unformat (line_input,
"add"))
227 else if (
unformat (line_input,
"via %U",
273 .short_help =
"l3xc [add|del] <INTERFACE> via ...",
284 s =
format (s,
"l3xc:[%d]: %U",
286 vnm,
l3xc->l3xc_sw_if_index);
290 s =
format (s,
"no forwarding");
336 .short_help =
"show l3xc",
345 return (&(
l3xc->l3xc_node));
int l3xc_delete(u32 sw_if_index, u8 is_ip6)
Delete an L3XC.
static const fib_node_vft_t l3xc_vft
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
static void l3xc_last_lock_gone(fib_node_t *node)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
#define pool_get_aligned_zero(P, E, A)
Allocate an object E from a pool P with alignment A and zero it.
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
static fib_node_back_walk_rc_t l3xc_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
u8 * fib_path_list_format(fib_node_index_t path_list_index, u8 *s)
vlib_main_t vlib_node_runtime_t * node
A FIB graph nodes virtual function table.
#define clib_error_return(e, args...)
#define FIB_NODE_INDEX_INVALID
#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.
static vlib_cli_command_t l3xc_show_cmd_node
(constructor) VLIB_CLI_COMMAND (l3xc_show_cmd_node)
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
int(* l3xc_walk_cb_t)(index_t l3xci, void *ctx)
Callback function invoked during a walk of all policies.
static vlib_cli_command_t l3xc_cmd_node
Create an L3XC policy.
@ FIB_FORW_CHAIN_TYPE_UNICAST_IP4
Contribute an object that is to be used to forward IP4 packets.
#define STRUCT_OFFSET_OF(t, f)
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
fib_node_type_t l3xc_fib_node_type
FIB node type the attachment is registered.
vlib_node_registration_t l3xc_ip6_node
(constructor) VLIB_REGISTER_NODE (l3xc_ip6_node)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void l3xc_walk(l3xc_walk_cb_t cb, void *ctx)
Walk/visit each of the L3XC policies.
#define FIB_PROTOCOL_IP_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements.
vnet_main_t * vnet_get_main(void)
l3xc_t * l3xc_pool
Pool of L3XC objects.
@ FIB_PATH_LIST_FLAG_SHARED
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.
static void l3xc_db_remove(u32 sw_if_index, fib_protocol_t fproto)
static_always_inline l3xc_t * l3xc_get(u32 index)
#define VLIB_CLI_COMMAND(x,...)
void dpo_stack_from_node(u32 child_node_index, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child parent relationship.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
u32 fib_path_list_child_add(fib_node_index_t path_list_index, fib_node_type_t child_type, fib_node_index_t child_index)
void fib_path_list_contribute_forwarding(fib_node_index_t path_list_index, fib_forward_chain_type_t fct, fib_path_list_fwd_flags_t flags, dpo_id_t *dpo)
#define CLIB_CACHE_LINE_BYTES
@ FIB_NODE_BACK_WALK_CONTINUE
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
static l3xc_t * l3xc_get_from_node(fib_node_t *node)
typedef l3xc
A description of an L3XC policy.
#define pool_foreach_index(i, v)
format_function_t format_vnet_sw_if_index_name
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
int l3xc_update(u32 sw_if_index, u8 is_ip6, const fib_route_path_t *rpaths)
Create or update an L3XC Policy.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
#define VLIB_INIT_FUNCTION(x)
static fib_node_t * l3xc_get_node(fib_node_index_t index)
A representation of a path as described by a route producer.
static u8 * format_l3xc(u8 *s, va_list *args)
vlib_node_registration_t l3xc_ip4_node
(constructor) VLIB_REGISTER_NODE (l3xc_ip4_node)
void fib_path_list_child_remove(fib_node_index_t path_list_index, u32 si)
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)
An node in the FIB graph.
static void l3xc_stack(l3xc_t *l3xc)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
static clib_error_t * l3xc_cmd(vlib_main_t *vm, unformat_input_t *main_input, vlib_cli_command_t *cmd)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static void l3xc_db_add(u32 sw_if_index, fib_protocol_t fproto, index_t l3xci)
@ FIB_PATH_LIST_FWD_FLAG_NONE
@ FIB_PATH_LIST_FLAG_NO_URPF
Context passed between object during a back walk.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
@ FIB_FORW_CHAIN_TYPE_UNICAST_IP6
Contribute an object that is to be used to forward IP6 packets.
index_t l3xc_find(u32 sw_if_index, fib_protocol_t fproto)
Find a L3 XC object from an interface and FIB protocol.
static clib_error_t * l3xc_init(vlib_main_t *vm)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
static u32 * l3xc_db[FIB_PROTOCOL_IP_MAX]
DB of L3XC objects.
vl_api_interface_index_t sw_if_index
fib_node_index_t fib_path_list_create(fib_path_list_flags_t flags, const fib_route_path_t *rpaths)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
fib_node_type_t fib_node_register_new_type(const fib_node_vft_t *vft)
Create a new FIB node type and Register the function table for it.
uword unformat_fib_route_path(unformat_input_t *input, va_list *args)
Unformat a fib_route_path_t from CLI input.
static clib_error_t * l3xc_show_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)