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
34 NAT_IS_TWICE_NAT = 0x01,
35 NAT_IS_SELF_TWICE_NAT = 0x02,
36 NAT_IS_OUT2IN_ONLY = 0x04,
37 NAT_IS_ADDR_ONLY = 0x08,
38 NAT_IS_OUTSIDE = 0x10,
41 NAT_IS_EXT_HOST_VALID = 0x80,
44 /** \brief Control ping from client to api server request
45 @param client_index - opaque cookie to identify the sender
46 @param context - sender context, to match reply w/ request
48 define nat_control_ping
54 /** \brief Control ping from the client to the server response
55 @param client_index - opaque cookie to identify the sender
56 @param context - sender context, to match reply w/ request
57 @param retval - return code for the request
58 @param vpe_pid - the pid of the vpe, returned by the server
60 define nat_control_ping_reply
68 /** \brief Show NAT plugin startup config
69 @param client_index - opaque cookie to identify the sender
70 @param context - sender context, to match reply w/ request
72 define nat_show_config
78 /** \brief Show NAT plugin startup config reply
79 @param context - sender context, to match reply w/ request
80 @param retval - return code for the request
81 @param static_mapping_only - if true dynamic translations disabled
82 @param static_mapping_connection_tracking - if true create session data
83 @param deterministic - if true deterministic mapping
84 @param endpoint_dependent - if true endpoint-dependent mode
85 @param out2in_dpo - if true out2in dpo mode
86 @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
87 @param translation_buckets - number of translation hash buckets
88 @param translation_memory_size - translation hash memory size
89 @param user_buckets - number of user hash buckets
90 @param user_memory_size - user hash memory size
91 @param max_translations_per_user - maximum number of translations per user
92 @param outside_vrf_id - outside VRF id
93 @param inside_vrf_id - default inside VRF id
94 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
95 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
96 @param nat64_st_buckets - number of NAT64 session table hash buckets
97 @param nat64_st_memory_size - memory size of NAT64 session table hash
99 define nat_show_config_reply
103 bool static_mapping_only;
104 bool static_mapping_connection_tracking;
106 bool endpoint_dependent;
109 u32 translation_buckets;
110 u32 translation_memory_size;
112 u32 user_memory_size;
113 u32 max_translations_per_user;
116 u32 nat64_bib_buckets;
117 u32 nat64_bib_memory_size;
118 u32 nat64_st_buckets;
119 u32 nat64_st_memory_size;
122 /** \brief Set NAT workers
123 @param client_index - opaque cookie to identify the sender
124 @param context - sender context, to match reply w/ request
125 @param worker_mask - NAT workers mask
127 autoreply define nat_set_workers {
133 /** \brief Dump NAT workers
134 @param client_index - opaque cookie to identify the sender
135 @param context - sender context, to match reply w/ request
137 define nat_worker_dump {
142 /** \brief NAT workers details response
143 @param context - sender context, to match reply w/ request
144 @param worker_index - worker index
145 @param lcore_id - lcore ID
146 @param name - worker name
148 define nat_worker_details {
155 /** \brief Enable/disable NAT IPFIX logging
156 @param client_index - opaque cookie to identify the sender
157 @param context - sender context, to match reply w/ request
158 @param domain_id - observation domain ID
159 @param src_port - source port number
160 @param enable - true if enable, false if disable
162 autoreply define nat_ipfix_enable_disable {
170 /** \brief Set NAT virtual fragmentation reassembly
171 @param client_index - opaque cookie to identify the sender
172 @param context - sender context, to match reply w/ request
173 @param timeout - reassembly timeout
174 @param max_reass - maximum number of concurrent reassemblies
175 @param max_frag - maximum number of fragmets per reassembly
176 @param drop_frag - if 0 translate fragments, otherwise drop fragments
177 @param is_ip6 - true if IPv6, false if IPv4
179 autoreply define nat_set_reass {
189 /** \brief Get NAT virtual fragmentation reassembly configuration
190 @param client_index - opaque cookie to identify the sender
191 @param context - sender context, to match reply w/ request
193 define nat_get_reass {
198 /** \brief Get NAT virtual fragmentation reassembly configuration reply
199 @param context - sender context, to match reply w/ request
200 @param retval - return code
201 @param ip4_timeout - reassembly timeout
202 @param ip4_max_reass - maximum number of concurrent reassemblies
203 @param ip4_max_frag - maximum number of fragmets per reassembly
204 @param ip4_drop_frag - if 0 translate fragments, otherwise drop fragments
205 @param ip6_timeout - reassembly timeout
206 @param ip6_max_reass - maximum number of concurrent reassemblies
207 @param ip6_max_frag - maximum number of fragmets per reassembly
208 @param ip6_drop_frag - if 0 translate fragments, otherwise drop fragments
210 define nat_get_reass_reply {
223 /** \brief Dump NAT virtual fragmentation reassemblies
224 @param client_index - opaque cookie to identify the sender
225 @param context - sender context, to match reply w/ request
227 define nat_reass_dump {
232 /** \brief NAT virtual fragmentation reassemblies response
233 @param context - sender context, to match reply w/ request
234 @param src_addr - source IPv4 address
235 @param dst_addr - destination IPv4 address
236 @param frag_id - fragment ID
237 @param proto - protocol
238 @param frag_n - number of cached fragments
240 define nat_reass_details {
242 vl_api_address_t src_addr;
243 vl_api_address_t dst_addr;
249 /** \brief Set values of timeouts for NAT sessions (seconds)
250 @param client_index - opaque cookie to identify the sender
251 @param context - sender context, to match reply w/ request
252 @param udp - UDP timeout (default 300sec)
253 @param tcp_established - TCP established timeout (default 7440sec)
254 @param tcp_transitory - TCP transitory timeout (default 240sec)
255 @param icmp - ICMP timeout (default 60sec)
257 autoreply define nat_set_timeouts {
266 /** \brief Get values of timeouts for NAT sessions (seconds)
267 @param client_index - opaque cookie to identify the sender
268 @param context - sender context, to match reply w/ request
270 define nat_get_timeouts {
275 /** \brief Get values of timeouts for NAT sessions reply
276 @param context - sender context, to match reply w/ request
277 @param retval - return code
278 @param udp - UDP timeout
279 @param tcp_established - TCP established timeout
280 @param tcp_transitory - TCP transitory timeout
281 @param icmp - ICMP timeout
283 define nat_get_timeouts_reply {
292 /** \brief Set address and port assignment algorithm
293 @param client_index - opaque cookie to identify the sender
294 @param context - sender context, to match reply w/ request
295 @param alg - address and port assignment algorithm:
296 0 - default, 1 - MAP-E, 2 - port range
297 (see nat_addr_and_port_alloc_alg_t in nat.h)
298 @param psid_offset - number of offset bits (valid only for MAP-E alg)
299 @param psid_length - length of PSID (valid only for MAP-E alg)
300 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
301 @param start_port - beginning of the port range
302 @param end_port - end of the port range
304 autoreply define nat_set_addr_and_port_alloc_alg {
315 /** \brief Get address and port assignment algorithm
316 @param client_index - opaque cookie to identify the sender
317 @param context - sender context, to match reply w/ request
319 define nat_get_addr_and_port_alloc_alg {
324 /** \brief Get address and port assignment algorithm reply
325 @param context - sender context, to match reply w/ request
326 @param retval - return code
327 @param alg - address and port assignment algorithm:
328 0 - default, 1 - MAP-E, 2 - port range
329 (see nat_addr_and_port_alloc_alg_t in nat.h)
330 @param psid_offset - number of offset bits (valid only for MAP-E alg)
331 @param psid_length - length of PSID (valid only for MAP-E alg)
332 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
333 @param start_port - beginning of the port range
334 @param end_port - end of the port range
336 define nat_get_addr_and_port_alloc_alg_reply {
347 /** \brief Set TCP MSS rewriting configuration
348 @param client_index - opaque cookie to identify the sender
349 @param context - sender context, to match reply w/ request
350 @param mss_value - MSS value to be used for MSS rewriting
351 @param enable - if true enable MSS rewriting feature else disable
353 autoreply define nat_set_mss_clamping {
360 /** \brief Get TCP MSS rewriting configuration
361 @param client_index - opaque cookie to identify the sender
362 @param context - sender context, to match reply w/ request
364 define nat_get_mss_clamping {
369 /** \brief Get TCP MSS rewriting configuration reply
370 @param context - sender context, to match reply w/ request
371 @param retval - return code
372 @param mss_value - MSS value to be used for MSS rewriting
373 @param enable - if true enable MSS rewriting feature else disable
375 define nat_get_mss_clamping_reply {
382 /** \brief Set HA listener (local settings)
383 @param client_index - opaque cookie to identify the sender
384 @param context - sender context, to match reply w/ request
385 @param ip_address - local IP4 address
386 @param port - local UDP port number
387 @param path_mtu - path MTU between local and failover
389 autoreply define nat_ha_set_listener {
392 vl_api_ip4_address_t ip_address;
397 /** \brief Set HA failover (remote settings)
398 @param client_index - opaque cookie to identify the sender
399 @param context - sender context, to match reply w/ request
400 @param ip_address - failover IP4 address
401 @param port - failvoer UDP port number
402 @param session_refresh_interval - number of seconds after which to send
403 session counters refresh
405 autoreply define nat_ha_set_failover {
408 vl_api_ip4_address_t ip_address;
410 u32 session_refresh_interval;
413 /** \brief Get HA listener/local configuration
414 @param client_index - opaque cookie to identify the sender
415 @param context - sender context, to match reply w/ request
417 define nat_ha_get_listener {
422 /** \brief Get HA listener/local configuration reply
423 @param context - sender context, to match reply w/ request
424 @param retval - return code
425 @param ip_address - local IP4 address
426 @param port - local UDP port number
427 @param path_mtu - Path MTU between local and failover
429 define nat_ha_get_listener_reply {
432 vl_api_ip4_address_t ip_address;
437 /** \brief Get HA failover/remote settings
438 @param client_index - opaque cookie to identify the sender
439 @param context - sender context, to match reply w/ request
441 define nat_ha_get_failover {
446 /** \brief Get HA failover/remote settings reply
447 @param context - sender context, to match reply w/ request
448 @param retval - return code
449 @param ip_address - failover IP4 address
450 @param port - failvoer UDP port number
451 @param session_refresh_interval - number of seconds after which to send
452 session counters refresh
454 define nat_ha_get_failover_reply {
457 vl_api_ip4_address_t ip_address;
459 u32 session_refresh_interval;
462 /** \brief Flush the current HA data (for testing)
463 @param client_index - opaque cookie to identify the sender
464 @param context - sender context, to match reply w/ request
466 autoreply define nat_ha_flush {
471 /** \brief Resync HA (resend existing sessions to new failover)
472 @param client_index - opaque cookie to identify the sender
473 @param context - sender context, to match reply w/ request
474 @param want_resync_event - resync completed event sent to the sender via
475 nat_ha_resync_completed_event API message if
477 @param pid - sender's pid
479 autoreply define nat_ha_resync
483 u8 want_resync_event;
487 /** \brief Tell client about a HA resync completion event
488 @param client_index - opaque cookie to identify the sender
489 @param pid - client pid registered to receive notification
490 @param missed_count - number of missed (not ACKed) messages
492 define nat_ha_resync_completed_event
500 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
507 /** \brief Add/del NAT44 address range
508 @param client_index - opaque cookie to identify the sender
509 @param context - sender context, to match reply w/ request
510 @param first_ip_address - first IPv4 address
511 @param last_ip_address - last IPv4 address
512 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
513 @param is_add - true if add, false if delete
514 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
517 autoreply define nat44_add_del_address_range {
520 vl_api_ip4_address_t first_ip_address;
521 vl_api_ip4_address_t last_ip_address;
524 vl_api_nat_config_flags_t flags;
527 /** \brief Dump NAT44 addresses
528 @param client_index - opaque cookie to identify the sender
529 @param context - sender context, to match reply w/ request
531 define nat44_address_dump {
536 /** \brief NAT44 address details response
537 @param context - sender context, to match reply w/ request
538 @param ip_address - IPv4 address
539 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
540 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
542 define nat44_address_details {
544 vl_api_ip4_address_t ip_address;
545 vl_api_nat_config_flags_t flags;
549 /** \brief Enable/disable NAT44 feature on the interface
550 @param client_index - opaque cookie to identify the sender
551 @param context - sender context, to match reply w/ request
552 @param is_add - true if add, false if delete
553 @param flags - flag NAT_IS_INSIDE if interface is inside else
555 @param sw_if_index - software index of the interface
557 autoreply define nat44_interface_add_del_feature {
561 vl_api_nat_config_flags_t flags;
562 vl_api_interface_index_t sw_if_index;
565 /** \brief Dump interfaces with NAT44 feature
566 @param client_index - opaque cookie to identify the sender
567 @param context - sender context, to match reply w/ request
569 define nat44_interface_dump {
574 /** \brief NAT44 interface details response
575 @param context - sender context, to match reply w/ request
576 @param sw_if_index - software index of the interface
577 @param flags - flag NAT_IS_INSIDE if interface is inside,
578 flag NAT_IS_OUTSIDE if interface is outside
579 and if both flags are set the interface is
580 both inside and outside
582 define nat44_interface_details {
584 vl_api_nat_config_flags_t flags;
585 vl_api_interface_index_t sw_if_index;
588 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
590 @param client_index - opaque cookie to identify the sender
591 @param context - sender context, to match reply w/ request
592 @param is_add - true if add, false if delete
593 @param flags - flag NAT_IS_INSIDE if interface is inside else
595 @param sw_if_index - software index of the interface
597 autoreply define nat44_interface_add_del_output_feature {
601 vl_api_nat_config_flags_t flags;
602 vl_api_interface_index_t sw_if_index;
605 /** \brief Dump interfaces with NAT44 output feature
606 @param client_index - opaque cookie to identify the sender
607 @param context - sender context, to match reply w/ request
609 define nat44_interface_output_feature_dump {
614 /** \brief NAT44 interface with output feature details response
615 @param context - sender context, to match reply w/ request
616 @param flags - flag NAT_IS_INSIDE if interface is inside else
618 @param sw_if_index - software index of the interface
620 define nat44_interface_output_feature_details {
622 vl_api_nat_config_flags_t flags;
623 vl_api_interface_index_t sw_if_index;
626 /** \brief Add/delete NAT44 static mapping
627 @param client_index - opaque cookie to identify the sender
628 @param context - sender context, to match reply w/ request
629 @param is_add - true if add, false if delete
630 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
631 flag nat_is_twice_nat if nat address range for external hosts,
632 flag NAT_IS_SELF_TWICE_NAT if translate external host address
633 and port whenever external host address equals local
634 address of internal host,
635 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
636 @param local_ip_address - local IPv4 address
637 @param external_ip_address - external IPv4 address
638 @param protocol - IP protocol, used only if addr_only=0
639 @param local_port - local port number, used only if addr_only=0
640 @param external_port - external port number, used only if addr_only=0
641 @param external_sw_if_index - external interface (if set
642 external_ip_address is ignored, ~0 means not
644 @param vfr_id - VRF ID
645 @param tag - opaque string tag
647 autoreply define nat44_add_del_static_mapping {
651 vl_api_nat_config_flags_t flags;
652 vl_api_ip4_address_t local_ip_address;
653 vl_api_ip4_address_t external_ip_address;
657 vl_api_interface_index_t external_sw_if_index;
662 /** \brief Dump NAT44 static mappings
663 @param client_index - opaque cookie to identify the sender
664 @param context - sender context, to match reply w/ request
666 define nat44_static_mapping_dump {
671 /** \brief NAT44 static mapping details response
672 @param context - sender context, to match reply w/ request
673 @param flags - flag NAT_ADDR_ONLY if address only mapping,
674 flag NAT_TWICE_NAT if NAT address range for external hosts,
675 flag NAT_SELF_TWICE_NAT if translate external host address
676 and port whenever external host address equals local
677 address of internal host,
678 flag NAT_OUT2IN_ONLY if rule match only out2in direction
679 @param local_ip_address - local IPv4 address
680 @param external_ip_address - external IPv4 address
681 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
682 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
683 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
684 @param external_sw_if_index - external interface
685 @param vfr_id - VRF ID
686 @param tag - opaque string tag
688 define nat44_static_mapping_details {
690 vl_api_nat_config_flags_t flags;
691 vl_api_ip4_address_t local_ip_address;
692 vl_api_ip4_address_t external_ip_address;
696 vl_api_interface_index_t external_sw_if_index;
701 /** \brief Add/delete NAT44 identity mapping
702 @param client_index - opaque cookie to identify the sender
703 @param context - sender context, to match reply w/ request
704 @param is_add - true if add, false if delete
705 @param flags - flag NAT_ADDR_ONLY if address only mapping
706 @param ip_address - IPv4 address
707 @param protocol - IP protocol
708 @param port - port number
709 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
711 @param vfr_id - VRF ID (if ~0 use default VRF)
712 @param tag - opaque string tag
714 autoreply define nat44_add_del_identity_mapping {
718 vl_api_nat_config_flags_t flags;
719 vl_api_ip4_address_t ip_address;
722 vl_api_interface_index_t sw_if_index;
727 /** \brief Dump NAT44 identity mappings
728 @param client_index - opaque cookie to identify the sender
729 @param context - sender context, to match reply w/ request
731 define nat44_identity_mapping_dump {
736 /** \brief NAT44 identity mapping details response
737 @param context - sender context, to match reply w/ request
738 @param flags - flag NAT_ADDR_ONLY if address only mapping
739 @param ip_address - IPv4 address
740 @param protocol - IP protocol
741 @param port - port number
742 @param sw_if_index - interface
743 @param vfr_id - VRF ID
744 @param tag - opaque string tag
746 define nat44_identity_mapping_details {
748 vl_api_nat_config_flags_t flags;
749 vl_api_ip4_address_t ip_address;
752 vl_api_interface_index_t sw_if_index;
757 /** \brief Add/delete NAT44 pool address from specific interfce
758 @param client_index - opaque cookie to identify the sender
759 @param context - sender context, to match reply w/ request
760 @param is_add - true if add, false if delete
761 @param sw_if_index - software index of the interface
762 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
764 autoreply define nat44_add_del_interface_addr {
768 vl_api_interface_index_t sw_if_index;
769 vl_api_nat_config_flags_t flags;
772 /** \brief Dump NAT44 pool addresses interfaces
773 @param client_index - opaque cookie to identify the sender
774 @param context - sender context, to match reply w/ request
776 define nat44_interface_addr_dump {
781 /** \brief NAT44 pool addresses interfaces details response
782 @param context - sender context, to match reply w/ request
783 @param sw_if_index - software index of the interface
784 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
787 define nat44_interface_addr_details {
789 vl_api_interface_index_t sw_if_index;
790 vl_api_nat_config_flags_t flags;
793 /** \brief Dump NAT44 users
794 @param client_index - opaque cookie to identify the sender
795 @param context - sender context, to match reply w/ request
797 define nat44_user_dump {
802 /** \brief NAT44 users response
803 @param context - sender context, to match reply w/ request
805 @param ip_address - IPv4 address
806 @param nsessions - number of dynamic sessions
807 @param nstaticsessions - number of static sessions
809 define nat44_user_details {
812 vl_api_ip4_address_t ip_address;
817 /** \brief NAT44 user's sessions
818 @param client_index - opaque cookie to identify the sender
819 @param context - sender context, to match reply w/ request
820 @param ip_address - IPv4 address of the user to dump
821 @param vrf_id - VRF_ID
823 define nat44_user_session_dump {
826 vl_api_ip4_address_t ip_address;
830 /** \brief NAT44 user's sessions response
831 @param context - sender context, to match reply w/ request
832 @param outside_ip_address - outside IPv4 address
833 @param outside_port - outside port
834 @param inside_ip_address - inside IPv4 address
835 @param inside_port - inside port
836 @param protocol - protocol
837 @param flags - flag NAT_IS_STATIC if session is static,
838 flag NAT_IS_TWICE_NAT if session is twice-nat,
839 flag NAT_IS_EXT_HOST_VALID if external host address
841 @param last_heard - last heard timer
842 @param total_bytes - count of bytes sent through session
843 @param total_pkts - count of pakets sent through session
844 @param ext_host_address - external host IPv4 address
845 @param ext_host_port - external host port
846 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
847 only if twice-nat session)
848 @param ext_host_nat_port - post-NAT external host port (valid only if
851 define nat44_user_session_details {
853 vl_api_ip4_address_t outside_ip_address;
855 vl_api_ip4_address_t inside_ip_address;
858 vl_api_nat_config_flags_t flags;
862 vl_api_ip4_address_t ext_host_address;
864 vl_api_ip4_address_t ext_host_nat_address;
865 u16 ext_host_nat_port;
868 /** \brief NAT44 load-balancing address and port pair
869 @param addr - IPv4 address of the internal node
870 @param port - L4 port number of the internal node
871 @param probability - probability of the internal node to be randomly matched
872 @param vrf_id - VRF id
874 typeonly manual_endian define nat44_lb_addr_port {
875 vl_api_ip4_address_t addr;
881 /** \brief Add/delete NAT44 load-balancing static mapping rule
882 @param client_index - opaque cookie to identify the sender
883 @param context - sender context, to match reply w/ request
884 @param is_add - true if add, false if delete
885 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
886 flag NAT_SELF_TWICE_NAT if translate external host address
887 and port whenever external host address equals local
888 address of internal host,
889 flag NAT_OUT2IN_ONLY if rule match only out2in direction
890 @param external_addr - external IPv4 address of the service
891 @param external_port - external L4 port number of the service
892 @param protocol - IP protocol number of the service
893 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
895 @param local_num - number of local network nodes
896 @param locals - local network nodes
897 @param tag - opaque string tag
899 autoreply manual_endian define nat44_add_del_lb_static_mapping {
903 vl_api_nat_config_flags_t flags;
904 vl_api_ip4_address_t external_addr;
909 vl_api_nat44_lb_addr_port_t locals[local_num];
913 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
914 @param client_index - opaque cookie to identify the sender
915 @param context - sender context, to match reply w/ request
916 @param is_add - true if add, false if delete
917 @param external_addr - external IPv4 address of the service
918 @param external_port - external L4 port number of the service
919 @param protocol - IP protocol number of the service
920 @param local - local network node
922 autoreply define nat44_lb_static_mapping_add_del_local {
926 vl_api_ip4_address_t external_addr;
929 vl_api_nat44_lb_addr_port_t local;
932 /** \brief Dump NAT44 load-balancing static mapping rules
933 @param client_index - opaque cookie to identify the sender
934 @param context - sender context, to match reply w/ request
936 define nat44_lb_static_mapping_dump {
941 /** \brief NAT44 load-balancing static mapping rule details response
942 @param context - sender context, to match reply w/ request
943 @param external_addr - external IPv4 address of the service
944 @param external_port - external L4 port number of the service
945 @param protocol - IP protocol number of the service
946 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
947 flag NAT_SELF_TWICE_NAT if translate external host address
948 and port whenever external host address equals local
949 address of internal host,
950 flag NAT_OUT2IN_ONLY if rule match only out2in direction
951 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
953 @param local_num - number of local network nodes
954 @param locals - local network nodes
955 @param tag - opaque string tag
957 manual_endian define nat44_lb_static_mapping_details {
959 vl_api_ip4_address_t external_addr;
962 vl_api_nat_config_flags_t flags;
965 vl_api_nat44_lb_addr_port_t locals[local_num];
969 /** \brief Delete NAT44 session
970 @param client_index - opaque cookie to identify the sender
971 @param context - sender context, to match reply w/ request
972 @param ip_address - IPv4 address
973 @param protocol - IP protocol
974 @param port - port number
975 @param vfr_id - VRF ID
976 @param flags - flag NAT_IS_INSIDE if interface is inside or
977 interface is outside,
978 flag NAT_IS_EXT_HOST_VALID if external host address and
980 @param ext_host_address - external host IPv4 address
981 @param ext_host_port - external host port
983 autoreply define nat44_del_session {
986 vl_api_ip4_address_t address;
990 vl_api_nat_config_flags_t flags;
991 vl_api_ip4_address_t ext_host_address;
995 /** \brief Enable/disable forwarding for NAT44
996 Forward packets which don't match existing translation
997 or static mapping instead of dropping them.
998 @param client_index - opaque cookie to identify the sender
999 @param context - sender context, to match reply w/ request
1000 @param enable - true for enable, false for disable
1002 autoreply define nat44_forwarding_enable_disable {
1008 /** \brief Check if forwarding is enabled or disabled
1009 @param client_index - opaque cookie to identify the sender
1010 @param context - sender context, to match reply w/ request
1012 define nat44_forwarding_is_enabled {
1017 /** \brief Response to check if forwarding is enabled or disabled
1018 @param context - sender context, to match reply w/ request
1019 @param enabled - true if enabled, false if disabled
1021 define nat44_forwarding_is_enabled_reply {
1028 * Deterministic NAT (CGN) APIs
1031 /** \brief Add/delete NAT deterministic mapping
1032 @param client_index - opaque cookie to identify the sender
1033 @param context - sender context, to match reply w/ request
1034 @param is_add - true if add, false if delete
1035 @param in_addr - inside IPv4 address
1036 @param in_plen - inside IPv4 address prefix length
1037 @param out_addr - outside IPv4 address
1038 @param out_plen - outside IPv4 address prefix length
1040 autoreply define nat_det_add_del_map {
1044 vl_api_ip4_address_t in_addr;
1046 vl_api_ip4_address_t out_addr;
1050 /** \brief Get outside address and port range from inside address
1051 @param client_index - opaque cookie to identify the sender
1052 @param context - sender context, to match reply w/ request
1053 @param in_addr - inside IP address
1055 define nat_det_forward {
1058 vl_api_ip4_address_t in_addr;
1061 /** \brief Get outside address and port range from inside address
1062 @param context - sender context, to match reply w/ request
1063 @param retval - return code
1064 @param out_port_lo - outside port range start
1065 @param out_port_hi - outside port range end
1066 @param out_addr - outside IPv4 address
1068 define nat_det_forward_reply {
1073 vl_api_ip4_address_t out_addr;
1076 /** \brief Get inside address from outside address and port
1077 @param client_index - opaque cookie to identify the sender
1078 @param context - sender context, to match reply w/ request
1079 @param out_port - outside port
1080 @param out_addr - outside IPv4 address
1082 define nat_det_reverse {
1086 vl_api_ip4_address_t out_addr;
1089 /** \brief Get inside address from outside address and port reply
1090 @param context - sender context, to match reply w/ request
1091 @param retval - return code
1092 @param in_addr - inside IP address
1094 define nat_det_reverse_reply {
1097 vl_api_ip4_address_t in_addr;
1100 /** \brief Dump NAT deterministic mappings
1101 @param client_index - opaque cookie to identify the sender
1102 @param context - sender context, to match reply w/ request
1104 define nat_det_map_dump {
1109 /** \brief NAT users response
1110 @param context - sender context, to match reply w/ request
1111 @param in_addr - inside IPv4 address
1112 @param in_plen - inside IPv4 address prefix length
1113 @param out_addr - outside IPv4 address
1114 @param out_plen - outside IPv4 address prefix length
1115 @param sharing_ratio - outside to inside address sharing ratio
1116 @param ports_per_host - number of ports available to a host
1117 @param ses_num - number of sessions belonging to this mapping
1119 define nat_det_map_details {
1121 vl_api_ip4_address_t in_addr;
1123 vl_api_ip4_address_t out_addr;
1130 /** \brief Close deterministic NAT session by outside address and port
1131 @param client_index - opaque cookie to identify the sender
1132 @param context - sender context, to match reply w/ request
1133 @param out_addr - outside IPv4 address
1134 @param out_port - outside port
1135 @param ext_addr - external host IPv4 address
1136 @param ext_port - external host port
1138 autoreply define nat_det_close_session_out {
1141 vl_api_ip4_address_t out_addr;
1143 vl_api_ip4_address_t ext_addr;
1147 /** \brief Close deterministic NAT session by inside address and port
1148 @param client_index - opaque cookie to identify the sender
1149 @param context - sender context, to match reply w/ request
1150 @param in_addr - inside IP address
1151 @param in_port - inside port
1152 @param ext_addr - external host IP address
1153 @param ext_port - external host port
1155 autoreply define nat_det_close_session_in {
1158 vl_api_ip4_address_t in_addr;
1160 vl_api_ip4_address_t ext_addr;
1164 /** \brief Dump determinstic NAT sessions
1165 @param client_index - opaque cookie to identify the sender
1166 @param context - sender context, to match reply w/ request
1167 @param user_addr - address of an inside user whose sessions to dump
1169 define nat_det_session_dump {
1172 vl_api_ip4_address_t user_addr;
1175 /** \brief Deterministic NAT sessions reply
1176 @param context - sender context, to match reply w/ request
1177 @param in_port - inside port
1178 @param ext_addr - external host IPv4 address
1179 @param ext_port - external host port
1180 @param out_port - outside NAT port
1181 @param state - session state
1182 @param expire - session expiration timestamp
1184 define nat_det_session_details {
1187 vl_api_ip4_address_t ext_addr;
1198 /** \brief Add/delete address range to NAT64 pool
1199 @param client_index - opaque cookie to identify the sender
1200 @param context - sender context, to match reply w/ request
1201 @param start_addr - start IPv4 address of the range
1202 @param end_addr - end IPv4 address of the range
1203 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1204 @param is_add - true if add, false if delete
1206 autoreply define nat64_add_del_pool_addr_range {
1209 vl_api_ip4_address_t start_addr;
1210 vl_api_ip4_address_t end_addr;
1215 /** \brief Dump NAT64 pool addresses
1216 @param client_index - opaque cookie to identify the sender
1217 @param context - sender context, to match reply w/ request
1219 define nat64_pool_addr_dump {
1224 /** \brief NAT64 pool address details response
1225 @param context - sender context, to match reply w/ request
1226 @param address - IPv4 address
1227 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1229 define nat64_pool_addr_details {
1231 vl_api_ip4_address_t address;
1235 /** \brief Enable/disable NAT64 feature on the interface
1236 @param client_index - opaque cookie to identify the sender
1237 @param context - sender context, to match reply w/ request
1238 @param is_add - true if add, false if delete
1239 @param flags - flag NAT_IS_INSIDE if interface is inside else
1240 interface is outside
1241 @param sw_if_index - index of the interface
1243 autoreply define nat64_add_del_interface {
1247 vl_api_nat_config_flags_t flags;
1248 vl_api_interface_index_t sw_if_index;
1251 /** \brief Dump interfaces with NAT64 feature
1252 @param client_index - opaque cookie to identify the sender
1253 @param context - sender context, to match reply w/ request
1255 define nat64_interface_dump {
1260 /** \brief NAT64 interface details response
1261 @param context - sender context, to match reply w/ request
1262 @param flags - flag NAT_IS_INSIDE if interface is inside,
1263 flag NAT_IS_OUTSIDE if interface is outside
1264 and if both flags are set the interface is
1265 both inside and outside
1266 @param sw_if_index - index of the interface
1268 define nat64_interface_details {
1270 vl_api_nat_config_flags_t flags;
1271 vl_api_interface_index_t sw_if_index;
1274 /** \brief Add/delete NAT64 static BIB entry
1275 @param client_index - opaque cookie to identify the sender
1276 @param context - sender context, to match reply w/ request
1277 @param i_addr - inside IPv6 address
1278 @param o_addr - outside IPv4 address
1279 @param i_port - inside port number
1280 @param o_port - outside port number
1281 @param vrf_id - VRF id of tenant
1282 @param proto - protocol number
1283 @param is_add - true if add, false if delete
1285 autoreply define nat64_add_del_static_bib {
1288 vl_api_ip6_address_t i_addr;
1289 vl_api_ip4_address_t o_addr;
1297 /** \brief Dump NAT64 BIB
1298 @param client_index - opaque cookie to identify the sender
1299 @param context - sender context, to match reply w/ request
1300 @param proto - protocol of the BIB: 255 - all BIBs
1304 otherwise - "unknown" protocol BIB
1306 define nat64_bib_dump {
1312 /** \brief NAT64 BIB details response
1313 @param context - sender context, to match reply w/ request
1314 @param i_addr - inside IPv6 address
1315 @param o_addr - outside IPv4 address
1316 @param i_port - inside port number
1317 @param o_port - outside port number
1318 @param vrf_id - VRF id of tenant
1319 @param proto - protocol number
1320 @param flags - flag NAT_IS_STATIC if BIB entry is static
1321 or BIB entry is dynamic
1322 @param ses_num - number of sessions associated with the BIB entry
1324 define nat64_bib_details {
1326 vl_api_ip6_address_t i_addr;
1327 vl_api_ip4_address_t o_addr;
1332 vl_api_nat_config_flags_t flags;
1336 /** \brief Dump NAT64 session table
1337 @param client_index - opaque cookie to identify the sender
1338 @param context - sender context, to match reply w/ request
1339 @param proto - protocol of the session table: 255 - all STs
1343 otherwise - "unknown" proto ST
1345 define nat64_st_dump {
1351 /** \brief NAT64 session table details response
1352 @param context - sender context, to match reply w/ request
1353 @param il_addr - inside IPv6 address of the local host
1354 @param ol_addr - outside IPv4 address of the local host
1355 @param il_port - inside port number id of the local host/inside ICMP id
1356 @param ol_port - outside port number of the local host/outside ICMP id
1357 @param ir_addr - inside IPv6 address of the remote host
1358 @param or_addr - outside IPv4 address of the remote host
1359 @param r_port - port number of the remote host (not used for ICMP)
1360 @param vrf_id - VRF id of tenant
1361 @param proto - protocol number
1363 define nat64_st_details {
1365 vl_api_ip6_address_t il_addr;
1366 vl_api_ip4_address_t ol_addr;
1369 vl_api_ip6_address_t ir_addr;
1370 vl_api_ip4_address_t or_addr;
1376 /** \brief Add/del NAT64 prefix
1377 @param client_index - opaque cookie to identify the sender
1378 @param context - sender context, to match reply w/ request
1379 @param prefix - NAT64 prefix
1380 @param vrf_id - VRF id of tenant
1381 @param is_add - true if add, false if delete
1383 autoreply define nat64_add_del_prefix {
1386 vl_api_ip6_prefix_t prefix;
1391 /** \brief Dump NAT64 prefix
1392 @param client_index - opaque cookie to identify the sender
1393 @param context - sender context, to match reply w/ request
1395 define nat64_prefix_dump {
1400 /** \brief Dump NAT64 prefix details response
1401 @param context - sender context, to match reply w/ request
1402 @param prefix - NAT64 prefix
1403 @param vrf_id - VRF id of tenant
1405 define nat64_prefix_details {
1407 vl_api_ip6_prefix_t prefix;
1411 /** \brief Add/delete NAT64 pool address from specific interfce
1412 @param client_index - opaque cookie to identify the sender
1413 @param context - sender context, to match reply w/ request
1414 @param is_add - true if add, false if delete
1415 @param sw_if_index - software index of the interface
1417 autoreply define nat64_add_del_interface_addr {
1421 vl_api_interface_index_t sw_if_index;
1428 /** \brief Add/delete address range to DS-Lite pool
1429 @param client_index - opaque cookie to identify the sender
1430 @param context - sender context, to match reply w/ request
1431 @param start_addr - start IPv4 address of the range
1432 @param end_addr - end IPv4 address of the range
1433 @param is_add - true if add, false if delete
1435 autoreply define dslite_add_del_pool_addr_range {
1438 vl_api_ip4_address_t start_addr;
1439 vl_api_ip4_address_t end_addr;
1443 /** \brief Dump DS-Lite addresses
1444 @param client_index - opaque cookie to identify the sender
1445 @param context - sender context, to match reply w/ request
1447 define dslite_address_dump {
1452 /** \brief DS-Lite address details response
1453 @param context - sender context, to match reply w/ request
1454 @param ip_address - IPv4 address
1456 define dslite_address_details {
1458 vl_api_ip4_address_t ip_address;
1461 /** \brief Set AFTR IPv6 and IPv4 addresses
1462 @param client_index - opaque cookie to identify the sender
1463 @param context - sender context, to match reply w/ request
1464 @param ip4_addr - IPv4 address
1465 @param ip6_addr - IPv6 address
1467 autoreply define dslite_set_aftr_addr {
1470 vl_api_ip4_address_t ip4_addr;
1471 vl_api_ip6_address_t ip6_addr;
1474 /** \brief Get AFTR IPv6 and IPv4 addresses
1475 @param client_index - opaque cookie to identify the sender
1476 @param context - sender context, to match reply w/ request
1478 define dslite_get_aftr_addr {
1483 /** \brief Response to get AFTR IPv6 and IPv4 addresses
1484 @param context - sender context, to match reply w/ request
1485 @param retval - return code
1486 @param ip4_addr - IPv4 address
1487 @param ip6_addr - IPv6 address
1489 define dslite_get_aftr_addr_reply {
1492 vl_api_ip4_address_t ip4_addr;
1493 vl_api_ip6_address_t ip6_addr;
1496 /** \brief Set B4 IPv6 and IPv4 addresses
1497 @param client_index - opaque cookie to identify the sender
1498 @param context - sender context, to match reply w/ request
1499 @param ip4_addr - IPv4 address
1500 @param ip6_addr - IPv6 address
1502 autoreply define dslite_set_b4_addr {
1505 vl_api_ip4_address_t ip4_addr;
1506 vl_api_ip6_address_t ip6_addr;
1509 /** \brief Get B4 IPv6 and IPv4 addresses
1510 @param client_index - opaque cookie to identify the sender
1511 @param context - sender context, to match reply w/ request
1513 define dslite_get_b4_addr {
1518 /** \brief Response to get B4 IPv6 and IPv4 addresses
1519 @param context - sender context, to match reply w/ request
1520 @param retval - return code
1521 @param ip4_addr - IPv4 address
1522 @param ip6_addr - IPv6 address
1524 define dslite_get_b4_addr_reply {
1527 vl_api_ip4_address_t ip4_addr;
1528 vl_api_ip6_address_t ip6_addr;
1534 /** \brief Enable/disable NAT66 feature on the interface
1535 @param client_index - opaque cookie to identify the sender
1536 @param context - sender context, to match reply w/ request
1537 @param is_add - true if add, false if delete
1538 @param flags - flag NAT_IS_INSIDE if interface is inside or
1539 interface is outside,
1540 @param sw_if_index - software index of the interface
1542 autoreply define nat66_add_del_interface {
1546 vl_api_nat_config_flags_t flags;
1547 vl_api_interface_index_t sw_if_index;
1550 /** \brief Dump interfaces with NAT66 feature
1551 @param client_index - opaque cookie to identify the sender
1552 @param context - sender context, to match reply w/ request
1554 define nat66_interface_dump {
1559 /** \brief NAT66 interface details response
1560 @param context - sender context, to match reply w/ request
1561 @param flags - flag NAT_IS_INSIDE if interface is inside or
1562 interface is outside,
1563 @param sw_if_index - software index of the interface
1565 define nat66_interface_details {
1567 vl_api_nat_config_flags_t flags;
1568 vl_api_interface_index_t sw_if_index;
1571 /** \brief Add/delete 1:1 NAT66
1572 @param client_index - opaque cookie to identify the sender
1573 @param context - sender context, to match reply w/ request
1574 @param is_add - true if add, false if delete
1575 @param local_ip_address - local IPv6 address
1576 @param external_ip_address - external IPv6 address
1577 @param vrf_id - VRF id of tenant
1579 autoreply define nat66_add_del_static_mapping {
1583 vl_api_ip6_address_t local_ip_address;
1584 vl_api_ip6_address_t external_ip_address;
1588 /** \brief Dump NAT66 static mappings
1589 @param client_index - opaque cookie to identify the sender
1590 @param context - sender context, to match reply w/ request
1592 define nat66_static_mapping_dump {
1597 /** \brief NAT66 static mapping details response
1598 @param context - sender context, to match reply w/ request
1599 @param local_ip_address - local IPv6 address
1600 @param external_ip_address - external IPv6 address
1601 @param vrf_id - VRF id of tenant
1602 @param total_bytes - count of bytes sent through static mapping
1603 @param total_pkts - count of pakets sent through static mapping
1605 define nat66_static_mapping_details {
1607 vl_api_ip6_address_t local_ip_address;
1608 vl_api_ip6_address_t external_ip_address;