21 #include <tracedump/graph.api_enum.h> 22 #include <tracedump/graph.api_types.h> 24 #define REPLY_MSG_ID_BASE gmp->msg_id_base 33 #define MIN(x,y) (((x) < (y)) ? (x) : (y)) 67 rmp->_vl_msg_id = htons (VL_API_GRAPH_NODE_GET_REPLY + gmp->
msg_id_base);
69 rmp->
retval = clib_host_to_net_u32 (retval);
70 rmp->
cursor = htonl (cursor);
85 msg_size =
sizeof (*mp);
95 mp->_vl_msg_id = htons (VL_API_GRAPH_NODE_DETAILS + gmp->
msg_id_base);
158 cursor = ntohl (mp->
cursor);
164 node_index = ntohl (mp->
index);
165 if (cursor == ~0 && node_index != ~0)
172 VNET_API_ERROR_NO_SUCH_ENTRY, ~0);
183 if (cursor == ~0 && mp->
name[0] != 0)
189 VNET_API_ERROR_NO_SUCH_ENTRY, ~0);
214 u32 first_index = (cursor == ~0) ? 0 : cursor;
218 u32 queue_slots_available = q->maxsize - q->cursize;
219 int chunk = (queue_slots_available > 0) ? queue_slots_available - 1 : 0;
222 for (i = first_index; i <
vec_len (nodes); ++
i)
234 if (flags == 0 || (n->
flags & flags))
245 #include <tracedump/graph.api.c>
vl_api_wireguard_peer_flags_t flags
Details for each graph node.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static clib_error_t * graph_api_hookup(vlib_main_t *vm)
void * vl_msg_api_alloc(int nbytes)
static int node_cmp(void *a1, void *a2)
static void send_graph_node_details(vlib_node_main_t *nm, vl_api_registration_t *reg, u32 context, vlib_node_t *n, bool want_arcs)
#define VLIB_INIT_FUNCTION(x)
static clib_error_t * graph_node_cache_reaper(u32 client_index)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
svm_queue_t * vl_input_queue
shared memory only: pointer to client input queue
#define vec_dup(V)
Return copy of vector (no header, no alignment)
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
#define clib_strncpy(d, s, n)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
static void send_graph_node_reply(vl_api_registration_t *rp, u32 context, u32 retval, u32 cursor)
void graph_node_invalid_cache(void)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_graph_node_get_t_handler(vl_api_graph_node_get_t *mp)
#define vec_cmp(v1, v2)
Compare two vectors (only applicable to vectors of signed numbers).
static vlib_main_t * vlib_get_main(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_node_main_t node_main
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
struct _svm_queue svm_queue_t
static api_main_t * vlibapi_get_main(void)
u8 * is_mp_safe
Message is mp safe vector.
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
graph_node_get - Get nodes of the packet processing graph In order: if index != ~0, dump node with given index if index == ~0 and name[0] != 0, dump named node if index == ~0 and name[0] == 0 and flag != 0, dump flagged nodes otherwise when no selection criteria given, dump all nodes.
VL_MSG_API_REAPER_FUNCTION(graph_node_cache_reaper)
vlib_node_t ** sorted_node_vec