149 u32 indent = va_arg (*args,
u32);
252 if (0 != res)
return (res);
267 *((
u64*)dst) = *(
u64*)src;
286 const char *node_name;
290 while (
NULL != node_name)
302 return (node_indices);
308 const char *
const *
const * nodes)
311 dpo_vfts[type] = *vft;
312 if (
NULL == dpo_vfts[type].dv_get_next_node)
323 const char *
const *
const * nodes)
377 dpo_edges[child_type][child_proto][parent_type],
383 if (~0 ==
dpo_edges[child_type][child_proto][parent_type][parent_proto])
392 ASSERT(
NULL != dpo_vfts[parent_type].dv_get_next_node);
415 if (~0 ==
dpo_edges[child_type][child_proto][parent_type][parent_proto])
417 dpo_edges[child_type][child_proto][parent_type][parent_proto] = edge;
421 ASSERT(
dpo_edges[child_type][child_proto][parent_type][parent_proto] == edge);
431 return (
dpo_edges[child_type][child_proto][parent_type][parent_proto]);
498 ASSERT(
NULL != dpo_vfts[parent_type].dv_get_next_node);
557 "Name",
"Size",
"in-use",
"allocated");
586 .path =
"show dpo memory",
588 .short_help =
"show dpo memory",
void dpo_unlock(dpo_id_t *dpo)
Release a reference counting lock on the DPO.
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
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.
dpo_lock_fn_t dv_lock
A reference counting lock function.
static const char * dpo_type_names[]
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
A virtual function table regisitered for a DPO type.
u8 * format_dpo_type(u8 *s, va_list *args)
format a DPO type
int dpo_is_adj(const dpo_id_t *dpo)
Return TRUE is the DPO is any type of adjacency.
static dpo_type_t dpo_dynamic
The DPO type value that can be assigend to the next dynamic type registration.
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
dpo_get_urpf_t dv_get_urpf
Get uRPF interface.
void l3_proxy_dpo_module_init(void)
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
dpo_proto_t dpoi_proto
the data-path protocol of the type.
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u32 dpo_get_urpf(const dpo_id_t *dpo)
Get a uRPF interface for the DPO.
static const char * dpo_proto_names[]
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
#define vlib_worker_thread_barrier_sync(X)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
void dpo_register(dpo_type_t type, const dpo_vft_t *vft, const char *const *const *nodes)
For a given DPO type Register:
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type() ...
#define VLIB_INIT_FUNCTION(x)
dpo_proto_t vnet_link_to_dpo_proto(vnet_link_t linkt)
static u32 dpo_get_next_node(dpo_type_t child_type, dpo_proto_t child_proto, const dpo_id_t *parent_dpo)
void load_balance_module_init(void)
void receive_dpo_module_init(void)
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
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 u32 * dpo_default_get_next_node(const dpo_id_t *dpo)
static u32 **** dpo_edges
Vector of edge indicies from parent DPO nodes to child.
dpo_get_next_node_t dv_get_next_node
A function to get the next VLIB node given an instance of the DPO.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
void ip_null_dpo_module_init(void)
void interface_rx_dpo_module_init(void)
dpo_type_t dpoi_type
the type
static const char *const *const ** dpo_nodes
vector of graph node names associated with each DPO type and protocol.
void classify_dpo_module_init(void)
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
void dpo_lock(dpo_id_t *dpo)
Take a reference counting lock on the DPO.
void lookup_dpo_module_init(void)
void l2_bridge_dpo_module_init(void)
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
#define vec_free(V)
Free vector's memory (no header).
Multicast Midchain Adjacency.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
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.
void mpls_disp_dpo_module_init(void)
#define VLIB_CLI_COMMAND(x,...)
This packets follow a mid-chain adjacency.
void mpls_label_dpo_module_init(void)
static clib_error_t * dpo_module_init(vlib_main_t *vm)
static dpo_vft_t * dpo_vfts
Vector of virtual function tables for the DPO types.
vnet_link_t dpo_proto_to_link(dpo_proto_t dp)
format a DPO protocol
void interface_tx_dpo_module_init(void)
void punt_dpo_module_init(void)
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
A non-zero value first so we can spot unitialisation errors.
int dpo_cmp(const dpo_id_t *dpo1, const dpo_id_t *dpo2)
Compare two Data-path objects.
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject
dpo_mem_show_t dv_mem_show
A show memory usage function.
static vlib_main_t * vlib_get_main(void)
uword vlib_node_get_next(vlib_main_t *vm, uword node_index, uword next_node_index)
static clib_error_t * dpo_memory_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
index_t dpoi_index
the index of objects of that type
format_function_t * dv_format
A format function.
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
dpo_lock_fn_t dv_unlock
A reference counting unlock function.
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
#define vec_foreach(var, vec)
Vector iterator.
u16 dpoi_next_node
The next VLIB node to follow.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
void drop_dpo_module_init(void)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static void dpo_stack_i(u32 edge, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child parent relationship.
void replicate_module_init(void)
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.