FD.io VPP
v16.12-rc0-308-g931be3a
Vector Packet Processing
Main Page
Related Pages
Data Structures
Source
Files
Symbols
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
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
PING_RESPONSE_IP6
= 42,
25
PING_RESPONSE_IP4
,
26
}
ping_response_type_t
;
27
28
typedef
enum
{
29
SEND_PING_OK
= 0,
30
SEND_PING_ALLOC_FAIL
,
31
SEND_PING_NO_INTERFACE
,
32
}
send_ip46_ping_result_t
;
33
34
/*
35
* Currently running ping command.
36
*/
37
typedef
struct
ping_run_t
{
38
u16
icmp_id
;
39
u16
curr_seq
;
40
uword
cli_process_id
;
41
}
ping_run_t
;
42
43
typedef
struct
ping_main_t
{
44
ip6_main_t
*
ip6_main
;
45
ip4_main_t
*
ip4_main
;
46
ping_run_t
*
ping_runs
;
47
/* hash table to find back the CLI process for a reply */
48
// uword *cli_proc_by_icmp_id;
49
ping_run_t
*
ping_run_by_icmp_id
;
50
}
ping_main_t
;
51
52
ping_main_t
ping_main
;
53
54
#define PING_DEFAULT_DATA_LEN 60
55
#define PING_DEFAULT_INTERVAL 1.0
56
57
#define PING_MAXIMUM_DATA_SIZE 2000
58
59
typedef
CLIB_PACKED
(
struct
{
60
u16
id;
61
u16
seq;
62
f64
time_sent;
63
u8
data[
PING_MAXIMUM_DATA_SIZE
];
64
}) icmp46_echo_request_t;
65
66
67
typedef
CLIB_PACKED
(
struct
{
68
ip6_header_t
ip6;
69
icmp46_header_t icmp;
70
icmp46_echo_request_t icmp_echo;
71
}) icmp6_echo_request_header_t;
72
73
typedef
CLIB_PACKED
(
struct
{
74
ip4_header_t
ip4;
75
icmp46_header_t icmp;
76
icmp46_echo_request_t icmp_echo;
77
}) icmp4_echo_request_header_t;
78
79
80
typedef
struct
{
81
u8
packet_data[64];
82
}
icmp4_input_trace_t
;
83
84
85
86
87
typedef
enum
{
88
ICMP6_ECHO_REPLY_NEXT_NORMAL
,
89
ICMP6_ECHO_REPLY_N_NEXT
,
90
}
icmp6_echo_reply_next_t
;
91
92
typedef
enum
{
93
ICMP4_ECHO_REPLY_NEXT_NORMAL
,
94
ICMP4_ECHO_REPLY_N_NEXT
,
95
}
icmp4_echo_reply_next_t
;
96
97
#endif
/* included_vnet_ping_h */
ICMP6_ECHO_REPLY_NEXT_NORMAL
Definition:
ping.h:88
ping_main_t
Definition:
ping.h:43
lookup.h
Definitions for all things IP (v4|v6) unicast and multicast lookup related.
ICMP4_ECHO_REPLY_N_NEXT
Definition:
ping.h:94
ICMP4_ECHO_REPLY_NEXT_NORMAL
Definition:
ping.h:93
ping_main_t::ip4_main
ip4_main_t * ip4_main
Definition:
ping.h:45
ip.h
ping_run_t
Definition:
ping.h:37
send_ip46_ping_result_t
send_ip46_ping_result_t
Definition:
ping.h:28
ping_main_t::ping_runs
ping_run_t * ping_runs
Definition:
ping.h:46
SEND_PING_OK
Definition:
ping.h:29
ping_main_t
struct ping_main_t ping_main_t
CLIB_PACKED
typedef CLIB_PACKED(struct{u16 id;u16 seq;f64 time_sent;u8 data[PING_MAXIMUM_DATA_SIZE];}) icmp46_echo_request_t
ping_run_t
struct ping_run_t ping_run_t
icmp4_echo_reply_next_t
icmp4_echo_reply_next_t
Definition:
ping.h:92
ping_run_t::curr_seq
u16 curr_seq
Definition:
ping.h:39
SEND_PING_NO_INTERFACE
Definition:
ping.h:31
ip6_main_t
Definition:
ip6.h:126
ping_main_t::ip6_main
ip6_main_t * ip6_main
Definition:
ping.h:44
PING_RESPONSE_IP6
Definition:
ping.h:24
ping_run_t::cli_process_id
uword cli_process_id
Definition:
ping.h:40
PING_RESPONSE_IP4
Definition:
ping.h:25
PING_MAXIMUM_DATA_SIZE
#define PING_MAXIMUM_DATA_SIZE
Definition:
ping.h:57
ip6_header_t
Definition:
ip6_packet.h:285
ip4_main_t
IPv4 main type.
Definition:
ip4.h:95
icmp4_input_trace_t
Definition:
ping.h:80
uword
u64 uword
Definition:
types.h:112
u16
unsigned short u16
Definition:
types.h:57
f64
double f64
Definition:
types.h:142
u8
unsigned char u8
Definition:
types.h:56
ICMP6_ECHO_REPLY_N_NEXT
Definition:
ping.h:89
ping_response_type_t
ping_response_type_t
Definition:
ping.h:23
ping_main
ping_main_t ping_main
Definition:
ping.h:52
ping_run_t::icmp_id
u16 icmp_id
Definition:
ping.h:38
ping_main_t::ping_run_by_icmp_id
ping_run_t * ping_run_by_icmp_id
Definition:
ping.h:49
icmp6_echo_reply_next_t
icmp6_echo_reply_next_t
Definition:
ping.h:87
SEND_PING_ALLOC_FAIL
Definition:
ping.h:30
ip4_header_t
Definition:
ip4_packet.h:104
vnet
vnet
ip
ping.h
Generated on Thu Nov 3 2016 18:24:42 for FD.io VPP by
1.8.11