151 u32 indent = va_arg (*args,
u32);
256 if (0 != res)
return (res);
271 *((
u64*)dst) = *(
u64*)src;
289 u32 *node_indices = NULL;
290 const char *node_name;
294 while (NULL != node_name)
306 return (node_indices);
324 const char *
const *
const * nodes)
327 dpo_vfts[
type] = *vft;
328 if (NULL == dpo_vfts[type].dv_get_next_node)
332 if (NULL == dpo_vfts[type].dv_mk_interpose)
343 const char *
const *
const * nodes)
408 dpo_edges[child_type][child_proto][parent_type],
414 if (~0 ==
dpo_edges[child_type][child_proto][parent_type][parent_proto])
423 ASSERT(NULL != dpo_vfts[parent_type].dv_get_next_node);
436 while (NULL !=
dpo_nodes[child_type][child_proto][cc])
446 if (~0 ==
dpo_edges[child_type][child_proto][parent_type][parent_proto])
448 dpo_edges[child_type][child_proto][parent_type][parent_proto] = edge;
452 ASSERT(
dpo_edges[child_type][child_proto][parent_type][parent_proto] == edge);
462 return (
dpo_edges[child_type][child_proto][parent_type][parent_proto]);
477 return (
dpo_edges[child_type][child_proto][parent_type][parent_proto]);
544 ASSERT(NULL != dpo_vfts[parent_type].dv_get_next_node);
613 "Name",
"Size",
"in-use",
"allocated");
642 .path =
"show dpo memory",
644 .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 assigned 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)
void dpo_mk_interpose(const dpo_id_t *original, const dpo_id_t *parent, dpo_id_t *clone)
Make an interpose DPO from an original.
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.
vl_api_fib_path_type_t type
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)
static void dpo_default_mk_interpose(const dpo_id_t *original, const dpo_id_t *parent, dpo_id_t *clone)
A default variant of the make interpose function that just returns the original.
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
void dvr_dpo_module_init(void)
void dpo_lock(dpo_id_t *dpo)
Take a reference counting lock on the DPO.
void lookup_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.
void ip6_ll_dpo_module_init(void)
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 pw_cw_dpo_module_init(void)
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)
u32 dpo_get_next_node_by_type_and_proto(dpo_type_t child_type, dpo_proto_t child_proto, dpo_type_t parent_type, dpo_proto_t parent_proto)
return already stacked up next node index for a given child_type/child_proto and parent_type/patent_p...
dpo_mk_interpose_t dv_mk_interpose
Signal on an interposed child that the parent has changed.
vl_api_fib_path_nh_proto_t proto
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.