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/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 NAT handoff frame queue options
394 @param client_index - opaque cookie to identify the sender
395 @param context - sender context, to match reply w/ request
396 @param frame_queue_nelts - number of worker handoff frame queue elements
398 autoreply define nat_set_fq_options {
402 u32 frame_queue_nelts;
405 /** \brief Show NAT handoff frame queue options
406 @param client_index - opaque cookie to identify the sender
407 @param context - sender context, to match reply w/ request
409 define nat_show_fq_options
416 /** \brief Show NAT handoff frame queue options reply
417 @param context - sender context, to match reply w/ request
418 @param retval - return code for the request
419 @param frame_queue_nelts - number of worker handoff frame queue elements
421 define nat_show_fq_options_reply
426 u32 frame_queue_nelts;
429 /** \brief Set address and port assignment algorithm
430 @param client_index - opaque cookie to identify the sender
431 @param context - sender context, to match reply w/ request
432 @param alg - address and port assignment algorithm:
433 0 - default, 1 - MAP-E, 2 - port range
434 (see nat_addr_and_port_alloc_alg_t in nat.h)
435 @param psid_offset - number of offset bits (valid only for MAP-E alg)
436 @param psid_length - length of PSID (valid only for MAP-E alg)
437 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
438 @param start_port - beginning of the port range
439 @param end_port - end of the port range
441 autoreply define nat_set_addr_and_port_alloc_alg {
452 /** \brief Get address and port assignment algorithm
453 @param client_index - opaque cookie to identify the sender
454 @param context - sender context, to match reply w/ request
456 define nat_get_addr_and_port_alloc_alg {
461 /** \brief Get address and port assignment algorithm reply
462 @param context - sender context, to match reply w/ request
463 @param retval - return code
464 @param alg - address and port assignment algorithm:
465 0 - default, 1 - MAP-E, 2 - port range
466 (see nat_addr_and_port_alloc_alg_t in nat.h)
467 @param psid_offset - number of offset bits (valid only for MAP-E alg)
468 @param psid_length - length of PSID (valid only for MAP-E alg)
469 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
470 @param start_port - beginning of the port range
471 @param end_port - end of the port range
473 define nat_get_addr_and_port_alloc_alg_reply {
484 /** \brief Set TCP MSS rewriting configuration
485 @param client_index - opaque cookie to identify the sender
486 @param context - sender context, to match reply w/ request
487 @param mss_value - MSS value to be used for MSS rewriting
488 @param enable - if true enable MSS rewriting feature else disable
490 autoreply define nat_set_mss_clamping {
497 /** \brief Get TCP MSS rewriting configuration
498 @param client_index - opaque cookie to identify the sender
499 @param context - sender context, to match reply w/ request
501 define nat_get_mss_clamping {
506 /** \brief Get TCP MSS rewriting configuration reply
507 @param context - sender context, to match reply w/ request
508 @param retval - return code
509 @param mss_value - MSS value to be used for MSS rewriting
510 @param enable - if true enable MSS rewriting feature else disable
512 define nat_get_mss_clamping_reply {
519 /** \brief Set HA listener (local settings)
520 @param client_index - opaque cookie to identify the sender
521 @param context - sender context, to match reply w/ request
522 @param ip_address - local IP4 address
523 @param port - local UDP port number
524 @param path_mtu - path MTU between local and failover
526 autoreply define nat_ha_set_listener {
529 vl_api_ip4_address_t ip_address;
534 /** \brief Set HA failover (remote settings)
535 @param client_index - opaque cookie to identify the sender
536 @param context - sender context, to match reply w/ request
537 @param ip_address - failover IP4 address
538 @param port - failvoer UDP port number
539 @param session_refresh_interval - number of seconds after which to send
540 session counters refresh
542 autoreply define nat_ha_set_failover {
545 vl_api_ip4_address_t ip_address;
547 u32 session_refresh_interval;
550 /** \brief Get HA listener/local configuration
551 @param client_index - opaque cookie to identify the sender
552 @param context - sender context, to match reply w/ request
554 define nat_ha_get_listener {
559 /** \brief Get HA listener/local configuration reply
560 @param context - sender context, to match reply w/ request
561 @param retval - return code
562 @param ip_address - local IP4 address
563 @param port - local UDP port number
564 @param path_mtu - Path MTU between local and failover
566 define nat_ha_get_listener_reply {
569 vl_api_ip4_address_t ip_address;
574 /** \brief Get HA failover/remote settings
575 @param client_index - opaque cookie to identify the sender
576 @param context - sender context, to match reply w/ request
578 define nat_ha_get_failover {
583 /** \brief Get HA failover/remote settings reply
584 @param context - sender context, to match reply w/ request
585 @param retval - return code
586 @param ip_address - failover IP4 address
587 @param port - failvoer UDP port number
588 @param session_refresh_interval - number of seconds after which to send
589 session counters refresh
591 define nat_ha_get_failover_reply {
594 vl_api_ip4_address_t ip_address;
596 u32 session_refresh_interval;
599 /** \brief Flush the current HA data (for testing)
600 @param client_index - opaque cookie to identify the sender
601 @param context - sender context, to match reply w/ request
603 autoreply define nat_ha_flush {
608 /** \brief Resync HA (resend existing sessions to new failover)
609 @param client_index - opaque cookie to identify the sender
610 @param context - sender context, to match reply w/ request
611 @param want_resync_event - resync completed event sent to the sender via
612 nat_ha_resync_completed_event API message if
614 @param pid - sender's pid
616 autoreply define nat_ha_resync
620 u8 want_resync_event;
624 /** \brief Tell client about a HA resync completion event
625 @param client_index - opaque cookie to identify the sender
626 @param pid - client pid registered to receive notification
627 @param missed_count - number of missed (not ACKed) messages
629 define nat_ha_resync_completed_event
637 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
640 /** \brief Del NAT44 user
641 @param client_index - opaque cookie to identify the sender
642 @param context - sender context, to match reply w/ request
643 @param ip_address - IPv4 address
644 @param fib_index - FIB index
646 autoreply define nat44_del_user {
649 vl_api_ip4_address_t ip_address;
653 /** \brief Add/del NAT44 address range
654 @param client_index - opaque cookie to identify the sender
655 @param context - sender context, to match reply w/ request
656 @param first_ip_address - first IPv4 address
657 @param last_ip_address - last IPv4 address
658 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
659 @param is_add - true if add, false if delete
660 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
663 autoreply define nat44_add_del_address_range {
666 vl_api_ip4_address_t first_ip_address;
667 vl_api_ip4_address_t last_ip_address;
670 vl_api_nat_config_flags_t flags;
673 /** \brief Dump NAT44 addresses
674 @param client_index - opaque cookie to identify the sender
675 @param context - sender context, to match reply w/ request
677 define nat44_address_dump {
682 /** \brief NAT44 address details response
683 @param context - sender context, to match reply w/ request
684 @param ip_address - IPv4 address
685 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
686 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
688 define nat44_address_details {
690 vl_api_ip4_address_t ip_address;
691 vl_api_nat_config_flags_t flags;
695 /** \brief Enable/disable NAT44 feature on the interface
696 @param client_index - opaque cookie to identify the sender
697 @param context - sender context, to match reply w/ request
698 @param is_add - true if add, false if delete
699 @param flags - flag NAT_IS_INSIDE if interface is inside else
701 @param sw_if_index - software index of the interface
703 autoreply define nat44_interface_add_del_feature {
707 vl_api_nat_config_flags_t flags;
708 vl_api_interface_index_t sw_if_index;
711 /** \brief Dump interfaces with NAT44 feature
712 @param client_index - opaque cookie to identify the sender
713 @param context - sender context, to match reply w/ request
715 define nat44_interface_dump {
720 /** \brief NAT44 interface details response
721 @param context - sender context, to match reply w/ request
722 @param sw_if_index - software index of the interface
723 @param flags - flag NAT_IS_INSIDE if interface is inside,
724 flag NAT_IS_OUTSIDE if interface is outside
725 and if both flags are set the interface is
726 both inside and outside
728 define nat44_interface_details {
730 vl_api_nat_config_flags_t flags;
731 vl_api_interface_index_t sw_if_index;
734 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
736 @param client_index - opaque cookie to identify the sender
737 @param context - sender context, to match reply w/ request
738 @param is_add - true if add, false if delete
739 @param flags - flag NAT_IS_INSIDE if interface is inside else
741 @param sw_if_index - software index of the interface
743 autoreply define nat44_interface_add_del_output_feature {
747 vl_api_nat_config_flags_t flags;
748 vl_api_interface_index_t sw_if_index;
751 /** \brief Dump interfaces with NAT44 output feature
752 @param client_index - opaque cookie to identify the sender
753 @param context - sender context, to match reply w/ request
755 define nat44_interface_output_feature_dump {
760 /** \brief NAT44 interface with output feature details response
761 @param context - sender context, to match reply w/ request
762 @param flags - flag NAT_IS_INSIDE if interface is inside else
764 @param sw_if_index - software index of the interface
766 define nat44_interface_output_feature_details {
768 vl_api_nat_config_flags_t flags;
769 vl_api_interface_index_t 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 flags - flag NAT_IS_ADDR_ONLY if address only mapping,
777 flag nat_is_twice_nat if nat address range for external hosts,
778 flag NAT_IS_SELF_TWICE_NAT if translate external host address
779 and port whenever external host address equals local
780 address of internal host,
781 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
782 @param local_ip_address - local IPv4 address
783 @param external_ip_address - external IPv4 address
784 @param protocol - IP protocol, used only if addr_only=0
785 @param local_port - local port number, used only if addr_only=0
786 @param external_port - external port number, used only if addr_only=0
787 @param external_sw_if_index - external interface (if set
788 external_ip_address is ignored, ~0 means not
790 @param vfr_id - VRF ID
791 @param tag - opaque string tag
793 autoreply define nat44_add_del_static_mapping {
797 vl_api_nat_config_flags_t flags;
798 vl_api_ip4_address_t local_ip_address;
799 vl_api_ip4_address_t external_ip_address;
803 vl_api_interface_index_t external_sw_if_index;
808 /** \brief Add/delete NAT44 static mapping
809 @param client_index - opaque cookie to identify the sender
810 @param context - sender context, to match reply w/ request
811 @param is_add - true if add, false if delete
812 @param match_pool - true if use specific pool_ip_address
813 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
814 flag nat_is_twice_nat if nat address range for external hosts,
815 flag NAT_IS_SELF_TWICE_NAT if translate external host address
816 and port whenever external host address equals local
817 address of internal host,
818 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
819 @param pool_ip_address - pool IPv4 address to match with pool
820 @param local_ip_address - local IPv4 address
821 @param external_ip_address - external IPv4 address
822 @param protocol - IP protocol, used only if addr_only=0
823 @param local_port - local port number, used only if addr_only=0
824 @param external_port - external port number, used only if addr_only=0
825 @param external_sw_if_index - external interface (if set
826 external_ip_address is ignored, ~0 means not
828 @param vfr_id - VRF ID
829 @param tag - opaque string tag
831 autoreply define nat44_add_del_static_mapping_v2 {
837 vl_api_nat_config_flags_t flags;
838 vl_api_ip4_address_t pool_ip_address;
839 vl_api_ip4_address_t local_ip_address;
840 vl_api_ip4_address_t external_ip_address;
844 vl_api_interface_index_t external_sw_if_index;
849 /** \brief Dump NAT44 static mappings
850 @param client_index - opaque cookie to identify the sender
851 @param context - sender context, to match reply w/ request
853 define nat44_static_mapping_dump {
858 /** \brief NAT44 static mapping details response
859 @param context - sender context, to match reply w/ request
860 @param flags - flag NAT_ADDR_ONLY if address only mapping,
861 flag NAT_TWICE_NAT if NAT address range for external hosts,
862 flag NAT_SELF_TWICE_NAT if translate external host address
863 and port whenever external host address equals local
864 address of internal host,
865 flag NAT_OUT2IN_ONLY if rule match only out2in direction
866 @param local_ip_address - local IPv4 address
867 @param external_ip_address - external IPv4 address
868 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
869 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
870 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
871 @param external_sw_if_index - external interface
872 @param vfr_id - VRF ID
873 @param tag - opaque string tag
875 define nat44_static_mapping_details {
877 vl_api_nat_config_flags_t flags;
878 vl_api_ip4_address_t local_ip_address;
879 vl_api_ip4_address_t external_ip_address;
883 vl_api_interface_index_t external_sw_if_index;
888 /** \brief Add/delete NAT44 identity mapping
889 @param client_index - opaque cookie to identify the sender
890 @param context - sender context, to match reply w/ request
891 @param is_add - true if add, false if delete
892 @param flags - flag NAT_ADDR_ONLY if address only mapping
893 @param ip_address - IPv4 address
894 @param protocol - IP protocol
895 @param port - port number
896 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
898 @param vfr_id - VRF ID (if ~0 use default VRF)
899 @param tag - opaque string tag
901 autoreply define nat44_add_del_identity_mapping {
905 vl_api_nat_config_flags_t flags;
906 vl_api_ip4_address_t ip_address;
909 vl_api_interface_index_t sw_if_index;
914 /** \brief Dump NAT44 identity mappings
915 @param client_index - opaque cookie to identify the sender
916 @param context - sender context, to match reply w/ request
918 define nat44_identity_mapping_dump {
923 /** \brief NAT44 identity mapping details response
924 @param context - sender context, to match reply w/ request
925 @param flags - flag NAT_ADDR_ONLY if address only mapping
926 @param ip_address - IPv4 address
927 @param protocol - IP protocol
928 @param port - port number
929 @param sw_if_index - interface
930 @param vfr_id - VRF ID
931 @param tag - opaque string tag
933 define nat44_identity_mapping_details {
935 vl_api_nat_config_flags_t flags;
936 vl_api_ip4_address_t ip_address;
939 vl_api_interface_index_t sw_if_index;
944 /** \brief Add/delete NAT44 pool address from specific interfce
945 @param client_index - opaque cookie to identify the sender
946 @param context - sender context, to match reply w/ request
947 @param is_add - true if add, false if delete
948 @param sw_if_index - software index of the interface
949 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
951 autoreply define nat44_add_del_interface_addr {
955 vl_api_interface_index_t sw_if_index;
956 vl_api_nat_config_flags_t flags;
959 /** \brief Dump NAT44 pool addresses interfaces
960 @param client_index - opaque cookie to identify the sender
961 @param context - sender context, to match reply w/ request
963 define nat44_interface_addr_dump {
968 /** \brief NAT44 pool addresses interfaces details response
969 @param context - sender context, to match reply w/ request
970 @param sw_if_index - software index of the interface
971 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
974 define nat44_interface_addr_details {
976 vl_api_interface_index_t sw_if_index;
977 vl_api_nat_config_flags_t flags;
980 /** \brief Dump NAT44 users
981 @param client_index - opaque cookie to identify the sender
982 @param context - sender context, to match reply w/ request
984 define nat44_user_dump {
989 /** \brief NAT44 users response
990 @param context - sender context, to match reply w/ request
992 @param ip_address - IPv4 address
993 @param nsessions - number of dynamic sessions
994 @param nstaticsessions - number of static sessions
996 define nat44_user_details {
999 vl_api_ip4_address_t ip_address;
1001 u32 nstaticsessions;
1004 /** \brief NAT44 user's sessions
1005 @param client_index - opaque cookie to identify the sender
1006 @param context - sender context, to match reply w/ request
1007 @param ip_address - IPv4 address of the user to dump
1008 @param vrf_id - VRF_ID
1010 define nat44_user_session_dump {
1013 vl_api_ip4_address_t ip_address;
1017 /** \brief NAT44 user's sessions response
1018 @param context - sender context, to match reply w/ request
1019 @param outside_ip_address - outside IPv4 address
1020 @param outside_port - outside port
1021 @param inside_ip_address - inside IPv4 address
1022 @param inside_port - inside port
1023 @param protocol - protocol
1024 @param flags - flag NAT_IS_STATIC if session is static,
1025 flag NAT_IS_TWICE_NAT if session is twice-nat,
1026 flag NAT_IS_EXT_HOST_VALID if external host address
1028 @param last_heard - last heard timer
1029 @param total_bytes - count of bytes sent through session
1030 @param total_pkts - count of pakets sent through session
1031 @param ext_host_address - external host IPv4 address
1032 @param ext_host_port - external host port
1033 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
1034 only if twice-nat session)
1035 @param ext_host_nat_port - post-NAT external host port (valid only if
1038 define nat44_user_session_details {
1040 vl_api_ip4_address_t outside_ip_address;
1042 vl_api_ip4_address_t inside_ip_address;
1045 vl_api_nat_config_flags_t flags;
1049 vl_api_ip4_address_t ext_host_address;
1051 vl_api_ip4_address_t ext_host_nat_address;
1052 u16 ext_host_nat_port;
1055 /** \brief NAT44 load-balancing address and port pair
1056 @param addr - IPv4 address of the internal node
1057 @param port - L4 port number of the internal node
1058 @param probability - probability of the internal node to be randomly matched
1059 @param vrf_id - VRF id
1061 typedef nat44_lb_addr_port {
1062 vl_api_ip4_address_t addr;
1068 /** \brief Add/delete NAT44 load-balancing static mapping rule
1069 @param client_index - opaque cookie to identify the sender
1070 @param context - sender context, to match reply w/ request
1071 @param is_add - true if add, false if delete
1072 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1073 flag NAT_SELF_TWICE_NAT if translate external host address
1074 and port whenever external host address equals local
1075 address of internal host,
1076 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1077 @param external_addr - external IPv4 address of the service
1078 @param external_port - external L4 port number of the service
1079 @param protocol - IP protocol number of the service
1080 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1082 @param local_num - number of local network nodes
1083 @param locals - local network nodes
1084 @param tag - opaque string tag
1086 autoreply define nat44_add_del_lb_static_mapping {
1090 vl_api_nat_config_flags_t flags;
1091 vl_api_ip4_address_t external_addr;
1097 vl_api_nat44_lb_addr_port_t locals[local_num];
1100 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
1101 @param client_index - opaque cookie to identify the sender
1102 @param context - sender context, to match reply w/ request
1103 @param is_add - true if add, false if delete
1104 @param external_addr - external IPv4 address of the service
1105 @param external_port - external L4 port number of the service
1106 @param protocol - IP protocol number of the service
1107 @param local - local network node
1109 autoreply define nat44_lb_static_mapping_add_del_local {
1113 vl_api_ip4_address_t external_addr;
1116 vl_api_nat44_lb_addr_port_t local;
1119 /** \brief Dump NAT44 load-balancing static mapping rules
1120 @param client_index - opaque cookie to identify the sender
1121 @param context - sender context, to match reply w/ request
1123 define nat44_lb_static_mapping_dump {
1128 /** \brief NAT44 load-balancing static mapping rule details response
1129 @param context - sender context, to match reply w/ request
1130 @param external_addr - external IPv4 address of the service
1131 @param external_port - external L4 port number of the service
1132 @param protocol - IP protocol number of the service
1133 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1134 flag NAT_SELF_TWICE_NAT if translate external host address
1135 and port whenever external host address equals local
1136 address of internal host,
1137 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1138 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1140 @param local_num - number of local network nodes
1141 @param locals - local network nodes
1142 @param tag - opaque string tag
1144 define nat44_lb_static_mapping_details {
1146 vl_api_ip4_address_t external_addr;
1149 vl_api_nat_config_flags_t flags;
1153 vl_api_nat44_lb_addr_port_t locals[local_num];
1156 /** \brief Delete NAT44 session
1157 @param client_index - opaque cookie to identify the sender
1158 @param context - sender context, to match reply w/ request
1159 @param ip_address - IPv4 address
1160 @param protocol - IP protocol
1161 @param port - port number
1162 @param vfr_id - VRF ID
1163 @param flags - flag NAT_IS_INSIDE if interface is inside or
1164 interface is outside,
1165 flag NAT_IS_EXT_HOST_VALID if external host address and
1167 @param ext_host_address - external host IPv4 address
1168 @param ext_host_port - external host port
1170 autoreply define nat44_del_session {
1173 vl_api_ip4_address_t address;
1177 vl_api_nat_config_flags_t flags;
1178 vl_api_ip4_address_t ext_host_address;
1182 /** \brief Enable/disable forwarding for NAT44
1183 Forward packets which don't match existing translation
1184 or static mapping instead of dropping them.
1185 @param client_index - opaque cookie to identify the sender
1186 @param context - sender context, to match reply w/ request
1187 @param enable - true for enable, false for disable
1189 autoreply define nat44_forwarding_enable_disable {
1196 /** \brief Check if forwarding is enabled or disabled
1197 @param client_index - opaque cookie to identify the sender
1198 @param context - sender context, to match reply w/ request
1200 define nat44_forwarding_is_enabled {
1206 /** \brief Response to check if forwarding is enabled or disabled
1207 @param context - sender context, to match reply w/ request
1208 @param enabled - true if enabled, false if disabled
1210 define nat44_forwarding_is_enabled_reply {