2 * Copyright (c) 2020 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 option version = "5.5.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/lib/nat_types.api";
23 * @brief VPP control-plane API messages.
25 * This file defines VPP control-plane API messages which are generally
26 * called through a shared memory interface.
29 enum nat44_config_flags : u8
31 NAT44_IS_ENDPOINT_INDEPENDENT = 0x00,
32 NAT44_IS_ENDPOINT_DEPENDENT = 0x01,
33 NAT44_IS_STATIC_MAPPING_ONLY = 0x02,
34 NAT44_IS_CONNECTION_TRACKING = 0x04,
35 NAT44_IS_OUT2IN_DPO = 0x08,
38 /** \brief Enable/disable NAT44ED plugin
39 @param client_index - opaque cookie to identify the sender
40 @param context - sender context, to match reply w/ request
41 @param inside_vrf - inside vrf id
42 @param outside_vrf - outside vrf id
43 @param sessions - maximum number of sessions per thread
44 @param session_memory - overwrite hash allocation parameter
45 @param enable - true if enable, false if disable
46 @param flags - flag NAT44_IS_STATIC_MAPPING_ONLY,
47 NAT44_IS_CONNECTION_TRACKING
49 autoreply define nat44_ed_plugin_enable_disable {
57 vl_api_nat44_config_flags_t flags;
60 /** \brief Enable/disable forwarding for NAT44
61 Forward packets which don't match existing translation
62 or static mapping instead of dropping them.
63 @param client_index - opaque cookie to identify the sender
64 @param context - sender context, to match reply w/ request
65 @param enable - true for enable, false for disable
67 autoreply define nat44_forwarding_enable_disable {
74 /** \brief Enable/disable NAT IPFIX logging
75 @param client_index - opaque cookie to identify the sender
76 @param context - sender context, to match reply w/ request
77 @param domain_id - observation domain ID
78 @param src_port - source port number
79 @param enable - true if enable, false if disable
81 autoreply define nat_ipfix_enable_disable {
90 /** \brief Set values of timeouts for NAT sessions (seconds)
91 @param client_index - opaque cookie to identify the sender
92 @param context - sender context, to match reply w/ request
93 @param udp - UDP timeout (default 300sec)
94 @param tcp_established - TCP established timeout (default 7440sec)
95 @param tcp_transitory - TCP transitory timeout (default 240sec)
96 @param icmp - ICMP timeout (default 60sec)
98 autoreply define nat_set_timeouts {
108 /** \brief NAT44 set session limit
109 @param client_index - opaque cookie to identify the sender
110 @param context - sender context, to match reply w/ request
111 @param session_limit - session limit
112 @param vrf_id - vrf id
114 autoreply define nat44_set_session_limit {
121 /** \brief Show NAT44 plugin running config
122 @param client_index - opaque cookie to identify the sender
123 @param context - sender context, to match reply w/ request
125 define nat44_show_running_config
131 /** \brief Show NAT44 plugin running config reply
132 @param context - sender context, to match reply w/ request
133 @param retval - return code for the request
134 @param inside_vrf - default inside VRF id
135 @param outside_vrf - outside VRF id
136 @param users - maximum number of users per worker thread
137 (NAT44_IS_ENDPOINT_INDEPENDENT)
138 @param sessions - maximum number of sessions per worker thread
139 @param user_sessions - maximum number of sessions per user
140 (NAT44_IS_ENDPOINT_INDEPENDENT)
141 @param user_buckets - number of user hash buckets
142 (NAT44_IS_ENDPOINT_INDEPENDENT)
143 @param translation_buckets - number of translation hash buckets
144 @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
145 NAT44_IS_ENDPOINT_DEPENDENT,
146 NAT44_IS_STATIC_MAPPING_ONLY,
147 NAT44_IS_CONNECTION_TRACKING,
150 define nat44_show_running_config_reply
160 u32 translation_buckets;
161 bool forwarding_enabled;
162 bool ipfix_logging_enabled;
163 vl_api_nat_timeouts_t timeouts;
164 vl_api_nat_log_level_t log_level;
165 vl_api_nat44_config_flags_t flags;
168 /** \brief Set NAT workers
169 @param client_index - opaque cookie to identify the sender
170 @param context - sender context, to match reply w/ request
171 @param worker_mask - NAT workers mask
173 autoreply define nat_set_workers {
179 /** \brief Dump NAT workers
180 @param client_index - opaque cookie to identify the sender
181 @param context - sender context, to match reply w/ request
183 define nat_worker_dump {
188 /** \brief NAT workers details response
189 @param context - sender context, to match reply w/ request
190 @param worker_index - worker index
191 @param lcore_id - lcore ID
192 @param name - worker name
194 define nat_worker_details {
201 /** \brief Add/delete inter VRF NAT44-ED routing table
202 @param client_index - opaque cookie to identify the sender
203 @param context - sender context, to match reply w/ request
204 @param table_vrf_id - id of (rx) VRF used for resolving
205 destination (tx) VRF during dynamic
207 @param is_add - if true add else del
209 autoreply define nat44_ed_add_del_vrf_table {
216 /** \brief Add/del inter VRF NAT44-ED route record
217 @param client_index - opaque cookie to identify the sender
218 @param context - sender context, to match reply w/ request
219 @param table_vrf_id - id of the VRF NAT routing table
220 @param vrf_id - id of resolving destination (tx) VRF table
221 @param is_add - if true add else del
223 autoreply define nat44_ed_add_del_vrf_route {
231 /** \brief Dump NAT44-ED inter VRF NAT routing tables
232 @param client_index - opaque cookie to identify the sender
233 @param context - sender context, to match reply w/ request
235 define nat44_ed_vrf_tables_dump {
240 /** \brief NAT44-ED inter VRF NAT routing table details response
241 @param context - sender context, to match reply w/ request
242 @param table_vrf_id - id of the VRF NAT routing table
243 @param n_vrf_ids - number of vrf_ids
244 @param vrf_ids - ids of resolving destination (tx) VRFs
246 define nat44_ed_vrf_tables_details {
250 u32 vrf_ids[n_vrf_ids];
253 /** \brief Set TCP MSS rewriting configuration
254 @param client_index - opaque cookie to identify the sender
255 @param context - sender context, to match reply w/ request
256 @param mss_value - MSS value to be used for MSS rewriting
257 @param enable - if true enable MSS rewriting feature else disable
259 autoreply define nat_set_mss_clamping {
266 /** \brief Get TCP MSS rewriting configuration
267 @param client_index - opaque cookie to identify the sender
268 @param context - sender context, to match reply w/ request
270 define nat_get_mss_clamping {
275 /** \brief Get TCP MSS rewriting configuration reply
276 @param context - sender context, to match reply w/ request
277 @param retval - return code
278 @param mss_value - MSS value to be used for MSS rewriting
279 @param enable - if true enable MSS rewriting feature else disable
281 define nat_get_mss_clamping_reply {
288 /** \brief Set NAT handoff frame queue options
289 @param client_index - opaque cookie to identify the sender
290 @param context - sender context, to match reply w/ request
291 @param frame_queue_nelts - number of worker handoff frame queue elements
293 autoreply define nat44_ed_set_fq_options {
296 u32 frame_queue_nelts;
299 /** \brief Show NAT handoff frame queue options
300 @param client_index - opaque cookie to identify the sender
301 @param context - sender context, to match reply w/ request
303 define nat44_ed_show_fq_options
309 /** \brief Show NAT handoff frame queue options reply
310 @param context - sender context, to match reply w/ request
311 @param retval - return code for the request
312 @param frame_queue_nelts - number of worker handoff frame queue elements
314 define nat44_ed_show_fq_options_reply
318 u32 frame_queue_nelts;
321 /** \brief Add/delete NAT44 pool address from specific interfce
322 @param client_index - opaque cookie to identify the sender
323 @param context - sender context, to match reply w/ request
324 @param is_add - true if add, false if delete
325 @param sw_if_index - software index of the interface
326 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
328 autoreply define nat44_add_del_interface_addr {
332 vl_api_interface_index_t sw_if_index;
333 vl_api_nat_config_flags_t flags;
336 /** \brief Dump NAT44 pool addresses interfaces
337 @param client_index - opaque cookie to identify the sender
338 @param context - sender context, to match reply w/ request
340 define nat44_interface_addr_dump {
345 /** \brief NAT44 pool addresses interfaces details response
346 @param context - sender context, to match reply w/ request
347 @param sw_if_index - software index of the interface
348 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
351 define nat44_interface_addr_details {
353 vl_api_interface_index_t sw_if_index;
354 vl_api_nat_config_flags_t flags;
357 /** \brief Add/del NAT44 address range
358 @param client_index - opaque cookie to identify the sender
359 @param context - sender context, to match reply w/ request
360 @param first_ip_address - first IPv4 address
361 @param last_ip_address - last IPv4 address
362 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
363 @param is_add - true if add, false if delete
364 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
367 autoreply define nat44_add_del_address_range {
370 vl_api_ip4_address_t first_ip_address;
371 vl_api_ip4_address_t last_ip_address;
374 vl_api_nat_config_flags_t flags;
377 /** \brief Dump NAT44 addresses
378 @param client_index - opaque cookie to identify the sender
379 @param context - sender context, to match reply w/ request
381 define nat44_address_dump {
386 /** \brief NAT44 address details response
387 @param context - sender context, to match reply w/ request
388 @param ip_address - IPv4 address
389 @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
390 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
392 define nat44_address_details {
394 vl_api_ip4_address_t ip_address;
395 vl_api_nat_config_flags_t flags;
399 /** \brief Enable/disable NAT44 feature on the interface
400 @param client_index - opaque cookie to identify the sender
401 @param context - sender context, to match reply w/ request
402 @param is_add - true if add, false if delete
403 @param flags - flag NAT_IS_INSIDE if interface is inside else
405 @param sw_if_index - software index of the interface
407 autoreply define nat44_interface_add_del_feature {
411 vl_api_nat_config_flags_t flags;
412 vl_api_interface_index_t sw_if_index;
415 /** \brief Dump interfaces with NAT44 feature
416 @param client_index - opaque cookie to identify the sender
417 @param context - sender context, to match reply w/ request
419 define nat44_interface_dump {
424 /** \brief NAT44 interface details response
425 @param context - sender context, to match reply w/ request
426 @param sw_if_index - software index of the interface
427 @param flags - flag NAT_IS_INSIDE if interface is inside,
428 flag NAT_IS_OUTSIDE if interface is outside
429 and if both flags are set the interface is
430 both inside and outside
432 define nat44_interface_details {
434 vl_api_nat_config_flags_t flags;
435 vl_api_interface_index_t sw_if_index;
438 /** \brief add/del NAT output interface (postrouting
440 @param client_index - opaque cookie to identify the sender
441 @param context - sender context, to match reply w/ request
442 @param is_add - true if add, false if delete
443 @param sw_if_index - software index of the interface
445 autoendian autoreply define nat44_ed_add_del_output_interface {
449 vl_api_interface_index_t sw_if_index;
453 rpc nat44_ed_output_interface_get returns nat44_ed_output_interface_get_reply
454 stream nat44_ed_output_interface_details;
457 define nat44_ed_output_interface_get
464 define nat44_ed_output_interface_get_reply
471 define nat44_ed_output_interface_details
474 vl_api_interface_index_t sw_if_index;
477 /** \brief Add/delete NAT44 static mapping
478 @param client_index - opaque cookie to identify the sender
479 @param context - sender context, to match reply w/ request
480 @param is_add - true if add, false if delete
481 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
482 flag nat_is_twice_nat if nat address range for external hosts,
483 flag NAT_IS_SELF_TWICE_NAT if translate external host address
484 and port whenever external host address equals local
485 address of internal host,
486 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
487 @param local_ip_address - local IPv4 address
488 @param external_ip_address - external IPv4 address
489 @param protocol - IP protocol, used only if addr_only=0
490 @param local_port - local port number, used only if addr_only=0
491 @param external_port - external port number, used only if addr_only=0
492 @param external_sw_if_index - external interface (if set
493 external_ip_address is ignored, ~0 means not
495 @param vfr_id - VRF ID
496 @param tag - opaque string tag
498 autoreply define nat44_add_del_static_mapping {
502 vl_api_nat_config_flags_t flags;
503 vl_api_ip4_address_t local_ip_address;
504 vl_api_ip4_address_t external_ip_address;
508 vl_api_interface_index_t external_sw_if_index;
513 /** \brief Add/delete NAT44 static mapping
514 @param client_index - opaque cookie to identify the sender
515 @param context - sender context, to match reply w/ request
516 @param is_add - true if add, false if delete
517 @param match_pool - true if use specific pool_ip_address
518 @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
519 flag nat_is_twice_nat if nat address range for external hosts,
520 flag NAT_IS_SELF_TWICE_NAT if translate external host address
521 and port whenever external host address equals local
522 address of internal host,
523 flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
524 @param pool_ip_address - pool IPv4 address to match with pool
525 @param local_ip_address - local IPv4 address
526 @param external_ip_address - external IPv4 address
527 @param protocol - IP protocol, used only if addr_only=0
528 @param local_port - local port number, used only if addr_only=0
529 @param external_port - external port number, used only if addr_only=0
530 @param external_sw_if_index - external interface (if set
531 external_ip_address is ignored, ~0 means not
533 @param vfr_id - VRF ID
534 @param tag - opaque string tag
536 autoreply define nat44_add_del_static_mapping_v2 {
541 vl_api_nat_config_flags_t flags;
542 vl_api_ip4_address_t pool_ip_address;
543 vl_api_ip4_address_t local_ip_address;
544 vl_api_ip4_address_t external_ip_address;
548 vl_api_interface_index_t external_sw_if_index;
553 /** \brief Dump NAT44 static mappings
554 @param client_index - opaque cookie to identify the sender
555 @param context - sender context, to match reply w/ request
557 define nat44_static_mapping_dump {
562 /** \brief NAT44 static mapping details response
563 @param context - sender context, to match reply w/ request
564 @param flags - flag NAT_ADDR_ONLY if address only mapping,
565 flag NAT_TWICE_NAT if NAT address range for external hosts,
566 flag NAT_SELF_TWICE_NAT if translate external host address
567 and port whenever external host address equals local
568 address of internal host,
569 flag NAT_OUT2IN_ONLY if rule match only out2in direction
570 @param local_ip_address - local IPv4 address
571 @param external_ip_address - external IPv4 address
572 @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
573 @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
574 @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
575 @param external_sw_if_index - external interface
576 @param vfr_id - VRF ID
577 @param tag - opaque string tag
579 define nat44_static_mapping_details {
581 vl_api_nat_config_flags_t flags;
582 vl_api_ip4_address_t local_ip_address;
583 vl_api_ip4_address_t external_ip_address;
587 vl_api_interface_index_t external_sw_if_index;
592 /** \brief Add/delete NAT44 identity mapping
593 @param client_index - opaque cookie to identify the sender
594 @param context - sender context, to match reply w/ request
595 @param is_add - true if add, false if delete
596 @param flags - flag NAT_ADDR_ONLY if address only mapping
597 @param ip_address - IPv4 address
598 @param protocol - IP protocol
599 @param port - port number
600 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
602 @param vfr_id - VRF ID (if ~0 use default VRF)
603 @param tag - opaque string tag
605 autoreply define nat44_add_del_identity_mapping {
609 vl_api_nat_config_flags_t flags;
610 vl_api_ip4_address_t ip_address;
613 vl_api_interface_index_t sw_if_index;
618 /** \brief Dump NAT44 identity mappings
619 @param client_index - opaque cookie to identify the sender
620 @param context - sender context, to match reply w/ request
622 define nat44_identity_mapping_dump {
627 /** \brief NAT44 identity mapping details response
628 @param context - sender context, to match reply w/ request
629 @param flags - flag NAT_ADDR_ONLY if address only mapping
630 @param ip_address - IPv4 address
631 @param protocol - IP protocol
632 @param port - port number
633 @param sw_if_index - interface
634 @param vfr_id - VRF ID
635 @param tag - opaque string tag
637 define nat44_identity_mapping_details {
639 vl_api_nat_config_flags_t flags;
640 vl_api_ip4_address_t ip_address;
643 vl_api_interface_index_t sw_if_index;
648 /** \brief NAT44 load-balancing address and port pair
649 @param addr - IPv4 address of the internal node
650 @param port - L4 port number of the internal node
651 @param probability - probability of the internal node to be randomly matched
652 @param vrf_id - VRF id
654 typedef nat44_lb_addr_port {
655 vl_api_ip4_address_t addr;
661 /** \brief Add/delete NAT44 load-balancing static mapping rule
662 @param client_index - opaque cookie to identify the sender
663 @param context - sender context, to match reply w/ request
664 @param is_add - true if add, false if delete
665 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
666 flag NAT_SELF_TWICE_NAT if translate external host address
667 and port whenever external host address equals local
668 address of internal host,
669 flag NAT_OUT2IN_ONLY if rule match only out2in direction
670 @param external_addr - external IPv4 address of the service
671 @param external_port - external L4 port number of the service
672 @param protocol - IP protocol number of the service
673 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
675 @param local_num - number of local network nodes
676 @param locals - local network nodes
677 @param tag - opaque string tag
679 autoreply define nat44_add_del_lb_static_mapping {
683 vl_api_nat_config_flags_t flags;
684 vl_api_ip4_address_t external_addr;
690 vl_api_nat44_lb_addr_port_t locals[local_num];
693 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
694 @param client_index - opaque cookie to identify the sender
695 @param context - sender context, to match reply w/ request
696 @param is_add - true if add, false if delete
697 @param external_addr - external IPv4 address of the service
698 @param external_port - external L4 port number of the service
699 @param protocol - IP protocol number of the service
700 @param local - local network node
702 autoreply define nat44_lb_static_mapping_add_del_local {
706 vl_api_ip4_address_t external_addr;
709 vl_api_nat44_lb_addr_port_t local;
712 /** \brief Dump NAT44 load-balancing static mapping rules
713 @param client_index - opaque cookie to identify the sender
714 @param context - sender context, to match reply w/ request
716 define nat44_lb_static_mapping_dump {
721 /** \brief NAT44 load-balancing static mapping rule details response
722 @param context - sender context, to match reply w/ request
723 @param external_addr - external IPv4 address of the service
724 @param external_port - external L4 port number of the service
725 @param protocol - IP protocol number of the service
726 @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
727 flag NAT_SELF_TWICE_NAT if translate external host address
728 and port whenever external host address equals local
729 address of internal host,
730 flag NAT_OUT2IN_ONLY if rule match only out2in direction
731 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
733 @param local_num - number of local network nodes
734 @param locals - local network nodes
735 @param tag - opaque string tag
737 define nat44_lb_static_mapping_details {
739 vl_api_ip4_address_t external_addr;
742 vl_api_nat_config_flags_t flags;
746 vl_api_nat44_lb_addr_port_t locals[local_num];
749 /** \brief Delete NAT44 session
750 @param client_index - opaque cookie to identify the sender
751 @param context - sender context, to match reply w/ request
752 @param ip_address - IPv4 address
753 @param protocol - IP protocol
754 @param port - port number
755 @param vfr_id - VRF ID
756 @param flags - flag NAT_IS_INSIDE if interface is inside or
757 interface is outside,
758 flag NAT_IS_EXT_HOST_VALID if external host address and
760 @param ext_host_address - external host IPv4 address
761 @param ext_host_port - external host port
763 autoreply define nat44_del_session {
766 vl_api_ip4_address_t address;
770 vl_api_nat_config_flags_t flags;
771 vl_api_ip4_address_t ext_host_address;
775 /** \brief Dump NAT44 users
776 @param client_index - opaque cookie to identify the sender
777 @param context - sender context, to match reply w/ request
779 define nat44_user_dump {
784 /** \brief NAT44 users response
785 @param context - sender context, to match reply w/ request
787 @param ip_address - IPv4 address
788 @param nsessions - number of dynamic sessions
789 @param nstaticsessions - number of static sessions
791 define nat44_user_details {
794 vl_api_ip4_address_t ip_address;
799 /** \brief NAT44 user's sessions
800 @param client_index - opaque cookie to identify the sender
801 @param context - sender context, to match reply w/ request
802 @param ip_address - IPv4 address of the user to dump
803 @param vrf_id - VRF_ID
805 define nat44_user_session_dump {
808 vl_api_ip4_address_t ip_address;
812 /** \brief NAT44 user's sessions response
813 @param context - sender context, to match reply w/ request
814 @param outside_ip_address - outside IPv4 address
815 @param outside_port - outside port
816 @param inside_ip_address - inside IPv4 address
817 @param inside_port - inside port
818 @param protocol - protocol
819 @param flags - flag NAT_IS_STATIC if session is static,
820 flag NAT_IS_TWICE_NAT if session is twice-nat,
821 flag NAT_IS_EXT_HOST_VALID if external host address
823 @param last_heard - last heard timer
824 @param total_bytes - count of bytes sent through session
825 @param total_pkts - count of pakets sent through session
826 @param ext_host_address - external host IPv4 address
827 @param ext_host_port - external host port
828 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
829 only if twice-nat session)
830 @param ext_host_nat_port - post-NAT external host port (valid only if
833 define nat44_user_session_details {
835 vl_api_ip4_address_t outside_ip_address;
837 vl_api_ip4_address_t inside_ip_address;
840 vl_api_nat_config_flags_t flags;
844 vl_api_ip4_address_t ext_host_address;
846 vl_api_ip4_address_t ext_host_nat_address;
847 u16 ext_host_nat_port;
850 /** \brief NAT44 user's sessions
851 @param client_index - opaque cookie to identify the sender
852 @param context - sender context, to match reply w/ request
853 @param ip_address - IPv4 address of the user to dump
854 @param vrf_id - VRF_ID
856 define nat44_user_session_v2_dump {
859 vl_api_ip4_address_t ip_address;
863 /** \brief NAT44 user's sessions response
864 @param context - sender context, to match reply w/ request
865 @param outside_ip_address - outside IPv4 address
866 @param outside_port - outside port
867 @param inside_ip_address - inside IPv4 address
868 @param inside_port - inside port
869 @param protocol - protocol
870 @param flags - flag NAT_IS_STATIC if session is static,
871 flag NAT_IS_TWICE_NAT if session is twice-nat,
872 flag NAT_IS_EXT_HOST_VALID if external host address
874 @param last_heard - last heard timer
875 @param total_bytes - count of bytes sent through session
876 @param total_pkts - count of pakets sent through session
877 @param ext_host_address - external host IPv4 address
878 @param ext_host_port - external host port
879 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
880 only if twice-nat session)
881 @param ext_host_nat_port - post-NAT external host port (valid only if
883 @param is_timed_out - true, if session is timed out, and false, if session
886 define nat44_user_session_v2_details {
888 vl_api_ip4_address_t outside_ip_address;
890 vl_api_ip4_address_t inside_ip_address;
893 vl_api_nat_config_flags_t flags;
897 vl_api_ip4_address_t ext_host_address;
899 vl_api_ip4_address_t ext_host_nat_address;
900 u16 ext_host_nat_port;
904 // DEPRECATED, obsolete messages completely unsupported
906 /** \brief Del NAT44 user
907 @param client_index - opaque cookie to identify the sender
908 @param context - sender context, to match reply w/ request
909 @param ip_address - IPv4 address
910 @param fib_index - FIB index
912 autoreply define nat44_del_user {
916 vl_api_ip4_address_t ip_address;
920 /** \brief Set address and port assignment algorithm
921 @param client_index - opaque cookie to identify the sender
922 @param context - sender context, to match reply w/ request
923 @param alg - address and port assignment algorithm:
924 0 - default, 1 - MAP-E, 2 - port range
925 (see nat_addr_and_port_alloc_alg_t in nat.h)
926 @param psid_offset - number of offset bits (valid only for MAP-E alg)
927 @param psid_length - length of PSID (valid only for MAP-E alg)
928 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
929 @param start_port - beginning of the port range
930 @param end_port - end of the port range
932 autoreply define nat_set_addr_and_port_alloc_alg {
944 /** \brief Get address and port assignment algorithm
945 @param client_index - opaque cookie to identify the sender
946 @param context - sender context, to match reply w/ request
948 define nat_get_addr_and_port_alloc_alg {
954 /** \brief Get address and port assignment algorithm reply
955 @param context - sender context, to match reply w/ request
956 @param retval - return code
957 @param alg - address and port assignment algorithm:
958 0 - default, 1 - MAP-E, 2 - port range
959 (see nat_addr_and_port_alloc_alg_t in nat.h)
960 @param psid_offset - number of offset bits (valid only for MAP-E alg)
961 @param psid_length - length of PSID (valid only for MAP-E alg)
962 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
963 @param start_port - beginning of the port range
964 @param end_port - end of the port range
966 define nat_get_addr_and_port_alloc_alg_reply {
978 /** \brief Set HA listener (local settings)
979 @param client_index - opaque cookie to identify the sender
980 @param context - sender context, to match reply w/ request
981 @param ip_address - local IP4 address
982 @param port - local UDP port number
983 @param path_mtu - path MTU between local and failover
985 autoreply define nat_ha_set_listener {
989 vl_api_ip4_address_t ip_address;
994 /** \brief Set HA failover (remote settings)
995 @param client_index - opaque cookie to identify the sender
996 @param context - sender context, to match reply w/ request
997 @param ip_address - failover IP4 address
998 @param port - failvoer UDP port number
999 @param session_refresh_interval - number of seconds after which to send
1000 session counters refresh
1002 autoreply define nat_ha_set_failover {
1006 vl_api_ip4_address_t ip_address;
1008 u32 session_refresh_interval;
1011 /** \brief Get HA listener/local configuration
1012 @param client_index - opaque cookie to identify the sender
1013 @param context - sender context, to match reply w/ request
1015 define nat_ha_get_listener {
1021 /** \brief Get HA listener/local configuration reply
1022 @param context - sender context, to match reply w/ request
1023 @param retval - return code
1024 @param ip_address - local IP4 address
1025 @param port - local UDP port number
1026 @param path_mtu - Path MTU between local and failover
1028 define nat_ha_get_listener_reply {
1032 vl_api_ip4_address_t ip_address;
1037 /** \brief Get HA failover/remote settings
1038 @param client_index - opaque cookie to identify the sender
1039 @param context - sender context, to match reply w/ request
1041 define nat_ha_get_failover {
1047 /** \brief Get HA failover/remote settings reply
1048 @param context - sender context, to match reply w/ request
1049 @param retval - return code
1050 @param ip_address - failover IP4 address
1051 @param port - failvoer UDP port number
1052 @param session_refresh_interval - number of seconds after which to send
1053 session counters refresh
1055 define nat_ha_get_failover_reply {
1059 vl_api_ip4_address_t ip_address;
1061 u32 session_refresh_interval;
1064 /** \brief Flush the current HA data (for testing)
1065 @param client_index - opaque cookie to identify the sender
1066 @param context - sender context, to match reply w/ request
1068 autoreply define nat_ha_flush {
1074 /** \brief Resync HA (resend existing sessions to new failover)
1075 @param client_index - opaque cookie to identify the sender
1076 @param context - sender context, to match reply w/ request
1077 @param want_resync_event - resync completed event sent to the sender via
1078 nat_ha_resync_completed_event API message if
1080 @param pid - sender's pid
1082 autoreply define nat_ha_resync
1087 u8 want_resync_event;
1091 /** \brief Tell client about a HA resync completion event
1092 @param client_index - opaque cookie to identify the sender
1093 @param pid - client pid registered to receive notification
1094 @param missed_count - number of missed (not ACKed) messages
1096 define nat_ha_resync_completed_event
1105 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;