2 * Copyright (c) 2016 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 option version = "5.2.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/nat_types.api";
23 * @brief VPP control-plane API messages.
25 * This file defines VPP control-plane API messages which are generally
26 * called through a shared memory interface.
30 * Common NAT plugin APIs
33 /** \brief Control ping from client to api server request
34 @param client_index - opaque cookie to identify the sender
35 @param context - sender context, to match reply w/ request
37 define nat_control_ping
43 /** \brief Control ping from the client to the server response
44 @param client_index - opaque cookie to identify the sender
45 @param context - sender context, to match reply w/ request
46 @param retval - return code for the request
47 @param vpe_pid - the pid of the vpe, returned by the server
49 define nat_control_ping_reply
57 /** \brief Show NAT plugin startup config
58 @param client_index - opaque cookie to identify the sender
59 @param context - sender context, to match reply w/ request
61 define nat_show_config
68 /** \brief DEPRECATED: Show NAT plugin startup config reply
69 @param context - sender context, to match reply w/ request
70 @param retval - return code for the request
71 @param static_mapping_only - if true dynamic translations disabled
72 @param static_mapping_connection_tracking - if true create session data
73 @param deterministic - if true deterministic mapping
74 @param endpoint_dependent - if true endpoint-dependent mode
75 @param out2in_dpo - if true out2in dpo mode
76 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
77 @param translation_buckets - number of translation hash buckets
78 @param translation_memory_size - translation hash memory size
79 @param user_buckets - number of user hash buckets
80 @param user_memory_size - user hash memory size
81 @param max_translations_per_user - maximum number of translations per user
82 @param outside_vrf_id - outside VRF id
83 @param inside_vrf_id - default inside VRF id
84 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
85 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
86 @param nat64_st_buckets - number of NAT64 session table hash buckets
87 @param nat64_st_memory_size - memory size of NAT64 session table hash
89 define nat_show_config_reply
94 bool static_mapping_only;
95 bool static_mapping_connection_tracking;
97 bool endpoint_dependent;
100 u32 translation_buckets;
101 u32 translation_memory_size;
103 u64 user_memory_size;
104 u32 max_translations_per_user;
107 u32 nat64_bib_buckets;
108 u64 nat64_bib_memory_size;
109 u32 nat64_st_buckets;
110 u64 nat64_st_memory_size;
113 /** \brief Show NAT plugin startup config
114 @param client_index - opaque cookie to identify the sender
115 @param context - sender context, to match reply w/ request
117 define nat_show_config_2
124 /** \brief Show NAT plugin startup config reply
125 @param context - sender context, to match reply w/ request
126 @param retval - return code for the request
127 @param static_mapping_only - if true dynamic translations disabled
128 @param static_mapping_connection_tracking - if true create session data
129 @param deterministic - if true deterministic mapping
130 @param endpoint_dependent - if true endpoint-dependent mode
131 @param out2in_dpo - if true out2in dpo mode
132 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
133 @param translation_buckets - number of translation hash buckets
134 @param translation_memory_size - translation hash memory size
135 @param user_buckets - number of user hash buckets
136 @param user_memory_size - user hash memory size
137 @param max_translations_per_user - maximum number of translations per user
138 @param outside_vrf_id - outside VRF id
139 @param inside_vrf_id - default inside VRF id
140 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
141 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
142 @param nat64_st_buckets - number of NAT64 session table hash buckets
143 @param nat64_st_memory_size - memory size of NAT64 session table hash
144 @param max_translations_per_thread - max translations per worker thread
145 @param max_users_per_thread - max users per worker thread
147 define nat_show_config_2_reply
152 bool static_mapping_only;
153 bool static_mapping_connection_tracking;
155 bool endpoint_dependent;
158 u32 translation_buckets;
159 u64 translation_memory_size;
161 u64 user_memory_size;
162 u32 max_translations_per_user;
165 u32 nat64_bib_buckets;
166 u64 nat64_bib_memory_size;
167 u32 nat64_st_buckets;
168 u64 nat64_st_memory_size;
169 u32 max_translations_per_thread;
170 u32 max_users_per_thread;
173 enum nat_log_level : u8
176 NAT_LOG_ERROR = 0x01,
177 NAT_LOG_WARNING = 0x02,
178 NAT_LOG_NOTICE = 0x03,
180 NAT_LOG_DEBUG = 0x05,
183 /** \brief Run nat44 garbage collection
184 @param client_index - opaque cookie to identify the sender
185 @param context - sender context, to match reply w/ request
187 autoreply define nat44_session_cleanup {
192 /** \brief NAT44 set session limit
193 @param client_index - opaque cookie to identify the sender
194 @param context - sender context, to match reply w/ request
195 @param session_limit - session limit
196 @param vrf_id - vrf id
198 autoreply define nat44_set_session_limit {
205 /** \brief Set NAT logging level
206 @param client_index - opaque cookie to identify the sender
207 @param context - sender context, to match reply w/ request
208 @param log_level - logging level
210 autoreply define nat_set_log_level {
213 vl_api_nat_log_level_t log_level;
216 /** \brief Set NAT workers
217 @param client_index - opaque cookie to identify the sender
218 @param context - sender context, to match reply w/ request
219 @param worker_mask - NAT workers mask
221 autoreply define nat_set_workers {
227 /** \brief Dump NAT workers
228 @param client_index - opaque cookie to identify the sender
229 @param context - sender context, to match reply w/ request
231 define nat_worker_dump {
236 /** \brief NAT workers details response
237 @param context - sender context, to match reply w/ request
238 @param worker_index - worker index
239 @param lcore_id - lcore ID
240 @param name - worker name
242 define nat_worker_details {
249 /** \brief Enable/disable NAT IPFIX logging
250 @param client_index - opaque cookie to identify the sender
251 @param context - sender context, to match reply w/ request
252 @param domain_id - observation domain ID
253 @param src_port - source port number
254 @param enable - true if enable, false if disable
256 autoreply define nat_ipfix_enable_disable {
264 /** \brief Set values of timeouts for NAT sessions (seconds)
265 @param client_index - opaque cookie to identify the sender
266 @param context - sender context, to match reply w/ request
267 @param udp - UDP timeout (default 300sec)
268 @param tcp_established - TCP established timeout (default 7440sec)
269 @param tcp_transitory - TCP transitory timeout (default 240sec)
270 @param icmp - ICMP timeout (default 60sec)
272 autoreply define nat_set_timeouts {
281 /** \brief Get values of timeouts for NAT sessions (seconds)
282 @param client_index - opaque cookie to identify the sender
283 @param context - sender context, to match reply w/ request
285 define nat_get_timeouts {
290 /** \brief Get values of timeouts for NAT sessions reply
291 @param context - sender context, to match reply w/ request
292 @param retval - return code
293 @param udp - UDP timeout
294 @param tcp_established - TCP established timeout
295 @param tcp_transitory - TCP transitory timeout
296 @param icmp - ICMP timeout
298 define nat_get_timeouts_reply {
307 /** \brief Set address and port assignment algorithm
308 @param client_index - opaque cookie to identify the sender
309 @param context - sender context, to match reply w/ request
310 @param alg - address and port assignment algorithm:
311 0 - default, 1 - MAP-E, 2 - port range
312 (see nat_addr_and_port_alloc_alg_t in nat.h)
313 @param psid_offset - number of offset bits (valid only for MAP-E alg)
314 @param psid_length - length of PSID (valid only for MAP-E alg)
315 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
316 @param start_port - beginning of the port range
317 @param end_port - end of the port range
319 autoreply define nat_set_addr_and_port_alloc_alg {
330 /** \brief Get address and port assignment algorithm
331 @param client_index - opaque cookie to identify the sender
332 @param context - sender context, to match reply w/ request
334 define nat_get_addr_and_port_alloc_alg {
339 /** \brief Get address and port assignment algorithm reply
340 @param context - sender context, to match reply w/ request
341 @param retval - return code
342 @param alg - address and port assignment algorithm:
343 0 - default, 1 - MAP-E, 2 - port range
344 (see nat_addr_and_port_alloc_alg_t in nat.h)
345 @param psid_offset - number of offset bits (valid only for MAP-E alg)
346 @param psid_length - length of PSID (valid only for MAP-E alg)
347 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
348 @param start_port - beginning of the port range
349 @param end_port - end of the port range
351 define nat_get_addr_and_port_alloc_alg_reply {
362 /** \brief Set TCP MSS rewriting configuration
363 @param client_index - opaque cookie to identify the sender
364 @param context - sender context, to match reply w/ request
365 @param mss_value - MSS value to be used for MSS rewriting
366 @param enable - if true enable MSS rewriting feature else disable
368 autoreply define nat_set_mss_clamping {
375 /** \brief Get TCP MSS rewriting configuration
376 @param client_index - opaque cookie to identify the sender
377 @param context - sender context, to match reply w/ request
379 define nat_get_mss_clamping {
384 /** \brief Get TCP MSS rewriting configuration reply
385 @param context - sender context, to match reply w/ request
386 @param retval - return code
387 @param mss_value - MSS value to be used for MSS rewriting
388 @param enable - if true enable MSS rewriting feature else disable
390 define nat_get_mss_clamping_reply {
397 /** \brief Set HA listener (local settings)
398 @param client_index - opaque cookie to identify the sender
399 @param context - sender context, to match reply w/ request
400 @param ip_address - local IP4 address
401 @param port - local UDP port number
402 @param path_mtu - path MTU between local and failover
404 autoreply define nat_ha_set_listener {
407 vl_api_ip4_address_t ip_address;
412 /** \brief Set HA failover (remote settings)
413 @param client_index - opaque cookie to identify the sender
414 @param context - sender context, to match reply w/ request
415 @param ip_address - failover IP4 address
416 @param port - failvoer UDP port number
417 @param session_refresh_interval - number of seconds after which to send
418 session counters refresh
420 autoreply define nat_ha_set_failover {
423 vl_api_ip4_address_t ip_address;
425 u32 session_refresh_interval;
428 /** \brief Get HA listener/local configuration
429 @param client_index - opaque cookie to identify the sender
430 @param context - sender context, to match reply w/ request
432 define nat_ha_get_listener {
437 /** \brief Get HA listener/local configuration reply
438 @param context - sender context, to match reply w/ request
439 @param retval - return code
440 @param ip_address - local IP4 address
441 @param port - local UDP port number
442 @param path_mtu - Path MTU between local and failover
444 define nat_ha_get_listener_reply {
447 vl_api_ip4_address_t ip_address;
452 /** \brief Get HA failover/remote settings
453 @param client_index - opaque cookie to identify the sender
454 @param context - sender context, to match reply w/ request
456 define nat_ha_get_failover {
461 /** \brief Get HA failover/remote settings reply
462 @param context - sender context, to match reply w/ request
463 @param retval - return code
464 @param ip_address - failover IP4 address
465 @param port - failvoer UDP port number
466 @param session_refresh_interval - number of seconds after which to send
467 session counters refresh
469 define nat_ha_get_failover_reply {
472 vl_api_ip4_address_t ip_address;
474 u32 session_refresh_interval;
477 /** \brief Flush the current HA data (for testing)
478 @param client_index - opaque cookie to identify the sender
479 @param context - sender context, to match reply w/ request
481 autoreply define nat_ha_flush {
486 /** \brief Resync HA (resend existing sessions to new failover)
487 @param client_index - opaque cookie to identify the sender
488 @param context - sender context, to match reply w/ request
489 @param want_resync_event - resync completed event sent to the sender via
490 nat_ha_resync_completed_event API message if
492 @param pid - sender's pid
494 autoreply define nat_ha_resync
498 u8 want_resync_event;
502 /** \brief Tell client about a HA resync completion event
503 @param client_index - opaque cookie to identify the sender
504 @param pid - client pid registered to receive notification
505 @param missed_count - number of missed (not ACKed) messages
507 define nat_ha_resync_completed_event
515 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
522 /** \brief Del NAT44 user
523 @param client_index - opaque cookie to identify the sender
524 @param context - sender context, to match reply w/ request
525 @param ip_address - IPv4 address
526 @param fib_index - FIB index
528 autoreply define nat44_del_user {
531 vl_api_ip4_address_t ip_address;
535 /** \brief Add/del NAT44 address range
536 @param client_index - opaque cookie to identify the sender
537 @param context - sender context, to match reply w/ request
538 @param first_ip_address - first IPv4 address
539 @param last_ip_address - last IPv4 address
540 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
541 @param is_add - true if add, false if delete
542 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
545 autoreply define nat44_add_del_address_range {
548 vl_api_ip4_address_t first_ip_address;
549 vl_api_ip4_address_t last_ip_address;
552 vl_api_nat_config_flags_t flags;
555 /** \brief Dump NAT44 addresses
556 @param client_index - opaque cookie to identify the sender
557 @param context - sender context, to match reply w/ request
559 define nat44_address_dump {
564 /** \brief NAT44 address details response
565 @param context - sender context, to match reply w/ request
566 @param ip_address - IPv4 address
567 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
568 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
570 define nat44_address_details {
572 vl_api_ip4_address_t ip_address;
573 vl_api_nat_config_flags_t flags;
577 /** \brief Enable/disable NAT44 feature on the interface
578 @param client_index - opaque cookie to identify the sender
579 @param context - sender context, to match reply w/ request
580 @param is_add - true if add, false if delete
581 @param flags - flag NAT_IS_INSIDE if interface is inside else
583 @param sw_if_index - software index of the interface
585 autoreply define nat44_interface_add_del_feature {
589 vl_api_nat_config_flags_t flags;
590 vl_api_interface_index_t sw_if_index;
593 /** \brief Dump interfaces with NAT44 feature
594 @param client_index - opaque cookie to identify the sender
595 @param context - sender context, to match reply w/ request
597 define nat44_interface_dump {
602 /** \brief NAT44 interface details response
603 @param context - sender context, to match reply w/ request
604 @param sw_if_index - software index of the interface
605 @param flags - flag NAT_IS_INSIDE if interface is inside,
606 flag NAT_IS_OUTSIDE if interface is outside
607 and if both flags are set the interface is
608 both inside and outside
610 define nat44_interface_details {
612 vl_api_nat_config_flags_t flags;
613 vl_api_interface_index_t sw_if_index;
616 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
618 @param client_index - opaque cookie to identify the sender
619 @param context - sender context, to match reply w/ request
620 @param is_add - true if add, false if delete
621 @param flags - flag NAT_IS_INSIDE if interface is inside else
623 @param sw_if_index - software index of the interface
625 autoreply define nat44_interface_add_del_output_feature {
629 vl_api_nat_config_flags_t flags;
630 vl_api_interface_index_t sw_if_index;
633 /** \brief Dump interfaces with NAT44 output feature
634 @param client_index - opaque cookie to identify the sender
635 @param context - sender context, to match reply w/ request
637 define nat44_interface_output_feature_dump {
642 /** \brief NAT44 interface with output feature details response
643 @param context - sender context, to match reply w/ request
644 @param flags - flag NAT_IS_INSIDE if interface is inside else
646 @param sw_if_index - software index of the interface
648 define nat44_interface_output_feature_details {
650 vl_api_nat_config_flags_t flags;
651 vl_api_interface_index_t sw_if_index;
654 /** \brief Add/delete NAT44 static mapping
655 @param client_index - opaque cookie to identify the sender
656 @param context - sender context, to match reply w/ request
657 @param is_add - true if add, false if delete
658 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
659 flag nat_is_twice_nat if nat address range for external hosts,
660 flag NAT_IS_SELF_TWICE_NAT if translate external host address
661 and port whenever external host address equals local
662 address of internal host,
663 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
664 @param local_ip_address - local IPv4 address
665 @param external_ip_address - external IPv4 address
666 @param protocol - IP protocol, used only if addr_only=0
667 @param local_port - local port number, used only if addr_only=0
668 @param external_port - external port number, used only if addr_only=0
669 @param external_sw_if_index - external interface (if set
670 external_ip_address is ignored, ~0 means not
672 @param vfr_id - VRF ID
673 @param tag - opaque string tag
675 autoreply define nat44_add_del_static_mapping {
679 vl_api_nat_config_flags_t flags;
680 vl_api_ip4_address_t local_ip_address;
681 vl_api_ip4_address_t external_ip_address;
685 vl_api_interface_index_t external_sw_if_index;
690 /** \brief Add/delete NAT44 static mapping
691 @param client_index - opaque cookie to identify the sender
692 @param context - sender context, to match reply w/ request
693 @param is_add - true if add, false if delete
694 @param match_pool - true if use specific pool_ip_address
695 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
696 flag nat_is_twice_nat if nat address range for external hosts,
697 flag NAT_IS_SELF_TWICE_NAT if translate external host address
698 and port whenever external host address equals local
699 address of internal host,
700 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
701 @param pool_ip_address - pool IPv4 address to match with pool
702 @param local_ip_address - local IPv4 address
703 @param external_ip_address - external IPv4 address
704 @param protocol - IP protocol, used only if addr_only=0
705 @param local_port - local port number, used only if addr_only=0
706 @param external_port - external port number, used only if addr_only=0
707 @param external_sw_if_index - external interface (if set
708 external_ip_address is ignored, ~0 means not
710 @param vfr_id - VRF ID
711 @param tag - opaque string tag
713 autoreply define nat44_add_del_static_mapping_v2 {
714 option status="in_progress";
719 vl_api_nat_config_flags_t flags;
720 vl_api_ip4_address_t pool_ip_address;
721 vl_api_ip4_address_t local_ip_address;
722 vl_api_ip4_address_t external_ip_address;
726 vl_api_interface_index_t external_sw_if_index;
731 /** \brief Dump NAT44 static mappings
732 @param client_index - opaque cookie to identify the sender
733 @param context - sender context, to match reply w/ request
735 define nat44_static_mapping_dump {
740 /** \brief NAT44 static mapping details response
741 @param context - sender context, to match reply w/ request
742 @param flags - flag NAT_ADDR_ONLY if address only mapping,
743 flag NAT_TWICE_NAT if NAT address range for external hosts,
744 flag NAT_SELF_TWICE_NAT if translate external host address
745 and port whenever external host address equals local
746 address of internal host,
747 flag NAT_OUT2IN_ONLY if rule match only out2in direction
748 @param local_ip_address - local IPv4 address
749 @param external_ip_address - external IPv4 address
750 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
751 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
752 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
753 @param external_sw_if_index - external interface
754 @param vfr_id - VRF ID
755 @param tag - opaque string tag
757 define nat44_static_mapping_details {
759 vl_api_nat_config_flags_t flags;
760 vl_api_ip4_address_t local_ip_address;
761 vl_api_ip4_address_t external_ip_address;
765 vl_api_interface_index_t external_sw_if_index;
770 /** \brief Add/delete NAT44 identity mapping
771 @param client_index - opaque cookie to identify the sender
772 @param context - sender context, to match reply w/ request
773 @param is_add - true if add, false if delete
774 @param flags - flag NAT_ADDR_ONLY if address only mapping
775 @param ip_address - IPv4 address
776 @param protocol - IP protocol
777 @param port - port number
778 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
780 @param vfr_id - VRF ID (if ~0 use default VRF)
781 @param tag - opaque string tag
783 autoreply define nat44_add_del_identity_mapping {
787 vl_api_nat_config_flags_t flags;
788 vl_api_ip4_address_t ip_address;
791 vl_api_interface_index_t sw_if_index;
796 /** \brief Dump NAT44 identity mappings
797 @param client_index - opaque cookie to identify the sender
798 @param context - sender context, to match reply w/ request
800 define nat44_identity_mapping_dump {
805 /** \brief NAT44 identity mapping details response
806 @param context - sender context, to match reply w/ request
807 @param flags - flag NAT_ADDR_ONLY if address only mapping
808 @param ip_address - IPv4 address
809 @param protocol - IP protocol
810 @param port - port number
811 @param sw_if_index - interface
812 @param vfr_id - VRF ID
813 @param tag - opaque string tag
815 define nat44_identity_mapping_details {
817 vl_api_nat_config_flags_t flags;
818 vl_api_ip4_address_t ip_address;
821 vl_api_interface_index_t sw_if_index;
826 /** \brief Add/delete NAT44 pool address from specific interfce
827 @param client_index - opaque cookie to identify the sender
828 @param context - sender context, to match reply w/ request
829 @param is_add - true if add, false if delete
830 @param sw_if_index - software index of the interface
831 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
833 autoreply define nat44_add_del_interface_addr {
837 vl_api_interface_index_t sw_if_index;
838 vl_api_nat_config_flags_t flags;
841 /** \brief Dump NAT44 pool addresses interfaces
842 @param client_index - opaque cookie to identify the sender
843 @param context - sender context, to match reply w/ request
845 define nat44_interface_addr_dump {
850 /** \brief NAT44 pool addresses interfaces details response
851 @param context - sender context, to match reply w/ request
852 @param sw_if_index - software index of the interface
853 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
856 define nat44_interface_addr_details {
858 vl_api_interface_index_t sw_if_index;
859 vl_api_nat_config_flags_t flags;
862 /** \brief Dump NAT44 users
863 @param client_index - opaque cookie to identify the sender
864 @param context - sender context, to match reply w/ request
866 define nat44_user_dump {
871 /** \brief NAT44 users response
872 @param context - sender context, to match reply w/ request
874 @param ip_address - IPv4 address
875 @param nsessions - number of dynamic sessions
876 @param nstaticsessions - number of static sessions
878 define nat44_user_details {
881 vl_api_ip4_address_t ip_address;
886 /** \brief NAT44 user's sessions
887 @param client_index - opaque cookie to identify the sender
888 @param context - sender context, to match reply w/ request
889 @param ip_address - IPv4 address of the user to dump
890 @param vrf_id - VRF_ID
892 define nat44_user_session_dump {
895 vl_api_ip4_address_t ip_address;
899 /** \brief NAT44 user's sessions response
900 @param context - sender context, to match reply w/ request
901 @param outside_ip_address - outside IPv4 address
902 @param outside_port - outside port
903 @param inside_ip_address - inside IPv4 address
904 @param inside_port - inside port
905 @param protocol - protocol
906 @param flags - flag NAT_IS_STATIC if session is static,
907 flag NAT_IS_TWICE_NAT if session is twice-nat,
908 flag NAT_IS_EXT_HOST_VALID if external host address
910 @param last_heard - last heard timer
911 @param total_bytes - count of bytes sent through session
912 @param total_pkts - count of pakets sent through session
913 @param ext_host_address - external host IPv4 address
914 @param ext_host_port - external host port
915 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
916 only if twice-nat session)
917 @param ext_host_nat_port - post-NAT external host port (valid only if
920 define nat44_user_session_details {
922 vl_api_ip4_address_t outside_ip_address;
924 vl_api_ip4_address_t inside_ip_address;
927 vl_api_nat_config_flags_t flags;
931 vl_api_ip4_address_t ext_host_address;
933 vl_api_ip4_address_t ext_host_nat_address;
934 u16 ext_host_nat_port;
937 /** \brief NAT44 load-balancing address and port pair
938 @param addr - IPv4 address of the internal node
939 @param port - L4 port number of the internal node
940 @param probability - probability of the internal node to be randomly matched
941 @param vrf_id - VRF id
943 typedef nat44_lb_addr_port {
944 vl_api_ip4_address_t addr;
950 /** \brief Add/delete NAT44 load-balancing static mapping rule
951 @param client_index - opaque cookie to identify the sender
952 @param context - sender context, to match reply w/ request
953 @param is_add - true if add, false if delete
954 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
955 flag NAT_SELF_TWICE_NAT if translate external host address
956 and port whenever external host address equals local
957 address of internal host,
958 flag NAT_OUT2IN_ONLY if rule match only out2in direction
959 @param external_addr - external IPv4 address of the service
960 @param external_port - external L4 port number of the service
961 @param protocol - IP protocol number of the service
962 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
964 @param local_num - number of local network nodes
965 @param locals - local network nodes
966 @param tag - opaque string tag
968 autoreply manual_endian define nat44_add_del_lb_static_mapping {
972 vl_api_nat_config_flags_t flags;
973 vl_api_ip4_address_t external_addr;
979 vl_api_nat44_lb_addr_port_t locals[local_num];
982 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
983 @param client_index - opaque cookie to identify the sender
984 @param context - sender context, to match reply w/ request
985 @param is_add - true if add, false if delete
986 @param external_addr - external IPv4 address of the service
987 @param external_port - external L4 port number of the service
988 @param protocol - IP protocol number of the service
989 @param local - local network node
991 autoreply define nat44_lb_static_mapping_add_del_local {
995 vl_api_ip4_address_t external_addr;
998 vl_api_nat44_lb_addr_port_t local;
1001 /** \brief Dump NAT44 load-balancing static mapping rules
1002 @param client_index - opaque cookie to identify the sender
1003 @param context - sender context, to match reply w/ request
1005 define nat44_lb_static_mapping_dump {
1010 /** \brief NAT44 load-balancing static mapping rule details response
1011 @param context - sender context, to match reply w/ request
1012 @param external_addr - external IPv4 address of the service
1013 @param external_port - external L4 port number of the service
1014 @param protocol - IP protocol number of the service
1015 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1016 flag NAT_SELF_TWICE_NAT if translate external host address
1017 and port whenever external host address equals local
1018 address of internal host,
1019 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1020 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1022 @param local_num - number of local network nodes
1023 @param locals - local network nodes
1024 @param tag - opaque string tag
1026 manual_endian define nat44_lb_static_mapping_details {
1028 vl_api_ip4_address_t external_addr;
1031 vl_api_nat_config_flags_t flags;
1035 vl_api_nat44_lb_addr_port_t locals[local_num];
1038 /** \brief Delete NAT44 session
1039 @param client_index - opaque cookie to identify the sender
1040 @param context - sender context, to match reply w/ request
1041 @param ip_address - IPv4 address
1042 @param protocol - IP protocol
1043 @param port - port number
1044 @param vfr_id - VRF ID
1045 @param flags - flag NAT_IS_INSIDE if interface is inside or
1046 interface is outside,
1047 flag NAT_IS_EXT_HOST_VALID if external host address and
1049 @param ext_host_address - external host IPv4 address
1050 @param ext_host_port - external host port
1052 autoreply define nat44_del_session {
1055 vl_api_ip4_address_t address;
1059 vl_api_nat_config_flags_t flags;
1060 vl_api_ip4_address_t ext_host_address;
1064 /** \brief Enable/disable forwarding for NAT44
1065 Forward packets which don't match existing translation
1066 or static mapping instead of dropping them.
1067 @param client_index - opaque cookie to identify the sender
1068 @param context - sender context, to match reply w/ request
1069 @param enable - true for enable, false for disable
1071 autoreply define nat44_forwarding_enable_disable {
1077 /** \brief Check if forwarding is enabled or disabled
1078 @param client_index - opaque cookie to identify the sender
1079 @param context - sender context, to match reply w/ request
1081 define nat44_forwarding_is_enabled {
1086 /** \brief Response to check if forwarding is enabled or disabled
1087 @param context - sender context, to match reply w/ request
1088 @param enabled - true if enabled, false if disabled
1090 define nat44_forwarding_is_enabled_reply {