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:
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.
16 option version = "3.0.1";
18 import "vnet/interface_types.api";
19 import "vnet/ip/ip_types.api";
20 import "vnet/ethernet/ethernet_types.api";
23 VSS_TYPE_API_ASCII = 0,
24 VSS_TYPE_API_VPN_ID = 1,
25 VSS_TYPE_API_INVALID = 123,
26 VSS_TYPE_API_DEFAULT = 255,
29 enum dhcp_client_state {
30 DHCP_CLIENT_STATE_API_DISCOVER,
31 DHCP_CLIENT_STATE_API_REQUEST,
32 DHCP_CLIENT_STATE_API_BOUND,
37 DHCPV6_MSG_API_SOLICIT = 1,
38 DHCPV6_MSG_API_ADVERTISE = 2,
39 DHCPV6_MSG_API_REQUEST = 3,
40 DHCPV6_MSG_API_CONFIRM = 4,
41 DHCPV6_MSG_API_RENEW = 5,
42 DHCPV6_MSG_API_REBIND = 6,
43 DHCPV6_MSG_API_REPLY = 7,
44 DHCPV6_MSG_API_RELEASE = 8,
45 DHCPV6_MSG_API_DECLINE = 9,
46 DHCPV6_MSG_API_RECONFIGURE = 10,
47 DHCPV6_MSG_API_INFORMATION_REQUEST = 11,
48 DHCPV6_MSG_API_RELAY_FORW = 12,
49 DHCPV6_MSG_API_RELAY_REPL = 13,
52 /** \brief Get the plugin version
53 @param client_index - opaque cookie to identify the sender
54 @param context - sender context, to match reply w/ request
57 define dhcp_plugin_get_version
63 /** \brief Reply to get the plugin version
64 @param context - returned sender context, to match reply w/ request
65 @param major - Incremented every time a known breaking behavior change is introduced
66 @param minor - Incremented with small changes, may be used to avoid buggy versions
69 define dhcp_plugin_get_version_reply
76 /** \brief Control ping from client to api server request
77 @param client_index - opaque cookie to identify the sender
78 @param context - sender context, to match reply w/ request
80 define dhcp_plugin_control_ping
86 /** \brief Control ping from the client to the server response
87 @param client_index - opaque cookie to identify the sender
88 @param context - sender context, to match reply w/ request
89 @param retval - return code for the request
90 @param vpe_pid - the pid of the vpe, returned by the server
92 define dhcp_plugin_control_ping_reply
100 /** \brief DHCP Proxy config add / del request
101 @param client_index - opaque cookie to identify the sender
102 @param context - sender context, to match reply w/ request
103 @param rx_vrf_id - Rx/interface vrf id
104 @param server_vrf_id - server vrf id
105 @param is_add - add the config if non-zero, else delete
106 @param insert_circuit_id - option82 suboption 1 fib number
107 @param dhcp_server[] - server address
108 @param dhcp_src_address[] - <fix this, need details>
110 autoreply define dhcp_proxy_config
117 vl_api_address_t dhcp_server;
118 vl_api_address_t dhcp_src_address;
121 /** \brief DHCP Proxy set / unset vss request
122 @param client_index - opaque cookie to identify the sender
123 @param context - sender context, to match reply w/ request
124 @param tbl_id - table id
125 @vss_type - 0: use ASCI vpn_id; 1: use oui/vpn_index; 255: global vpn
126 @vpn_ascii - null terminated ASCII VPN ID up to 128 characters
127 @param oui - first part of rfc2685 vpn id, 3 bytes oui
128 @param vpn_index - second part of rfc2685 vpn id, 4 bytes vpn index
129 @param is_ipv6 - ip6 if non-zero, else ip4
130 @param is_add - set vss if non-zero, else delete
132 autoreply define dhcp_proxy_set_vss
137 vl_api_vss_type_t vss_type;
138 string vpn_ascii_id[129];
145 /** \brief DHCP Client config data
146 @param sw_if_index - index of the interface for DHCP client
147 @param hostname - hostname
148 @param id - Client ID - option 61
149 @param want_dhcp_event - DHCP event sent to the sender
150 via dhcp_compl_event API message if non-zero
151 @param set_broadcast_flag - in the DHCP Discover to control
152 how the resulting OFFER is addressed.
153 @param dscp - DSCP value set in IP packets sent by the client
154 @param pid - sender's pid
158 vl_api_interface_index_t sw_if_index;
161 bool want_dhcp_event;
162 bool set_broadcast_flag;
163 vl_api_ip_dscp_t dscp;
167 /** \brief DHCP Client config add / del request
168 @param client_index - opaque cookie to identify the sender
169 @param context - sender context, to match reply w/ request
170 @param is_add - add the config if non-zero, else delete
171 @param client - client configuration data
173 autoreply define dhcp_client_config
178 vl_api_dhcp_client_t client;
181 /** \brief Struct representing domain server
182 @param address - IP address
184 typedef domain_server
186 vl_api_address_t address;
189 /** \brief Data learned by the client during the DHCP process
190 @param sw_if_index - the interface on which the client is configured
191 @param state - the state of the lease
192 @param is_ipv6 - if non-zero the address is ipv6, else ipv4
193 @param mask_width - The length of the subnet mask assigned
194 @param host_address - Host IP address
195 @param router_address - Router IP address
196 @param host_mac - Host MAC address
200 vl_api_interface_index_t sw_if_index;
201 vl_api_dhcp_client_state_t state;
205 vl_api_address_t host_address;
206 vl_api_address_t router_address;
207 vl_api_mac_address_t host_mac;
209 vl_api_domain_server_t domain_server[count];
212 /** \brief Tell client about a DHCP completion event
213 @param client_index - opaque cookie to identify the sender
214 @param pid - client pid registered to receive notification
215 @param lease - Data learned during the DHCP process;
217 define dhcp_compl_event
221 vl_api_dhcp_lease_t lease;
225 rpc dhcp_client_config returns dhcp_client_config_reply events dhcp_compl_event;
228 /** \brief Dump the DHCP client configurations
230 define dhcp_client_dump
236 /** \brief DHCP Client details returned from dump
237 * @param client - The configured client
238 * @param lease - The learned lease data
240 define dhcp_client_details
243 vl_api_dhcp_client_t client;
244 vl_api_dhcp_lease_t lease;
247 /** \brief Dump DHCP proxy table
248 @param client_index - opaque cookie to identify the sender
249 @param True for IPv6 proxy table
251 define dhcp_proxy_dump
261 vl_api_address_t dhcp_server;
264 /** \brief Tell client about a DHCP completion event
265 @param client_index - opaque cookie to identify the sender
267 manual_endian manual_print define dhcp_proxy_details
273 vl_api_vss_type_t vss_type;
275 string vss_vpn_ascii_id[129];
276 vl_api_address_t dhcp_src_address;
278 vl_api_dhcp_server_t servers[count];
281 /** \brief Set DHCPv6 DUID-LL
282 @param client_index - opaque cookie to identify the sender
283 @param context - sender context, to match reply w/ request
284 @param duid_ll - DUID-LL binary string
286 autoreply define dhcp6_duid_ll_set
293 /** \brief Enable/disable listening on DHCPv6 client port
294 @param client_index - opaque cookie to identify the sender
295 @param context - sender context, to match reply w/ request
297 autoreply define dhcp6_clients_enable_disable
304 /** \brief Struct representing DHCPv6 address
305 @param address - address
306 @param valid_time - valid lifetime
307 @param preferred_time - preferred lifetime
309 typedef dhcp6_address_info
311 vl_api_ip6_address_t address;
316 /** \brief Struct representing DHCPv6 PD prefix
317 @param prefix - prefix
318 @param valid_time - valid lifetime
319 @param preferred_time - preferred lifetime
321 typedef dhcp6_pd_prefix_info
323 vl_api_ip6_prefix_t prefix;
328 /** \brief Send DHCPv6 client message of specified type
329 @param client_index - opaque cookie to identify the sender
330 @param context - sender context, to match reply w/ request
331 @param sw_if_index - index of TX interface, also identifies IAID
332 @param server_index - used to dentify DHCPv6 server,
333 unique for each DHCPv6 server on the link,
334 value obrtained from dhcp6_reply_event API message,
335 use ~0 to send message to all DHCPv6 servers
336 @param irt - initial retransmission time
337 @param mrt - maximum retransmission time
338 @param mrc - maximum retransmission count
339 @param mrd - maximum retransmission duration
340 for sending the message
341 @param stop - if non-zero then stop resending the message,
342 otherwise start sending the message
343 @param msg_type - message type
344 @param T1 - value of T1 in IA_NA option
345 @param T2 - value of T2 in IA_NA option
346 @param n_addresses - number of addresses in IA_NA option
347 @param addresses - list of addresses in IA_NA option
349 autoreply define dhcp6_send_client_message
353 vl_api_interface_index_t sw_if_index;
360 vl_api_dhcpv6_msg_type_t msg_type;
364 vl_api_dhcp6_address_info_t addresses[n_addresses];
367 /** \brief Send DHCPv6 PD client message of specified type
368 @param client_index - opaque cookie to identify the sender
369 @param context - sender context, to match reply w/ request
370 @param sw_if_index - index of TX interface
371 @param server_index - used to dentify DHCPv6 server,
372 unique for each DHCPv6 server on the link,
373 value obrtained from dhcp6_pd_reply_event API message,
374 use ~0 to send message to all DHCPv6 servers
375 @param irt - initial retransmission time
376 @param mrt - maximum retransmission time
377 @param mrc - maximum retransmission count
378 @param mrd - maximum retransmission duration
379 for sending the message
380 @param stop - if non-zero then stop resending the message,
381 otherwise start sending the message
382 @param msg_type - message type
383 @param T1 - value of T1 in IA_PD option
384 @param T2 - value of T2 in IA_PD option
385 @param n_prefixes - number of addresses in IA_PD option
386 @param prefixes - list of prefixes in IA_PD option
388 autoreply define dhcp6_pd_send_client_message
392 vl_api_interface_index_t sw_if_index;
399 vl_api_dhcpv6_msg_type_t msg_type;
403 vl_api_dhcp6_pd_prefix_info_t prefixes[n_prefixes];
407 rpc want_dhcp6_reply_events returns want_dhcp6_reply_events_reply
408 events dhcp6_reply_event;
412 rpc want_dhcp6_pd_reply_events returns want_dhcp6_pd_reply_events_reply
413 events dhcp6_pd_reply_event;
416 /** \brief Register for DHCPv6 reply events
417 @param client_index - opaque cookie to identify the sender
418 @param context - sender context, to match reply w/ request
419 @param enable_disable - 1 => register for events, 0 => cancel registration
420 @param pid - sender's pid
422 autoreply define want_dhcp6_reply_events
430 /** \brief Register for DHCPv6 PD reply events
431 @param client_index - opaque cookie to identify the sender
432 @param context - sender context, to match reply w/ request
433 @param enable_disable - 1 => register for events, 0 => cancel registration
434 @param pid - sender's pid
436 autoreply define want_dhcp6_pd_reply_events
444 /** \brief Tell client about a DHCPv6 server reply event
445 @param client_index - opaque cookie to identify the sender
446 @param pid - client pid registered to receive notification
447 @param sw_if_index - index of RX interface, also identifies IAID
448 @param server_index - used to dentify DHCPv6 server,
449 unique for each DHCPv6 server on the link
450 @param msg_type - message type
451 @param T1 - value of T1 in IA_NA option
452 @param T2 - value of T2 in IA_NA option
453 @param inner_status_code - value of status code inside IA_NA option
454 @param status_code - value of status code
455 @param preference - value of preference option in reply message
456 @param n_addresses - number of addresses in IA_NA option
457 @param addresses - list of addresses in IA_NA option
459 define dhcp6_reply_event
463 vl_api_interface_index_t sw_if_index;
465 vl_api_dhcpv6_msg_type_t msg_type;
468 u16 inner_status_code;
472 vl_api_dhcp6_address_info_t addresses[n_addresses];
475 /** \brief Tell client about a DHCPv6 PD server reply event
476 @param client_index - opaque cookie to identify the sender
477 @param pid - client pid registered to receive notification
478 @param sw_if_index - index of RX interface
479 @param server_index - used to dentify DHCPv6 server,
480 unique for each DHCPv6 server on the link
481 @param msg_type - message type
482 @param T1 - value of T1 in IA_PD option
483 @param T2 - value of T2 in IA_PD option
484 @param inner_status_code - value of status code inside IA_PD option
485 @param status_code - value of the main status code of DHCPv6 message
486 @param preference - value of preference option in reply message
487 @param n_prefixes - number of prefixes in IA_PD option
488 @param prefixes - list of prefixes in IA_PD option
490 define dhcp6_pd_reply_event
494 vl_api_interface_index_t sw_if_index;
496 vl_api_dhcpv6_msg_type_t msg_type;
499 u16 inner_status_code;
503 vl_api_dhcp6_pd_prefix_info_t prefixes[n_prefixes];
508 * eval: (c-set-style "gnu")