BFD: add get echo source API (VPP-1367)
[vpp.git] / src / vnet / bfd / bfd.api
1 /*
2  * Copyright (c) 2015-2016 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 option version = "1.0.0";
17
18 /** \brief Set BFD echo source
19     @param client_index - opaque cookie to identify the sender
20     @param context - sender context, to match reply w/ request
21     @param sw_if_index - interface to use as echo source
22 */
23 autoreply define bfd_udp_set_echo_source
24 {
25   u32 client_index;
26   u32 context;
27   u32 sw_if_index;
28 };
29
30 /** \brief Delete BFD echo source
31     @param client_index - opaque cookie to identify the sender
32     @param context - sender context, to match reply w/ request
33 */
34 autoreply define bfd_udp_del_echo_source
35 {
36   u32 client_index;
37   u32 context;
38 };
39
40 /** \brief Get BFD echo source
41     @param client_index - opaque cookie to identify the sender
42     @param context - sender context, to match reply w/ request
43 */
44 define bfd_udp_get_echo_source
45 {
46   u32 client_index;
47   u32 context;
48 };
49
50 /** \brief Get BFD echo source reply
51     @param context - sender context, to match reply w/ request
52     @param retval - return code
53     @param sw_if_index - interface to use as echo source
54     @param is_set - non-zero if set
55     @param have_usable_ip4 - non-zero if have usable IPv4 address
56     @param ip4_addr - IPv4 address
57     @param have_usable_ip6 - non-zero if have usable IPv6 address
58     @param ip6_addr - IPv6 address
59 */
60 define bfd_udp_get_echo_source_reply
61 {
62   u32 context;
63   i32 retval;
64   u32 sw_if_index;
65   u8 is_set;
66   u8 have_usable_ip4;
67   u8 ip4_addr[4];
68   u8 have_usable_ip6;
69   u8 ip6_addr[16];
70 };
71
72 /** \brief Add UDP BFD session on interface
73     @param client_index - opaque cookie to identify the sender
74     @param context - sender context, to match reply w/ request
75     @param sw_if_index - sw index of the interface
76     @param desired_min_tx - desired min transmit interval (microseconds)
77     @param required_min_rx - required min receive interval (microseconds)
78     @param local_addr - local address
79     @param peer_addr - peer address
80     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
81     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
82     @param is_authenticated - non-zero if authentication is required
83     @param bfd_key_id - key id sent out in BFD packets (if is_authenticated)
84     @param conf_key_id - id of already configured key (if is_authenticated)
85 */
86 autoreply define bfd_udp_add
87 {
88   u32 client_index;
89   u32 context;
90   u32 sw_if_index;
91   u32 desired_min_tx;
92   u32 required_min_rx;
93   u8 local_addr[16];
94   u8 peer_addr[16];
95   u8 is_ipv6;
96   u8 detect_mult;
97   u8 is_authenticated;
98   u8 bfd_key_id;
99   u32 conf_key_id;
100 };
101
102 /** \brief Modify UDP BFD session on interface
103     @param client_index - opaque cookie to identify the sender
104     @param context - sender context, to match reply w/ request
105     @param sw_if_index - sw index of the interface
106     @param desired_min_tx - desired min transmit interval (microseconds)
107     @param required_min_rx - required min receive interval (microseconds)
108     @param local_addr - local address
109     @param peer_addr - peer address
110     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
111     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
112 */
113 autoreply define bfd_udp_mod
114 {
115   u32 client_index;
116   u32 context;
117   u32 sw_if_index;
118   u32 desired_min_tx;
119   u32 required_min_rx;
120   u8 local_addr[16];
121   u8 peer_addr[16];
122   u8 is_ipv6;
123   u8 detect_mult;
124 };
125
126 /** \brief Delete UDP BFD session on interface
127     @param client_index - opaque cookie to identify the sender
128     @param context - sender context, to match reply w/ request
129     @param sw_if_index - sw index of the interface
130     @param local_addr - local address
131     @param peer_addr - peer address
132     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
133 */
134 autoreply define bfd_udp_del
135 {
136   u32 client_index;
137   u32 context;
138   u32 sw_if_index;
139   u8 local_addr[16];
140   u8 peer_addr[16];
141   u8 is_ipv6;
142 };
143
144 /** \brief Get all BFD sessions
145     @param client_index - opaque cookie to identify the sender
146     @param context - sender context, to match reply w/ request
147 */
148 define bfd_udp_session_dump
149 {
150   u32 client_index;
151   u32 context;
152 };
153
154 /** \brief BFD session details structure
155     @param context - sender context, to match reply w/ request
156     @param sw_if_index - sw index of the interface
157     @param local_addr - local address
158     @param peer_addr - peer address
159     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
160     @param state - session state
161     @param is_authenticated - non-zero if authentication in-use, zero otherwise
162     @param bfd_key_id - ID of key currently in-use if auth is on
163     @param conf_key_id - configured key ID for this session
164     @param required_min_rx - required min receive interval (microseconds)
165     @param desired_min_tx - desired min transmit interval (microseconds)
166     @param detect_mult - detect multiplier (# of packets missed before connection goes down)
167 */
168 define bfd_udp_session_details
169 {
170   u32 context;
171   u32 sw_if_index;
172   u8 local_addr[16];
173   u8 peer_addr[16];
174   u8 is_ipv6;
175   u8 state;
176   u8 is_authenticated;
177   u8 bfd_key_id;
178   u32 conf_key_id;
179   u32 required_min_rx;
180   u32 desired_min_tx;
181   u8 detect_mult;
182 };
183
184 /** \brief Set flags of BFD UDP session
185     @param client_index - opaque cookie to identify the sender
186     @param context - sender context, to match reply w/ request
187     @param sw_if_index - sw index of the interface
188     @param local_addr - local address
189     @param peer_addr - peer address
190     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
191     @param admin_up_down - set the admin state, 1 = up, 0 = down
192 */
193 autoreply define bfd_udp_session_set_flags
194 {
195   u32 client_index;
196   u32 context;
197   u32 sw_if_index;
198   u8 local_addr[16];
199   u8 peer_addr[16];
200   u8 is_ipv6;
201   u8 admin_up_down;
202 };
203
204 /** \brief Register for BFD events
205     @param client_index - opaque cookie to identify the sender
206     @param context - sender context, to match reply w/ request
207     @param enable_disable - 1 => register for events, 0 => cancel registration
208     @param pid - sender's pid
209 */
210 autoreply define want_bfd_events
211 {
212   u32 client_index;
213   u32 context;
214   u32 enable_disable;
215   u32 pid;
216 };
217
218 /** \brief BFD UDP - add/replace key to configuration
219     @param client_index - opaque cookie to identify the sender
220     @param context - sender context, to match reply w/ request
221     @param conf_key_id - key ID to add/replace/delete
222     @param key_len - length of key (must be non-zero)
223     @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
224     @param key - key data
225 */
226 autoreply define bfd_auth_set_key
227 {
228   u32 client_index;
229   u32 context;
230   u32 conf_key_id;
231   u8 key_len;
232   u8 auth_type;
233   u8 key[20];
234 };
235
236 /** \brief BFD UDP - delete key from configuration
237     @param client_index - opaque cookie to identify the sender
238     @param context - sender context, to match reply w/ request
239     @param conf_key_id - key ID to add/replace/delete
240     @param key_len - length of key (must be non-zero)
241     @param key - key data
242 */
243 autoreply define bfd_auth_del_key
244 {
245   u32 client_index;
246   u32 context;
247   u32 conf_key_id;
248 };
249
250 /** \brief Get a list of configured authentication keys
251     @param client_index - opaque cookie to identify the sender
252     @param context - sender context, to match reply w/ request
253 */
254 define bfd_auth_keys_dump
255 {
256   u32 client_index;
257   u32 context;
258 };
259
260 /** \brief BFD authentication key details
261     @param context - sender context, to match reply w/ request
262     @param conf_key_id - configured key ID
263     @param use_count - how many BFD sessions currently use this key
264     @param auth_type - authentication type (RFC 5880/4.1/Auth Type)
265 */
266 define bfd_auth_keys_details
267 {
268   u32 context;
269   u32 conf_key_id;
270   u32 use_count;
271   u8 auth_type;
272 };
273
274 /** \brief BFD UDP - activate/change authentication
275     @param client_index - opaque cookie to identify the sender
276     @param context - sender context, to match reply w/ request
277     @param sw_if_index - sw index of the interface
278     @param local_addr - local address
279     @param peer_addr - peer address
280     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
281     @param is_delayed - change is applied once peer applies the change (on first received packet with this auth)
282     @param bfd_key_id - key id sent out in BFD packets
283     @param conf_key_id - id of already configured key
284 */
285 autoreply define bfd_udp_auth_activate
286 {
287   u32 client_index;
288   u32 context;
289   u32 sw_if_index;
290   u8 local_addr[16];
291   u8 peer_addr[16];
292   u8 is_ipv6;
293   u8 is_delayed;
294   u8 bfd_key_id;
295   u32 conf_key_id;
296 };
297
298 /** \brief BFD UDP - deactivate authentication
299     @param client_index - opaque cookie to identify the sender
300     @param context - sender context, to match reply w/ request
301     @param sw_if_index - sw index of the interface
302     @param local_addr - local address
303     @param peer_addr - peer address
304     @param is_ipv6 - local_addr, peer_addr are IPv6 if non-zero, otherwise IPv4
305     @param is_delayed - change is applied once peer applies the change (on first received non-authenticated packet)
306 */
307 autoreply define bfd_udp_auth_deactivate
308 {
309   u32 client_index;
310   u32 context;
311   u32 sw_if_index;
312   u8 local_addr[16];
313   u8 peer_addr[16];
314   u8 is_ipv6;
315   u8 is_delayed;
316 };
317
318 /*
319  * Local Variables:
320  * eval: (c-set-style "gnu")
321  * End:
322  */