blob: 033c7a34fed229a4b3fe268dda0713a0887ff7fc [file] [log] [blame]
Pavel Kotucekc8d87702017-01-25 07:25:32 +01001/*
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
Juraj Sloboda81119e82018-05-25 14:02:20 +020016option version = "2.0.1";
Dave Barach0d056e52017-09-28 15:11:16 -040017
Pavel Kotucekc8d87702017-01-25 07:25:32 +010018/** \brief DHCP Proxy config add / del request
19 @param client_index - opaque cookie to identify the sender
20 @param context - sender context, to match reply w/ request
Neale Ranns20a175a2017-02-14 07:28:41 -080021 @param rx_vrf_id - Rx/interface vrf id
22 @param server_vrf_id - server vrf id
Pavel Kotucekc8d87702017-01-25 07:25:32 +010023 @param if_ipv6 - ipv6 if non-zero, else ipv4
24 @param is_add - add the config if non-zero, else delete
25 @param insert_circuit_id - option82 suboption 1 fib number
26 @param dhcp_server[] - server address
27 @param dhcp_src_address[] - <fix this, need details>
28*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040029autoreply define dhcp_proxy_config
Pavel Kotucekc8d87702017-01-25 07:25:32 +010030{
31 u32 client_index;
32 u32 context;
Neale Ranns20a175a2017-02-14 07:28:41 -080033 u32 rx_vrf_id;
34 u32 server_vrf_id;
Pavel Kotucekc8d87702017-01-25 07:25:32 +010035 u8 is_ipv6;
36 u8 is_add;
Pavel Kotucekc8d87702017-01-25 07:25:32 +010037 u8 dhcp_server[16];
38 u8 dhcp_src_address[16];
39};
40
Pavel Kotucekc8d87702017-01-25 07:25:32 +010041/** \brief DHCP Proxy set / unset vss request
42 @param client_index - opaque cookie to identify the sender
43 @param context - sender context, to match reply w/ request
44 @param tbl_id - table id
John Lo70bfcaf2017-11-14 13:19:26 -050045 @vss_type - 0: use ASCI vpn_id; 1: use oui/vpn_index; 255: global vpn
46 @vpn_ascii - null terminated ASCII VPN ID up to 128 characters
47 @param oui - first part of rfc2685 vpn id, 3 bytes oui
48 @param vpn_index - second part of rfc2685 vpn id, 4 bytes vpn index
Pavel Kotucekc8d87702017-01-25 07:25:32 +010049 @param is_ipv6 - ip6 if non-zero, else ip4
50 @param is_add - set vss if non-zero, else delete
51*/
Dave Barach11b8dbf2017-04-24 10:46:54 -040052autoreply define dhcp_proxy_set_vss
Pavel Kotucekc8d87702017-01-25 07:25:32 +010053{
54 u32 client_index;
55 u32 context;
56 u32 tbl_id;
John Lo70bfcaf2017-11-14 13:19:26 -050057 u8 vss_type;
58 u8 vpn_ascii_id[129];
Pavel Kotucekc8d87702017-01-25 07:25:32 +010059 u32 oui;
John Lo70bfcaf2017-11-14 13:19:26 -050060 u32 vpn_index;
Pavel Kotucekc8d87702017-01-25 07:25:32 +010061 u8 is_ipv6;
62 u8 is_add;
63};
64
Neale Rannsdaff1782018-05-16 04:12:18 -070065/** \brief DHCP Client config data
Pavel Kotucekc8d87702017-01-25 07:25:32 +010066 @param sw_if_index - index of the interface for DHCP client
67 @param hostname - hostname
Neale Rannsdaff1782018-05-16 04:12:18 -070068 @param id - Client ID - option 61
Pavel Kotucekc8d87702017-01-25 07:25:32 +010069 @param want_dhcp_event - DHCP event sent to the sender
70 via dhcp_compl_event API message if non-zero
Neale Ranns54c6dc42018-01-17 10:29:10 -080071 @param set_broadcast_flag - in the DHCP Discover to control
72 how the resulting OFFER is addressed.
Pavel Kotucekc8d87702017-01-25 07:25:32 +010073 @param pid - sender's pid
74*/
Neale Rannsdaff1782018-05-16 04:12:18 -070075typeonly define dhcp_client
Pavel Kotucekc8d87702017-01-25 07:25:32 +010076{
Pavel Kotucekc8d87702017-01-25 07:25:32 +010077 u32 sw_if_index;
78 u8 hostname[64];
Neale Rannsdaff1782018-05-16 04:12:18 -070079 u8 id[64];
Pavel Kotucekc8d87702017-01-25 07:25:32 +010080 u8 want_dhcp_event;
Neale Ranns54c6dc42018-01-17 10:29:10 -080081 u8 set_broadcast_flag;
Pavel Kotucekc8d87702017-01-25 07:25:32 +010082 u32 pid;
83};
84
Neale Rannsdaff1782018-05-16 04:12:18 -070085/** \brief DHCP Client config add / del request
Pavel Kotucekc8d87702017-01-25 07:25:32 +010086 @param client_index - opaque cookie to identify the sender
Neale Rannsdaff1782018-05-16 04:12:18 -070087 @param context - sender context, to match reply w/ request
88 @param is_add - add the config if non-zero, else delete
89 @param client - client configuration data
90*/
91autoreply define dhcp_client_config
92{
93 u32 client_index;
94 u32 context;
95 u8 is_add;
96 vl_api_dhcp_client_t client;
97};
98
jackiechen198556bc7382019-04-29 12:00:43 +080099/** \brief Struct representing domain server
100 @param address - IP address
101*/
102typeonly manual_print manual_endian define domain_server
103{
104 u8 address[16];
105};
106
Neale Rannsdaff1782018-05-16 04:12:18 -0700107/** \brief Data learned by the client during the DHCP process
108 @param sw_if_index - the interface on which the client is configured
109 @param state - the state of the lease (see dhcp_client_state_t)
Pavel Kotucekc8d87702017-01-25 07:25:32 +0100110 @param is_ipv6 - if non-zero the address is ipv6, else ipv4
Neale Ranns4729b1e2017-07-06 01:39:05 -0700111 @param mask_width - The length of the subnet mask assigned
Pavel Kotucekc8d87702017-01-25 07:25:32 +0100112 @param host_address - Host IP address
113 @param router_address - Router IP address
114 @param host_mac - Host MAC address
115*/
Neale Rannsdaff1782018-05-16 04:12:18 -0700116typeonly define dhcp_lease
Pavel Kotucekc8d87702017-01-25 07:25:32 +0100117{
Neale Rannsdaff1782018-05-16 04:12:18 -0700118 u32 sw_if_index;
119 u8 state;
Pavel Kotucekc8d87702017-01-25 07:25:32 +0100120 u8 hostname[64];
121 u8 is_ipv6;
Neale Ranns4729b1e2017-07-06 01:39:05 -0700122 u8 mask_width;
Pavel Kotucekc8d87702017-01-25 07:25:32 +0100123 u8 host_address[16];
124 u8 router_address[16];
125 u8 host_mac[6];
jackiechen198556bc7382019-04-29 12:00:43 +0800126 u8 count;
127 vl_api_domain_server_t domain_server[count];
Pavel Kotucekc8d87702017-01-25 07:25:32 +0100128};
129
Neale Rannsdaff1782018-05-16 04:12:18 -0700130/** \brief Tell client about a DHCP completion event
131 @param client_index - opaque cookie to identify the sender
132 @param pid - client pid registered to receive notification
133 @param lease - Data learned during the DHCP process;
134*/
135define dhcp_compl_event
136{
137 u32 client_index;
138 u32 pid;
139 vl_api_dhcp_lease_t lease;
140};
141
Marek Gradzki51e59682018-03-06 10:05:44 +0100142service {
143 rpc dhcp_client_config returns dhcp_client_config_reply events dhcp_compl_event;
144};
145
Neale Rannsdaff1782018-05-16 04:12:18 -0700146/** \brief Dump the DHCP client configurations
147 */
148define dhcp_client_dump
149{
150 u32 client_index;
151 u32 context;
152};
153
154/** \brief DHCP Client details returned from dump
155 * @param client - The configured client
156 * @param lease - The learned lease data
157 */
158define dhcp_client_details
159{
160 u32 context;
161 vl_api_dhcp_client_t client;
162 vl_api_dhcp_lease_t lease;
163};
164
Neale Ranns20a175a2017-02-14 07:28:41 -0800165/** \brief Dump DHCP proxy table
166 @param client_index - opaque cookie to identify the sender
167 @param True for IPv6 proxy table
168*/
169define dhcp_proxy_dump
170{
171 u32 client_index;
172 u32 context;
173 u8 is_ip6;
174};
175
Neale Ranns3466c302017-02-16 07:45:03 -0800176typeonly manual_print manual_endian define dhcp_server
177{
178 u32 server_vrf_id;
179 u8 dhcp_server[16];
180};
181
Neale Ranns20a175a2017-02-14 07:28:41 -0800182/** \brief Tell client about a DHCP completion event
183 @param client_index - opaque cookie to identify the sender
184*/
Neale Ranns3466c302017-02-16 07:45:03 -0800185manual_endian manual_print define dhcp_proxy_details
Neale Ranns20a175a2017-02-14 07:28:41 -0800186{
187 u32 context;
188 u32 rx_vrf_id;
Neale Ranns20a175a2017-02-14 07:28:41 -0800189 u32 vss_oui;
190 u32 vss_fib_id;
John Lo70bfcaf2017-11-14 13:19:26 -0500191 u8 vss_type;
192 u8 vss_vpn_ascii_id[129];
Neale Ranns20a175a2017-02-14 07:28:41 -0800193 u8 is_ipv6;
Neale Ranns20a175a2017-02-14 07:28:41 -0800194 u8 dhcp_src_address[16];
Neale Ranns3466c302017-02-16 07:45:03 -0800195 u8 count;
196 vl_api_dhcp_server_t servers[count];
Neale Ranns20a175a2017-02-14 07:28:41 -0800197};
198
Juraj Slobodad9778c22018-06-12 10:21:05 +0200199/** \brief Set DHCPv6 DUID-LL
200 @param client_index - opaque cookie to identify the sender
201 @param context - sender context, to match reply w/ request
202 @param duid_ll - DUID-LL binary string
203*/
204autoreply define dhcp6_duid_ll_set
205{
206 u32 client_index;
207 u32 context;
208 u8 duid_ll[10];
209};
210
Juraj Sloboda81119e82018-05-25 14:02:20 +0200211/** \brief Enable/disable listening on DHCPv6 client port
212 @param client_index - opaque cookie to identify the sender
213 @param context - sender context, to match reply w/ request
214*/
215autoreply define dhcp6_clients_enable_disable
216{
217 u32 client_index;
218 u32 context;
219 u8 enable;
220};
221
Juraj Slobodadd3b8f72018-05-04 14:20:06 +0200222/** \brief Struct representing DHCPv6 address
223 @param address - address
224 @param valid_time - valid lifetime
225 @param preferred_time - preferred lifetime
226*/
227typeonly define dhcp6_address_info
228{
229 u8 address[16];
230 u32 valid_time;
231 u32 preferred_time;
232};
233
Juraj Sloboda81119e82018-05-25 14:02:20 +0200234/** \brief Struct representing DHCPv6 PD prefix
235 @param prefix - prefix
236 @param prefix_length - prefix length
237 @param valid_time - valid lifetime
238 @param preferred_time - preferred lifetime
239*/
240typeonly define dhcp6_pd_prefix_info
241{
242 u8 prefix[16];
243 u8 prefix_length;
244 u32 valid_time;
245 u32 preferred_time;
246};
247
Juraj Slobodadd3b8f72018-05-04 14:20:06 +0200248/** \brief Send DHCPv6 client message of specified type
249 @param client_index - opaque cookie to identify the sender
250 @param context - sender context, to match reply w/ request
251 @param sw_if_index - index of TX interface, also identifies IAID
252 @param server_index - used to dentify DHCPv6 server,
253 unique for each DHCPv6 server on the link,
254 value obrtained from dhcp6_reply_event API message,
255 use ~0 to send message to all DHCPv6 servers
256 @param irt - initial retransmission time
257 @param mrt - maximum retransmission time
258 @param mrc - maximum retransmission count
259 @param mrd - maximum retransmission duration
260 for sending the message
261 @param stop - if non-zero then stop resending the message,
262 otherwise start sending the message
263 @param msg_type - message type
264 @param T1 - value of T1 in IA_NA option
265 @param T2 - value of T2 in IA_NA option
266 @param n_addresses - number of addresses in IA_NA option
267 @param addresses - list of addresses in IA_NA option
268*/
269autoreply define dhcp6_send_client_message
270{
271 u32 client_index;
272 u32 context;
273 u32 sw_if_index;
274 u32 server_index;
275 u32 irt;
276 u32 mrt;
277 u32 mrc;
278 u32 mrd;
279 u8 stop;
280 u8 msg_type;
281 u32 T1;
282 u32 T2;
283 u32 n_addresses;
284 vl_api_dhcp6_address_info_t addresses[n_addresses];
285};
286
Juraj Sloboda81119e82018-05-25 14:02:20 +0200287/** \brief Send DHCPv6 PD client message of specified type
288 @param client_index - opaque cookie to identify the sender
289 @param context - sender context, to match reply w/ request
290 @param sw_if_index - index of TX interface
291 @param server_index - used to dentify DHCPv6 server,
292 unique for each DHCPv6 server on the link,
293 value obrtained from dhcp6_pd_reply_event API message,
294 use ~0 to send message to all DHCPv6 servers
295 @param irt - initial retransmission time
296 @param mrt - maximum retransmission time
297 @param mrc - maximum retransmission count
298 @param mrd - maximum retransmission duration
299 for sending the message
300 @param stop - if non-zero then stop resending the message,
301 otherwise start sending the message
302 @param msg_type - message type
303 @param T1 - value of T1 in IA_PD option
304 @param T2 - value of T2 in IA_PD option
305 @param n_prefixes - number of addresses in IA_PD option
306 @param prefixes - list of prefixes in IA_PD option
307*/
308autoreply define dhcp6_pd_send_client_message
309{
310 u32 client_index;
311 u32 context;
312 u32 sw_if_index;
313 u32 server_index;
314 u32 irt;
315 u32 mrt;
316 u32 mrc;
317 u32 mrd;
318 u8 stop;
319 u8 msg_type;
320 u32 T1;
321 u32 T2;
322 u32 n_prefixes;
323 vl_api_dhcp6_pd_prefix_info_t prefixes[n_prefixes];
324};
325
326service {
Juraj Slobodadd3b8f72018-05-04 14:20:06 +0200327 rpc want_dhcp6_reply_events returns want_dhcp6_reply_events_reply
328 events dhcp6_reply_event;
329};
330
331service {
Juraj Sloboda81119e82018-05-25 14:02:20 +0200332 rpc want_dhcp6_pd_reply_events returns want_dhcp6_pd_reply_events_reply
333 events dhcp6_pd_reply_event;
334};
335
Juraj Slobodadd3b8f72018-05-04 14:20:06 +0200336/** \brief Register for DHCPv6 reply events
337 @param client_index - opaque cookie to identify the sender
338 @param context - sender context, to match reply w/ request
339 @param enable_disable - 1 => register for events, 0 => cancel registration
340 @param pid - sender's pid
341*/
342autoreply define want_dhcp6_reply_events
343{
344 u32 client_index;
345 u32 context;
346 u8 enable_disable;
347 u32 pid;
348};
349
Juraj Sloboda81119e82018-05-25 14:02:20 +0200350/** \brief Register for DHCPv6 PD reply events
351 @param client_index - opaque cookie to identify the sender
352 @param context - sender context, to match reply w/ request
353 @param enable_disable - 1 => register for events, 0 => cancel registration
354 @param pid - sender's pid
355*/
356autoreply define want_dhcp6_pd_reply_events
357{
358 u32 client_index;
359 u32 context;
360 u8 enable_disable;
361 u32 pid;
362};
363
Juraj Slobodadd3b8f72018-05-04 14:20:06 +0200364/** \brief Tell client about a DHCPv6 server reply event
365 @param client_index - opaque cookie to identify the sender
366 @param pid - client pid registered to receive notification
367 @param sw_if_index - index of RX interface, also identifies IAID
368 @param server_index - used to dentify DHCPv6 server,
369 unique for each DHCPv6 server on the link
370 @param msg_type - message type
371 @param T1 - value of T1 in IA_NA option
372 @param T2 - value of T2 in IA_NA option
373 @param inner_status_code - value of status code inside IA_NA option
374 @param status_code - value of status code
375 @param preference - value of preference option in reply message
376 @param n_addresses - number of addresses in IA_NA option
377 @param addresses - list of addresses in IA_NA option
378*/
379define dhcp6_reply_event
380{
381 u32 client_index;
382 u32 pid;
383 u32 sw_if_index;
384 u32 server_index;
385 u8 msg_type;
386 u32 T1;
387 u32 T2;
388 u16 inner_status_code;
389 u16 status_code;
390 u8 preference;
391 u32 n_addresses;
392 vl_api_dhcp6_address_info_t addresses[n_addresses];
393};
394
Juraj Sloboda81119e82018-05-25 14:02:20 +0200395/** \brief Tell client about a DHCPv6 PD server reply event
396 @param client_index - opaque cookie to identify the sender
397 @param pid - client pid registered to receive notification
398 @param sw_if_index - index of RX interface
399 @param server_index - used to dentify DHCPv6 server,
400 unique for each DHCPv6 server on the link
401 @param msg_type - message type
402 @param T1 - value of T1 in IA_PD option
403 @param T2 - value of T2 in IA_PD option
404 @param inner_status_code - value of status code inside IA_PD option
405 @param status_code - value of the main status code of DHCPv6 message
406 @param preference - value of preference option in reply message
407 @param n_prefixes - number of prefixes in IA_PD option
408 @param prefixes - list of prefixes in IA_PD option
409*/
410define dhcp6_pd_reply_event
411{
412 u32 client_index;
413 u32 pid;
414 u32 sw_if_index;
415 u32 server_index;
416 u8 msg_type;
417 u32 T1;
418 u32 T2;
419 u16 inner_status_code;
420 u16 status_code;
421 u8 preference;
422 u32 n_prefixes;
423 vl_api_dhcp6_pd_prefix_info_t prefixes[n_prefixes];
424};
425
Pavel Kotucekc8d87702017-01-25 07:25:32 +0100426/*
427 * Local Variables:
428 * eval: (c-set-style "gnu")
429 * End:
Dave Barach11b8dbf2017-04-24 10:46:54 -0400430 */