aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dhcp/dhcp.api
blob: c84b36391039e671126f9d788c65898b4fc0cc65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
/*
 * Copyright (c) 2015-2016 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "2.0.1";

import "vnet/ip/ip_types.api";

/** \brief DHCP Proxy config add / del request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param rx_vrf_id - Rx/interface vrf id
    @param server_vrf_id - server vrf id
    @param if_ipv6 - ipv6 if non-zero, else ipv4
    @param is_add - add the config if non-zero, else delete
    @param insert_circuit_id - option82 suboption 1 fib number
    @param dhcp_server[] - server address
    @param dhcp_src_address[] - <fix this, need details>
*/
autoreply define dhcp_proxy_config
{
  u32 client_index;
  u32 context;
  u32 rx_vrf_id;
  u32 server_vrf_id;
  u8 is_ipv6;
  u8 is_add;
  u8 dhcp_server[16];
  u8 dhcp_src_address[16];
};

/** \brief DHCP Proxy set / unset vss request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param tbl_id - table id
    @vss_type - 0: use ASCI vpn_id; 1: use oui/vpn_index; 255: global vpn
    @vpn_ascii - null terminated ASCII VPN ID up to 128 characters
    @param oui - first part of rfc2685 vpn id, 3 bytes oui 
    @param vpn_index - second part of rfc2685 vpn id, 4 bytes vpn index
    @param is_ipv6 - ip6 if non-zero, else ip4
    @param is_add - set vss if non-zero, else delete
*/
autoreply define dhcp_proxy_set_vss
{
  u32 client_index;
  u32 context;
  u32 tbl_id;
  u8 vss_type;
  u8 vpn_ascii_id[129];
  u32 oui;
  u32 vpn_index;
  u8 is_ipv6;
  u8 is_add;
};

/** \brief DHCP Client config data
    @param sw_if_index - index of the interface for DHCP client
    @param hostname - hostname
    @param id - Client ID - option 61
    @param want_dhcp_event - DHCP event sent to the sender
           via dhcp_compl_event API message if non-zero
    @param set_broadcast_flag - in the DHCP Discover to control
                                how the resulting OFFER is addressed.
    @param dscp - DSCP value set in IP packets sent by the client
    @param pid - sender's pid
*/
typedef dhcp_client
{
  u32 sw_if_index;
  u8 hostname[64];
  u8 id[64];
  u8 want_dhcp_event;
  u8 set_broadcast_flag;
  vl_api_ip_dscp_t dscp;
  u32 pid;
};

/** \brief DHCP Client config add / del request
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add the config if non-zero, else delete
    @param client - client configuration data
*/
autoreply define dhcp_client_config
{
  u32 client_index;
  u32 context;
  u8 is_add;
  vl_api_dhcp_client_t client;
};

/** \brief Struct representing domain server
    @param address - IP address
*/
typedef domain_server
{
  u8 address[16];
};

/** \brief Data learned by the client during the DHCP process
    @param sw_if_index - the interface on which the client is configured
    @param state - the state of the lease (see dhcp_client_state_t)
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param mask_width - The length of the subnet mask assigned
    @param host_address - Host IP address
    @param router_address - Router IP address
    @param host_mac - Host MAC address
*/
typedef dhcp_lease
{
  u32 sw_if_index;
  u8 state;
  u8 hostname[64];
  u8 is_ipv6;
  u8 mask_width;
  u8 host_address[16];
  u8 router_address[16];
  u8 host_mac[6];
  u8 count;
  vl_api_domain_server_t domain_server[count];
};

/** \brief Tell client about a DHCP completion event
    @param client_index - opaque cookie to identify the sender
    @param pid - client pid registered to receive notification
    @param lease - Data learned during the DHCP process;
*/
define dhcp_compl_event
{
  u32 client_index;
  u32 pid;
  vl_api_dhcp_lease_t lease;
};

