FD.io VPP  v20.09-64-g4f7b92f0a
Vector Packet Processing
udp_ping_node.c File Reference
+ Include dependency graph for udp_ping_node.c:

Go to the source code of this file.

Data Structures

struct  udp_ping_trace_t
 

Macros

#define foreach_udp_ping_error   _(BADHBH, "Malformed hop-by-hop header")
 

Enumerations

enum  udp_ping_next_t {
  UDP_PING_NEXT_DROP, UDP_PING_NEXT_PUNT, UDP_PING_NEXT_UDP_LOOKUP, UDP_PING_NEXT_ICMP,
  UDP_PING_NEXT_IP6_LOOKUP, UDP_PING_NEXT_IP6_DROP, UDP_PING_N_NEXT
}
 
enum  udp_ping_error_t { UDP_PING_N_ERROR }
 

Functions

uword udp_ping_process (vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
 UDP-Ping Process node. More...
 
int ip6_hbh_ioam_trace_data_list_handler (vlib_buffer_t *b, ip6_header_t *ip, ip6_hop_by_hop_option_t *opt)
 
static u8format_udp_ping_trace (u8 *s, va_list *args)
 
void udp_ping_calculate_timer_interval (void)
 
void ip46_udp_ping_set_flow (ip46_address_t src, ip46_address_t dst, u16 start_src_port, u16 end_src_port, u16 start_dst_port, u16 end_dst_port, u16 interval, u8 fault_det, u8 is_disable)
 
uword unformat_port_range (unformat_input_t *input, va_list *args)
 
static clib_error_tset_udp_ping_command_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tshow_udp_ping_summary_cmd_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
void udp_ping_analyse_hbh (vlib_buffer_t *b0, u32 flow_id, u16 src_port, u16 dst_port, ip6_hop_by_hop_option_t *opt0, ip6_hop_by_hop_option_t *limit0, u16 len)
 HopByHop analyse function for udp-ping response. More...
 
void udp_ping_local_analyse (vlib_node_runtime_t *node, vlib_buffer_t *b0, ip6_header_t *ip0, ip6_hop_by_hop_header_t *hbh0, u16 *next0)
 UDP-Ping request/response handler function. More...
 
static uword udp_ping_local_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 udp ping request/response packet receive node. More...
 
static clib_error_tudp_ping_init (vlib_main_t *vm)
 

Variables

static char * udp_ping_error_strings []
 
udp_ping_main_t udp_ping_main
 
static vlib_node_registration_t udp_ping_node
 (constructor) VLIB_REGISTER_NODE (udp_ping_node) More...
 
static vlib_cli_command_t set_udp_ping_command
 (constructor) VLIB_CLI_COMMAND (set_udp_ping_command) More...
 
static vlib_cli_command_t show_udp_ping_cmd
 (constructor) VLIB_CLI_COMMAND (show_udp_ping_cmd) More...
 
static vlib_node_registration_t udp_ping_local
 (constructor) VLIB_REGISTER_NODE (udp_ping_local) More...
 

Macro Definition Documentation

◆ foreach_udp_ping_error

#define foreach_udp_ping_error   _(BADHBH, "Malformed hop-by-hop header")

Definition at line 41 of file udp_ping_node.c.

Enumeration Type Documentation

◆ udp_ping_error_t

Enumerator
UDP_PING_N_ERROR 

Definition at line 44 of file udp_ping_node.c.

◆ udp_ping_next_t

Enumerator
UDP_PING_NEXT_DROP 
UDP_PING_NEXT_PUNT 
UDP_PING_NEXT_UDP_LOOKUP 
UDP_PING_NEXT_ICMP 
UDP_PING_NEXT_IP6_LOOKUP 
UDP_PING_NEXT_IP6_DROP 
UDP_PING_N_NEXT 

Definition at line 30 of file udp_ping_node.c.

Function Documentation

◆ format_udp_ping_trace()

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

Definition at line 81 of file udp_ping_node.c.

+ Here is the call graph for this function:

◆ ip46_udp_ping_set_flow()

void ip46_udp_ping_set_flow ( ip46_address_t  src,
ip46_address_t  dst,
u16  start_src_port,
u16  end_src_port,
u16  start_dst_port,
u16  end_dst_port,
u16  interval,
u8  fault_det,
u8  is_disable 
)

Definition at line 132 of file udp_ping_node.c.

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

◆ ip6_hbh_ioam_trace_data_list_handler()

int ip6_hbh_ioam_trace_data_list_handler ( vlib_buffer_t b,
ip6_header_t ip,
ip6_hop_by_hop_option_t opt 
)

Definition at line 256 of file ip6_ioam_trace.c.

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

◆ set_udp_ping_command_fn()

static clib_error_t* set_udp_ping_command_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 262 of file udp_ping_node.c.

+ Here is the call graph for this function:

◆ show_udp_ping_summary_cmd_fn()

static clib_error_t* show_udp_ping_summary_cmd_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 318 of file udp_ping_node.c.

+ Here is the call graph for this function:

◆ udp_ping_analyse_hbh()

void udp_ping_analyse_hbh ( vlib_buffer_t b0,
u32  flow_id,
u16  src_port,
u16  dst_port,
ip6_hop_by_hop_option_t opt0,
ip6_hop_by_hop_option_t limit0,
u16  len 
)

HopByHop analyse function for udp-ping response.

Walks through all hbh options present in udp-ping response and uses analyser library for the analysis.

Definition at line 435 of file udp_ping_node.c.

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

◆ udp_ping_calculate_timer_interval()

void udp_ping_calculate_timer_interval ( void  )

Definition at line 106 of file udp_ping_node.c.

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

◆ udp_ping_init()

static clib_error_t* udp_ping_init ( vlib_main_t vm)
static

Definition at line 820 of file udp_ping_node.c.

+ Here is the call graph for this function:

◆ udp_ping_local_analyse()

void udp_ping_local_analyse ( vlib_node_runtime_t node,
vlib_buffer_t b0,
ip6_header_t ip0,
ip6_hop_by_hop_header_t hbh0,
u16 next0 
)

UDP-Ping request/response handler function.

Checks udp-ping packet type - request/response and handles them. If not udp-ping packet then, strips off hbh options and enques packet to protocol registered node to enable next protocol processing.

Definition at line 522 of file udp_ping_node.c.

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

◆ udp_ping_local_node_fn()

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

udp ping request/response packet receive node.

Node Identifier:
udp-ping-local

This function receives udp ping request/response packets and process them. For request packets, response is created and sent. For response packets, they are analysed and results stored.

Parameters
vmvlib_main_t corresponding to the current thread.
nodevlib_node_runtime_t data for this node.
framevlib_frame_t whose contents should be dispatched.
Graph mechanics: buffer, next index usage

Uses:

  • udp_ping_local_analyse(node, p0, ip0, hbh0, &next0)
    • Checks packet type - request/respnse and process them.

Next Index:

  • Dispatches the packet to ip6-lookup/ip6-drop depending on type of packet.

Definition at line 638 of file udp_ping_node.c.

+ Here is the call graph for this function:

◆ udp_ping_process()

uword udp_ping_process ( vlib_main_t vm,
vlib_node_runtime_t rt,
vlib_frame_t f 
)

UDP-Ping Process node.

Node Identifier:
udp-ping-process

This is process node which wakes up when periodically to send out udp probe packets for all configured sessions.

Parameters
vmvlib_main_t corresponding to the current thread.
rtvlib_node_runtime_t data for this node.
fvlib_frame_t whose contents should be dispatched.

Definition at line 399 of file udp_ping_node.c.

+ Here is the call graph for this function:

◆ unformat_port_range()

uword unformat_port_range ( unformat_input_t input,
va_list *  args 
)

Definition at line 207 of file udp_ping_node.c.

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

Variable Documentation

◆ set_udp_ping_command

vlib_cli_command_t set_udp_ping_command
static
Initial value:
=
{
.path = "set udp-ping",
.short_help =
"set udp-ping src <local IPv6 address> src-port-range <local port range> \
dst <remote IPv6 address> dst-port-range <destination port range> \
interval <time interval in sec for which ping packet will be sent> \
[disable]",
}
static clib_error_t * set_udp_ping_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (set_udp_ping_command)

Definition at line 305 of file udp_ping_node.c.

◆ show_udp_ping_cmd

vlib_cli_command_t show_udp_ping_cmd
static
Initial value:
=
{
.path = "show udp-ping summary",
.short_help = "Summary of udp-ping",
}
static clib_error_t * show_udp_ping_summary_cmd_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (show_udp_ping_cmd)

Definition at line 378 of file udp_ping_node.c.

◆ udp_ping_error_strings

char* udp_ping_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_udp_ping_error
Definition: udp_ping_node.c:41

Definition at line 52 of file udp_ping_node.c.

◆ udp_ping_local

vlib_node_registration_t udp_ping_local
static
Initial value:
=
{
.name = "udp-ping-local",
.vector_size = sizeof (u32),
.format_trace = format_udp_ping_trace,
.n_next_nodes = UDP_PING_N_NEXT,
.n_errors = UDP_PING_N_ERROR,
.error_strings = udp_ping_error_strings,
.next_nodes =
{
[UDP_PING_NEXT_DROP] = "error-drop",
[UDP_PING_NEXT_PUNT] = "error-punt",
[UDP_PING_NEXT_UDP_LOOKUP] = "ip6-udp-lookup",
[UDP_PING_NEXT_ICMP] = "ip6-icmp-input",
[UDP_PING_NEXT_IP6_LOOKUP] = "ip6-lookup",
[UDP_PING_NEXT_IP6_DROP] = "ip6-drop",
},
}
static char * udp_ping_error_strings[]
Definition: udp_ping_node.c:52
static u8 * format_udp_ping_trace(u8 *s, va_list *args)
Definition: udp_ping_node.c:81
unsigned int u32
Definition: types.h:88
vl_api_fib_path_type_t type
Definition: fib_types.api:123
static uword udp_ping_local_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
udp ping request/response packet receive node.

(constructor) VLIB_REGISTER_NODE (udp_ping_local)

Definition at line 797 of file udp_ping_node.c.

◆ udp_ping_main

udp_ping_main_t udp_ping_main

Definition at line 58 of file udp_ping_node.c.

◆ udp_ping_node

vlib_node_registration_t udp_ping_node
static
Initial value:
=
{
.function = udp_ping_process,
.name = "udp-ping-process",
}
uword udp_ping_process(vlib_main_t *vm, vlib_node_runtime_t *rt, vlib_frame_t *f)
UDP-Ping Process node.

(constructor) VLIB_REGISTER_NODE (udp_ping_node)

Definition at line 97 of file udp_ping_node.c.