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";
22 * @brief VPP control-plane API messages.
24 * This file defines VPP control-plane API messages which are generally
25 * called through a shared memory interface.
29 * Common NAT plugin APIs
32 enum nat_config_flags : u8
35 NAT_IS_TWICE_NAT = 0x01,
36 NAT_IS_SELF_TWICE_NAT = 0x02,
37 NAT_IS_OUT2IN_ONLY = 0x04,
38 NAT_IS_ADDR_ONLY = 0x08,
39 NAT_IS_OUTSIDE = 0x10,
42 NAT_IS_EXT_HOST_VALID = 0x80,
45 /** \brief Control ping from client to api server request
46 @param client_index - opaque cookie to identify the sender
47 @param context - sender context, to match reply w/ request
49 define nat_control_ping
55 /** \brief Control ping from the client to the server response
56 @param client_index - opaque cookie to identify the sender
57 @param context - sender context, to match reply w/ request
58 @param retval - return code for the request
59 @param vpe_pid - the pid of the vpe, returned by the server
61 define nat_control_ping_reply
69 /** \brief Show NAT plugin startup config
70 @param client_index - opaque cookie to identify the sender
71 @param context - sender context, to match reply w/ request
73 define nat_show_config
79 /** \brief Show NAT plugin startup config reply
80 @param context - sender context, to match reply w/ request
81 @param retval - return code for the request
82 @param static_mapping_only - if true dynamic translations disabled
83 @param static_mapping_connection_tracking - if true create session data
84 @param deterministic - if true deterministic mapping
85 @param endpoint_dependent - if true endpoint-dependent mode
86 @param out2in_dpo - if true out2in dpo mode
87 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
88 @param translation_buckets - number of translation hash buckets
89 @param translation_memory_size - translation hash memory size
90 @param user_buckets - number of user hash buckets
91 @param user_memory_size - user hash memory size
92 @param max_translations_per_user - maximum number of translations per user
93 @param outside_vrf_id - outside VRF id
94 @param inside_vrf_id - default inside VRF id
95 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
96 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
97 @param nat64_st_buckets - number of NAT64 session table hash buckets
98 @param nat64_st_memory_size - memory size of NAT64 session table hash
100 define nat_show_config_reply
104 bool static_mapping_only;
105 bool static_mapping_connection_tracking;
107 bool endpoint_dependent;
110 u32 translation_buckets;
111 u32 translation_memory_size;
113 u64 user_memory_size;
114 u32 max_translations_per_user;
117 u32 nat64_bib_buckets;
118 u64 nat64_bib_memory_size;
119 u32 nat64_st_buckets;
120 u64 nat64_st_memory_size;
123 enum nat_log_level : u8
126 NAT_LOG_ERROR = 0x01,
127 NAT_LOG_WARNING = 0x02,
128 NAT_LOG_NOTICE = 0x03,
130 NAT_LOG_DEBUG = 0x05,
133 /** \brief Run nat44 garbage collection
134 @param client_index - opaque cookie to identify the sender
135 @param context - sender context, to match reply w/ request
137 autoreply define nat44_session_cleanup {
142 /** \brief NAT44 set session limit
143 @param client_index - opaque cookie to identify the sender
144 @param context - sender context, to match reply w/ request
145 @param session_limit - session limit
146 @param vrf_id - vrf id
148 autoreply define nat44_set_session_limit {
155 /** \brief Set NAT logging level
156 @param client_index - opaque cookie to identify the sender
157 @param context - sender context, to match reply w/ request
158 @param log_level - logging level
160 autoreply define nat_set_log_level {
163 vl_api_nat_log_level_t log_level;
166 /** \brief Set NAT workers
167 @param client_index - opaque cookie to identify the sender
168 @param context - sender context, to match reply w/ request
169 @param worker_mask - NAT workers mask
171 autoreply define nat_set_workers {
177 /** \brief Dump NAT workers
178 @param client_index - opaque cookie to identify the sender
179 @param context - sender context, to match reply w/ request
181 define nat_worker_dump {
186 /** \brief NAT workers details response
187 @param context - sender context, to match reply w/ request
188 @param worker_index - worker index
189 @param lcore_id - lcore ID
190 @param name - worker name
192 define nat_worker_details {
199 /** \brief Enable/disable NAT IPFIX logging
200 @param client_index - opaque cookie to identify the sender
201 @param context - sender context, to match reply w/ request
202 @param domain_id - observation domain ID
203 @param src_port - source port number
204 @param enable - true if enable, false if disable
206 autoreply define nat_ipfix_enable_disable {
214 /** \brief Set values of timeouts for NAT sessions (seconds)
215 @param client_index - opaque cookie to identify the sender
216 @param context - sender context, to match reply w/ request
217 @param udp - UDP timeout (default 300sec)
218 @param tcp_established - TCP established timeout (default 7440sec)
219 @param tcp_transitory - TCP transitory timeout (default 240sec)
220 @param icmp - ICMP timeout (default 60sec)
222 autoreply define nat_set_timeouts {
231 /** \brief Get values of timeouts for NAT sessions (seconds)
232 @param client_index - opaque cookie to identify the sender
233 @param context - sender context, to match reply w/ request
235 define nat_get_timeouts {
240 /** \brief Get values of timeouts for NAT sessions reply
241 @param context - sender context, to match reply w/ request
242 @param retval - return code
243 @param udp - UDP timeout
244 @param tcp_established - TCP established timeout
245 @param tcp_transitory - TCP transitory timeout
246 @param icmp - ICMP timeout
248 define nat_get_timeouts_reply {
257 /** \brief Set address and port assignment algorithm
258 @param client_index - opaque cookie to identify the sender
259 @param context - sender context, to match reply w/ request
260 @param alg - address and port assignment algorithm:
261 0 - default, 1 - MAP-E, 2 - port range
262 (see nat_addr_and_port_alloc_alg_t in nat.h)
263 @param psid_offset - number of offset bits (valid only for MAP-E alg)
264 @param psid_length - length of PSID (valid only for MAP-E alg)
265 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
266 @param start_port - beginning of the port range
267 @param end_port - end of the port range
269 autoreply define nat_set_addr_and_port_alloc_alg {
280 /** \brief Get address and port assignment algorithm
281 @param client_index - opaque cookie to identify the sender
282 @param context - sender context, to match reply w/ request
284 define nat_get_addr_and_port_alloc_alg {
289 /** \brief Get address and port assignment algorithm reply
290 @param context - sender context, to match reply w/ request
291 @param retval - return code
292 @param alg - address and port assignment algorithm:
293 0 - default, 1 - MAP-E, 2 - port range
294 (see nat_addr_and_port_alloc_alg_t in nat.h)
295 @param psid_offset - number of offset bits (valid only for MAP-E alg)
296 @param psid_length - length of PSID (valid only for MAP-E alg)
297 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
298 @param start_port - beginning of the port range
299 @param end_port - end of the port range
301 define nat_get_addr_and_port_alloc_alg_reply {
312 /** \brief Set TCP MSS rewriting configuration
313 @param client_index - opaque cookie to identify the sender
314 @param context - sender context, to match reply w/ request
315 @param mss_value - MSS value to be used for MSS rewriting
316 @param enable - if true enable MSS rewriting feature else disable
318 autoreply define nat_set_mss_clamping {
325 /** \brief Get TCP MSS rewriting configuration
326 @param client_index - opaque cookie to identify the sender
327 @param context - sender context, to match reply w/ request
329 define nat_get_mss_clamping {
334 /** \brief Get TCP MSS rewriting configuration reply
335 @param context - sender context, to match reply w/ request
336 @param retval - return code
337 @param mss_value - MSS value to be used for MSS rewriting
338 @param enable - if true enable MSS rewriting feature else disable
340 define nat_get_mss_clamping_reply {
347 /** \brief Set HA listener (local settings)
348 @param client_index - opaque cookie to identify the sender
349 @param context - sender context, to match reply w/ request
350 @param ip_address - local IP4 address
351 @param port - local UDP port number
352 @param path_mtu - path MTU between local and failover
354 autoreply define nat_ha_set_listener {
357 vl_api_ip4_address_t ip_address;
362 /** \brief Set HA failover (remote settings)
363 @param client_index - opaque cookie to identify the sender
364 @param context - sender context, to match reply w/ request
365 @param ip_address - failover IP4 address
366 @param port - failvoer UDP port number
367 @param session_refresh_interval - number of seconds after which to send
368 session counters refresh
370 autoreply define nat_ha_set_failover {
373 vl_api_ip4_address_t ip_address;
375 u32 session_refresh_interval;
378 /** \brief Get HA listener/local configuration
379 @param client_index - opaque cookie to identify the sender
380 @param context - sender context, to match reply w/ request
382 define nat_ha_get_listener {
387 /** \brief Get HA listener/local configuration reply
388 @param context - sender context, to match reply w/ request
389 @param retval - return code
390 @param ip_address - local IP4 address
391 @param port - local UDP port number
392 @param path_mtu - Path MTU between local and failover
394 define nat_ha_get_listener_reply {
397 vl_api_ip4_address_t ip_address;
402 /** \brief Get HA failover/remote settings
403 @param client_index - opaque cookie to identify the sender
404 @param context - sender context, to match reply w/ request
406 define nat_ha_get_failover {
411 /** \brief Get HA failover/remote settings reply
412 @param context - sender context, to match reply w/ request
413 @param retval - return code
414 @param ip_address - failover IP4 address
415 @param port - failvoer UDP port number
416 @param session_refresh_interval - number of seconds after which to send
417 session counters refresh
419 define nat_ha_get_failover_reply {
422 vl_api_ip4_address_t ip_address;
424 u32 session_refresh_interval;
427 /** \brief Flush the current HA data (for testing)
428 @param client_index - opaque cookie to identify the sender
429 @param context - sender context, to match reply w/ request
431 autoreply define nat_ha_flush {
436 /** \brief Resync HA (resend existing sessions to new failover)
437 @param client_index - opaque cookie to identify the sender
438 @param context - sender context, to match reply w/ request
439 @param want_resync_event - resync completed event sent to the sender via
440 nat_ha_resync_completed_event API message if
442 @param pid - sender's pid
444 autoreply define nat_ha_resync
448 u8 want_resync_event;
452 /** \brief Tell client about a HA resync completion event
453 @param client_index - opaque cookie to identify the sender
454 @param pid - client pid registered to receive notification
455 @param missed_count - number of missed (not ACKed) messages
457 define nat_ha_resync_completed_event
465 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
472 /** \brief Del NAT44 user
473 @param client_index - opaque cookie to identify the sender
474 @param context - sender context, to match reply w/ request
475 @param ip_address - IPv4 address
476 @param fib_index - FIB index
478 autoreply define nat44_del_user {
481 vl_api_ip4_address_t ip_address;
485 /** \brief Add/del NAT44 address range
486 @param client_index - opaque cookie to identify the sender
487 @param context - sender context, to match reply w/ request
488 @param first_ip_address - first IPv4 address
489 @param last_ip_address - last IPv4 address
490 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
491 @param is_add - true if add, false if delete
492 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
495 autoreply define nat44_add_del_address_range {
498 vl_api_ip4_address_t first_ip_address;
499 vl_api_ip4_address_t last_ip_address;
502 vl_api_nat_config_flags_t flags;
505 /** \brief Dump NAT44 addresses
506 @param client_index - opaque cookie to identify the sender
507 @param context - sender context, to match reply w/ request
509 define nat44_address_dump {
514 /** \brief NAT44 address details response
515 @param context - sender context, to match reply w/ request
516 @param ip_address - IPv4 address
517 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
518 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
520 define nat44_address_details {
522 vl_api_ip4_address_t ip_address;
523 vl_api_nat_config_flags_t flags;
527 /** \brief Enable/disable NAT44 feature on the interface
528 @param client_index - opaque cookie to identify the sender
529 @param context - sender context, to match reply w/ request
530 @param is_add - true if add, false if delete
531 @param flags - flag NAT_IS_INSIDE if interface is inside else
533 @param sw_if_index - software index of the interface
535 autoreply define nat44_interface_add_del_feature {
539 vl_api_nat_config_flags_t flags;
540 vl_api_interface_index_t sw_if_index;
543 /** \brief Dump interfaces with NAT44 feature
544 @param client_index - opaque cookie to identify the sender
545 @param context - sender context, to match reply w/ request
547 define nat44_interface_dump {
552 /** \brief NAT44 interface details response
553 @param context - sender context, to match reply w/ request
554 @param sw_if_index - software index of the interface
555 @param flags - flag NAT_IS_INSIDE if interface is inside,
556 flag NAT_IS_OUTSIDE if interface is outside
557 and if both flags are set the interface is
558 both inside and outside
560 define nat44_interface_details {
562 vl_api_nat_config_flags_t flags;
563 vl_api_interface_index_t sw_if_index;
566 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
568 @param client_index - opaque cookie to identify the sender
569 @param context - sender context, to match reply w/ request
570 @param is_add - true if add, false if delete
571 @param flags - flag NAT_IS_INSIDE if interface is inside else
573 @param sw_if_index - software index of the interface
575 autoreply define nat44_interface_add_del_output_feature {
579 vl_api_nat_config_flags_t flags;
580 vl_api_interface_index_t sw_if_index;
583 /** \brief Dump interfaces with NAT44 output feature
584 @param client_index - opaque cookie to identify the sender
585 @param context - sender context, to match reply w/ request
587 define nat44_interface_output_feature_dump {
592 /** \brief NAT44 interface with output feature details response
593 @param context - sender context, to match reply w/ request
594 @param flags - flag NAT_IS_INSIDE if interface is inside else
596 @param sw_if_index - software index of the interface
598 define nat44_interface_output_feature_details {
600 vl_api_nat_config_flags_t flags;
601 vl_api_interface_index_t sw_if_index;
604 /** \brief Add/delete NAT44 static mapping
605 @param client_index - opaque cookie to identify the sender
606 @param context - sender context, to match reply w/ request
607 @param is_add - true if add, false if delete
608 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
609 flag nat_is_twice_nat if nat address range for external hosts,
610 flag NAT_IS_SELF_TWICE_NAT if translate external host address
611 and port whenever external host address equals local
612 address of internal host,
613 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
614 @param local_ip_address - local IPv4 address
615 @param external_ip_address - external IPv4 address
616 @param protocol - IP protocol, used only if addr_only=0
617 @param local_port - local port number, used only if addr_only=0
618 @param external_port - external port number, used only if addr_only=0
619 @param external_sw_if_index - external interface (if set
620 external_ip_address is ignored, ~0 means not
622 @param vfr_id - VRF ID
623 @param tag - opaque string tag
625 autoreply define nat44_add_del_static_mapping {
629 vl_api_nat_config_flags_t flags;
630 vl_api_ip4_address_t local_ip_address;
631 vl_api_ip4_address_t external_ip_address;
635 vl_api_interface_index_t external_sw_if_index;
640 /** \brief Dump NAT44 static mappings
641 @param client_index - opaque cookie to identify the sender
642 @param context - sender context, to match reply w/ request
644 define nat44_static_mapping_dump {
649 /** \brief NAT44 static mapping details response
650 @param context - sender context, to match reply w/ request
651 @param flags - flag NAT_ADDR_ONLY if address only mapping,
652 flag NAT_TWICE_NAT if NAT address range for external hosts,
653 flag NAT_SELF_TWICE_NAT if translate external host address
654 and port whenever external host address equals local
655 address of internal host,
656 flag NAT_OUT2IN_ONLY if rule match only out2in direction
657 @param local_ip_address - local IPv4 address
658 @param external_ip_address - external IPv4 address
659 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
660 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
661 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
662 @param external_sw_if_index - external interface
663 @param vfr_id - VRF ID
664 @param tag - opaque string tag
666 define nat44_static_mapping_details {
668 vl_api_nat_config_flags_t flags;
669 vl_api_ip4_address_t local_ip_address;
670 vl_api_ip4_address_t external_ip_address;
674 vl_api_interface_index_t external_sw_if_index;
679 /** \brief Add/delete NAT44 identity mapping
680 @param client_index - opaque cookie to identify the sender
681 @param context - sender context, to match reply w/ request
682 @param is_add - true if add, false if delete
683 @param flags - flag NAT_ADDR_ONLY if address only mapping
684 @param ip_address - IPv4 address
685 @param protocol - IP protocol
686 @param port - port number
687 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
689 @param vfr_id - VRF ID (if ~0 use default VRF)
690 @param tag - opaque string tag
692 autoreply define nat44_add_del_identity_mapping {
696 vl_api_nat_config_flags_t flags;
697 vl_api_ip4_address_t ip_address;
700 vl_api_interface_index_t sw_if_index;
705 /** \brief Dump NAT44 identity mappings
706 @param client_index - opaque cookie to identify the sender
707 @param context - sender context, to match reply w/ request
709 define nat44_identity_mapping_dump {
714 /** \brief NAT44 identity mapping details response
715 @param context - sender context, to match reply w/ request
716 @param flags - flag NAT_ADDR_ONLY if address only mapping
717 @param ip_address - IPv4 address
718 @param protocol - IP protocol
719 @param port - port number
720 @param sw_if_index - interface
721 @param vfr_id - VRF ID
722 @param tag - opaque string tag
724 define nat44_identity_mapping_details {
726 vl_api_nat_config_flags_t flags;
727 vl_api_ip4_address_t ip_address;
730 vl_api_interface_index_t sw_if_index;
735 /** \brief Add/delete NAT44 pool address from specific interfce
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 sw_if_index - software index of the interface
740 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
742 autoreply define nat44_add_del_interface_addr {
746 vl_api_interface_index_t sw_if_index;
747 vl_api_nat_config_flags_t flags;
750 /** \brief Dump NAT44 pool addresses interfaces
751 @param client_index - opaque cookie to identify the sender
752 @param context - sender context, to match reply w/ request
754 define nat44_interface_addr_dump {
759 /** \brief NAT44 pool addresses interfaces details response
760 @param context - sender context, to match reply w/ request
761 @param sw_if_index - software index of the interface
762 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
765 define nat44_interface_addr_details {
767 vl_api_interface_index_t sw_if_index;
768 vl_api_nat_config_flags_t flags;
771 /** \brief Dump NAT44 users
772 @param client_index - opaque cookie to identify the sender
773 @param context - sender context, to match reply w/ request
775 define nat44_user_dump {
780 /** \brief NAT44 users response
781 @param context - sender context, to match reply w/ request
783 @param ip_address - IPv4 address
784 @param nsessions - number of dynamic sessions
785 @param nstaticsessions - number of static sessions
787 define nat44_user_details {
790 vl_api_ip4_address_t ip_address;
795 /** \brief NAT44 user's sessions
796 @param client_index - opaque cookie to identify the sender
797 @param context - sender context, to match reply w/ request
798 @param ip_address - IPv4 address of the user to dump
799 @param vrf_id - VRF_ID
801 define nat44_user_session_dump {
804 vl_api_ip4_address_t ip_address;
808 /** \brief NAT44 user's sessions response
809 @param context - sender context, to match reply w/ request
810 @param outside_ip_address - outside IPv4 address
811 @param outside_port - outside port
812 @param inside_ip_address - inside IPv4 address
813 @param inside_port - inside port
814 @param protocol - protocol
815 @param flags - flag NAT_IS_STATIC if session is static,
816 flag NAT_IS_TWICE_NAT if session is twice-nat,
817 flag NAT_IS_EXT_HOST_VALID if external host address
819 @param last_heard - last heard timer
820 @param total_bytes - count of bytes sent through session
821 @param total_pkts - count of pakets sent through session
822 @param ext_host_address - external host IPv4 address
823 @param ext_host_port - external host port
824 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
825 only if twice-nat session)
826 @param ext_host_nat_port - post-NAT external host port (valid only if
829 define nat44_user_session_details {
831 vl_api_ip4_address_t outside_ip_address;
833 vl_api_ip4_address_t inside_ip_address;
836 vl_api_nat_config_flags_t flags;
840 vl_api_ip4_address_t ext_host_address;
842 vl_api_ip4_address_t ext_host_nat_address;
843 u16 ext_host_nat_port;
846 /** \brief NAT44 load-balancing address and port pair
847 @param addr - IPv4 address of the internal node
848 @param port - L4 port number of the internal node
849 @param probability - probability of the internal node to be randomly matched
850 @param vrf_id - VRF id
852 typedef nat44_lb_addr_port {
853 vl_api_ip4_address_t addr;
859 /** \brief Add/delete NAT44 load-balancing static mapping rule
860 @param client_index - opaque cookie to identify the sender
861 @param context - sender context, to match reply w/ request
862 @param is_add - true if add, false if delete
863 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
864 flag NAT_SELF_TWICE_NAT if translate external host address
865 and port whenever external host address equals local
866 address of internal host,
867 flag NAT_OUT2IN_ONLY if rule match only out2in direction
868 @param external_addr - external IPv4 address of the service
869 @param external_port - external L4 port number of the service
870 @param protocol - IP protocol number of the service
871 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
873 @param local_num - number of local network nodes
874 @param locals - local network nodes
875 @param tag - opaque string tag
877 autoreply manual_endian define nat44_add_del_lb_static_mapping {
881 vl_api_nat_config_flags_t flags;
882 vl_api_ip4_address_t external_addr;
888 vl_api_nat44_lb_addr_port_t locals[local_num];
891 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
892 @param client_index - opaque cookie to identify the sender
893 @param context - sender context, to match reply w/ request
894 @param is_add - true if add, false if delete
895 @param external_addr - external IPv4 address of the service
896 @param external_port - external L4 port number of the service
897 @param protocol - IP protocol number of the service
898 @param local - local network node
900 autoreply define nat44_lb_static_mapping_add_del_local {
904 vl_api_ip4_address_t external_addr;
907 vl_api_nat44_lb_addr_port_t local;
910 /** \brief Dump NAT44 load-balancing static mapping rules
911 @param client_index - opaque cookie to identify the sender
912 @param context - sender context, to match reply w/ request
914 define nat44_lb_static_mapping_dump {
919 /** \brief NAT44 load-balancing static mapping rule details response
920 @param context - sender context, to match reply w/ request
921 @param external_addr - external IPv4 address of the service
922 @param external_port - external L4 port number of the service
923 @param protocol - IP protocol number of the service
924 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
925 flag NAT_SELF_TWICE_NAT if translate external host address
926 and port whenever external host address equals local
927 address of internal host,
928 flag NAT_OUT2IN_ONLY if rule match only out2in direction
929 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
931 @param local_num - number of local network nodes
932 @param locals - local network nodes
933 @param tag - opaque string tag
935 manual_endian define nat44_lb_static_mapping_details {
937 vl_api_ip4_address_t external_addr;
940 vl_api_nat_config_flags_t flags;
944 vl_api_nat44_lb_addr_port_t locals[local_num];
947 /** \brief Delete NAT44 session
948 @param client_index - opaque cookie to identify the sender
949 @param context - sender context, to match reply w/ request
950 @param ip_address - IPv4 address
951 @param protocol - IP protocol
952 @param port - port number
953 @param vfr_id - VRF ID
954 @param flags - flag NAT_IS_INSIDE if interface is inside or
955 interface is outside,
956 flag NAT_IS_EXT_HOST_VALID if external host address and
958 @param ext_host_address - external host IPv4 address
959 @param ext_host_port - external host port
961 autoreply define nat44_del_session {
964 vl_api_ip4_address_t address;
968 vl_api_nat_config_flags_t flags;
969 vl_api_ip4_address_t ext_host_address;
973 /** \brief Enable/disable forwarding for NAT44
974 Forward packets which don't match existing translation
975 or static mapping instead of dropping them.
976 @param client_index - opaque cookie to identify the sender
977 @param context - sender context, to match reply w/ request
978 @param enable - true for enable, false for disable
980 autoreply define nat44_forwarding_enable_disable {
986 /** \brief Check if forwarding is enabled or disabled
987 @param client_index - opaque cookie to identify the sender
988 @param context - sender context, to match reply w/ request
990 define nat44_forwarding_is_enabled {
995 /** \brief Response to check if forwarding is enabled or disabled
996 @param context - sender context, to match reply w/ request
997 @param enabled - true if enabled, false if disabled
999 define nat44_forwarding_is_enabled_reply {
1006 * Deterministic NAT (CGN) APIs
1009 /** \brief Add/delete NAT deterministic mapping
1010 @param client_index - opaque cookie to identify the sender
1011 @param context - sender context, to match reply w/ request
1012 @param is_add - true if add, false if delete
1013 @param in_addr - inside IPv4 address
1014 @param in_plen - inside IPv4 address prefix length
1015 @param out_addr - outside IPv4 address
1016 @param out_plen - outside IPv4 address prefix length
1018 autoreply define nat_det_add_del_map {
1022 vl_api_ip4_address_t in_addr;
1024 vl_api_ip4_address_t out_addr;
1028 /** \brief Get outside address and port range from inside address
1029 @param client_index - opaque cookie to identify the sender
1030 @param context - sender context, to match reply w/ request
1031 @param in_addr - inside IP address
1033 define nat_det_forward {
1036 vl_api_ip4_address_t in_addr;
1039 /** \brief Get outside address and port range from inside address
1040 @param context - sender context, to match reply w/ request
1041 @param retval - return code
1042 @param out_port_lo - outside port range start
1043 @param out_port_hi - outside port range end
1044 @param out_addr - outside IPv4 address
1046 define nat_det_forward_reply {
1051 vl_api_ip4_address_t out_addr;
1054 /** \brief Get inside address from outside address and port
1055 @param client_index - opaque cookie to identify the sender
1056 @param context - sender context, to match reply w/ request
1057 @param out_port - outside port
1058 @param out_addr - outside IPv4 address
1060 define nat_det_reverse {
1064 vl_api_ip4_address_t out_addr;
1067 /** \brief Get inside address from outside address and port reply
1068 @param context - sender context, to match reply w/ request
1069 @param retval - return code
1070 @param in_addr - inside IP address
1072 define nat_det_reverse_reply {
1075 vl_api_ip4_address_t in_addr;
1078 /** \brief Dump NAT deterministic mappings
1079 @param client_index - opaque cookie to identify the sender
1080 @param context - sender context, to match reply w/ request
1082 define nat_det_map_dump {
1087 /** \brief NAT users response
1088 @param context - sender context, to match reply w/ request
1089 @param in_addr - inside IPv4 address
1090 @param in_plen - inside IPv4 address prefix length
1091 @param out_addr - outside IPv4 address
1092 @param out_plen - outside IPv4 address prefix length
1093 @param sharing_ratio - outside to inside address sharing ratio
1094 @param ports_per_host - number of ports available to a host
1095 @param ses_num - number of sessions belonging to this mapping
1097 define nat_det_map_details {
1099 vl_api_ip4_address_t in_addr;
1101 vl_api_ip4_address_t out_addr;
1108 /** \brief Close deterministic NAT session by outside address and port
1109 @param client_index - opaque cookie to identify the sender
1110 @param context - sender context, to match reply w/ request
1111 @param out_addr - outside IPv4 address
1112 @param out_port - outside port
1113 @param ext_addr - external host IPv4 address
1114 @param ext_port - external host port
1116 autoreply define nat_det_close_session_out {
1119 vl_api_ip4_address_t out_addr;
1121 vl_api_ip4_address_t ext_addr;
1125 /** \brief Close deterministic NAT session by inside address and port
1126 @param client_index - opaque cookie to identify the sender
1127 @param context - sender context, to match reply w/ request
1128 @param in_addr - inside IP address
1129 @param in_port - inside port
1130 @param ext_addr - external host IP address
1131 @param ext_port - external host port
1133 autoreply define nat_det_close_session_in {
1136 vl_api_ip4_address_t in_addr;
1138 vl_api_ip4_address_t ext_addr;
1142 /** \brief Dump determinstic NAT sessions
1143 @param client_index - opaque cookie to identify the sender
1144 @param context - sender context, to match reply w/ request
1145 @param user_addr - address of an inside user whose sessions to dump
1147 define nat_det_session_dump {
1150 vl_api_ip4_address_t user_addr;
1153 /** \brief Deterministic NAT sessions reply
1154 @param context - sender context, to match reply w/ request
1155 @param in_port - inside port
1156 @param ext_addr - external host IPv4 address
1157 @param ext_port - external host port
1158 @param out_port - outside NAT port
1159 @param state - session state
1160 @param expire - session expiration timestamp
1162 define nat_det_session_details {
1165 vl_api_ip4_address_t ext_addr;
1176 /** \brief Add/delete address range to NAT64 pool
1177 @param client_index - opaque cookie to identify the sender
1178 @param context - sender context, to match reply w/ request
1179 @param start_addr - start IPv4 address of the range
1180 @param end_addr - end IPv4 address of the range
1181 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1182 @param is_add - true if add, false if delete
1184 autoreply define nat64_add_del_pool_addr_range {
1187 vl_api_ip4_address_t start_addr;
1188 vl_api_ip4_address_t end_addr;
1193 /** \brief Dump NAT64 pool addresses
1194 @param client_index - opaque cookie to identify the sender
1195 @param context - sender context, to match reply w/ request
1197 define nat64_pool_addr_dump {
1202 /** \brief NAT64 pool address details response
1203 @param context - sender context, to match reply w/ request
1204 @param address - IPv4 address
1205 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1207 define nat64_pool_addr_details {
1209 vl_api_ip4_address_t address;
1213 /** \brief Enable/disable NAT64 feature on the interface
1214 @param client_index - opaque cookie to identify the sender
1215 @param context - sender context, to match reply w/ request
1216 @param is_add - true if add, false if delete
1217 @param flags - flag NAT_IS_INSIDE if interface is inside else
1218 interface is outside
1219 @param sw_if_index - index of the interface
1221 autoreply define nat64_add_del_interface {
1225 vl_api_nat_config_flags_t flags;
1226 vl_api_interface_index_t sw_if_index;
1229 /** \brief Dump interfaces with NAT64 feature
1230 @param client_index - opaque cookie to identify the sender
1231 @param context - sender context, to match reply w/ request
1233 define nat64_interface_dump {
1238 /** \brief NAT64 interface details response
1239 @param context - sender context, to match reply w/ request
1240 @param flags - flag NAT_IS_INSIDE if interface is inside,
1241 flag NAT_IS_OUTSIDE if interface is outside
1242 and if both flags are set the interface is
1243 both inside and outside
1244 @param sw_if_index - index of the interface
1246 define nat64_interface_details {
1248 vl_api_nat_config_flags_t flags;
1249 vl_api_interface_index_t sw_if_index;
1252 /** \brief Add/delete NAT64 static BIB entry
1253 @param client_index - opaque cookie to identify the sender
1254 @param context - sender context, to match reply w/ request
1255 @param i_addr - inside IPv6 address
1256 @param o_addr - outside IPv4 address
1257 @param i_port - inside port number
1258 @param o_port - outside port number
1259 @param vrf_id - VRF id of tenant
1260 @param proto - protocol number
1261 @param is_add - true if add, false if delete
1263 autoreply define nat64_add_del_static_bib {
1266 vl_api_ip6_address_t i_addr;
1267 vl_api_ip4_address_t o_addr;
1275 /** \brief Dump NAT64 BIB
1276 @param client_index - opaque cookie to identify the sender
1277 @param context - sender context, to match reply w/ request
1278 @param proto - protocol of the BIB: 255 - all BIBs
1282 otherwise - "unknown" protocol BIB
1284 define nat64_bib_dump {
1290 /** \brief NAT64 BIB details response
1291 @param context - sender context, to match reply w/ request
1292 @param i_addr - inside IPv6 address
1293 @param o_addr - outside IPv4 address
1294 @param i_port - inside port number
1295 @param o_port - outside port number
1296 @param vrf_id - VRF id of tenant
1297 @param proto - protocol number
1298 @param flags - flag NAT_IS_STATIC if BIB entry is static
1299 or BIB entry is dynamic
1300 @param ses_num - number of sessions associated with the BIB entry
1302 define nat64_bib_details {
1304 vl_api_ip6_address_t i_addr;
1305 vl_api_ip4_address_t o_addr;
1310 vl_api_nat_config_flags_t flags;
1314 /** \brief Dump NAT64 session table
1315 @param client_index - opaque cookie to identify the sender
1316 @param context - sender context, to match reply w/ request
1317 @param proto - protocol of the session table: 255 - all STs
1321 otherwise - "unknown" proto ST
1323 define nat64_st_dump {
1329 /** \brief NAT64 session table details response
1330 @param context - sender context, to match reply w/ request
1331 @param il_addr - inside IPv6 address of the local host
1332 @param ol_addr - outside IPv4 address of the local host
1333 @param il_port - inside port number id of the local host/inside ICMP id
1334 @param ol_port - outside port number of the local host/outside ICMP id
1335 @param ir_addr - inside IPv6 address of the remote host
1336 @param or_addr - outside IPv4 address of the remote host
1337 @param r_port - port number of the remote host (not used for ICMP)
1338 @param vrf_id - VRF id of tenant
1339 @param proto - protocol number
1341 define nat64_st_details {
1343 vl_api_ip6_address_t il_addr;
1344 vl_api_ip4_address_t ol_addr;
1347 vl_api_ip6_address_t ir_addr;
1348 vl_api_ip4_address_t or_addr;
1354 /** \brief Add/del NAT64 prefix
1355 @param client_index - opaque cookie to identify the sender
1356 @param context - sender context, to match reply w/ request
1357 @param prefix - NAT64 prefix
1358 @param vrf_id - VRF id of tenant
1359 @param is_add - true if add, false if delete
1361 autoreply define nat64_add_del_prefix {
1364 vl_api_ip6_prefix_t prefix;
1369 /** \brief Dump NAT64 prefix
1370 @param client_index - opaque cookie to identify the sender
1371 @param context - sender context, to match reply w/ request
1373 define nat64_prefix_dump {
1378 /** \brief Dump NAT64 prefix details response
1379 @param context - sender context, to match reply w/ request
1380 @param prefix - NAT64 prefix
1381 @param vrf_id - VRF id of tenant
1383 define nat64_prefix_details {
1385 vl_api_ip6_prefix_t prefix;
1389 /** \brief Add/delete NAT64 pool address from specific interfce
1390 @param client_index - opaque cookie to identify the sender
1391 @param context - sender context, to match reply w/ request
1392 @param is_add - true if add, false if delete
1393 @param sw_if_index - software index of the interface
1395 autoreply define nat64_add_del_interface_addr {
1399 vl_api_interface_index_t sw_if_index;
1405 /** \brief Enable/disable NAT66 feature on the interface
1406 @param client_index - opaque cookie to identify the sender
1407 @param context - sender context, to match reply w/ request
1408 @param is_add - true if add, false if delete
1409 @param flags - flag NAT_IS_INSIDE if interface is inside or
1410 interface is outside,
1411 @param sw_if_index - software index of the interface
1413 autoreply define nat66_add_del_interface {
1417 vl_api_nat_config_flags_t flags;
1418 vl_api_interface_index_t sw_if_index;
1421 /** \brief Dump interfaces with NAT66 feature
1422 @param client_index - opaque cookie to identify the sender
1423 @param context - sender context, to match reply w/ request
1425 define nat66_interface_dump {
1430 /** \brief NAT66 interface details response
1431 @param context - sender context, to match reply w/ request
1432 @param flags - flag NAT_IS_INSIDE if interface is inside or
1433 interface is outside,
1434 @param sw_if_index - software index of the interface
1436 define nat66_interface_details {
1438 vl_api_nat_config_flags_t flags;
1439 vl_api_interface_index_t sw_if_index;
1442 /** \brief Add/delete 1:1 NAT66
1443 @param client_index - opaque cookie to identify the sender
1444 @param context - sender context, to match reply w/ request
1445 @param is_add - true if add, false if delete
1446 @param local_ip_address - local IPv6 address
1447 @param external_ip_address - external IPv6 address
1448 @param vrf_id - VRF id of tenant
1450 autoreply define nat66_add_del_static_mapping {
1454 vl_api_ip6_address_t local_ip_address;
1455 vl_api_ip6_address_t external_ip_address;
1459 /** \brief Dump NAT66 static mappings
1460 @param client_index - opaque cookie to identify the sender
1461 @param context - sender context, to match reply w/ request
1463 define nat66_static_mapping_dump {
1468 /** \brief NAT66 static mapping details response
1469 @param context - sender context, to match reply w/ request
1470 @param local_ip_address - local IPv6 address
1471 @param external_ip_address - external IPv6 address
1472 @param vrf_id - VRF id of tenant
1473 @param total_bytes - count of bytes sent through static mapping
1474 @param total_pkts - count of pakets sent through static mapping
1476 define nat66_static_mapping_details {
1478 vl_api_ip6_address_t local_ip_address;
1479 vl_api_ip6_address_t external_ip_address;