FD.io VPP  v21.01.1
Vector Packet Processing
nat44.api
Go to the documentation of this file.
1 /*
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:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15 
16 option version = "5.2.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/nat_types.api";
20 
21 /**
22  * @file nat44.api
23  * @brief VPP control-plane API messages.
24  *
25  * This file defines VPP control-plane API messages which are generally
26  * called through a shared memory interface.
27  */
28 
30 {
36 };
37 
38 /** \brief Enable/disable NAT44 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 users - maximum number of users per thread
44  (NAT44_IS_ENDPOINT_INDEPENDENT)
45  @param user_memory - overwrite hash allocation parameter
46  (NAT44_IS_ENDPOINT_INDEPENDENT)
47  @param sessions - maximum number of sessions per thread
48  @param session_memory - overwrite hash allocation parameter
49  @param user_sessions - maximum number of sessions per user
50  (NAT44_IS_ENDPOINT_INDEPENDENT)
51  @param enable - true if enable, false if disable
52  @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
53  NAT44_IS_ENDPOINT_DEPENDENT,
54  NAT44_IS_STATIC_MAPPING_ONLY,
55  NAT44_IS_CONNECTION_TRACKING,
56  NAT44_IS_OUT2IN_DPO
57 */
58 autoreply define nat44_plugin_enable_disable {
68  bool enable;
69  vl_api_nat44_config_flags_t flags;
70 };
71 
72 /** \brief Control ping from client to api server request
73  @param client_index - opaque cookie to identify the sender
74  @param context - sender context, to match reply w/ request
75 */
76 define nat_control_ping
77 {
78  option deprecated;
81 };
82 
83 /** \brief Control ping from the client to the server response
84  @param client_index - opaque cookie to identify the sender
85  @param context - sender context, to match reply w/ request
86  @param retval - return code for the request
87  @param vpe_pid - the pid of the vpe, returned by the server
88 */
89 define nat_control_ping_reply
90 {
91  option deprecated;
96 };
97 
98 /** \brief Show NAT plugin startup config
99  @param client_index - opaque cookie to identify the sender
100  @param context - sender context, to match reply w/ request
101 */
102 define nat_show_config
103 {
104  option deprecated;
107 };
108 
109 /** \brief DEPRECATED: Show NAT plugin startup config reply
110  @param context - sender context, to match reply w/ request
111  @param retval - return code for the request
112  @param static_mapping_only - if true dynamic translations disabled
113  @param static_mapping_connection_tracking - if true create session data
114  @param deterministic - if true deterministic mapping
115  @param endpoint_dependent - if true endpoint-dependent mode
116  @param out2in_dpo - if true out2in dpo mode
117  @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
118  @param translation_buckets - number of translation hash buckets
119  @param translation_memory_size - translation hash memory size
120  @param user_buckets - number of user hash buckets
121  @param user_memory_size - user hash memory size
122  @param max_translations_per_user - maximum number of translations per user
123  @param outside_vrf_id - outside VRF id
124  @param inside_vrf_id - default inside VRF id
125  @param nat64_bib_buckets - number of NAT64 BIB hash buckets
126  @param nat64_bib_memory_size - memory size of NAT64 BIB hash
127  @param nat64_st_buckets - number of NAT64 session table hash buckets
128  @param nat64_st_memory_size - memory size of NAT64 session table hash
129 */
130 define nat_show_config_reply
131 {
132  option deprecated;
140  bool dslite_ce;
152 };
153 
154 /** \brief Show NAT plugin startup config
155  @param client_index - opaque cookie to identify the sender
156  @param context - sender context, to match reply w/ request
157 */
158 define nat_show_config_2
159 {
160  option deprecated;
163 };
164 
165 /** \brief Show NAT plugin startup config reply
166  @param context - sender context, to match reply w/ request
167  @param retval - return code for the request
168  @param static_mapping_only - if true dynamic translations disabled
169  @param static_mapping_connection_tracking - if true create session data
170  @param deterministic - if true deterministic mapping
171  @param endpoint_dependent - if true endpoint-dependent mode
172  @param out2in_dpo - if true out2in dpo mode
173  @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
174  @param translation_buckets - number of translation hash buckets
175  @param translation_memory_size - translation hash memory size
176  @param user_buckets - number of user hash buckets
177  @param user_memory_size - user hash memory size
178  @param max_translations_per_user - maximum number of translations per user
179  @param outside_vrf_id - outside VRF id
180  @param inside_vrf_id - default inside VRF id
181  @param nat64_bib_buckets - number of NAT64 BIB hash buckets
182  @param nat64_bib_memory_size - memory size of NAT64 BIB hash
183  @param nat64_st_buckets - number of NAT64 session table hash buckets
184  @param nat64_st_memory_size - memory size of NAT64 session table hash
185  @param max_translations_per_thread - max translations per worker thread
186  @param max_users_per_thread - max users per worker thread
187 */
188 define nat_show_config_2_reply
189 {
190  option deprecated;
198  bool dslite_ce;
212 };
213 
214 /** \brief Show NAT44 plugin running config
215  @param client_index - opaque cookie to identify the sender
216  @param context - sender context, to match reply w/ request
217 */
218 define nat44_show_running_config
219 {
220  option in_progress;
223 };
224 
225 /** \brief Show NAT44 plugin running config reply
226  @param context - sender context, to match reply w/ request
227  @param retval - return code for the request
228  @param inside_vrf - default inside VRF id
229  @param outside_vrf - outside VRF id
230  @param users - maximum number of users per worker thread
231  (NAT44_IS_ENDPOINT_INDEPENDENT)
232  @param sessions - maximum number of sessions per worker thread
233  @param user_sessions - maximum number of sessions per user
234  (NAT44_IS_ENDPOINT_INDEPENDENT)
235  @param user_buckets - number of user hash buckets
236  (NAT44_IS_ENDPOINT_INDEPENDENT)
237  @param translation_buckets - number of translation hash buckets
238  @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
239  NAT44_IS_ENDPOINT_DEPENDENT,
240  NAT44_IS_STATIC_MAPPING_ONLY,
241  NAT44_IS_CONNECTION_TRACKING,
242  NAT44_IS_OUT2IN_DPO
243 */
244 define nat44_show_running_config_reply
245 {
246  option in_progress;
258  vl_api_nat_timeouts_t timeouts;
259  vl_api_nat_log_level_t log_level;
260  vl_api_nat44_config_flags_t flags;
261 };
262 
263 /** \brief Run nat44 garbage collection
264  @param client_index - opaque cookie to identify the sender
265  @param context - sender context, to match reply w/ request
266 */
267 autoreply define nat44_session_cleanup {
268  option deprecated;
271 };
272 
273 /** \brief NAT44 set session limit
274  @param client_index - opaque cookie to identify the sender
275  @param context - sender context, to match reply w/ request
276  @param session_limit - session limit
277  @param vrf_id - vrf id
278 */
279 autoreply define nat44_set_session_limit {
284 };
285 
286 /** \brief Set NAT logging level
287  @param client_index - opaque cookie to identify the sender
288  @param context - sender context, to match reply w/ request
289  @param log_level - logging level
290 */
291 autoreply define nat_set_log_level {
292  option deprecated;
295  vl_api_nat_log_level_t log_level;
296 };
297 
298 /** \brief Set NAT workers
299  @param client_index - opaque cookie to identify the sender
300  @param context - sender context, to match reply w/ request
301  @param worker_mask - NAT workers mask
302 */
303 autoreply define nat_set_workers {
307 };
308 
309 /** \brief Dump NAT workers
310  @param client_index - opaque cookie to identify the sender
311  @param context - sender context, to match reply w/ request
312 */
313 define nat_worker_dump {
316 };
317 
318 /** \brief NAT workers details response
319  @param context - sender context, to match reply w/ request
320  @param worker_index - worker index
321  @param lcore_id - lcore ID
322  @param name - worker name
323 */
324 define nat_worker_details {
328  string name[64];
329 };
330 
331 /** \brief Enable/disable NAT IPFIX logging
332  @param client_index - opaque cookie to identify the sender
333  @param context - sender context, to match reply w/ request
334  @param domain_id - observation domain ID
335  @param src_port - source port number
336  @param enable - true if enable, false if disable
337 */
338 autoreply define nat_ipfix_enable_disable {
339  option deprecated;
344  bool enable;
345 };
346 
347 /** \brief Set values of timeouts for NAT sessions (seconds)
348  @param client_index - opaque cookie to identify the sender
349  @param context - sender context, to match reply w/ request
350  @param udp - UDP timeout (default 300sec)
351  @param tcp_established - TCP established timeout (default 7440sec)
352  @param tcp_transitory - TCP transitory timeout (default 240sec)
353  @param icmp - ICMP timeout (default 60sec)
354 */
355 autoreply define nat_set_timeouts {
356  option deprecated;
363 };
364 
365 /** \brief Get values of timeouts for NAT sessions (seconds)
366  @param client_index - opaque cookie to identify the sender
367  @param context - sender context, to match reply w/ request
368 */
369 define nat_get_timeouts {
370  option deprecated;
373 };
374 
375 /** \brief Get values of timeouts for NAT sessions reply
376  @param context - sender context, to match reply w/ request
377  @param retval - return code
378  @param udp - UDP timeout
379  @param tcp_established - TCP established timeout
380  @param tcp_transitory - TCP transitory timeout
381  @param icmp - ICMP timeout
382 */
383 define nat_get_timeouts_reply {
384  option deprecated;
391 };
392 
393 /** \brief Set address and port assignment algorithm
394  @param client_index - opaque cookie to identify the sender
395  @param context - sender context, to match reply w/ request
396  @param alg - address and port assignment algorithm:
397  0 - default, 1 - MAP-E, 2 - port range
398  (see nat_addr_and_port_alloc_alg_t in nat.h)
399  @param psid_offset - number of offset bits (valid only for MAP-E alg)
400  @param psid_length - length of PSID (valid only for MAP-E alg)
401  @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
402  @param start_port - beginning of the port range
403  @param end_port - end of the port range
404 */
405 autoreply define nat_set_addr_and_port_alloc_alg {
414 };
415 
416 /** \brief Get address and port assignment algorithm
417  @param client_index - opaque cookie to identify the sender
418  @param context - sender context, to match reply w/ request
419 */
420 define nat_get_addr_and_port_alloc_alg {
423 };
424 
425 /** \brief Get address and port assignment algorithm reply
426  @param context - sender context, to match reply w/ request
427  @param retval - return code
428  @param alg - address and port assignment algorithm:
429  0 - default, 1 - MAP-E, 2 - port range
430  (see nat_addr_and_port_alloc_alg_t in nat.h)
431  @param psid_offset - number of offset bits (valid only for MAP-E alg)
432  @param psid_length - length of PSID (valid only for MAP-E alg)
433  @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
434  @param start_port - beginning of the port range
435  @param end_port - end of the port range
436 */
437 define nat_get_addr_and_port_alloc_alg_reply {
446 };
447 
448 /** \brief Set TCP MSS rewriting configuration
449  @param client_index - opaque cookie to identify the sender
450  @param context - sender context, to match reply w/ request
451  @param mss_value - MSS value to be used for MSS rewriting
452  @param enable - if true enable MSS rewriting feature else disable
453 */
454 autoreply define nat_set_mss_clamping {
458  bool enable;
459 };
460 
461 /** \brief Get TCP MSS rewriting configuration
462  @param client_index - opaque cookie to identify the sender
463  @param context - sender context, to match reply w/ request
464 */
465 define nat_get_mss_clamping {
468 };
469 
470 /** \brief Get TCP MSS rewriting configuration reply
471  @param context - sender context, to match reply w/ request
472  @param retval - return code
473  @param mss_value - MSS value to be used for MSS rewriting
474  @param enable - if true enable MSS rewriting feature else disable
475 */
476 define nat_get_mss_clamping_reply {
480  bool enable;
481 };
482 
483 /** \brief Set HA listener (local settings)
484  @param client_index - opaque cookie to identify the sender
485  @param context - sender context, to match reply w/ request
486  @param ip_address - local IP4 address
487  @param port - local UDP port number
488  @param path_mtu - path MTU between local and failover
489 */
490 autoreply define nat_ha_set_listener {
493  vl_api_ip4_address_t ip_address;
496 };
497 
498 /** \brief Set HA failover (remote settings)
499  @param client_index - opaque cookie to identify the sender
500  @param context - sender context, to match reply w/ request
501  @param ip_address - failover IP4 address
502  @param port - failvoer UDP port number
503  @param session_refresh_interval - number of seconds after which to send
504  session counters refresh
505 */
506 autoreply define nat_ha_set_failover {
509  vl_api_ip4_address_t ip_address;
512 };
513 
514 /** \brief Get HA listener/local configuration
515  @param client_index - opaque cookie to identify the sender
516  @param context - sender context, to match reply w/ request
517 */
521 };
522 
523 /** \brief Get HA listener/local configuration reply
524  @param context - sender context, to match reply w/ request
525  @param retval - return code
526  @param ip_address - local IP4 address
527  @param port - local UDP port number
528  @param path_mtu - Path MTU between local and failover
529 */
530 define nat_ha_get_listener_reply {
533  vl_api_ip4_address_t ip_address;
536 };
537 
538 /** \brief Get HA failover/remote settings
539  @param client_index - opaque cookie to identify the sender
540  @param context - sender context, to match reply w/ request
541 */
545 };
546 
547 /** \brief Get HA failover/remote settings reply
548  @param context - sender context, to match reply w/ request
549  @param retval - return code
550  @param ip_address - failover IP4 address
551  @param port - failvoer UDP port number
552  @param session_refresh_interval - number of seconds after which to send
553  session counters refresh
554 */
555 define nat_ha_get_failover_reply {
558  vl_api_ip4_address_t ip_address;
561 };
562 
563 /** \brief Flush the current HA data (for testing)
564  @param client_index - opaque cookie to identify the sender
565  @param context - sender context, to match reply w/ request
566 */
567 autoreply define nat_ha_flush {
570 };
571 
572 /** \brief Resync HA (resend existing sessions to new failover)
573  @param client_index - opaque cookie to identify the sender
574  @param context - sender context, to match reply w/ request
575  @param want_resync_event - resync completed event sent to the sender via
576  nat_ha_resync_completed_event API message if
577  non-zero
578  @param pid - sender's pid
579 */
580 autoreply define nat_ha_resync
581 {
586 };
587 
588 /** \brief Tell client about a HA resync completion event
589  @param client_index - opaque cookie to identify the sender
590  @param pid - client pid registered to receive notification
591  @param missed_count - number of missed (not ACKed) messages
592 */
593 define nat_ha_resync_completed_event
594 {
598 };
599 
601  rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
602 };
603 
604 /** \brief Del NAT44 user
605  @param client_index - opaque cookie to identify the sender
606  @param context - sender context, to match reply w/ request
607  @param ip_address - IPv4 address
608  @param fib_index - FIB index
609 */
610 autoreply define nat44_del_user {
613  vl_api_ip4_address_t ip_address;
615 };
616 
617 /** \brief Add/del NAT44 address range
618  @param client_index - opaque cookie to identify the sender
619  @param context - sender context, to match reply w/ request
620  @param first_ip_address - first IPv4 address
621  @param last_ip_address - last IPv4 address
622  @param vrf_id - VRF id of tenant, ~0 means independent of VRF
623  @param is_add - true if add, false if delete
624  @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
625 
626 */
627 autoreply define nat44_add_del_address_range {
630  vl_api_ip4_address_t first_ip_address;
631  vl_api_ip4_address_t last_ip_address;
633  bool is_add;
634  vl_api_nat_config_flags_t flags;
635 };
636 
637 /** \brief Dump NAT44 addresses
638  @param client_index - opaque cookie to identify the sender
639  @param context - sender context, to match reply w/ request
640 */
641 define nat44_address_dump {
644 };
645 
646 /** \brief NAT44 address details response
647  @param context - sender context, to match reply w/ request
648  @param ip_address - IPv4 address
649  @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
650  @param vrf_id - VRF id of tenant, ~0 means independent of VRF
651 */
652 define nat44_address_details {
654  vl_api_ip4_address_t ip_address;
655  vl_api_nat_config_flags_t flags;
657 };
658 
659 /** \brief Enable/disable NAT44 feature on the interface
660  @param client_index - opaque cookie to identify the sender
661  @param context - sender context, to match reply w/ request
662  @param is_add - true if add, false if delete
663  @param flags - flag NAT_IS_INSIDE if interface is inside else
664  interface is outside
665  @param sw_if_index - software index of the interface
666 */
667 autoreply define nat44_interface_add_del_feature {
670  bool is_add;
671  vl_api_nat_config_flags_t flags;
672  vl_api_interface_index_t sw_if_index;
673 };
674 
675 /** \brief Dump interfaces with NAT44 feature
676  @param client_index - opaque cookie to identify the sender
677  @param context - sender context, to match reply w/ request
678 */
679 define nat44_interface_dump {
682 };
683 
684 /** \brief NAT44 interface details response
685  @param context - sender context, to match reply w/ request
686  @param sw_if_index - software index of the interface
687  @param flags - flag NAT_IS_INSIDE if interface is inside,
688  flag NAT_IS_OUTSIDE if interface is outside
689  and if both flags are set the interface is
690  both inside and outside
691 */
692 define nat44_interface_details {
694  vl_api_nat_config_flags_t flags;
695  vl_api_interface_index_t sw_if_index;
696 };
697 
698 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
699  in2out translation)
700  @param client_index - opaque cookie to identify the sender
701  @param context - sender context, to match reply w/ request
702  @param is_add - true if add, false if delete
703  @param flags - flag NAT_IS_INSIDE if interface is inside else
704  interface is outside
705  @param sw_if_index - software index of the interface
706 */
707 autoreply define nat44_interface_add_del_output_feature {
710  bool is_add;
711  vl_api_nat_config_flags_t flags;
712  vl_api_interface_index_t sw_if_index;
713 };
714 
715 /** \brief Dump interfaces with NAT44 output feature
716  @param client_index - opaque cookie to identify the sender
717  @param context - sender context, to match reply w/ request
718 */
719 define nat44_interface_output_feature_dump {
722 };
723 
724 /** \brief NAT44 interface with output feature details response
725  @param context - sender context, to match reply w/ request
726  @param flags - flag NAT_IS_INSIDE if interface is inside else
727  interface is outside
728  @param sw_if_index - software index of the interface
729 */
730 define nat44_interface_output_feature_details {
732  vl_api_nat_config_flags_t flags;
733  vl_api_interface_index_t sw_if_index;
734 };
735 
736 /** \brief Add/delete NAT44 static mapping
737  @param client_index - opaque cookie to identify the sender
738  @param context - sender context, to match reply w/ request
739  @param is_add - true if add, false if delete
740  @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
741  flag nat_is_twice_nat if nat address range for external hosts,
742  flag NAT_IS_SELF_TWICE_NAT if translate external host address
743  and port whenever external host address equals local
744  address of internal host,
745  flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
746  @param local_ip_address - local IPv4 address
747  @param external_ip_address - external IPv4 address
748  @param protocol - IP protocol, used only if addr_only=0
749  @param local_port - local port number, used only if addr_only=0
750  @param external_port - external port number, used only if addr_only=0
751  @param external_sw_if_index - external interface (if set
752  external_ip_address is ignored, ~0 means not
753  used)
754  @param vfr_id - VRF ID
755  @param tag - opaque string tag
756 */
757 autoreply define nat44_add_del_static_mapping {
760  bool is_add;
761  vl_api_nat_config_flags_t flags;
762  vl_api_ip4_address_t local_ip_address;
763  vl_api_ip4_address_t external_ip_address;
767  vl_api_interface_index_t external_sw_if_index;
769  string tag[64];
770 };
771 
772 /** \brief Add/delete NAT44 static mapping
773  @param client_index - opaque cookie to identify the sender
774  @param context - sender context, to match reply w/ request
775  @param is_add - true if add, false if delete
776  @param match_pool - true if use specific pool_ip_address
777  @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
778  flag nat_is_twice_nat if nat address range for external hosts,
779  flag NAT_IS_SELF_TWICE_NAT if translate external host address
780  and port whenever external host address equals local
781  address of internal host,
782  flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
783  @param pool_ip_address - pool IPv4 address to match with pool
784  @param local_ip_address - local IPv4 address
785  @param external_ip_address - external IPv4 address
786  @param protocol - IP protocol, used only if addr_only=0
787  @param local_port - local port number, used only if addr_only=0
788  @param external_port - external port number, used only if addr_only=0
789  @param external_sw_if_index - external interface (if set
790  external_ip_address is ignored, ~0 means not
791  used)
792  @param vfr_id - VRF ID
793  @param tag - opaque string tag
794 */
795 autoreply define nat44_add_del_static_mapping_v2 {
796  option in_progress;
799  bool is_add;
801  vl_api_nat_config_flags_t flags;
802  vl_api_ip4_address_t pool_ip_address;
803  vl_api_ip4_address_t local_ip_address;
804  vl_api_ip4_address_t external_ip_address;
808  vl_api_interface_index_t external_sw_if_index;
810  string tag[64];
811 };
812 
813 /** \brief Dump NAT44 static mappings
814  @param client_index - opaque cookie to identify the sender
815  @param context - sender context, to match reply w/ request
816 */
817 define nat44_static_mapping_dump {
820 };
821 
822 /** \brief NAT44 static mapping details response
823  @param context - sender context, to match reply w/ request
824  @param flags - flag NAT_ADDR_ONLY if address only mapping,
825  flag NAT_TWICE_NAT if NAT address range for external hosts,
826  flag NAT_SELF_TWICE_NAT if translate external host address
827  and port whenever external host address equals local
828  address of internal host,
829  flag NAT_OUT2IN_ONLY if rule match only out2in direction
830  @param local_ip_address - local IPv4 address
831  @param external_ip_address - external IPv4 address
832  @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
833  @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
834  @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
835  @param external_sw_if_index - external interface
836  @param vfr_id - VRF ID
837  @param tag - opaque string tag
838 */
839 define nat44_static_mapping_details {
841  vl_api_nat_config_flags_t flags;
842  vl_api_ip4_address_t local_ip_address;
843  vl_api_ip4_address_t external_ip_address;
847  vl_api_interface_index_t external_sw_if_index;
849  string tag[64];
850 };
851 
852 /** \brief Add/delete NAT44 identity mapping
853  @param client_index - opaque cookie to identify the sender
854  @param context - sender context, to match reply w/ request
855  @param is_add - true if add, false if delete
856  @param flags - flag NAT_ADDR_ONLY if address only mapping
857  @param ip_address - IPv4 address
858  @param protocol - IP protocol
859  @param port - port number
860  @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
861  used)
862  @param vfr_id - VRF ID (if ~0 use default VRF)
863  @param tag - opaque string tag
864 */
865 autoreply define nat44_add_del_identity_mapping {
868  bool is_add;
869  vl_api_nat_config_flags_t flags;
870  vl_api_ip4_address_t ip_address;
873  vl_api_interface_index_t sw_if_index;
875  string tag[64];
876 };
877 
878 /** \brief Dump NAT44 identity mappings
879  @param client_index - opaque cookie to identify the sender
880  @param context - sender context, to match reply w/ request
881 */
882 define nat44_identity_mapping_dump {
885 };
886 
887 /** \brief NAT44 identity mapping details response
888  @param context - sender context, to match reply w/ request
889  @param flags - flag NAT_ADDR_ONLY if address only mapping
890  @param ip_address - IPv4 address
891  @param protocol - IP protocol
892  @param port - port number
893  @param sw_if_index - interface
894  @param vfr_id - VRF ID
895  @param tag - opaque string tag
896 */
897 define nat44_identity_mapping_details {
899  vl_api_nat_config_flags_t flags;
900  vl_api_ip4_address_t ip_address;
903  vl_api_interface_index_t sw_if_index;
905  string tag[64];
906 };
907 
908 /** \brief Add/delete NAT44 pool address from specific interfce
909  @param client_index - opaque cookie to identify the sender
910  @param context - sender context, to match reply w/ request
911  @param is_add - true if add, false if delete
912  @param sw_if_index - software index of the interface
913  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
914 */
915 autoreply define nat44_add_del_interface_addr {
918  bool is_add;
919  vl_api_interface_index_t sw_if_index;
920  vl_api_nat_config_flags_t flags;
921 };
922 
923 /** \brief Dump NAT44 pool addresses interfaces
924  @param client_index - opaque cookie to identify the sender
925  @param context - sender context, to match reply w/ request
926 */
927 define nat44_interface_addr_dump {
930 };
931 
932 /** \brief NAT44 pool addresses interfaces details response
933  @param context - sender context, to match reply w/ request
934  @param sw_if_index - software index of the interface
935  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
936 
937 */
938 define nat44_interface_addr_details {
940  vl_api_interface_index_t sw_if_index;
941  vl_api_nat_config_flags_t flags;
942 };
943 
944 /** \brief Dump NAT44 users
945  @param client_index - opaque cookie to identify the sender
946  @param context - sender context, to match reply w/ request
947 */
948 define nat44_user_dump {
951 };
952 
953 /** \brief NAT44 users response
954  @param context - sender context, to match reply w/ request
955  @vrf_id - VRF ID
956  @param ip_address - IPv4 address
957  @param nsessions - number of dynamic sessions
958  @param nstaticsessions - number of static sessions
959 */
960 define nat44_user_details {
963  vl_api_ip4_address_t ip_address;
966 };
967 
968 /** \brief NAT44 user's sessions
969  @param client_index - opaque cookie to identify the sender
970  @param context - sender context, to match reply w/ request
971  @param ip_address - IPv4 address of the user to dump
972  @param vrf_id - VRF_ID
973 */
974 define nat44_user_session_dump {
977  vl_api_ip4_address_t ip_address;
979 };
980 
981 /** \brief NAT44 user's sessions response
982  @param context - sender context, to match reply w/ request
983  @param outside_ip_address - outside IPv4 address
984  @param outside_port - outside port
985  @param inside_ip_address - inside IPv4 address
986  @param inside_port - inside port
987  @param protocol - protocol
988  @param flags - flag NAT_IS_STATIC if session is static,
989  flag NAT_IS_TWICE_NAT if session is twice-nat,
990  flag NAT_IS_EXT_HOST_VALID if external host address
991  and port are valid
992  @param last_heard - last heard timer
993  @param total_bytes - count of bytes sent through session
994  @param total_pkts - count of pakets sent through session
995  @param ext_host_address - external host IPv4 address
996  @param ext_host_port - external host port
997  @param ext_host_nat_address - post-NAT external host IPv4 address (valid
998  only if twice-nat session)
999  @param ext_host_nat_port - post-NAT external host port (valid only if
1000  twice-nat session)
1001 */
1002 define nat44_user_session_details {
1004  vl_api_ip4_address_t outside_ip_address;
1006  vl_api_ip4_address_t inside_ip_address;
1009  vl_api_nat_config_flags_t flags;
1013  vl_api_ip4_address_t ext_host_address;
1015  vl_api_ip4_address_t ext_host_nat_address;
1017 };
1018 
1019 /** \brief NAT44 load-balancing address and port pair
1020  @param addr - IPv4 address of the internal node
1021  @param port - L4 port number of the internal node
1022  @param probability - probability of the internal node to be randomly matched
1023  @param vrf_id - VRF id
1024 */
1026  vl_api_ip4_address_t addr;
1030 };
1031 
1032 /** \brief Add/delete NAT44 load-balancing static mapping rule
1033  @param client_index - opaque cookie to identify the sender
1034  @param context - sender context, to match reply w/ request
1035  @param is_add - true if add, false if delete
1036  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1037  flag NAT_SELF_TWICE_NAT if translate external host address
1038  and port whenever external host address equals local
1039  address of internal host,
1040  flag NAT_OUT2IN_ONLY if rule match only out2in direction
1041  @param external_addr - external IPv4 address of the service
1042  @param external_port - external L4 port number of the service
1043  @param protocol - IP protocol number of the service
1044  @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1045  in seconds
1046  @param local_num - number of local network nodes
1047  @param locals - local network nodes
1048  @param tag - opaque string tag
1049 */
1053  bool is_add;
1054  vl_api_nat_config_flags_t flags;
1055  vl_api_ip4_address_t external_addr;
1059  string tag[64];
1061  vl_api_nat44_lb_addr_port_t locals[local_num];
1062 };
1063 
1064 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
1065  @param client_index - opaque cookie to identify the sender
1066  @param context - sender context, to match reply w/ request
1067  @param is_add - true if add, false if delete
1068  @param external_addr - external IPv4 address of the service
1069  @param external_port - external L4 port number of the service
1070  @param protocol - IP protocol number of the service
1071  @param local - local network node
1072 */
1076  bool is_add;
1077  vl_api_ip4_address_t external_addr;
1080  vl_api_nat44_lb_addr_port_t local;
1081 };
1082 
1083 /** \brief Dump NAT44 load-balancing static mapping rules
1084  @param client_index - opaque cookie to identify the sender
1085  @param context - sender context, to match reply w/ request
1086 */
1087 define nat44_lb_static_mapping_dump {
1090 };
1091 
1092 /** \brief NAT44 load-balancing static mapping rule details response
1093  @param context - sender context, to match reply w/ request
1094  @param external_addr - external IPv4 address of the service
1095  @param external_port - external L4 port number of the service
1096  @param protocol - IP protocol number of the service
1097  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1098  flag NAT_SELF_TWICE_NAT if translate external host address
1099  and port whenever external host address equals local
1100  address of internal host,
1101  flag NAT_OUT2IN_ONLY if rule match only out2in direction
1102  @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1103  in seconds
1104  @param local_num - number of local network nodes
1105  @param locals - local network nodes
1106  @param tag - opaque string tag
1107 */
1108 define nat44_lb_static_mapping_details {
1110  vl_api_ip4_address_t external_addr;
1113  vl_api_nat_config_flags_t flags;
1115  string tag[64];
1117  vl_api_nat44_lb_addr_port_t locals[local_num];
1118 };
1119 
1120 /** \brief Delete NAT44 session
1121  @param client_index - opaque cookie to identify the sender
1122  @param context - sender context, to match reply w/ request
1123  @param ip_address - IPv4 address
1124  @param protocol - IP protocol
1125  @param port - port number
1126  @param vfr_id - VRF ID
1127  @param flags - flag NAT_IS_INSIDE if interface is inside or
1128  interface is outside,
1129  flag NAT_IS_EXT_HOST_VALID if external host address and
1130  port are valid
1131  @param ext_host_address - external host IPv4 address
1132  @param ext_host_port - external host port
1133 */
1134 autoreply define nat44_del_session {
1137  vl_api_ip4_address_t address;
1141  vl_api_nat_config_flags_t flags;
1142  vl_api_ip4_address_t ext_host_address;
1144 };
1145 
1146 /** \brief Enable/disable forwarding for NAT44
1147  Forward packets which don't match existing translation
1148  or static mapping instead of dropping them.
1149  @param client_index - opaque cookie to identify the sender
1150  @param context - sender context, to match reply w/ request
1151  @param enable - true for enable, false for disable
1152 */
1153 autoreply define nat44_forwarding_enable_disable {
1154  option deprecated;
1157  bool enable;
1158 };
1159 
1160 /** \brief Check if forwarding is enabled or disabled
1161  @param client_index - opaque cookie to identify the sender
1162  @param context - sender context, to match reply w/ request
1163 */
1164 define nat44_forwarding_is_enabled {
1165  option deprecated;
1168 };
1169 
1170 /** \brief Response to check if forwarding is enabled or disabled
1171  @param context - sender context, to match reply w/ request
1172  @param enabled - true if enabled, false if disabled
1173 */
1174 define nat44_forwarding_is_enabled_reply {
1175  option deprecated;
1177  bool enabled;
1178 };
vl_api_ip4_address_t ext_host_address
Definition: nat44.api:1013
vl_api_interface_index_t external_sw_if_index
Definition: nat44.api:808
vl_api_interface_index_t sw_if_index
Definition: nat44.api:919
vl_api_ip4_address_t external_addr
Definition: nat44.api:1110
int nat44_del_session(snat_main_t *sm, ip4_address_t *addr, u16 port, nat_protocol_t proto, u32 vrf_id, int is_in)
Delete NAT44 session.
Definition: nat.c:4622
vl_api_interface_index_t external_sw_if_index
Definition: nat44.api:767
vl_api_nat44_config_flags_t flags
Definition: nat44.api:69
vl_api_interface_index_t sw_if_index
Definition: nat44.api:672
vl_api_ip4_address_t external_addr
Definition: nat44.api:1055
unsigned long u64
Definition: types.h:89
vl_api_nat_config_flags_t flags
Definition: nat44.api:869
vl_api_nat_config_flags_t flags
Definition: nat44.api:694
u16 port
Definition: nat44.api:1027
vl_api_ip4_address_t local_ip_address
Definition: nat44.api:762
vl_api_ip4_address_t ip_address
Definition: nat44.api:558
u32 vrf_id
Definition: nat44.api:1029
vl_api_nat_config_flags_t flags
Definition: nat44.api:671
vl_api_ip4_address_t first_ip_address
Definition: nat44.api:630
vl_api_ip4_address_t ip_address
Definition: nat44.api:900
vhost_vring_addr_t addr
Definition: vhost_user.h:111
vl_api_nat_config_flags_t flags
Definition: nat44.api:941
unsigned char u8
Definition: types.h:56
vl_api_nat_config_flags_t flags
Definition: nat44.api:801
vl_api_nat_config_flags_t flags
Definition: nat44.api:899
nat44_config_flags
Definition: nat44.api:29
unsigned int u32
Definition: types.h:88
vl_api_ip4_address_t ip_address
Definition: nat44.api:977
vl_api_nat_config_flags_t flags
Definition: nat44.api:1141
vl_api_ip4_address_t external_ip_address
Definition: nat44.api:804
vl_api_nat_config_flags_t flags
Definition: nat44.api:1009
int nat44_set_session_limit(u32 session_limit, u32 vrf_id)
Set NAT44 session limit (session limit, vrf id)
Definition: nat.c:4253
vl_api_nat_config_flags_t flags
Definition: nat44.api:634
vl_api_nat_config_flags_t flags
Definition: nat44.api:1054
vl_api_nat_config_flags_t flags
Definition: nat44.api:841
vl_api_nat_config_flags_t flags
Definition: nat44.api:1113
unsigned short u16
Definition: types.h:57
vl_api_ip4_address_t external_ip_address
Definition: nat44.api:843
void nat_ha_get_listener(ip4_address_t *addr, u16 *port, u32 *path_mtu)
Get HA listener/local configuration.
Definition: nat_ha.c:388
void nat_ha_flush(u8 is_resync)
Flush the current HA data (for testing)
Definition: nat_ha.c:685
vl_api_ip4_address_t ext_host_nat_address
Definition: nat44.api:1015
vl_api_ip4_address_t outside_ip_address
Definition: nat44.api:1004
service
Definition: nat44.api:600
vl_api_ip4_address_t address
Definition: nat44.api:1137
vl_api_ip4_address_t ip_address
Definition: nat44.api:613
vl_api_ip4_address_t pool_ip_address
Definition: nat44.api:802
vl_api_ip4_address_t last_ip_address
Definition: nat44.api:631
vl_api_ip4_address_t ip_address
Definition: nat44.api:654
option version
Definition: nat44.api:16
vl_api_ip4_address_t ip_address
Definition: nat44.api:493
vl_api_nat_config_flags_t flags
Definition: nat44.api:920
vl_api_ip4_address_t ext_host_address
Definition: nat44.api:1142
string name[64]
Definition: ip.api:44
int nat_ha_set_listener(ip4_address_t *addr, u16 port, u32 path_mtu)
Set HA listener (local settings)
Definition: nat_ha.c:355
signed int i32
Definition: types.h:77
int nat_ha_set_failover(ip4_address_t *addr, u16 port, u32 session_refresh_interval)
Set HA failover (remote settings)
Definition: nat_ha.c:398
vl_api_nat_config_flags_t flags
Definition: nat44.api:761
typedef nat44_lb_addr_port
NAT44 load-balancing address and port pair.
Definition: nat44.api:1025
vl_api_nat_log_level_t log_level
Definition: nat44.api:259
vl_api_ip4_address_t local_ip_address
Definition: nat44.api:803
vl_api_interface_index_t sw_if_index
Definition: nat44.api:903
int nat44_lb_static_mapping_add_del_local(ip4_address_t e_addr, u16 e_port, ip4_address_t l_addr, u16 l_port, nat_protocol_t proto, u32 vrf_id, u8 probability, u8 is_add)
Definition: nat.c:1599
vl_api_interface_index_t external_sw_if_index
Definition: nat44.api:847
vl_api_interface_index_t sw_if_index
Definition: nat44.api:695
vl_api_ip4_address_t ip_address
Definition: nat44.api:870
vl_api_interface_index_t sw_if_index
Definition: nat44.api:940
vl_api_ip4_address_t ip_address
Definition: nat44.api:963
void nat_ha_get_failover(ip4_address_t *addr, u16 *port, u32 *session_refresh_interval)
Get HA failover/remote settings.
Definition: nat_ha.c:413
vl_api_ip4_address_t ip_address
Definition: nat44.api:509
vl_api_interface_index_t sw_if_index
Definition: nat44.api:873
vl_api_ip4_address_t external_ip_address
Definition: nat44.api:763
int nat_ha_resync(u32 client_index, u32 pid, nat_ha_resync_event_cb_t event_callback)
Resync HA (resend existing sessions to new failover)
Definition: nat_ha.c:1142
vl_api_ip4_address_t inside_ip_address
Definition: nat44.api:1006
int nat44_add_del_lb_static_mapping(ip4_address_t e_addr, u16 e_port, nat_protocol_t proto, nat44_lb_addr_port_t *locals, u8 is_add, twice_nat_type_t twice_nat, u8 out2in_only, u8 *tag, u32 affinity)
Add/delete static mapping with load-balancing (multiple backends)
Definition: nat.c:1365
vl_api_nat_config_flags_t flags
Definition: nat44.api:655
vl_api_ip4_address_t local_ip_address
Definition: nat44.api:842
vl_api_nat_timeouts_t timeouts
Definition: nat44.api:258
vl_api_nat_log_level_t log_level
Definition: nat44.api:295
vl_api_nat44_lb_addr_port_t local
Definition: nat44.api:1080
u8 probability
Definition: nat44.api:1028
vl_api_ip4_address_t ip_address
Definition: nat44.api:533
vl_api_nat44_config_flags_t flags
Definition: nat44.api:260