service {
  rpc dhcp_client_config returns dhcp_client_config_reply events dhcp_compl_event;
};

/** \brief Dump the DHCP client configurations
 */
define dhcp_client_dump
{
  u32 client_index;
  u32 context;
};

/** \brief DHCP Client details returned from dump
 *  @param client - The configured client
 *  @param lease - The learned lease data
 */
define dhcp_client_details
{
  u32 context;
  vl_api_dhcp_client_t client;
  vl_api_dhcp_lease_t lease;
};

/** \brief Dump DHCP proxy table
    @param client_index - opaque cookie to identify the sender
    @param True for IPv6 proxy table
*/
define dhcp_proxy_dump
{
  u32 client_index;
  u32 context;
  u8  is_ip6;
};

typedef dhcp_server
{
  u32 server_vrf_id;
  u8 dhcp_server[16];
};

/** \brief Tell client about a DHCP completion event
    @param client_index - opaque cookie to identify the sender
*/
manual_endian manual_print define dhcp_proxy_details
{
  u32 context;
  u32 rx_vrf_id;
  u32 vss_oui;
  u32 vss_fib_id;
  u8 vss_type;
  u8 vss_vpn_ascii_id[129];
  u8 is_ipv6;
  u8 dhcp_src_address[16];
  u8 count;
  vl_api_dhcp_server_t servers[count];
};

/** \brief Set DHCPv6 DUID-LL
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param duid_ll - DUID-LL binary string
*/
autoreply define dhcp6_duid_ll_set
{
  u32 client_index;
  u32 context;
  u8 duid_ll[10];
};

/** \brief Enable/disable listening on DHCPv6 client port
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
autoreply define dhcp6_clients_enable_disable
{
  u32 client_index;
  u32 context;
  u8 enable;
};

/** \brief Struct representing DHCPv6 address
    @param address - address
    @param valid_time - valid lifetime
    @param preferred_time - preferred lifetime
*/
typedef dhcp6_address_info
{
  u8 address[16];
  u32 valid_time;
  u32 preferred_time;
};

/** \brief Struct representing DHCPv6 PD prefix
    @param prefix - prefix
    @param prefix_length - prefix length
    @param valid_time - valid lifetime
    @param preferred_time - preferred lifetime
*/
typedef dhcp6_pd_prefix_info
{
  u8 prefix[16];
  u8 prefix_length;
  u32 valid_time;
  u32 preferred_time;
};

/** \brief Send DHCPv6 client message of specified type
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - index of TX interface, also identifies IAID
    @param server_index - used to dentify DHCPv6 server,
                          unique for each DHCPv6 server on the link,
                          value obrtained from dhcp6_reply_event API message,
                          use ~0 to send message to all DHCPv6 servers
    @param irt - initial retransmission time
    @param mrt - maximum retransmission time
    @param mrc - maximum retransmission count
    @param mrd - maximum retransmission duration
                         for sending the message
    @param stop - if non-zero then stop resending the message,
                  otherwise start sending the message
    @param msg_type - message type
    @param T1 - value of T1 in IA_NA option
    @param T2 - value of T2 in IA_NA option
    @param n_addresses - number of addresses in IA_NA option
    @param addresses - list of addresses in IA_NA option
*/
autoreply define dhcp6_send_client_message
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u32 server_index;
  u32 irt;
  u32 mrt;
  u32 mrc;
  u32 mrd;
  u8 stop;
  u8 msg_type;
  u32 T1;
  u32 T2;
  u32 n_addresses;
  vl_api_dhcp6_address_info_t addresses[n_addresses];
};

