2 * Copyright (c) 2020 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 option version = "5.2.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/lib/nat_types.api";
23 * @brief VPP control-plane API messages.
25 * This file defines VPP control-plane API messages which are generally
26 * called through a shared memory interface.
29 enum nat44_config_flags : u8
31 NAT44_IS_ENDPOINT_INDEPENDENT = 0x00,
32 NAT44_IS_ENDPOINT_DEPENDENT = 0x01,
33 NAT44_IS_STATIC_MAPPING_ONLY = 0x02,
34 NAT44_IS_CONNECTION_TRACKING = 0x04,
35 NAT44_IS_OUT2IN_DPO = 0x08,
38 /** \brief Enable/disable NAT44 plugin
39 @param client_index - opaque cookie to identify the sender
40 @param context - sender context, to match reply w/ request
41 @param inside_vrf - inside vrf id
42 @param outside_vrf - outside vrf id
43 @param users - maximum number of users per thread
44 (NAT44_IS_ENDPOINT_INDEPENDENT)
45 @param user_memory - overwrite hash allocation parameter
46 (NAT44_IS_ENDPOINT_INDEPENDENT)
47 @param sessions - maximum number of sessions per thread
48 @param session_memory - overwrite hash allocation parameter
49 @param user_sessions - maximum number of sessions per user
50 (NAT44_IS_ENDPOINT_INDEPENDENT)
51 @param enable - true if enable, false if disable
52 @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
53 NAT44_IS_ENDPOINT_DEPENDENT,
54 NAT44_IS_STATIC_MAPPING_ONLY,
55 NAT44_IS_CONNECTION_TRACKING,
58 autoreply define nat44_plugin_enable_disable {
70 vl_api_nat44_config_flags_t flags;
73 /** \brief Enable/disable NAT44ED plugin
74 @param client_index - opaque cookie to identify the sender
75 @param context - sender context, to match reply w/ request
76 @param inside_vrf - inside vrf id
77 @param outside_vrf - outside vrf id
78 @param sessions - maximum number of sessions per thread
79 @param session_memory - overwrite hash allocation parameter
80 @param enable - true if enable, false if disable
81 @param flags - flag NAT44_IS_STATIC_MAPPING_ONLY,
82 NAT44_IS_CONNECTION_TRACKING
84 autoreply define nat44_ed_plugin_enable_disable {
93 vl_api_nat44_config_flags_t flags;
96 /** \brief Control ping from client to api server request
97 @param client_index - opaque cookie to identify the sender
98 @param context - sender context, to match reply w/ request
100 define nat_control_ping
107 /** \brief Control ping from the client to the server response
108 @param client_index - opaque cookie to identify the sender
109 @param context - sender context, to match reply w/ request
110 @param retval - return code for the request
111 @param vpe_pid - the pid of the vpe, returned by the server
113 define nat_control_ping_reply
122 /** \brief Show NAT plugin startup config
123 @param client_index - opaque cookie to identify the sender
124 @param context - sender context, to match reply w/ request
126 define nat_show_config
133 /** \brief DEPRECATED: Show NAT plugin startup config reply
134 @param context - sender context, to match reply w/ request
135 @param retval - return code for the request
136 @param static_mapping_only - if true dynamic translations disabled
137 @param static_mapping_connection_tracking - if true create session data
138 @param deterministic - if true deterministic mapping
139 @param endpoint_dependent - if true endpoint-dependent mode
140 @param out2in_dpo - if true out2in dpo mode
141 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
142 @param translation_buckets - number of translation hash buckets
143 @param translation_memory_size - translation hash memory size
144 @param user_buckets - number of user hash buckets
145 @param user_memory_size - user hash memory size
146 @param max_translations_per_user - maximum number of translations per user
147 @param outside_vrf_id - outside VRF id
148 @param inside_vrf_id - default inside VRF id
149 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
150 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
151 @param nat64_st_buckets - number of NAT64 session table hash buckets
152 @param nat64_st_memory_size - memory size of NAT64 session table hash
154 define nat_show_config_reply
159 bool static_mapping_only;
160 bool static_mapping_connection_tracking;
162 bool endpoint_dependent;
165 u32 translation_buckets;
166 u32 translation_memory_size;
168 u64 user_memory_size;
169 u32 max_translations_per_user;
172 u32 nat64_bib_buckets;
173 u64 nat64_bib_memory_size;
174 u32 nat64_st_buckets;
175 u64 nat64_st_memory_size;
178 /** \brief Show NAT plugin startup config
179 @param client_index - opaque cookie to identify the sender
180 @param context - sender context, to match reply w/ request
182 define nat_show_config_2
189 /** \brief Show NAT plugin startup config reply
190 @param context - sender context, to match reply w/ request
191 @param retval - return code for the request
192 @param static_mapping_only - if true dynamic translations disabled
193 @param static_mapping_connection_tracking - if true create session data
194 @param deterministic - if true deterministic mapping
195 @param endpoint_dependent - if true endpoint-dependent mode
196 @param out2in_dpo - if true out2in dpo mode
197 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
198 @param translation_buckets - number of translation hash buckets
199 @param translation_memory_size - translation hash memory size
200 @param user_buckets - number of user hash buckets
201 @param user_memory_size - user hash memory size
202 @param max_translations_per_user - maximum number of translations per user
203 @param outside_vrf_id - outside VRF id
204 @param inside_vrf_id - default inside VRF id
205 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
206 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
207 @param nat64_st_buckets - number of NAT64 session table hash buckets
208 @param nat64_st_memory_size - memory size of NAT64 session table hash
209 @param max_translations_per_thread - max translations per worker thread
210 @param max_users_per_thread - max users per worker thread
212 define nat_show_config_2_reply
217 bool static_mapping_only;
218 bool static_mapping_connection_tracking;
220 bool endpoint_dependent;
223 u32 translation_buckets;
224 u64 translation_memory_size;
226 u64 user_memory_size;
227 u32 max_translations_per_user;
230 u32 nat64_bib_buckets;
231 u64 nat64_bib_memory_size;
232 u32 nat64_st_buckets;
233 u64 nat64_st_memory_size;
234 u32 max_translations_per_thread;
235 u32 max_users_per_thread;
238 /** \brief Show NAT44 plugin running config
239 @param client_index - opaque cookie to identify the sender
240 @param context - sender context, to match reply w/ request
242 define nat44_show_running_config
249 /** \brief Show NAT44 plugin running config reply
250 @param context - sender context, to match reply w/ request
251 @param retval - return code for the request
252 @param inside_vrf - default inside VRF id
253 @param outside_vrf - outside VRF id
254 @param users - maximum number of users per worker thread
255 (NAT44_IS_ENDPOINT_INDEPENDENT)
256 @param sessions - maximum number of sessions per worker thread
257 @param user_sessions - maximum number of sessions per user
258 (NAT44_IS_ENDPOINT_INDEPENDENT)
259 @param user_buckets - number of user hash buckets
260 (NAT44_IS_ENDPOINT_INDEPENDENT)
261 @param translation_buckets - number of translation hash buckets
262 @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
263 NAT44_IS_ENDPOINT_DEPENDENT,
264 NAT44_IS_STATIC_MAPPING_ONLY,
265 NAT44_IS_CONNECTION_TRACKING,
268 define nat44_show_running_config_reply
279 u32 translation_buckets;
280 bool forwarding_enabled;
281 bool ipfix_logging_enabled;
282 vl_api_nat_timeouts_t timeouts;
283 vl_api_nat_log_level_t log_level;
284 vl_api_nat44_config_flags_t flags;
287 /** \brief Run nat44 garbage collection
288 @param client_index - opaque cookie to identify the sender
289 @param context - sender context, to match reply w/ request
291 autoreply define nat44_session_cleanup {
297 /** \brief NAT44 set session limit
298 @param client_index - opaque cookie to identify the sender
299 @param context - sender context, to match reply w/ request
300 @param session_limit - session limit
301 @param vrf_id - vrf id
303 autoreply define nat44_set_session_limit {
310 /** \brief Set NAT logging level
311 @param client_index - opaque cookie to identify the sender
312 @param context - sender context, to match reply w/ request
313 @param log_level - logging level
315 autoreply define nat_set_log_level {
319 vl_api_nat_log_level_t log_level;
322 /** \brief Set NAT workers
323 @param client_index - opaque cookie to identify the sender
324 @param context - sender context, to match reply w/ request
325 @param worker_mask - NAT workers mask
327 autoreply define nat_set_workers {
333 /** \brief Dump NAT workers
334 @param client_index - opaque cookie to identify the sender
335 @param context - sender context, to match reply w/ request
337 define nat_worker_dump {
342 /** \brief NAT workers details response
343 @param context - sender context, to match reply w/ request
344 @param worker_index - worker index
345 @param lcore_id - lcore ID
346 @param name - worker name
348 define nat_worker_details {
355 /** \brief Enable/disable NAT IPFIX logging
356 @param client_index - opaque cookie to identify the sender
357 @param context - sender context, to match reply w/ request
358 @param domain_id - observation domain ID
359 @param src_port - source port number
360 @param enable - true if enable, false if disable
362 autoreply define nat_ipfix_enable_disable {
371 /** \brief Set values of timeouts for NAT sessions (seconds)
372 @param client_index - opaque cookie to identify the sender
373 @param context - sender context, to match reply w/ request
374 @param udp - UDP timeout (default 300sec)
375 @param tcp_established - TCP established timeout (default 7440sec)
376 @param tcp_transitory - TCP transitory timeout (default 240sec)
377 @param icmp - ICMP timeout (default 60sec)
379 autoreply define nat_set_timeouts {
389 /** \brief Get values of timeouts for NAT sessions (seconds)
390 @param client_index - opaque cookie to identify the sender
391 @param context - sender context, to match reply w/ request
393 define nat_get_timeouts {
399 /** \brief Get values of timeouts for NAT sessions reply
400 @param context - sender context, to match reply w/ request
401 @param retval - return code
402 @param udp - UDP timeout
403 @param tcp_established - TCP established timeout
404 @param tcp_transitory - TCP transitory timeout
405 @param icmp - ICMP timeout
407 define nat_get_timeouts_reply {
417 /** \brief Set address and port assignment algorithm
418 @param client_index - opaque cookie to identify the sender
419 @param context - sender context, to match reply w/ request
420 @param alg - address and port assignment algorithm:
421 0 - default, 1 - MAP-E, 2 - port range
422 (see nat_addr_and_port_alloc_alg_t in nat.h)
423 @param psid_offset - number of offset bits (valid only for MAP-E alg)
424 @param psid_length - length of PSID (valid only for MAP-E alg)
425 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
426 @param start_port - beginning of the port range
427 @param end_port - end of the port range
429 autoreply define nat_set_addr_and_port_alloc_alg {
440 /** \brief Get address and port assignment algorithm
441 @param client_index - opaque cookie to identify the sender
442 @param context - sender context, to match reply w/ request
444 define nat_get_addr_and_port_alloc_alg {
449 /** \brief Get address and port assignment algorithm reply
450 @param context - sender context, to match reply w/ request
451 @param retval - return code
452 @param alg - address and port assignment algorithm:
453 0 - default, 1 - MAP-E, 2 - port range
454 (see nat_addr_and_port_alloc_alg_t in nat.h)
455 @param psid_offset - number of offset bits (valid only for MAP-E alg)
456 @param psid_length - length of PSID (valid only for MAP-E alg)
457 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
458 @param start_port - beginning of the port range
459 @param end_port - end of the port range
461 define nat_get_addr_and_port_alloc_alg_reply {
472 /** \brief Set TCP MSS rewriting configuration
473 @param client_index - opaque cookie to identify the sender
474 @param context - sender context, to match reply w/ request
475 @param mss_value - MSS value to be used for MSS rewriting
476 @param enable - if true enable MSS rewriting feature else disable
478 autoreply define nat_set_mss_clamping {
485 /** \brief Get TCP MSS rewriting configuration
486 @param client_index - opaque cookie to identify the sender
487 @param context - sender context, to match reply w/ request
489 define nat_get_mss_clamping {
494 /** \brief Get TCP MSS rewriting configuration reply
495 @param context - sender context, to match reply w/ request
496 @param retval - return code
497 @param mss_value - MSS value to be used for MSS rewriting
498 @param enable - if true enable MSS rewriting feature else disable
500 define nat_get_mss_clamping_reply {
507 /** \brief Set HA listener (local settings)
508 @param client_index - opaque cookie to identify the sender
509 @param context - sender context, to match reply w/ request
510 @param ip_address - local IP4 address
511 @param port - local UDP port number
512 @param path_mtu - path MTU between local and failover
514 autoreply define nat_ha_set_listener {
517 vl_api_ip4_address_t ip_address;
522 /** \brief Set HA failover (remote settings)
523 @param client_index - opaque cookie to identify the sender
524 @param context - sender context, to match reply w/ request
525 @param ip_address - failover IP4 address
526 @param port - failvoer UDP port number
527 @param session_refresh_interval - number of seconds after which to send
528 session counters refresh
530 autoreply define nat_ha_set_failover {
533 vl_api_ip4_address_t ip_address;
535 u32 session_refresh_interval;
538 /** \brief Get HA listener/local configuration
539 @param client_index - opaque cookie to identify the sender
540 @param context - sender context, to match reply w/ request
542 define nat_ha_get_listener {
547 /** \brief Get HA listener/local configuration reply
548 @param context - sender context, to match reply w/ request
549 @param retval - return code
550 @param ip_address - local IP4 address
551 @param port - local UDP port number
552 @param path_mtu - Path MTU between local and failover
554 define nat_ha_get_listener_reply {
557 vl_api_ip4_address_t ip_address;
562 /** \brief Get HA failover/remote settings
563 @param client_index - opaque cookie to identify the sender
564 @param context - sender context, to match reply w/ request
566 define nat_ha_get_failover {
571 /** \brief Get HA failover/remote settings reply
572 @param context - sender context, to match reply w/ request
573 @param retval - return code
574 @param ip_address - failover IP4 address
575 @param port - failvoer UDP port number
576 @param session_refresh_interval - number of seconds after which to send
577 session counters refresh
579 define nat_ha_get_failover_reply {
582 vl_api_ip4_address_t ip_address;
584 u32 session_refresh_interval;
587 /** \brief Flush the current HA data (for testing)
588 @param client_index - opaque cookie to identify the sender
589 @param context - sender context, to match reply w/ request
591 autoreply define nat_ha_flush {
596 /** \brief Resync HA (resend existing sessions to new failover)
597 @param client_index - opaque cookie to identify the sender
598 @param context - sender context, to match reply w/ request
599 @param want_resync_event - resync completed event sent to the sender via
600 nat_ha_resync_completed_event API message if
602 @param pid - sender's pid
604 autoreply define nat_ha_resync
608 u8 want_resync_event;
612 /** \brief Tell client about a HA resync completion event
613 @param client_index - opaque cookie to identify the sender
614 @param pid - client pid registered to receive notification
615 @param missed_count - number of missed (not ACKed) messages
617 define nat_ha_resync_completed_event
625 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
628 /** \brief Del NAT44 user
629 @param client_index - opaque cookie to identify the sender
630 @param context - sender context, to match reply w/ request
631 @param ip_address - IPv4 address
632 @param fib_index - FIB index
634 autoreply define nat44_del_user {
637 vl_api_ip4_address_t ip_address;
641 /** \brief Add/del NAT44 address range
642 @param client_index - opaque cookie to identify the sender
643 @param context - sender context, to match reply w/ request
644 @param first_ip_address - first IPv4 address
645 @param last_ip_address - last IPv4 address
646 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
647 @param is_add - true if add, false if delete
648 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
651 autoreply define nat44_add_del_address_range {
654 vl_api_ip4_address_t first_ip_address;
655 vl_api_ip4_address_t last_ip_address;
658 vl_api_nat_config_flags_t flags;
661 /** \brief Dump NAT44 addresses
662 @param client_index - opaque cookie to identify the sender
663 @param context - sender context, to match reply w/ request
665 define nat44_address_dump {
670 /** \brief NAT44 address details response
671 @param context - sender context, to match reply w/ request
672 @param ip_address - IPv4 address
673 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
674 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
676 define nat44_address_details {
678 vl_api_ip4_address_t ip_address;
679 vl_api_nat_config_flags_t flags;
683 /** \brief Enable/disable NAT44 feature on the interface
684 @param client_index - opaque cookie to identify the sender
685 @param context - sender context, to match reply w/ request
686 @param is_add - true if add, false if delete
687 @param flags - flag NAT_IS_INSIDE if interface is inside else
689 @param sw_if_index - software index of the interface
691 autoreply define nat44_interface_add_del_feature {
695 vl_api_nat_config_flags_t flags;
696 vl_api_interface_index_t sw_if_index;
699 /** \brief Dump interfaces with NAT44 feature
700 @param client_index - opaque cookie to identify the sender
701 @param context - sender context, to match reply w/ request
703 define nat44_interface_dump {
708 /** \brief NAT44 interface details response
709 @param context - sender context, to match reply w/ request
710 @param sw_if_index - software index of the interface
711 @param flags - flag NAT_IS_INSIDE if interface is inside,
712 flag NAT_IS_OUTSIDE if interface is outside
713 and if both flags are set the interface is
714 both inside and outside
716 define nat44_interface_details {
718 vl_api_nat_config_flags_t flags;
719 vl_api_interface_index_t sw_if_index;
722 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
724 @param client_index - opaque cookie to identify the sender
725 @param context - sender context, to match reply w/ request
726 @param is_add - true if add, false if delete
727 @param flags - flag NAT_IS_INSIDE if interface is inside else
729 @param sw_if_index - software index of the interface
731 autoreply define nat44_interface_add_del_output_feature {
735 vl_api_nat_config_flags_t flags;
736 vl_api_interface_index_t sw_if_index;
739 /** \brief Dump interfaces with NAT44 output feature
740 @param client_index - opaque cookie to identify the sender
741 @param context - sender context, to match reply w/ request
743 define nat44_interface_output_feature_dump {
748 /** \brief NAT44 interface with output feature details response
749 @param context - sender context, to match reply w/ request
750 @param flags - flag NAT_IS_INSIDE if interface is inside else
752 @param sw_if_index - software index of the interface
754 define nat44_interface_output_feature_details {
756 vl_api_nat_config_flags_t flags;
757 vl_api_interface_index_t sw_if_index;
760 /** \brief Add/delete NAT44 static mapping
761 @param client_index - opaque cookie to identify the sender
762 @param context - sender context, to match reply w/ request
763 @param is_add - true if add, false if delete
764 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
765 flag nat_is_twice_nat if nat address range for external hosts,
766 flag NAT_IS_SELF_TWICE_NAT if translate external host address
767 and port whenever external host address equals local
768 address of internal host,
769 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
770 @param local_ip_address - local IPv4 address
771 @param external_ip_address - external IPv4 address
772 @param protocol - IP protocol, used only if addr_only=0
773 @param local_port - local port number, used only if addr_only=0
774 @param external_port - external port number, used only if addr_only=0
775 @param external_sw_if_index - external interface (if set
776 external_ip_address is ignored, ~0 means not
778 @param vfr_id - VRF ID
779 @param tag - opaque string tag
781 autoreply define nat44_add_del_static_mapping {
785 vl_api_nat_config_flags_t flags;
786 vl_api_ip4_address_t local_ip_address;
787 vl_api_ip4_address_t external_ip_address;
791 vl_api_interface_index_t external_sw_if_index;
796 /** \brief Add/delete NAT44 static mapping
797 @param client_index - opaque cookie to identify the sender
798 @param context - sender context, to match reply w/ request
799 @param is_add - true if add, false if delete
800 @param match_pool - true if use specific pool_ip_address
801 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
802 flag nat_is_twice_nat if nat address range for external hosts,
803 flag NAT_IS_SELF_TWICE_NAT if translate external host address
804 and port whenever external host address equals local
805 address of internal host,
806 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
807 @param pool_ip_address - pool IPv4 address to match with pool
808 @param local_ip_address - local IPv4 address
809 @param external_ip_address - external IPv4 address
810 @param protocol - IP protocol, used only if addr_only=0
811 @param local_port - local port number, used only if addr_only=0
812 @param external_port - external port number, used only if addr_only=0
813 @param external_sw_if_index - external interface (if set
814 external_ip_address is ignored, ~0 means not
816 @param vfr_id - VRF ID
817 @param tag - opaque string tag
819 autoreply define nat44_add_del_static_mapping_v2 {
825 vl_api_nat_config_flags_t flags;
826 vl_api_ip4_address_t pool_ip_address;
827 vl_api_ip4_address_t local_ip_address;
828 vl_api_ip4_address_t external_ip_address;
832 vl_api_interface_index_t external_sw_if_index;
837 /** \brief Dump NAT44 static mappings
838 @param client_index - opaque cookie to identify the sender
839 @param context - sender context, to match reply w/ request
841 define nat44_static_mapping_dump {
846 /** \brief NAT44 static mapping details response
847 @param context - sender context, to match reply w/ request
848 @param flags - flag NAT_ADDR_ONLY if address only mapping,
849 flag NAT_TWICE_NAT if NAT address range for external hosts,
850 flag NAT_SELF_TWICE_NAT if translate external host address
851 and port whenever external host address equals local
852 address of internal host,
853 flag NAT_OUT2IN_ONLY if rule match only out2in direction
854 @param local_ip_address - local IPv4 address
855 @param external_ip_address - external IPv4 address
856 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
857 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
858 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
859 @param external_sw_if_index - external interface
860 @param vfr_id - VRF ID
861 @param tag - opaque string tag
863 define nat44_static_mapping_details {
865 vl_api_nat_config_flags_t flags;
866 vl_api_ip4_address_t local_ip_address;
867 vl_api_ip4_address_t external_ip_address;
871 vl_api_interface_index_t external_sw_if_index;
876 /** \brief Add/delete NAT44 identity mapping
877 @param client_index - opaque cookie to identify the sender
878 @param context - sender context, to match reply w/ request
879 @param is_add - true if add, false if delete
880 @param flags - flag NAT_ADDR_ONLY if address only mapping
881 @param ip_address - IPv4 address
882 @param protocol - IP protocol
883 @param port - port number
884 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
886 @param vfr_id - VRF ID (if ~0 use default VRF)
887 @param tag - opaque string tag
889 autoreply define nat44_add_del_identity_mapping {
893 vl_api_nat_config_flags_t flags;
894 vl_api_ip4_address_t ip_address;
897 vl_api_interface_index_t sw_if_index;
902 /** \brief Dump NAT44 identity mappings
903 @param client_index - opaque cookie to identify the sender
904 @param context - sender context, to match reply w/ request
906 define nat44_identity_mapping_dump {
911 /** \brief NAT44 identity mapping details response
912 @param context - sender context, to match reply w/ request
913 @param flags - flag NAT_ADDR_ONLY if address only mapping
914 @param ip_address - IPv4 address
915 @param protocol - IP protocol
916 @param port - port number
917 @param sw_if_index - interface
918 @param vfr_id - VRF ID
919 @param tag - opaque string tag
921 define nat44_identity_mapping_details {
923 vl_api_nat_config_flags_t flags;
924 vl_api_ip4_address_t ip_address;
927 vl_api_interface_index_t sw_if_index;
932 /** \brief Add/delete NAT44 pool address from specific interfce
933 @param client_index - opaque cookie to identify the sender
934 @param context - sender context, to match reply w/ request
935 @param is_add - true if add, false if delete
936 @param sw_if_index - software index of the interface
937 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
939 autoreply define nat44_add_del_interface_addr {
943 vl_api_interface_index_t sw_if_index;
944 vl_api_nat_config_flags_t flags;
947 /** \brief Dump NAT44 pool addresses interfaces
948 @param client_index - opaque cookie to identify the sender
949 @param context - sender context, to match reply w/ request
951 define nat44_interface_addr_dump {
956 /** \brief NAT44 pool addresses interfaces details response
957 @param context - sender context, to match reply w/ request
958 @param sw_if_index - software index of the interface
959 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
962 define nat44_interface_addr_details {
964 vl_api_interface_index_t sw_if_index;
965 vl_api_nat_config_flags_t flags;
968 /** \brief Dump NAT44 users
969 @param client_index - opaque cookie to identify the sender
970 @param context - sender context, to match reply w/ request
972 define nat44_user_dump {
977 /** \brief NAT44 users response
978 @param context - sender context, to match reply w/ request
980 @param ip_address - IPv4 address
981 @param nsessions - number of dynamic sessions
982 @param nstaticsessions - number of static sessions
984 define nat44_user_details {
987 vl_api_ip4_address_t ip_address;
992 /** \brief NAT44 user's sessions
993 @param client_index - opaque cookie to identify the sender
994 @param context - sender context, to match reply w/ request
995 @param ip_address - IPv4 address of the user to dump
996 @param vrf_id - VRF_ID
998 define nat44_user_session_dump {
1001 vl_api_ip4_address_t ip_address;
1005 /** \brief NAT44 user's sessions response
1006 @param context - sender context, to match reply w/ request
1007 @param outside_ip_address - outside IPv4 address
1008 @param outside_port - outside port
1009 @param inside_ip_address - inside IPv4 address
1010 @param inside_port - inside port
1011 @param protocol - protocol
1012 @param flags - flag NAT_IS_STATIC if session is static,
1013 flag NAT_IS_TWICE_NAT if session is twice-nat,
1014 flag NAT_IS_EXT_HOST_VALID if external host address
1016 @param last_heard - last heard timer
1017 @param total_bytes - count of bytes sent through session
1018 @param total_pkts - count of pakets sent through session
1019 @param ext_host_address - external host IPv4 address
1020 @param ext_host_port - external host port
1021 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
1022 only if twice-nat session)
1023 @param ext_host_nat_port - post-NAT external host port (valid only if
1026 define nat44_user_session_details {
1028 vl_api_ip4_address_t outside_ip_address;
1030 vl_api_ip4_address_t inside_ip_address;
1033 vl_api_nat_config_flags_t flags;
1037 vl_api_ip4_address_t ext_host_address;
1039 vl_api_ip4_address_t ext_host_nat_address;
1040 u16 ext_host_nat_port;
1043 /** \brief NAT44 load-balancing address and port pair
1044 @param addr - IPv4 address of the internal node
1045 @param port - L4 port number of the internal node
1046 @param probability - probability of the internal node to be randomly matched
1047 @param vrf_id - VRF id
1049 typedef nat44_lb_addr_port {
1050 vl_api_ip4_address_t addr;
1056 /** \brief Add/delete NAT44 load-balancing static mapping rule
1057 @param client_index - opaque cookie to identify the sender
1058 @param context - sender context, to match reply w/ request
1059 @param is_add - true if add, false if delete
1060 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1061 flag NAT_SELF_TWICE_NAT if translate external host address
1062 and port whenever external host address equals local
1063 address of internal host,
1064 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1065 @param external_addr - external IPv4 address of the service
1066 @param external_port - external L4 port number of the service
1067 @param protocol - IP protocol number of the service
1068 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1070 @param local_num - number of local network nodes
1071 @param locals - local network nodes
1072 @param tag - opaque string tag
1074 autoreply define nat44_add_del_lb_static_mapping {
1078 vl_api_nat_config_flags_t flags;
1079 vl_api_ip4_address_t external_addr;
1085 vl_api_nat44_lb_addr_port_t locals[local_num];
1088 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
1089 @param client_index - opaque cookie to identify the sender
1090 @param context - sender context, to match reply w/ request
1091 @param is_add - true if add, false if delete
1092 @param external_addr - external IPv4 address of the service
1093 @param external_port - external L4 port number of the service
1094 @param protocol - IP protocol number of the service
1095 @param local - local network node
1097 autoreply define nat44_lb_static_mapping_add_del_local {
1101 vl_api_ip4_address_t external_addr;
1104 vl_api_nat44_lb_addr_port_t local;
1107 /** \brief Dump NAT44 load-balancing static mapping rules
1108 @param client_index - opaque cookie to identify the sender
1109 @param context - sender context, to match reply w/ request
1111 define nat44_lb_static_mapping_dump {
1116 /** \brief NAT44 load-balancing static mapping rule details response
1117 @param context - sender context, to match reply w/ request
1118 @param external_addr - external IPv4 address of the service
1119 @param external_port - external L4 port number of the service
1120 @param protocol - IP protocol number of the service
1121 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1122 flag NAT_SELF_TWICE_NAT if translate external host address
1123 and port whenever external host address equals local
1124 address of internal host,
1125 flag NAT_OUT2IN_ONLY if rule match only out2in direction
1126 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1128 @param local_num - number of local network nodes
1129 @param locals - local network nodes
1130 @param tag - opaque string tag
1132 define nat44_lb_static_mapping_details {
1134 vl_api_ip4_address_t external_addr;
1137 vl_api_nat_config_flags_t flags;
1141 vl_api_nat44_lb_addr_port_t locals[local_num];
1144 /** \brief Delete NAT44 session
1145 @param client_index - opaque cookie to identify the sender
1146 @param context - sender context, to match reply w/ request
1147 @param ip_address - IPv4 address
1148 @param protocol - IP protocol
1149 @param port - port number
1150 @param vfr_id - VRF ID
1151 @param flags - flag NAT_IS_INSIDE if interface is inside or
1152 interface is outside,
1153 flag NAT_IS_EXT_HOST_VALID if external host address and
1155 @param ext_host_address - external host IPv4 address
1156 @param ext_host_port - external host port
1158 autoreply define nat44_del_session {
1161 vl_api_ip4_address_t address;
1165 vl_api_nat_config_flags_t flags;
1166 vl_api_ip4_address_t ext_host_address;
1170 /** \brief Enable/disable forwarding for NAT44
1171 Forward packets which don't match existing translation
1172 or static mapping instead of dropping them.
1173 @param client_index - opaque cookie to identify the sender
1174 @param context - sender context, to match reply w/ request
1175 @param enable - true for enable, false for disable
1177 autoreply define nat44_forwarding_enable_disable {
1184 /** \brief Check if forwarding is enabled or disabled
1185 @param client_index - opaque cookie to identify the sender
1186 @param context - sender context, to match reply w/ request
1188 define nat44_forwarding_is_enabled {
1194 /** \brief Response to check if forwarding is enabled or disabled
1195 @param context - sender context, to match reply w/ request
1196 @param enabled - true if enabled, false if disabled
1198 define nat44_forwarding_is_enabled_reply {
1204 /** \brief Set NAT handoff frame queue options
1205 @param client_index - opaque cookie to identify the sender
1206 @param context - sender context, to match reply w/ request
1207 @param frame_queue_nelts - number of worker handoff frame queue elements
1209 autoreply define nat44_ed_set_fq_options {
1213 u32 frame_queue_nelts;
1216 /** \brief Show NAT handoff frame queue options
1217 @param client_index - opaque cookie to identify the sender
1218 @param context - sender context, to match reply w/ request
1220 define nat44_ed_show_fq_options
1227 /** \brief Show NAT handoff frame queue options reply
1228 @param context - sender context, to match reply w/ request
1229 @param retval - return code for the request
1230 @param frame_queue_nelts - number of worker handoff frame queue elements
1232 define nat44_ed_show_fq_options_reply
1237 u32 frame_queue_nelts;