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.2.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/nat_types.api";
23 * @brief VPP control-plane API messages.
25 * This file defines VPP control-plane API messages which are generally
26 * called through a shared memory interface.
30 * Common NAT plugin APIs
33 /** \brief Control ping from client to api server request
34 @param client_index - opaque cookie to identify the sender
35 @param context - sender context, to match reply w/ request
37 define nat_control_ping
43 /** \brief Control ping from the client to the server response
44 @param client_index - opaque cookie to identify the sender
45 @param context - sender context, to match reply w/ request
46 @param retval - return code for the request
47 @param vpe_pid - the pid of the vpe, returned by the server
49 define nat_control_ping_reply
57 /** \brief Show NAT plugin startup config
58 @param client_index - opaque cookie to identify the sender
59 @param context - sender context, to match reply w/ request
61 define nat_show_config
67 /** \brief Show NAT plugin startup config reply
68 @param context - sender context, to match reply w/ request
69 @param retval - return code for the request
70 @param static_mapping_only - if true dynamic translations disabled
71 @param static_mapping_connection_tracking - if true create session data
72 @param deterministic - if true deterministic mapping
73 @param endpoint_dependent - if true endpoint-dependent mode
74 @param out2in_dpo - if true out2in dpo mode
75 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
76 @param translation_buckets - number of translation hash buckets
77 @param translation_memory_size - translation hash memory size
78 @param user_buckets - number of user hash buckets
79 @param user_memory_size - user hash memory size
80 @param max_translations_per_user - maximum number of translations per user
81 @param outside_vrf_id - outside VRF id
82 @param inside_vrf_id - default inside VRF id
83 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
84 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
85 @param nat64_st_buckets - number of NAT64 session table hash buckets
86 @param nat64_st_memory_size - memory size of NAT64 session table hash
88 define nat_show_config_reply
92 bool static_mapping_only;
93 bool static_mapping_connection_tracking;
95 bool endpoint_dependent;
98 u32 translation_buckets;
99 u32 translation_memory_size;
101 u64 user_memory_size;
102 u32 max_translations_per_user;
105 u32 nat64_bib_buckets;
106 u64 nat64_bib_memory_size;
107 u32 nat64_st_buckets;
108 u64 nat64_st_memory_size;
111 enum nat_log_level : u8
114 NAT_LOG_ERROR = 0x01,
115 NAT_LOG_WARNING = 0x02,
116 NAT_LOG_NOTICE = 0x03,
118 NAT_LOG_DEBUG = 0x05,
121 /** \brief Run nat44 garbage collection
122 @param client_index - opaque cookie to identify the sender
123 @param context - sender context, to match reply w/ request
125 autoreply define nat44_session_cleanup {
130 /** \brief NAT44 set session limit
131 @param client_index - opaque cookie to identify the sender
132 @param context - sender context, to match reply w/ request
133 @param session_limit - session limit
134 @param vrf_id - vrf id
136 autoreply define nat44_set_session_limit {
143 /** \brief Set NAT logging level
144 @param client_index - opaque cookie to identify the sender
145 @param context - sender context, to match reply w/ request
146 @param log_level - logging level
148 autoreply define nat_set_log_level {
151 vl_api_nat_log_level_t log_level;
154 /** \brief Set NAT workers
155 @param client_index - opaque cookie to identify the sender
156 @param context - sender context, to match reply w/ request
157 @param worker_mask - NAT workers mask
159 autoreply define nat_set_workers {
165 /** \brief Dump NAT workers
166 @param client_index - opaque cookie to identify the sender
167 @param context - sender context, to match reply w/ request
169 define nat_worker_dump {
174 /** \brief NAT workers details response
175 @param context - sender context, to match reply w/ request
176 @param worker_index - worker index
177 @param lcore_id - lcore ID
178 @param name - worker name
180 define nat_worker_details {
187 /** \brief Enable/disable NAT IPFIX logging
188 @param client_index - opaque cookie to identify the sender
189 @param context - sender context, to match reply w/ request
190 @param domain_id - observation domain ID
191 @param src_port - source port number
192 @param enable - true if enable, false if disable
194 autoreply define nat_ipfix_enable_disable {
202 /** \brief Set values of timeouts for NAT sessions (seconds)
203 @param client_index - opaque cookie to identify the sender
204 @param context - sender context, to match reply w/ request
205 @param udp - UDP timeout (default 300sec)
206 @param tcp_established - TCP established timeout (default 7440sec)
207 @param tcp_transitory - TCP transitory timeout (default 240sec)
208 @param icmp - ICMP timeout (default 60sec)
210 autoreply define nat_set_timeouts {
219 /** \brief Get values of timeouts for NAT sessions (seconds)
220 @param client_index - opaque cookie to identify the sender
221 @param context - sender context, to match reply w/ request
223 define nat_get_timeouts {
228 /** \brief Get values of timeouts for NAT sessions reply
229 @param context - sender context, to match reply w/ request
230 @param retval - return code
231 @param udp - UDP timeout
232 @param tcp_established - TCP established timeout
233 @param tcp_transitory - TCP transitory timeout
234 @param icmp - ICMP timeout
236 define nat_get_timeouts_reply {
245 /** \brief Set address and port assignment algorithm
246 @param client_index - opaque cookie to identify the sender
247 @param context - sender context, to match reply w/ request
248 @param alg - address and port assignment algorithm:
249 0 - default, 1 - MAP-E, 2 - port range
250 (see nat_addr_and_port_alloc_alg_t in nat.h)
251 @param psid_offset - number of offset bits (valid only for MAP-E alg)
252 @param psid_length - length of PSID (valid only for MAP-E alg)
253 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
254 @param start_port - beginning of the port range
255 @param end_port - end of the port range
257 autoreply define nat_set_addr_and_port_alloc_alg {
268 /** \brief Get address and port assignment algorithm
269 @param client_index - opaque cookie to identify the sender
270 @param context - sender context, to match reply w/ request
272 define nat_get_addr_and_port_alloc_alg {
277 /** \brief Get address and port assignment algorithm reply
278 @param context - sender context, to match reply w/ request
279 @param retval - return code
280 @param alg - address and port assignment algorithm:
281 0 - default, 1 - MAP-E, 2 - port range
282 (see nat_addr_and_port_alloc_alg_t in nat.h)
283 @param psid_offset - number of offset bits (valid only for MAP-E alg)
284 @param psid_length - length of PSID (valid only for MAP-E alg)
285 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
286 @param start_port - beginning of the port range
287 @param end_port - end of the port range
289 define nat_get_addr_and_port_alloc_alg_reply {
300 /** \brief Set TCP MSS rewriting configuration
301 @param client_index - opaque cookie to identify the sender
302 @param context - sender context, to match reply w/ request
303 @param mss_value - MSS value to be used for MSS rewriting
304 @param enable - if true enable MSS rewriting feature else disable
306 autoreply define nat_set_mss_clamping {
313 /** \brief Get TCP MSS rewriting configuration
314 @param client_index - opaque cookie to identify the sender
315 @param context - sender context, to match reply w/ request
317 define nat_get_mss_clamping {
322 /** \brief Get TCP MSS rewriting configuration reply
323 @param context - sender context, to match reply w/ request
324 @param retval - return code
325 @param mss_value - MSS value to be used for MSS rewriting
326 @param enable - if true enable MSS rewriting feature else disable
328 define nat_get_mss_clamping_reply {
335 /** \brief Set HA listener (local settings)
336 @param client_index - opaque cookie to identify the sender
337 @param context - sender context, to match reply w/ request
338 @param ip_address - local IP4 address
339 @param port - local UDP port number
340 @param path_mtu - path MTU between local and failover
342 autoreply define nat_ha_set_listener {
345 vl_api_ip4_address_t ip_address;
350 /** \brief Set HA failover (remote settings)
351 @param client_index - opaque cookie to identify the sender
352 @param context - sender context, to match reply w/ request
353 @param ip_address - failover IP4 address
354 @param port - failvoer UDP port number
355 @param session_refresh_interval - number of seconds after which to send
356 session counters refresh
358 autoreply define nat_ha_set_failover {
361 vl_api_ip4_address_t ip_address;
363 u32 session_refresh_interval;
366 /** \brief Get HA listener/local configuration
367 @param client_index - opaque cookie to identify the sender
368 @param context - sender context, to match reply w/ request
370 define nat_ha_get_listener {
375 /** \brief Get HA listener/local configuration reply
376 @param context - sender context, to match reply w/ request
377 @param retval - return code
378 @param ip_address - local IP4 address
379 @param port - local UDP port number
380 @param path_mtu - Path MTU between local and failover
382 define nat_ha_get_listener_reply {
385 vl_api_ip4_address_t ip_address;
390 /** \brief Get HA failover/remote settings
391 @param client_index - opaque cookie to identify the sender
392 @param context - sender context, to match reply w/ request
394 define nat_ha_get_failover {
399 /** \brief Get HA failover/remote settings reply
400 @param context - sender context, to match reply w/ request
401 @param retval - return code
402 @param ip_address - failover IP4 address
403 @param port - failvoer UDP port number
404 @param session_refresh_interval - number of seconds after which to send
405 session counters refresh
407 define nat_ha_get_failover_reply {
410 vl_api_ip4_address_t ip_address;
412 u32 session_refresh_interval;
415 /** \brief Flush the current HA data (for testing)
416 @param client_index - opaque cookie to identify the sender
417 @param context - sender context, to match reply w/ request
419 autoreply define nat_ha_flush {
424 /** \brief Resync HA (resend existing sessions to new failover)
425 @param client_index - opaque cookie to identify the sender
426 @param context - sender context, to match reply w/ request
427 @param want_resync_event - resync completed event sent to the sender via
428 nat_ha_resync_completed_event API message if
430 @param pid - sender's pid
432 autoreply define nat_ha_resync
436 u8 want_resync_event;
440 /** \brief Tell client about a HA resync completion event
441 @param client_index - opaque cookie to identify the sender
442 @param pid - client pid registered to receive notification
443 @param missed_count - number of missed (not ACKed) messages
445 define nat_ha_resync_completed_event
453 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
460 /** \brief Del NAT44 user
461 @param client_index - opaque cookie to identify the sender
462 @param context - sender context, to match reply w/ request
463 @param ip_address - IPv4 address
464 @param fib_index - FIB index
466 autoreply define nat44_del_user {
469 vl_api_ip4_address_t ip_address;
473 /** \brief Add/del NAT44 address range
474 @param client_index - opaque cookie to identify the sender
475 @param context - sender context, to match reply w/ request
476 @param first_ip_address - first IPv4 address
477 @param last_ip_address - last IPv4 address
478 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
479 @param is_add - true if add, false if delete
480 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
483 autoreply define nat44_add_del_address_range {
486 vl_api_ip4_address_t first_ip_address;
487 vl_api_ip4_address_t last_ip_address;
490 vl_api_nat_config_flags_t flags;
493 /** \brief Dump NAT44 addresses
494 @param client_index - opaque cookie to identify the sender
495 @param context - sender context, to match reply w/ request
497 define nat44_address_dump {
502 /** \brief NAT44 address details response
503 @param context - sender context, to match reply w/ request
504 @param ip_address - IPv4 address
505 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
506 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
508 define nat44_address_details {
510 vl_api_ip4_address_t ip_address;
511 vl_api_nat_config_flags_t flags;
515 /** \brief Enable/disable NAT44 feature on the interface
516 @param client_index - opaque cookie to identify the sender
517 @param context - sender context, to match reply w/ request
518 @param is_add - true if add, false if delete
519 @param flags - flag NAT_IS_INSIDE if interface is inside else
521 @param sw_if_index - software index of the interface
523 autoreply define nat44_interface_add_del_feature {
527 vl_api_nat_config_flags_t flags;
528 vl_api_interface_index_t sw_if_index;
531 /** \brief Dump interfaces with NAT44 feature
532 @param client_index - opaque cookie to identify the sender
533 @param context - sender context, to match reply w/ request
535 define nat44_interface_dump {
540 /** \brief NAT44 interface details response
541 @param context - sender context, to match reply w/ request
542 @param sw_if_index - software index of the interface
543 @param flags - flag NAT_IS_INSIDE if interface is inside,
544 flag NAT_IS_OUTSIDE if interface is outside
545 and if both flags are set the interface is
546 both inside and outside
548 define nat44_interface_details {
550 vl_api_nat_config_flags_t flags;
551 vl_api_interface_index_t sw_if_index;
554 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
556 @param client_index - opaque cookie to identify the sender
557 @param context - sender context, to match reply w/ request
558 @param is_add - true if add, false if delete
559 @param flags - flag NAT_IS_INSIDE if interface is inside else
561 @param sw_if_index - software index of the interface
563 autoreply define nat44_interface_add_del_output_feature {
567 vl_api_nat_config_flags_t flags;
568 vl_api_interface_index_t sw_if_index;
571 /** \brief Dump interfaces with NAT44 output feature
572 @param client_index - opaque cookie to identify the sender
573 @param context - sender context, to match reply w/ request
575 define nat44_interface_output_feature_dump {
580 /** \brief NAT44 interface with output feature details response
581 @param context - sender context, to match reply w/ request
582 @param flags - flag NAT_IS_INSIDE if interface is inside else
584 @param sw_if_index - software index of the interface
586 define nat44_interface_output_feature_details {
588 vl_api_nat_config_flags_t flags;
589 vl_api_interface_index_t sw_if_index;
592 /** \brief Add/delete NAT44 static mapping
593 @param client_index - opaque cookie to identify the sender
594 @param context - sender context, to match reply w/ request
595 @param is_add - true if add, false if delete
596 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
597 flag nat_is_twice_nat if nat address range for external hosts,
598 flag NAT_IS_SELF_TWICE_NAT if translate external host address
599 and port whenever external host address equals local
600 address of internal host,
601 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
602 @param local_ip_address - local IPv4 address
603 @param external_ip_address - external IPv4 address
604 @param protocol - IP protocol, used only if addr_only=0
605 @param local_port - local port number, used only if addr_only=0
606 @param external_port - external port number, used only if addr_only=0
607 @param external_sw_if_index - external interface (if set
608 external_ip_address is ignored, ~0 means not
610 @param vfr_id - VRF ID
611 @param tag - opaque string tag
613 autoreply define nat44_add_del_static_mapping {
617 vl_api_nat_config_flags_t flags;
618 vl_api_ip4_address_t local_ip_address;
619 vl_api_ip4_address_t external_ip_address;
623 vl_api_interface_index_t external_sw_if_index;
628 /** \brief Dump NAT44 static mappings
629 @param client_index - opaque cookie to identify the sender
630 @param context - sender context, to match reply w/ request
632 define nat44_static_mapping_dump {
637 /** \brief NAT44 static mapping details response
638 @param context - sender context, to match reply w/ request
639 @param flags - flag NAT_ADDR_ONLY if address only mapping,
640 flag NAT_TWICE_NAT if NAT address range for external hosts,
641 flag NAT_SELF_TWICE_NAT if translate external host address
642 and port whenever external host address equals local
643 address of internal host,
644 flag NAT_OUT2IN_ONLY if rule match only out2in direction
645 @param local_ip_address - local IPv4 address
646 @param external_ip_address - external IPv4 address
647 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
648 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
649 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
650 @param external_sw_if_index - external interface
651 @param vfr_id - VRF ID
652 @param tag - opaque string tag
654 define nat44_static_mapping_details {
656 vl_api_nat_config_flags_t flags;
657 vl_api_ip4_address_t local_ip_address;
658 vl_api_ip4_address_t external_ip_address;
662 vl_api_interface_index_t external_sw_if_index;
667 /** \brief Add/delete NAT44 identity mapping
668 @param client_index - opaque cookie to identify the sender
669 @param context - sender context, to match reply w/ request
670 @param is_add - true if add, false if delete
671 @param flags - flag NAT_ADDR_ONLY if address only mapping
672 @param ip_address - IPv4 address
673 @param protocol - IP protocol
674 @param port - port number
675 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
677 @param vfr_id - VRF ID (if ~0 use default VRF)
678 @param tag - opaque string tag
680 autoreply define nat44_add_del_identity_mapping {
684 vl_api_nat_config_flags_t flags;
685 vl_api_ip4_address_t ip_address;
688 vl_api_interface_index_t sw_if_index;
693 /** \brief Dump NAT44 identity mappings
694 @param client_index - opaque cookie to identify the sender
695 @param context - sender context, to match reply w/ request
697 define nat44_identity_mapping_dump {
702 /** \brief NAT44 identity mapping details response
703 @param context - sender context, to match reply w/ request
704 @param flags - flag NAT_ADDR_ONLY if address only mapping
705 @param ip_address - IPv4 address
706 @param protocol - IP protocol
707 @param port - port number
708 @param sw_if_index - interface
709 @param vfr_id - VRF ID
710 @param tag - opaque string tag
712 define nat44_identity_mapping_details {
714 vl_api_nat_config_flags_t flags;
715 vl_api_ip4_address_t ip_address;
718 vl_api_interface_index_t sw_if_index;
723 /** \brief Add/delete NAT44 pool address from specific interfce
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 sw_if_index - software index of the interface
728 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
730 autoreply define nat44_add_del_interface_addr {
734 vl_api_interface_index_t sw_if_index;
735 vl_api_nat_config_flags_t flags;
738 /** \brief Dump NAT44 pool addresses interfaces
739 @param client_index - opaque cookie to identify the sender
740 @param context - sender context, to match reply w/ request
742 define nat44_interface_addr_dump {
747 /** \brief NAT44 pool addresses interfaces details response
748 @param context - sender context, to match reply w/ request
749 @param sw_if_index - software index of the interface
750 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
753 define nat44_interface_addr_details {
755 vl_api_interface_index_t sw_if_index;
756 vl_api_nat_config_flags_t flags;
759 /** \brief Dump NAT44 users
760 @param client_index - opaque cookie to identify the sender
761 @param context - sender context, to match reply w/ request
763 define nat44_user_dump {
768 /** \brief NAT44 users response
769 @param context - sender context, to match reply w/ request
771 @param ip_address - IPv4 address
772 @param nsessions - number of dynamic sessions
773 @param nstaticsessions - number of static sessions
775 define nat44_user_details {
778 vl_api_ip4_address_t ip_address;
783 /** \brief NAT44 user's sessions
784 @param client_index - opaque cookie to identify the sender
785 @param context - sender context, to match reply w/ request
786 @param ip_address - IPv4 address of the user to dump
787 @param vrf_id - VRF_ID
789 define nat44_user_session_dump {
792 vl_api_ip4_address_t ip_address;
796 /** \brief NAT44 user's sessions response
797 @param context - sender context, to match reply w/ request
798 @param outside_ip_address - outside IPv4 address
799 @param outside_port - outside port
800 @param inside_ip_address - inside IPv4 address
801 @param inside_port - inside port
802 @param protocol - protocol
803 @param flags - flag NAT_IS_STATIC if session is static,
804 flag NAT_IS_TWICE_NAT if session is twice-nat,
805 flag NAT_IS_EXT_HOST_VALID if external host address
807 @param last_heard - last heard timer
808 @param total_bytes - count of bytes sent through session
809 @param total_pkts - count of pakets sent through session
810 @param ext_host_address - external host IPv4 address
811 @param ext_host_port - external host port
812 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
813 only if twice-nat session)
814 @param ext_host_nat_port - post-NAT external host port (valid only if
817 define nat44_user_session_details {
819 vl_api_ip4_address_t outside_ip_address;
821 vl_api_ip4_address_t inside_ip_address;
824 vl_api_nat_config_flags_t flags;
828 vl_api_ip4_address_t ext_host_address;
830 vl_api_ip4_address_t ext_host_nat_address;
831 u16 ext_host_nat_port;
834 /** \brief NAT44 load-balancing address and port pair
835 @param addr - IPv4 address of the internal node
836 @param port - L4 port number of the internal node
837 @param probability - probability of the internal node to be randomly matched
838 @param vrf_id - VRF id
840 typedef nat44_lb_addr_port {
841 vl_api_ip4_address_t addr;
847 /** \brief Add/delete NAT44 load-balancing static mapping rule
848 @param client_index - opaque cookie to identify the sender
849 @param context - sender context, to match reply w/ request
850 @param is_add - true if add, false if delete
851 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
852 flag NAT_SELF_TWICE_NAT if translate external host address
853 and port whenever external host address equals local
854 address of internal host,
855 flag NAT_OUT2IN_ONLY if rule match only out2in direction
856 @param external_addr - external IPv4 address of the service
857 @param external_port - external L4 port number of the service
858 @param protocol - IP protocol number of the service
859 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
861 @param local_num - number of local network nodes
862 @param locals - local network nodes
863 @param tag - opaque string tag
865 autoreply manual_endian define nat44_add_del_lb_static_mapping {
869 vl_api_nat_config_flags_t flags;
870 vl_api_ip4_address_t external_addr;
876 vl_api_nat44_lb_addr_port_t locals[local_num];
879 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
880 @param client_index - opaque cookie to identify the sender
881 @param context - sender context, to match reply w/ request
882 @param is_add - true if add, false if delete
883 @param external_addr - external IPv4 address of the service
884 @param external_port - external L4 port number of the service
885 @param protocol - IP protocol number of the service
886 @param local - local network node
888 autoreply define nat44_lb_static_mapping_add_del_local {
892 vl_api_ip4_address_t external_addr;
895 vl_api_nat44_lb_addr_port_t local;
898 /** \brief Dump NAT44 load-balancing static mapping rules
899 @param client_index - opaque cookie to identify the sender
900 @param context - sender context, to match reply w/ request
902 define nat44_lb_static_mapping_dump {
907 /** \brief NAT44 load-balancing static mapping rule details response
908 @param context - sender context, to match reply w/ request
909 @param external_addr - external IPv4 address of the service
910 @param external_port - external L4 port number of the service
911 @param protocol - IP protocol number of the service
912 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
913 flag NAT_SELF_TWICE_NAT if translate external host address
914 and port whenever external host address equals local
915 address of internal host,
916 flag NAT_OUT2IN_ONLY if rule match only out2in direction
917 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
919 @param local_num - number of local network nodes
920 @param locals - local network nodes
921 @param tag - opaque string tag
923 manual_endian define nat44_lb_static_mapping_details {
925 vl_api_ip4_address_t external_addr;
928 vl_api_nat_config_flags_t flags;
932 vl_api_nat44_lb_addr_port_t locals[local_num];
935 /** \brief Delete NAT44 session
936 @param client_index - opaque cookie to identify the sender
937 @param context - sender context, to match reply w/ request
938 @param ip_address - IPv4 address
939 @param protocol - IP protocol
940 @param port - port number
941 @param vfr_id - VRF ID
942 @param flags - flag NAT_IS_INSIDE if interface is inside or
943 interface is outside,
944 flag NAT_IS_EXT_HOST_VALID if external host address and
946 @param ext_host_address - external host IPv4 address
947 @param ext_host_port - external host port
949 autoreply define nat44_del_session {
952 vl_api_ip4_address_t address;
956 vl_api_nat_config_flags_t flags;
957 vl_api_ip4_address_t ext_host_address;
961 /** \brief Enable/disable forwarding for NAT44
962 Forward packets which don't match existing translation
963 or static mapping instead of dropping them.
964 @param client_index - opaque cookie to identify the sender
965 @param context - sender context, to match reply w/ request
966 @param enable - true for enable, false for disable
968 autoreply define nat44_forwarding_enable_disable {
974 /** \brief Check if forwarding is enabled or disabled
975 @param client_index - opaque cookie to identify the sender
976 @param context - sender context, to match reply w/ request
978 define nat44_forwarding_is_enabled {
983 /** \brief Response to check if forwarding is enabled or disabled
984 @param context - sender context, to match reply w/ request
985 @param enabled - true if enabled, false if disabled
987 define nat44_forwarding_is_enabled_reply {
996 /** \brief Add/delete address range to NAT64 pool
997 @param client_index - opaque cookie to identify the sender
998 @param context - sender context, to match reply w/ request
999 @param start_addr - start IPv4 address of the range
1000 @param end_addr - end IPv4 address of the range
1001 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1002 @param is_add - true if add, false if delete
1004 autoreply define nat64_add_del_pool_addr_range {
1007 vl_api_ip4_address_t start_addr;
1008 vl_api_ip4_address_t end_addr;
1013 /** \brief Dump NAT64 pool addresses
1014 @param client_index - opaque cookie to identify the sender
1015 @param context - sender context, to match reply w/ request
1017 define nat64_pool_addr_dump {
1022 /** \brief NAT64 pool address details response
1023 @param context - sender context, to match reply w/ request
1024 @param address - IPv4 address
1025 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1027 define nat64_pool_addr_details {
1029 vl_api_ip4_address_t address;
1033 /** \brief Enable/disable NAT64 feature on the interface
1034 @param client_index - opaque cookie to identify the sender
1035 @param context - sender context, to match reply w/ request
1036 @param is_add - true if add, false if delete
1037 @param flags - flag NAT_IS_INSIDE if interface is inside else
1038 interface is outside
1039 @param sw_if_index - index of the interface
1041 autoreply define nat64_add_del_interface {
1045 vl_api_nat_config_flags_t flags;
1046 vl_api_interface_index_t sw_if_index;
1049 /** \brief Dump interfaces with NAT64 feature
1050 @param client_index - opaque cookie to identify the sender
1051 @param context - sender context, to match reply w/ request
1053 define nat64_interface_dump {
1058 /** \brief NAT64 interface details response
1059 @param context - sender context, to match reply w/ request
1060 @param flags - flag NAT_IS_INSIDE if interface is inside,
1061 flag NAT_IS_OUTSIDE if interface is outside
1062 and if both flags are set the interface is
1063 both inside and outside
1064 @param sw_if_index - index of the interface
1066 define nat64_interface_details {
1068 vl_api_nat_config_flags_t flags;
1069 vl_api_interface_index_t sw_if_index;
1072 /** \brief Add/delete NAT64 static BIB entry
1073 @param client_index - opaque cookie to identify the sender
1074 @param context - sender context, to match reply w/ request
1075 @param i_addr - inside IPv6 address
1076 @param o_addr - outside IPv4 address
1077 @param i_port - inside port number
1078 @param o_port - outside port number
1079 @param vrf_id - VRF id of tenant
1080 @param proto - protocol number
1081 @param is_add - true if add, false if delete
1083 autoreply define nat64_add_del_static_bib {
1086 vl_api_ip6_address_t i_addr;
1087 vl_api_ip4_address_t o_addr;
1095 /** \brief Dump NAT64 BIB
1096 @param client_index - opaque cookie to identify the sender
1097 @param context - sender context, to match reply w/ request
1098 @param proto - protocol of the BIB: 255 - all BIBs
1102 otherwise - "unknown" protocol BIB
1104 define nat64_bib_dump {
1110 /** \brief NAT64 BIB details response
1111 @param context - sender context, to match reply w/ request
1112 @param i_addr - inside IPv6 address
1113 @param o_addr - outside IPv4 address
1114 @param i_port - inside port number
1115 @param o_port - outside port number
1116 @param vrf_id - VRF id of tenant
1117 @param proto - protocol number
1118 @param flags - flag NAT_IS_STATIC if BIB entry is static
1119 or BIB entry is dynamic
1120 @param ses_num - number of sessions associated with the BIB entry
1122 define nat64_bib_details {
1124 vl_api_ip6_address_t i_addr;
1125 vl_api_ip4_address_t o_addr;
1130 vl_api_nat_config_flags_t flags;
1134 /** \brief Dump NAT64 session table
1135 @param client_index - opaque cookie to identify the sender
1136 @param context - sender context, to match reply w/ request
1137 @param proto - protocol of the session table: 255 - all STs
1141 otherwise - "unknown" proto ST
1143 define nat64_st_dump {
1149 /** \brief NAT64 session table details response
1150 @param context - sender context, to match reply w/ request
1151 @param il_addr - inside IPv6 address of the local host
1152 @param ol_addr - outside IPv4 address of the local host
1153 @param il_port - inside port number id of the local host/inside ICMP id
1154 @param ol_port - outside port number of the local host/outside ICMP id
1155 @param ir_addr - inside IPv6 address of the remote host
1156 @param or_addr - outside IPv4 address of the remote host
1157 @param r_port - port number of the remote host (not used for ICMP)
1158 @param vrf_id - VRF id of tenant
1159 @param proto - protocol number
1161 define nat64_st_details {
1163 vl_api_ip6_address_t il_addr;
1164 vl_api_ip4_address_t ol_addr;
1167 vl_api_ip6_address_t ir_addr;
1168 vl_api_ip4_address_t or_addr;
1174 /** \brief Add/del NAT64 prefix
1175 @param client_index - opaque cookie to identify the sender
1176 @param context - sender context, to match reply w/ request
1177 @param prefix - NAT64 prefix
1178 @param vrf_id - VRF id of tenant
1179 @param is_add - true if add, false if delete
1181 autoreply define nat64_add_del_prefix {
1184 vl_api_ip6_prefix_t prefix;
1189 /** \brief Dump NAT64 prefix
1190 @param client_index - opaque cookie to identify the sender
1191 @param context - sender context, to match reply w/ request
1193 define nat64_prefix_dump {
1198 /** \brief Dump NAT64 prefix details response
1199 @param context - sender context, to match reply w/ request
1200 @param prefix - NAT64 prefix
1201 @param vrf_id - VRF id of tenant
1203 define nat64_prefix_details {
1205 vl_api_ip6_prefix_t prefix;
1209 /** \brief Add/delete NAT64 pool address from specific interfce
1210 @param client_index - opaque cookie to identify the sender
1211 @param context - sender context, to match reply w/ request
1212 @param is_add - true if add, false if delete
1213 @param sw_if_index - software index of the interface
1215 autoreply define nat64_add_del_interface_addr {
1219 vl_api_interface_index_t sw_if_index;