FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
node.c File Reference
+ Include dependency graph for node.c:

Go to the source code of this file.

Data Structures

struct  flowprobe_trace_t
 

Macros

#define foreach_flowprobe_error
 
#define FLOWPROBE_NEXT_NODES
 
#define NTP_TIMESTAMP   2208988800LU
 

Enumerations

enum  flowprobe_error_t { FLOWPROBE_N_ERROR }
 
enum  flowprobe_next_t { FLOWPROBE_NEXT_DROP, FLOWPROBE_NEXT_IP4_LOOKUP, FLOWPROBE_N_NEXT }
 

Functions

static void flowprobe_export_entry (vlib_main_t *vm, flowprobe_entry_t *e)
 
static u8format_flowprobe_trace (u8 *s, va_list *args)
 
static flowprobe_variant_t flowprobe_get_variant (flowprobe_variant_t which, flowprobe_record_t flags, u16 ethertype)
 
static u32 flowprobe_common_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l2_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l3_ip6_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l3_ip4_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_l4_add (vlib_buffer_t *to_b, flowprobe_entry_t *e, u16 offset)
 
static u32 flowprobe_hash (flowprobe_key_t *k)
 
flowprobe_entry_tflowprobe_lookup (u32 my_cpu_number, flowprobe_key_t *k, u32 *poolindex, bool *collision)
 
flowprobe_entry_tflowprobe_create (u32 my_cpu_number, flowprobe_key_t *k, u32 *poolindex)
 
static void add_to_flow_record_state (vlib_main_t *vm, vlib_node_runtime_t *node, flowprobe_main_t *fm, vlib_buffer_t *b, timestamp_nsec_t timestamp, u16 length, flowprobe_variant_t which, flowprobe_trace_t *t)
 
static u16 flowprobe_get_headersize (void)
 
static void flowprobe_export_send (vlib_main_t *vm, vlib_buffer_t *b0, flowprobe_variant_t which)
 
static vlib_buffer_tflowprobe_get_buffer (vlib_main_t *vm, flowprobe_variant_t which)
 
uword flowprobe_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, flowprobe_variant_t which)
 
static uword flowprobe_ip4_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword flowprobe_ip6_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword flowprobe_l2_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static void flush_record (flowprobe_variant_t which)
 
void flowprobe_flush_callback_ip4 (void)
 
void flowprobe_flush_callback_ip6 (void)
 
void flowprobe_flush_callback_l2 (void)
 
static void flowprobe_delete_by_index (u32 my_cpu_number, u32 poolindex)
 
static uword flowprobe_walker_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 

Variables

static char * flowprobe_variant_strings []
 
vlib_node_registration_t flowprobe_ip4_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_ip4_node) More...
 
vlib_node_registration_t flowprobe_ip6_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_ip6_node) More...
 
vlib_node_registration_t flowprobe_l2_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_l2_node) More...
 
static char * flowprobe_error_strings []
 
vlib_node_registration_t flowprobe_walker_node
 (constructor) VLIB_REGISTER_NODE (flowprobe_walker_node) More...
 

Detailed Description

flow record generator graph node

Definition in file node.c.

Macro Definition Documentation

◆ FLOWPROBE_NEXT_NODES

#define FLOWPROBE_NEXT_NODES
Value:
{ \
[FLOWPROBE_NEXT_DROP] = "error-drop", \
[FLOWPROBE_NEXT_IP4_LOOKUP] = "ip4-lookup", \
}

Definition at line 133 of file node.c.

◆ foreach_flowprobe_error

#define foreach_flowprobe_error
Value:
_(COLLISION, "Hash table collisions") \
_(BUFFER, "Buffer allocation error") \
_(EXPORTED_PACKETS, "Exported packets") \
_(INPATH, "Exported packets in path")

Definition at line 106 of file node.c.

◆ NTP_TIMESTAMP

#define NTP_TIMESTAMP   2208988800LU

Definition at line 152 of file node.c.

Enumeration Type Documentation

◆ flowprobe_error_t

Enumerator
FLOWPROBE_N_ERROR 

Definition at line 112 of file node.c.

◆ flowprobe_next_t

Enumerator
FLOWPROBE_NEXT_DROP 
FLOWPROBE_NEXT_IP4_LOOKUP 
FLOWPROBE_N_NEXT 

