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 enum nat44_config_flags : u8
35 NAT44_IS_ENDPOINT_INDEPENDENT = 0x00,
36 NAT44_IS_ENDPOINT_DEPENDENT = 0x01,
37 NAT44_IS_STATIC_MAPPING_ONLY = 0x02,
38 NAT44_IS_CONNECTION_TRACKING = 0x04,
39 NAT44_IS_OUT2IN_DPO = 0x08,
42 /** \brief Enable/disable NAT44 plugin
43 @param client_index - opaque cookie to identify the sender
44 @param context - sender context, to match reply w/ request
45 @param inside_vrf - inside vrf id
46 @param outside_vrf - outside vrf id
47 @param users - maximum number of users per thread
48 (NAT44_IS_ENDPOINT_INDEPENDENT)
49 @param user_memory - overwrite hash allocation parameter
50 (NAT44_IS_ENDPOINT_INDEPENDENT)
51 @param sessions - maximum number of sessions per thread
52 @param session_memory - overwrite hash allocation parameter
53 @param user_sessions - maximum number of sessions per user
54 (NAT44_IS_ENDPOINT_INDEPENDENT)
55 @param enable - true if enable, false if disable
56 @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
57 NAT44_IS_ENDPOINT_DEPENDENT,
58 NAT44_IS_STATIC_MAPPING_ONLY,
59 NAT44_IS_CONNECTION_TRACKING,
62 autoreply define nat44_plugin_enable_disable {
73 vl_api_nat44_config_flags_t flags;
76 /** \brief Control ping from client to api server request
77 @param client_index - opaque cookie to identify the sender
78 @param context - sender context, to match reply w/ request
80 define nat_control_ping
86 /** \brief Control ping from the client to the server response
87 @param client_index - opaque cookie to identify the sender
88 @param context - sender context, to match reply w/ request
89 @param retval - return code for the request
90 @param vpe_pid - the pid of the vpe, returned by the server
92 define nat_control_ping_reply
100 /** \brief Show NAT plugin startup config
101 @param client_index - opaque cookie to identify the sender
102 @param context - sender context, to match reply w/ request
104 define nat_show_config
111 /** \brief DEPRECATED: Show NAT plugin startup config reply
112 @param context - sender context, to match reply w/ request
113 @param retval - return code for the request
114 @param static_mapping_only - if true dynamic translations disabled
115 @param static_mapping_connection_tracking - if true create session data
116 @param deterministic - if true deterministic mapping
117 @param endpoint_dependent - if true endpoint-dependent mode
118 @param out2in_dpo - if true out2in dpo mode
119 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
120 @param translation_buckets - number of translation hash buckets
121 @param translation_memory_size - translation hash memory size
122 @param user_buckets - number of user hash buckets
123 @param user_memory_size - user hash memory size
124 @param max_translations_per_user - maximum number of translations per user
125 @param outside_vrf_id - outside VRF id
126 @param inside_vrf_id - default inside VRF id
127 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
128 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
129 @param nat64_st_buckets - number of NAT64 session table hash buckets
130 @param nat64_st_memory_size - memory size of NAT64 session table hash
132 define nat_show_config_reply
137 bool static_mapping_only;
138 bool static_mapping_connection_tracking;
140 bool endpoint_dependent;
143 u32 translation_buckets;
144 u32 translation_memory_size;
146 u64 user_memory_size;
147 u32 max_translations_per_user;
150 u32 nat64_bib_buckets;
151 u64 nat64_bib_memory_size;
152 u32 nat64_st_buckets;
153 u64 nat64_st_memory_size;
156 /** \brief Show NAT plugin startup config
157 @param client_index - opaque cookie to identify the sender
158 @param context - sender context, to match reply w/ request
160 define nat_show_config_2
167 /** \brief Show NAT plugin startup config reply
168 @param context - sender context, to match reply w/ request
169 @param retval - return code for the request
170 @param static_mapping_only - if true dynamic translations disabled
171 @param static_mapping_connection_tracking - if true create session data
172 @param deterministic - if true deterministic mapping
173 @param endpoint_dependent - if true endpoint-dependent mode
174 @param out2in_dpo - if true out2in dpo mode
175 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
176 @param translation_buckets - number of translation hash buckets
177 @param translation_memory_size - translation hash memory size
178 @param user_buckets - number of user hash buckets
179 @param user_memory_size - user hash memory size
180 @param max_translations_per_user - maximum number of translations per user
181 @param outside_vrf_id - outside VRF id
182 @param inside_vrf_id - default inside VRF id
183 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
184 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
185 @param nat64_st_buckets - number of NAT64 session table hash buckets
186 @param nat64_st_memory_size - memory size of NAT64 session table hash
187 @param max_translations_per_thread - max translations per worker thread
188 @param max_users_per_thread - max users per worker thread
190 define nat_show_config_2_reply
195 bool static_mapping_only;
196 bool static_mapping_connection_tracking;
198 bool endpoint_dependent;
201 u32 translation_buckets;
202 u64 translation_memory_size;
204 u64 user_memory_size;
205 u32 max_translations_per_user;
208 u32 nat64_bib_buckets;
209 u64 nat64_bib_memory_size;
210 u32 nat64_st_buckets;
211 u64 nat64_st_memory_size;
212 u32 max_translations_per_thread;
213 u32 max_users_per_thread;
216 enum nat_log_level : u8
219 NAT_LOG_ERROR = 0x01,
220 NAT_LOG_WARNING = 0x02,
221 NAT_LOG_NOTICE = 0x03,
223 NAT_LOG_DEBUG = 0x05,
226 /** \brief Run nat44 garbage collection
227 @param client_index - opaque cookie to identify the sender
228 @param context - sender context, to match reply w/ request
230 autoreply define nat44_session_cleanup {
235 /** \brief NAT44 set session limit
236 @param client_index - opaque cookie to identify the sender
237 @param context - sender context, to match reply w/ request
238 @param session_limit - session limit
239 @param vrf_id - vrf id
241 autoreply define nat44_set_session_limit {
248 /** \brief Set NAT logging level
249 @param client_index - opaque cookie to identify the sender
250 @param context - sender context, to match reply w/ request
251 @param log_level - logging level
253 autoreply define nat_set_log_level {
256 vl_api_nat_log_level_t log_level;
259 /** \brief Set NAT workers
260 @param client_index - opaque cookie to identify the sender
261 @param context - sender context, to match reply w/ request
262 @param worker_mask - NAT workers mask
264 autoreply define nat_set_workers {
270 /** \brief Dump NAT workers
271 @param client_index - opaque cookie to identify the sender
272 @param context - sender context, to match reply w/ request
274 define nat_worker_dump {
279 /** \brief NAT workers details response
280 @param context - sender context, to match reply w/ request
281 @param worker_index - worker index
282 @param lcore_id - lcore ID
283 @param name - worker name
285 define nat_worker_details {
292 /** \brief Enable/disable NAT IPFIX logging
293 @param client_index - opaque cookie to identify the sender
294 @param context - sender context, to match reply w/ request
295 @param domain_id - observation domain ID
296 @param src_port - source port number
297 @param enable - true if enable, false if disable
299 autoreply define nat_ipfix_enable_disable {
307 /** \brief Set values of timeouts for NAT sessions (seconds)
308 @param client_index - opaque cookie to identify the sender
309 @param context - sender context, to match reply w/ request
310 @param udp - UDP timeout (default 300sec)
311 @param tcp_established - TCP established timeout (default 7440sec)
312 @param tcp_transitory - TCP transitory timeout (default 240sec)
313 @param icmp - ICMP timeout (default 60sec)
315 autoreply define nat_set_timeouts {
324 /** \brief Get values of timeouts for NAT sessions (seconds)
325 @param client_index - opaque cookie to identify the sender
326 @param context - sender context, to match reply w/ request
328 define nat_get_timeouts {
333 /** \brief Get values of timeouts for NAT sessions reply
334 @param context - sender context, to match reply w/ request
335 @param retval - return code
336 @param udp - UDP timeout
337 @param tcp_established - TCP established timeout
338 @param tcp_transitory - TCP transitory timeout
339 @param icmp - ICMP timeout
341 define nat_get_timeouts_reply {
350 /** \brief Set address and port assignment algorithm
351 @param client_index - opaque cookie to identify the sender
352 @param context - sender context, to match reply w/ request
353 @param alg - address and port assignment algorithm:
354 0 - default, 1 - MAP-E, 2 - port range
355 (see nat_addr_and_port_alloc_alg_t in nat.h)
356 @param psid_offset - number of offset bits (valid only for MAP-E alg)
357 @param psid_length - length of PSID (valid only for MAP-E alg)
358 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
359 @param start_port - beginning of the port range
360 @param end_port - end of the port range
362 autoreply define nat_set_addr_and_port_alloc_alg {
373 /** \brief Get address and port assignment algorithm
374 @param client_index - opaque cookie to identify the sender
375 @param context - sender context, to match reply w/ request
377 define nat_get_addr_and_port_alloc_alg {
382 /** \brief Get address and port assignment algorithm reply
383 @param context - sender context, to match reply w/ request
384 @param retval - return code
385 @param alg - address and port assignment algorithm:
386 0 - default, 1 - MAP-E, 2 - port range
387 (see nat_addr_and_port_alloc_alg_t in nat.h)
388 @param psid_offset - number of offset bits (valid only for MAP-E alg)
389 @param psid_length - length of PSID (valid only for MAP-E alg)
390 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
391 @param start_port - beginning of the port range
392 @param end_port - end of the port range
394 define nat_get_addr_and_port_alloc_alg_reply {
405 /** \brief Set TCP MSS rewriting configuration
406 @param client_index - opaque cookie to identify the sender
407 @param context - sender context, to match reply w/ request
408 @param mss_value - MSS value to be used for MSS rewriting
409 @param enable - if true enable MSS rewriting feature else disable
411 autoreply define nat_set_mss_clamping {
418 /** \brief Get TCP MSS rewriting configuration
419 @param client_index - opaque cookie to identify the sender
420 @param context - sender context, to match reply w/ request
422 define nat_get_mss_clamping {
427 /** \brief Get TCP MSS rewriting configuration reply
428 @param context - sender context, to match reply w/ request
429 @param retval - return code
430 @param mss_value - MSS value to be used for MSS rewriting
431 @param enable - if true enable MSS rewriting feature else disable
433 define nat_get_mss_clamping_reply {
440 /** \brief Set HA listener (local settings)
441 @param client_index - opaque cookie to identify the sender
442 @param context - sender context, to match reply w/ request
443 @param ip_address - local IP4 address
444 @param port - local UDP port number
445 @param path_mtu - path MTU between local and failover
447 autoreply define nat_ha_set_listener {
450 vl_api_ip4_address_t ip_address;
455 /** \brief Set HA failover (remote settings)
456 @param client_index - opaque cookie to identify the sender
457 @param context - sender context, to match reply w/ request
458 @param ip_address - failover IP4 address
459 @param port - failvoer UDP port number
460 @param session_refresh_interval - number of seconds after which to send
461 session counters refresh
463 autoreply define nat_ha_set_failover {
466 vl_api_ip4_address_t ip_address;
468 u32 session_refresh_interval;
471 /** \brief Get HA listener/local configuration
472 @param client_index - opaque cookie to identify the sender
473 @param context - sender context, to match reply w/ request
475 define nat_ha_get_listener {
480 /** \brief Get HA listener/local configuration reply
481 @param context - sender context, to match reply w/ request
482 @param retval - return code
483 @param ip_address - local IP4 address
484 @param port - local UDP port number
485 @param path_mtu - Path MTU between local and failover
487 define nat_ha_get_listener_reply {
490 vl_api_ip4_address_t ip_address;
495 /** \brief Get HA failover/remote settings
496 @param client_index - opaque cookie to identify the sender
497 @param context - sender context, to match reply w/ request
499 define nat_ha_get_failover {
504 /** \brief Get HA failover/remote settings reply
505 @param context - sender context, to match reply w/ request
506 @param retval - return code
507 @param ip_address - failover IP4 address
508 @param port - failvoer UDP port number
509 @param session_refresh_interval - number of seconds after which to send
510 session counters refresh
512 define nat_ha_get_failover_reply {
515 vl_api_ip4_address_t ip_address;
517 u32 session_refresh_interval;
520 /** \brief Flush the current HA data (for testing)
521 @param client_index - opaque cookie to identify the sender
522 @param context - sender context, to match reply w/ request
524 autoreply define nat_ha_flush {
529 /** \brief Resync HA (resend existing sessions to new failover)
530 @param client_index - opaque cookie to identify the sender
531 @param context - sender context, to match reply w/ request
532 @param want_resync_event - resync completed event sent to the sender via
533 nat_ha_resync_completed_event API message if
535 @param pid - sender's pid
537 autoreply define nat_ha_resync
541 u8 want_resync_event;
545 /** \brief Tell client about a HA resync completion event
546 @param client_index - opaque cookie to identify the sender
547 @param pid - client pid registered to receive notification
548 @param missed_count - number of missed (not ACKed) messages
550 define nat_ha_resync_completed_event
558 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
565 /** \brief Del NAT44 user
566 @param client_index - opaque cookie to identify the sender
567 @param context - sender context, to match reply w/ request
568 @param ip_address - IPv4 address
569 @param fib_index - FIB index
571 autoreply define nat44_del_user {
574 vl_api_ip4_address_t ip_address;
578 /** \brief Add/del NAT44 address range
579 @param client_index - opaque cookie to identify the sender
580 @param context - sender context, to match reply w/ request
581 @param first_ip_address - first IPv4 address
582 @param last_ip_address - last IPv4 address
583 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
584 @param is_add - true if add, false if delete
585 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
588 autoreply define nat44_add_del_address_range {
591 vl_api_ip4_address_t first_ip_address;
592 vl_api_ip4_address_t last_ip_address;
595 vl_api_nat_config_flags_t flags;
598 /** \brief Dump NAT44 addresses
599 @param client_index - opaque cookie to identify the sender
600 @param context - sender context, to match reply w/ request
602 define nat44_address_dump {
607 /** \brief NAT44 address details response
608 @param context - sender context, to match reply w/ request
609 @param ip_address - IPv4 address
610 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
611 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
613 define nat44_address_details {
615 vl_api_ip4_address_t ip_address;
616 vl_api_nat_config_flags_t flags;
620 /** \brief Enable/disable NAT44 feature on the interface
621 @param client_index - opaque cookie to identify the sender
622 @param context - sender context, to match reply w/ request
623 @param is_add - true if add, false if delete
624 @param flags - flag NAT_IS_INSIDE if interface is inside else
626 @param sw_if_index - software index of the interface
628 autoreply define nat44_interface_add_del_feature {
632 vl_api_nat_config_flags_t flags;
633 vl_api_interface_index_t sw_if_index;
636 /** \brief Dump interfaces with NAT44 feature
637 @param client_index - opaque cookie to identify the sender
638 @param context - sender context, to match reply w/ request
640 define nat44_interface_dump {
645 /** \brief NAT44 interface details response
646 @param context - sender context, to match reply w/ request
647 @param sw_if_index - software index of the interface
648 @param flags - flag NAT_IS_INSIDE if interface is inside,
649 flag NAT_IS_OUTSIDE if interface is outside
650 and if both flags are set the interface is
651 both inside and outside
653 define nat44_interface_details {
655 vl_api_nat_config_flags_t flags;
656 vl_api_interface_index_t sw_if_index;
659 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
661 @param client_index - opaque cookie to identify the sender
662 @param context - sender context, to match reply w/ request
663 @param is_add - true if add, false if delete
664 @param flags - flag NAT_IS_INSIDE if interface is inside else
666 @param sw_if_index - software index of the interface
668 autoreply define nat44_interface_add_del_output_feature {
672 vl_api_nat_config_flags_t flags;
673 vl_api_interface_index_t sw_if_index;
676 /** \brief Dump interfaces with NAT44 output feature
677 @param client_index - opaque cookie to identify the sender
678 @param context - sender context, to match reply w/ request
680 define nat44_interface_output_feature_dump {
685 /** \brief NAT44 interface with output feature details response
686 @param context - sender context, to match reply w/ request
687 @param flags - flag NAT_IS_INSIDE if interface is inside else
689 @param sw_if_index - software index of the interface
691 define nat44_interface_output_feature_details {
693 vl_api_nat_config_flags_t flags;
694 vl_api_interface_index_t sw_if_index;
697 /** \brief Add/delete NAT44 static mapping
698 @param client_index - opaque cookie to identify the sender
699 @param context - sender context, to match reply w/ request
700 @param is_add - true if add, false if delete
701 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
702 flag nat_is_twice_nat if nat address range for external hosts,
703 flag NAT_IS_SELF_TWICE_NAT if translate external host address
704 and port whenever external host address equals local
705 address of internal host,
706 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
707 @param local_ip_address - local IPv4 address
708 @param external_ip_address - external IPv4 address
709 @param protocol - IP protocol, used only if addr_only=0
710 @param local_port - local port number, used only if addr_only=0
711 @param external_port - external port number, used only if addr_only=0
712 @param external_sw_if_index - external interface (if set
713 external_ip_address is ignored, ~0 means not
715 @param vfr_id - VRF ID
716 @param tag - opaque string tag
718 autoreply define nat44_add_del_static_mapping {
722 vl_api_nat_config_flags_t flags;
723 vl_api_ip4_address_t local_ip_address;
724 vl_api_ip4_address_t external_ip_address;
728 vl_api_interface_index_t external_sw_if_index;
733 /** \brief Add/delete NAT44 static mapping
734 @param client_index - opaque cookie to identify the sender
735 @param context - sender context, to match reply w/ request
736 @param is_add - true if add, false if delete
737 @param match_pool - true if use specific pool_ip_address
738 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
739 flag nat_is_twice_nat if nat address range for external hosts,
740 flag NAT_IS_SELF_TWICE_NAT if translate external host address
741 and port whenever external host address equals local
742 address of internal host,
743 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
744 @param pool_ip_address - pool IPv4 address to match with pool
745 @param local_ip_address - local IPv4 address
746 @param external_ip_address - external IPv4 address
747 @param protocol - IP protocol, used only if addr_only=0
748 @param local_port - local port number, used only if addr_only=0
749 @param external_port - external port number, used only if addr_only=0
750 @param external_sw_if_index - external interface (if set
751 external_ip_address is ignored, ~0 means not
753 @param vfr_id - VRF ID
754 @param tag - opaque string tag
756 autoreply define nat44_add_del_static_mapping_v2 {
757 option status="in_progress";
762 vl_api_nat_config_flags_t flags;
763 vl_api_ip4_address_t pool_ip_address;
764 vl_api_ip4_address_t local_ip_address;
765 vl_api_ip4_address_t external_ip_address;
769 vl_api_interface_index_t external_sw_if_index;
774 /** \brief Dump NAT44 static mappings
775 @param client_index - opaque cookie to identify the sender
776 @param context - sender context, to match reply w/ request
778 define nat44_static_mapping_dump {
783 /** \brief NAT44 static mapping details response
784 @param context - sender context, to match reply w/ request
785 @param flags - flag NAT_ADDR_ONLY if address only mapping,
786 flag NAT_TWICE_NAT if NAT address range for external hosts,
787 flag NAT_SELF_TWICE_NAT if translate external host address
788 and port whenever external host address equals local
789 address of internal host,
790 flag NAT_OUT2IN_ONLY if rule match only out2in direction
791 @param local_ip_address - local IPv4 address
792 @param external_ip_address - external IPv4 address
793 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
794 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
795 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
796 @param external_sw_if_index - external interface
797 @param vfr_id - VRF ID
798 @param tag - opaque string tag
800 define nat44_static_mapping_details {
802 vl_api_nat_config_flags_t flags;
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 Add/delete NAT44 identity mapping
814 @param client_index - opaque cookie to identify the sender
815 @param context - sender context, to match reply w/ request
816 @param is_add - true if add, false if delete
817 @param flags - flag NAT_ADDR_ONLY if address only mapping
818 @param ip_address - IPv4 address
819 @param protocol - IP protocol
820 @param port - port number
821 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
823 @param vfr_id - VRF ID (if ~0 use default VRF)
824 @param tag - opaque string tag
826 autoreply define nat44_add_del_identity_mapping {
830 vl_api_nat_config_flags_t flags;
831 vl_api_ip4_address_t ip_address;
834 vl_api_interface_index_t sw_if_index;
839 /** \brief Dump NAT44 identity mappings
840 @param client_index - opaque cookie to identify the sender
841 @param context - sender context, to match reply w/ request
843 define nat44_identity_mapping_dump {
848 /** \brief NAT44 identity mapping details response
849 @param context - sender context, to match reply w/ request
850 @param flags - flag NAT_ADDR_ONLY if address only mapping
851 @param ip_address - IPv4 address
852 @param protocol - IP protocol
853 @param port - port number
854 @param sw_if_index - interface
855 @param vfr_id - VRF ID
856 @param tag - opaque string tag
858 define nat44_identity_mapping_details {
860 vl_api_nat_config_flags_t flags;
861 vl_api_ip4_address_t ip_address;
864 vl_api_interface_index_t sw_if_index;
869 /** \brief Add/delete NAT44 pool address from specific interfce
870 @param client_index - opaque cookie to identify the sender
871 @param context - sender context, to match reply w/ request
872 @param is_add - true if add, false if delete
873 @param sw_if_index - software index of the interface
874 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
876 autoreply define nat44_add_del_interface_addr {
880 vl_api_interface_index_t sw_if_index;
881 vl_api_nat_config_flags_t flags;
884 /** \brief Dump NAT44 pool addresses interfaces
885 @param client_index - opaque cookie to identify the sender
886 @param context - sender context, to match reply w/ request
888 define nat44_interface_addr_dump {
893 /** \brief NAT44 pool addresses interfaces details response
894 @param context - sender context, to match reply w/ request
895 @param sw_if_index - software index of the interface
896 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
899 define nat44_interface_addr_details {
901 vl_api_interface_index_t sw_if_index;
902 vl_api_nat_config_flags_t flags;
905 /** \brief Dump NAT44 users
906 @param client_index - opaque cookie to identify the sender
907 @param context - sender context, to match reply w/ request
909 define nat44_user_dump {
914 /** \brief NAT44 users response
915 @param context - sender context, to match reply w/ request
917 @param ip_address - IPv4 address
918 @param nsessions - number of dynamic sessions
919 @param nstaticsessions - number of static sessions
921 define nat44_user_details {
924 vl_api_ip4_address_t ip_address;
929 /** \brief NAT44 user's sessions
930 @param client_index - opaque cookie to identify the sender
931 @param context - sender context, to match reply w/ request
932 @param ip_address - IPv4 address of the user to dump
933 @param vrf_id - VRF_ID
935 define nat44_user_session_dump {
938 vl_api_ip4_address_t ip_address;
942 /** \brief NAT44 user's sessions response
943 @param context - sender context, to match reply w/ request
944 @param outside_ip_address - outside IPv4 address
945 @param outside_port - outside port
946 @param inside_ip_address - inside IPv4 address
947 @param inside_port - inside port
948 @param protocol - protocol
949 @param flags - flag NAT_IS_STATIC if session is static,
950 flag NAT_IS_TWICE_NAT if session is twice-nat,
951 flag NAT_IS_EXT_HOST_VALID if external host address
953 @param last_heard - last heard timer
954 @param total_bytes - count of bytes sent through session
955 @param total_pkts - count of pakets sent through session
956 @param ext_host_address - external host IPv4 address
957 @param ext_host_port - external host port
958 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
959 only if twice-nat session)
960 @param ext_host_nat_port - post-NAT external host port (valid only if
963 define nat44_user_session_details {
965 vl_api_ip4_address_t outside_ip_address;
967 vl_api_ip4_address_t inside_ip_address;
970 vl_api_nat_config_flags_t flags;
974 vl_api_ip4_address_t ext_host_address;
976 vl_api_ip4_address_t ext_host_nat_address;
977 u16 ext_host_nat_port;
980 /** \brief NAT44 load-balancing address and port pair
981 @param addr - IPv4 address of the internal node
982 @param port - L4 port number of the internal node
983 @param probability - probability of the internal node to be randomly matched
984 @param vrf_id - VRF id
986 typedef nat44_lb_addr_port {
987 vl_api_ip4_address_t addr;
993 /** \brief Add/delete NAT44 load-balancing static mapping rule
994 @param client_index - opaque cookie to identify the sender
995 @param context - sender context, to match reply w/ request
996 @param is_add - true if add, false if delete
997 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
998 flag NAT_SELF_TWICE_NAT if translate external host address
999 and port whenever external host address equals local
1000 address of internal host,
1001 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1002 @param external_addr - external IPv4 address of the service
1003 @param external_port - external L4 port number of the service
1004 @param protocol - IP protocol number of the service
1005 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1007 @param local_num - number of local network nodes
1008 @param locals - local network nodes
1009 @param tag - opaque string tag
1011 autoreply manual_endian define nat44_add_del_lb_static_mapping {
1015 vl_api_nat_config_flags_t flags;
1016 vl_api_ip4_address_t external_addr;
1022 vl_api_nat44_lb_addr_port_t locals[local_num];
1025 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
1026 @param client_index - opaque cookie to identify the sender
1027 @param context - sender context, to match reply w/ request
1028 @param is_add - true if add, false if delete
1029 @param external_addr - external IPv4 address of the service
1030 @param external_port - external L4 port number of the service
1031 @param protocol - IP protocol number of the service
1032 @param local - local network node
1034 autoreply define nat44_lb_static_mapping_add_del_local {
1038 vl_api_ip4_address_t external_addr;
1041 vl_api_nat44_lb_addr_port_t local;
1044 /** \brief Dump NAT44 load-balancing static mapping rules
1045 @param client_index - opaque cookie to identify the sender
1046 @param context - sender context, to match reply w/ request
1048 define nat44_lb_static_mapping_dump {
1053 /** \brief NAT44 load-balancing static mapping rule details response
1054 @param context - sender context, to match reply w/ request
1055 @param external_addr - external IPv4 address of the service
1056 @param external_port - external L4 port number of the service
1057 @param protocol - IP protocol number of the service
1058 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1059 flag NAT_SELF_TWICE_NAT if translate external host address
1060 and port whenever external host address equals local
1061 address of internal host,
1062 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1063 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1065 @param local_num - number of local network nodes
1066 @param locals - local network nodes
1067 @param tag - opaque string tag
1069 manual_endian define nat44_lb_static_mapping_details {
1071 vl_api_ip4_address_t external_addr;
1074 vl_api_nat_config_flags_t flags;
1078 vl_api_nat44_lb_addr_port_t locals[local_num];
1081 /** \brief Delete NAT44 session
1082 @param client_index - opaque cookie to identify the sender
1083 @param context - sender context, to match reply w/ request
1084 @param ip_address - IPv4 address
1085 @param protocol - IP protocol
1086 @param port - port number
1087 @param vfr_id - VRF ID
1088 @param flags - flag NAT_IS_INSIDE if interface is inside or
1089 interface is outside,
1090 flag NAT_IS_EXT_HOST_VALID if external host address and
1092 @param ext_host_address - external host IPv4 address
1093 @param ext_host_port - external host port
1095 autoreply define nat44_del_session {
1098 vl_api_ip4_address_t address;
1102 vl_api_nat_config_flags_t flags;
1103 vl_api_ip4_address_t ext_host_address;
1107 /** \brief Enable/disable forwarding for NAT44
1108 Forward packets which don't match existing translation
1109 or static mapping instead of dropping them.
1110 @param client_index - opaque cookie to identify the sender
1111 @param context - sender context, to match reply w/ request
1112 @param enable - true for enable, false for disable
1114 autoreply define nat44_forwarding_enable_disable {
1120 /** \brief Check if forwarding is enabled or disabled
1121 @param client_index - opaque cookie to identify the sender
1122 @param context - sender context, to match reply w/ request
1124 define nat44_forwarding_is_enabled {
1129 /** \brief Response to check if forwarding is enabled or disabled
1130 @param context - sender context, to match reply w/ request
1131 @param enabled - true if enabled, false if disabled
1133 define nat44_forwarding_is_enabled_reply {