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.
16 option version = "5.1.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
22 * @brief VPP control-plane API messages.
24 * This file defines VPP control-plane API messages which are generally
25 * called through a shared memory interface.
29 * Common NAT plugin APIs
32 enum nat_config_flags : u8
35 NAT_IS_TWICE_NAT = 0x01,
36 NAT_IS_SELF_TWICE_NAT = 0x02,
37 NAT_IS_OUT2IN_ONLY = 0x04,
38 NAT_IS_ADDR_ONLY = 0x08,
39 NAT_IS_OUTSIDE = 0x10,
42 NAT_IS_EXT_HOST_VALID = 0x80,
45 /** \brief Control ping from client to api server request
46 @param client_index - opaque cookie to identify the sender
47 @param context - sender context, to match reply w/ request
49 define nat_control_ping
55 /** \brief Control ping from the client to the server response
56 @param client_index - opaque cookie to identify the sender
57 @param context - sender context, to match reply w/ request
58 @param retval - return code for the request
59 @param vpe_pid - the pid of the vpe, returned by the server
61 define nat_control_ping_reply
69 /** \brief Show NAT plugin startup config
70 @param client_index - opaque cookie to identify the sender
71 @param context - sender context, to match reply w/ request
73 define nat_show_config
79 /** \brief Show NAT plugin startup config reply
80 @param context - sender context, to match reply w/ request
81 @param retval - return code for the request
82 @param static_mapping_only - if true dynamic translations disabled
83 @param static_mapping_connection_tracking - if true create session data
84 @param deterministic - if true deterministic mapping
85 @param endpoint_dependent - if true endpoint-dependent mode
86 @param out2in_dpo - if true out2in dpo mode
87 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
88 @param translation_buckets - number of translation hash buckets
89 @param translation_memory_size - translation hash memory size
90 @param user_buckets - number of user hash buckets
91 @param user_memory_size - user hash memory size
92 @param max_translations_per_user - maximum number of translations per user
93 @param outside_vrf_id - outside VRF id
94 @param inside_vrf_id - default inside VRF id
95 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
96 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
97 @param nat64_st_buckets - number of NAT64 session table hash buckets
98 @param nat64_st_memory_size - memory size of NAT64 session table hash
100 define nat_show_config_reply
104 bool static_mapping_only;
105 bool static_mapping_connection_tracking;
107 bool endpoint_dependent;
110 u32 translation_buckets;
111 u32 translation_memory_size;
113 u32 user_memory_size;
114 u32 max_translations_per_user;
117 u32 nat64_bib_buckets;
118 u32 nat64_bib_memory_size;
119 u32 nat64_st_buckets;
120 u32 nat64_st_memory_size;
123 enum nat_log_level : u8
126 NAT_LOG_ERROR = 0x01,
127 NAT_LOG_WARNING = 0x02,
128 NAT_LOG_NOTICE = 0x03,
130 NAT_LOG_DEBUG = 0x05,
133 /** \brief Set NAT logging level
134 @param client_index - opaque cookie to identify the sender
135 @param context - sender context, to match reply w/ request
136 @param log_level - logging level
138 autoreply define nat_set_log_level {
141 vl_api_nat_log_level_t log_level;
144 /** \brief Set NAT workers
145 @param client_index - opaque cookie to identify the sender
146 @param context - sender context, to match reply w/ request
147 @param worker_mask - NAT workers mask
149 autoreply define nat_set_workers {
155 /** \brief Dump NAT workers
156 @param client_index - opaque cookie to identify the sender
157 @param context - sender context, to match reply w/ request
159 define nat_worker_dump {
164 /** \brief NAT workers details response
165 @param context - sender context, to match reply w/ request
166 @param worker_index - worker index
167 @param lcore_id - lcore ID
168 @param name - worker name
170 define nat_worker_details {
177 /** \brief Enable/disable NAT IPFIX logging
178 @param client_index - opaque cookie to identify the sender
179 @param context - sender context, to match reply w/ request
180 @param domain_id - observation domain ID
181 @param src_port - source port number
182 @param enable - true if enable, false if disable
184 autoreply define nat_ipfix_enable_disable {
192 /** \brief Set NAT virtual fragmentation reassembly
193 @param client_index - opaque cookie to identify the sender
194 @param context - sender context, to match reply w/ request
195 @param timeout - reassembly timeout
196 @param max_reass - maximum number of concurrent reassemblies
197 @param max_frag - maximum number of fragmets per reassembly
198 @param drop_frag - if 0 translate fragments, otherwise drop fragments
199 @param is_ip6 - true if IPv6, false if IPv4
201 autoreply define nat_set_reass {
211 /** \brief Get NAT virtual fragmentation reassembly configuration
212 @param client_index - opaque cookie to identify the sender
213 @param context - sender context, to match reply w/ request
215 define nat_get_reass {
220 /** \brief Get NAT virtual fragmentation reassembly configuration reply
221 @param context - sender context, to match reply w/ request
222 @param retval - return code
223 @param ip4_timeout - reassembly timeout
224 @param ip4_max_reass - maximum number of concurrent reassemblies
225 @param ip4_max_frag - maximum number of fragmets per reassembly
226 @param ip4_drop_frag - if 0 translate fragments, otherwise drop fragments
227 @param ip6_timeout - reassembly timeout
228 @param ip6_max_reass - maximum number of concurrent reassemblies
229 @param ip6_max_frag - maximum number of fragmets per reassembly
230 @param ip6_drop_frag - if 0 translate fragments, otherwise drop fragments
232 define nat_get_reass_reply {
245 /** \brief Dump NAT virtual fragmentation reassemblies
246 @param client_index - opaque cookie to identify the sender
247 @param context - sender context, to match reply w/ request
249 define nat_reass_dump {
254 /** \brief NAT virtual fragmentation reassemblies response
255 @param context - sender context, to match reply w/ request
256 @param src_addr - source IPv4 address
257 @param dst_addr - destination IPv4 address
258 @param frag_id - fragment ID
259 @param proto - protocol
260 @param frag_n - number of cached fragments
262 define nat_reass_details {
264 vl_api_address_t src_addr;
265 vl_api_address_t dst_addr;
271 /** \brief Set values of timeouts for NAT sessions (seconds)
272 @param client_index - opaque cookie to identify the sender
273 @param context - sender context, to match reply w/ request
274 @param udp - UDP timeout (default 300sec)
275 @param tcp_established - TCP established timeout (default 7440sec)
276 @param tcp_transitory - TCP transitory timeout (default 240sec)
277 @param icmp - ICMP timeout (default 60sec)
279 autoreply define nat_set_timeouts {
288 /** \brief Get values of timeouts for NAT sessions (seconds)
289 @param client_index - opaque cookie to identify the sender
290 @param context - sender context, to match reply w/ request
292 define nat_get_timeouts {
297 /** \brief Get values of timeouts for NAT sessions reply
298 @param context - sender context, to match reply w/ request
299 @param retval - return code
300 @param udp - UDP timeout
301 @param tcp_established - TCP established timeout
302 @param tcp_transitory - TCP transitory timeout
303 @param icmp - ICMP timeout
305 define nat_get_timeouts_reply {
314 /** \brief Set address and port assignment algorithm
315 @param client_index - opaque cookie to identify the sender
316 @param context - sender context, to match reply w/ request
317 @param alg - address and port assignment algorithm:
318 0 - default, 1 - MAP-E, 2 - port range
319 (see nat_addr_and_port_alloc_alg_t in nat.h)
320 @param psid_offset - number of offset bits (valid only for MAP-E alg)
321 @param psid_length - length of PSID (valid only for MAP-E alg)
322 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
323 @param start_port - beginning of the port range
324 @param end_port - end of the port range
326 autoreply define nat_set_addr_and_port_alloc_alg {
337 /** \brief Get address and port assignment algorithm
338 @param client_index - opaque cookie to identify the sender
339 @param context - sender context, to match reply w/ request
341 define nat_get_addr_and_port_alloc_alg {
346 /** \brief Get address and port assignment algorithm reply
347 @param context - sender context, to match reply w/ request
348 @param retval - return code
349 @param alg - address and port assignment algorithm:
350 0 - default, 1 - MAP-E, 2 - port range
351 (see nat_addr_and_port_alloc_alg_t in nat.h)
352 @param psid_offset - number of offset bits (valid only for MAP-E alg)
353 @param psid_length - length of PSID (valid only for MAP-E alg)
354 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
355 @param start_port - beginning of the port range
356 @param end_port - end of the port range
358 define nat_get_addr_and_port_alloc_alg_reply {
369 /** \brief Set TCP MSS rewriting configuration
370 @param client_index - opaque cookie to identify the sender
371 @param context - sender context, to match reply w/ request
372 @param mss_value - MSS value to be used for MSS rewriting
373 @param enable - if true enable MSS rewriting feature else disable
375 autoreply define nat_set_mss_clamping {
382 /** \brief Get TCP MSS rewriting configuration
383 @param client_index - opaque cookie to identify the sender
384 @param context - sender context, to match reply w/ request
386 define nat_get_mss_clamping {
391 /** \brief Get TCP MSS rewriting configuration reply
392 @param context - sender context, to match reply w/ request
393 @param retval - return code
394 @param mss_value - MSS value to be used for MSS rewriting
395 @param enable - if true enable MSS rewriting feature else disable
397 define nat_get_mss_clamping_reply {
404 /** \brief Set HA listener (local settings)
405 @param client_index - opaque cookie to identify the sender
406 @param context - sender context, to match reply w/ request
407 @param ip_address - local IP4 address
408 @param port - local UDP port number
409 @param path_mtu - path MTU between local and failover
411 autoreply define nat_ha_set_listener {
414 vl_api_ip4_address_t ip_address;
419 /** \brief Set HA failover (remote settings)
420 @param client_index - opaque cookie to identify the sender
421 @param context - sender context, to match reply w/ request
422 @param ip_address - failover IP4 address
423 @param port - failvoer UDP port number
424 @param session_refresh_interval - number of seconds after which to send
425 session counters refresh
427 autoreply define nat_ha_set_failover {
430 vl_api_ip4_address_t ip_address;
432 u32 session_refresh_interval;
435 /** \brief Get HA listener/local configuration
436 @param client_index - opaque cookie to identify the sender
437 @param context - sender context, to match reply w/ request
439 define nat_ha_get_listener {
444 /** \brief Get HA listener/local configuration reply
445 @param context - sender context, to match reply w/ request
446 @param retval - return code
447 @param ip_address - local IP4 address
448 @param port - local UDP port number
449 @param path_mtu - Path MTU between local and failover
451 define nat_ha_get_listener_reply {
454 vl_api_ip4_address_t ip_address;
459 /** \brief Get HA failover/remote settings
460 @param client_index - opaque cookie to identify the sender
461 @param context - sender context, to match reply w/ request
463 define nat_ha_get_failover {
468 /** \brief Get HA failover/remote settings reply
469 @param context - sender context, to match reply w/ request
470 @param retval - return code
471 @param ip_address - failover IP4 address
472 @param port - failvoer UDP port number
473 @param session_refresh_interval - number of seconds after which to send
474 session counters refresh
476 define nat_ha_get_failover_reply {
479 vl_api_ip4_address_t ip_address;
481 u32 session_refresh_interval;
484 /** \brief Flush the current HA data (for testing)
485 @param client_index - opaque cookie to identify the sender
486 @param context - sender context, to match reply w/ request
488 autoreply define nat_ha_flush {
493 /** \brief Resync HA (resend existing sessions to new failover)
494 @param client_index - opaque cookie to identify the sender
495 @param context - sender context, to match reply w/ request
496 @param want_resync_event - resync completed event sent to the sender via
497 nat_ha_resync_completed_event API message if
499 @param pid - sender's pid
501 autoreply define nat_ha_resync
505 u8 want_resync_event;
509 /** \brief Tell client about a HA resync completion event
510 @param client_index - opaque cookie to identify the sender
511 @param pid - client pid registered to receive notification
512 @param missed_count - number of missed (not ACKed) messages
514 define nat_ha_resync_completed_event
522 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
529 /** \brief Add/del NAT44 address range
530 @param client_index - opaque cookie to identify the sender
531 @param context - sender context, to match reply w/ request
532 @param first_ip_address - first IPv4 address
533 @param last_ip_address - last IPv4 address
534 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
535 @param is_add - true if add, false if delete
536 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
539 autoreply define nat44_add_del_address_range {
542 vl_api_ip4_address_t first_ip_address;
543 vl_api_ip4_address_t last_ip_address;
546 vl_api_nat_config_flags_t flags;
549 /** \brief Dump NAT44 addresses
550 @param client_index - opaque cookie to identify the sender
551 @param context - sender context, to match reply w/ request
553 define nat44_address_dump {
558 /** \brief NAT44 address details response
559 @param context - sender context, to match reply w/ request
560 @param ip_address - IPv4 address
561 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
562 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
564 define nat44_address_details {
566 vl_api_ip4_address_t ip_address;
567 vl_api_nat_config_flags_t flags;
571 /** \brief Enable/disable NAT44 feature on the interface
572 @param client_index - opaque cookie to identify the sender
573 @param context - sender context, to match reply w/ request
574 @param is_add - true if add, false if delete
575 @param flags - flag NAT_IS_INSIDE if interface is inside else
577 @param sw_if_index - software index of the interface
579 autoreply define nat44_interface_add_del_feature {
583 vl_api_nat_config_flags_t flags;
584 vl_api_interface_index_t sw_if_index;
587 /** \brief Dump interfaces with NAT44 feature
588 @param client_index - opaque cookie to identify the sender
589 @param context - sender context, to match reply w/ request
591 define nat44_interface_dump {
596 /** \brief NAT44 interface details response
597 @param context - sender context, to match reply w/ request
598 @param sw_if_index - software index of the interface
599 @param flags - flag NAT_IS_INSIDE if interface is inside,
600 flag NAT_IS_OUTSIDE if interface is outside
601 and if both flags are set the interface is
602 both inside and outside
604 define nat44_interface_details {
606 vl_api_nat_config_flags_t flags;
607 vl_api_interface_index_t sw_if_index;
610 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
612 @param client_index - opaque cookie to identify the sender
613 @param context - sender context, to match reply w/ request
614 @param is_add - true if add, false if delete
615 @param flags - flag NAT_IS_INSIDE if interface is inside else
617 @param sw_if_index - software index of the interface
619 autoreply define nat44_interface_add_del_output_feature {
623 vl_api_nat_config_flags_t flags;
624 vl_api_interface_index_t sw_if_index;
627 /** \brief Dump interfaces with NAT44 output feature
628 @param client_index - opaque cookie to identify the sender
629 @param context - sender context, to match reply w/ request
631 define nat44_interface_output_feature_dump {
636 /** \brief NAT44 interface with output feature details response
637 @param context - sender context, to match reply w/ request
638 @param flags - flag NAT_IS_INSIDE if interface is inside else
640 @param sw_if_index - software index of the interface
642 define nat44_interface_output_feature_details {
644 vl_api_nat_config_flags_t flags;
645 vl_api_interface_index_t sw_if_index;
648 /** \brief Add/delete NAT44 static mapping
649 @param client_index - opaque cookie to identify the sender
650 @param context - sender context, to match reply w/ request
651 @param is_add - true if add, false if delete
652 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
653 flag nat_is_twice_nat if nat address range for external hosts,
654 flag NAT_IS_SELF_TWICE_NAT if translate external host address
655 and port whenever external host address equals local
656 address of internal host,
657 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
658 @param local_ip_address - local IPv4 address
659 @param external_ip_address - external IPv4 address
660 @param protocol - IP protocol, used only if addr_only=0
661 @param local_port - local port number, used only if addr_only=0
662 @param external_port - external port number, used only if addr_only=0
663 @param external_sw_if_index - external interface (if set
664 external_ip_address is ignored, ~0 means not
666 @param vfr_id - VRF ID
667 @param tag - opaque string tag
669 autoreply define nat44_add_del_static_mapping {
673 vl_api_nat_config_flags_t flags;
674 vl_api_ip4_address_t local_ip_address;
675 vl_api_ip4_address_t external_ip_address;
679 vl_api_interface_index_t external_sw_if_index;
684 /** \brief Dump NAT44 static mappings
685 @param client_index - opaque cookie to identify the sender
686 @param context - sender context, to match reply w/ request
688 define nat44_static_mapping_dump {
693 /** \brief NAT44 static mapping details response
694 @param context - sender context, to match reply w/ request
695 @param flags - flag NAT_ADDR_ONLY if address only mapping,
696 flag NAT_TWICE_NAT if NAT address range for external hosts,
697 flag NAT_SELF_TWICE_NAT if translate external host address
698 and port whenever external host address equals local
699 address of internal host,
700 flag NAT_OUT2IN_ONLY if rule match only out2in direction
701 @param local_ip_address - local IPv4 address
702 @param external_ip_address - external IPv4 address
703 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
704 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
705 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
706 @param external_sw_if_index - external interface
707 @param vfr_id - VRF ID
708 @param tag - opaque string tag
710 define nat44_static_mapping_details {
712 vl_api_nat_config_flags_t flags;
713 vl_api_ip4_address_t local_ip_address;
714 vl_api_ip4_address_t external_ip_address;
718 vl_api_interface_index_t external_sw_if_index;
723 /** \brief Add/delete NAT44 identity mapping
724 @param client_index - opaque cookie to identify the sender
725 @param context - sender context, to match reply w/ request
726 @param is_add - true if add, false if delete
727 @param flags - flag NAT_ADDR_ONLY if address only mapping
728 @param ip_address - IPv4 address
729 @param protocol - IP protocol
730 @param port - port number
731 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
733 @param vfr_id - VRF ID (if ~0 use default VRF)
734 @param tag - opaque string tag
736 autoreply define nat44_add_del_identity_mapping {
740 vl_api_nat_config_flags_t flags;
741 vl_api_ip4_address_t ip_address;
744 vl_api_interface_index_t sw_if_index;
749 /** \brief Dump NAT44 identity mappings
750 @param client_index - opaque cookie to identify the sender
751 @param context - sender context, to match reply w/ request
753 define nat44_identity_mapping_dump {
758 /** \brief NAT44 identity mapping details response
759 @param context - sender context, to match reply w/ request
760 @param flags - flag NAT_ADDR_ONLY if address only mapping
761 @param ip_address - IPv4 address
762 @param protocol - IP protocol
763 @param port - port number
764 @param sw_if_index - interface
765 @param vfr_id - VRF ID
766 @param tag - opaque string tag
768 define nat44_identity_mapping_details {
770 vl_api_nat_config_flags_t flags;
771 vl_api_ip4_address_t ip_address;
774 vl_api_interface_index_t sw_if_index;
779 /** \brief Add/delete NAT44 pool address from specific interfce
780 @param client_index - opaque cookie to identify the sender
781 @param context - sender context, to match reply w/ request
782 @param is_add - true if add, false if delete
783 @param sw_if_index - software index of the interface
784 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
786 autoreply define nat44_add_del_interface_addr {
790 vl_api_interface_index_t sw_if_index;
791 vl_api_nat_config_flags_t flags;
794 /** \brief Dump NAT44 pool addresses interfaces
795 @param client_index - opaque cookie to identify the sender
796 @param context - sender context, to match reply w/ request
798 define nat44_interface_addr_dump {
803 /** \brief NAT44 pool addresses interfaces details response
804 @param context - sender context, to match reply w/ request
805 @param sw_if_index - software index of the interface
806 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
809 define nat44_interface_addr_details {
811 vl_api_interface_index_t sw_if_index;
812 vl_api_nat_config_flags_t flags;
815 /** \brief Dump NAT44 users
816 @param client_index - opaque cookie to identify the sender
817 @param context - sender context, to match reply w/ request
819 define nat44_user_dump {
824 /** \brief NAT44 users response
825 @param context - sender context, to match reply w/ request
827 @param ip_address - IPv4 address
828 @param nsessions - number of dynamic sessions
829 @param nstaticsessions - number of static sessions
831 define nat44_user_details {
834 vl_api_ip4_address_t ip_address;
839 /** \brief NAT44 user's sessions
840 @param client_index - opaque cookie to identify the sender
841 @param context - sender context, to match reply w/ request
842 @param ip_address - IPv4 address of the user to dump
843 @param vrf_id - VRF_ID
845 define nat44_user_session_dump {
848 vl_api_ip4_address_t ip_address;
852 /** \brief NAT44 user's sessions response
853 @param context - sender context, to match reply w/ request
854 @param outside_ip_address - outside IPv4 address
855 @param outside_port - outside port
856 @param inside_ip_address - inside IPv4 address
857 @param inside_port - inside port
858 @param protocol - protocol
859 @param flags - flag NAT_IS_STATIC if session is static,
860 flag NAT_IS_TWICE_NAT if session is twice-nat,
861 flag NAT_IS_EXT_HOST_VALID if external host address
863 @param last_heard - last heard timer
864 @param total_bytes - count of bytes sent through session
865 @param total_pkts - count of pakets sent through session
866 @param ext_host_address - external host IPv4 address
867 @param ext_host_port - external host port
868 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
869 only if twice-nat session)
870 @param ext_host_nat_port - post-NAT external host port (valid only if
873 define nat44_user_session_details {
875 vl_api_ip4_address_t outside_ip_address;
877 vl_api_ip4_address_t inside_ip_address;
880 vl_api_nat_config_flags_t flags;
884 vl_api_ip4_address_t ext_host_address;
886 vl_api_ip4_address_t ext_host_nat_address;
887 u16 ext_host_nat_port;
890 /** \brief NAT44 load-balancing address and port pair
891 @param addr - IPv4 address of the internal node
892 @param port - L4 port number of the internal node
893 @param probability - probability of the internal node to be randomly matched
894 @param vrf_id - VRF id
896 typeonly manual_endian define nat44_lb_addr_port {
897 vl_api_ip4_address_t addr;
903 /** \brief Add/delete NAT44 load-balancing static mapping rule
904 @param client_index - opaque cookie to identify the sender
905 @param context - sender context, to match reply w/ request
906 @param is_add - true if add, false if delete
907 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
908 flag NAT_SELF_TWICE_NAT if translate external host address
909 and port whenever external host address equals local
910 address of internal host,
911 flag NAT_OUT2IN_ONLY if rule match only out2in direction
912 @param external_addr - external IPv4 address of the service
913 @param external_port - external L4 port number of the service
914 @param protocol - IP protocol number of the service
915 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
917 @param local_num - number of local network nodes
918 @param locals - local network nodes
919 @param tag - opaque string tag
921 autoreply manual_endian define nat44_add_del_lb_static_mapping {
925 vl_api_nat_config_flags_t flags;
926 vl_api_ip4_address_t external_addr;
931 vl_api_nat44_lb_addr_port_t locals[local_num];
935 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
936 @param client_index - opaque cookie to identify the sender
937 @param context - sender context, to match reply w/ request
938 @param is_add - true if add, false if delete
939 @param external_addr - external IPv4 address of the service
940 @param external_port - external L4 port number of the service
941 @param protocol - IP protocol number of the service
942 @param local - local network node
944 autoreply define nat44_lb_static_mapping_add_del_local {
948 vl_api_ip4_address_t external_addr;
951 vl_api_nat44_lb_addr_port_t local;
954 /** \brief Dump NAT44 load-balancing static mapping rules
955 @param client_index - opaque cookie to identify the sender
956 @param context - sender context, to match reply w/ request
958 define nat44_lb_static_mapping_dump {
963 /** \brief NAT44 load-balancing static mapping rule details response
964 @param context - sender context, to match reply w/ request
965 @param external_addr - external IPv4 address of the service
966 @param external_port - external L4 port number of the service
967 @param protocol - IP protocol number of the service
968 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
969 flag NAT_SELF_TWICE_NAT if translate external host address
970 and port whenever external host address equals local
971 address of internal host,
972 flag NAT_OUT2IN_ONLY if rule match only out2in direction
973 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
975 @param local_num - number of local network nodes
976 @param locals - local network nodes
977 @param tag - opaque string tag
979 manual_endian define nat44_lb_static_mapping_details {
981 vl_api_ip4_address_t external_addr;
984 vl_api_nat_config_flags_t flags;
987 vl_api_nat44_lb_addr_port_t locals[local_num];
991 /** \brief Delete NAT44 session
992 @param client_index - opaque cookie to identify the sender
993 @param context - sender context, to match reply w/ request
994 @param ip_address - IPv4 address
995 @param protocol - IP protocol
996 @param port - port number
997 @param vfr_id - VRF ID
998 @param flags - flag NAT_IS_INSIDE if interface is inside or
999 interface is outside,
1000 flag NAT_IS_EXT_HOST_VALID if external host address and
1002 @param ext_host_address - external host IPv4 address
1003 @param ext_host_port - external host port
1005 autoreply define nat44_del_session {
1008 vl_api_ip4_address_t address;
1012 vl_api_nat_config_flags_t flags;
1013 vl_api_ip4_address_t ext_host_address;
1017 /** \brief Enable/disable forwarding for NAT44
1018 Forward packets which don't match existing translation
1019 or static mapping instead of dropping them.
1020 @param client_index - opaque cookie to identify the sender
1021 @param context - sender context, to match reply w/ request
1022 @param enable - true for enable, false for disable
1024 autoreply define nat44_forwarding_enable_disable {
1030 /** \brief Check if forwarding is enabled or disabled
1031 @param client_index - opaque cookie to identify the sender
1032 @param context - sender context, to match reply w/ request
1034 define nat44_forwarding_is_enabled {
1039 /** \brief Response to check if forwarding is enabled or disabled
1040 @param context - sender context, to match reply w/ request
1041 @param enabled - true if enabled, false if disabled
1043 define nat44_forwarding_is_enabled_reply {
1050 * Deterministic NAT (CGN) APIs
1053 /** \brief Add/delete NAT deterministic mapping
1054 @param client_index - opaque cookie to identify the sender
1055 @param context - sender context, to match reply w/ request
1056 @param is_add - true if add, false if delete
1057 @param in_addr - inside IPv4 address
1058 @param in_plen - inside IPv4 address prefix length
1059 @param out_addr - outside IPv4 address
1060 @param out_plen - outside IPv4 address prefix length
1062 autoreply define nat_det_add_del_map {
1066 vl_api_ip4_address_t in_addr;
1068 vl_api_ip4_address_t out_addr;
1072 /** \brief Get outside address and port range from inside address
1073 @param client_index - opaque cookie to identify the sender
1074 @param context - sender context, to match reply w/ request
1075 @param in_addr - inside IP address
1077 define nat_det_forward {
1080 vl_api_ip4_address_t in_addr;
1083 /** \brief Get outside address and port range from inside address
1084 @param context - sender context, to match reply w/ request
1085 @param retval - return code
1086 @param out_port_lo - outside port range start
1087 @param out_port_hi - outside port range end
1088 @param out_addr - outside IPv4 address
1090 define nat_det_forward_reply {
1095 vl_api_ip4_address_t out_addr;
1098 /** \brief Get inside address from outside address and port
1099 @param client_index - opaque cookie to identify the sender
1100 @param context - sender context, to match reply w/ request
1101 @param out_port - outside port
1102 @param out_addr - outside IPv4 address
1104 define nat_det_reverse {
1108 vl_api_ip4_address_t out_addr;
1111 /** \brief Get inside address from outside address and port reply
1112 @param context - sender context, to match reply w/ request
1113 @param retval - return code
1114 @param in_addr - inside IP address
1116 define nat_det_reverse_reply {
1119 vl_api_ip4_address_t in_addr;
1122 /** \brief Dump NAT deterministic mappings
1123 @param client_index - opaque cookie to identify the sender
1124 @param context - sender context, to match reply w/ request
1126 define nat_det_map_dump {
1131 /** \brief NAT users response
1132 @param context - sender context, to match reply w/ request
1133 @param in_addr - inside IPv4 address
1134 @param in_plen - inside IPv4 address prefix length
1135 @param out_addr - outside IPv4 address
1136 @param out_plen - outside IPv4 address prefix length
1137 @param sharing_ratio - outside to inside address sharing ratio
1138 @param ports_per_host - number of ports available to a host
1139 @param ses_num - number of sessions belonging to this mapping
1141 define nat_det_map_details {
1143 vl_api_ip4_address_t in_addr;
1145 vl_api_ip4_address_t out_addr;
1152 /** \brief Close deterministic NAT session by outside address and port
1153 @param client_index - opaque cookie to identify the sender
1154 @param context - sender context, to match reply w/ request
1155 @param out_addr - outside IPv4 address
1156 @param out_port - outside port
1157 @param ext_addr - external host IPv4 address
1158 @param ext_port - external host port
1160 autoreply define nat_det_close_session_out {
1163 vl_api_ip4_address_t out_addr;
1165 vl_api_ip4_address_t ext_addr;
1169 /** \brief Close deterministic NAT session by inside address and port
1170 @param client_index - opaque cookie to identify the sender
1171 @param context - sender context, to match reply w/ request
1172 @param in_addr - inside IP address
1173 @param in_port - inside port
1174 @param ext_addr - external host IP address
1175 @param ext_port - external host port
1177 autoreply define nat_det_close_session_in {
1180 vl_api_ip4_address_t in_addr;
1182 vl_api_ip4_address_t ext_addr;
1186 /** \brief Dump determinstic NAT sessions
1187 @param client_index - opaque cookie to identify the sender
1188 @param context - sender context, to match reply w/ request
1189 @param user_addr - address of an inside user whose sessions to dump
1191 define nat_det_session_dump {
1194 vl_api_ip4_address_t user_addr;
1197 /** \brief Deterministic NAT sessions reply
1198 @param context - sender context, to match reply w/ request
1199 @param in_port - inside port
1200 @param ext_addr - external host IPv4 address
1201 @param ext_port - external host port
1202 @param out_port - outside NAT port
1203 @param state - session state
1204 @param expire - session expiration timestamp
1206 define nat_det_session_details {
1209 vl_api_ip4_address_t ext_addr;
1220 /** \brief Add/delete address range to NAT64 pool
1221 @param client_index - opaque cookie to identify the sender
1222 @param context - sender context, to match reply w/ request
1223 @param start_addr - start IPv4 address of the range
1224 @param end_addr - end IPv4 address of the range
1225 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1226 @param is_add - true if add, false if delete
1228 autoreply define nat64_add_del_pool_addr_range {
1231 vl_api_ip4_address_t start_addr;
1232 vl_api_ip4_address_t end_addr;
1237 /** \brief Dump NAT64 pool addresses
1238 @param client_index - opaque cookie to identify the sender
1239 @param context - sender context, to match reply w/ request
1241 define nat64_pool_addr_dump {
1246 /** \brief NAT64 pool address details response
1247 @param context - sender context, to match reply w/ request
1248 @param address - IPv4 address
1249 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1251 define nat64_pool_addr_details {
1253 vl_api_ip4_address_t address;
1257 /** \brief Enable/disable NAT64 feature on the interface
1258 @param client_index - opaque cookie to identify the sender
1259 @param context - sender context, to match reply w/ request
1260 @param is_add - true if add, false if delete
1261 @param flags - flag NAT_IS_INSIDE if interface is inside else
1262 interface is outside
1263 @param sw_if_index - index of the interface
1265 autoreply define nat64_add_del_interface {
1269 vl_api_nat_config_flags_t flags;
1270 vl_api_interface_index_t sw_if_index;
1273 /** \brief Dump interfaces with NAT64 feature
1274 @param client_index - opaque cookie to identify the sender
1275 @param context - sender context, to match reply w/ request
1277 define nat64_interface_dump {
1282 /** \brief NAT64 interface details response
1283 @param context - sender context, to match reply w/ request
1284 @param flags - flag NAT_IS_INSIDE if interface is inside,
1285 flag NAT_IS_OUTSIDE if interface is outside
1286 and if both flags are set the interface is
1287 both inside and outside
1288 @param sw_if_index - index of the interface
1290 define nat64_interface_details {
1292 vl_api_nat_config_flags_t flags;
1293 vl_api_interface_index_t sw_if_index;
1296 /** \brief Add/delete NAT64 static BIB entry
1297 @param client_index - opaque cookie to identify the sender
1298 @param context - sender context, to match reply w/ request
1299 @param i_addr - inside IPv6 address
1300 @param o_addr - outside IPv4 address
1301 @param i_port - inside port number
1302 @param o_port - outside port number
1303 @param vrf_id - VRF id of tenant
1304 @param proto - protocol number
1305 @param is_add - true if add, false if delete
1307 autoreply define nat64_add_del_static_bib {
1310 vl_api_ip6_address_t i_addr;
1311 vl_api_ip4_address_t o_addr;
1319 /** \brief Dump NAT64 BIB
1320 @param client_index - opaque cookie to identify the sender
1321 @param context - sender context, to match reply w/ request
1322 @param proto - protocol of the BIB: 255 - all BIBs
1326 otherwise - "unknown" protocol BIB
1328 define nat64_bib_dump {
1334 /** \brief NAT64 BIB details response
1335 @param context - sender context, to match reply w/ request
1336 @param i_addr - inside IPv6 address
1337 @param o_addr - outside IPv4 address
1338 @param i_port - inside port number
1339 @param o_port - outside port number
1340 @param vrf_id - VRF id of tenant
1341 @param proto - protocol number
1342 @param flags - flag NAT_IS_STATIC if BIB entry is static
1343 or BIB entry is dynamic
1344 @param ses_num - number of sessions associated with the BIB entry
1346 define nat64_bib_details {
1348 vl_api_ip6_address_t i_addr;
1349 vl_api_ip4_address_t o_addr;
1354 vl_api_nat_config_flags_t flags;
1358 /** \brief Dump NAT64 session table
1359 @param client_index - opaque cookie to identify the sender
1360 @param context - sender context, to match reply w/ request
1361 @param proto - protocol of the session table: 255 - all STs
1365 otherwise - "unknown" proto ST
1367 define nat64_st_dump {
1373 /** \brief NAT64 session table details response
1374 @param context - sender context, to match reply w/ request
1375 @param il_addr - inside IPv6 address of the local host
1376 @param ol_addr - outside IPv4 address of the local host
1377 @param il_port - inside port number id of the local host/inside ICMP id
1378 @param ol_port - outside port number of the local host/outside ICMP id
1379 @param ir_addr - inside IPv6 address of the remote host
1380 @param or_addr - outside IPv4 address of the remote host
1381 @param r_port - port number of the remote host (not used for ICMP)
1382 @param vrf_id - VRF id of tenant
1383 @param proto - protocol number
1385 define nat64_st_details {
1387 vl_api_ip6_address_t il_addr;
1388 vl_api_ip4_address_t ol_addr;
1391 vl_api_ip6_address_t ir_addr;
1392 vl_api_ip4_address_t or_addr;
1398 /** \brief Add/del NAT64 prefix
1399 @param client_index - opaque cookie to identify the sender
1400 @param context - sender context, to match reply w/ request
1401 @param prefix - NAT64 prefix
1402 @param vrf_id - VRF id of tenant
1403 @param is_add - true if add, false if delete
1405 autoreply define nat64_add_del_prefix {
1408 vl_api_ip6_prefix_t prefix;
1413 /** \brief Dump NAT64 prefix
1414 @param client_index - opaque cookie to identify the sender
1415 @param context - sender context, to match reply w/ request
1417 define nat64_prefix_dump {
1422 /** \brief Dump NAT64 prefix details response
1423 @param context - sender context, to match reply w/ request
1424 @param prefix - NAT64 prefix
1425 @param vrf_id - VRF id of tenant
1427 define nat64_prefix_details {
1429 vl_api_ip6_prefix_t prefix;
1433 /** \brief Add/delete NAT64 pool address from specific interfce
1434 @param client_index - opaque cookie to identify the sender
1435 @param context - sender context, to match reply w/ request
1436 @param is_add - true if add, false if delete
1437 @param sw_if_index - software index of the interface
1439 autoreply define nat64_add_del_interface_addr {
1443 vl_api_interface_index_t sw_if_index;
1450 /** \brief Add/delete address range to DS-Lite pool
1451 @param client_index - opaque cookie to identify the sender
1452 @param context - sender context, to match reply w/ request
1453 @param start_addr - start IPv4 address of the range
1454 @param end_addr - end IPv4 address of the range
1455 @param is_add - true if add, false if delete
1457 autoreply define dslite_add_del_pool_addr_range {
1460 vl_api_ip4_address_t start_addr;
1461 vl_api_ip4_address_t end_addr;
1465 /** \brief Dump DS-Lite addresses
1466 @param client_index - opaque cookie to identify the sender
1467 @param context - sender context, to match reply w/ request
1469 define dslite_address_dump {
1474 /** \brief DS-Lite address details response
1475 @param context - sender context, to match reply w/ request
1476 @param ip_address - IPv4 address
1478 define dslite_address_details {
1480 vl_api_ip4_address_t ip_address;
1483 /** \brief Set AFTR IPv6 and IPv4 addresses
1484 @param client_index - opaque cookie to identify the sender
1485 @param context - sender context, to match reply w/ request
1486 @param ip4_addr - IPv4 address
1487 @param ip6_addr - IPv6 address
1489 autoreply define dslite_set_aftr_addr {
1492 vl_api_ip4_address_t ip4_addr;
1493 vl_api_ip6_address_t ip6_addr;
1496 /** \brief Get AFTR IPv6 and IPv4 addresses
1497 @param client_index - opaque cookie to identify the sender
1498 @param context - sender context, to match reply w/ request
1500 define dslite_get_aftr_addr {
1505 /** \brief Response to get AFTR IPv6 and IPv4 addresses
1506 @param context - sender context, to match reply w/ request
1507 @param retval - return code
1508 @param ip4_addr - IPv4 address
1509 @param ip6_addr - IPv6 address
1511 define dslite_get_aftr_addr_reply {
1514 vl_api_ip4_address_t ip4_addr;
1515 vl_api_ip6_address_t ip6_addr;
1518 /** \brief Set B4 IPv6 and IPv4 addresses
1519 @param client_index - opaque cookie to identify the sender
1520 @param context - sender context, to match reply w/ request
1521 @param ip4_addr - IPv4 address
1522 @param ip6_addr - IPv6 address
1524 autoreply define dslite_set_b4_addr {
1527 vl_api_ip4_address_t ip4_addr;
1528 vl_api_ip6_address_t ip6_addr;
1531 /** \brief Get B4 IPv6 and IPv4 addresses
1532 @param client_index - opaque cookie to identify the sender
1533 @param context - sender context, to match reply w/ request
1535 define dslite_get_b4_addr {
1540 /** \brief Response to get B4 IPv6 and IPv4 addresses
1541 @param context - sender context, to match reply w/ request
1542 @param retval - return code
1543 @param ip4_addr - IPv4 address
1544 @param ip6_addr - IPv6 address
1546 define dslite_get_b4_addr_reply {
1549 vl_api_ip4_address_t ip4_addr;
1550 vl_api_ip6_address_t ip6_addr;
1556 /** \brief Enable/disable NAT66 feature on the interface
1557 @param client_index - opaque cookie to identify the sender
1558 @param context - sender context, to match reply w/ request
1559 @param is_add - true if add, false if delete
1560 @param flags - flag NAT_IS_INSIDE if interface is inside or
1561 interface is outside,
1562 @param sw_if_index - software index of the interface
1564 autoreply define nat66_add_del_interface {
1568 vl_api_nat_config_flags_t flags;
1569 vl_api_interface_index_t sw_if_index;
1572 /** \brief Dump interfaces with NAT66 feature
1573 @param client_index - opaque cookie to identify the sender
1574 @param context - sender context, to match reply w/ request
1576 define nat66_interface_dump {
1581 /** \brief NAT66 interface details response
1582 @param context - sender context, to match reply w/ request
1583 @param flags - flag NAT_IS_INSIDE if interface is inside or
1584 interface is outside,
1585 @param sw_if_index - software index of the interface
1587 define nat66_interface_details {
1589 vl_api_nat_config_flags_t flags;
1590 vl_api_interface_index_t sw_if_index;
1593 /** \brief Add/delete 1:1 NAT66
1594 @param client_index - opaque cookie to identify the sender
1595 @param context - sender context, to match reply w/ request
1596 @param is_add - true if add, false if delete
1597 @param local_ip_address - local IPv6 address
1598 @param external_ip_address - external IPv6 address
1599 @param vrf_id - VRF id of tenant
1601 autoreply define nat66_add_del_static_mapping {
1605 vl_api_ip6_address_t local_ip_address;
1606 vl_api_ip6_address_t external_ip_address;
1610 /** \brief Dump NAT66 static mappings
1611 @param client_index - opaque cookie to identify the sender
1612 @param context - sender context, to match reply w/ request
1614 define nat66_static_mapping_dump {
1619 /** \brief NAT66 static mapping details response
1620 @param context - sender context, to match reply w/ request
1621 @param local_ip_address - local IPv6 address
1622 @param external_ip_address - external IPv6 address
1623 @param vrf_id - VRF id of tenant
1624 @param total_bytes - count of bytes sent through static mapping
1625 @param total_pkts - count of pakets sent through static mapping
1627 define nat66_static_mapping_details {
1629 vl_api_ip6_address_t local_ip_address;
1630 vl_api_ip6_address_t external_ip_address;