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
68 /** \brief DEPRECATED: Show NAT plugin startup config reply
69 @param context - sender context, to match reply w/ request
70 @param retval - return code for the request
71 @param static_mapping_only - if true dynamic translations disabled
72 @param static_mapping_connection_tracking - if true create session data
73 @param deterministic - if true deterministic mapping
74 @param endpoint_dependent - if true endpoint-dependent mode
75 @param out2in_dpo - if true out2in dpo mode
76 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
77 @param translation_buckets - number of translation hash buckets
78 @param translation_memory_size - translation hash memory size
79 @param user_buckets - number of user hash buckets
80 @param user_memory_size - user hash memory size
81 @param max_translations_per_user - maximum number of translations per user
82 @param outside_vrf_id - outside VRF id
83 @param inside_vrf_id - default inside VRF id
84 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
85 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
86 @param nat64_st_buckets - number of NAT64 session table hash buckets
87 @param nat64_st_memory_size - memory size of NAT64 session table hash
89 define nat_show_config_reply
93 bool static_mapping_only;
94 bool static_mapping_connection_tracking;
96 bool endpoint_dependent;
99 u32 translation_buckets;
100 u32 translation_memory_size;
102 u64 user_memory_size;
103 u32 max_translations_per_user;
106 u32 nat64_bib_buckets;
107 u64 nat64_bib_memory_size;
108 u32 nat64_st_buckets;
109 u64 nat64_st_memory_size;
112 /** \brief Show NAT plugin startup config
113 @param client_index - opaque cookie to identify the sender
114 @param context - sender context, to match reply w/ request
116 define nat_show_config_2
122 /** \brief Show NAT plugin startup config reply
123 @param context - sender context, to match reply w/ request
124 @param retval - return code for the request
125 @param static_mapping_only - if true dynamic translations disabled
126 @param static_mapping_connection_tracking - if true create session data
127 @param deterministic - if true deterministic mapping
128 @param endpoint_dependent - if true endpoint-dependent mode
129 @param out2in_dpo - if true out2in dpo mode
130 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
131 @param translation_buckets - number of translation hash buckets
132 @param translation_memory_size - translation hash memory size
133 @param user_buckets - number of user hash buckets
134 @param user_memory_size - user hash memory size
135 @param max_translations_per_user - maximum number of translations per user
136 @param outside_vrf_id - outside VRF id
137 @param inside_vrf_id - default inside VRF id
138 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
139 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
140 @param nat64_st_buckets - number of NAT64 session table hash buckets
141 @param nat64_st_memory_size - memory size of NAT64 session table hash
142 @param max_translations_per_thread - max translations per worker thread
143 @param max_users_per_thread - max users per worker thread
145 define nat_show_config_2_reply
149 bool static_mapping_only;
150 bool static_mapping_connection_tracking;
152 bool endpoint_dependent;
155 u32 translation_buckets;
156 u64 translation_memory_size;
158 u64 user_memory_size;
159 u32 max_translations_per_user;
162 u32 nat64_bib_buckets;
163 u64 nat64_bib_memory_size;
164 u32 nat64_st_buckets;
165 u64 nat64_st_memory_size;
166 u32 max_translations_per_thread;
167 u32 max_users_per_thread;
170 enum nat_log_level : u8
173 NAT_LOG_ERROR = 0x01,
174 NAT_LOG_WARNING = 0x02,
175 NAT_LOG_NOTICE = 0x03,
177 NAT_LOG_DEBUG = 0x05,
180 /** \brief Run nat44 garbage collection
181 @param client_index - opaque cookie to identify the sender
182 @param context - sender context, to match reply w/ request
184 autoreply define nat44_session_cleanup {
189 /** \brief NAT44 set session limit
190 @param client_index - opaque cookie to identify the sender
191 @param context - sender context, to match reply w/ request
192 @param session_limit - session limit
193 @param vrf_id - vrf id
195 autoreply define nat44_set_session_limit {
202 /** \brief Set NAT logging level
203 @param client_index - opaque cookie to identify the sender
204 @param context - sender context, to match reply w/ request
205 @param log_level - logging level
207 autoreply define nat_set_log_level {
210 vl_api_nat_log_level_t log_level;
213 /** \brief Set NAT workers
214 @param client_index - opaque cookie to identify the sender
215 @param context - sender context, to match reply w/ request
216 @param worker_mask - NAT workers mask
218 autoreply define nat_set_workers {
224 /** \brief Dump NAT workers
225 @param client_index - opaque cookie to identify the sender
226 @param context - sender context, to match reply w/ request
228 define nat_worker_dump {
233 /** \brief NAT workers details response
234 @param context - sender context, to match reply w/ request
235 @param worker_index - worker index
236 @param lcore_id - lcore ID
237 @param name - worker name
239 define nat_worker_details {
246 /** \brief Enable/disable NAT IPFIX logging
247 @param client_index - opaque cookie to identify the sender
248 @param context - sender context, to match reply w/ request
249 @param domain_id - observation domain ID
250 @param src_port - source port number
251 @param enable - true if enable, false if disable
253 autoreply define nat_ipfix_enable_disable {
261 /** \brief Set values of timeouts for NAT sessions (seconds)
262 @param client_index - opaque cookie to identify the sender
263 @param context - sender context, to match reply w/ request
264 @param udp - UDP timeout (default 300sec)
265 @param tcp_established - TCP established timeout (default 7440sec)
266 @param tcp_transitory - TCP transitory timeout (default 240sec)
267 @param icmp - ICMP timeout (default 60sec)
269 autoreply define nat_set_timeouts {
278 /** \brief Get values of timeouts for NAT sessions (seconds)
279 @param client_index - opaque cookie to identify the sender
280 @param context - sender context, to match reply w/ request
282 define nat_get_timeouts {
287 /** \brief Get values of timeouts for NAT sessions reply
288 @param context - sender context, to match reply w/ request
289 @param retval - return code
290 @param udp - UDP timeout
291 @param tcp_established - TCP established timeout
292 @param tcp_transitory - TCP transitory timeout
293 @param icmp - ICMP timeout
295 define nat_get_timeouts_reply {
304 /** \brief Set address and port assignment algorithm
305 @param client_index - opaque cookie to identify the sender
306 @param context - sender context, to match reply w/ request
307 @param alg - address and port assignment algorithm:
308 0 - default, 1 - MAP-E, 2 - port range
309 (see nat_addr_and_port_alloc_alg_t in nat.h)
310 @param psid_offset - number of offset bits (valid only for MAP-E alg)
311 @param psid_length - length of PSID (valid only for MAP-E alg)
312 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
313 @param start_port - beginning of the port range
314 @param end_port - end of the port range
316 autoreply define nat_set_addr_and_port_alloc_alg {
327 /** \brief Get address and port assignment algorithm
328 @param client_index - opaque cookie to identify the sender
329 @param context - sender context, to match reply w/ request
331 define nat_get_addr_and_port_alloc_alg {
336 /** \brief Get address and port assignment algorithm reply
337 @param context - sender context, to match reply w/ request
338 @param retval - return code
339 @param alg - address and port assignment algorithm:
340 0 - default, 1 - MAP-E, 2 - port range
341 (see nat_addr_and_port_alloc_alg_t in nat.h)
342 @param psid_offset - number of offset bits (valid only for MAP-E alg)
343 @param psid_length - length of PSID (valid only for MAP-E alg)
344 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
345 @param start_port - beginning of the port range
346 @param end_port - end of the port range
348 define nat_get_addr_and_port_alloc_alg_reply {
359 /** \brief Set TCP MSS rewriting configuration
360 @param client_index - opaque cookie to identify the sender
361 @param context - sender context, to match reply w/ request
362 @param mss_value - MSS value to be used for MSS rewriting
363 @param enable - if true enable MSS rewriting feature else disable
365 autoreply define nat_set_mss_clamping {
372 /** \brief Get TCP MSS rewriting configuration
373 @param client_index - opaque cookie to identify the sender
374 @param context - sender context, to match reply w/ request
376 define nat_get_mss_clamping {
381 /** \brief Get TCP MSS rewriting configuration reply
382 @param context - sender context, to match reply w/ request
383 @param retval - return code
384 @param mss_value - MSS value to be used for MSS rewriting
385 @param enable - if true enable MSS rewriting feature else disable
387 define nat_get_mss_clamping_reply {
394 /** \brief Set HA listener (local settings)
395 @param client_index - opaque cookie to identify the sender
396 @param context - sender context, to match reply w/ request
397 @param ip_address - local IP4 address
398 @param port - local UDP port number
399 @param path_mtu - path MTU between local and failover
401 autoreply define nat_ha_set_listener {
404 vl_api_ip4_address_t ip_address;
409 /** \brief Set HA failover (remote settings)
410 @param client_index - opaque cookie to identify the sender
411 @param context - sender context, to match reply w/ request
412 @param ip_address - failover IP4 address
413 @param port - failvoer UDP port number
414 @param session_refresh_interval - number of seconds after which to send
415 session counters refresh
417 autoreply define nat_ha_set_failover {
420 vl_api_ip4_address_t ip_address;
422 u32 session_refresh_interval;
425 /** \brief Get HA listener/local configuration
426 @param client_index - opaque cookie to identify the sender
427 @param context - sender context, to match reply w/ request
429 define nat_ha_get_listener {
434 /** \brief Get HA listener/local configuration reply
435 @param context - sender context, to match reply w/ request
436 @param retval - return code
437 @param ip_address - local IP4 address
438 @param port - local UDP port number
439 @param path_mtu - Path MTU between local and failover
441 define nat_ha_get_listener_reply {
444 vl_api_ip4_address_t ip_address;
449 /** \brief Get HA failover/remote settings
450 @param client_index - opaque cookie to identify the sender
451 @param context - sender context, to match reply w/ request
453 define nat_ha_get_failover {
458 /** \brief Get HA failover/remote settings reply
459 @param context - sender context, to match reply w/ request
460 @param retval - return code
461 @param ip_address - failover IP4 address
462 @param port - failvoer UDP port number
463 @param session_refresh_interval - number of seconds after which to send
464 session counters refresh
466 define nat_ha_get_failover_reply {
469 vl_api_ip4_address_t ip_address;
471 u32 session_refresh_interval;
474 /** \brief Flush the current HA data (for testing)
475 @param client_index - opaque cookie to identify the sender
476 @param context - sender context, to match reply w/ request
478 autoreply define nat_ha_flush {
483 /** \brief Resync HA (resend existing sessions to new failover)
484 @param client_index - opaque cookie to identify the sender
485 @param context - sender context, to match reply w/ request
486 @param want_resync_event - resync completed event sent to the sender via
487 nat_ha_resync_completed_event API message if
489 @param pid - sender's pid
491 autoreply define nat_ha_resync
495 u8 want_resync_event;
499 /** \brief Tell client about a HA resync completion event
500 @param client_index - opaque cookie to identify the sender
501 @param pid - client pid registered to receive notification
502 @param missed_count - number of missed (not ACKed) messages
504 define nat_ha_resync_completed_event
512 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
519 /** \brief Del NAT44 user
520 @param client_index - opaque cookie to identify the sender
521 @param context - sender context, to match reply w/ request
522 @param ip_address - IPv4 address
523 @param fib_index - FIB index
525 autoreply define nat44_del_user {
528 vl_api_ip4_address_t ip_address;
532 /** \brief Add/del NAT44 address range
533 @param client_index - opaque cookie to identify the sender
534 @param context - sender context, to match reply w/ request
535 @param first_ip_address - first IPv4 address
536 @param last_ip_address - last IPv4 address
537 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
538 @param is_add - true if add, false if delete
539 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
542 autoreply define nat44_add_del_address_range {
545 vl_api_ip4_address_t first_ip_address;
546 vl_api_ip4_address_t last_ip_address;
549 vl_api_nat_config_flags_t flags;
552 /** \brief Dump NAT44 addresses
553 @param client_index - opaque cookie to identify the sender
554 @param context - sender context, to match reply w/ request
556 define nat44_address_dump {
561 /** \brief NAT44 address details response
562 @param context - sender context, to match reply w/ request
563 @param ip_address - IPv4 address
564 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
565 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
567 define nat44_address_details {
569 vl_api_ip4_address_t ip_address;
570 vl_api_nat_config_flags_t flags;
574 /** \brief Enable/disable NAT44 feature on the interface
575 @param client_index - opaque cookie to identify the sender
576 @param context - sender context, to match reply w/ request
577 @param is_add - true if add, false if delete
578 @param flags - flag NAT_IS_INSIDE if interface is inside else
580 @param sw_if_index - software index of the interface
582 autoreply define nat44_interface_add_del_feature {
586 vl_api_nat_config_flags_t flags;
587 vl_api_interface_index_t sw_if_index;
590 /** \brief Dump interfaces with NAT44 feature
591 @param client_index - opaque cookie to identify the sender
592 @param context - sender context, to match reply w/ request
594 define nat44_interface_dump {
599 /** \brief NAT44 interface details response
600 @param context - sender context, to match reply w/ request
601 @param sw_if_index - software index of the interface
602 @param flags - flag NAT_IS_INSIDE if interface is inside,
603 flag NAT_IS_OUTSIDE if interface is outside
604 and if both flags are set the interface is
605 both inside and outside
607 define nat44_interface_details {
609 vl_api_nat_config_flags_t flags;
610 vl_api_interface_index_t sw_if_index;
613 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
615 @param client_index - opaque cookie to identify the sender
616 @param context - sender context, to match reply w/ request
617 @param is_add - true if add, false if delete
618 @param flags - flag NAT_IS_INSIDE if interface is inside else
620 @param sw_if_index - software index of the interface
622 autoreply define nat44_interface_add_del_output_feature {
626 vl_api_nat_config_flags_t flags;
627 vl_api_interface_index_t sw_if_index;
630 /** \brief Dump interfaces with NAT44 output feature
631 @param client_index - opaque cookie to identify the sender
632 @param context - sender context, to match reply w/ request
634 define nat44_interface_output_feature_dump {
639 /** \brief NAT44 interface with output feature details response
640 @param context - sender context, to match reply w/ request
641 @param flags - flag NAT_IS_INSIDE if interface is inside else
643 @param sw_if_index - software index of the interface
645 define nat44_interface_output_feature_details {
647 vl_api_nat_config_flags_t flags;
648 vl_api_interface_index_t sw_if_index;
651 /** \brief Add/delete NAT44 static mapping
652 @param client_index - opaque cookie to identify the sender
653 @param context - sender context, to match reply w/ request
654 @param is_add - true if add, false if delete
655 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
656 flag nat_is_twice_nat if nat address range for external hosts,
657 flag NAT_IS_SELF_TWICE_NAT if translate external host address
658 and port whenever external host address equals local
659 address of internal host,
660 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
661 @param local_ip_address - local IPv4 address
662 @param external_ip_address - external IPv4 address
663 @param protocol - IP protocol, used only if addr_only=0
664 @param local_port - local port number, used only if addr_only=0
665 @param external_port - external port number, used only if addr_only=0
666 @param external_sw_if_index - external interface (if set
667 external_ip_address is ignored, ~0 means not
669 @param vfr_id - VRF ID
670 @param tag - opaque string tag
672 autoreply define nat44_add_del_static_mapping {
676 vl_api_nat_config_flags_t flags;
677 vl_api_ip4_address_t local_ip_address;
678 vl_api_ip4_address_t external_ip_address;
682 vl_api_interface_index_t external_sw_if_index;
687 /** \brief Add/delete NAT44 static mapping
688 @param client_index - opaque cookie to identify the sender
689 @param context - sender context, to match reply w/ request
690 @param is_add - true if add, false if delete
691 @param match_pool - true if use specific pool_ip_address
692 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
693 flag nat_is_twice_nat if nat address range for external hosts,
694 flag NAT_IS_SELF_TWICE_NAT if translate external host address
695 and port whenever external host address equals local
696 address of internal host,
697 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
698 @param pool_ip_address - pool IPv4 address to match with pool
699 @param local_ip_address - local IPv4 address
700 @param external_ip_address - external IPv4 address
701 @param protocol - IP protocol, used only if addr_only=0
702 @param local_port - local port number, used only if addr_only=0
703 @param external_port - external port number, used only if addr_only=0
704 @param external_sw_if_index - external interface (if set
705 external_ip_address is ignored, ~0 means not
707 @param vfr_id - VRF ID
708 @param tag - opaque string tag
710 autoreply define nat44_add_del_static_mapping_v2 {
711 option status="in_progress";
716 vl_api_nat_config_flags_t flags;
717 vl_api_ip4_address_t pool_ip_address;
718 vl_api_ip4_address_t local_ip_address;
719 vl_api_ip4_address_t external_ip_address;
723 vl_api_interface_index_t external_sw_if_index;
728 /** \brief Dump NAT44 static mappings
729 @param client_index - opaque cookie to identify the sender
730 @param context - sender context, to match reply w/ request
732 define nat44_static_mapping_dump {
737 /** \brief NAT44 static mapping details response
738 @param context - sender context, to match reply w/ request
739 @param flags - flag NAT_ADDR_ONLY if address only mapping,
740 flag NAT_TWICE_NAT if NAT address range for external hosts,
741 flag NAT_SELF_TWICE_NAT if translate external host address
742 and port whenever external host address equals local
743 address of internal host,
744 flag NAT_OUT2IN_ONLY if rule match only out2in direction
745 @param local_ip_address - local IPv4 address
746 @param external_ip_address - external IPv4 address
747 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
748 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
749 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
750 @param external_sw_if_index - external interface
751 @param vfr_id - VRF ID
752 @param tag - opaque string tag
754 define nat44_static_mapping_details {
756 vl_api_nat_config_flags_t flags;
757 vl_api_ip4_address_t local_ip_address;
758 vl_api_ip4_address_t external_ip_address;
762 vl_api_interface_index_t external_sw_if_index;
767 /** \brief Add/delete NAT44 identity mapping
768 @param client_index - opaque cookie to identify the sender
769 @param context - sender context, to match reply w/ request
770 @param is_add - true if add, false if delete
771 @param flags - flag NAT_ADDR_ONLY if address only mapping
772 @param ip_address - IPv4 address
773 @param protocol - IP protocol
774 @param port - port number
775 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
777 @param vfr_id - VRF ID (if ~0 use default VRF)
778 @param tag - opaque string tag
780 autoreply define nat44_add_del_identity_mapping {
784 vl_api_nat_config_flags_t flags;
785 vl_api_ip4_address_t ip_address;
788 vl_api_interface_index_t sw_if_index;
793 /** \brief Dump NAT44 identity mappings
794 @param client_index - opaque cookie to identify the sender
795 @param context - sender context, to match reply w/ request
797 define nat44_identity_mapping_dump {
802 /** \brief NAT44 identity mapping details response
803 @param context - sender context, to match reply w/ request
804 @param flags - flag NAT_ADDR_ONLY if address only mapping
805 @param ip_address - IPv4 address
806 @param protocol - IP protocol
807 @param port - port number
808 @param sw_if_index - interface
809 @param vfr_id - VRF ID
810 @param tag - opaque string tag
812 define nat44_identity_mapping_details {
814 vl_api_nat_config_flags_t flags;
815 vl_api_ip4_address_t ip_address;
818 vl_api_interface_index_t sw_if_index;
823 /** \brief Add/delete NAT44 pool address from specific interfce
824 @param client_index - opaque cookie to identify the sender
825 @param context - sender context, to match reply w/ request
826 @param is_add - true if add, false if delete
827 @param sw_if_index - software index of the interface
828 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
830 autoreply define nat44_add_del_interface_addr {
834 vl_api_interface_index_t sw_if_index;
835 vl_api_nat_config_flags_t flags;
838 /** \brief Dump NAT44 pool addresses interfaces
839 @param client_index - opaque cookie to identify the sender
840 @param context - sender context, to match reply w/ request
842 define nat44_interface_addr_dump {
847 /** \brief NAT44 pool addresses interfaces details response
848 @param context - sender context, to match reply w/ request
849 @param sw_if_index - software index of the interface
850 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
853 define nat44_interface_addr_details {
855 vl_api_interface_index_t sw_if_index;
856 vl_api_nat_config_flags_t flags;
859 /** \brief Dump NAT44 users
860 @param client_index - opaque cookie to identify the sender
861 @param context - sender context, to match reply w/ request
863 define nat44_user_dump {
868 /** \brief NAT44 users response
869 @param context - sender context, to match reply w/ request
871 @param ip_address - IPv4 address
872 @param nsessions - number of dynamic sessions
873 @param nstaticsessions - number of static sessions
875 define nat44_user_details {
878 vl_api_ip4_address_t ip_address;
883 /** \brief NAT44 user's sessions
884 @param client_index - opaque cookie to identify the sender
885 @param context - sender context, to match reply w/ request
886 @param ip_address - IPv4 address of the user to dump
887 @param vrf_id - VRF_ID
889 define nat44_user_session_dump {
892 vl_api_ip4_address_t ip_address;
896 /** \brief NAT44 user's sessions response
897 @param context - sender context, to match reply w/ request
898 @param outside_ip_address - outside IPv4 address
899 @param outside_port - outside port
900 @param inside_ip_address - inside IPv4 address
901 @param inside_port - inside port
902 @param protocol - protocol
903 @param flags - flag NAT_IS_STATIC if session is static,
904 flag NAT_IS_TWICE_NAT if session is twice-nat,
905 flag NAT_IS_EXT_HOST_VALID if external host address
907 @param last_heard - last heard timer
908 @param total_bytes - count of bytes sent through session
909 @param total_pkts - count of pakets sent through session
910 @param ext_host_address - external host IPv4 address
911 @param ext_host_port - external host port
912 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
913 only if twice-nat session)
914 @param ext_host_nat_port - post-NAT external host port (valid only if
917 define nat44_user_session_details {
919 vl_api_ip4_address_t outside_ip_address;
921 vl_api_ip4_address_t inside_ip_address;
924 vl_api_nat_config_flags_t flags;
928 vl_api_ip4_address_t ext_host_address;
930 vl_api_ip4_address_t ext_host_nat_address;
931 u16 ext_host_nat_port;
934 /** \brief NAT44 load-balancing address and port pair
935 @param addr - IPv4 address of the internal node
936 @param port - L4 port number of the internal node
937 @param probability - probability of the internal node to be randomly matched
938 @param vrf_id - VRF id
940 typedef nat44_lb_addr_port {
941 vl_api_ip4_address_t addr;
947 /** \brief Add/delete NAT44 load-balancing static mapping rule
948 @param client_index - opaque cookie to identify the sender
949 @param context - sender context, to match reply w/ request
950 @param is_add - true if add, false if delete
951 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
952 flag NAT_SELF_TWICE_NAT if translate external host address
953 and port whenever external host address equals local
954 address of internal host,
955 flag NAT_OUT2IN_ONLY if rule match only out2in direction
956 @param external_addr - external IPv4 address of the service
957 @param external_port - external L4 port number of the service
958 @param protocol - IP protocol number of the service
959 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
961 @param local_num - number of local network nodes
962 @param locals - local network nodes
963 @param tag - opaque string tag
965 autoreply manual_endian define nat44_add_del_lb_static_mapping {
969 vl_api_nat_config_flags_t flags;
970 vl_api_ip4_address_t external_addr;
976 vl_api_nat44_lb_addr_port_t locals[local_num];
979 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
980 @param client_index - opaque cookie to identify the sender
981 @param context - sender context, to match reply w/ request
982 @param is_add - true if add, false if delete
983 @param external_addr - external IPv4 address of the service
984 @param external_port - external L4 port number of the service
985 @param protocol - IP protocol number of the service
986 @param local - local network node
988 autoreply define nat44_lb_static_mapping_add_del_local {
992 vl_api_ip4_address_t external_addr;
995 vl_api_nat44_lb_addr_port_t local;
998 /** \brief Dump NAT44 load-balancing static mapping rules
999 @param client_index - opaque cookie to identify the sender
1000 @param context - sender context, to match reply w/ request
1002 define nat44_lb_static_mapping_dump {
1007 /** \brief NAT44 load-balancing static mapping rule details response
1008 @param context - sender context, to match reply w/ request
1009 @param external_addr - external IPv4 address of the service
1010 @param external_port - external L4 port number of the service
1011 @param protocol - IP protocol number of the service
1012 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1013 flag NAT_SELF_TWICE_NAT if translate external host address
1014 and port whenever external host address equals local
1015 address of internal host,
1016 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1017 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1019 @param local_num - number of local network nodes
1020 @param locals - local network nodes
1021 @param tag - opaque string tag
1023 manual_endian define nat44_lb_static_mapping_details {
1025 vl_api_ip4_address_t external_addr;
1028 vl_api_nat_config_flags_t flags;
1032 vl_api_nat44_lb_addr_port_t locals[local_num];
1035 /** \brief Delete NAT44 session
1036 @param client_index - opaque cookie to identify the sender
1037 @param context - sender context, to match reply w/ request
1038 @param ip_address - IPv4 address
1039 @param protocol - IP protocol
1040 @param port - port number
1041 @param vfr_id - VRF ID
1042 @param flags - flag NAT_IS_INSIDE if interface is inside or
1043 interface is outside,
1044 flag NAT_IS_EXT_HOST_VALID if external host address and
1046 @param ext_host_address - external host IPv4 address
1047 @param ext_host_port - external host port
1049 autoreply define nat44_del_session {
1052 vl_api_ip4_address_t address;
1056 vl_api_nat_config_flags_t flags;
1057 vl_api_ip4_address_t ext_host_address;
1061 /** \brief Enable/disable forwarding for NAT44
1062 Forward packets which don't match existing translation
1063 or static mapping instead of dropping them.
1064 @param client_index - opaque cookie to identify the sender
1065 @param context - sender context, to match reply w/ request
1066 @param enable - true for enable, false for disable
1068 autoreply define nat44_forwarding_enable_disable {
1074 /** \brief Check if forwarding is enabled or disabled
1075 @param client_index - opaque cookie to identify the sender
1076 @param context - sender context, to match reply w/ request
1078 define nat44_forwarding_is_enabled {
1083 /** \brief Response to check if forwarding is enabled or disabled
1084 @param context - sender context, to match reply w/ request
1085 @param enabled - true if enabled, false if disabled
1087 define nat44_forwarding_is_enabled_reply {
1096 /** \brief Add/delete address range to NAT64 pool
1097 @param client_index - opaque cookie to identify the sender
1098 @param context - sender context, to match reply w/ request
1099 @param start_addr - start IPv4 address of the range
1100 @param end_addr - end IPv4 address of the range
1101 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1102 @param is_add - true if add, false if delete
1104 autoreply define nat64_add_del_pool_addr_range {
1107 vl_api_ip4_address_t start_addr;
1108 vl_api_ip4_address_t end_addr;
1113 /** \brief Dump NAT64 pool addresses
1114 @param client_index - opaque cookie to identify the sender
1115 @param context - sender context, to match reply w/ request
1117 define nat64_pool_addr_dump {
1122 /** \brief NAT64 pool address details response
1123 @param context - sender context, to match reply w/ request
1124 @param address - IPv4 address
1125 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1127 define nat64_pool_addr_details {
1129 vl_api_ip4_address_t address;
1133 /** \brief Enable/disable NAT64 feature on the interface
1134 @param client_index - opaque cookie to identify the sender
1135 @param context - sender context, to match reply w/ request
1136 @param is_add - true if add, false if delete
1137 @param flags - flag NAT_IS_INSIDE if interface is inside else
1138 interface is outside
1139 @param sw_if_index - index of the interface
1141 autoreply define nat64_add_del_interface {
1145 vl_api_nat_config_flags_t flags;
1146 vl_api_interface_index_t sw_if_index;
1149 /** \brief Dump interfaces with NAT64 feature
1150 @param client_index - opaque cookie to identify the sender
1151 @param context - sender context, to match reply w/ request
1153 define nat64_interface_dump {
1158 /** \brief NAT64 interface details response
1159 @param context - sender context, to match reply w/ request
1160 @param flags - flag NAT_IS_INSIDE if interface is inside,
1161 flag NAT_IS_OUTSIDE if interface is outside
1162 and if both flags are set the interface is
1163 both inside and outside
1164 @param sw_if_index - index of the interface
1166 define nat64_interface_details {
1168 vl_api_nat_config_flags_t flags;
1169 vl_api_interface_index_t sw_if_index;
1172 /** \brief Add/delete NAT64 static BIB entry
1173 @param client_index - opaque cookie to identify the sender
1174 @param context - sender context, to match reply w/ request
1175 @param i_addr - inside IPv6 address
1176 @param o_addr - outside IPv4 address
1177 @param i_port - inside port number
1178 @param o_port - outside port number
1179 @param vrf_id - VRF id of tenant
1180 @param proto - protocol number
1181 @param is_add - true if add, false if delete
1183 autoreply define nat64_add_del_static_bib {
1186 vl_api_ip6_address_t i_addr;
1187 vl_api_ip4_address_t o_addr;
1195 /** \brief Dump NAT64 BIB
1196 @param client_index - opaque cookie to identify the sender
1197 @param context - sender context, to match reply w/ request
1198 @param proto - protocol of the BIB: 255 - all BIBs
1202 otherwise - "unknown" protocol BIB
1204 define nat64_bib_dump {
1210 /** \brief NAT64 BIB details response
1211 @param context - sender context, to match reply w/ request
1212 @param i_addr - inside IPv6 address
1213 @param o_addr - outside IPv4 address
1214 @param i_port - inside port number
1215 @param o_port - outside port number
1216 @param vrf_id - VRF id of tenant
1217 @param proto - protocol number
1218 @param flags - flag NAT_IS_STATIC if BIB entry is static
1219 or BIB entry is dynamic
1220 @param ses_num - number of sessions associated with the BIB entry
1222 define nat64_bib_details {
1224 vl_api_ip6_address_t i_addr;
1225 vl_api_ip4_address_t o_addr;
1230 vl_api_nat_config_flags_t flags;
1234 /** \brief Dump NAT64 session table
1235 @param client_index - opaque cookie to identify the sender
1236 @param context - sender context, to match reply w/ request
1237 @param proto - protocol of the session table: 255 - all STs
1241 otherwise - "unknown" proto ST
1243 define nat64_st_dump {
1249 /** \brief NAT64 session table details response
1250 @param context - sender context, to match reply w/ request
1251 @param il_addr - inside IPv6 address of the local host
1252 @param ol_addr - outside IPv4 address of the local host
1253 @param il_port - inside port number id of the local host/inside ICMP id
1254 @param ol_port - outside port number of the local host/outside ICMP id
1255 @param ir_addr - inside IPv6 address of the remote host
1256 @param or_addr - outside IPv4 address of the remote host
1257 @param r_port - port number of the remote host (not used for ICMP)
1258 @param vrf_id - VRF id of tenant
1259 @param proto - protocol number
1261 define nat64_st_details {
1263 vl_api_ip6_address_t il_addr;
1264 vl_api_ip4_address_t ol_addr;
1267 vl_api_ip6_address_t ir_addr;
1268 vl_api_ip4_address_t or_addr;
1274 /** \brief Add/del NAT64 prefix
1275 @param client_index - opaque cookie to identify the sender
1276 @param context - sender context, to match reply w/ request
1277 @param prefix - NAT64 prefix
1278 @param vrf_id - VRF id of tenant
1279 @param is_add - true if add, false if delete
1281 autoreply define nat64_add_del_prefix {
1284 vl_api_ip6_prefix_t prefix;
1289 /** \brief Dump NAT64 prefix
1290 @param client_index - opaque cookie to identify the sender
1291 @param context - sender context, to match reply w/ request
1293 define nat64_prefix_dump {
1298 /** \brief Dump NAT64 prefix details response
1299 @param context - sender context, to match reply w/ request
1300 @param prefix - NAT64 prefix
1301 @param vrf_id - VRF id of tenant
1303 define nat64_prefix_details {
1305 vl_api_ip6_prefix_t prefix;
1309 /** \brief Add/delete NAT64 pool address from specific interfce
1310 @param client_index - opaque cookie to identify the sender
1311 @param context - sender context, to match reply w/ request
1312 @param is_add - true if add, false if delete
1313 @param sw_if_index - software index of the interface
1315 autoreply define nat64_add_del_interface_addr {
1319 vl_api_interface_index_t sw_if_index;