/** \brief Send DHCPv6 PD client message of specified type
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - index of TX interface
    @param server_index - used to dentify DHCPv6 server,
                          unique for each DHCPv6 server on the link,
                          value obrtained from dhcp6_pd_reply_event API message,
                          use ~0 to send message to all DHCPv6 servers
    @param irt - initial retransmission time
    @param mrt - maximum retransmission time
    @param mrc - maximum retransmission count
    @param mrd - maximum retransmission duration
                         for sending the message
    @param stop - if non-zero then stop resending the message,
                  otherwise start sending the message
    @param msg_type - message type
    @param T1 - value of T1 in IA_PD option
    @param T2 - value of T2 in IA_PD option
    @param n_prefixes - number of addresses in IA_PD option
    @param prefixes - list of prefixes in IA_PD option
*/
autoreply define dhcp6_pd_send_client_message
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  u32 server_index;
  u32 irt;
  u32 mrt;
  u32 mrc;
  u32 mrd;
  u8 stop;
  u8 msg_type;
  u32 T1;
  u32 T2;
  u32 n_prefixes;
  vl_api_dhcp6_pd_prefix_info_t prefixes[n_prefixes];
};

service {
  rpc want_dhcp6_reply_events returns want_dhcp6_reply_events_reply
    events dhcp6_reply_event;
};

service {
  rpc want_dhcp6_pd_reply_events returns want_dhcp6_pd_reply_events_reply
    events dhcp6_pd_reply_event;
};

/** \brief Register for DHCPv6 reply events
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable_disable - 1 => register for events, 0 => cancel registration
    @param pid - sender's pid
*/
autoreply define want_dhcp6_reply_events
{
  u32 client_index;
  u32 context;
  u8 enable_disable;
  u32 pid;
};

/** \brief Register for DHCPv6 PD reply events
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable_disable - 1 => register for events, 0 => cancel registration
    @param pid - sender's pid
*/
autoreply define want_dhcp6_pd_reply_events
{
  u32 client_index;
  u32 context;
  u8 enable_disable;
  u32 pid;
};

/** \brief Tell client about a DHCPv6 server reply event
    @param client_index - opaque cookie to identify the sender
    @param pid - client pid registered to receive notification
    @param sw_if_index - index of RX interface, also identifies IAID
    @param server_index - used to dentify DHCPv6 server,
                          unique for each DHCPv6 server on the link
    @param msg_type - message type
    @param T1 - value of T1 in IA_NA option
    @param T2 - value of T2 in IA_NA option
    @param inner_status_code - value of status code inside IA_NA option
    @param status_code - value of status code
    @param preference - value of preference option in reply message
    @param n_addresses - number of addresses in IA_NA option
    @param addresses - list of addresses in IA_NA option
*/
define dhcp6_reply_event
{
  u32 client_index;
  u32 pid;
  u32 sw_if_index;
  u32 server_index;
  u8 msg_type;
  u32 T1;
  u32 T2;
  u16 inner_status_code;
  u16 status_code;
  u8 preference;
  u32 n_addresses;
  vl_api_dhcp6_address_info_t addresses[n_addresses];
};

/** \brief Tell client about a DHCPv6 PD server reply event
    @param client_index - opaque cookie to identify the sender
    @param pid - client pid registered to receive notification
    @param sw_if_index - index of RX interface
    @param server_index - used to dentify DHCPv6 server,
                          unique for each DHCPv6 server on the link
    @param msg_type - message type
    @param T1 - value of T1 in IA_PD option
    @param T2 - value of T2 in IA_PD option
    @param inner_status_code - value of status code inside IA_PD option
    @param status_code - value of the main status code of DHCPv6 message
    @param preference - value of preference option in reply message
    @param n_prefixes - number of prefixes in IA_PD option
    @param prefixes - list of prefixes in IA_PD option
*/
define dhcp6_pd_reply_event
{
  u32 client_index;
  u32 pid;
  u32 sw_if_index;
  u32 server_index;
  u8 msg_type;
  u32 T1;
  u32 T2;
  u16 inner_status_code;
  u16 status_code;
  u8 preference;
  u32 n_prefixes;
  vl_api_dhcp6_pd_prefix_info_t prefixes[n_prefixes];
};

/*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */