FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
ping.c File Reference

IPv4 and IPv6 ICMP Ping. More...

+ Include dependency graph for ping.c:

Go to the source code of this file.

Functions

u8format_icmp4_input_trace (u8 *s, va_list *va)
 
static void signal_ip46_icmp_reply_event (vlib_main_t *vm, u8 event_type, vlib_buffer_t *b0)
 
static uword ip6_icmp_echo_reply_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword ip4_icmp_echo_reply_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static ip6_address_tip6_interface_first_address (ip6_main_t *im, u32 sw_if_index)
 
static u16 init_icmp46_echo_request (icmp46_echo_request_t *icmp46_echo, u16 seq_host, u16 id_host, u16 data_len)
 
static u32 adj_index_to_sw_if_index (vlib_main_t *vm, ip_lookup_main_t *lm, char *lookup_next_nodes[], u32 adj_index0, u32 sw_if_index, u8 verbose)
 
static send_ip46_ping_result_t send_ip6_ping (vlib_main_t *vm, ip6_main_t *im, ip6_address_t *pa6, u32 sw_if_index, u16 seq_host, u16 id_host, u16 data_len, u8 verbose)
 
static send_ip46_ping_result_t send_ip4_ping (vlib_main_t *vm, ip4_main_t *im, ip4_address_t *pa4, u32 sw_if_index, u16 seq_host, u16 id_host, u16 data_len, u8 verbose)
 
static void print_ip6_icmp_reply (vlib_main_t *vm, u32 bi0)
 
static void print_ip4_icmp_reply (vlib_main_t *vm, u32 bi0)
 
static void run_ping_ip46_address (vlib_main_t *vm, ip4_address_t *pa4, ip6_address_t *pa6, u32 sw_if_index, f64 ping_interval, u32 ping_repeat, u32 data_len, u32 verbose)
 
static clib_error_tping_ip_address (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tping_cli_init (vlib_main_t *vm)
 

Variables

static vlib_node_registration_t ip6_icmp_echo_reply_node
 (constructor) VLIB_REGISTER_NODE (ip6_icmp_echo_reply_node) More...
 
static vlib_node_registration_t ip4_icmp_echo_reply_node
 (constructor) VLIB_REGISTER_NODE (ip4_icmp_echo_reply_node) More...
 
char * ip6_lookup_next_nodes [] = IP6_LOOKUP_NEXT_NODES
 
char * ip4_lookup_next_nodes [] = IP4_LOOKUP_NEXT_NODES
 
static vlib_cli_command_t ping_command
 (constructor) VLIB_CLI_COMMAND (ping_command) More...
 

Detailed Description

IPv4 and IPv6 ICMP Ping.

This file contains code to suppport IPv4 or IPv6 ICMP ECHO_REQUEST to network hosts.

Definition in file ping.c.

Function Documentation

static u32 adj_index_to_sw_if_index ( vlib_main_t vm,
ip_lookup_main_t lm,
char *  lookup_next_nodes[],
u32  adj_index0,
u32  sw_if_index,
u8  verbose 
)
static

Definition at line 243 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_icmp4_input_trace ( u8 s,
va_list *  va 
)

Definition at line 32 of file ping.c.

+ Here is the call graph for this function:

static u16 init_icmp46_echo_request ( icmp46_echo_request_t *  icmp46_echo,
u16  seq_host,
u16  id_host,
u16  data_len 
)
static

Definition at line 217 of file ping.c.

+ Here is the caller graph for this function:

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

Definition at line 147 of file ping.c.

+ Here is the call graph for this function:

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

Definition at line 99 of file ping.c.

+ Here is the call graph for this function:

static ip6_address_t* ip6_interface_first_address ( ip6_main_t im,
u32  sw_if_index 
)
static

Definition at line 196 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static clib_error_t* ping_cli_init ( vlib_main_t vm)
static

Definition at line 829 of file ping.c.

+ Here is the call graph for this function:

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

Definition at line 635 of file ping.c.

+ Here is the call graph for this function:

static void print_ip4_icmp_reply ( vlib_main_t vm,
u32  bi0 
)
static

Definition at line 484 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void print_ip6_icmp_reply ( vlib_main_t vm,
u32  bi0 
)
static

Definition at line 467 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void run_ping_ip46_address ( vlib_main_t vm,
ip4_address_t pa4,
ip6_address_t pa6,
u32  sw_if_index,
f64  ping_interval,
u32  ping_repeat,
u32  data_len,
u32  verbose 
)
static

Definition at line 512 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static send_ip46_ping_result_t send_ip4_ping ( vlib_main_t vm,
ip4_main_t im,
ip4_address_t pa4,
u32  sw_if_index,
u16  seq_host,
u16  id_host,
u16  data_len,
u8  verbose 
)
static

Definition at line 359 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static send_ip46_ping_result_t send_ip6_ping ( vlib_main_t vm,
ip6_main_t im,
ip6_address_t pa6,
u32  sw_if_index,
u16  seq_host,
u16  id_host,
u16  data_len,
u8  verbose 
)
static

Definition at line 270 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void signal_ip46_icmp_reply_event ( vlib_main_t vm,
u8  event_type,
vlib_buffer_t b0 
)
static

Definition at line 54 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

vlib_node_registration_t ip4_icmp_echo_reply_node
static
Initial value:
=
{
.name = "ip4-icmp-echo-reply",
.vector_size = sizeof (u32),
.format_trace = format_icmp4_input_trace,
.n_next_nodes = ICMP4_ECHO_REPLY_N_NEXT,
.next_nodes = {
[ICMP4_ECHO_REPLY_NEXT_NORMAL] = "error-drop",
},
}
static uword ip4_icmp_echo_reply_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ping.c:147
unsigned int u32
Definition: types.h:88
u8 * format_icmp4_input_trace(u8 *s, va_list *va)
Definition: ping.c:32

(constructor) VLIB_REGISTER_NODE (ip4_icmp_echo_reply_node)

Definition at line 178 of file ping.c.

char* ip4_lookup_next_nodes[] = IP4_LOOKUP_NEXT_NODES

Definition at line 192 of file ping.c.

vlib_node_registration_t ip6_icmp_echo_reply_node
static
Initial value:
=
{
.name = "ip6-icmp-echo-reply",
.vector_size = sizeof (u32),
.format_trace = format_icmp6_input_trace,
.n_next_nodes = ICMP6_ECHO_REPLY_N_NEXT,
.next_nodes = {
[ICMP6_ECHO_REPLY_NEXT_NORMAL] = "error-drop",
},
}
unsigned int u32
Definition: types.h:88
static uword ip6_icmp_echo_reply_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ping.c:99
format_function_t format_icmp6_input_trace
Definition: icmp6.h:66

(constructor) VLIB_REGISTER_NODE (ip6_icmp_echo_reply_node)

Definition at line 130 of file ping.c.

char* ip6_lookup_next_nodes[] = IP6_LOOKUP_NEXT_NODES

Definition at line 191 of file ping.c.

vlib_cli_command_t ping_command
static
Initial value:
=
{
.path = "ping",
.function = ping_ip_address,
.short_help = "ping {<ip-addr> | ipv4 <ip4-addr> | ipv6 <ip6-addr>} [ipv4 <ip4-addr> | ipv6 <ip6-addr>] [source <interface>] [size <pktsize>] [interval <sec>] [repeat <cnt>] [verbose]",
}
static clib_error_t * ping_ip_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ping.c:635

(constructor) VLIB_CLI_COMMAND (ping_command)

Definition at line 820 of file ping.c.