FD.io VPP
v18.10-34-gcce845e
Vector Packet Processing
Main Page
Related Pages
Modules
Namespaces
Data Structures
Source
Files
Symbols
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
{
25
PING_RESPONSE_IP6
= 42,
26
PING_RESPONSE_IP4
,
27
}
ping_response_type_t
;
28
29
typedef
enum
30
{
31
SEND_PING_OK
= 0,
32
SEND_PING_ALLOC_FAIL
,
33
SEND_PING_NO_INTERFACE
,
34
SEND_PING_NO_TABLE
,
35
SEND_PING_NO_SRC_ADDRESS
,
36
}
send_ip46_ping_result_t
;
37
38
/*
39
* Currently running ping command.
40
*/
41
typedef
struct
ping_run_t
42
{
43
u16
icmp_id
;
44
u16
curr_seq
;
45
uword
cli_process_id
;
46
uword
cli_thread_index
;
47
}
ping_run_t
;
48
49
typedef
struct
ping_main_t
50
{
51
ip6_main_t
*
ip6_main
;
52
ip4_main_t
*
ip4_main
;
53
ping_run_t
*
ping_runs
;
54
/* hash table to find back the CLI process for a reply */
55
// uword *cli_proc_by_icmp_id;
56
ping_run_t
*
ping_run_by_icmp_id
;
57
}
ping_main_t
;
58
59
extern
ping_main_t
ping_main
;
60
61
#define PING_DEFAULT_DATA_LEN 60
62
#define PING_DEFAULT_INTERVAL 1.0
63
64
#define PING_MAXIMUM_DATA_SIZE (VLIB_BUFFER_DATA_SIZE - sizeof(ip6_header_t) - sizeof(icmp46_header_t) - offsetof(icmp46_echo_request_t, data))
65
66
/* *INDENT-OFF* */
67
68
typedef
CLIB_PACKED
(
struct
{
69
u16
id
;
70
u16
seq;
71
f64
time_sent;
72
u8
data[0];
73
}) icmp46_echo_request_t;
74
75
76
typedef
CLIB_PACKED
(
struct
{
77
ip6_header_t
ip6;
78
icmp46_header_t icmp;
79
icmp46_echo_request_t icmp_echo;
80
}) icmp6_echo_request_header_t;
81
82
typedef
CLIB_PACKED
(
struct
{
83
ip4_header_t
ip4;
84
icmp46_header_t icmp;
85
icmp46_echo_request_t icmp_echo;
86
}) icmp4_echo_request_header_t;
87
88
/* *INDENT-ON* */
89
90
91
typedef
struct
92
{
93
u16
id
;
94
u16
seq
;
95
u8
bound
;
96
}
icmp_echo_trace_t
;
97
98
99
100
101
typedef
enum
102
{
103
ICMP6_ECHO_REPLY_NEXT_DROP
,
104
ICMP6_ECHO_REPLY_NEXT_PUNT
,
105
ICMP6_ECHO_REPLY_N_NEXT
,
106
}
icmp6_echo_reply_next_t
;
107
108
typedef
enum
109
{
110
ICMP4_ECHO_REPLY_NEXT_DROP
,
111
ICMP4_ECHO_REPLY_NEXT_PUNT
,
112
ICMP4_ECHO_REPLY_N_NEXT
,
113
}
icmp4_echo_reply_next_t
;
114
115
#endif
/* included_vnet_ping_h */
ping_main_t
Definition:
ping.h:49
lookup.h
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
CLIB_PACKED
typedef CLIB_PACKED(struct{u16 id;u16 seq;f64 time_sent;u8 data[0];}) icmp46_echo_request_t
ICMP4_ECHO_REPLY_N_NEXT
Definition:
ping.h:112
ping_main_t::ip4_main
ip4_main_t * ip4_main
Definition:
ping.h:52
ip.h
u8
unsigned char u8
Definition:
types.h:56
ping_run_t
Definition:
ping.h:41
send_ip46_ping_result_t
send_ip46_ping_result_t
Definition:
ping.h:29
ping_run_t::cli_thread_index
uword cli_thread_index
Definition:
ping.h:46
f64
double f64
Definition:
types.h:142
ping_main_t::ping_runs
ping_run_t * ping_runs
Definition:
ping.h:53
ICMP4_ECHO_REPLY_NEXT_DROP
Definition:
ping.h:110
u16
unsigned short u16
Definition:
types.h:57
SEND_PING_OK
Definition:
ping.h:31
ping_main_t
struct ping_main_t ping_main_t
SEND_PING_NO_TABLE
Definition:
ping.h:34
ICMP4_ECHO_REPLY_NEXT_PUNT
Definition:
ping.h:111
ping_run_t
struct ping_run_t ping_run_t
icmp4_echo_reply_next_t
icmp4_echo_reply_next_t
Definition:
ping.h:108
ping_run_t::curr_seq
u16 curr_seq
Definition:
ping.h:44
SEND_PING_NO_INTERFACE
Definition:
ping.h:33
ip6_main_t
Definition:
ip6.h:154
ping_main_t::ip6_main
ip6_main_t * ip6_main
Definition:
ping.h:51
PING_RESPONSE_IP6
Definition:
ping.h:25
icmp_echo_trace_t::bound
u8 bound
Definition:
ping.h:95
icmp_echo_trace_t::seq
u16 seq
Definition:
ping.h:94
ping_run_t::cli_process_id
uword cli_process_id
Definition:
ping.h:45
PING_RESPONSE_IP4
Definition:
ping.h:26
ICMP6_ECHO_REPLY_NEXT_DROP
Definition:
ping.h:103
ip6_header_t
Definition:
ip6_packet.h:362
ip4_main_t
IPv4 main type.
Definition:
ip4.h:96
icmp_echo_trace_t::id
u16 id
Definition:
ping.h:93
icmp_echo_trace_t
Definition:
ping.h:91
uword
u64 uword
Definition:
types.h:112
ICMP6_ECHO_REPLY_N_NEXT
Definition:
ping.h:105
ping_response_type_t
ping_response_type_t
Definition:
ping.h:23
ping_main
ping_main_t ping_main
Definition:
ping.c:23
ping_run_t::icmp_id
u16 icmp_id
Definition:
ping.h:43
ping_main_t::ping_run_by_icmp_id
ping_run_t * ping_run_by_icmp_id
Definition:
ping.h:56
id
u32 id
Definition:
udp.api:45
ICMP6_ECHO_REPLY_NEXT_PUNT
Definition:
ping.h:104
icmp6_echo_reply_next_t
icmp6_echo_reply_next_t
Definition:
ping.h:101
SEND_PING_NO_SRC_ADDRESS
Definition:
ping.h:35
SEND_PING_ALLOC_FAIL
Definition:
ping.h:32
ip4_header_t
Definition:
ip4_packet.h:131
src
vnet
ip
ping.h
Generated on Thu May 16 2019 14:26:32 for FD.io VPP by
1.8.11