FD.io VPP  v18.04-17-g3a0d853
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_icmp_echo_trace (u8 *s, va_list *va)
 
static int signal_ip46_icmp_reply_event (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 u16 init_icmp46_echo_request (icmp46_echo_request_t *icmp46_echo, u16 seq_host, u16 id_host, u16 data_len)
 
static send_ip46_ping_result_t send_ip6_ping (vlib_main_t *vm, ip6_main_t *im, u32 table_id, ip6_address_t *pa6, u32 sw_if_index, u16 seq_host, u16 id_host, u16 data_len, u32 burst, u8 verbose)
 
static send_ip46_ping_result_t send_ip4_ping (vlib_main_t *vm, ip4_main_t *im, u32 table_id, ip4_address_t *pa4, u32 sw_if_index, u16 seq_host, u16 id_host, u16 data_len, u32 burst, 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, u32 table_id, ip4_address_t *pa4, ip6_address_t *pa6, u32 sw_if_index, f64 ping_interval, u32 ping_repeat, u32 data_len, u32 ping_burst, 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

ping_main_t ping_main
 
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

u8* format_icmp_echo_trace ( u8 s,
va_list *  va 
)

Definition at line 36 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 227 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 168 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 110 of file ping.c.

+ Here is the call graph for this function:

static clib_error_t* ping_cli_init ( vlib_main_t vm)
static

Definition at line 912 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 676 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 522 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 505 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,
u32  table_id,
ip4_address_t pa4,
ip6_address_t pa6,
u32  sw_if_index,
f64  ping_interval,
u32  ping_repeat,
u32  data_len,
u32  ping_burst,
u32  verbose 
)
static

Definition at line 551 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,
u32  table_id,
ip4_address_t pa4,
u32  sw_if_index,
u16  seq_host,
u16  id_host,
u16  data_len,
u32  burst,
u8  verbose 
)
static

Definition at line 366 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,
u32  table_id,
ip6_address_t pa6,
u32  sw_if_index,
u16  seq_host,
u16  id_host,
u16  data_len,
u32  burst,
u8  verbose 
)
static

Definition at line 242 of file ping.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int signal_ip46_icmp_reply_event ( u8  event_type,
vlib_buffer_t b0 
)
static

Definition at line 59 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_icmp_echo_trace,
.n_next_nodes = ICMP4_ECHO_REPLY_N_NEXT,
.next_nodes = {
},
}
u8 * format_icmp_echo_trace(u8 *s, va_list *va)
Definition: ping.c:36
static uword ip4_icmp_echo_reply_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: ping.c:168
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (ip4_icmp_echo_reply_node)

Definition at line 208 of file ping.c.

char* ip4_lookup_next_nodes[] = IP4_LOOKUP_NEXT_NODES

Definition at line 223 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_icmp_echo_trace,
.n_next_nodes = ICMP6_ECHO_REPLY_N_NEXT,
.next_nodes = {
},
}
u8 * format_icmp_echo_trace(u8 *s, va_list *va)
Definition: ping.c:36
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:110

(constructor) VLIB_REGISTER_NODE (ip6_icmp_echo_reply_node)

Definition at line 150 of file ping.c.

char* ip6_lookup_next_nodes[] = IP6_LOOKUP_NEXT_NODES

Definition at line 222 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>] [table-id <id>]"
" [verbose]",
.is_mp_safe = 1,
}
static clib_error_t * ping_ip_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ping.c:676

(constructor) VLIB_CLI_COMMAND (ping_command)

Definition at line 899 of file ping.c.

ping_main_t ping_main

Definition at line 23 of file ping.c.