2 * Copyright (c) 2020 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/lib/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.
29 enum nat44_config_flags : u8
31 NAT44_IS_ENDPOINT_INDEPENDENT = 0x00,
32 NAT44_IS_ENDPOINT_DEPENDENT = 0x01,
33 NAT44_IS_STATIC_MAPPING_ONLY = 0x02,
34 NAT44_IS_CONNECTION_TRACKING = 0x04,
35 NAT44_IS_OUT2IN_DPO = 0x08,
38 /** \brief Enable/disable NAT44 plugin
39 @param client_index - opaque cookie to identify the sender
40 @param context - sender context, to match reply w/ request
41 @param inside_vrf - inside vrf id
42 @param outside_vrf - outside vrf id
43 @param users - maximum number of users per thread
44 (NAT44_IS_ENDPOINT_INDEPENDENT)
45 @param user_memory - overwrite hash allocation parameter
46 (NAT44_IS_ENDPOINT_INDEPENDENT)
47 @param sessions - maximum number of sessions per thread
48 @param session_memory - overwrite hash allocation parameter
49 @param user_sessions - maximum number of sessions per user
50 (NAT44_IS_ENDPOINT_INDEPENDENT)
51 @param enable - true if enable, false if disable
52 @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
53 NAT44_IS_ENDPOINT_DEPENDENT,
54 NAT44_IS_STATIC_MAPPING_ONLY,
55 NAT44_IS_CONNECTION_TRACKING,
58 autoreply define nat44_plugin_enable_disable {
69 vl_api_nat44_config_flags_t flags;
72 /** \brief Control ping from client to api server request
73 @param client_index - opaque cookie to identify the sender
74 @param context - sender context, to match reply w/ request
76 define nat_control_ping
83 /** \brief Control ping from the client to the server response
84 @param client_index - opaque cookie to identify the sender
85 @param context - sender context, to match reply w/ request
86 @param retval - return code for the request
87 @param vpe_pid - the pid of the vpe, returned by the server
89 define nat_control_ping_reply
98 /** \brief Show NAT plugin startup config
99 @param client_index - opaque cookie to identify the sender
100 @param context - sender context, to match reply w/ request
102 define nat_show_config
109 /** \brief DEPRECATED: Show NAT plugin startup config reply
110 @param context - sender context, to match reply w/ request
111 @param retval - return code for the request
112 @param static_mapping_only - if true dynamic translations disabled
113 @param static_mapping_connection_tracking - if true create session data
114 @param deterministic - if true deterministic mapping
115 @param endpoint_dependent - if true endpoint-dependent mode
116 @param out2in_dpo - if true out2in dpo mode
117 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
118 @param translation_buckets - number of translation hash buckets
119 @param translation_memory_size - translation hash memory size
120 @param user_buckets - number of user hash buckets
121 @param user_memory_size - user hash memory size
122 @param max_translations_per_user - maximum number of translations per user
123 @param outside_vrf_id - outside VRF id
124 @param inside_vrf_id - default inside VRF id
125 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
126 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
127 @param nat64_st_buckets - number of NAT64 session table hash buckets
128 @param nat64_st_memory_size - memory size of NAT64 session table hash
130 define nat_show_config_reply
135 bool static_mapping_only;
136 bool static_mapping_connection_tracking;
138 bool endpoint_dependent;
141 u32 translation_buckets;
142 u32 translation_memory_size;
144 u64 user_memory_size;
145 u32 max_translations_per_user;
148 u32 nat64_bib_buckets;
149 u64 nat64_bib_memory_size;
150 u32 nat64_st_buckets;
151 u64 nat64_st_memory_size;
154 /** \brief Show NAT plugin startup config
155 @param client_index - opaque cookie to identify the sender
156 @param context - sender context, to match reply w/ request
158 define nat_show_config_2
165 /** \brief Show NAT plugin startup config reply
166 @param context - sender context, to match reply w/ request
167 @param retval - return code for the request
168 @param static_mapping_only - if true dynamic translations disabled
169 @param static_mapping_connection_tracking - if true create session data
170 @param deterministic - if true deterministic mapping
171 @param endpoint_dependent - if true endpoint-dependent mode
172 @param out2in_dpo - if true out2in dpo mode
173 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
174 @param translation_buckets - number of translation hash buckets
175 @param translation_memory_size - translation hash memory size
176 @param user_buckets - number of user hash buckets
177 @param user_memory_size - user hash memory size
178 @param max_translations_per_user - maximum number of translations per user
179 @param outside_vrf_id - outside VRF id
180 @param inside_vrf_id - default inside VRF id
181 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
182 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
183 @param nat64_st_buckets - number of NAT64 session table hash buckets
184 @param nat64_st_memory_size - memory size of NAT64 session table hash
185 @param max_translations_per_thread - max translations per worker thread
186 @param max_users_per_thread - max users per worker thread
188 define nat_show_config_2_reply
193 bool static_mapping_only;
194 bool static_mapping_connection_tracking;
196 bool endpoint_dependent;
199 u32 translation_buckets;
200 u64 translation_memory_size;
202 u64 user_memory_size;
203 u32 max_translations_per_user;
206 u32 nat64_bib_buckets;
207 u64 nat64_bib_memory_size;
208 u32 nat64_st_buckets;
209 u64 nat64_st_memory_size;
210 u32 max_translations_per_thread;
211 u32 max_users_per_thread;
214 /** \brief Show NAT44 plugin running config
215 @param client_index - opaque cookie to identify the sender
216 @param context - sender context, to match reply w/ request
218 define nat44_show_running_config
225 /** \brief Show NAT44 plugin running config reply
226 @param context - sender context, to match reply w/ request
227 @param retval - return code for the request
228 @param inside_vrf - default inside VRF id
229 @param outside_vrf - outside VRF id
230 @param users - maximum number of users per worker thread
231 (NAT44_IS_ENDPOINT_INDEPENDENT)
232 @param sessions - maximum number of sessions per worker thread
233 @param user_sessions - maximum number of sessions per user
234 (NAT44_IS_ENDPOINT_INDEPENDENT)
235 @param user_buckets - number of user hash buckets
236 (NAT44_IS_ENDPOINT_INDEPENDENT)
237 @param translation_buckets - number of translation hash buckets
238 @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
239 NAT44_IS_ENDPOINT_DEPENDENT,
240 NAT44_IS_STATIC_MAPPING_ONLY,
241 NAT44_IS_CONNECTION_TRACKING,
244 define nat44_show_running_config_reply
255 u32 translation_buckets;
256 bool forwarding_enabled;
257 bool ipfix_logging_enabled;
258 vl_api_nat_timeouts_t timeouts;
259 vl_api_nat_log_level_t log_level;
260 vl_api_nat44_config_flags_t flags;
263 /** \brief Run nat44 garbage collection
264 @param client_index - opaque cookie to identify the sender
265 @param context - sender context, to match reply w/ request
267 autoreply define nat44_session_cleanup {
273 /** \brief NAT44 set session limit
274 @param client_index - opaque cookie to identify the sender
275 @param context - sender context, to match reply w/ request
276 @param session_limit - session limit
277 @param vrf_id - vrf id
279 autoreply define nat44_set_session_limit {
286 /** \brief Set NAT logging level
287 @param client_index - opaque cookie to identify the sender
288 @param context - sender context, to match reply w/ request
289 @param log_level - logging level
291 autoreply define nat_set_log_level {
295 vl_api_nat_log_level_t log_level;
298 /** \brief Set NAT workers
299 @param client_index - opaque cookie to identify the sender
300 @param context - sender context, to match reply w/ request
301 @param worker_mask - NAT workers mask
303 autoreply define nat_set_workers {
309 /** \brief Dump NAT workers
310 @param client_index - opaque cookie to identify the sender
311 @param context - sender context, to match reply w/ request
313 define nat_worker_dump {
318 /** \brief NAT workers details response
319 @param context - sender context, to match reply w/ request
320 @param worker_index - worker index
321 @param lcore_id - lcore ID
322 @param name - worker name
324 define nat_worker_details {
331 /** \brief Enable/disable NAT IPFIX logging
332 @param client_index - opaque cookie to identify the sender
333 @param context - sender context, to match reply w/ request
334 @param domain_id - observation domain ID
335 @param src_port - source port number
336 @param enable - true if enable, false if disable
338 autoreply define nat_ipfix_enable_disable {
347 /** \brief Set values of timeouts for NAT sessions (seconds)
348 @param client_index - opaque cookie to identify the sender
349 @param context - sender context, to match reply w/ request
350 @param udp - UDP timeout (default 300sec)
351 @param tcp_established - TCP established timeout (default 7440sec)
352 @param tcp_transitory - TCP transitory timeout (default 240sec)
353 @param icmp - ICMP timeout (default 60sec)
355 autoreply define nat_set_timeouts {
365 /** \brief Get values of timeouts for NAT sessions (seconds)
366 @param client_index - opaque cookie to identify the sender
367 @param context - sender context, to match reply w/ request
369 define nat_get_timeouts {
375 /** \brief Get values of timeouts for NAT sessions reply
376 @param context - sender context, to match reply w/ request
377 @param retval - return code
378 @param udp - UDP timeout
379 @param tcp_established - TCP established timeout
380 @param tcp_transitory - TCP transitory timeout
381 @param icmp - ICMP timeout
383 define nat_get_timeouts_reply {
393 /** \brief Set address and port assignment algorithm
394 @param client_index - opaque cookie to identify the sender
395 @param context - sender context, to match reply w/ request
396 @param alg - address and port assignment algorithm:
397 0 - default, 1 - MAP-E, 2 - port range
398 (see nat_addr_and_port_alloc_alg_t in nat.h)
399 @param psid_offset - number of offset bits (valid only for MAP-E alg)
400 @param psid_length - length of PSID (valid only for MAP-E alg)
401 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
402 @param start_port - beginning of the port range
403 @param end_port - end of the port range
405 autoreply define nat_set_addr_and_port_alloc_alg {
416 /** \brief Get address and port assignment algorithm
417 @param client_index - opaque cookie to identify the sender
418 @param context - sender context, to match reply w/ request
420 define nat_get_addr_and_port_alloc_alg {
425 /** \brief Get address and port assignment algorithm reply
426 @param context - sender context, to match reply w/ request
427 @param retval - return code
428 @param alg - address and port assignment algorithm:
429 0 - default, 1 - MAP-E, 2 - port range
430 (see nat_addr_and_port_alloc_alg_t in nat.h)
431 @param psid_offset - number of offset bits (valid only for MAP-E alg)
432 @param psid_length - length of PSID (valid only for MAP-E alg)
433 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
434 @param start_port - beginning of the port range
435 @param end_port - end of the port range
437 define nat_get_addr_and_port_alloc_alg_reply {
448 /** \brief Set TCP MSS rewriting configuration
449 @param client_index - opaque cookie to identify the sender
450 @param context - sender context, to match reply w/ request
451 @param mss_value - MSS value to be used for MSS rewriting
452 @param enable - if true enable MSS rewriting feature else disable
454 autoreply define nat_set_mss_clamping {
461 /** \brief Get TCP MSS rewriting configuration
462 @param client_index - opaque cookie to identify the sender
463 @param context - sender context, to match reply w/ request
465 define nat_get_mss_clamping {
470 /** \brief Get TCP MSS rewriting configuration reply
471 @param context - sender context, to match reply w/ request
472 @param retval - return code
473 @param mss_value - MSS value to be used for MSS rewriting
474 @param enable - if true enable MSS rewriting feature else disable
476 define nat_get_mss_clamping_reply {
483 /** \brief Set HA listener (local settings)
484 @param client_index - opaque cookie to identify the sender
485 @param context - sender context, to match reply w/ request
486 @param ip_address - local IP4 address
487 @param port - local UDP port number
488 @param path_mtu - path MTU between local and failover
490 autoreply define nat_ha_set_listener {
493 vl_api_ip4_address_t ip_address;
498 /** \brief Set HA failover (remote settings)
499 @param client_index - opaque cookie to identify the sender
500 @param context - sender context, to match reply w/ request
501 @param ip_address - failover IP4 address
502 @param port - failvoer UDP port number
503 @param session_refresh_interval - number of seconds after which to send
504 session counters refresh
506 autoreply define nat_ha_set_failover {
509 vl_api_ip4_address_t ip_address;
511 u32 session_refresh_interval;
514 /** \brief Get HA listener/local configuration
515 @param client_index - opaque cookie to identify the sender
516 @param context - sender context, to match reply w/ request
518 define nat_ha_get_listener {
523 /** \brief Get HA listener/local configuration reply
524 @param context - sender context, to match reply w/ request
525 @param retval - return code
526 @param ip_address - local IP4 address
527 @param port - local UDP port number
528 @param path_mtu - Path MTU between local and failover
530 define nat_ha_get_listener_reply {
533 vl_api_ip4_address_t ip_address;
538 /** \brief Get HA failover/remote settings
539 @param client_index - opaque cookie to identify the sender
540 @param context - sender context, to match reply w/ request
542 define nat_ha_get_failover {
547 /** \brief Get HA failover/remote settings reply
548 @param context - sender context, to match reply w/ request
549 @param retval - return code
550 @param ip_address - failover IP4 address
551 @param port - failvoer UDP port number
552 @param session_refresh_interval - number of seconds after which to send
553 session counters refresh
555 define nat_ha_get_failover_reply {
558 vl_api_ip4_address_t ip_address;
560 u32 session_refresh_interval;
563 /** \brief Flush the current HA data (for testing)
564 @param client_index - opaque cookie to identify the sender
565 @param context - sender context, to match reply w/ request
567 autoreply define nat_ha_flush {
572 /** \brief Resync HA (resend existing sessions to new failover)
573 @param client_index - opaque cookie to identify the sender
574 @param context - sender context, to match reply w/ request
575 @param want_resync_event - resync completed event sent to the sender via
576 nat_ha_resync_completed_event API message if
578 @param pid - sender's pid
580 autoreply define nat_ha_resync
584 u8 want_resync_event;
588 /** \brief Tell client about a HA resync completion event
589 @param client_index - opaque cookie to identify the sender
590 @param pid - client pid registered to receive notification
591 @param missed_count - number of missed (not ACKed) messages
593 define nat_ha_resync_completed_event
601 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
604 /** \brief Del NAT44 user
605 @param client_index - opaque cookie to identify the sender
606 @param context - sender context, to match reply w/ request
607 @param ip_address - IPv4 address
608 @param fib_index - FIB index
610 autoreply define nat44_del_user {
613 vl_api_ip4_address_t ip_address;
617 /** \brief Add/del NAT44 address range
618 @param client_index - opaque cookie to identify the sender
619 @param context - sender context, to match reply w/ request
620 @param first_ip_address - first IPv4 address
621 @param last_ip_address - last IPv4 address
622 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
623 @param is_add - true if add, false if delete
624 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
627 autoreply define nat44_add_del_address_range {
630 vl_api_ip4_address_t first_ip_address;
631 vl_api_ip4_address_t last_ip_address;
634 vl_api_nat_config_flags_t flags;
637 /** \brief Dump NAT44 addresses
638 @param client_index - opaque cookie to identify the sender
639 @param context - sender context, to match reply w/ request
641 define nat44_address_dump {
646 /** \brief NAT44 address details response
647 @param context - sender context, to match reply w/ request
648 @param ip_address - IPv4 address
649 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
650 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
652 define nat44_address_details {
654 vl_api_ip4_address_t ip_address;
655 vl_api_nat_config_flags_t flags;
659 /** \brief Enable/disable NAT44 feature on the interface
660 @param client_index - opaque cookie to identify the sender
661 @param context - sender context, to match reply w/ request
662 @param is_add - true if add, false if delete
663 @param flags - flag NAT_IS_INSIDE if interface is inside else
665 @param sw_if_index - software index of the interface
667 autoreply define nat44_interface_add_del_feature {
671 vl_api_nat_config_flags_t flags;
672 vl_api_interface_index_t sw_if_index;
675 /** \brief Dump interfaces with NAT44 feature
676 @param client_index - opaque cookie to identify the sender
677 @param context - sender context, to match reply w/ request
679 define nat44_interface_dump {
684 /** \brief NAT44 interface details response
685 @param context - sender context, to match reply w/ request
686 @param sw_if_index - software index of the interface
687 @param flags - flag NAT_IS_INSIDE if interface is inside,
688 flag NAT_IS_OUTSIDE if interface is outside
689 and if both flags are set the interface is
690 both inside and outside
692 define nat44_interface_details {
694 vl_api_nat_config_flags_t flags;
695 vl_api_interface_index_t sw_if_index;
698 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
700 @param client_index - opaque cookie to identify the sender
701 @param context - sender context, to match reply w/ request
702 @param is_add - true if add, false if delete
703 @param flags - flag NAT_IS_INSIDE if interface is inside else
705 @param sw_if_index - software index of the interface
707 autoreply define nat44_interface_add_del_output_feature {
711 vl_api_nat_config_flags_t flags;
712 vl_api_interface_index_t sw_if_index;
715 /** \brief Dump interfaces with NAT44 output feature
716 @param client_index - opaque cookie to identify the sender
717 @param context - sender context, to match reply w/ request
719 define nat44_interface_output_feature_dump {
724 /** \brief NAT44 interface with output feature details response
725 @param context - sender context, to match reply w/ request
726 @param flags - flag NAT_IS_INSIDE if interface is inside else
728 @param sw_if_index - software index of the interface
730 define nat44_interface_output_feature_details {
732 vl_api_nat_config_flags_t flags;
733 vl_api_interface_index_t sw_if_index;
736 /** \brief Add/delete NAT44 static mapping
737 @param client_index - opaque cookie to identify the sender
738 @param context - sender context, to match reply w/ request
739 @param is_add - true if add, false if delete
740 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
741 flag nat_is_twice_nat if nat address range for external hosts,
742 flag NAT_IS_SELF_TWICE_NAT if translate external host address
743 and port whenever external host address equals local
744 address of internal host,
745 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
746 @param local_ip_address - local IPv4 address
747 @param external_ip_address - external IPv4 address
748 @param protocol - IP protocol, used only if addr_only=0
749 @param local_port - local port number, used only if addr_only=0
750 @param external_port - external port number, used only if addr_only=0
751 @param external_sw_if_index - external interface (if set
752 external_ip_address is ignored, ~0 means not
754 @param vfr_id - VRF ID
755 @param tag - opaque string tag
757 autoreply define nat44_add_del_static_mapping {
761 vl_api_nat_config_flags_t flags;
762 vl_api_ip4_address_t local_ip_address;
763 vl_api_ip4_address_t external_ip_address;
767 vl_api_interface_index_t external_sw_if_index;
772 /** \brief Add/delete NAT44 static mapping
773 @param client_index - opaque cookie to identify the sender
774 @param context - sender context, to match reply w/ request
775 @param is_add - true if add, false if delete
776 @param match_pool - true if use specific pool_ip_address
777 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
778 flag nat_is_twice_nat if nat address range for external hosts,
779 flag NAT_IS_SELF_TWICE_NAT if translate external host address
780 and port whenever external host address equals local
781 address of internal host,
782 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
783 @param pool_ip_address - pool IPv4 address to match with pool
784 @param local_ip_address - local IPv4 address
785 @param external_ip_address - external IPv4 address
786 @param protocol - IP protocol, used only if addr_only=0
787 @param local_port - local port number, used only if addr_only=0
788 @param external_port - external port number, used only if addr_only=0
789 @param external_sw_if_index - external interface (if set
790 external_ip_address is ignored, ~0 means not
792 @param vfr_id - VRF ID
793 @param tag - opaque string tag
795 autoreply define nat44_add_del_static_mapping_v2 {
801 vl_api_nat_config_flags_t flags;
802 vl_api_ip4_address_t pool_ip_address;
803 vl_api_ip4_address_t local_ip_address;
804 vl_api_ip4_address_t external_ip_address;
808 vl_api_interface_index_t external_sw_if_index;
813 /** \brief Dump NAT44 static mappings
814 @param client_index - opaque cookie to identify the sender
815 @param context - sender context, to match reply w/ request
817 define nat44_static_mapping_dump {
822 /** \brief NAT44 static mapping details response
823 @param context - sender context, to match reply w/ request
824 @param flags - flag NAT_ADDR_ONLY if address only mapping,
825 flag NAT_TWICE_NAT if NAT address range for external hosts,
826 flag NAT_SELF_TWICE_NAT if translate external host address
827 and port whenever external host address equals local
828 address of internal host,
829 flag NAT_OUT2IN_ONLY if rule match only out2in direction
830 @param local_ip_address - local IPv4 address
831 @param external_ip_address - external IPv4 address
832 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
833 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
834 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
835 @param external_sw_if_index - external interface
836 @param vfr_id - VRF ID
837 @param tag - opaque string tag
839 define nat44_static_mapping_details {
841 vl_api_nat_config_flags_t flags;
842 vl_api_ip4_address_t local_ip_address;
843 vl_api_ip4_address_t external_ip_address;
847 vl_api_interface_index_t external_sw_if_index;
852 /** \brief Add/delete NAT44 identity mapping
853 @param client_index - opaque cookie to identify the sender
854 @param context - sender context, to match reply w/ request
855 @param is_add - true if add, false if delete
856 @param flags - flag NAT_ADDR_ONLY if address only mapping
857 @param ip_address - IPv4 address
858 @param protocol - IP protocol
859 @param port - port number
860 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
862 @param vfr_id - VRF ID (if ~0 use default VRF)
863 @param tag - opaque string tag
865 autoreply define nat44_add_del_identity_mapping {
869 vl_api_nat_config_flags_t flags;
870 vl_api_ip4_address_t ip_address;
873 vl_api_interface_index_t sw_if_index;
878 /** \brief Dump NAT44 identity mappings
879 @param client_index - opaque cookie to identify the sender
880 @param context - sender context, to match reply w/ request
882 define nat44_identity_mapping_dump {
887 /** \brief NAT44 identity mapping details response
888 @param context - sender context, to match reply w/ request
889 @param flags - flag NAT_ADDR_ONLY if address only mapping
890 @param ip_address - IPv4 address
891 @param protocol - IP protocol
892 @param port - port number
893 @param sw_if_index - interface
894 @param vfr_id - VRF ID
895 @param tag - opaque string tag
897 define nat44_identity_mapping_details {
899 vl_api_nat_config_flags_t flags;
900 vl_api_ip4_address_t ip_address;
903 vl_api_interface_index_t sw_if_index;
908 /** \brief Add/delete NAT44 pool address from specific interfce
909 @param client_index - opaque cookie to identify the sender
910 @param context - sender context, to match reply w/ request
911 @param is_add - true if add, false if delete
912 @param sw_if_index - software index of the interface
913 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
915 autoreply define nat44_add_del_interface_addr {
919 vl_api_interface_index_t sw_if_index;
920 vl_api_nat_config_flags_t flags;
923 /** \brief Dump NAT44 pool addresses interfaces
924 @param client_index - opaque cookie to identify the sender
925 @param context - sender context, to match reply w/ request
927 define nat44_interface_addr_dump {
932 /** \brief NAT44 pool addresses interfaces details response
933 @param context - sender context, to match reply w/ request
934 @param sw_if_index - software index of the interface
935 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
938 define nat44_interface_addr_details {
940 vl_api_interface_index_t sw_if_index;
941 vl_api_nat_config_flags_t flags;
944 /** \brief Dump NAT44 users
945 @param client_index - opaque cookie to identify the sender
946 @param context - sender context, to match reply w/ request
948 define nat44_user_dump {
953 /** \brief NAT44 users response
954 @param context - sender context, to match reply w/ request
956 @param ip_address - IPv4 address
957 @param nsessions - number of dynamic sessions
958 @param nstaticsessions - number of static sessions
960 define nat44_user_details {
963 vl_api_ip4_address_t ip_address;
968 /** \brief NAT44 user's sessions
969 @param client_index - opaque cookie to identify the sender
970 @param context - sender context, to match reply w/ request
971 @param ip_address - IPv4 address of the user to dump
972 @param vrf_id - VRF_ID
974 define nat44_user_session_dump {
977 vl_api_ip4_address_t ip_address;
981 /** \brief NAT44 user's sessions response
982 @param context - sender context, to match reply w/ request
983 @param outside_ip_address - outside IPv4 address
984 @param outside_port - outside port
985 @param inside_ip_address - inside IPv4 address
986 @param inside_port - inside port
987 @param protocol - protocol
988 @param flags - flag NAT_IS_STATIC if session is static,
989 flag NAT_IS_TWICE_NAT if session is twice-nat,
990 flag NAT_IS_EXT_HOST_VALID if external host address
992 @param last_heard - last heard timer
993 @param total_bytes - count of bytes sent through session
994 @param total_pkts - count of pakets sent through session
995 @param ext_host_address - external host IPv4 address
996 @param ext_host_port - external host port
997 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
998 only if twice-nat session)
999 @param ext_host_nat_port - post-NAT external host port (valid only if
1002 define nat44_user_session_details {
1004 vl_api_ip4_address_t outside_ip_address;
1006 vl_api_ip4_address_t inside_ip_address;
1009 vl_api_nat_config_flags_t flags;
1013 vl_api_ip4_address_t ext_host_address;
1015 vl_api_ip4_address_t ext_host_nat_address;
1016 u16 ext_host_nat_port;
1019 /** \brief NAT44 load-balancing address and port pair
1020 @param addr - IPv4 address of the internal node
1021 @param port - L4 port number of the internal node
1022 @param probability - probability of the internal node to be randomly matched
1023 @param vrf_id - VRF id
1025 typedef nat44_lb_addr_port {
1026 vl_api_ip4_address_t addr;
1032 /** \brief Add/delete NAT44 load-balancing static mapping rule
1033 @param client_index - opaque cookie to identify the sender
1034 @param context - sender context, to match reply w/ request
1035 @param is_add - true if add, false if delete
1036 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1037 flag NAT_SELF_TWICE_NAT if translate external host address
1038 and port whenever external host address equals local
1039 address of internal host,
1040 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1041 @param external_addr - external IPv4 address of the service
1042 @param external_port - external L4 port number of the service
1043 @param protocol - IP protocol number of the service
1044 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1046 @param local_num - number of local network nodes
1047 @param locals - local network nodes
1048 @param tag - opaque string tag
1050 autoreply define nat44_add_del_lb_static_mapping {
1054 vl_api_nat_config_flags_t flags;
1055 vl_api_ip4_address_t external_addr;
1061 vl_api_nat44_lb_addr_port_t locals[local_num];
1064 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
1065 @param client_index - opaque cookie to identify the sender
1066 @param context - sender context, to match reply w/ request
1067 @param is_add - true if add, false if delete
1068 @param external_addr - external IPv4 address of the service
1069 @param external_port - external L4 port number of the service
1070 @param protocol - IP protocol number of the service
1071 @param local - local network node
1073 autoreply define nat44_lb_static_mapping_add_del_local {
1077 vl_api_ip4_address_t external_addr;
1080 vl_api_nat44_lb_addr_port_t local;
1083 /** \brief Dump NAT44 load-balancing static mapping rules
1084 @param client_index - opaque cookie to identify the sender
1085 @param context - sender context, to match reply w/ request
1087 define nat44_lb_static_mapping_dump {
1092 /** \brief NAT44 load-balancing static mapping rule details response
1093 @param context - sender context, to match reply w/ request
1094 @param external_addr - external IPv4 address of the service
1095 @param external_port - external L4 port number of the service
1096 @param protocol - IP protocol number of the service
1097 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1098 flag NAT_SELF_TWICE_NAT if translate external host address
1099 and port whenever external host address equals local
1100 address of internal host,
1101 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1102 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1104 @param local_num - number of local network nodes
1105 @param locals - local network nodes
1106 @param tag - opaque string tag
1108 define nat44_lb_static_mapping_details {
1110 vl_api_ip4_address_t external_addr;
1113 vl_api_nat_config_flags_t flags;
1117 vl_api_nat44_lb_addr_port_t locals[local_num];
1120 /** \brief Delete NAT44 session
1121 @param client_index - opaque cookie to identify the sender
1122 @param context - sender context, to match reply w/ request
1123 @param ip_address - IPv4 address
1124 @param protocol - IP protocol
1125 @param port - port number
1126 @param vfr_id - VRF ID
1127 @param flags - flag NAT_IS_INSIDE if interface is inside or
1128 interface is outside,
1129 flag NAT_IS_EXT_HOST_VALID if external host address and
1131 @param ext_host_address - external host IPv4 address
1132 @param ext_host_port - external host port
1134 autoreply define nat44_del_session {
1137 vl_api_ip4_address_t address;
1141 vl_api_nat_config_flags_t flags;
1142 vl_api_ip4_address_t ext_host_address;
1146 /** \brief Enable/disable forwarding for NAT44
1147 Forward packets which don't match existing translation
1148 or static mapping instead of dropping them.
1149 @param client_index - opaque cookie to identify the sender
1150 @param context - sender context, to match reply w/ request
1151 @param enable - true for enable, false for disable
1153 autoreply define nat44_forwarding_enable_disable {
1160 /** \brief Check if forwarding is enabled or disabled
1161 @param client_index - opaque cookie to identify the sender
1162 @param context - sender context, to match reply w/ request
1164 define nat44_forwarding_is_enabled {
1170 /** \brief Response to check if forwarding is enabled or disabled
1171 @param context - sender context, to match reply w/ request
1172 @param enabled - true if enabled, false if disabled
1174 define nat44_forwarding_is_enabled_reply {
1180 /** \brief Set NAT handoff frame queue options
1181 @param client_index - opaque cookie to identify the sender
1182 @param context - sender context, to match reply w/ request
1183 @param frame_queue_nelts - number of worker handoff frame queue elements
1185 autoreply define nat44_ed_set_fq_options {
1189 u32 frame_queue_nelts;
1192 /** \brief Show NAT handoff frame queue options
1193 @param client_index - opaque cookie to identify the sender
1194 @param context - sender context, to match reply w/ request
1196 define nat44_ed_show_fq_options
1203 /** \brief Show NAT handoff frame queue options reply
1204 @param context - sender context, to match reply w/ request
1205 @param retval - return code for the request
1206 @param frame_queue_nelts - number of worker handoff frame queue elements
1208 define nat44_ed_show_fq_options_reply
1213 u32 frame_queue_nelts;