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:
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.
17 * @brief VPP control-plane API messages.
19 * This file defines VPP control-plane API messages which are generally
20 * called through a shared memory interface.
23 /** \brief Add/del S-NAT address range
24 @param client_index - opaque cookie to identify the sender
25 @param context - sender context, to match reply w/ request
26 @param is_ip4 - 1 if address type is IPv4
27 @param first_ip_address - first IP address
28 @param last_ip_address - last IP address
29 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
30 @param is_add - 1 if add, 0 if delete
32 autoreply define snat_add_address_range {
36 u8 first_ip_address[16];
37 u8 last_ip_address[16];
42 /** \brief Dump S-NAT addresses
43 @param client_index - opaque cookie to identify the sender
44 @param context - sender context, to match reply w/ request
46 define snat_address_dump {
51 /** \brief S-NAT address details response
52 @param context - sender context, to match reply w/ request
53 @param is_ip4 - 1 if address type is IPv4
54 @param ip_address - IP address
55 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
57 define snat_address_details {
64 /** \brief Enable/disable S-NAT feature on the interface
65 @param client_index - opaque cookie to identify the sender
66 @param context - sender context, to match reply w/ request
67 @param is_add - 1 if add, 0 if delete
68 @param is_inside - 1 if inside, 0 if outside
69 @param sw_if_index - software index of the interface
71 autoreply define snat_interface_add_del_feature {
79 /** \brief Dump interfaces with S-NAT feature
80 @param client_index - opaque cookie to identify the sender
81 @param context - sender context, to match reply w/ request
83 define snat_interface_dump {
88 /** \brief S-NAT interface details response
89 @param context - sender context, to match reply w/ request
90 @param is_inside - 1 if inside, 0 if outside
91 @param sw_if_index - software index of the interface
93 define snat_interface_details {
99 /** \brief Add/delete S-NAT static mapping
100 @param client_index - opaque cookie to identify the sender
101 @param context - sender context, to match reply w/ request
102 @param is_add - 1 if add, 0 if delete
103 @param is_ip4 - 1 if address type is IPv4
104 @param addr_only - 1 if address only mapping
105 @param local_ip_address - local IP address
106 @param external_ip_address - external IP address
107 @param protocol - IP protocol
108 @param local_port - local port number
109 @param external_port - external port number
110 @param external_sw_if_index - external interface (if set
111 external_ip_address is ignored, ~0 means not
113 @param vfr_id - VRF ID
115 autoreply define snat_add_static_mapping {
121 u8 local_ip_address[16];
122 u8 external_ip_address[16];
126 u32 external_sw_if_index;
130 /** \brief Dump S-NAT static mappings
131 @param client_index - opaque cookie to identify the sender
132 @param context - sender context, to match reply w/ request
134 define snat_static_mapping_dump {
139 /** \brief S-NAT static mapping details response
140 @param context - sender context, to match reply w/ request
141 @param is_ip4 - 1 if address type is IPv4
142 @param addr_only - 1 if address only mapping
143 @param local_ip_address - local IP address
144 @param external_ip_address - external IP address
145 @param protocol - IP protocol
146 @param local_port - local port number
147 @param external_port - external port number
148 @param external_sw_if_index - external interface
149 @param vfr_id - VRF ID
151 define snat_static_mapping_details {
155 u8 local_ip_address[16];
156 u8 external_ip_address[16];
160 u32 external_sw_if_index;
164 /** \brief Control ping from client to api server request
165 @param client_index - opaque cookie to identify the sender
166 @param context - sender context, to match reply w/ request
168 define snat_control_ping
174 /** \brief Control ping from the client to the server response
175 @param client_index - opaque cookie to identify the sender
176 @param context - sender context, to match reply w/ request
177 @param retval - return code for the request
178 @param vpe_pid - the pid of the vpe, returned by the server
180 define snat_control_ping_reply
188 /** \brief Show S-NAT plugin startup config
189 @param client_index - opaque cookie to identify the sender
190 @param context - sender context, to match reply w/ request
192 define snat_show_config
198 /** \brief Show S-NAT plugin startup config reply
199 @param context - sender context, to match reply w/ request
200 @param retval - return code for the request
201 @param static_mapping_only - if 1 dynamic translations disabled
202 @param static_mapping_connection_tracking - if 1 create session data
203 @param deterministic - if 1 deterministic mapping
204 @param translation_buckets - number of translation hash buckets
205 @param translation_memory_size - translation hash memory size
206 @param user_buckets - number of user hash buckets
207 @param user_memory_size - user hash memory size
208 @param max_translations_per_user - maximum number of translations per user
209 @param outside_vrf_id - outside VRF id
210 @param inside_vrf_id - default inside VRF id
212 define snat_show_config_reply
216 u8 static_mapping_only;
217 u8 static_mapping_connection_tracking;
219 u32 translation_buckets;
220 u32 translation_memory_size;
222 u32 user_memory_size;
223 u32 max_translations_per_user;
228 /** \brief Set S-NAT workers
229 @param client_index - opaque cookie to identify the sender
230 @param context - sender context, to match reply w/ request
231 @param worker_mask - S-NAT workers mask
233 autoreply define snat_set_workers {
239 /** \brief Dump S-NAT workers
240 @param client_index - opaque cookie to identify the sender
241 @param context - sender context, to match reply w/ request
243 define snat_worker_dump {
248 /** \brief S-NAT workers details response
249 @param context - sender context, to match reply w/ request
250 @param worker_index - worker index
251 @param lcore_id - lcore ID
252 @param name - worker name
254 define snat_worker_details {
261 /** \brief Add/delete S-NAT pool address from specific interfce
262 @param client_index - opaque cookie to identify the sender
263 @param context - sender context, to match reply w/ request
264 @param is_add - 1 if add, 0 if delete
265 @param sw_if_index - software index of the interface
267 autoreply define snat_add_del_interface_addr {
275 /** \brief Dump S-NAT pool addresses interfaces
276 @param client_index - opaque cookie to identify the sender
277 @param context - sender context, to match reply w/ request
279 define snat_interface_addr_dump {
284 /** \brief S-NAT pool addresses interfaces details response
285 @param context - sender context, to match reply w/ request
286 @param sw_if_index - software index of the interface
288 define snat_interface_addr_details {
293 /** \brief Enable/disable S-NAT IPFIX logging
294 @param client_index - opaque cookie to identify the sender
295 @param context - sender context, to match reply w/ request
296 @param domain_id - observation domain ID
297 @param src_port - source port number
298 @param enable - 1 if enable, 0 if disable
300 autoreply define snat_ipfix_enable_disable {
308 /** \brief Dump S-NAT users
309 @param client_index - opaque cookie to identify the sender
310 @param context - sender context, to match reply w/ request
312 define snat_user_dump {
317 /** \brief S-NAT users response
318 @param context - sender context, to match reply w/ request
320 @param is_ip4 - 1 if address type is IPv4
321 @param ip_adress - IP address
322 @param nsessions - number of dynamic sessions
323 @param nstaticsessions - number of static sessions
325 define snat_user_details {
334 /** \brief S-NAT user's sessions
335 @param client_index - opaque cookie to identify the sender
336 @param context - sender context, to match reply w/ request
337 @param is_ip4 - 1 if address type is IPv4
338 @param user_ip - IP address of the user to dump
339 @param vrf_id - VRF_ID
341 define snat_user_session_dump {
349 /** \brief S-NAT user's sessions response
350 @param context - sender context, to match reply w/ request
351 @param is_ip4 - 1 if address type is IPv4
352 @param outside_ip_address - outside IP address
353 @param outside_port - outside port
354 @param inside_ip_address - inside IP address
355 @param inside_port - inside port
356 @param protocol - protocol
357 @param is_static - 1 if session is static
358 @param last_heard - last heard timer
359 @param total_bytes - count of bytes sent through session
360 @param total_pkts - count of pakets sent through session
362 define snat_user_session_details {
365 u8 outside_ip_address[16];
367 u8 inside_ip_address[16];
376 /** \brief Add/delete S-NAT deterministic mapping
377 @param client_index - opaque cookie to identify the sender
378 @param context - sender context, to match reply w/ request
379 @param is_add - 1 if add, 0 if delete
380 @param is_ip4 - 1 if address type is IPv4
381 @param in_addr - inside IP address
382 @param in_plen - inside IP address prefix length
383 @param out_addr - outside IP address
384 @param out_addr - outside IP address prefix length
386 autoreply define snat_add_det_map {
398 /** \brief Get outside address and port range from inside address
399 @param client_index - opaque cookie to identify the sender
400 @param context - sender context, to match reply w/ request
401 @param is_ip4 - 1 if address type is IPv4
402 @param in_addr - inside IP address
404 define snat_det_forward {
411 /** \brief Get outside address and port range from inside address
412 @param context - sender context, to match reply w/ request
413 @param retval - return code
414 @param out_port_lo - outside port range start
415 @param out_port_hi - outside port range end
416 @param is_ip4 - 1 if address type is IPv4
417 @param out_addr - outside IP address
419 define snat_det_forward_reply {
428 /** \brief Get inside address from outside address and port
429 @param client_index - opaque cookie to identify the sender
430 @param context - sender context, to match reply w/ request
431 @param out_port - outside port
432 @param is_ip4 - 1 if address type is IPv4
433 @param out_addr - outside IP address
435 define snat_det_reverse {
443 /** \brief Get inside address from outside address and port reply
444 @param context - sender context, to match reply w/ request
445 @param retval - return code
446 @param is_ip4 - 1 if address type is IPv4
447 @param in_addr - inside IP address
449 define snat_det_reverse_reply {
456 /** \brief Dump S-NAT deterministic mappings
457 @param client_index - opaque cookie to identify the sender
458 @param context - sender context, to match reply w/ request
460 define snat_det_map_dump {
465 /** \brief S-NAT users response
466 @param context - sender context, to match reply w/ request
467 @param is_ip4 - 1 if address type is IPv4
468 @param in_addr - inside IP address
469 @param in_plen - inside IP address prefix length
470 @param out_addr - outside IP address
471 @param out_plen - outside IP address prefix length
472 @param sharing_ratio - outside to inside address sharing ratio
473 @param ports_per_host - number of ports available to a host
474 @param ses_num - number of sessions belonging to this mapping
476 define snat_det_map_details {
488 /** \brief Set values of timeouts for deterministic NAT (seconds, 0 = default)
489 @param client_index - opaque cookie to identify the sender
490 @param context - sender context, to match reply w/ request
491 @param udp - UDP timeout (default 300sec)
492 @param tcp_established - TCP established timeout (default 7440sec)
493 @param tcp_transitory - TCP transitory timeout (default 240sec)
494 @param icmp - ICMP timeout (default 60sec)
496 autoreply define snat_det_set_timeouts {
505 /** \brief Get values of timeouts for deterministic NAT (seconds)
506 @param client_index - opaque cookie to identify the sender
507 @param context - sender context, to match reply w/ request
509 define snat_det_get_timeouts {
514 /** \brief Get values of timeouts for deterministic NAT reply
515 @param context - sender context, to match reply w/ request
516 @param retval - return code
517 @param udp - UDP timeout (default 300sec)
518 @param tcp_established - TCP established timeout (default 7440sec)
519 @param tcp_transitory - TCP transitory timeout (default 240sec)
520 @param icmp - ICMP timeout (default 60sec)
522 define snat_det_get_timeouts_reply {
531 /** \brief Close CGNAT session by outside address and port
532 @param client_index - opaque cookie to identify the sender
533 @param context - sender context, to match reply w/ request
534 @param is_ip4 - 1 if address type is IPv4
535 @param out_addr - outside IP address
536 @param out_port - outside port
537 @param ext_addr - external host address
538 @param ext_port - external host port
540 autoreply define snat_det_close_session_out {
550 /** \brief Close CGNAT session by inside address and port
551 @param client_index - opaque cookie to identify the sender
552 @param context - sender context, to match reply w/ request
553 @param is_ip4 - 1 if address type is IPv4
554 @param in_addr - inside IP address
555 @param in_port - inside port
556 @param ext_addr - external host address
557 @param ext_port - external host port
559 autoreply define snat_det_close_session_in {
569 /** \brief Dump S-NAT deterministic sessions
570 @param client_index - opaque cookie to identify the sender
571 @param context - sender context, to match reply w/ request
572 @param is_ip4 - 1 if address type is IPv4
573 @param user_addr - address of an inside user whose sessions to dump
575 define snat_det_session_dump {
582 /** \brief S-NAT deterministic sessions reply
583 @param context - sender context, to match reply w/ request
584 @param is_ip4 - 1 if address type is IPv4
585 @param in_port - inside port
586 @param ext_addr - external host address
587 @param ext_port - external host port
588 @param out_port - outside NAT port
589 @param state - session state
590 @param expire - session expiration timestamp
592 define snat_det_session_details {
604 /** \brief Add/delete address range to NAT64 pool
605 @param client_index - opaque cookie to identify the sender
606 @param context - sender context, to match reply w/ request
607 @param start_addr - start address of the range
608 @param end_addr - end address of the range
609 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
610 @param is_add - 1 if add, 0 if delete
612 autoreply define nat64_add_del_pool_addr_range {
621 /** \brief Dump NAT64 pool addresses
622 @param client_index - opaque cookie to identify the sender
623 @param context - sender context, to match reply w/ request
625 define nat64_pool_addr_dump {
630 /** \brief NAT64 pool address details response
631 @param context - sender context, to match reply w/ request
632 @param address - IPv4 address
633 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
635 define nat64_pool_addr_details {
641 /** \brief Enable/disable NAT64 feature on the interface
642 @param client_index - opaque cookie to identify the sender
643 @param context - sender context, to match reply w/ request
644 @param sw_if_index - index of the interface
645 @param is_inside - 1 if inside, 0 if outside
646 @param is_add - 1 if add, 0 if delete
648 autoreply define nat64_add_del_interface {
656 /** \brief Dump interfaces with NAT64 feature
657 @param client_index - opaque cookie to identify the sender
658 @param context - sender context, to match reply w/ request
660 define nat64_interface_dump {
665 /** \brief NAT64 interface details response
666 @param context - sender context, to match reply w/ request
667 @param is_inside - 1 if inside, 0 if outside
668 @param sw_if_index - index of the interface
670 define nat64_interface_details {
676 /** \brief Add/delete NAT64 static BIB entry
677 @param client_index - opaque cookie to identify the sender
678 @param context - sender context, to match reply w/ request
679 @param i_addr - inside IPv6 address
680 @param o_addr - outside IPv4 address
681 @param i_port - inside port number
682 @param o_port - outside port number
683 @param vrf_id - VRF id of tenant
684 @param proto - protocol number
685 @param is_add - 1 if add, 0 if delete
687 autoreply define nat64_add_del_static_bib {
699 /** \brief Dump NAT64 BIB
700 @param client_index - opaque cookie to identify the sender
701 @param context - sender context, to match reply w/ request
702 @param proto - protocol of the BIB
704 define nat64_bib_dump {
710 /** \brief NAT64 BIB details response
711 @param context - sender context, to match reply w/ request
712 @param i_addr - inside IPv6 address
713 @param o_addr - outside IPv4 address
714 @param i_port - inside port number
715 @param o_port - outside port number
716 @param vrf_id - VRF id of tenant
717 @param proto - protocol number
718 @param is_static - 1 if static BIB entry, 0 if dynamic
719 @param ses_num - number of sessions associated with the BIB entry
721 define nat64_bib_details {
733 /** \brief Set values of timeouts for NAT64 (seconds, 0 = default)
734 @param client_index - opaque cookie to identify the sender
735 @param context - sender context, to match reply w/ request
736 @param udp - UDP timeout (default 300sec)
737 @param icmp - ICMP timeout (default 60sec)
738 @param tcp_trans - TCP transitory timeout (default 240sec)
739 @param tcp_est - TCP established timeout (default 7440sec)
740 @param tcp_incoming_syn - TCP incoming SYN timeout (default 6sec)
742 autoreply define nat64_set_timeouts {
749 u32 tcp_incoming_syn;
752 /** \brief Get values of timeouts for NAT64 (seconds)
753 @param client_index - opaque cookie to identify the sender
754 @param context - sender context, to match reply w/ request
756 define nat64_get_timeouts {
761 /** \brief Get values of timeouts for NAT64 reply
762 @param context - sender context, to match reply w/ request
763 @param retval - return code
764 @param udp - UDP timeout
765 @param icmp - ICMP timeout
766 @param tcp_trans - TCP transitory timeout
767 @param tcp_est - TCP established timeout
768 @param tcp_incoming_syn - TCP incoming SYN timeout
770 define nat64_get_timeouts_reply {
777 u32 tcp_incoming_syn;
780 /** \brief Dump NAT64 session table
781 @param client_index - opaque cookie to identify the sender
782 @param context - sender context, to match reply w/ request
783 @param proto - protocol of the session table
785 define nat64_st_dump {
791 /** \brief NAT64 session table details response
792 @param context - sender context, to match reply w/ request
793 @param il_addr - inside IPv6 address of the local host
794 @param ol_addr - outside IPv4 address of the local host
795 @param il_port - inside port number id of the local host/inside ICMP id
796 @param ol_port - outside port number of the local host/outside ICMP id
797 @param il_addr - inside IPv6 address of the remote host
798 @param ol_addr - outside IPv4 address of the remote host
799 @param l_port - port number of the remote host (not used for ICMP)
800 @param vrf_id - VRF id of tenant
801 @param proto - protocol number
803 define nat64_st_details {
816 /** \brief Add/del NAT64 prefix
817 @param client_index - opaque cookie to identify the sender
818 @param context - sender context, to match reply w/ request
819 @param prefix - NAT64 prefix
820 @param prefix - NAT64 prefix length
821 @param vrf_id - VRF id of tenant
822 @param is_add - 1 if add, 0 if delete
824 autoreply define nat64_add_del_prefix {
833 /** \brief Dump NAT64 prefix
834 @param client_index - opaque cookie to identify the sender
835 @param context - sender context, to match reply w/ request
837 define nat64_prefix_dump {
842 /** \brief Dump NAT64 prefix details response
843 @param context - sender context, to match reply w/ request
844 @param prefix - NAT64 prefix
845 @param prefix - NAT64 prefix length
846 @param vrf_id - VRF id of tenant
848 define nat64_prefix_details {