FD.io VPP  v21.06-1-gbb7418cf9
Vector Packet Processing
map.api
Go to the documentation of this file.
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 
16 option version = "4.2.1";
17 
18 import "vnet/ip/ip_types.api";
19 import "vnet/interface_types.api";
20 
21 /** \brief Add MAP domains
22  @param client_index - opaque cookie to identify the sender
23  @param context - sender context, to match reply w/ request
24  @param ip6_prefix - Rule IPv6 prefix
25  @param ip4_prefix - Rule IPv4 prefix
26  @param ip6_src - MAP domain IPv6 BR address / Tunnel source
27  @param ea_bits_len - Embedded Address bits length
28  @param psid_offset - Port Set Identifier (PSID) offset
29  @param psid_length - PSID length
30  @param mtu - MTU. default 1280
31  @param tag - A user field stored with the MAP
32 */
33 autoendian define map_add_domain
34 {
37  vl_api_ip6_prefix_t ip6_prefix;
38  vl_api_ip4_prefix_t ip4_prefix;
39  vl_api_ip6_prefix_t ip6_src;
43  u16 mtu [default=1280];
44  string tag[64];
45 };
46 
47 /** \brief Reply for MAP domain add
48  @param context - returned sender context, to match reply w/ request
49  @param index - MAP domain index
50  @param retval - return code
51 */
52 define map_add_domain_reply
53 {
57 };
58 
59 /** \brief Delete MAP domain
60  @param client_index - opaque cookie to identify the sender
61  @param context - sender context, to match reply w/ request
62  @param index - MAP Domain index
63 */
64 autoreply define map_del_domain
65 {
69 };
70 
71 
72 /** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
73  @param client_index - opaque cookie to identify the sender
74  @param context - sender context, to match reply w/ request
75  @param index - MAP Domain index
76  @param is_add - If 1 add rule, if 0 delete rule
77  @param ip6_dst - MAP CE IPv6 address
78  @param psid - Rule PSID
79 */
80 autoreply define map_add_del_rule
81 {
85  bool is_add;
86  vl_api_ip6_address_t ip6_dst;
88 };
89 
90 
91 /** \brief Get list of map domains
92  @param client_index - opaque cookie to identify the sender
93 */
95  rpc map_domains_get returns map_domains_get_reply
96  stream map_domain_details;
97 };
98 
99 define map_domains_get
100 {
104 };
105 
106 define map_domains_get_reply
107 {
111 };
112 
113 define map_domain_dump
114 {
115  option deprecated;
118 };
119 
120 /** \brief Details about a single MAP domain
121  @param context - returned sender context, to match reply w/ request
122  @param domain_index - MAP domain index
123  @param ip6_prefix - Rule IPv6 prefix
124  @param ip4_prefix - Rule IPv4 prefix
125  @param ip6_src - MAP domain IPv6 BR address / Tunnel source
126  @param ea_bits_len - Embedded Address bits length
127  @param psid_offset - Port Set Identifier (PSID) offset
128  @param psid_length - PSID length
129  @param flags -
130  @param mtu - MTU
131  @param tag - The user field stored with the MAP at creation time
132 */
133 define map_domain_details
134 {
137  vl_api_ip6_prefix_t ip6_prefix;
138  vl_api_ip4_prefix_t ip4_prefix;
139  vl_api_ip6_prefix_t ip6_src;
145  string tag[64];
146 };
147 
148 define map_rule_dump
149 {
153 };
154 
155 define map_rule_details
156 {
158  vl_api_ip6_address_t ip6_dst;
160 };
161 
162 /** \brief Enable or disable a MAP interface
163  @param client_index - opaque cookie to identify the sender
164  @param context - sender context, to match reply w/ request
165  @param sw_if_index -
166  @param is_enable - 0=disable, 1=enable interface
167  @param is_translation - 0=encapsulation, 1=translation
168 */
169 autoreply define map_if_enable_disable
170 {
173  vl_api_interface_index_t sw_if_index;
174  bool is_enable;
175  bool is_translation; /* 0 - encapsulation, 1 - translation */
176 };
177 
178 /** \brief Request for a single block of summary stats
179  @param client_index - opaque cookie to identify the sender
180  @param context - sender context, to match reply w/ request
181 */
182 define map_summary_stats
183 {
186 };
187 
188 /** \brief Reply for map_summary_stats request
189  @param context - sender context, to match reply w/ request
190  @param retval - return code for request
191  @param total_bindings -
192  @param total_pkts -
193  @param total_ip4_fragments -
194  @param total_security_check -
195 */
196 define map_summary_stats_reply
197 {
201  u64 total_pkts[2];
202  u64 total_bytes[2];
204  u64 total_security_check[2];
205 };
206 
207 
208 /** \brief Set MAP fragmentation parameters
209  @param client_index - opaque cookie to identify the sender
210  @param context - sender context, to match reply w/ request
211  @param inner - 1=frag inner packet, 0=frag tunnel packets
212  @param ignore_df - 1=IP4 fragment despite DF bit, 0=honor DF
213 */
215 {
218  bool inner;
219  bool ignore_df;
220 };
221 
222 
223 /** \brief Set MAP ICMP parameters
224  @param client_index - opaque cookie to identify the sender
225  @param context - sender context, to match reply w/ request
226  @param icmp4_err_relay_src - IPv4 ICMP err relay src address
227 */
228 autoreply define map_param_set_icmp
229 {
232  vl_api_ip4_address_t ip4_err_relay_src;
233 };
234 
235 
236 /** \brief Set MAP ICMP6 parameters
237  @param client_index - opaque cookie to identify the sender
238  @param context - sender context, to match reply w/ request
239  @param enable_unreachable - 1 = send ICMP unreachable err msgs
240 */
241 autoreply define map_param_set_icmp6
242 {
246 };
247 
248 
249 /** \brief Add/delete MAP pre-resolve IP addresses parameters
250  @param client_index - opaque cookie to identify the sender
251  @param context - sender context, to match reply w/ request
252  @param is_add - 1 = Add non-zero IP addresses, 0 = delete
253  @param ip4_nh_address - direct IP4 next-hop address
254  @param ip6_nh_address - direct IP6 next-hop address
255 */
256 autoreply define map_param_add_del_pre_resolve
257 {
260  bool is_add;
261  vl_api_ip4_address_t ip4_nh_address;
262  vl_api_ip6_address_t ip6_nh_address;
263 };
264 
265 /** \brief Set MAP security-check parameters
266  @param client_index - opaque cookie to identify the sender
267  @param context - sender context, to match reply w/ request
268  @param enable - 1=enable security check on first inbound packet
269  @param fragments - 1=enable check on (subsequent) fragments too
270 */
272 {
275  bool enable;
276  bool fragments;
277 };
278 
279 
280 /** \brief Set MAP traffic class parameters
281  @param client_index - opaque cookie to identify the sender
282  @param context - sender context, to match reply w/ request
283  @param copy - 1 = copy packet class/TOS field, 0 = use tc_class instead
284  @param tc_class - class field value when copy == 0
285 */
287 {
290  bool copy;
292 };
293 
294 
295 /** \brief Set MAP TCP parameters
296  @param client_index - opaque cookie to identify the sender
297  @param context - sender context, to match reply w/ request
298  @parma tcp_mss - TCP MSS clamping value
299 */
300 autoreply define map_param_set_tcp
301 {
305 };
306 
307 
308 /** \brief Request for a single block of MAP parameters
309  @param client_index - opaque cookie to identify the sender
310  @param context - sender context, to match reply w/ request
311 */
312 define map_param_get
313 {
316 };
317 
318 
319 /** \brief Reply for map_param_get request
320  @param context - sender context, to match reply w/ request
321  @param retval - return code for request
322  @param inner - 1=frag inner packet, 0=frag tunnel packets, ~0=untouched
323  @param ignore_df - 1=IP4 fragm despite DF bit, 0=honor DF, ~0=untouched
324  @param icmp_ip4_err_relay_src - IPv4 ICMP err relay src address
325  @param icmp6_enable_unreachable - 1 = send ICMP unreachable err msgs
326  @param ip4_nh_address - direct IP4 next-hop address
327  @param ip6_nh_address - direct IP6 next-hop address
328  @param sec_check_enable - 1=enable security check on first inbound packet
329  @param sec_check_fragments - 1=enable check on (subsequent) fragments too
330  @param tc_copy - 1 = copy packet class/TOS field, 0 = use class instead
331  @param tc_class - class field value when copy == 0
332 */
333 define map_param_get_reply
334 {
339  vl_api_ip4_address_t icmp_ip4_err_relay_src;
341  vl_api_ip4_address_t ip4_nh_address;
342  vl_api_ip6_address_t ip6_nh_address;
349  bool tc_copy;
351 };
352 
353 /*
354  * MAP Error counters/messages
355  */
356 counters map {
357  none {
358  severity info;
359  type counter64;
360  units "packets";
361  description "valid MAP packets";
362  };
364  severity error;
366  units "packets";
367  description "bad protocol";
368  };
370  severity error;
371  type counter64;
372  units "packets";
373  description "security check failed";
374  };
376  severity error;
377  type counter64;
378  units "packets";
379  description "encap security check failed";
380  };
382  severity error;
383  type counter64;
384  units "packets";
385  description "decap security check failed";
386  };
388  severity error;
389  type counter64;
390  units "packets";
391  description "unable to translate ICMP";
392  };
394  severity error;
395  type counter64;
396  units "packets";
397  description "unable to relay ICMP";
398  };
400  severity error;
401  type counter64;
402  units "packets";
403  description "unknown";
404  };
406  severity error;
407  type counter64;
408  units "packets";
409  description "no binding";
410  };
412  severity error;
413  type counter64;
414  units "packets";
415  description "no domain";
416  };
418  severity error;
419  type counter64;
420  units "packets";
421  description "packet is a fragment";
422  };
424  severity error;
425  type counter64;
426  units "packets";
427  description "could not cache fragment";
428  };
430  severity error;
431  type counter64;
432  units "packets";
433  description "fragment has unexpected format";
434  };
436  severity error;
437  type counter64;
438  units "packets";
439  description "dropped cached fragment";
440  };
442  severity error;
443  type counter64;
444  units "packets";
445  description "malformed packet";
446  };
448  severity error;
449  type counter64;
450  units "packets";
451  description "can't fragment, DF set";
452  };
454  severity error;
455  type counter64;
456  units "packets";
457  description "time exceeded";
458  };
459 };
461  "/err/ip4-map" "map";
462  "/err/ip6-map" "map";
463  "/err/ip4-t-map" "map";
464  "/err/ip6-t-map" "map";
465 };
int map_param_set_icmp(ip4_address_t *ip4_err_relay_src)
Definition: map_api.c:298
fragment_malformed
Definition: map.api:429
int map_if_enable_disable(bool is_enable, u32 sw_if_index, bool is_translation)
Definition: map_api.c:476
vl_api_ip6_prefix_t ip6_src
Definition: map.api:39
unsigned long u64
Definition: types.h:89
df_set
Definition: map.api:447
vl_api_ip6_prefix_t ip6_src
Definition: map.api:139
icmp_relay
Definition: map.api:393
unsigned char u8
Definition: types.h:56
vl_api_ip6_address_t ip6_dst
Definition: map.api:86
double f64
Definition: types.h:142
unsigned int u32
Definition: types.h:88
vl_api_ip4_prefix_t ip4_prefix
Definition: map.api:38
vl_api_fib_path_type_t type
Definition: fib_types.api:123
Definition: cJSON.c:88
encap_sec_check
Definition: map.api:375
icmp
Definition: map.api:387
int map_param_set_traffic_class(bool copy, u8 tc)
Definition: map_api.c:387
unsigned short u16
Definition: types.h:57
unknown
Definition: map.api:399
vl_api_ip4_address_t ip4_nh_address
Definition: map.api:341
vl_api_ip4_address_t ip4_nh_address
Definition: map.api:261
type counter64
Definition: map.api:365
option version
Definition: map.api:16
vl_api_ip6_prefix_t ip6_prefix
Definition: map.api:137
vl_api_interface_index_t sw_if_index
Definition: map.api:173
service
Get list of map domains.
Definition: map.api:94
no_binding
Definition: map.api:405
vl_api_ip6_address_t ip6_nh_address
Definition: map.api:342
counters map
Definition: map.api:356
int map_param_set_fragmentation(bool inner, bool ignore_df)
Definition: map_api.c:273
vl_api_ip6_address_t ip6_dst
Definition: map.api:158
fragment_dropped
Definition: map.api:435
fragmented
Definition: map.api:417
signed int i32
Definition: types.h:77
vl_api_ip6_address_t ip6_nh_address
Definition: map.api:262
malformed
Definition: map.api:441
fragment_memory
Definition: map.api:423
no_domain
Definition: map.api:411
paths
Definition: map.api:460
int map_param_set_security_check(bool enable, bool fragments)
Definition: map_api.c:362
time_exceeded
Definition: map.api:453
vl_api_ip4_address_t ip4_err_relay_src
Definition: map.api:232
int map_param_set_icmp6(u8 enable_unreachable)
Definition: map_api.c:325
vl_api_ip4_prefix_t ip4_prefix
Definition: map.api:138
decap_sec_check
Definition: map.api:381
sec_check
Definition: map.api:369
vl_api_ip4_address_t icmp_ip4_err_relay_src
Definition: map.api:339
vl_api_ip6_prefix_t ip6_prefix
Definition: map.api:37
int map_param_set_tcp(u16 tcp_mss)
Definition: map_api.c:412
bad_protocol
Definition: map.api:363