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";
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 values of timeouts for NAT sessions (seconds)
193 @param client_index - opaque cookie to identify the sender
194 @param context - sender context, to match reply w/ request
195 @param udp - UDP timeout (default 300sec)
196 @param tcp_established - TCP established timeout (default 7440sec)
197 @param tcp_transitory - TCP transitory timeout (default 240sec)
198 @param icmp - ICMP timeout (default 60sec)
200 autoreply define nat_set_timeouts {
209 /** \brief Get values of timeouts for NAT sessions (seconds)
210 @param client_index - opaque cookie to identify the sender
211 @param context - sender context, to match reply w/ request
213 define nat_get_timeouts {
218 /** \brief Get values of timeouts for NAT sessions reply
219 @param context - sender context, to match reply w/ request
220 @param retval - return code
221 @param udp - UDP timeout
222 @param tcp_established - TCP established timeout
223 @param tcp_transitory - TCP transitory timeout
224 @param icmp - ICMP timeout
226 define nat_get_timeouts_reply {
235 /** \brief Set address and port assignment algorithm
236 @param client_index - opaque cookie to identify the sender
237 @param context - sender context, to match reply w/ request
238 @param alg - address and port assignment algorithm:
239 0 - default, 1 - MAP-E, 2 - port range
240 (see nat_addr_and_port_alloc_alg_t in nat.h)
241 @param psid_offset - number of offset bits (valid only for MAP-E alg)
242 @param psid_length - length of PSID (valid only for MAP-E alg)
243 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
244 @param start_port - beginning of the port range
245 @param end_port - end of the port range
247 autoreply define nat_set_addr_and_port_alloc_alg {
258 /** \brief Get address and port assignment algorithm
259 @param client_index - opaque cookie to identify the sender
260 @param context - sender context, to match reply w/ request
262 define nat_get_addr_and_port_alloc_alg {
267 /** \brief Get address and port assignment algorithm reply
268 @param context - sender context, to match reply w/ request
269 @param retval - return code
270 @param alg - address and port assignment algorithm:
271 0 - default, 1 - MAP-E, 2 - port range
272 (see nat_addr_and_port_alloc_alg_t in nat.h)
273 @param psid_offset - number of offset bits (valid only for MAP-E alg)
274 @param psid_length - length of PSID (valid only for MAP-E alg)
275 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
276 @param start_port - beginning of the port range
277 @param end_port - end of the port range
279 define nat_get_addr_and_port_alloc_alg_reply {
290 /** \brief Set TCP MSS rewriting configuration
291 @param client_index - opaque cookie to identify the sender
292 @param context - sender context, to match reply w/ request
293 @param mss_value - MSS value to be used for MSS rewriting
294 @param enable - if true enable MSS rewriting feature else disable
296 autoreply define nat_set_mss_clamping {
303 /** \brief Get TCP MSS rewriting configuration
304 @param client_index - opaque cookie to identify the sender
305 @param context - sender context, to match reply w/ request
307 define nat_get_mss_clamping {
312 /** \brief Get TCP MSS rewriting configuration reply
313 @param context - sender context, to match reply w/ request
314 @param retval - return code
315 @param mss_value - MSS value to be used for MSS rewriting
316 @param enable - if true enable MSS rewriting feature else disable
318 define nat_get_mss_clamping_reply {
325 /** \brief Set HA listener (local settings)
326 @param client_index - opaque cookie to identify the sender
327 @param context - sender context, to match reply w/ request
328 @param ip_address - local IP4 address
329 @param port - local UDP port number
330 @param path_mtu - path MTU between local and failover
332 autoreply define nat_ha_set_listener {
335 vl_api_ip4_address_t ip_address;
340 /** \brief Set HA failover (remote settings)
341 @param client_index - opaque cookie to identify the sender
342 @param context - sender context, to match reply w/ request
343 @param ip_address - failover IP4 address
344 @param port - failvoer UDP port number
345 @param session_refresh_interval - number of seconds after which to send
346 session counters refresh
348 autoreply define nat_ha_set_failover {
351 vl_api_ip4_address_t ip_address;
353 u32 session_refresh_interval;
356 /** \brief Get HA listener/local configuration
357 @param client_index - opaque cookie to identify the sender
358 @param context - sender context, to match reply w/ request
360 define nat_ha_get_listener {
365 /** \brief Get HA listener/local configuration reply
366 @param context - sender context, to match reply w/ request
367 @param retval - return code
368 @param ip_address - local IP4 address
369 @param port - local UDP port number
370 @param path_mtu - Path MTU between local and failover
372 define nat_ha_get_listener_reply {
375 vl_api_ip4_address_t ip_address;
380 /** \brief Get HA failover/remote settings
381 @param client_index - opaque cookie to identify the sender
382 @param context - sender context, to match reply w/ request
384 define nat_ha_get_failover {
389 /** \brief Get HA failover/remote settings reply
390 @param context - sender context, to match reply w/ request
391 @param retval - return code
392 @param ip_address - failover IP4 address
393 @param port - failvoer UDP port number
394 @param session_refresh_interval - number of seconds after which to send
395 session counters refresh
397 define nat_ha_get_failover_reply {
400 vl_api_ip4_address_t ip_address;
402 u32 session_refresh_interval;
405 /** \brief Flush the current HA data (for testing)
406 @param client_index - opaque cookie to identify the sender
407 @param context - sender context, to match reply w/ request
409 autoreply define nat_ha_flush {
414 /** \brief Resync HA (resend existing sessions to new failover)
415 @param client_index - opaque cookie to identify the sender
416 @param context - sender context, to match reply w/ request
417 @param want_resync_event - resync completed event sent to the sender via
418 nat_ha_resync_completed_event API message if
420 @param pid - sender's pid
422 autoreply define nat_ha_resync
426 u8 want_resync_event;
430 /** \brief Tell client about a HA resync completion event
431 @param client_index - opaque cookie to identify the sender
432 @param pid - client pid registered to receive notification
433 @param missed_count - number of missed (not ACKed) messages
435 define nat_ha_resync_completed_event
443 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
450 /** \brief Add/del NAT44 address range
451 @param client_index - opaque cookie to identify the sender
452 @param context - sender context, to match reply w/ request
453 @param first_ip_address - first IPv4 address
454 @param last_ip_address - last IPv4 address
455 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
456 @param is_add - true if add, false if delete
457 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
460 autoreply define nat44_add_del_address_range {
463 vl_api_ip4_address_t first_ip_address;
464 vl_api_ip4_address_t last_ip_address;
467 vl_api_nat_config_flags_t flags;
470 /** \brief Dump NAT44 addresses
471 @param client_index - opaque cookie to identify the sender
472 @param context - sender context, to match reply w/ request
474 define nat44_address_dump {
479 /** \brief NAT44 address details response
480 @param context - sender context, to match reply w/ request
481 @param ip_address - IPv4 address
482 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
483 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
485 define nat44_address_details {
487 vl_api_ip4_address_t ip_address;
488 vl_api_nat_config_flags_t flags;
492 /** \brief Enable/disable NAT44 feature on the interface
493 @param client_index - opaque cookie to identify the sender
494 @param context - sender context, to match reply w/ request
495 @param is_add - true if add, false if delete
496 @param flags - flag NAT_IS_INSIDE if interface is inside else
498 @param sw_if_index - software index of the interface
500 autoreply define nat44_interface_add_del_feature {
504 vl_api_nat_config_flags_t flags;
505 vl_api_interface_index_t sw_if_index;
508 /** \brief Dump interfaces with NAT44 feature
509 @param client_index - opaque cookie to identify the sender
510 @param context - sender context, to match reply w/ request
512 define nat44_interface_dump {
517 /** \brief NAT44 interface details response
518 @param context - sender context, to match reply w/ request
519 @param sw_if_index - software index of the interface
520 @param flags - flag NAT_IS_INSIDE if interface is inside,
521 flag NAT_IS_OUTSIDE if interface is outside
522 and if both flags are set the interface is
523 both inside and outside
525 define nat44_interface_details {
527 vl_api_nat_config_flags_t flags;
528 vl_api_interface_index_t sw_if_index;
531 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
533 @param client_index - opaque cookie to identify the sender
534 @param context - sender context, to match reply w/ request
535 @param is_add - true if add, false if delete
536 @param flags - flag NAT_IS_INSIDE if interface is inside else
538 @param sw_if_index - software index of the interface
540 autoreply define nat44_interface_add_del_output_feature {
544 vl_api_nat_config_flags_t flags;
545 vl_api_interface_index_t sw_if_index;
548 /** \brief Dump interfaces with NAT44 output feature
549 @param client_index - opaque cookie to identify the sender
550 @param context - sender context, to match reply w/ request
552 define nat44_interface_output_feature_dump {
557 /** \brief NAT44 interface with output feature details response
558 @param context - sender context, to match reply w/ request
559 @param flags - flag NAT_IS_INSIDE if interface is inside else
561 @param sw_if_index - software index of the interface
563 define nat44_interface_output_feature_details {
565 vl_api_nat_config_flags_t flags;
566 vl_api_interface_index_t sw_if_index;
569 /** \brief Add/delete NAT44 static mapping
570 @param client_index - opaque cookie to identify the sender
571 @param context - sender context, to match reply w/ request
572 @param is_add - true if add, false if delete
573 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
574 flag nat_is_twice_nat if nat address range for external hosts,
575 flag NAT_IS_SELF_TWICE_NAT if translate external host address
576 and port whenever external host address equals local
577 address of internal host,
578 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
579 @param local_ip_address - local IPv4 address
580 @param external_ip_address - external IPv4 address
581 @param protocol - IP protocol, used only if addr_only=0
582 @param local_port - local port number, used only if addr_only=0
583 @param external_port - external port number, used only if addr_only=0
584 @param external_sw_if_index - external interface (if set
585 external_ip_address is ignored, ~0 means not
587 @param vfr_id - VRF ID
588 @param tag - opaque string tag
590 autoreply define nat44_add_del_static_mapping {
594 vl_api_nat_config_flags_t flags;
595 vl_api_ip4_address_t local_ip_address;
596 vl_api_ip4_address_t external_ip_address;
600 vl_api_interface_index_t external_sw_if_index;
605 /** \brief Dump NAT44 static mappings
606 @param client_index - opaque cookie to identify the sender
607 @param context - sender context, to match reply w/ request
609 define nat44_static_mapping_dump {
614 /** \brief NAT44 static mapping details response
615 @param context - sender context, to match reply w/ request
616 @param flags - flag NAT_ADDR_ONLY if address only mapping,
617 flag NAT_TWICE_NAT if NAT address range for external hosts,
618 flag NAT_SELF_TWICE_NAT if translate external host address
619 and port whenever external host address equals local
620 address of internal host,
621 flag NAT_OUT2IN_ONLY if rule match only out2in direction
622 @param local_ip_address - local IPv4 address
623 @param external_ip_address - external IPv4 address
624 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
625 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
626 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
627 @param external_sw_if_index - external interface
628 @param vfr_id - VRF ID
629 @param tag - opaque string tag
631 define nat44_static_mapping_details {
633 vl_api_nat_config_flags_t flags;
634 vl_api_ip4_address_t local_ip_address;
635 vl_api_ip4_address_t external_ip_address;
639 vl_api_interface_index_t external_sw_if_index;
644 /** \brief Add/delete NAT44 identity mapping
645 @param client_index - opaque cookie to identify the sender
646 @param context - sender context, to match reply w/ request
647 @param is_add - true if add, false if delete
648 @param flags - flag NAT_ADDR_ONLY if address only mapping
649 @param ip_address - IPv4 address
650 @param protocol - IP protocol
651 @param port - port number
652 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
654 @param vfr_id - VRF ID (if ~0 use default VRF)
655 @param tag - opaque string tag
657 autoreply define nat44_add_del_identity_mapping {
661 vl_api_nat_config_flags_t flags;
662 vl_api_ip4_address_t ip_address;
665 vl_api_interface_index_t sw_if_index;
670 /** \brief Dump NAT44 identity mappings
671 @param client_index - opaque cookie to identify the sender
672 @param context - sender context, to match reply w/ request
674 define nat44_identity_mapping_dump {
679 /** \brief NAT44 identity mapping details response
680 @param context - sender context, to match reply w/ request
681 @param flags - flag NAT_ADDR_ONLY if address only mapping
682 @param ip_address - IPv4 address
683 @param protocol - IP protocol
684 @param port - port number
685 @param sw_if_index - interface
686 @param vfr_id - VRF ID
687 @param tag - opaque string tag
689 define nat44_identity_mapping_details {
691 vl_api_nat_config_flags_t flags;
692 vl_api_ip4_address_t ip_address;
695 vl_api_interface_index_t sw_if_index;
700 /** \brief Add/delete NAT44 pool address from specific interfce
701 @param client_index - opaque cookie to identify the sender
702 @param context - sender context, to match reply w/ request
703 @param is_add - true if add, false if delete
704 @param sw_if_index - software index of the interface
705 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
707 autoreply define nat44_add_del_interface_addr {
711 vl_api_interface_index_t sw_if_index;
712 vl_api_nat_config_flags_t flags;
715 /** \brief Dump NAT44 pool addresses interfaces
716 @param client_index - opaque cookie to identify the sender
717 @param context - sender context, to match reply w/ request
719 define nat44_interface_addr_dump {
724 /** \brief NAT44 pool addresses interfaces details response
725 @param context - sender context, to match reply w/ request
726 @param sw_if_index - software index of the interface
727 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
730 define nat44_interface_addr_details {
732 vl_api_interface_index_t sw_if_index;
733 vl_api_nat_config_flags_t flags;
736 /** \brief Dump NAT44 users
737 @param client_index - opaque cookie to identify the sender
738 @param context - sender context, to match reply w/ request
740 define nat44_user_dump {
745 /** \brief NAT44 users response
746 @param context - sender context, to match reply w/ request
748 @param ip_address - IPv4 address
749 @param nsessions - number of dynamic sessions
750 @param nstaticsessions - number of static sessions
752 define nat44_user_details {
755 vl_api_ip4_address_t ip_address;
760 /** \brief NAT44 user's sessions
761 @param client_index - opaque cookie to identify the sender
762 @param context - sender context, to match reply w/ request
763 @param ip_address - IPv4 address of the user to dump
764 @param vrf_id - VRF_ID
766 define nat44_user_session_dump {
769 vl_api_ip4_address_t ip_address;
773 /** \brief NAT44 user's sessions response
774 @param context - sender context, to match reply w/ request
775 @param outside_ip_address - outside IPv4 address
776 @param outside_port - outside port
777 @param inside_ip_address - inside IPv4 address
778 @param inside_port - inside port
779 @param protocol - protocol
780 @param flags - flag NAT_IS_STATIC if session is static,
781 flag NAT_IS_TWICE_NAT if session is twice-nat,
782 flag NAT_IS_EXT_HOST_VALID if external host address
784 @param last_heard - last heard timer
785 @param total_bytes - count of bytes sent through session
786 @param total_pkts - count of pakets sent through session
787 @param ext_host_address - external host IPv4 address
788 @param ext_host_port - external host port
789 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
790 only if twice-nat session)
791 @param ext_host_nat_port - post-NAT external host port (valid only if
794 define nat44_user_session_details {
796 vl_api_ip4_address_t outside_ip_address;
798 vl_api_ip4_address_t inside_ip_address;
801 vl_api_nat_config_flags_t flags;
805 vl_api_ip4_address_t ext_host_address;
807 vl_api_ip4_address_t ext_host_nat_address;
808 u16 ext_host_nat_port;
811 /** \brief NAT44 load-balancing address and port pair
812 @param addr - IPv4 address of the internal node
813 @param port - L4 port number of the internal node
814 @param probability - probability of the internal node to be randomly matched
815 @param vrf_id - VRF id
817 typedef nat44_lb_addr_port {
818 vl_api_ip4_address_t addr;
824 /** \brief Add/delete NAT44 load-balancing static mapping rule
825 @param client_index - opaque cookie to identify the sender
826 @param context - sender context, to match reply w/ request
827 @param is_add - true if add, false if delete
828 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
829 flag NAT_SELF_TWICE_NAT if translate external host address
830 and port whenever external host address equals local
831 address of internal host,
832 flag NAT_OUT2IN_ONLY if rule match only out2in direction
833 @param external_addr - external IPv4 address of the service
834 @param external_port - external L4 port number of the service
835 @param protocol - IP protocol number of the service
836 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
838 @param local_num - number of local network nodes
839 @param locals - local network nodes
840 @param tag - opaque string tag
842 autoreply manual_endian define nat44_add_del_lb_static_mapping {
846 vl_api_nat_config_flags_t flags;
847 vl_api_ip4_address_t external_addr;
853 vl_api_nat44_lb_addr_port_t locals[local_num];
856 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
857 @param client_index - opaque cookie to identify the sender
858 @param context - sender context, to match reply w/ request
859 @param is_add - true if add, false if delete
860 @param external_addr - external IPv4 address of the service
861 @param external_port - external L4 port number of the service
862 @param protocol - IP protocol number of the service
863 @param local - local network node
865 autoreply define nat44_lb_static_mapping_add_del_local {
869 vl_api_ip4_address_t external_addr;
872 vl_api_nat44_lb_addr_port_t local;
875 /** \brief Dump NAT44 load-balancing static mapping rules
876 @param client_index - opaque cookie to identify the sender
877 @param context - sender context, to match reply w/ request
879 define nat44_lb_static_mapping_dump {
884 /** \brief NAT44 load-balancing static mapping rule details response
885 @param context - sender context, to match reply w/ request
886 @param external_addr - external IPv4 address of the service
887 @param external_port - external L4 port number of the service
888 @param protocol - IP protocol number of the service
889 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
890 flag NAT_SELF_TWICE_NAT if translate external host address
891 and port whenever external host address equals local
892 address of internal host,
893 flag NAT_OUT2IN_ONLY if rule match only out2in direction
894 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
896 @param local_num - number of local network nodes
897 @param locals - local network nodes
898 @param tag - opaque string tag
900 manual_endian define nat44_lb_static_mapping_details {
902 vl_api_ip4_address_t external_addr;
905 vl_api_nat_config_flags_t flags;
909 vl_api_nat44_lb_addr_port_t locals[local_num];
912 /** \brief Delete NAT44 session
913 @param client_index - opaque cookie to identify the sender
914 @param context - sender context, to match reply w/ request
915 @param ip_address - IPv4 address
916 @param protocol - IP protocol
917 @param port - port number
918 @param vfr_id - VRF ID
919 @param flags - flag NAT_IS_INSIDE if interface is inside or
920 interface is outside,
921 flag NAT_IS_EXT_HOST_VALID if external host address and
923 @param ext_host_address - external host IPv4 address
924 @param ext_host_port - external host port
926 autoreply define nat44_del_session {
929 vl_api_ip4_address_t address;
933 vl_api_nat_config_flags_t flags;
934 vl_api_ip4_address_t ext_host_address;
938 /** \brief Enable/disable forwarding for NAT44
939 Forward packets which don't match existing translation
940 or static mapping instead of dropping them.
941 @param client_index - opaque cookie to identify the sender
942 @param context - sender context, to match reply w/ request
943 @param enable - true for enable, false for disable
945 autoreply define nat44_forwarding_enable_disable {
951 /** \brief Check if forwarding is enabled or disabled
952 @param client_index - opaque cookie to identify the sender
953 @param context - sender context, to match reply w/ request
955 define nat44_forwarding_is_enabled {
960 /** \brief Response to check if forwarding is enabled or disabled
961 @param context - sender context, to match reply w/ request
962 @param enabled - true if enabled, false if disabled
964 define nat44_forwarding_is_enabled_reply {
971 * Deterministic NAT (CGN) APIs
974 /** \brief Add/delete NAT deterministic mapping
975 @param client_index - opaque cookie to identify the sender
976 @param context - sender context, to match reply w/ request
977 @param is_add - true if add, false if delete
978 @param in_addr - inside IPv4 address
979 @param in_plen - inside IPv4 address prefix length
980 @param out_addr - outside IPv4 address
981 @param out_plen - outside IPv4 address prefix length
983 autoreply define nat_det_add_del_map {
987 vl_api_ip4_address_t in_addr;
989 vl_api_ip4_address_t out_addr;
993 /** \brief Get outside address and port range from inside address
994 @param client_index - opaque cookie to identify the sender
995 @param context - sender context, to match reply w/ request
996 @param in_addr - inside IP address
998 define nat_det_forward {
1001 vl_api_ip4_address_t in_addr;
1004 /** \brief Get outside address and port range from inside address
1005 @param context - sender context, to match reply w/ request
1006 @param retval - return code
1007 @param out_port_lo - outside port range start
1008 @param out_port_hi - outside port range end
1009 @param out_addr - outside IPv4 address
1011 define nat_det_forward_reply {
1016 vl_api_ip4_address_t out_addr;
1019 /** \brief Get inside address from outside address and port
1020 @param client_index - opaque cookie to identify the sender
1021 @param context - sender context, to match reply w/ request
1022 @param out_port - outside port
1023 @param out_addr - outside IPv4 address
1025 define nat_det_reverse {
1029 vl_api_ip4_address_t out_addr;
1032 /** \brief Get inside address from outside address and port reply
1033 @param context - sender context, to match reply w/ request
1034 @param retval - return code
1035 @param in_addr - inside IP address
1037 define nat_det_reverse_reply {
1040 vl_api_ip4_address_t in_addr;
1043 /** \brief Dump NAT deterministic mappings
1044 @param client_index - opaque cookie to identify the sender
1045 @param context - sender context, to match reply w/ request
1047 define nat_det_map_dump {
1052 /** \brief NAT users response
1053 @param context - sender context, to match reply w/ request
1054 @param in_addr - inside IPv4 address
1055 @param in_plen - inside IPv4 address prefix length
1056 @param out_addr - outside IPv4 address
1057 @param out_plen - outside IPv4 address prefix length
1058 @param sharing_ratio - outside to inside address sharing ratio
1059 @param ports_per_host - number of ports available to a host
1060 @param ses_num - number of sessions belonging to this mapping
1062 define nat_det_map_details {
1064 vl_api_ip4_address_t in_addr;
1066 vl_api_ip4_address_t out_addr;
1073 /** \brief Close deterministic NAT session by outside address and port
1074 @param client_index - opaque cookie to identify the sender
1075 @param context - sender context, to match reply w/ request
1076 @param out_addr - outside IPv4 address
1077 @param out_port - outside port
1078 @param ext_addr - external host IPv4 address
1079 @param ext_port - external host port
1081 autoreply define nat_det_close_session_out {
1084 vl_api_ip4_address_t out_addr;
1086 vl_api_ip4_address_t ext_addr;
1090 /** \brief Close deterministic NAT session by inside address and port
1091 @param client_index - opaque cookie to identify the sender
1092 @param context - sender context, to match reply w/ request
1093 @param in_addr - inside IP address
1094 @param in_port - inside port
1095 @param ext_addr - external host IP address
1096 @param ext_port - external host port
1098 autoreply define nat_det_close_session_in {
1101 vl_api_ip4_address_t in_addr;
1103 vl_api_ip4_address_t ext_addr;
1107 /** \brief Dump determinstic NAT sessions
1108 @param client_index - opaque cookie to identify the sender
1109 @param context - sender context, to match reply w/ request
1110 @param user_addr - address of an inside user whose sessions to dump
1112 define nat_det_session_dump {
1115 vl_api_ip4_address_t user_addr;
1118 /** \brief Deterministic NAT sessions reply
1119 @param context - sender context, to match reply w/ request
1120 @param in_port - inside port
1121 @param ext_addr - external host IPv4 address
1122 @param ext_port - external host port
1123 @param out_port - outside NAT port
1124 @param state - session state
1125 @param expire - session expiration timestamp
1127 define nat_det_session_details {
1130 vl_api_ip4_address_t ext_addr;
1141 /** \brief Add/delete address range to NAT64 pool
1142 @param client_index - opaque cookie to identify the sender
1143 @param context - sender context, to match reply w/ request
1144 @param start_addr - start IPv4 address of the range
1145 @param end_addr - end IPv4 address of the range
1146 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1147 @param is_add - true if add, false if delete
1149 autoreply define nat64_add_del_pool_addr_range {
1152 vl_api_ip4_address_t start_addr;
1153 vl_api_ip4_address_t end_addr;
1158 /** \brief Dump NAT64 pool addresses
1159 @param client_index - opaque cookie to identify the sender
1160 @param context - sender context, to match reply w/ request
1162 define nat64_pool_addr_dump {
1167 /** \brief NAT64 pool address details response
1168 @param context - sender context, to match reply w/ request
1169 @param address - IPv4 address
1170 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1172 define nat64_pool_addr_details {
1174 vl_api_ip4_address_t address;
1178 /** \brief Enable/disable NAT64 feature on the interface
1179 @param client_index - opaque cookie to identify the sender
1180 @param context - sender context, to match reply w/ request
1181 @param is_add - true if add, false if delete
1182 @param flags - flag NAT_IS_INSIDE if interface is inside else
1183 interface is outside
1184 @param sw_if_index - index of the interface
1186 autoreply define nat64_add_del_interface {
1190 vl_api_nat_config_flags_t flags;
1191 vl_api_interface_index_t sw_if_index;
1194 /** \brief Dump interfaces with NAT64 feature
1195 @param client_index - opaque cookie to identify the sender
1196 @param context - sender context, to match reply w/ request
1198 define nat64_interface_dump {
1203 /** \brief NAT64 interface details response
1204 @param context - sender context, to match reply w/ request
1205 @param flags - flag NAT_IS_INSIDE if interface is inside,
1206 flag NAT_IS_OUTSIDE if interface is outside
1207 and if both flags are set the interface is
1208 both inside and outside
1209 @param sw_if_index - index of the interface
1211 define nat64_interface_details {
1213 vl_api_nat_config_flags_t flags;
1214 vl_api_interface_index_t sw_if_index;
1217 /** \brief Add/delete NAT64 static BIB entry
1218 @param client_index - opaque cookie to identify the sender
1219 @param context - sender context, to match reply w/ request
1220 @param i_addr - inside IPv6 address
1221 @param o_addr - outside IPv4 address
1222 @param i_port - inside port number
1223 @param o_port - outside port number
1224 @param vrf_id - VRF id of tenant
1225 @param proto - protocol number
1226 @param is_add - true if add, false if delete
1228 autoreply define nat64_add_del_static_bib {
1231 vl_api_ip6_address_t i_addr;
1232 vl_api_ip4_address_t o_addr;
1240 /** \brief Dump NAT64 BIB
1241 @param client_index - opaque cookie to identify the sender
1242 @param context - sender context, to match reply w/ request
1243 @param proto - protocol of the BIB: 255 - all BIBs
1247 otherwise - "unknown" protocol BIB
1249 define nat64_bib_dump {
1255 /** \brief NAT64 BIB details response
1256 @param context - sender context, to match reply w/ request
1257 @param i_addr - inside IPv6 address
1258 @param o_addr - outside IPv4 address
1259 @param i_port - inside port number
1260 @param o_port - outside port number
1261 @param vrf_id - VRF id of tenant
1262 @param proto - protocol number
1263 @param flags - flag NAT_IS_STATIC if BIB entry is static
1264 or BIB entry is dynamic
1265 @param ses_num - number of sessions associated with the BIB entry
1267 define nat64_bib_details {
1269 vl_api_ip6_address_t i_addr;
1270 vl_api_ip4_address_t o_addr;
1275 vl_api_nat_config_flags_t flags;
1279 /** \brief Dump NAT64 session table
1280 @param client_index - opaque cookie to identify the sender
1281 @param context - sender context, to match reply w/ request
1282 @param proto - protocol of the session table: 255 - all STs
1286 otherwise - "unknown" proto ST
1288 define nat64_st_dump {
1294 /** \brief NAT64 session table details response
1295 @param context - sender context, to match reply w/ request
1296 @param il_addr - inside IPv6 address of the local host
1297 @param ol_addr - outside IPv4 address of the local host
1298 @param il_port - inside port number id of the local host/inside ICMP id
1299 @param ol_port - outside port number of the local host/outside ICMP id
1300 @param ir_addr - inside IPv6 address of the remote host
1301 @param or_addr - outside IPv4 address of the remote host
1302 @param r_port - port number of the remote host (not used for ICMP)
1303 @param vrf_id - VRF id of tenant
1304 @param proto - protocol number
1306 define nat64_st_details {
1308 vl_api_ip6_address_t il_addr;
1309 vl_api_ip4_address_t ol_addr;
1312 vl_api_ip6_address_t ir_addr;
1313 vl_api_ip4_address_t or_addr;
1319 /** \brief Add/del NAT64 prefix
1320 @param client_index - opaque cookie to identify the sender
1321 @param context - sender context, to match reply w/ request
1322 @param prefix - NAT64 prefix
1323 @param vrf_id - VRF id of tenant
1324 @param is_add - true if add, false if delete
1326 autoreply define nat64_add_del_prefix {
1329 vl_api_ip6_prefix_t prefix;
1334 /** \brief Dump NAT64 prefix
1335 @param client_index - opaque cookie to identify the sender
1336 @param context - sender context, to match reply w/ request
1338 define nat64_prefix_dump {
1343 /** \brief Dump NAT64 prefix details response
1344 @param context - sender context, to match reply w/ request
1345 @param prefix - NAT64 prefix
1346 @param vrf_id - VRF id of tenant
1348 define nat64_prefix_details {
1350 vl_api_ip6_prefix_t prefix;
1354 /** \brief Add/delete NAT64 pool address from specific interfce
1355 @param client_index - opaque cookie to identify the sender
1356 @param context - sender context, to match reply w/ request
1357 @param is_add - true if add, false if delete
1358 @param sw_if_index - software index of the interface
1360 autoreply define nat64_add_del_interface_addr {
1364 vl_api_interface_index_t sw_if_index;
1371 /** \brief Add/delete address range to DS-Lite pool
1372 @param client_index - opaque cookie to identify the sender
1373 @param context - sender context, to match reply w/ request
1374 @param start_addr - start IPv4 address of the range
1375 @param end_addr - end IPv4 address of the range
1376 @param is_add - true if add, false if delete
1378 autoreply define dslite_add_del_pool_addr_range {
1381 vl_api_ip4_address_t start_addr;
1382 vl_api_ip4_address_t end_addr;
1386 /** \brief Dump DS-Lite addresses
1387 @param client_index - opaque cookie to identify the sender
1388 @param context - sender context, to match reply w/ request
1390 define dslite_address_dump {
1395 /** \brief DS-Lite address details response
1396 @param context - sender context, to match reply w/ request
1397 @param ip_address - IPv4 address
1399 define dslite_address_details {
1401 vl_api_ip4_address_t ip_address;
1404 /** \brief Set AFTR IPv6 and IPv4 addresses
1405 @param client_index - opaque cookie to identify the sender
1406 @param context - sender context, to match reply w/ request
1407 @param ip4_addr - IPv4 address
1408 @param ip6_addr - IPv6 address
1410 autoreply define dslite_set_aftr_addr {
1413 vl_api_ip4_address_t ip4_addr;
1414 vl_api_ip6_address_t ip6_addr;
1417 /** \brief Get AFTR IPv6 and IPv4 addresses
1418 @param client_index - opaque cookie to identify the sender
1419 @param context - sender context, to match reply w/ request
1421 define dslite_get_aftr_addr {
1426 /** \brief Response to get AFTR IPv6 and IPv4 addresses
1427 @param context - sender context, to match reply w/ request
1428 @param retval - return code
1429 @param ip4_addr - IPv4 address
1430 @param ip6_addr - IPv6 address
1432 define dslite_get_aftr_addr_reply {
1435 vl_api_ip4_address_t ip4_addr;
1436 vl_api_ip6_address_t ip6_addr;
1439 /** \brief Set B4 IPv6 and IPv4 addresses
1440 @param client_index - opaque cookie to identify the sender
1441 @param context - sender context, to match reply w/ request
1442 @param ip4_addr - IPv4 address
1443 @param ip6_addr - IPv6 address
1445 autoreply define dslite_set_b4_addr {
1448 vl_api_ip4_address_t ip4_addr;
1449 vl_api_ip6_address_t ip6_addr;
1452 /** \brief Get B4 IPv6 and IPv4 addresses
1453 @param client_index - opaque cookie to identify the sender
1454 @param context - sender context, to match reply w/ request
1456 define dslite_get_b4_addr {
1461 /** \brief Response to get B4 IPv6 and IPv4 addresses
1462 @param context - sender context, to match reply w/ request
1463 @param retval - return code
1464 @param ip4_addr - IPv4 address
1465 @param ip6_addr - IPv6 address
1467 define dslite_get_b4_addr_reply {
1470 vl_api_ip4_address_t ip4_addr;
1471 vl_api_ip6_address_t ip6_addr;
1477 /** \brief Enable/disable NAT66 feature on the interface
1478 @param client_index - opaque cookie to identify the sender
1479 @param context - sender context, to match reply w/ request
1480 @param is_add - true if add, false if delete
1481 @param flags - flag NAT_IS_INSIDE if interface is inside or
1482 interface is outside,
1483 @param sw_if_index - software index of the interface
1485 autoreply define nat66_add_del_interface {
1489 vl_api_nat_config_flags_t flags;
1490 vl_api_interface_index_t sw_if_index;
1493 /** \brief Dump interfaces with NAT66 feature
1494 @param client_index - opaque cookie to identify the sender
1495 @param context - sender context, to match reply w/ request
1497 define nat66_interface_dump {
1502 /** \brief NAT66 interface details response
1503 @param context - sender context, to match reply w/ request
1504 @param flags - flag NAT_IS_INSIDE if interface is inside or
1505 interface is outside,
1506 @param sw_if_index - software index of the interface
1508 define nat66_interface_details {
1510 vl_api_nat_config_flags_t flags;
1511 vl_api_interface_index_t sw_if_index;
1514 /** \brief Add/delete 1:1 NAT66
1515 @param client_index - opaque cookie to identify the sender
1516 @param context - sender context, to match reply w/ request
1517 @param is_add - true if add, false if delete
1518 @param local_ip_address - local IPv6 address
1519 @param external_ip_address - external IPv6 address
1520 @param vrf_id - VRF id of tenant
1522 autoreply define nat66_add_del_static_mapping {
1526 vl_api_ip6_address_t local_ip_address;
1527 vl_api_ip6_address_t external_ip_address;
1531 /** \brief Dump NAT66 static mappings
1532 @param client_index - opaque cookie to identify the sender
1533 @param context - sender context, to match reply w/ request
1535 define nat66_static_mapping_dump {
1540 /** \brief NAT66 static mapping details response
1541 @param context - sender context, to match reply w/ request
1542 @param local_ip_address - local IPv6 address
1543 @param external_ip_address - external IPv6 address
1544 @param vrf_id - VRF id of tenant
1545 @param total_bytes - count of bytes sent through static mapping
1546 @param total_pkts - count of pakets sent through static mapping
1548 define nat66_static_mapping_details {
1550 vl_api_ip6_address_t local_ip_address;
1551 vl_api_ip6_address_t external_ip_address;