FD.io VPP  v17.04-9-g99c0734
Vector Packet Processing
ping.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef included_vnet_ping_h
16 #define included_vnet_ping_h
17 
18 
19 #include <vnet/ip/ip.h>
20 
21 #include <vnet/ip/lookup.h>
22 
23 typedef enum
24 {
28 
29 typedef enum
30 {
37 
38 /*
39  * Currently running ping command.
40  */
41 typedef struct ping_run_t
42 {
46 } ping_run_t;
47 
48 typedef struct ping_main_t
49 {
53  /* hash table to find back the CLI process for a reply */
54  // uword *cli_proc_by_icmp_id;
56 } ping_main_t;
57 
59 
60 #define PING_DEFAULT_DATA_LEN 60
61 #define PING_DEFAULT_INTERVAL 1.0
62 
63 #define PING_MAXIMUM_DATA_SIZE (VLIB_BUFFER_DATA_SIZE - sizeof(ip6_header_t) - sizeof(icmp46_header_t) - offsetof(icmp46_echo_request_t, data))
64 
65 /* *INDENT-OFF* */
66 
67 typedef CLIB_PACKED (struct {
68  u16 id;
69  u16 seq;
70  f64 time_sent;
71  u8 data[0];
72 }) icmp46_echo_request_t;
73 
74 
75 typedef CLIB_PACKED (struct {
76  ip6_header_t ip6;
77  icmp46_header_t icmp;
78  icmp46_echo_request_t icmp_echo;
79 }) icmp6_echo_request_header_t;
80 
81 typedef CLIB_PACKED (struct {
82  ip4_header_t ip4;
83  icmp46_header_t icmp;
84  icmp46_echo_request_t icmp_echo;
85 }) icmp4_echo_request_header_t;
86 
87 /* *INDENT-ON* */
88 
89 
90 typedef struct
91 {
96 
97 
98 
99 
100 typedef enum
101 {
106 
107 typedef enum
108 {
113 
114 #endif /* included_vnet_ping_h */
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
typedef CLIB_PACKED(struct{u16 id;u16 seq;f64 time_sent;u8 data[0];}) icmp46_echo_request_t
ip4_main_t * ip4_main
Definition: ping.h:51
send_ip46_ping_result_t
Definition: ping.h:29
ping_run_t * ping_runs
Definition: ping.h:52
struct ping_main_t ping_main_t
struct ping_run_t ping_run_t
icmp4_echo_reply_next_t
Definition: ping.h:107
u16 curr_seq
Definition: ping.h:44
ip6_main_t * ip6_main
Definition: ping.h:50
uword cli_process_id
Definition: ping.h:45
IPv4 main type.
Definition: ip4.h:107
u64 uword
Definition: types.h:112
unsigned short u16
Definition: types.h:57
double f64
Definition: types.h:142
unsigned char u8
Definition: types.h:56
ping_response_type_t
Definition: ping.h:23
ping_main_t ping_main
Definition: ping.h:58
u16 icmp_id
Definition: ping.h:43
ping_run_t * ping_run_by_icmp_id
Definition: ping.h:55
icmp6_echo_reply_next_t
Definition: ping.h:100