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.0.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 u32 user_memory_size;
114 u32 max_translations_per_user;
117 u32 nat64_bib_buckets;
118 u32 nat64_bib_memory_size;
119 u32 nat64_st_buckets;
120 u32 nat64_st_memory_size;
123 /** \brief Set NAT workers
124 @param client_index - opaque cookie to identify the sender
125 @param context - sender context, to match reply w/ request
126 @param worker_mask - NAT workers mask
128 autoreply define nat_set_workers {
134 /** \brief Dump NAT workers
135 @param client_index - opaque cookie to identify the sender
136 @param context - sender context, to match reply w/ request
138 define nat_worker_dump {
143 /** \brief NAT workers details response
144 @param context - sender context, to match reply w/ request
145 @param worker_index - worker index
146 @param lcore_id - lcore ID
147 @param name - worker name
149 define nat_worker_details {
156 /** \brief Enable/disable NAT IPFIX logging
157 @param client_index - opaque cookie to identify the sender
158 @param context - sender context, to match reply w/ request
159 @param domain_id - observation domain ID
160 @param src_port - source port number
161 @param enable - true if enable, false if disable
163 autoreply define nat_ipfix_enable_disable {
171 /** \brief Set NAT virtual fragmentation reassembly
172 @param client_index - opaque cookie to identify the sender
173 @param context - sender context, to match reply w/ request
174 @param timeout - reassembly timeout
175 @param max_reass - maximum number of concurrent reassemblies
176 @param max_frag - maximum number of fragmets per reassembly
177 @param drop_frag - if 0 translate fragments, otherwise drop fragments
178 @param is_ip6 - true if IPv6, false if IPv4
180 autoreply define nat_set_reass {
190 /** \brief Get NAT virtual fragmentation reassembly configuration
191 @param client_index - opaque cookie to identify the sender
192 @param context - sender context, to match reply w/ request
194 define nat_get_reass {
199 /** \brief Get NAT virtual fragmentation reassembly configuration reply
200 @param context - sender context, to match reply w/ request
201 @param retval - return code
202 @param ip4_timeout - reassembly timeout
203 @param ip4_max_reass - maximum number of concurrent reassemblies
204 @param ip4_max_frag - maximum number of fragmets per reassembly
205 @param ip4_drop_frag - if 0 translate fragments, otherwise drop fragments
206 @param ip6_timeout - reassembly timeout
207 @param ip6_max_reass - maximum number of concurrent reassemblies
208 @param ip6_max_frag - maximum number of fragmets per reassembly
209 @param ip6_drop_frag - if 0 translate fragments, otherwise drop fragments
211 define nat_get_reass_reply {
224 /** \brief Dump NAT virtual fragmentation reassemblies
225 @param client_index - opaque cookie to identify the sender
226 @param context - sender context, to match reply w/ request
228 define nat_reass_dump {
233 /** \brief NAT virtual fragmentation reassemblies response
234 @param context - sender context, to match reply w/ request
235 @param src_addr - source IPv4 address
236 @param dst_addr - destination IPv4 address
237 @param frag_id - fragment ID
238 @param proto - protocol
239 @param frag_n - number of cached fragments
241 define nat_reass_details {
243 vl_api_address_t src_addr;
244 vl_api_address_t dst_addr;
250 /** \brief Set values of timeouts for NAT sessions (seconds)
251 @param client_index - opaque cookie to identify the sender
252 @param context - sender context, to match reply w/ request
253 @param udp - UDP timeout (default 300sec)
254 @param tcp_established - TCP established timeout (default 7440sec)
255 @param tcp_transitory - TCP transitory timeout (default 240sec)
256 @param icmp - ICMP timeout (default 60sec)
258 autoreply define nat_set_timeouts {
267 /** \brief Get values of timeouts for NAT sessions (seconds)
268 @param client_index - opaque cookie to identify the sender
269 @param context - sender context, to match reply w/ request
271 define nat_get_timeouts {
276 /** \brief Get values of timeouts for NAT sessions reply
277 @param context - sender context, to match reply w/ request
278 @param retval - return code
279 @param udp - UDP timeout
280 @param tcp_established - TCP established timeout
281 @param tcp_transitory - TCP transitory timeout
282 @param icmp - ICMP timeout
284 define nat_get_timeouts_reply {
293 /** \brief Set address and port assignment algorithm
294 @param client_index - opaque cookie to identify the sender
295 @param context - sender context, to match reply w/ request
296 @param alg - address and port assignment algorithm:
297 0 - default, 1 - MAP-E, 2 - port range
298 (see nat_addr_and_port_alloc_alg_t in nat.h)
299 @param psid_offset - number of offset bits (valid only for MAP-E alg)
300 @param psid_length - length of PSID (valid only for MAP-E alg)
301 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
302 @param start_port - beginning of the port range
303 @param end_port - end of the port range
305 autoreply define nat_set_addr_and_port_alloc_alg {
316 /** \brief Get address and port assignment algorithm
317 @param client_index - opaque cookie to identify the sender
318 @param context - sender context, to match reply w/ request
320 define nat_get_addr_and_port_alloc_alg {
325 /** \brief Get address and port assignment algorithm reply
326 @param context - sender context, to match reply w/ request
327 @param retval - return code
328 @param alg - address and port assignment algorithm:
329 0 - default, 1 - MAP-E, 2 - port range
330 (see nat_addr_and_port_alloc_alg_t in nat.h)
331 @param psid_offset - number of offset bits (valid only for MAP-E alg)
332 @param psid_length - length of PSID (valid only for MAP-E alg)
333 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
334 @param start_port - beginning of the port range
335 @param end_port - end of the port range
337 define nat_get_addr_and_port_alloc_alg_reply {
348 /** \brief Set TCP MSS rewriting configuration
349 @param client_index - opaque cookie to identify the sender
350 @param context - sender context, to match reply w/ request
351 @param mss_value - MSS value to be used for MSS rewriting
352 @param enable - if true enable MSS rewriting feature else disable
354 autoreply define nat_set_mss_clamping {
361 /** \brief Get TCP MSS rewriting configuration
362 @param client_index - opaque cookie to identify the sender
363 @param context - sender context, to match reply w/ request
365 define nat_get_mss_clamping {
370 /** \brief Get TCP MSS rewriting configuration reply
371 @param context - sender context, to match reply w/ request
372 @param retval - return code
373 @param mss_value - MSS value to be used for MSS rewriting
374 @param enable - if true enable MSS rewriting feature else disable
376 define nat_get_mss_clamping_reply {
383 /** \brief Set HA listener (local settings)
384 @param client_index - opaque cookie to identify the sender
385 @param context - sender context, to match reply w/ request
386 @param ip_address - local IP4 address
387 @param port - local UDP port number
388 @param path_mtu - path MTU between local and failover
390 autoreply define nat_ha_set_listener {
393 vl_api_ip4_address_t ip_address;
398 /** \brief Set HA failover (remote settings)
399 @param client_index - opaque cookie to identify the sender
400 @param context - sender context, to match reply w/ request
401 @param ip_address - failover IP4 address
402 @param port - failvoer UDP port number
403 @param session_refresh_interval - number of seconds after which to send
404 session counters refresh
406 autoreply define nat_ha_set_failover {
409 vl_api_ip4_address_t ip_address;
411 u32 session_refresh_interval;
414 /** \brief Get HA listener/local configuration
415 @param client_index - opaque cookie to identify the sender
416 @param context - sender context, to match reply w/ request
418 define nat_ha_get_listener {
423 /** \brief Get HA listener/local configuration reply
424 @param context - sender context, to match reply w/ request
425 @param retval - return code
426 @param ip_address - local IP4 address
427 @param port - local UDP port number
428 @param path_mtu - Path MTU between local and failover
430 define nat_ha_get_listener_reply {
433 vl_api_ip4_address_t ip_address;
438 /** \brief Get HA failover/remote settings
439 @param client_index - opaque cookie to identify the sender
440 @param context - sender context, to match reply w/ request
442 define nat_ha_get_failover {
447 /** \brief Get HA failover/remote settings reply
448 @param context - sender context, to match reply w/ request
449 @param retval - return code
450 @param ip_address - failover IP4 address
451 @param port - failvoer UDP port number
452 @param session_refresh_interval - number of seconds after which to send
453 session counters refresh
455 define nat_ha_get_failover_reply {
458 vl_api_ip4_address_t ip_address;
460 u32 session_refresh_interval;
463 /** \brief Flush the current HA data (for testing)
464 @param client_index - opaque cookie to identify the sender
465 @param context - sender context, to match reply w/ request
467 autoreply define nat_ha_flush {
472 /** \brief Resync HA (resend existing sessions to new failover)
473 @param client_index - opaque cookie to identify the sender
474 @param context - sender context, to match reply w/ request
475 @param want_resync_event - resync completed event sent to the sender via
476 nat_ha_resync_completed_event API message if
478 @param pid - sender's pid
480 autoreply define nat_ha_resync
484 u8 want_resync_event;
488 /** \brief Tell client about a HA resync completion event
489 @param client_index - opaque cookie to identify the sender
490 @param pid - client pid registered to receive notification
491 @param missed_count - number of missed (not ACKed) messages
493 define nat_ha_resync_completed_event
501 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
508 /** \brief Add/del NAT44 address range
509 @param client_index - opaque cookie to identify the sender
510 @param context - sender context, to match reply w/ request
511 @param first_ip_address - first IPv4 address
512 @param last_ip_address - last IPv4 address
513 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
514 @param is_add - true if add, false if delete
515 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
518 autoreply define nat44_add_del_address_range {
521 vl_api_ip4_address_t first_ip_address;
522 vl_api_ip4_address_t last_ip_address;
525 vl_api_nat_config_flags_t flags;
528 /** \brief Dump NAT44 addresses
529 @param client_index - opaque cookie to identify the sender
530 @param context - sender context, to match reply w/ request
532 define nat44_address_dump {
537 /** \brief NAT44 address details response
538 @param context - sender context, to match reply w/ request
539 @param ip_address - IPv4 address
540 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
541 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
543 define nat44_address_details {
545 vl_api_ip4_address_t ip_address;
546 vl_api_nat_config_flags_t flags;
550 /** \brief Enable/disable NAT44 feature on the interface
551 @param client_index - opaque cookie to identify the sender
552 @param context - sender context, to match reply w/ request
553 @param is_add - true if add, false if delete
554 @param flags - flag NAT_IS_INSIDE if interface is inside else
556 @param sw_if_index - software index of the interface
558 autoreply define nat44_interface_add_del_feature {
562 vl_api_nat_config_flags_t flags;
563 vl_api_interface_index_t sw_if_index;
566 /** \brief Dump interfaces with NAT44 feature
567 @param client_index - opaque cookie to identify the sender
568 @param context - sender context, to match reply w/ request
570 define nat44_interface_dump {
575 /** \brief NAT44 interface details response
576 @param context - sender context, to match reply w/ request
577 @param sw_if_index - software index of the interface
578 @param flags - flag NAT_IS_INSIDE if interface is inside,
579 flag NAT_IS_OUTSIDE if interface is outside
580 and if both flags are set the interface is
581 both inside and outside
583 define nat44_interface_details {
585 vl_api_nat_config_flags_t flags;
586 vl_api_interface_index_t sw_if_index;
589 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
591 @param client_index - opaque cookie to identify the sender
592 @param context - sender context, to match reply w/ request
593 @param is_add - true if add, false if delete
594 @param flags - flag NAT_IS_INSIDE if interface is inside else
596 @param sw_if_index - software index of the interface
598 autoreply define nat44_interface_add_del_output_feature {
602 vl_api_nat_config_flags_t flags;
603 vl_api_interface_index_t sw_if_index;
606 /** \brief Dump interfaces with NAT44 output feature
607 @param client_index - opaque cookie to identify the sender
608 @param context - sender context, to match reply w/ request
610 define nat44_interface_output_feature_dump {
615 /** \brief NAT44 interface with output feature details response
616 @param context - sender context, to match reply w/ request
617 @param flags - flag NAT_IS_INSIDE if interface is inside else
619 @param sw_if_index - software index of the interface
621 define nat44_interface_output_feature_details {
623 vl_api_nat_config_flags_t flags;
624 vl_api_interface_index_t sw_if_index;
627 /** \brief Add/delete NAT44 static mapping
628 @param client_index - opaque cookie to identify the sender
629 @param context - sender context, to match reply w/ request
630 @param is_add - true if add, false if delete
631 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
632 flag nat_is_twice_nat if nat address range for external hosts,
633 flag NAT_IS_SELF_TWICE_NAT if translate external host address
634 and port whenever external host address equals local
635 address of internal host,
636 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
637 @param local_ip_address - local IPv4 address
638 @param external_ip_address - external IPv4 address
639 @param protocol - IP protocol, used only if addr_only=0
640 @param local_port - local port number, used only if addr_only=0
641 @param external_port - external port number, used only if addr_only=0
642 @param external_sw_if_index - external interface (if set
643 external_ip_address is ignored, ~0 means not
645 @param vfr_id - VRF ID
646 @param tag - opaque string tag
648 autoreply define nat44_add_del_static_mapping {
652 vl_api_nat_config_flags_t flags;
653 vl_api_ip4_address_t local_ip_address;
654 vl_api_ip4_address_t external_ip_address;
658 vl_api_interface_index_t external_sw_if_index;
663 /** \brief Dump NAT44 static mappings
664 @param client_index - opaque cookie to identify the sender
665 @param context - sender context, to match reply w/ request
667 define nat44_static_mapping_dump {
672 /** \brief NAT44 static mapping details response
673 @param context - sender context, to match reply w/ request
674 @param flags - flag NAT_ADDR_ONLY if address only mapping,
675 flag NAT_TWICE_NAT if NAT address range for external hosts,
676 flag NAT_SELF_TWICE_NAT if translate external host address
677 and port whenever external host address equals local
678 address of internal host,
679 flag NAT_OUT2IN_ONLY if rule match only out2in direction
680 @param local_ip_address - local IPv4 address
681 @param external_ip_address - external IPv4 address
682 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
683 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
684 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
685 @param external_sw_if_index - external interface
686 @param vfr_id - VRF ID
687 @param tag - opaque string tag
689 define nat44_static_mapping_details {
691 vl_api_nat_config_flags_t flags;
692 vl_api_ip4_address_t local_ip_address;
693 vl_api_ip4_address_t external_ip_address;
697 vl_api_interface_index_t external_sw_if_index;
702 /** \brief Add/delete NAT44 identity mapping
703 @param client_index - opaque cookie to identify the sender
704 @param context - sender context, to match reply w/ request
705 @param is_add - true if add, false if delete
706 @param flags - flag NAT_ADDR_ONLY if address only mapping
707 @param ip_address - IPv4 address
708 @param protocol - IP protocol
709 @param port - port number
710 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
712 @param vfr_id - VRF ID (if ~0 use default VRF)
713 @param tag - opaque string tag
715 autoreply define nat44_add_del_identity_mapping {
719 vl_api_nat_config_flags_t flags;
720 vl_api_ip4_address_t ip_address;
723 vl_api_interface_index_t sw_if_index;
728 /** \brief Dump NAT44 identity mappings
729 @param client_index - opaque cookie to identify the sender
730 @param context - sender context, to match reply w/ request
732 define nat44_identity_mapping_dump {
737 /** \brief NAT44 identity mapping details response
738 @param context - sender context, to match reply w/ request
739 @param flags - flag NAT_ADDR_ONLY if address only mapping
740 @param ip_address - IPv4 address
741 @param protocol - IP protocol
742 @param port - port number
743 @param sw_if_index - interface
744 @param vfr_id - VRF ID
745 @param tag - opaque string tag
747 define nat44_identity_mapping_details {
749 vl_api_nat_config_flags_t flags;
750 vl_api_ip4_address_t ip_address;
753 vl_api_interface_index_t sw_if_index;
758 /** \brief Add/delete NAT44 pool address from specific interfce
759 @param client_index - opaque cookie to identify the sender
760 @param context - sender context, to match reply w/ request
761 @param is_add - true if add, false if delete
762 @param sw_if_index - software index of the interface
763 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
765 autoreply define nat44_add_del_interface_addr {
769 vl_api_interface_index_t sw_if_index;
770 vl_api_nat_config_flags_t flags;
773 /** \brief Dump NAT44 pool addresses interfaces
774 @param client_index - opaque cookie to identify the sender
775 @param context - sender context, to match reply w/ request
777 define nat44_interface_addr_dump {
782 /** \brief NAT44 pool addresses interfaces details response
783 @param context - sender context, to match reply w/ request
784 @param sw_if_index - software index of the interface
785 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
788 define nat44_interface_addr_details {
790 vl_api_interface_index_t sw_if_index;
791 vl_api_nat_config_flags_t flags;
794 /** \brief Dump NAT44 users
795 @param client_index - opaque cookie to identify the sender
796 @param context - sender context, to match reply w/ request
798 define nat44_user_dump {
803 /** \brief NAT44 users response
804 @param context - sender context, to match reply w/ request
806 @param ip_address - IPv4 address
807 @param nsessions - number of dynamic sessions
808 @param nstaticsessions - number of static sessions
810 define nat44_user_details {
813 vl_api_ip4_address_t ip_address;
818 /** \brief NAT44 user's sessions
819 @param client_index - opaque cookie to identify the sender
820 @param context - sender context, to match reply w/ request
821 @param ip_address - IPv4 address of the user to dump
822 @param vrf_id - VRF_ID
824 define nat44_user_session_dump {
827 vl_api_ip4_address_t ip_address;
831 /** \brief NAT44 user's sessions response
832 @param context - sender context, to match reply w/ request
833 @param outside_ip_address - outside IPv4 address
834 @param outside_port - outside port
835 @param inside_ip_address - inside IPv4 address
836 @param inside_port - inside port
837 @param protocol - protocol
838 @param flags - flag NAT_IS_STATIC if session is static,
839 flag NAT_IS_TWICE_NAT if session is twice-nat,
840 flag NAT_IS_EXT_HOST_VALID if external host address
842 @param last_heard - last heard timer
843 @param total_bytes - count of bytes sent through session
844 @param total_pkts - count of pakets sent through session
845 @param ext_host_address - external host IPv4 address
846 @param ext_host_port - external host port
847 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
848 only if twice-nat session)
849 @param ext_host_nat_port - post-NAT external host port (valid only if
852 define nat44_user_session_details {
854 vl_api_ip4_address_t outside_ip_address;
856 vl_api_ip4_address_t inside_ip_address;
859 vl_api_nat_config_flags_t flags;
863 vl_api_ip4_address_t ext_host_address;
865 vl_api_ip4_address_t ext_host_nat_address;
866 u16 ext_host_nat_port;
869 /** \brief NAT44 load-balancing address and port pair
870 @param addr - IPv4 address of the internal node
871 @param port - L4 port number of the internal node
872 @param probability - probability of the internal node to be randomly matched
873 @param vrf_id - VRF id
875 typeonly manual_endian define nat44_lb_addr_port {
876 vl_api_ip4_address_t addr;
882 /** \brief Add/delete NAT44 load-balancing static mapping rule
883 @param client_index - opaque cookie to identify the sender
884 @param context - sender context, to match reply w/ request
885 @param is_add - true if add, false if delete
886 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
887 flag NAT_SELF_TWICE_NAT if translate external host address
888 and port whenever external host address equals local
889 address of internal host,
890 flag NAT_OUT2IN_ONLY if rule match only out2in direction
891 @param external_addr - external IPv4 address of the service
892 @param external_port - external L4 port number of the service
893 @param protocol - IP protocol number of the service
894 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
896 @param local_num - number of local network nodes
897 @param locals - local network nodes
898 @param tag - opaque string tag
900 autoreply manual_endian define nat44_add_del_lb_static_mapping {
904 vl_api_nat_config_flags_t flags;
905 vl_api_ip4_address_t external_addr;
910 vl_api_nat44_lb_addr_port_t locals[local_num];
914 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
915 @param client_index - opaque cookie to identify the sender
916 @param context - sender context, to match reply w/ request
917 @param is_add - true if add, false if delete
918 @param external_addr - external IPv4 address of the service
919 @param external_port - external L4 port number of the service
920 @param protocol - IP protocol number of the service
921 @param local - local network node
923 autoreply define nat44_lb_static_mapping_add_del_local {
927 vl_api_ip4_address_t external_addr;
930 vl_api_nat44_lb_addr_port_t local;
933 /** \brief Dump NAT44 load-balancing static mapping rules
934 @param client_index - opaque cookie to identify the sender
935 @param context - sender context, to match reply w/ request
937 define nat44_lb_static_mapping_dump {
942 /** \brief NAT44 load-balancing static mapping rule details response
943 @param context - sender context, to match reply w/ request
944 @param external_addr - external IPv4 address of the service
945 @param external_port - external L4 port number of the service
946 @param protocol - IP protocol number of the service
947 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
948 flag NAT_SELF_TWICE_NAT if translate external host address
949 and port whenever external host address equals local
950 address of internal host,
951 flag NAT_OUT2IN_ONLY if rule match only out2in direction
952 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
954 @param local_num - number of local network nodes
955 @param locals - local network nodes
956 @param tag - opaque string tag
958 manual_endian define nat44_lb_static_mapping_details {
960 vl_api_ip4_address_t external_addr;
963 vl_api_nat_config_flags_t flags;
966 vl_api_nat44_lb_addr_port_t locals[local_num];
970 /** \brief Delete NAT44 session
971 @param client_index - opaque cookie to identify the sender
972 @param context - sender context, to match reply w/ request
973 @param ip_address - IPv4 address
974 @param protocol - IP protocol
975 @param port - port number
976 @param vfr_id - VRF ID
977 @param flags - flag NAT_IS_INSIDE if interface is inside or
978 interface is outside,
979 flag NAT_IS_EXT_HOST_VALID if external host address and
981 @param ext_host_address - external host IPv4 address
982 @param ext_host_port - external host port
984 autoreply define nat44_del_session {
987 vl_api_ip4_address_t address;
991 vl_api_nat_config_flags_t flags;
992 vl_api_ip4_address_t ext_host_address;
996 /** \brief Enable/disable forwarding for NAT44
997 Forward packets which don't match existing translation
998 or static mapping instead of dropping them.
999 @param client_index - opaque cookie to identify the sender
1000 @param context - sender context, to match reply w/ request
1001 @param enable - true for enable, false for disable
1003 autoreply define nat44_forwarding_enable_disable {
1009 /** \brief Check if forwarding is enabled or disabled
1010 @param client_index - opaque cookie to identify the sender
1011 @param context - sender context, to match reply w/ request
1013 define nat44_forwarding_is_enabled {
1018 /** \brief Response to check if forwarding is enabled or disabled
1019 @param context - sender context, to match reply w/ request
1020 @param enabled - true if enabled, false if disabled
1022 define nat44_forwarding_is_enabled_reply {
1029 * Deterministic NAT (CGN) APIs
1032 /** \brief Add/delete NAT deterministic mapping
1033 @param client_index - opaque cookie to identify the sender
1034 @param context - sender context, to match reply w/ request
1035 @param is_add - true if add, false if delete
1036 @param in_addr - inside IPv4 address
1037 @param in_plen - inside IPv4 address prefix length
1038 @param out_addr - outside IPv4 address
1039 @param out_plen - outside IPv4 address prefix length
1041 autoreply define nat_det_add_del_map {
1045 vl_api_ip4_address_t in_addr;
1047 vl_api_ip4_address_t out_addr;
1051 /** \brief Get outside address and port range from inside address
1052 @param client_index - opaque cookie to identify the sender
1053 @param context - sender context, to match reply w/ request
1054 @param in_addr - inside IP address
1056 define nat_det_forward {
1059 vl_api_ip4_address_t in_addr;
1062 /** \brief Get outside address and port range from inside address
1063 @param context - sender context, to match reply w/ request
1064 @param retval - return code
1065 @param out_port_lo - outside port range start
1066 @param out_port_hi - outside port range end
1067 @param out_addr - outside IPv4 address
1069 define nat_det_forward_reply {
1074 vl_api_ip4_address_t out_addr;
1077 /** \brief Get inside address from outside address and port
1078 @param client_index - opaque cookie to identify the sender
1079 @param context - sender context, to match reply w/ request
1080 @param out_port - outside port
1081 @param out_addr - outside IPv4 address
1083 define nat_det_reverse {
1087 vl_api_ip4_address_t out_addr;
1090 /** \brief Get inside address from outside address and port reply
1091 @param context - sender context, to match reply w/ request
1092 @param retval - return code
1093 @param in_addr - inside IP address
1095 define nat_det_reverse_reply {
1098 vl_api_ip4_address_t in_addr;
1101 /** \brief Dump NAT deterministic mappings
1102 @param client_index - opaque cookie to identify the sender
1103 @param context - sender context, to match reply w/ request
1105 define nat_det_map_dump {
1110 /** \brief NAT users response
1111 @param context - sender context, to match reply w/ request
1112 @param in_addr - inside IPv4 address
1113 @param in_plen - inside IPv4 address prefix length
1114 @param out_addr - outside IPv4 address
1115 @param out_plen - outside IPv4 address prefix length
1116 @param sharing_ratio - outside to inside address sharing ratio
1117 @param ports_per_host - number of ports available to a host
1118 @param ses_num - number of sessions belonging to this mapping
1120 define nat_det_map_details {
1122 vl_api_ip4_address_t in_addr;
1124 vl_api_ip4_address_t out_addr;
1131 /** \brief Close deterministic NAT session by outside address and port
1132 @param client_index - opaque cookie to identify the sender
1133 @param context - sender context, to match reply w/ request
1134 @param out_addr - outside IPv4 address
1135 @param out_port - outside port
1136 @param ext_addr - external host IPv4 address
1137 @param ext_port - external host port
1139 autoreply define nat_det_close_session_out {
1142 vl_api_ip4_address_t out_addr;
1144 vl_api_ip4_address_t ext_addr;
1148 /** \brief Close deterministic NAT session by inside address and port
1149 @param client_index - opaque cookie to identify the sender
1150 @param context - sender context, to match reply w/ request
1151 @param in_addr - inside IP address
1152 @param in_port - inside port
1153 @param ext_addr - external host IP address
1154 @param ext_port - external host port
1156 autoreply define nat_det_close_session_in {
1159 vl_api_ip4_address_t in_addr;
1161 vl_api_ip4_address_t ext_addr;
1165 /** \brief Dump determinstic NAT sessions
1166 @param client_index - opaque cookie to identify the sender
1167 @param context - sender context, to match reply w/ request
1168 @param user_addr - address of an inside user whose sessions to dump
1170 define nat_det_session_dump {
1173 vl_api_ip4_address_t user_addr;
1176 /** \brief Deterministic NAT sessions reply
1177 @param context - sender context, to match reply w/ request
1178 @param in_port - inside port
1179 @param ext_addr - external host IPv4 address
1180 @param ext_port - external host port
1181 @param out_port - outside NAT port
1182 @param state - session state
1183 @param expire - session expiration timestamp
1185 define nat_det_session_details {
1188 vl_api_ip4_address_t ext_addr;
1199 /** \brief Add/delete address range to NAT64 pool
1200 @param client_index - opaque cookie to identify the sender
1201 @param context - sender context, to match reply w/ request
1202 @param start_addr - start IPv4 address of the range
1203 @param end_addr - end IPv4 address of the range
1204 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1205 @param is_add - true if add, false if delete
1207 autoreply define nat64_add_del_pool_addr_range {
1210 vl_api_ip4_address_t start_addr;
1211 vl_api_ip4_address_t end_addr;
1216 /** \brief Dump NAT64 pool addresses
1217 @param client_index - opaque cookie to identify the sender
1218 @param context - sender context, to match reply w/ request
1220 define nat64_pool_addr_dump {
1225 /** \brief NAT64 pool address details response
1226 @param context - sender context, to match reply w/ request
1227 @param address - IPv4 address
1228 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1230 define nat64_pool_addr_details {
1232 vl_api_ip4_address_t address;
1236 /** \brief Enable/disable NAT64 feature on the interface
1237 @param client_index - opaque cookie to identify the sender
1238 @param context - sender context, to match reply w/ request
1239 @param is_add - true if add, false if delete
1240 @param flags - flag NAT_IS_INSIDE if interface is inside else
1241 interface is outside
1242 @param sw_if_index - index of the interface
1244 autoreply define nat64_add_del_interface {
1248 vl_api_nat_config_flags_t flags;
1249 vl_api_interface_index_t sw_if_index;
1252 /** \brief Dump interfaces with NAT64 feature
1253 @param client_index - opaque cookie to identify the sender
1254 @param context - sender context, to match reply w/ request
1256 define nat64_interface_dump {
1261 /** \brief NAT64 interface details response
1262 @param context - sender context, to match reply w/ request
1263 @param flags - flag NAT_IS_INSIDE if interface is inside,
1264 flag NAT_IS_OUTSIDE if interface is outside
1265 and if both flags are set the interface is
1266 both inside and outside
1267 @param sw_if_index - index of the interface
1269 define nat64_interface_details {
1271 vl_api_nat_config_flags_t flags;
1272 vl_api_interface_index_t sw_if_index;
1275 /** \brief Add/delete NAT64 static BIB entry
1276 @param client_index - opaque cookie to identify the sender
1277 @param context - sender context, to match reply w/ request
1278 @param i_addr - inside IPv6 address
1279 @param o_addr - outside IPv4 address
1280 @param i_port - inside port number
1281 @param o_port - outside port number
1282 @param vrf_id - VRF id of tenant
1283 @param proto - protocol number
1284 @param is_add - true if add, false if delete
1286 autoreply define nat64_add_del_static_bib {
1289 vl_api_ip6_address_t i_addr;
1290 vl_api_ip4_address_t o_addr;
1298 /** \brief Dump NAT64 BIB
1299 @param client_index - opaque cookie to identify the sender
1300 @param context - sender context, to match reply w/ request
1301 @param proto - protocol of the BIB: 255 - all BIBs
1305 otherwise - "unknown" protocol BIB
1307 define nat64_bib_dump {
1313 /** \brief NAT64 BIB details response
1314 @param context - sender context, to match reply w/ request
1315 @param i_addr - inside IPv6 address
1316 @param o_addr - outside IPv4 address
1317 @param i_port - inside port number
1318 @param o_port - outside port number
1319 @param vrf_id - VRF id of tenant
1320 @param proto - protocol number
1321 @param flags - flag NAT_IS_STATIC if BIB entry is static
1322 or BIB entry is dynamic
1323 @param ses_num - number of sessions associated with the BIB entry
1325 define nat64_bib_details {
1327 vl_api_ip6_address_t i_addr;
1328 vl_api_ip4_address_t o_addr;
1333 vl_api_nat_config_flags_t flags;
1337 /** \brief Dump NAT64 session table
1338 @param client_index - opaque cookie to identify the sender
1339 @param context - sender context, to match reply w/ request
1340 @param proto - protocol of the session table: 255 - all STs
1344 otherwise - "unknown" proto ST
1346 define nat64_st_dump {
1352 /** \brief NAT64 session table details response
1353 @param context - sender context, to match reply w/ request
1354 @param il_addr - inside IPv6 address of the local host
1355 @param ol_addr - outside IPv4 address of the local host
1356 @param il_port - inside port number id of the local host/inside ICMP id
1357 @param ol_port - outside port number of the local host/outside ICMP id
1358 @param ir_addr - inside IPv6 address of the remote host
1359 @param or_addr - outside IPv4 address of the remote host
1360 @param r_port - port number of the remote host (not used for ICMP)
1361 @param vrf_id - VRF id of tenant
1362 @param proto - protocol number
1364 define nat64_st_details {
1366 vl_api_ip6_address_t il_addr;
1367 vl_api_ip4_address_t ol_addr;
1370 vl_api_ip6_address_t ir_addr;
1371 vl_api_ip4_address_t or_addr;
1377 /** \brief Add/del NAT64 prefix
1378 @param client_index - opaque cookie to identify the sender
1379 @param context - sender context, to match reply w/ request
1380 @param prefix - NAT64 prefix
1381 @param vrf_id - VRF id of tenant
1382 @param is_add - true if add, false if delete
1384 autoreply define nat64_add_del_prefix {
1387 vl_api_ip6_prefix_t prefix;
1392 /** \brief Dump NAT64 prefix
1393 @param client_index - opaque cookie to identify the sender
1394 @param context - sender context, to match reply w/ request
1396 define nat64_prefix_dump {
1401 /** \brief Dump NAT64 prefix details response
1402 @param context - sender context, to match reply w/ request
1403 @param prefix - NAT64 prefix
1404 @param vrf_id - VRF id of tenant
1406 define nat64_prefix_details {
1408 vl_api_ip6_prefix_t prefix;
1412 /** \brief Add/delete NAT64 pool address from specific interfce
1413 @param client_index - opaque cookie to identify the sender
1414 @param context - sender context, to match reply w/ request
1415 @param is_add - true if add, false if delete
1416 @param sw_if_index - software index of the interface
1418 autoreply define nat64_add_del_interface_addr {
1422 vl_api_interface_index_t sw_if_index;
1429 /** \brief Add/delete address range to DS-Lite pool
1430 @param client_index - opaque cookie to identify the sender
1431 @param context - sender context, to match reply w/ request
1432 @param start_addr - start IPv4 address of the range
1433 @param end_addr - end IPv4 address of the range
1434 @param is_add - true if add, false if delete
1436 autoreply define dslite_add_del_pool_addr_range {
1439 vl_api_ip4_address_t start_addr;
1440 vl_api_ip4_address_t end_addr;
1444 /** \brief Dump DS-Lite addresses
1445 @param client_index - opaque cookie to identify the sender
1446 @param context - sender context, to match reply w/ request
1448 define dslite_address_dump {
1453 /** \brief DS-Lite address details response
1454 @param context - sender context, to match reply w/ request
1455 @param ip_address - IPv4 address
1457 define dslite_address_details {
1459 vl_api_ip4_address_t ip_address;
1462 /** \brief Set AFTR IPv6 and IPv4 addresses
1463 @param client_index - opaque cookie to identify the sender
1464 @param context - sender context, to match reply w/ request
1465 @param ip4_addr - IPv4 address
1466 @param ip6_addr - IPv6 address
1468 autoreply define dslite_set_aftr_addr {
1471 vl_api_ip4_address_t ip4_addr;
1472 vl_api_ip6_address_t ip6_addr;
1475 /** \brief Get AFTR IPv6 and IPv4 addresses
1476 @param client_index - opaque cookie to identify the sender
1477 @param context - sender context, to match reply w/ request
1479 define dslite_get_aftr_addr {
1484 /** \brief Response to get AFTR IPv6 and IPv4 addresses
1485 @param context - sender context, to match reply w/ request
1486 @param retval - return code
1487 @param ip4_addr - IPv4 address
1488 @param ip6_addr - IPv6 address
1490 define dslite_get_aftr_addr_reply {
1493 vl_api_ip4_address_t ip4_addr;
1494 vl_api_ip6_address_t ip6_addr;
1497 /** \brief Set B4 IPv6 and IPv4 addresses
1498 @param client_index - opaque cookie to identify the sender
1499 @param context - sender context, to match reply w/ request
1500 @param ip4_addr - IPv4 address
1501 @param ip6_addr - IPv6 address
1503 autoreply define dslite_set_b4_addr {
1506 vl_api_ip4_address_t ip4_addr;
1507 vl_api_ip6_address_t ip6_addr;
1510 /** \brief Get B4 IPv6 and IPv4 addresses
1511 @param client_index - opaque cookie to identify the sender
1512 @param context - sender context, to match reply w/ request
1514 define dslite_get_b4_addr {
1519 /** \brief Response to get B4 IPv6 and IPv4 addresses
1520 @param context - sender context, to match reply w/ request
1521 @param retval - return code
1522 @param ip4_addr - IPv4 address
1523 @param ip6_addr - IPv6 address
1525 define dslite_get_b4_addr_reply {
1528 vl_api_ip4_address_t ip4_addr;
1529 vl_api_ip6_address_t ip6_addr;
1535 /** \brief Enable/disable NAT66 feature on the interface
1536 @param client_index - opaque cookie to identify the sender
1537 @param context - sender context, to match reply w/ request
1538 @param is_add - true if add, false if delete
1539 @param flags - flag NAT_IS_INSIDE if interface is inside or
1540 interface is outside,
1541 @param sw_if_index - software index of the interface
1543 autoreply define nat66_add_del_interface {
1547 vl_api_nat_config_flags_t flags;
1548 vl_api_interface_index_t sw_if_index;
1551 /** \brief Dump interfaces with NAT66 feature
1552 @param client_index - opaque cookie to identify the sender
1553 @param context - sender context, to match reply w/ request
1555 define nat66_interface_dump {
1560 /** \brief NAT66 interface details response
1561 @param context - sender context, to match reply w/ request
1562 @param flags - flag NAT_IS_INSIDE if interface is inside or
1563 interface is outside,
1564 @param sw_if_index - software index of the interface
1566 define nat66_interface_details {
1568 vl_api_nat_config_flags_t flags;
1569 vl_api_interface_index_t sw_if_index;
1572 /** \brief Add/delete 1:1 NAT66
1573 @param client_index - opaque cookie to identify the sender
1574 @param context - sender context, to match reply w/ request
1575 @param is_add - true if add, false if delete
1576 @param local_ip_address - local IPv6 address
1577 @param external_ip_address - external IPv6 address
1578 @param vrf_id - VRF id of tenant
1580 autoreply define nat66_add_del_static_mapping {
1584 vl_api_ip6_address_t local_ip_address;
1585 vl_api_ip6_address_t external_ip_address;
1589 /** \brief Dump NAT66 static mappings
1590 @param client_index - opaque cookie to identify the sender
1591 @param context - sender context, to match reply w/ request
1593 define nat66_static_mapping_dump {
1598 /** \brief NAT66 static mapping details response
1599 @param context - sender context, to match reply w/ request
1600 @param local_ip_address - local IPv6 address
1601 @param external_ip_address - external IPv6 address
1602 @param vrf_id - VRF id of tenant
1603 @param total_bytes - count of bytes sent through static mapping
1604 @param total_pkts - count of pakets sent through static mapping
1606 define nat66_static_mapping_details {
1608 vl_api_ip6_address_t local_ip_address;
1609 vl_api_ip6_address_t external_ip_address;