map.api revision 7b2e9fb1
1/*
2 * Copyright (c) 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
16option version = "4.1.0";
17
18import "vnet/ip/ip_types.api";
19
20/** \brief Add MAP domains
21    @param client_index - opaque cookie to identify the sender
22    @param context - sender context, to match reply w/ request
23    @param ip6_prefix - Rule IPv6 prefix
24    @param ip4_prefix - Rule IPv4 prefix
25    @param ip6_src - MAP domain IPv6 BR address / Tunnel source
26    @param ea_bits_len - Embedded Address bits length
27    @param psid_offset - Port Set Identifier (PSID) offset
28    @param psid_length - PSID length
29    @param mtu - MTU
30    @param tag - A user field stored with the MAP
31*/
32define map_add_domain
33{
34  u32 client_index;
35  u32 context;
36  vl_api_ip6_prefix_t ip6_prefix;
37  vl_api_ip4_prefix_t ip4_prefix;
38  vl_api_ip6_prefix_t ip6_src;
39  u8 ea_bits_len;
40  u8 psid_offset;
41  u8 psid_length;
42  u16 mtu;
43  string tag[64];
44};
45
46/** \brief Reply for MAP domain add
47    @param context - returned sender context, to match reply w/ request
48    @param index - MAP domain index
49    @param retval - return code
50*/
51define map_add_domain_reply
52{
53  u32 context;
54  u32 index;
55  i32 retval;
56};
57
58/** \brief Delete MAP domain
59    @param client_index - opaque cookie to identify the sender
60    @param context - sender context, to match reply w/ request
61    @param index - MAP Domain index
62*/
63autoreply define map_del_domain
64{
65  u32 client_index;
66  u32 context;
67  u32 index;
68};
69
70
71/** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
72    @param client_index - opaque cookie to identify the sender
73    @param context - sender context, to match reply w/ request
74    @param index - MAP Domain index
75    @param is_add - If 1 add rule, if 0 delete rule
76    @param ip6_dst - MAP CE IPv6 address
77    @param psid - Rule PSID
78*/
79autoreply define map_add_del_rule
80{
81  u32 client_index;
82  u32 context;
83  u32 index;
84  bool is_add;
85  vl_api_ip6_address_t ip6_dst;
86  u16 psid;
87};
88
89
90/** \brief Get list of map domains
91    @param client_index - opaque cookie to identify the sender
92*/
93define map_domain_dump
94{
95  u32 client_index;
96  u32 context;
97};
98
99/** \brief Details about a single MAP domain
100    @param context - returned sender context, to match reply w/ request
101    @param domain_index - MAP domain index
102    @param ip6_prefix - Rule IPv6 prefix
103    @param ip4_prefix - Rule IPv4 prefix
104    @param ip6_src - MAP domain IPv6 BR address / Tunnel source
105    @param ea_bits_len - Embedded Address bits length
106    @param psid_offset - Port Set Identifier (PSID) offset
107    @param psid_length - PSID length
108    @param flags -
109    @param mtu - MTU
110    @param tag - The user field stored with the MAP at creation time
111*/
112define map_domain_details
113{
114  u32 context;
115  u32 domain_index;
116  vl_api_ip6_prefix_t ip6_prefix;
117  vl_api_ip4_prefix_t ip4_prefix;
118  vl_api_ip6_prefix_t ip6_src;
119  u8 ea_bits_len;
120  u8 psid_offset;
121  u8 psid_length;
122  u8 flags;
123  u16 mtu;
124  string tag[64];
125};
126
127define map_rule_dump
128{
129  u32 client_index;
130  u32 context;
131  u32 domain_index;
132};
133
134define map_rule_details
135{
136  u32 context;
137  vl_api_ip6_address_t ip6_dst;
138  u16 psid;
139};
140
141/** \brief Enable or disable a MAP interface
142    @param client_index - opaque cookie to identify the sender
143    @param context - sender context, to match reply w/ request
144    @param sw_if_index - 
145    @param is_enable - 0=disable, 1=enable interface
146    @param is_translation -  0=encapsulation, 1=translation
147*/
148autoreply define map_if_enable_disable
149{
150  u32 client_index;
151  u32 context;
152  u32 sw_if_index;
153  bool is_enable;
154  bool is_translation; /* 0 - encapsulation, 1 - translation */
155};
156
157/** \brief Request for a single block of summary stats
158    @param client_index - opaque cookie to identify the sender
159    @param context - sender context, to match reply w/ request
160*/
161define map_summary_stats
162{
163  u32 client_index;
164  u32 context;
165};
166
167/** \brief Reply for map_summary_stats request
168    @param context - sender context, to match reply w/ request
169    @param retval - return code for request
170    @param total_bindings -
171    @param total_pkts -
172    @param total_ip4_fragments -
173    @param total_security_check -
174*/
175define map_summary_stats_reply
176{
177  u32 context;
178  i32 retval;
179  u64 total_bindings;
180  u64 total_pkts[2];
181  u64 total_bytes[2];
182  u64 total_ip4_fragments;
183  u64 total_security_check[2];
184};
185
186
187/** \brief Set MAP fragmentation parameters
188    @param client_index - opaque cookie to identify the sender
189    @param context - sender context, to match reply w/ request
190    @param inner - 1=frag inner packet, 0=frag tunnel packets
191    @param ignore_df - 1=IP4 fragment despite DF bit, 0=honor DF
192*/
193autoreply define map_param_set_fragmentation
194{
195  u32 client_index;
196  u32 context;
197  bool inner;
198  bool ignore_df;
199};
200
201
202/** \brief Set MAP ICMP parameters
203    @param client_index - opaque cookie to identify the sender
204    @param context - sender context, to match reply w/ request
205    @param icmp4_err_relay_src - IPv4 ICMP err relay src address
206*/
207autoreply define map_param_set_icmp
208{
209  u32 client_index;
210  u32 context;
211  vl_api_ip4_address_t ip4_err_relay_src;
212};
213
214
215/** \brief Set MAP ICMP6 parameters
216    @param client_index - opaque cookie to identify the sender
217    @param context - sender context, to match reply w/ request
218    @param enable_unreachable - 1 = send ICMP unreachable err msgs
219*/
220autoreply define map_param_set_icmp6
221{
222  u32 client_index;
223  u32 context;
224  bool enable_unreachable;
225};
226
227
228/** \brief Add/delete MAP pre-resolve IP addresses parameters
229    @param client_index - opaque cookie to identify the sender
230    @param context - sender context, to match reply w/ request
231    @param is_add - 1 = Add non-zero IP addresses, 0 = delete
232    @param ip4_nh_address - direct IP4 next-hop address
233    @param ip6_nh_address - direct IP6 next-hop address
234*/
235autoreply define map_param_add_del_pre_resolve
236{
237  u32 client_index;
238  u32 context;
239  bool is_add;
240  vl_api_ip4_address_t ip4_nh_address;
241  vl_api_ip6_address_t ip6_nh_address;
242};
243
244/** \brief Set MAP security-check parameters
245    @param client_index - opaque cookie to identify the sender
246    @param context - sender context, to match reply w/ request
247    @param enable - 1=enable security check on first inbound packet
248    @param fragments - 1=enable check on (subsequent) fragments too
249*/
250autoreply define map_param_set_security_check
251{
252  u32 client_index;
253  u32 context;
254  bool enable;
255  bool fragments;
256};
257
258
259/** \brief Set MAP traffic class parameters
260    @param client_index - opaque cookie to identify the sender
261    @param context - sender context, to match reply w/ request
262    @param copy - 1 = copy packet class/TOS field, 0 = use tc_class instead
263    @param tc_class - class field value when copy == 0
264*/
265autoreply define map_param_set_traffic_class
266{
267  u32 client_index;
268  u32 context;
269  bool copy;
270  u8 tc_class;
271};
272
273
274/** \brief Set MAP TCP parameters
275    @param client_index - opaque cookie to identify the sender
276    @param context - sender context, to match reply w/ request
277    @parma tcp_mss - TCP MSS clamping value
278*/
279autoreply define map_param_set_tcp
280{
281  u32 client_index;
282  u32 context;
283  u16 tcp_mss;
284};
285
286
287/** \brief Request for a single block of MAP parameters
288    @param client_index - opaque cookie to identify the sender
289    @param context - sender context, to match reply w/ request
290*/
291define map_param_get
292{
293  u32 client_index;
294  u32 context;
295};
296
297
298/** \brief Reply for map_param_get request
299    @param context - sender context, to match reply w/ request
300    @param retval - return code for request
301    @param inner - 1=frag inner packet, 0=frag tunnel packets, ~0=untouched
302    @param ignore_df - 1=IP4 fragm despite DF bit, 0=honor DF, ~0=untouched
303    @param icmp_ip4_err_relay_src - IPv4 ICMP err relay src address
304    @param icmp6_enable_unreachable - 1 = send ICMP unreachable err msgs
305    @param ip4_nh_address - direct IP4 next-hop address
306    @param ip6_nh_address - direct IP6 next-hop address
307    @param sec_check_enable - 1=enable security check on first inbound packet
308    @param sec_check_fragments - 1=enable check on (subsequent) fragments too
309    @param tc_copy - 1 = copy packet class/TOS field, 0 = use class instead
310    @param tc_class - class field value when copy == 0
311*/
312define map_param_get_reply
313{
314  u32 context;
315  i32 retval;
316  u8 frag_inner;
317  u8 frag_ignore_df;
318  vl_api_ip4_address_t icmp_ip4_err_relay_src;
319  bool icmp6_enable_unreachable;
320  vl_api_ip4_address_t ip4_nh_address;
321  vl_api_ip6_address_t ip6_nh_address;
322  u16 ip4_lifetime_ms;
323  u16 ip4_pool_size;
324  u32 ip4_buffers;
325  f64 ip4_ht_ratio;
326  bool sec_check_enable;
327  bool sec_check_fragments;
328  bool tc_copy;
329  u8 tc_class;
330};
331