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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
15 #ifndef included_vnet_ping_h
16 #define included_vnet_ping_h
19 #include <vnet/ip/ip.h>
21 #include <vnet/ip/lookup.h>
25 PING_RESPONSE_IP6 = 42,
27 } ping_response_type_t;
33 SEND_PING_NO_INTERFACE,
35 } send_ip46_ping_result_t;
38 * Currently running ping command.
40 typedef struct ping_run_t
47 typedef struct ping_main_t
51 ping_run_t *ping_runs;
52 /* hash table to find back the CLI process for a reply */
53 // uword *cli_proc_by_icmp_id;
54 ping_run_t *ping_run_by_icmp_id;
57 ping_main_t ping_main;
59 #define PING_DEFAULT_DATA_LEN 60
60 #define PING_DEFAULT_INTERVAL 1.0
62 #define PING_MAXIMUM_DATA_SIZE 2000
64 typedef CLIB_PACKED (struct
67 u16 seq; f64 time_sent; u8 data[PING_MAXIMUM_DATA_SIZE];
68 }) icmp46_echo_request_t;
71 typedef CLIB_PACKED (struct
74 icmp46_header_t icmp; icmp46_echo_request_t icmp_echo;
75 }) icmp6_echo_request_header_t;
77 typedef CLIB_PACKED (struct
80 icmp46_header_t icmp; icmp46_echo_request_t icmp_echo;
81 }) icmp4_echo_request_header_t;
96 ICMP6_ECHO_REPLY_NEXT_DROP,
97 ICMP6_ECHO_REPLY_NEXT_PUNT,
98 ICMP6_ECHO_REPLY_N_NEXT,
99 } icmp6_echo_reply_next_t;
103 ICMP4_ECHO_REPLY_NEXT_DROP,
104 ICMP4_ECHO_REPLY_NEXT_PUNT,
105 ICMP4_ECHO_REPLY_N_NEXT,
106 } icmp4_echo_reply_next_t;
108 #endif /* included_vnet_ping_h */