Definition at line 126 of file node.c.

Function Documentation

◆ add_to_flow_record_state()

static void add_to_flow_record_state ( vlib_main_t vm,
vlib_node_runtime_t node,
flowprobe_main_t fm,
vlib_buffer_t b,
timestamp_nsec_t  timestamp,
u16  length,
flowprobe_variant_t  which,
flowprobe_trace_t t 
)
inlinestatic

Definition at line 360 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_common_add()

static u32 flowprobe_common_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 155 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_create()

flowprobe_entry_t* flowprobe_create ( u32  my_cpu_number,
flowprobe_key_t k,
u32 poolindex 
)

Definition at line 334 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_delete_by_index()

static void flowprobe_delete_by_index ( u32  my_cpu_number,
u32  poolindex 
)
static

Definition at line 901 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_export_entry()

static void flowprobe_export_entry ( vlib_main_t vm,
flowprobe_entry_t e 
)
static

Definition at line 668 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_export_send()

static void flowprobe_export_send ( vlib_main_t vm,
vlib_buffer_t b0,
flowprobe_variant_t  which 
)
static

Definition at line 518 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_flush_callback_ip4()

void flowprobe_flush_callback_ip4 ( void  )

Definition at line 880 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_flush_callback_ip6()

void flowprobe_flush_callback_ip6 ( void  )

Definition at line 886 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_flush_callback_l2()

void flowprobe_flush_callback_l2 ( void  )

Definition at line 892 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_get_buffer()

static vlib_buffer_t* flowprobe_get_buffer ( vlib_main_t vm,
flowprobe_variant_t  which 
)
static

Definition at line 629 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_get_headersize()

static u16 flowprobe_get_headersize ( void  )
static

Definition at line 511 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_get_variant()

static flowprobe_variant_t flowprobe_get_variant ( flowprobe_variant_t  which,
flowprobe_record_t  flags,
u16  ethertype 
)
inlinestatic

Definition at line 139 of file node.c.

+ Here is the caller graph for this function:

◆ flowprobe_hash()

static u32 flowprobe_hash ( flowprobe_key_t k)
inlinestatic

Definition at line 287 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_ip4_node_fn()

static uword flowprobe_ip4_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 850 of file node.c.

+ Here is the call graph for this function:

◆ flowprobe_ip6_node_fn()

static uword flowprobe_ip6_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 857 of file node.c.

+ Here is the call graph for this function:

◆ flowprobe_l2_add()

static u32 flowprobe_l2_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 194 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_l2_node_fn()

static uword flowprobe_l2_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 864 of file node.c.

+ Here is the call graph for this function:

◆ flowprobe_l3_ip4_add()

static u32 flowprobe_l3_ip4_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 240 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_l3_ip6_add()

static u32 flowprobe_l3_ip6_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 214 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_l4_add()

static u32 flowprobe_l4_add ( vlib_buffer_t to_b,
flowprobe_entry_t e,
u16  offset 
)
inlinestatic

Definition at line 266 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_lookup()

flowprobe_entry_t* flowprobe_lookup ( u32  my_cpu_number,
flowprobe_key_t k,
u32 poolindex,
bool collision 
)

Definition at line 307 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_node_fn()

uword flowprobe_node_fn ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
flowprobe_variant_t  which 
)

Definition at line 719 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ flowprobe_walker_process()

static uword flowprobe_walker_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)
static

Definition at line 921 of file node.c.

+ Here is the call graph for this function:

◆ flush_record()

static void flush_record ( flowprobe_variant_t  which)
inlinestatic

Definition at line 871 of file node.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_flowprobe_trace()

static u8* format_flowprobe_trace ( u8 s,
va_list *  args 
)
static

Definition at line 72 of file node.c.

+ Here is the call graph for this function:

Variable Documentation

◆ flowprobe_error_strings

char* flowprobe_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}

Definition at line 120 of file node.c.

◆ flowprobe_ip4_node

vlib_node_registration_t flowprobe_ip4_node
Initial value:
= {
.function = flowprobe_ip4_node_fn,
.name = "flowprobe-ip4",
.vector_size = sizeof (u32),
.format_trace = format_flowprobe_trace,
.error_strings = flowprobe_error_strings,
.n_next_nodes = FLOWPROBE_N_NEXT,
.next_nodes = FLOWPROBE_NEXT_NODES,
}

(constructor) VLIB_REGISTER_NODE (flowprobe_ip4_node)

Definition at line 101 of file node.c.

◆ flowprobe_ip6_node

vlib_node_registration_t flowprobe_ip6_node
Initial value:
= {
.function = flowprobe_ip6_node_fn,
.name = "flowprobe-ip6",
.vector_size = sizeof (u32),
.format_trace = format_flowprobe_trace,
.error_strings = flowprobe_error_strings,
.n_next_nodes = FLOWPROBE_N_NEXT,
.next_nodes = FLOWPROBE_NEXT_NODES,
}

(constructor) VLIB_REGISTER_NODE (flowprobe_ip6_node)

Definition at line 102 of file node.c.

◆ flowprobe_l2_node

vlib_node_registration_t flowprobe_l2_node
Initial value:
= {
.function = flowprobe_l2_node_fn,
.name = "flowprobe-l2",
.vector_size = sizeof (u32),
.format_trace = format_flowprobe_trace,
.error_strings = flowprobe_error_strings,
.n_next_nodes = FLOWPROBE_N_NEXT,
.next_nodes = FLOWPROBE_NEXT_NODES,
}

(constructor) VLIB_REGISTER_NODE (flowprobe_l2_node)

Definition at line 103 of file node.c.

◆ flowprobe_variant_strings

char* flowprobe_variant_strings[]
static
Initial value:
= {
[FLOW_VARIANT_IP4] = "IP4",
[FLOW_VARIANT_IP6] = "IP6",
[FLOW_VARIANT_L2] = "L2",
[FLOW_VARIANT_L2_IP4] = "L2-IP4",
[FLOW_VARIANT_L2_IP6] = "L2-IP6",
}

Definition at line 62 of file node.c.

◆ flowprobe_walker_node

vlib_node_registration_t flowprobe_walker_node
Initial value:
= {
.name = "flowprobe-walker",
.state = VLIB_NODE_STATE_INTERRUPT,
}

(constructor) VLIB_REGISTER_NODE (flowprobe_walker_node)

Definition at line 1033 of file node.c.

VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
flowprobe_error_strings
static char * flowprobe_error_strings[]
Definition: node.c:120
VLIB_NODE_TYPE_INPUT
@ VLIB_NODE_TYPE_INPUT
Definition: node.h:76
flowprobe_ip4_node_fn
static uword flowprobe_ip4_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:850
FLOWPROBE_NEXT_DROP
@ FLOWPROBE_NEXT_DROP
Definition: node.c:128
FLOWPROBE_NEXT_IP4_LOOKUP
@ FLOWPROBE_NEXT_IP4_LOOKUP
Definition: node.c:129
foreach_flowprobe_error
#define foreach_flowprobe_error
Definition: node.c:106
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
FLOW_VARIANT_L2
@ FLOW_VARIANT_L2
Definition: flowprobe.h:50
FLOWPROBE_N_NEXT
@ FLOWPROBE_N_NEXT
Definition: node.c:130
u32
unsigned int u32
Definition: types.h:88
FLOW_VARIANT_L2_IP4
@ FLOW_VARIANT_L2_IP4
Definition: flowprobe.h:51
FLOW_VARIANT_IP6
@ FLOW_VARIANT_IP6
Definition: flowprobe.h:49
FLOW_VARIANT_L2_IP6
@ FLOW_VARIANT_L2_IP6
Definition: flowprobe.h:52
flowprobe_walker_process
static uword flowprobe_walker_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
Definition: node.c:921
format_flowprobe_trace
static u8 * format_flowprobe_trace(u8 *s, va_list *args)
Definition: node.c:72
FLOW_VARIANT_IP4
@ FLOW_VARIANT_IP4
Definition: flowprobe.h:48
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
flowprobe_ip6_node_fn
static uword flowprobe_ip6_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:857
FLOWPROBE_NEXT_NODES
#define FLOWPROBE_NEXT_NODES
Definition: node.c:133
flowprobe_l2_node_fn
static uword flowprobe_l2_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: node.c:864