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 = "4.1.0";
17 import "vnet/ip/ip_types.api";
21 * @brief VPP control-plane API messages.
23 * This file defines VPP control-plane API messages which are generally
24 * called through a shared memory interface.
28 * Common NAT plugin APIs
31 /** \brief Control ping from client to api server request
32 @param client_index - opaque cookie to identify the sender
33 @param context - sender context, to match reply w/ request
35 define nat_control_ping
41 /** \brief Control ping from the client to the server response
42 @param client_index - opaque cookie to identify the sender
43 @param context - sender context, to match reply w/ request
44 @param retval - return code for the request
45 @param vpe_pid - the pid of the vpe, returned by the server
47 define nat_control_ping_reply
55 /** \brief Show NAT plugin startup config
56 @param client_index - opaque cookie to identify the sender
57 @param context - sender context, to match reply w/ request
59 define nat_show_config
65 /** \brief Show NAT plugin startup config reply
66 @param context - sender context, to match reply w/ request
67 @param retval - return code for the request
68 @param static_mapping_only - if 1 dynamic translations disabled
69 @param static_mapping_connection_tracking - if 1 create session data
70 @param deterministic - if 1 deterministic mapping
71 @param endpoint_dependent - if 1 endpoint-dependent mode
72 @param out2in_dpo - if 1 out2in dpo mode
73 @param translation_buckets - number of translation hash buckets
74 @param translation_memory_size - translation hash memory size
75 @param user_buckets - number of user hash buckets
76 @param user_memory_size - user hash memory size
77 @param max_translations_per_user - maximum number of translations per user
78 @param outside_vrf_id - outside VRF id
79 @param inside_vrf_id - default inside VRF id
80 @param dslite_ce - if DS-Lite is CE/B4 element, if 0 AFTR elemet
81 @param nat64_bib_buckets - number of NAT64 BIB hash buckets
82 @param nat64_bib_memory_size - memory size of NAT64 BIB hash
83 @param nat64_st_buckets - number of NAT64 session table hash buckets
84 @param nat64_st_memory_size - memory size of NAT64 session table hash
86 define nat_show_config_reply
90 u8 static_mapping_only;
91 u8 static_mapping_connection_tracking;
93 u8 endpoint_dependent;
95 u32 translation_buckets;
96 u32 translation_memory_size;
99 u32 max_translations_per_user;
103 u32 nat64_bib_buckets;
104 u32 nat64_bib_memory_size;
105 u32 nat64_st_buckets;
106 u32 nat64_st_memory_size;
109 /** \brief Set NAT workers
110 @param client_index - opaque cookie to identify the sender
111 @param context - sender context, to match reply w/ request
112 @param worker_mask - NAT workers mask
114 autoreply define nat_set_workers {
120 /** \brief Dump NAT workers
121 @param client_index - opaque cookie to identify the sender
122 @param context - sender context, to match reply w/ request
124 define nat_worker_dump {
129 /** \brief NAT workers details response
130 @param context - sender context, to match reply w/ request
131 @param worker_index - worker index
132 @param lcore_id - lcore ID
133 @param name - worker name
135 define nat_worker_details {
142 /** \brief Enable/disable NAT IPFIX logging
143 @param client_index - opaque cookie to identify the sender
144 @param context - sender context, to match reply w/ request
145 @param domain_id - observation domain ID
146 @param src_port - source port number
147 @param enable - 1 if enable, 0 if disable
149 autoreply define nat_ipfix_enable_disable {
157 /** \brief Set NAT virtual fragmentation reassembly
158 @param client_index - opaque cookie to identify the sender
159 @param context - sender context, to match reply w/ request
160 @param timeout - reassembly timeout
161 @param max_reass - maximum number of concurrent reassemblies
162 @param max_frag - maximum number of fragmets per reassembly
163 @param drop_frag - if 0 translate fragments, otherwise drop fragments
164 @param is_ip6 - 1 if IPv6, 0 if IPv4
166 autoreply define nat_set_reass {
176 /** \brief Get NAT virtual fragmentation reassembly configuration
177 @param client_index - opaque cookie to identify the sender
178 @param context - sender context, to match reply w/ request
180 define nat_get_reass {
185 /** \brief Get NAT virtual fragmentation reassembly configuration reply
186 @param context - sender context, to match reply w/ request
187 @param retval - return code
188 @param ip4_timeout - reassembly timeout
189 @param ip4_max_reass - maximum number of concurrent reassemblies
190 @param ip4_max_frag - maximum number of fragmets per reassembly
191 @param ip4_drop_frag - if 0 translate fragments, otherwise drop fragments
192 @param ip6_timeout - reassembly timeout
193 @param ip6_max_reass - maximum number of concurrent reassemblies
194 @param ip6_max_frag - maximum number of fragmets per reassembly
195 @param ip6_drop_frag - if 0 translate fragments, otherwise drop fragments
197 define nat_get_reass_reply {
210 /** \brief Dump NAT virtual fragmentation reassemblies
211 @param client_index - opaque cookie to identify the sender
212 @param context - sender context, to match reply w/ request
214 define nat_reass_dump {
219 /** \brief NAT virtual fragmentation reassemblies response
220 @param context - sender context, to match reply w/ request
221 @param is_ip4 - 1 if address type is IPv4
222 @param src_addr - source IP address
223 @param dst_addr - destination IP address
224 @param frag_id - fragment ID
225 @param proto - protocol
226 @param frag_n - number of cached fragments
228 define nat_reass_details {
238 /** \brief Set values of timeouts for NAT sessions (seconds)
239 @param client_index - opaque cookie to identify the sender
240 @param context - sender context, to match reply w/ request
241 @param udp - UDP timeout (default 300sec)
242 @param tcp_established - TCP established timeout (default 7440sec)
243 @param tcp_transitory - TCP transitory timeout (default 240sec)
244 @param icmp - ICMP timeout (default 60sec)
246 autoreply define nat_set_timeouts {
255 /** \brief Get values of timeouts for NAT sessions (seconds)
256 @param client_index - opaque cookie to identify the sender
257 @param context - sender context, to match reply w/ request
259 define nat_get_timeouts {
264 /** \brief Get values of timeouts for NAT sessions reply
265 @param context - sender context, to match reply w/ request
266 @param retval - return code
267 @param udp - UDP timeout
268 @param tcp_established - TCP established timeout
269 @param tcp_transitory - TCP transitory timeout
270 @param icmp - ICMP timeout
272 define nat_get_timeouts_reply {
281 /** \brief Set address and port assignment algorithm
282 @param client_index - opaque cookie to identify the sender
283 @param context - sender context, to match reply w/ request
284 @param alg - address and port assignment algorithm:
285 0 - default, 1 - MAP-E, 2 - port range
286 (see nat_addr_and_port_alloc_alg_t in nat.h)
287 @param psid_offset - number of offset bits (valid only for MAP-E alg)
288 @param psid_length - length of PSID (valid only for MAP-E alg)
289 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
290 @param start_port - beginning of the port range
291 @param end_port - end of the port range
293 autoreply define nat_set_addr_and_port_alloc_alg {
304 /** \brief Get address and port assignment algorithm
305 @param client_index - opaque cookie to identify the sender
306 @param context - sender context, to match reply w/ request
308 define nat_get_addr_and_port_alloc_alg {
313 /** \brief Get address and port assignment algorithm reply
314 @param context - sender context, to match reply w/ request
315 @param retval - return code
316 @param alg - address and port assignment algorithm:
317 0 - default, 1 - MAP-E, 2 - port range
318 (see nat_addr_and_port_alloc_alg_t in nat.h)
319 @param psid_offset - number of offset bits (valid only for MAP-E alg)
320 @param psid_length - length of PSID (valid only for MAP-E alg)
321 @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
322 @param start_port - beginning of the port range
323 @param end_port - end of the port range
325 define nat_get_addr_and_port_alloc_alg_reply {
336 /** \brief Set TCP MSS rewriting configuration
337 @param client_index - opaque cookie to identify the sender
338 @param context - sender context, to match reply w/ request
339 @param mss_value - MSS value to be used for MSS rewriting
340 @param enable - disable(0)/enable(1) MSS rewriting feature
342 autoreply define nat_set_mss_clamping {
349 /** \brief Get TCP MSS rewriting configuration
350 @param client_index - opaque cookie to identify the sender
351 @param context - sender context, to match reply w/ request
353 define nat_get_mss_clamping {
358 /** \brief Get TCP MSS rewriting configuration reply
359 @param context - sender context, to match reply w/ request
360 @param retval - return code
361 @param mss_value - MSS value to be used for MSS rewriting
362 @param enable - disable(0)/enable(1) MSS rewriting feature
364 define nat_get_mss_clamping_reply {
371 /** \brief Set HA listener (local settings)
372 @param client_index - opaque cookie to identify the sender
373 @param context - sender context, to match reply w/ request
374 @param ip_address - local IP4 address
375 @param port - local UDP port number
376 @param path_mtu - path MTU between local and failover
378 autoreply define nat_ha_set_listener {
381 vl_api_ip4_address_t ip_address;
386 /** \brief Set HA failover (remote settings)
387 @param client_index - opaque cookie to identify the sender
388 @param context - sender context, to match reply w/ request
389 @param ip_address - failover IP4 address
390 @param port - failvoer UDP port number
391 @param session_refresh_interval - number of seconds after which to send
392 session counters refresh
394 autoreply define nat_ha_set_failover {
397 vl_api_ip4_address_t ip_address;
399 u32 session_refresh_interval;
402 /** \brief Get HA listener/local configuration
403 @param client_index - opaque cookie to identify the sender
404 @param context - sender context, to match reply w/ request
406 define nat_ha_get_listener {
411 /** \brief Get HA listener/local configuration reply
412 @param context - sender context, to match reply w/ request
413 @param retval - return code
414 @param ip_address - local IP4 address
415 @param port - local UDP port number
416 @param path_mtu - Path MTU between local and failover
418 define nat_ha_get_listener_reply {
421 vl_api_ip4_address_t ip_address;
426 /** \brief Get HA failover/remote settings
427 @param client_index - opaque cookie to identify the sender
428 @param context - sender context, to match reply w/ request
430 define nat_ha_get_failover {
435 /** \brief Get HA failover/remote settings reply
436 @param context - sender context, to match reply w/ request
437 @param retval - return code
438 @param ip_address - failover IP4 address
439 @param port - failvoer UDP port number
440 @param session_refresh_interval - number of seconds after which to send
441 session counters refresh
443 define nat_ha_get_failover_reply {
446 vl_api_ip4_address_t ip_address;
448 u32 session_refresh_interval;
451 /** \brief Flush the current HA data (for testing)
452 @param client_index - opaque cookie to identify the sender
453 @param context - sender context, to match reply w/ request
455 autoreply define nat_ha_flush {
460 /** \brief Resync HA (resend existing sessions to new failover)
461 @param context - sender context, to match reply w/ request
462 @param retval - return code
463 @param want_resync_event - resync completed event sent to the sender via
464 nat_ha_resync_completed_event API message if
466 @param pid - sender's pid
468 autoreply define nat_ha_resync
472 u8 want_resync_event;
476 /** \brief Tell client about a HA resync completion event
477 @param client_index - opaque cookie to identify the sender
478 @param pid - client pid registered to receive notification
479 @param missed_count - number of missed (not ACKed) messages
481 define nat_ha_resync_completed_event
489 rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
496 /** \brief Add/del NAT44 address range
497 @param client_index - opaque cookie to identify the sender
498 @param context - sender context, to match reply w/ request
499 @param first_ip_address - first IPv4 address
500 @param last_ip_address - last IPv4 address
501 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
502 @param twice_nat - twice NAT address range for extenal hosts
503 @param is_add - 1 if add, 0 if delete
505 autoreply define nat44_add_del_address_range {
508 u8 first_ip_address[4];
509 u8 last_ip_address[4];
515 /** \brief Dump NAT44 addresses
516 @param client_index - opaque cookie to identify the sender
517 @param context - sender context, to match reply w/ request
519 define nat44_address_dump {
524 /** \brief NAT44 address details response
525 @param context - sender context, to match reply w/ request
526 @param ip_address - IPv4 address
527 @param twice_nat - twice NAT address range for extenal hosts
528 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
530 define nat44_address_details {
537 /** \brief Enable/disable NAT44 feature on the interface
538 @param client_index - opaque cookie to identify the sender
539 @param context - sender context, to match reply w/ request
540 @param is_add - 1 if add, 0 if delete
541 @param is_inside - 1 if inside, 0 if outside
542 @param sw_if_index - software index of the interface
544 autoreply define nat44_interface_add_del_feature {
552 /** \brief Dump interfaces with NAT44 feature
553 @param client_index - opaque cookie to identify the sender
554 @param context - sender context, to match reply w/ request
556 define nat44_interface_dump {
561 /** \brief NAT44 interface details response
562 @param context - sender context, to match reply w/ request
563 @param is_inside - 1 if inside, 0 if outside, 2 if inside and outside
564 @param sw_if_index - software index of the interface
566 define nat44_interface_details {
572 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
574 @param client_index - opaque cookie to identify the sender
575 @param context - sender context, to match reply w/ request
576 @param is_add - 1 if add, 0 if delete
577 @param is_inside - 1 if inside, 0 if outside
578 @param sw_if_index - software index of the interface
580 autoreply define nat44_interface_add_del_output_feature {
588 /** \brief Dump interfaces with NAT44 output feature
589 @param client_index - opaque cookie to identify the sender
590 @param context - sender context, to match reply w/ request
592 define nat44_interface_output_feature_dump {
597 /** \brief NAT44 interface with output feature details response
598 @param context - sender context, to match reply w/ request
599 @param is_inside - 1 if inside, 0 if outside
600 @param sw_if_index - software index of the interface
602 define nat44_interface_output_feature_details {
608 /** \brief Add/delete NAT44 static mapping
609 @param client_index - opaque cookie to identify the sender
610 @param context - sender context, to match reply w/ request
611 @param is_add - 1 if add, 0 if delete
612 @param addr_only - 1 if address only mapping
613 @param local_ip_address - local IPv4 address
614 @param external_ip_address - external IPv4 address
615 @param protocol - IP protocol, used only if addr_only=0
616 @param local_port - local port number, used only if addr_only=0
617 @param external_port - external port number, used only if addr_only=0
618 @param external_sw_if_index - external interface (if set
619 external_ip_address is ignored, ~0 means not
621 @param vfr_id - VRF ID
622 @param twice_nat - if 1 translate external host address and port, only for
623 1:1 NAPT (addr_only must be 0)
624 @param self_twice_nat - if 1 translate external host address and port
625 whenever external host address equals
626 local address of internal host
627 @param out2in_only - if 1 rule match only out2in direction
628 @param tag - opaque string tag
630 autoreply define nat44_add_del_static_mapping {
635 u8 local_ip_address[4];
636 u8 external_ip_address[4];
640 u32 external_sw_if_index;
648 /** \brief Dump NAT44 static mappings
649 @param client_index - opaque cookie to identify the sender
650 @param context - sender context, to match reply w/ request
652 define nat44_static_mapping_dump {
657 /** \brief NAT44 static mapping details response
658 @param context - sender context, to match reply w/ request
659 @param addr_only - 1 if address only mapping
660 @param local_ip_address - local IPv4 address
661 @param external_ip_address - external IPv4 address
662 @param protocol - IP protocol, valid only if addr_only=0
663 @param local_port - local port number, valid only if addr_only=0
664 @param external_port - external port number, valid only if addr_only=0
665 @param external_sw_if_index - external interface
666 @param vfr_id - VRF ID
667 @param twice_nat - if 1 translate external host address and port
668 @param self_twice_nat - if 1 translate external host address and port
669 whenever external host address equals
670 local address of internal host
671 @param out2in_only - if 1 rule match only out2in direction
672 @param tag - opaque string tag
674 define nat44_static_mapping_details {
677 u8 local_ip_address[4];
678 u8 external_ip_address[4];
682 u32 external_sw_if_index;
690 /** \brief Add/delete NAT44 identity mapping
691 @param client_index - opaque cookie to identify the sender
692 @param context - sender context, to match reply w/ request
693 @param is_add - 1 if add, 0 if delete
694 @param addr_only - 1 if address only mapping
695 @param ip_address - IPv4 address
696 @param protocol - IP protocol
697 @param port - port number
698 @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
700 @param vfr_id - VRF ID (if ~0 use default VRF)
701 @param tag - opaque string tag
703 autoreply define nat44_add_del_identity_mapping {
716 /** \brief Dump NAT44 identity mappings
717 @param client_index - opaque cookie to identify the sender
718 @param context - sender context, to match reply w/ request
720 define nat44_identity_mapping_dump {
725 /** \brief NAT44 identity mapping details response
726 @param context - sender context, to match reply w/ request
727 @param addr_only - 1 if address only mapping
728 @param ip_address - IPv4 address
729 @param protocol - IP protocol
730 @param port - port number
731 @param sw_if_index - interface
732 @param vfr_id - VRF ID
733 @param tag - opaque string tag
735 define nat44_identity_mapping_details {
746 /** \brief Add/delete NAT44 pool address from specific interfce
747 @param client_index - opaque cookie to identify the sender
748 @param context - sender context, to match reply w/ request
749 @param is_add - 1 if add, 0 if delete
750 @param twice_nat - twice NAT address for extenal hosts
751 @param sw_if_index - software index of the interface
753 autoreply define nat44_add_del_interface_addr {
761 /** \brief Dump NAT44 pool addresses interfaces
762 @param client_index - opaque cookie to identify the sender
763 @param context - sender context, to match reply w/ request
765 define nat44_interface_addr_dump {
770 /** \brief NAT44 pool addresses interfaces details response
771 @param context - sender context, to match reply w/ request
772 @param sw_if_index - software index of the interface
773 @param twice_nat - twice NAT address for extenal hosts
775 define nat44_interface_addr_details {
781 /** \brief Dump NAT44 users
782 @param client_index - opaque cookie to identify the sender
783 @param context - sender context, to match reply w/ request
785 define nat44_user_dump {
790 /** \brief NAT44 users response
791 @param context - sender context, to match reply w/ request
793 @param ip_adress - IPv4 address
794 @param nsessions - number of dynamic sessions
795 @param nstaticsessions - number of static sessions
797 define nat44_user_details {
805 /** \brief NAT44 user's sessions
806 @param client_index - opaque cookie to identify the sender
807 @param context - sender context, to match reply w/ request
808 @param is_ip4 - 1 if address type is IPv4
809 @param user_ip - IP address of the user to dump
810 @param vrf_id - VRF_ID
812 define nat44_user_session_dump {
819 /** \brief NAT44 user's sessions response
820 @param context - sender context, to match reply w/ request
821 @param outside_ip_address - outside IPv4 address
822 @param outside_port - outside port
823 @param inside_ip_address - inside IPv4 address
824 @param inside_port - inside port
825 @param protocol - protocol
826 @param is_static - 1 if session is static
827 @param last_heard - last heard timer
828 @param total_bytes - count of bytes sent through session
829 @param total_pkts - count of pakets sent through session
830 @param is_twicenat - 1 if session is twice-nat
831 @param ext_host_valid - 1 if external host address and port are valid
832 @param ext_host_address - external host IPv4 address
833 @param ext_host_port - external host port
834 @param ext_host_nat_address - post-NAT external host IPv4 address (valid
835 only if twice-nat session)
836 @param ext_host_nat_port - post-NAT external host port (valid only if
839 define nat44_user_session_details {
841 u8 outside_ip_address[4];
843 u8 inside_ip_address[4];
852 u8 ext_host_address[4];
854 u8 ext_host_nat_address[4];
855 u16 ext_host_nat_port;
858 /** \brief NAT44 load-balancing address and port pair
859 @param addr - IPv4 address of the internal node
860 @param port - L4 port number of the internal node
861 @param probability - probability of the internal node to be randomly matched
863 typeonly manual_endian define nat44_lb_addr_port {
870 /** \brief Add/delete NAT44 load-balancing static mapping rule
871 @param client_index - opaque cookie to identify the sender
872 @param context - sender context, to match reply w/ request
873 @param is_add - 1 if add, 0 if delete
874 @param external_addr - external IPv4 address of the service
875 @param external_port - external L4 port number of the service
876 @param protocol - IP protocol number of the service
877 @param twice_nat - if 1 translate external host address and port
878 @param self_twice_nat - if 1 translate external host address and port
879 whenever external host address equals
880 local address of internal host
881 @param out2in_only - if 1 rule match only out2in direction
882 @param tag - opaque string tag
883 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
885 @param local_num - number of local network nodes
886 @param locals - local network nodes
888 autoreply manual_endian define nat44_add_del_lb_static_mapping {
901 vl_api_nat44_lb_addr_port_t locals[local_num];
904 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
905 @param client_index - opaque cookie to identify the sender
906 @param context - sender context, to match reply w/ request
907 @param is_add - 1 if add, 0 if delete
908 @param external_addr - external IPv4 address of the service
909 @param external_port - external L4 port number of the service
910 @param protocol - IP protocol number of the service
911 @param local - local network node
913 autoreply define nat44_lb_static_mapping_add_del_local {
920 vl_api_nat44_lb_addr_port_t local;
923 /** \brief Dump NAT44 load-balancing static mapping rules
924 @param client_index - opaque cookie to identify the sender
925 @param context - sender context, to match reply w/ request
927 define nat44_lb_static_mapping_dump {
932 /** \brief NAT44 load-balancing static mapping rule details response
933 @param context - sender context, to match reply w/ request
934 @param is_add - 1 if add, 0 if delete
935 @param external_addr - external IPv4 address of the service
936 @param external_port - external L4 port number of the service
937 @param protocol - IP protocol number of the service
938 @param twice_nat - if 1 translate external host address and port
939 @param self_twice_nat - if 1 translate external host address and port
940 whenever external host address equals
941 local address of internal host
942 @param out2in_only - if 1 rule match only out2in direction
943 @param tag - opaque string tag
944 @param affinity - if 0 disabled, otherwise client IP affinity sticky time
946 @param local_num - number of local network nodes
947 @param locals - local network nodes
949 manual_endian define nat44_lb_static_mapping_details {
960 vl_api_nat44_lb_addr_port_t locals[local_num];
963 /** \brief Delete NAT44 session
964 @param client_index - opaque cookie to identify the sender
965 @param context - sender context, to match reply w/ request
966 @param is_in - 1 if inside network addres and port pari, 0 if outside
967 @param ip_address - IPv4 address
968 @param protocol - IP protocol
969 @param port - port number
970 @param vfr_id - VRF ID
971 @param ext_host_valid - 1 if external host address and port are valid
972 @param ext_host_address - external host IPv4 address
973 @param ext_host_port - external host port
975 autoreply define nat44_del_session {
984 u8 ext_host_address[4];
988 /** \brief Enable/disable forwarding for NAT44
989 Forward packets which don't match existing translation
990 or static mapping instead of dropping them.
991 @param client_index - opaque cookie to identify the sender
992 @param context - sender context, to match reply w/ request
993 @param enable - 0 for enable, 1 for disable
995 autoreply define nat44_forwarding_enable_disable {
1001 /** \brief Check if forwarding is enabled or disabled
1002 @param client_index - opaque cookie to identify the sender
1003 @param context - sender context, to match reply w/ request
1005 define nat44_forwarding_is_enabled {
1010 /** \brief Response to check if forwarding is enabled or disabled
1011 @param context - sender context, to match reply w/ request
1012 @param enabled - 1 if enabled, 0 if disabled
1014 define nat44_forwarding_is_enabled_reply {
1021 * Deterministic NAT (CGN) APIs
1024 /** \brief Add/delete NAT deterministic mapping
1025 @param client_index - opaque cookie to identify the sender
1026 @param context - sender context, to match reply w/ request
1027 @param is_add - 1 if add, 0 if delete
1028 @param is_nat44 - 1 if NAT44
1029 @param in_addr - inside IP address
1030 @param in_plen - inside IP address prefix length
1031 @param out_addr - outside IPv4 address
1032 @param out_addr - outside IPv4 address prefix length
1034 autoreply define nat_det_add_del_map {
1046 /** \brief Get outside address and port range from inside address
1047 @param client_index - opaque cookie to identify the sender
1048 @param context - sender context, to match reply w/ request
1049 @param is_nat44 - 1 if NAT44
1050 @param in_addr - inside IP address
1052 define nat_det_forward {
1059 /** \brief Get outside address and port range from inside address
1060 @param context - sender context, to match reply w/ request
1061 @param retval - return code
1062 @param out_port_lo - outside port range start
1063 @param out_port_hi - outside port range end
1064 @param out_addr - outside IPv4 address
1066 define nat_det_forward_reply {
1074 /** \brief Get inside address from outside address and port
1075 @param client_index - opaque cookie to identify the sender
1076 @param context - sender context, to match reply w/ request
1077 @param out_port - outside port
1078 @param out_addr - outside IPv4 address
1080 define nat_det_reverse {
1087 /** \brief Get inside address from outside address and port reply
1088 @param context - sender context, to match reply w/ request
1089 @param retval - return code
1090 @param is_nat44 - 1 if NAT44
1091 @param in_addr - inside IP address
1093 define nat_det_reverse_reply {
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 is_nat44 - 1 if NAT44
1112 @param in_addr - inside IP address
1113 @param in_plen - inside IP 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 {
1132 /** \brief Close deterministic NAT session by outside address and port
1133 @param client_index - opaque cookie to identify the sender
1134 @param context - sender context, to match reply w/ request
1135 @param out_addr - outside IPv4 address
1136 @param out_port - outside port
1137 @param ext_addr - external host IPv4 address
1138 @param ext_port - external host port
1140 autoreply define nat_det_close_session_out {
1149 /** \brief Close deterministic NAT session by inside address and port
1150 @param client_index - opaque cookie to identify the sender
1151 @param context - sender context, to match reply w/ request
1152 @param is_nat44 - 1 if NAT44
1153 @param in_addr - inside IP address
1154 @param in_port - inside port
1155 @param ext_addr - external host IP address
1156 @param ext_port - external host port
1158 autoreply define nat_det_close_session_in {
1168 /** \brief Dump determinstic NAT sessions
1169 @param client_index - opaque cookie to identify the sender
1170 @param context - sender context, to match reply w/ request
1171 @param is_nat44 - 1 if NAT44
1172 @param user_addr - address of an inside user whose sessions to dump
1174 define nat_det_session_dump {
1181 /** \brief Deterministic NAT sessions reply
1182 @param context - sender context, to match reply w/ request
1183 @param in_port - inside port
1184 @param ext_addr - external host address
1185 @param ext_port - external host port
1186 @param out_port - outside NAT port
1187 @param state - session state
1188 @param expire - session expiration timestamp
1190 define nat_det_session_details {
1204 /** \brief Add/delete address range to NAT64 pool
1205 @param client_index - opaque cookie to identify the sender
1206 @param context - sender context, to match reply w/ request
1207 @param start_addr - start address of the range
1208 @param end_addr - end address of the range
1209 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1210 @param is_add - 1 if add, 0 if delete
1212 autoreply define nat64_add_del_pool_addr_range {
1221 /** \brief Dump NAT64 pool addresses
1222 @param client_index - opaque cookie to identify the sender
1223 @param context - sender context, to match reply w/ request
1225 define nat64_pool_addr_dump {
1230 /** \brief NAT64 pool address details response
1231 @param context - sender context, to match reply w/ request
1232 @param address - IPv4 address
1233 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1235 define nat64_pool_addr_details {
1241 /** \brief Enable/disable NAT64 feature on the interface
1242 @param client_index - opaque cookie to identify the sender
1243 @param context - sender context, to match reply w/ request
1244 @param sw_if_index - index of the interface
1245 @param is_inside - 1 if inside, 0 if outside
1246 @param is_add - 1 if add, 0 if delete
1248 autoreply define nat64_add_del_interface {
1256 /** \brief Dump interfaces with NAT64 feature
1257 @param client_index - opaque cookie to identify the sender
1258 @param context - sender context, to match reply w/ request
1260 define nat64_interface_dump {
1265 /** \brief NAT64 interface details response
1266 @param context - sender context, to match reply w/ request
1267 @param is_inside - 1 if inside, 0 if outside
1268 @param sw_if_index - index of the interface
1270 define nat64_interface_details {
1276 /** \brief Add/delete NAT64 static BIB entry
1277 @param client_index - opaque cookie to identify the sender
1278 @param context - sender context, to match reply w/ request
1279 @param i_addr - inside IPv6 address
1280 @param o_addr - outside IPv4 address
1281 @param i_port - inside port number
1282 @param o_port - outside port number
1283 @param vrf_id - VRF id of tenant
1284 @param proto - protocol number
1285 @param is_add - 1 if add, 0 if delete
1287 autoreply define nat64_add_del_static_bib {
1299 /** \brief Dump NAT64 BIB
1300 @param client_index - opaque cookie to identify the sender
1301 @param context - sender context, to match reply w/ request
1302 @param proto - protocol of the BIB: 255 - all BIBs
1306 otherwise - "unknown" protocol BIB
1308 define nat64_bib_dump {
1314 /** \brief NAT64 BIB details response
1315 @param context - sender context, to match reply w/ request
1316 @param i_addr - inside IPv6 address
1317 @param o_addr - outside IPv4 address
1318 @param i_port - inside port number
1319 @param o_port - outside port number
1320 @param vrf_id - VRF id of tenant
1321 @param proto - protocol number
1322 @param is_static - 1 if static BIB entry, 0 if dynamic
1323 @param ses_num - number of sessions associated with the BIB entry
1325 define nat64_bib_details {
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 il_addr - inside IPv6 address of the remote host
1359 @param ol_addr - outside IPv4 address of the remote host
1360 @param l_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 {
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 prefix - NAT64 prefix length
1382 @param vrf_id - VRF id of tenant
1383 @param is_add - 1 if add, 0 if delete
1385 autoreply define nat64_add_del_prefix {
1394 /** \brief Dump NAT64 prefix
1395 @param client_index - opaque cookie to identify the sender
1396 @param context - sender context, to match reply w/ request
1398 define nat64_prefix_dump {
1403 /** \brief Dump NAT64 prefix details response
1404 @param context - sender context, to match reply w/ request
1405 @param prefix - NAT64 prefix
1406 @param prefix - NAT64 prefix length
1407 @param vrf_id - VRF id of tenant
1409 define nat64_prefix_details {
1416 /** \brief Add/delete NAT64 pool address from specific interfce
1417 @param client_index - opaque cookie to identify the sender
1418 @param context - sender context, to match reply w/ request
1419 @param is_add - 1 if add, 0 if delete
1420 @param sw_if_index - software index of the interface
1422 autoreply define nat64_add_del_interface_addr {
1435 /** \brief Add/delete address range to DS-Lite pool
1436 @param client_index - opaque cookie to identify the sender
1437 @param context - sender context, to match reply w/ request
1438 @param start_addr - start address of the range
1439 @param end_addr - end address of the range
1440 @param is_add - 1 if add, 0 if delete
1442 autoreply define dslite_add_del_pool_addr_range {
1450 /** \brief Dump DS-Lite addresses
1451 @param client_index - opaque cookie to identify the sender
1452 @param context - sender context, to match reply w/ request
1454 define dslite_address_dump {
1459 /** \brief DS-Lite address details response
1460 @param context - sender context, to match reply w/ request
1461 @param ip_address - IPv4 address
1463 define dslite_address_details {
1468 /** \brief Set AFTR IPv6 and IPv4 addresses
1469 @param client_index - opaque cookie to identify the sender
1470 @param context - sender context, to match reply w/ request
1471 @param ip4_addr - IPv4 address
1472 @param ip6_addr - IP64 address
1474 autoreply define dslite_set_aftr_addr {
1481 /** \brief Get AFTR IPv6 and IPv4 addresses
1482 @param client_index - opaque cookie to identify the sender
1483 @param context - sender context, to match reply w/ request
1485 define dslite_get_aftr_addr {
1490 /** \brief Response to get AFTR IPv6 and IPv4 addresses
1491 @param context - sender context, to match reply w/ request
1492 @param retval - return code
1493 @param ip4_addr - IPv4 address
1494 @param ip6_addr - IP64 address
1496 define dslite_get_aftr_addr_reply {
1503 /** \brief Set B4 IPv6 and IPv4 addresses
1504 @param client_index - opaque cookie to identify the sender
1505 @param context - sender context, to match reply w/ request
1506 @param ip4_addr - IPv4 address
1507 @param ip6_addr - IP64 address
1509 autoreply define dslite_set_b4_addr {
1516 /** \brief Get B4 IPv6 and IPv4 addresses
1517 @param client_index - opaque cookie to identify the sender
1518 @param context - sender context, to match reply w/ request
1520 define dslite_get_b4_addr {
1525 /** \brief Response to get B4 IPv6 and IPv4 addresses
1526 @param context - sender context, to match reply w/ request
1527 @param retval - return code
1528 @param ip4_addr - IPv4 address
1529 @param ip6_addr - IP64 address
1531 define dslite_get_b4_addr_reply {
1541 /** \brief Enable/disable NAT66 feature on the interface
1542 @param client_index - opaque cookie to identify the sender
1543 @param context - sender context, to match reply w/ request
1544 @param is_add - 1 if add, 0 if delete
1545 @param is_inside - 1 if inside, 0 if outside
1546 @param sw_if_index - software index of the interface
1548 autoreply define nat66_add_del_interface {
1556 /** \brief Dump interfaces with NAT66 feature
1557 @param client_index - opaque cookie to identify the sender
1558 @param context - sender context, to match reply w/ request
1560 define nat66_interface_dump {
1565 /** \brief NAT66 interface details response
1566 @param context - sender context, to match reply w/ request
1567 @param is_inside - 1 if inside, 0 if outside
1568 @param sw_if_index - software index of the interface
1570 define nat66_interface_details {
1576 /** \brief Add/delete 1:1 NAT66
1577 @param client_index - opaque cookie to identify the sender
1578 @param context - sender context, to match reply w/ request
1579 @param is_add - 1 if add, 0 if delete
1580 @param local_ip_address - local IPv6 address
1581 @param external_ip_address - external IPv6 address
1582 @param vrf_id - VRF id of tenant
1584 autoreply define nat66_add_del_static_mapping {
1588 u8 local_ip_address[16];
1589 u8 external_ip_address[16];
1593 /** \brief Dump NAT66 static mappings
1594 @param client_index - opaque cookie to identify the sender
1595 @param context - sender context, to match reply w/ request
1597 define nat66_static_mapping_dump {
1602 /** \brief NAT66 static mapping details response
1603 @param context - sender context, to match reply w/ request
1604 @param local_ip_address - local IPv6 address
1605 @param external_ip_address - external IPv6 address
1606 @param vrf_id - VRF id of tenant
1607 @param total_bytes - count of bytes sent through static mapping
1608 @param total_pkts - count of pakets sent through static mapping
1610 define nat66_static_mapping_details {
1612 u8 local_ip_address[16];
1613 u8 external_ip_address[16];