121 u32 indent = va_arg (*args,
u32);
215 if (0 != res)
return (res);
230 *((
u64*)dst) = *(
u64*)src;
248 const char *
const *
const * nodes)
251 dpo_vfts[
type] = *vft;
259 const char *
const *
const * nodes)
302 dpo_edges[child_type][child_proto][parent_type],
308 if (~0 ==
dpo_edges[child_type][child_proto][parent_type][parent_proto])
345 if (~0 ==
dpo_edges[child_type][child_proto][parent_type][parent_proto])
347 dpo_edges[child_type][child_proto][parent_type][parent_proto] = edge;
351 ASSERT(
dpo_edges[child_type][child_proto][parent_type][parent_proto] == edge);
359 return (
dpo_edges[child_type][child_proto][parent_type][parent_proto]);
467 "Name",
"Size",
"in-use",
"allocated");
496 .path =
"show dpo memory",
498 .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
static vlib_main_t * vlib_get_main(void)
int dpo_is_adj(const dpo_id_t *dpo)
Return TRUE is the DPO is any type of adjacency.
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
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.
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...
static const char * dpo_proto_names[]
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
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_edges
Vector of edge indicies from parent DPO nodes to child.
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)
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)
void dpo_lock(dpo_id_t *dpo)
Take a reference counting lock on the DPO.
void lookup_dpo_module_init(void)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
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.
#define VLIB_CLI_COMMAND(x,...)
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.
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.
This packets follow a mid-chain adjacency.
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.
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
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
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 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)
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 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.