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.
20 * @brief VPP control-plane API messages.
22 * This file defines VPP control-plane API messages which are generally
23 * called through a shared memory interface.
27 * Old "snat" APIs, will be deprecated after 17.10
30 /** \brief Add/del NAT44 address range
31 @param client_index - opaque cookie to identify the sender
32 @param context - sender context, to match reply w/ request
33 @param is_ip4 - 1 if address type is IPv4
34 @param first_ip_address - first IP address
35 @param last_ip_address - last IP address
36 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
37 @param is_add - 1 if add, 0 if delete
39 autoreply define snat_add_address_range {
43 u8 first_ip_address[16];
44 u8 last_ip_address[16];
49 /** \brief Dump NAT44 addresses
50 @param client_index - opaque cookie to identify the sender
51 @param context - sender context, to match reply w/ request
53 define snat_address_dump {
58 /** \brief NAT44 address details response
59 @param context - sender context, to match reply w/ request
60 @param is_ip4 - 1 if address type is IPv4
61 @param ip_address - IP address
62 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
64 define snat_address_details {
71 /** \brief Enable/disable NAT44 feature on the interface
72 @param client_index - opaque cookie to identify the sender
73 @param context - sender context, to match reply w/ request
74 @param is_add - 1 if add, 0 if delete
75 @param is_inside - 1 if inside, 0 if outside
76 @param sw_if_index - software index of the interface
78 autoreply define snat_interface_add_del_feature {
86 /** \brief Dump interfaces with NAT44 feature
87 @param client_index - opaque cookie to identify the sender
88 @param context - sender context, to match reply w/ request
90 define snat_interface_dump {
95 /** \brief NAT44 interface details response
96 @param context - sender context, to match reply w/ request
97 @param is_inside - 1 if inside, 0 if outside
98 @param sw_if_index - software index of the interface
100 define snat_interface_details {
106 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
108 @param client_index - opaque cookie to identify the sender
109 @param context - sender context, to match reply w/ request
110 @param is_add - 1 if add, 0 if delete
111 @param is_inside - 1 if inside, 0 if outside
112 @param sw_if_index - software index of the interface
114 autoreply define snat_interface_add_del_output_feature {
122 /** \brief Dump interfaces with NAT44 output feature
123 @param client_index - opaque cookie to identify the sender
124 @param context - sender context, to match reply w/ request
126 define snat_interface_output_feature_dump {
131 /** \brief NAT44 interface with output feature details response
132 @param context - sender context, to match reply w/ request
133 @param is_inside - 1 if inside, 0 if outside
134 @param sw_if_index - software index of the interface
136 define snat_interface_output_feature_details {
142 /** \brief Add/delete NAT44 static mapping
143 @param client_index - opaque cookie to identify the sender
144 @param context - sender context, to match reply w/ request
145 @param is_add - 1 if add, 0 if delete
146 @param is_ip4 - 1 if address type is IPv4
147 @param addr_only - 1 if address only mapping
148 @param local_ip_address - local IP address
149 @param external_ip_address - external IP address
150 @param protocol - IP protocol
151 @param local_port - local port number
152 @param external_port - external port number
153 @param external_sw_if_index - external interface (if set
154 external_ip_address is ignored, ~0 means not
156 @param vfr_id - VRF ID
158 autoreply define snat_add_static_mapping {
164 u8 local_ip_address[16];
165 u8 external_ip_address[16];
169 u32 external_sw_if_index;
173 /** \brief Dump NAT44 static mappings
174 @param client_index - opaque cookie to identify the sender
175 @param context - sender context, to match reply w/ request
177 define snat_static_mapping_dump {
182 /** \brief NAT44 static mapping details response
183 @param context - sender context, to match reply w/ request
184 @param is_ip4 - 1 if address type is IPv4
185 @param addr_only - 1 if address only mapping
186 @param local_ip_address - local IP address
187 @param external_ip_address - external IP address
188 @param protocol - IP protocol
189 @param local_port - local port number
190 @param external_port - external port number
191 @param external_sw_if_index - external interface
192 @param vfr_id - VRF ID
194 define snat_static_mapping_details {
198 u8 local_ip_address[16];
199 u8 external_ip_address[16];
203 u32 external_sw_if_index;
207 /** \brief Control ping from client to api server request
208 @param client_index - opaque cookie to identify the sender
209 @param context - sender context, to match reply w/ request
211 define snat_control_ping
217 /** \brief Control ping from the client to the server response
218 @param client_index - opaque cookie to identify the sender
219 @param context - sender context, to match reply w/ request
220 @param retval - return code for the request
221 @param vpe_pid - the pid of the vpe, returned by the server
223 define snat_control_ping_reply
231 /** \brief Show NAT plugin startup config
232 @param client_index - opaque cookie to identify the sender
233 @param context - sender context, to match reply w/ request
235 define snat_show_config
241 /** \brief Show NAT plugin startup config reply
242 @param context - sender context, to match reply w/ request
243 @param retval - return code for the request
244 @param static_mapping_only - if 1 dynamic translations disabled
245 @param static_mapping_connection_tracking - if 1 create session data
246 @param deterministic - if 1 deterministic mapping
247 @param translation_buckets - number of translation hash buckets
248 @param translation_memory_size - translation hash memory size
249 @param user_buckets - number of user hash buckets
250 @param user_memory_size - user hash memory size
251 @param max_translations_per_user - maximum number of translations per user
252 @param outside_vrf_id - outside VRF id
253 @param inside_vrf_id - default inside VRF id
255 define snat_show_config_reply
259 u8 static_mapping_only;
260 u8 static_mapping_connection_tracking;
262 u32 translation_buckets;
263 u32 translation_memory_size;
265 u32 user_memory_size;
266 u32 max_translations_per_user;
271 /** \brief Set NAT workers
272 @param client_index - opaque cookie to identify the sender
273 @param context - sender context, to match reply w/ request
274 @param worker_mask - NAT workers mask
276 autoreply define snat_set_workers {
282 /** \brief Dump NAT workers
283 @param client_index - opaque cookie to identify the sender
284 @param context - sender context, to match reply w/ request
286 define snat_worker_dump {
291 /** \brief NAT workers details response
292 @param context - sender context, to match reply w/ request
293 @param worker_index - worker index
294 @param lcore_id - lcore ID
295 @param name - worker name
297 define snat_worker_details {
304 /** \brief Add/delete NAT44 pool address from specific interfce
305 @param client_index - opaque cookie to identify the sender
306 @param context - sender context, to match reply w/ request
307 @param is_add - 1 if add, 0 if delete
308 @param sw_if_index - software index of the interface
310 autoreply define snat_add_del_interface_addr {
318 /** \brief Dump NAT44 pool addresses interfaces
319 @param client_index - opaque cookie to identify the sender
320 @param context - sender context, to match reply w/ request
322 define snat_interface_addr_dump {
327 /** \brief NAT44 pool addresses interfaces details response
328 @param context - sender context, to match reply w/ request
329 @param sw_if_index - software index of the interface
331 define snat_interface_addr_details {
336 /** \brief Enable/disable NAT IPFIX logging
337 @param client_index - opaque cookie to identify the sender
338 @param context - sender context, to match reply w/ request
339 @param domain_id - observation domain ID
340 @param src_port - source port number
341 @param enable - 1 if enable, 0 if disable
343 autoreply define snat_ipfix_enable_disable {
351 /** \brief Dump NAT44 users
352 @param client_index - opaque cookie to identify the sender
353 @param context - sender context, to match reply w/ request
355 define snat_user_dump {
360 /** \brief NAT44 users response
361 @param context - sender context, to match reply w/ request
363 @param is_ip4 - 1 if address type is IPv4
364 @param ip_adress - IP address
365 @param nsessions - number of dynamic sessions
366 @param nstaticsessions - number of static sessions
368 define snat_user_details {
377 /** \brief NAT44 user's sessions
378 @param client_index - opaque cookie to identify the sender
379 @param context - sender context, to match reply w/ request
380 @param is_ip4 - 1 if address type is IPv4
381 @param user_ip - IP address of the user to dump
382 @param vrf_id - VRF_ID
384 define snat_user_session_dump {
392 /** \brief NAT44 user's sessions response
393 @param context - sender context, to match reply w/ request
394 @param is_ip4 - 1 if address type is IPv4
395 @param outside_ip_address - outside IP address
396 @param outside_port - outside port
397 @param inside_ip_address - inside IP address
398 @param inside_port - inside port
399 @param protocol - protocol
400 @param is_static - 1 if session is static
401 @param last_heard - last heard timer
402 @param total_bytes - count of bytes sent through session
403 @param total_pkts - count of pakets sent through session
405 define snat_user_session_details {
408 u8 outside_ip_address[16];
410 u8 inside_ip_address[16];
419 /** \brief Add/delete NAT deterministic mapping
420 @param client_index - opaque cookie to identify the sender
421 @param context - sender context, to match reply w/ request
422 @param is_add - 1 if add, 0 if delete
423 @param is_ip4 - 1 if address type is IPv4
424 @param in_addr - inside IP address
425 @param in_plen - inside IP address prefix length
426 @param out_addr - outside IP address
427 @param out_addr - outside IP address prefix length
429 autoreply define snat_add_det_map {
441 /** \brief Get outside address and port range from inside address
442 @param client_index - opaque cookie to identify the sender
443 @param context - sender context, to match reply w/ request
444 @param is_ip4 - 1 if address type is IPv4
445 @param in_addr - inside IP address
447 define snat_det_forward {
454 /** \brief Get outside address and port range from inside address
455 @param context - sender context, to match reply w/ request
456 @param retval - return code
457 @param out_port_lo - outside port range start
458 @param out_port_hi - outside port range end
459 @param is_ip4 - 1 if address type is IPv4
460 @param out_addr - outside IP address
462 define snat_det_forward_reply {
471 /** \brief Get inside address from outside address and port
472 @param client_index - opaque cookie to identify the sender
473 @param context - sender context, to match reply w/ request
474 @param out_port - outside port
475 @param is_ip4 - 1 if address type is IPv4
476 @param out_addr - outside IP address
478 define snat_det_reverse {
486 /** \brief Get inside address from outside address and port reply
487 @param context - sender context, to match reply w/ request
488 @param retval - return code
489 @param is_ip4 - 1 if address type is IPv4
490 @param in_addr - inside IP address
492 define snat_det_reverse_reply {
499 /** \brief Dump NAT deterministic mappings
500 @param client_index - opaque cookie to identify the sender
501 @param context - sender context, to match reply w/ request
503 define snat_det_map_dump {
508 /** \brief NAT users response
509 @param context - sender context, to match reply w/ request
510 @param is_ip4 - 1 if address type is IPv4
511 @param in_addr - inside IP address
512 @param in_plen - inside IP address prefix length
513 @param out_addr - outside IP address
514 @param out_plen - outside IP address prefix length
515 @param sharing_ratio - outside to inside address sharing ratio
516 @param ports_per_host - number of ports available to a host
517 @param ses_num - number of sessions belonging to this mapping
519 define snat_det_map_details {
531 /** \brief Set values of timeouts for deterministic NAT (seconds, 0 = default)
532 @param client_index - opaque cookie to identify the sender
533 @param context - sender context, to match reply w/ request
534 @param udp - UDP timeout (default 300sec)
535 @param tcp_established - TCP established timeout (default 7440sec)
536 @param tcp_transitory - TCP transitory timeout (default 240sec)
537 @param icmp - ICMP timeout (default 60sec)
539 autoreply define snat_det_set_timeouts {
548 /** \brief Get values of timeouts for deterministic NAT (seconds)
549 @param client_index - opaque cookie to identify the sender
550 @param context - sender context, to match reply w/ request
552 define snat_det_get_timeouts {
557 /** \brief Get values of timeouts for deterministic NAT reply
558 @param context - sender context, to match reply w/ request
559 @param retval - return code
560 @param udp - UDP timeout (default 300sec)
561 @param tcp_established - TCP established timeout (default 7440sec)
562 @param tcp_transitory - TCP transitory timeout (default 240sec)
563 @param icmp - ICMP timeout (default 60sec)
565 define snat_det_get_timeouts_reply {
574 /** \brief Close deterministic NAT session by outside address and port
575 @param client_index - opaque cookie to identify the sender
576 @param context - sender context, to match reply w/ request
577 @param is_ip4 - 1 if address type is IPv4
578 @param out_addr - outside IP address
579 @param out_port - outside port
580 @param ext_addr - external host address
581 @param ext_port - external host port
583 autoreply define snat_det_close_session_out {
593 /** \brief Close deterministic NAT session by inside address and port
594 @param client_index - opaque cookie to identify the sender
595 @param context - sender context, to match reply w/ request
596 @param is_ip4 - 1 if address type is IPv4
597 @param in_addr - inside IP address
598 @param in_port - inside port
599 @param ext_addr - external host address
600 @param ext_port - external host port
602 autoreply define snat_det_close_session_in {
612 /** \brief Dump determinstic NAT sessions
613 @param client_index - opaque cookie to identify the sender
614 @param context - sender context, to match reply w/ request
615 @param is_ip4 - 1 if address type is IPv4
616 @param user_addr - address of an inside user whose sessions to dump
618 define snat_det_session_dump {
625 /** \brief Deterministic NAT sessions reply
626 @param context - sender context, to match reply w/ request
627 @param is_ip4 - 1 if address type is IPv4
628 @param in_port - inside port
629 @param ext_addr - external host address
630 @param ext_port - external host port
631 @param out_port - outside NAT port
632 @param state - session state
633 @param expire - session expiration timestamp
635 define snat_det_session_details {
648 * Common NAT plugin APIs
651 /** \brief Control ping from client to api server request
652 @param client_index - opaque cookie to identify the sender
653 @param context - sender context, to match reply w/ request
655 define nat_control_ping
661 /** \brief Control ping from the client to the server response
662 @param client_index - opaque cookie to identify the sender
663 @param context - sender context, to match reply w/ request
664 @param retval - return code for the request
665 @param vpe_pid - the pid of the vpe, returned by the server
667 define nat_control_ping_reply
675 /** \brief Show NAT plugin startup config
676 @param client_index - opaque cookie to identify the sender
677 @param context - sender context, to match reply w/ request
679 define nat_show_config
685 /** \brief Show NAT plugin startup config reply
686 @param context - sender context, to match reply w/ request
687 @param retval - return code for the request
688 @param static_mapping_only - if 1 dynamic translations disabled
689 @param static_mapping_connection_tracking - if 1 create session data
690 @param deterministic - if 1 deterministic mapping
691 @param translation_buckets - number of translation hash buckets
692 @param translation_memory_size - translation hash memory size
693 @param user_buckets - number of user hash buckets
694 @param user_memory_size - user hash memory size
695 @param max_translations_per_user - maximum number of translations per user
696 @param outside_vrf_id - outside VRF id
697 @param inside_vrf_id - default inside VRF id
699 define nat_show_config_reply
703 u8 static_mapping_only;
704 u8 static_mapping_connection_tracking;
706 u32 translation_buckets;
707 u32 translation_memory_size;
709 u32 user_memory_size;
710 u32 max_translations_per_user;
715 /** \brief Set NAT workers
716 @param client_index - opaque cookie to identify the sender
717 @param context - sender context, to match reply w/ request
718 @param worker_mask - NAT workers mask
720 autoreply define nat_set_workers {
726 /** \brief Dump NAT workers
727 @param client_index - opaque cookie to identify the sender
728 @param context - sender context, to match reply w/ request
730 define nat_worker_dump {
735 /** \brief NAT workers details response
736 @param context - sender context, to match reply w/ request
737 @param worker_index - worker index
738 @param lcore_id - lcore ID
739 @param name - worker name
741 define nat_worker_details {
748 /** \brief Enable/disable NAT IPFIX logging
749 @param client_index - opaque cookie to identify the sender
750 @param context - sender context, to match reply w/ request
751 @param domain_id - observation domain ID
752 @param src_port - source port number
753 @param enable - 1 if enable, 0 if disable
755 autoreply define nat_ipfix_enable_disable {
763 /** \brief Set NAT virtual fragmentation reassembly
764 @param client_index - opaque cookie to identify the sender
765 @param context - sender context, to match reply w/ request
766 @param timeout - reassembly timeout
767 @param max_reass - maximum number of concurrent reassemblies
768 @param max_frag - maximum number of fragmets per reassembly
769 @param drop_frag - if 0 translate fragments, otherwise drop fragments
770 @param is_ip6 - 1 if IPv6, 0 if IPv4
772 autoreply define nat_set_reass {
782 /** \brief Get NAT virtual fragmentation reassembly configuration
783 @param client_index - opaque cookie to identify the sender
784 @param context - sender context, to match reply w/ request
786 define nat_get_reass {
791 /** \brief Get NAT virtual fragmentation reassembly configuration reply
792 @param context - sender context, to match reply w/ request
793 @param retval - return code
794 @param ip4_timeout - reassembly timeout
795 @param ip4_max_reass - maximum number of concurrent reassemblies
796 @param ip4_max_frag - maximum number of fragmets per reassembly
797 @param ip4_drop_frag - if 0 translate fragments, otherwise drop fragments
798 @param ip6_timeout - reassembly timeout
799 @param ip6_max_reass - maximum number of concurrent reassemblies
800 @param ip6_max_frag - maximum number of fragmets per reassembly
801 @param ip6_drop_frag - if 0 translate fragments, otherwise drop fragments
803 define nat_get_reass_reply {
816 /** \brief Dump NAT virtual fragmentation reassemblies
817 @param client_index - opaque cookie to identify the sender
818 @param context - sender context, to match reply w/ request
820 define nat_reass_dump {
825 /** \brief NAT virtual fragmentation reassemblies response
826 @param context - sender context, to match reply w/ request
827 @param is_ip4 - 1 if address type is IPv4
828 @param src_addr - source IP address
829 @param dst_addr - destination IP address
830 @param frag_id - fragment ID
831 @param proto - protocol
832 @param frag_n - number of cached fragments
834 define nat_reass_details {
848 /** \brief Add/del NAT44 address range
849 @param client_index - opaque cookie to identify the sender
850 @param context - sender context, to match reply w/ request
851 @param first_ip_address - first IPv4 address
852 @param last_ip_address - last IPv4 address
853 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
854 @param is_add - 1 if add, 0 if delete
856 autoreply define nat44_add_del_address_range {
859 u8 first_ip_address[4];
860 u8 last_ip_address[4];
865 /** \brief Dump NAT44 addresses
866 @param client_index - opaque cookie to identify the sender
867 @param context - sender context, to match reply w/ request
869 define nat44_address_dump {
874 /** \brief NAT44 address details response
875 @param context - sender context, to match reply w/ request
876 @param ip_address - IPv4 address
877 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
879 define nat44_address_details {
885 /** \brief Enable/disable NAT44 feature on the interface
886 @param client_index - opaque cookie to identify the sender
887 @param context - sender context, to match reply w/ request
888 @param is_add - 1 if add, 0 if delete
889 @param is_inside - 1 if inside, 0 if outside
890 @param sw_if_index - software index of the interface
892 autoreply define nat44_interface_add_del_feature {
900 /** \brief Dump interfaces with NAT44 feature
901 @param client_index - opaque cookie to identify the sender
902 @param context - sender context, to match reply w/ request
904 define nat44_interface_dump {
909 /** \brief NAT44 interface details response
910 @param context - sender context, to match reply w/ request
911 @param is_inside - 1 if inside, 0 if outside, 2 if inside and outside
912 @param sw_if_index - software index of the interface
914 define nat44_interface_details {
920 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
922 @param client_index - opaque cookie to identify the sender
923 @param context - sender context, to match reply w/ request
924 @param is_add - 1 if add, 0 if delete
925 @param is_inside - 1 if inside, 0 if outside
926 @param sw_if_index - software index of the interface
928 autoreply define nat44_interface_add_del_output_feature {
936 /** \brief Dump interfaces with NAT44 output feature
937 @param client_index - opaque cookie to identify the sender
938 @param context - sender context, to match reply w/ request
940 define nat44_interface_output_feature_dump {
945 /** \brief NAT44 interface with output feature details response
946 @param context - sender context, to match reply w/ request
947 @param is_inside - 1 if inside, 0 if outside
948 @param sw_if_index - software index of the interface
950 define nat44_interface_output_feature_details {
956 /** \brief Add/delete NAT44 static mapping
957 @param client_index - opaque cookie to identify the sender
958 @param context - sender context, to match reply w/ request
959 @param is_add - 1 if add, 0 if delete
960 @param addr_only - 1 if address only mapping
961 @param local_ip_address - local IPv4 address
962 @param external_ip_address - external IPv4 address
963 @param protocol - IP protocol
964 @param local_port - local port number
965 @param external_port - external port number
966 @param external_sw_if_index - external interface (if set
967 external_ip_address is ignored, ~0 means not
969 @param vfr_id - VRF ID
971 autoreply define nat44_add_del_static_mapping {
976 u8 local_ip_address[4];
977 u8 external_ip_address[4];
981 u32 external_sw_if_index;
985 /** \brief Dump NAT44 static mappings
986 @param client_index - opaque cookie to identify the sender
987 @param context - sender context, to match reply w/ request
989 define nat44_static_mapping_dump {
994 /** \brief NAT44 static mapping details response
995 @param context - sender context, to match reply w/ request
996 @param addr_only - 1 if address only mapping
997 @param local_ip_address - local IPv4 address
998 @param external_ip_address - external IPv4 address
999 @param protocol - IP protocol
1000 @param local_port - local port number
1001 @param external_port - external port number
1002 @param external_sw_if_index - external interface
1003 @param vfr_id - VRF ID
1005 define nat44_static_mapping_details {
1008 u8 local_ip_address[4];
1009 u8 external_ip_address[4];
1013 u32 external_sw_if_index;
1017 /** \brief Add/delete NAT44 pool address from specific interfce
1018 @param client_index - opaque cookie to identify the sender
1019 @param context - sender context, to match reply w/ request
1020 @param is_add - 1 if add, 0 if delete
1021 @param sw_if_index - software index of the interface
1023 autoreply define nat44_add_del_interface_addr {
1031 /** \brief Dump NAT44 pool addresses interfaces
1032 @param client_index - opaque cookie to identify the sender
1033 @param context - sender context, to match reply w/ request
1035 define nat44_interface_addr_dump {
1040 /** \brief NAT44 pool addresses interfaces details response
1041 @param context - sender context, to match reply w/ request
1042 @param sw_if_index - software index of the interface
1044 define nat44_interface_addr_details {
1049 /** \brief Dump NAT44 users
1050 @param client_index - opaque cookie to identify the sender
1051 @param context - sender context, to match reply w/ request
1053 define nat44_user_dump {
1058 /** \brief NAT44 users response
1059 @param context - sender context, to match reply w/ request
1061 @param ip_adress - IPv4 address
1062 @param nsessions - number of dynamic sessions
1063 @param nstaticsessions - number of static sessions
1065 define nat44_user_details {
1070 u32 nstaticsessions;
1073 /** \brief NAT44 user's sessions
1074 @param client_index - opaque cookie to identify the sender
1075 @param context - sender context, to match reply w/ request
1076 @param is_ip4 - 1 if address type is IPv4
1077 @param user_ip - IP address of the user to dump
1078 @param vrf_id - VRF_ID
1080 define nat44_user_session_dump {
1087 /** \brief NAT44 user's sessions response
1088 @param context - sender context, to match reply w/ request
1089 @param outside_ip_address - outside IPv4 address
1090 @param outside_port - outside port
1091 @param inside_ip_address - inside IPv4 address
1092 @param inside_port - inside port
1093 @param protocol - protocol
1094 @param is_static - 1 if session is static
1095 @param last_heard - last heard timer
1096 @param total_bytes - count of bytes sent through session
1097 @param total_pkts - count of pakets sent through session
1099 define nat44_user_session_details {
1101 u8 outside_ip_address[4];
1103 u8 inside_ip_address[4];
1112 typeonly manual_endian define nat44_lb_addr_port {
1118 autoreply manual_endian define nat44_add_del_lb_static_mapping {
1122 u8 external_addr[4];
1127 vl_api_nat44_lb_addr_port_t locals[local_num];
1130 define nat44_lb_static_mapping_dump {
1135 manual_endian define nat44_lb_static_mapping_details {
1137 u8 external_addr[4];
1142 vl_api_nat44_lb_addr_port_t locals[local_num];
1145 /** \brief Delete NAT44 session
1146 @param client_index - opaque cookie to identify the sender
1147 @param context - sender context, to match reply w/ request
1148 @param is_in - 1 if inside network addres and port pari, 0 if outside
1149 @param ip_address - IPv4 address
1150 @param protocol - IP protocol
1151 @param port - port number
1152 @param vfr_id - VRF ID
1154 autoreply define nat44_del_session {
1166 * Deterministic NAT (CGN) APIs
1169 /** \brief Add/delete NAT deterministic mapping
1170 @param client_index - opaque cookie to identify the sender
1171 @param context - sender context, to match reply w/ request
1172 @param is_add - 1 if add, 0 if delete
1173 @param is_nat44 - 1 if NAT44
1174 @param in_addr - inside IP address
1175 @param in_plen - inside IP address prefix length
1176 @param out_addr - outside IPv4 address
1177 @param out_addr - outside IPv4 address prefix length
1179 autoreply define nat_det_add_del_map {
1191 /** \brief Get outside address and port range from inside address
1192 @param client_index - opaque cookie to identify the sender
1193 @param context - sender context, to match reply w/ request
1194 @param is_nat44 - 1 if NAT44
1195 @param in_addr - inside IP address
1197 define nat_det_forward {
1204 /** \brief Get outside address and port range from inside address
1205 @param context - sender context, to match reply w/ request
1206 @param retval - return code
1207 @param out_port_lo - outside port range start
1208 @param out_port_hi - outside port range end
1209 @param out_addr - outside IPv4 address
1211 define nat_det_forward_reply {
1219 /** \brief Get inside address from outside address and port
1220 @param client_index - opaque cookie to identify the sender
1221 @param context - sender context, to match reply w/ request
1222 @param out_port - outside port
1223 @param out_addr - outside IPv4 address
1225 define nat_det_reverse {
1232 /** \brief Get inside address from outside address and port reply
1233 @param context - sender context, to match reply w/ request
1234 @param retval - return code
1235 @param is_nat44 - 1 if NAT44
1236 @param in_addr - inside IP address
1238 define nat_det_reverse_reply {
1245 /** \brief Dump NAT deterministic mappings
1246 @param client_index - opaque cookie to identify the sender
1247 @param context - sender context, to match reply w/ request
1249 define nat_det_map_dump {
1254 /** \brief NAT users response
1255 @param context - sender context, to match reply w/ request
1256 @param is_nat44 - 1 if NAT44
1257 @param in_addr - inside IP address
1258 @param in_plen - inside IP address prefix length
1259 @param out_addr - outside IPv4 address
1260 @param out_plen - outside IPv4 address prefix length
1261 @param sharing_ratio - outside to inside address sharing ratio
1262 @param ports_per_host - number of ports available to a host
1263 @param ses_num - number of sessions belonging to this mapping
1265 define nat_det_map_details {
1277 /** \brief Set values of timeouts for deterministic NAT (seconds, 0 = default)
1278 @param client_index - opaque cookie to identify the sender
1279 @param context - sender context, to match reply w/ request
1280 @param udp - UDP timeout (default 300sec)
1281 @param tcp_established - TCP established timeout (default 7440sec)
1282 @param tcp_transitory - TCP transitory timeout (default 240sec)
1283 @param icmp - ICMP timeout (default 60sec)
1285 autoreply define nat_det_set_timeouts {
1289 u32 tcp_established;
1294 /** \brief Get values of timeouts for deterministic NAT (seconds)
1295 @param client_index - opaque cookie to identify the sender
1296 @param context - sender context, to match reply w/ request
1298 define nat_det_get_timeouts {
1303 /** \brief Get values of timeouts for deterministic NAT reply
1304 @param context - sender context, to match reply w/ request
1305 @param retval - return code
1306 @param udp - UDP timeout (default 300sec)
1307 @param tcp_established - TCP established timeout (default 7440sec)
1308 @param tcp_transitory - TCP transitory timeout (default 240sec)
1309 @param icmp - ICMP timeout (default 60sec)
1311 define nat_det_get_timeouts_reply {
1315 u32 tcp_established;
1320 /** \brief Close deterministic NAT session by outside address and port
1321 @param client_index - opaque cookie to identify the sender
1322 @param context - sender context, to match reply w/ request
1323 @param out_addr - outside IPv4 address
1324 @param out_port - outside port
1325 @param ext_addr - external host IPv4 address
1326 @param ext_port - external host port
1328 autoreply define nat_det_close_session_out {
1337 /** \brief Close deterministic NAT session by inside address and port
1338 @param client_index - opaque cookie to identify the sender
1339 @param context - sender context, to match reply w/ request
1340 @param is_nat44 - 1 if NAT44
1341 @param in_addr - inside IP address
1342 @param in_port - inside port
1343 @param ext_addr - external host IP address
1344 @param ext_port - external host port
1346 autoreply define nat_det_close_session_in {
1356 /** \brief Dump determinstic NAT sessions
1357 @param client_index - opaque cookie to identify the sender
1358 @param context - sender context, to match reply w/ request
1359 @param is_nat44 - 1 if NAT44
1360 @param user_addr - address of an inside user whose sessions to dump
1362 define nat_det_session_dump {
1369 /** \brief Deterministic NAT sessions reply
1370 @param context - sender context, to match reply w/ request
1371 @param in_port - inside port
1372 @param ext_addr - external host address
1373 @param ext_port - external host port
1374 @param out_port - outside NAT port
1375 @param state - session state
1376 @param expire - session expiration timestamp
1378 define nat_det_session_details {
1393 /** \brief Add/delete address range to NAT64 pool
1394 @param client_index - opaque cookie to identify the sender
1395 @param context - sender context, to match reply w/ request
1396 @param start_addr - start address of the range
1397 @param end_addr - end address of the range
1398 @param vrf_id - VRF id of tenant, ~0 means independent of VRF
1399 @param is_add - 1 if add, 0 if delete
1401 autoreply define nat64_add_del_pool_addr_range {
1410 /** \brief Dump NAT64 pool addresses
1411 @param client_index - opaque cookie to identify the sender
1412 @param context - sender context, to match reply w/ request
1414 define nat64_pool_addr_dump {
1419 /** \brief NAT64 pool address details response
1420 @param context - sender context, to match reply w/ request
1421 @param address - IPv4 address
1422 @param vfr_id - VRF id of tenant, ~0 means independent of VRF
1424 define nat64_pool_addr_details {
1430 /** \brief Enable/disable NAT64 feature on the interface
1431 @param client_index - opaque cookie to identify the sender
1432 @param context - sender context, to match reply w/ request
1433 @param sw_if_index - index of the interface
1434 @param is_inside - 1 if inside, 0 if outside
1435 @param is_add - 1 if add, 0 if delete
1437 autoreply define nat64_add_del_interface {
1445 /** \brief Dump interfaces with NAT64 feature
1446 @param client_index - opaque cookie to identify the sender
1447 @param context - sender context, to match reply w/ request
1449 define nat64_interface_dump {
1454 /** \brief NAT64 interface details response
1455 @param context - sender context, to match reply w/ request
1456 @param is_inside - 1 if inside, 0 if outside
1457 @param sw_if_index - index of the interface
1459 define nat64_interface_details {
1465 /** \brief Add/delete NAT64 static BIB entry
1466 @param client_index - opaque cookie to identify the sender
1467 @param context - sender context, to match reply w/ request
1468 @param i_addr - inside IPv6 address
1469 @param o_addr - outside IPv4 address
1470 @param i_port - inside port number
1471 @param o_port - outside port number
1472 @param vrf_id - VRF id of tenant
1473 @param proto - protocol number
1474 @param is_add - 1 if add, 0 if delete
1476 autoreply define nat64_add_del_static_bib {
1488 /** \brief Dump NAT64 BIB
1489 @param client_index - opaque cookie to identify the sender
1490 @param context - sender context, to match reply w/ request
1491 @param proto - protocol of the BIB: 255 - all BIBs
1495 otherwise - "unknown" protocol BIB
1497 define nat64_bib_dump {
1503 /** \brief NAT64 BIB details response
1504 @param context - sender context, to match reply w/ request
1505 @param i_addr - inside IPv6 address
1506 @param o_addr - outside IPv4 address
1507 @param i_port - inside port number
1508 @param o_port - outside port number
1509 @param vrf_id - VRF id of tenant
1510 @param proto - protocol number
1511 @param is_static - 1 if static BIB entry, 0 if dynamic
1512 @param ses_num - number of sessions associated with the BIB entry
1514 define nat64_bib_details {
1526 /** \brief Set values of timeouts for NAT64 (seconds, 0 = default)
1527 @param client_index - opaque cookie to identify the sender
1528 @param context - sender context, to match reply w/ request
1529 @param udp - UDP timeout (default 300sec)
1530 @param icmp - ICMP timeout (default 60sec)
1531 @param tcp_trans - TCP transitory timeout (default 240sec)
1532 @param tcp_est - TCP established timeout (default 7440sec)
1533 @param tcp_incoming_syn - TCP incoming SYN timeout (default 6sec)
1535 autoreply define nat64_set_timeouts {
1542 u32 tcp_incoming_syn;
1545 /** \brief Get values of timeouts for NAT64 (seconds)
1546 @param client_index - opaque cookie to identify the sender
1547 @param context - sender context, to match reply w/ request
1549 define nat64_get_timeouts {
1554 /** \brief Get values of timeouts for NAT64 reply
1555 @param context - sender context, to match reply w/ request
1556 @param retval - return code
1557 @param udp - UDP timeout
1558 @param icmp - ICMP timeout
1559 @param tcp_trans - TCP transitory timeout
1560 @param tcp_est - TCP established timeout
1561 @param tcp_incoming_syn - TCP incoming SYN timeout
1563 define nat64_get_timeouts_reply {
1570 u32 tcp_incoming_syn;
1573 /** \brief Dump NAT64 session table
1574 @param client_index - opaque cookie to identify the sender
1575 @param context - sender context, to match reply w/ request
1576 @param proto - protocol of the session table: 255 - all STs
1580 otherwise - "unknown" proto ST
1582 define nat64_st_dump {
1588 /** \brief NAT64 session table details response
1589 @param context - sender context, to match reply w/ request
1590 @param il_addr - inside IPv6 address of the local host
1591 @param ol_addr - outside IPv4 address of the local host
1592 @param il_port - inside port number id of the local host/inside ICMP id
1593 @param ol_port - outside port number of the local host/outside ICMP id
1594 @param il_addr - inside IPv6 address of the remote host
1595 @param ol_addr - outside IPv4 address of the remote host
1596 @param l_port - port number of the remote host (not used for ICMP)
1597 @param vrf_id - VRF id of tenant
1598 @param proto - protocol number
1600 define nat64_st_details {
1613 /** \brief Add/del NAT64 prefix
1614 @param client_index - opaque cookie to identify the sender
1615 @param context - sender context, to match reply w/ request
1616 @param prefix - NAT64 prefix
1617 @param prefix - NAT64 prefix length
1618 @param vrf_id - VRF id of tenant
1619 @param is_add - 1 if add, 0 if delete
1621 autoreply define nat64_add_del_prefix {
1630 /** \brief Dump NAT64 prefix
1631 @param client_index - opaque cookie to identify the sender
1632 @param context - sender context, to match reply w/ request
1634 define nat64_prefix_dump {
1639 /** \brief Dump NAT64 prefix details response
1640 @param context - sender context, to match reply w/ request
1641 @param prefix - NAT64 prefix
1642 @param prefix - NAT64 prefix length
1643 @param vrf_id - VRF id of tenant
1645 define nat64_prefix_details {
1652 /** \brief Add/delete NAT64 pool address from specific interfce
1653 @param client_index - opaque cookie to identify the sender
1654 @param context - sender context, to match reply w/ request
1655 @param is_add - 1 if add, 0 if delete
1656 @param sw_if_index - software index of the interface
1658 autoreply define nat64_add_del_interface_addr {
1671 /** \brief Add/delete address range to DS-Lite pool
1672 @param client_index - opaque cookie to identify the sender
1673 @param context - sender context, to match reply w/ request
1674 @param start_addr - start address of the range
1675 @param end_addr - end address of the range
1676 @param is_add - 1 if add, 0 if delete
1678 autoreply define dslite_add_del_pool_addr_range {
1686 autoreply define dslite_set_aftr_addr {