FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
udp_ping.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 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 
16 #ifndef PLUGINS_IOAM_PLUGIN_IOAM_UDP_PING_UDP_PING_H_
17 #define PLUGINS_IOAM_PLUGIN_IOAM_UDP_PING_UDP_PING_H_
18 
20 
21 #define MAX_PING_RETRIES 5
22 
23 #define EVENT_SIG_RECHECK 2
24 
25 /** @brief udp-ping session data.
26  @note cache aligned.
27 */
28 typedef struct
29 {
30  /** UDP ping packet */
32 
33  /** Ping packet rewrite string len. */
35 
36  /** Number of times ping response was dropped.
37  * If retry > MAX_PING_RETRIES then declare connectivity as down.
38  */
40 
41  u16 reserve[2];
42 
43  /** Analysed data. */
45 
46  /** This is used by ioam e2e for identifying flow and add seq number. */
48 
49  /** No of packets sent for this flow. */
52 
53 /** @brief udp-ping flow data.
54  @note cache aligned.
55 */
56 typedef struct
57 {
58  /** Time at which next udp-ping probe has to be sent out. */
60 
61  /** Interval for which ping packet to be sent. */
63 
64  u16 reserve[3];
65 
66  /** Defines start port of the src port range. */
68 
69  /** Defines end port of the src port range. */
71 
72  /** Defines start port of the dest port range. */
74 
75  /** Defines end port of the dest port range. */
77 
78  /** Ping statistics. */
80 
82 
83 /** @brief udp-ping data.
84 */
85 typedef struct
86 {
87  /** Required for pool_get_aligned */
88  CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
89 
90  /** Local source IPv4/6 address to be used. */
91  ip46_address_t src;
92 
93  /** Remote destination IPv4/6 address to be used. */
94  ip46_address_t dst;
95 
96  /** Per flow data. */
98 
99  /** To enable fault detection/isolation in network. */
102 
103 /** @brief udp-ping main data-structure.
104 */
105 typedef struct
106 {
107  /** Vector od udp-ping data */
109 
110  /** Stores the time interval at which process node has to wake up. */
112 
113  /** Pointer to VLib main for the node - ipfix-collector. */
115 
116  /** Pointer to vnet main for convenience. */
118 
119  /** API message ID base */
122 
124 
125 void
126 ip46_udp_ping_set_flow (ip46_address_t src, ip46_address_t dst,
127  u16 start_src_port, u16 end_src_port,
128  u16 start_dst_port, u16 end_dst_port,
129  u16 interval, u8 fault_det, u8 is_disable);
130 
132 
133 #endif /* PLUGINS_IOAM_PLUGIN_IOAM_UDP_PING_UDP_PING_H_ */
134 
135 /*
136  * fd.io coding-style-patch-verification: ON
137  *
138  * Local Variables:
139  * eval: (c-set-style "gnu")
140  * End:
141  */
ip46_udp_ping_flow::dst
ip46_address_t dst
Remote destination IPv4/6 address to be used.
Definition: udp_ping.h:94
udp_ping_main_t::msg_id_base
u16 msg_id_base
API message ID base.
Definition: udp_ping.h:120
udp_ping_flow_create
clib_error_t * udp_ping_flow_create(u8 del)
Definition: udp_ping_export.c:228
udp_ping_main_t::vlib_main
vlib_main_t * vlib_main
Pointer to VLib main for the node - ipfix-collector.
Definition: udp_ping.h:114
udp_ping_main_t::ip46_flow
ip46_udp_ping_flow * ip46_flow
Vector od udp-ping data.
Definition: udp_ping.h:108
CLIB_CACHE_LINE_ALIGN_MARK
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
Definition: cache.h:60
udp_ping_flow::stats
udp_ping_flow_data * stats
Ping statistics.
Definition: udp_ping.h:79
udp_ping_flow_data::flow_ctx
u32 flow_ctx
This is used by ioam e2e for identifying flow and add seq number.
Definition: udp_ping.h:47
u16
unsigned short u16
Definition: types.h:57
udp_ping_main_t::vnet_main
vnet_main_t * vnet_main
Pointer to vnet main for convenience.
Definition: udp_ping.h:117
ip46_udp_ping_flow::fault_det
u8 fault_det
To enable fault detection/isolation in network.
Definition: udp_ping.h:100
ip46_udp_ping_flow::src
ip46_address_t src
Local source IPv4/6 address to be used.
Definition: udp_ping.h:91
udp_ping_flow::start_src_port
u16 start_src_port
Defines start port of the src port range.
Definition: udp_ping.h:67
udp_ping_flow_data::rewrite_len
u16 rewrite_len
Ping packet rewrite string len.
Definition: udp_ping.h:34
udp_ping_flow_data::retry
u16 retry
Number of times ping response was dropped.
Definition: udp_ping.h:39
udp_ping_main
udp_ping_main_t udp_ping_main
Definition: udp_ping_node.c:58
udp_ping_main_t
udp-ping main data-structure.
Definition: udp_ping.h:105
f64
double f64
Definition: types.h:142
src
vl_api_address_t src
Definition: gre.api:54
interval
u16 interval
Definition: vrrp.api:34
udp_ping_flow_data
udp-ping session data.
Definition: udp_ping.h:28
udp_ping_flow_data::analyse_data
ioam_analyser_data_t analyse_data
Analysed data.
Definition: udp_ping.h:44
udp_ping_main_t::timer_interval
u64 timer_interval
Stores the time interval at which process node has to wake up.
Definition: udp_ping.h:111
vnet_main_t
Definition: vnet.h:76
u64
unsigned long u64
Definition: types.h:89
udp_ping_flow::interval
u16 interval
Interval for which ping packet to be sent.
Definition: udp_ping.h:62
ip46_udp_ping_flow::udp_data
udp_ping_flow udp_data
Per flow data.
Definition: udp_ping.h:97
udp_ping_flow
udp-ping flow data.
Definition: udp_ping.h:56
u32
unsigned int u32
Definition: types.h:88
udp_ping_flow_data::pak_sent
u32 pak_sent
No of packets sent for this flow.
Definition: udp_ping.h:50
dst
vl_api_ip4_address_t dst
Definition: pnat.api:41
ip46_udp_ping_flow
udp-ping data.
Definition: udp_ping.h:85
ioam_analyser_data_t_
Analysed iOAM data.
Definition: ioam_analyse.h:98
vlib_main_t
Definition: main.h:102
udp_ping_flow::end_dst_port
u16 end_dst_port
Defines end port of the dest port range.
Definition: udp_ping.h:76
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
udp_ping_flow::end_src_port
u16 end_src_port
Defines end port of the src port range.
Definition: udp_ping.h:70
ip46_udp_ping_set_flow
void ip46_udp_ping_set_flow(ip46_address_t src, ip46_address_t dst, u16 start_src_port, u16 end_src_port, u16 start_dst_port, u16 end_dst_port, u16 interval, u8 fault_det, u8 is_disable)
Definition: udp_ping_node.c:132
udp_ping_flow_data::ping_rewrite
u8 * ping_rewrite
UDP ping packet.
Definition: udp_ping.h:31
ioam_analyse.h
udp_ping_flow::next_send_time
f64 next_send_time
Time at which next udp-ping probe has to be sent out.
Definition: udp_ping.h:59
udp_ping_flow::start_dst_port
u16 start_dst_port
Defines start port of the dest port range.
Definition: udp_ping.h:73