FD.io VPP  v21.06
Vector Packet Processing
nat44_ed.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.3.0";
17 import "vnet/ip/ip_types.api";
18 import "vnet/interface_types.api";
19 import "plugins/nat/lib/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 {
59  option deprecated;
69  bool enable;
70  vl_api_nat44_config_flags_t flags;
71 };
72 
73 /** \brief Enable/disable NAT44ED plugin
74  @param client_index - opaque cookie to identify the sender
75  @param context - sender context, to match reply w/ request
76  @param inside_vrf - inside vrf id
77  @param outside_vrf - outside vrf id
78  @param sessions - maximum number of sessions per thread
79  @param session_memory - overwrite hash allocation parameter
80  @param enable - true if enable, false if disable
81  @param flags - flag NAT44_IS_STATIC_MAPPING_ONLY,
82  NAT44_IS_CONNECTION_TRACKING
83 */
84 autoreply define nat44_ed_plugin_enable_disable {
85  option in_progress;
92  bool enable;
93  vl_api_nat44_config_flags_t flags;
94 };
95 
96 /** \brief Control ping from client to api server request
97  @param client_index - opaque cookie to identify the sender
98  @param context - sender context, to match reply w/ request
99 */
100 define nat_control_ping
101 {
102  option deprecated;
105 };
106 
107 /** \brief Control ping from the client to the server response
108  @param client_index - opaque cookie to identify the sender
109  @param context - sender context, to match reply w/ request
110  @param retval - return code for the request
111  @param vpe_pid - the pid of the vpe, returned by the server
112 */
113 define nat_control_ping_reply
114 {
115  option deprecated;
120 };
121 
122 /** \brief Show NAT plugin startup config
123  @param client_index - opaque cookie to identify the sender
124  @param context - sender context, to match reply w/ request
125 */
126 define nat_show_config
127 {
128  option deprecated;
131 };
132 
133 /** \brief DEPRECATED: Show NAT plugin startup config reply
134  @param context - sender context, to match reply w/ request
135  @param retval - return code for the request
136  @param static_mapping_only - if true dynamic translations disabled
137  @param static_mapping_connection_tracking - if true create session data
138  @param deterministic - if true deterministic mapping
139  @param endpoint_dependent - if true endpoint-dependent mode
140  @param out2in_dpo - if true out2in dpo mode
141  @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
142  @param translation_buckets - number of translation hash buckets
143  @param translation_memory_size - translation hash memory size
144  @param user_buckets - number of user hash buckets
145  @param user_memory_size - user hash memory size
146  @param max_translations_per_user - maximum number of translations per user
147  @param outside_vrf_id - outside VRF id
148  @param inside_vrf_id - default inside VRF id
149  @param nat64_bib_buckets - number of NAT64 BIB hash buckets
150  @param nat64_bib_memory_size - memory size of NAT64 BIB hash
151  @param nat64_st_buckets - number of NAT64 session table hash buckets
152  @param nat64_st_memory_size - memory size of NAT64 session table hash
153 */
154 define nat_show_config_reply
155 {
156  option deprecated;
164  bool dslite_ce;
176 };
177 
178 /** \brief Show NAT plugin startup config
179  @param client_index - opaque cookie to identify the sender
180  @param context - sender context, to match reply w/ request
181 */
182 define nat_show_config_2
183 {
184  option deprecated;
187 };
188 
189 /** \brief Show NAT plugin startup config reply
190  @param context - sender context, to match reply w/ request
191  @param retval - return code for the request
192  @param static_mapping_only - if true dynamic translations disabled
193  @param static_mapping_connection_tracking - if true create session data
194  @param deterministic - if true deterministic mapping
195  @param endpoint_dependent - if true endpoint-dependent mode
196  @param out2in_dpo - if true out2in dpo mode
197  @param dslite_ce - if true DS-Lite is CE/B4 element, if false AFTR elemet
198  @param translation_buckets - number of translation hash buckets
199  @param translation_memory_size - translation hash memory size
200  @param user_buckets - number of user hash buckets
201  @param user_memory_size - user hash memory size
202  @param max_translations_per_user - maximum number of translations per user
203  @param outside_vrf_id - outside VRF id
204  @param inside_vrf_id - default inside VRF id
205  @param nat64_bib_buckets - number of NAT64 BIB hash buckets
206  @param nat64_bib_memory_size - memory size of NAT64 BIB hash
207  @param nat64_st_buckets - number of NAT64 session table hash buckets
208  @param nat64_st_memory_size - memory size of NAT64 session table hash
209  @param max_translations_per_thread - max translations per worker thread
210  @param max_users_per_thread - max users per worker thread
211 */
212 define nat_show_config_2_reply
213 {
214  option deprecated;
222  bool dslite_ce;
236 };
237 
238 /** \brief Show NAT44 plugin running config
239  @param client_index - opaque cookie to identify the sender
240  @param context - sender context, to match reply w/ request
241 */
242 define nat44_show_running_config
243 {
244  option in_progress;
247 };
248 
249 /** \brief Show NAT44 plugin running config reply
250  @param context - sender context, to match reply w/ request
251  @param retval - return code for the request
252  @param inside_vrf - default inside VRF id
253  @param outside_vrf - outside VRF id
254  @param users - maximum number of users per worker thread
255  (NAT44_IS_ENDPOINT_INDEPENDENT)
256  @param sessions - maximum number of sessions per worker thread
257  @param user_sessions - maximum number of sessions per user
258  (NAT44_IS_ENDPOINT_INDEPENDENT)
259  @param user_buckets - number of user hash buckets
260  (NAT44_IS_ENDPOINT_INDEPENDENT)
261  @param translation_buckets - number of translation hash buckets
262  @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT,
263  NAT44_IS_ENDPOINT_DEPENDENT,
264  NAT44_IS_STATIC_MAPPING_ONLY,
265  NAT44_IS_CONNECTION_TRACKING,
266  NAT44_IS_OUT2IN_DPO
267 */
268 define nat44_show_running_config_reply
269 {
270  option in_progress;
282  vl_api_nat_timeouts_t timeouts;
283  vl_api_nat_log_level_t log_level;
284  vl_api_nat44_config_flags_t flags;
285 };
286 
287 /** \brief Run nat44 garbage collection
288  @param client_index - opaque cookie to identify the sender
289  @param context - sender context, to match reply w/ request
290 */
291 autoreply define nat44_session_cleanup {
292  option deprecated;
295 };
296 
297 /** \brief NAT44 set session limit
298  @param client_index - opaque cookie to identify the sender
299  @param context - sender context, to match reply w/ request
300  @param session_limit - session limit
301  @param vrf_id - vrf id
302 */
303 autoreply define nat44_set_session_limit {
308 };
309 
310 /** \brief Set NAT logging level
311  @param client_index - opaque cookie to identify the sender
312  @param context - sender context, to match reply w/ request
313  @param log_level - logging level
314 */
315 autoreply define nat_set_log_level {
316  option deprecated;
319  vl_api_nat_log_level_t log_level;
320 };
321 
322 /** \brief Set NAT workers
323  @param client_index - opaque cookie to identify the sender
324  @param context - sender context, to match reply w/ request
325  @param worker_mask - NAT workers mask
326 */
327 autoreply define nat_set_workers {
331 };
332 
333 /** \brief Dump NAT workers
334  @param client_index - opaque cookie to identify the sender
335  @param context - sender context, to match reply w/ request
336 */
337 define nat_worker_dump {
340 };
341 
342 /** \brief NAT workers details response
343  @param context - sender context, to match reply w/ request
344  @param worker_index - worker index
345  @param lcore_id - lcore ID
346  @param name - worker name
347 */
348 define nat_worker_details {
352  string name[64];
353 };
354 
355 /** \brief Enable/disable NAT IPFIX logging
356  @param client_index - opaque cookie to identify the sender
357  @param context - sender context, to match reply w/ request
358  @param domain_id - observation domain ID
359  @param src_port - source port number
360  @param enable - true if enable, false if disable
361 */
362 autoreply define nat_ipfix_enable_disable {
363  option deprecated;
368  bool enable;
369 };
370 
371 /** \brief Set values of timeouts for NAT sessions (seconds)
372  @param client_index - opaque cookie to identify the sender
373  @param context - sender context, to match reply w/ request
374  @param udp - UDP timeout (default 300sec)
375  @param tcp_established - TCP established timeout (default 7440sec)
376  @param tcp_transitory - TCP transitory timeout (default 240sec)
377  @param icmp - ICMP timeout (default 60sec)
378 */
379 autoreply define nat_set_timeouts {
380  option deprecated;
387 };
388 
389 /** \brief Get values of timeouts for NAT sessions (seconds)
390  @param client_index - opaque cookie to identify the sender
391  @param context - sender context, to match reply w/ request
392 */
393 define nat_get_timeouts {
394  option deprecated;
397 };
398 
399 /** \brief Get values of timeouts for NAT sessions reply
400  @param context - sender context, to match reply w/ request
401  @param retval - return code
402  @param udp - UDP timeout
403  @param tcp_established - TCP established timeout
404  @param tcp_transitory - TCP transitory timeout
405  @param icmp - ICMP timeout
406 */
407 define nat_get_timeouts_reply {
408  option deprecated;
415 };
416 
417 /** \brief Set address and port assignment algorithm
418  @param client_index - opaque cookie to identify the sender
419  @param context - sender context, to match reply w/ request
420  @param alg - address and port assignment algorithm:
421  0 - default, 1 - MAP-E, 2 - port range
422  (see nat_addr_and_port_alloc_alg_t in nat.h)
423  @param psid_offset - number of offset bits (valid only for MAP-E alg)
424  @param psid_length - length of PSID (valid only for MAP-E alg)
425  @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
426  @param start_port - beginning of the port range
427  @param end_port - end of the port range
428 */
429 autoreply define nat_set_addr_and_port_alloc_alg {
438 };
439 
440 /** \brief Get address and port assignment algorithm
441  @param client_index - opaque cookie to identify the sender
442  @param context - sender context, to match reply w/ request
443 */
444 define nat_get_addr_and_port_alloc_alg {
447 };
448 
449 /** \brief Get address and port assignment algorithm reply
450  @param context - sender context, to match reply w/ request
451  @param retval - return code
452  @param alg - address and port assignment algorithm:
453  0 - default, 1 - MAP-E, 2 - port range
454  (see nat_addr_and_port_alloc_alg_t in nat.h)
455  @param psid_offset - number of offset bits (valid only for MAP-E alg)
456  @param psid_length - length of PSID (valid only for MAP-E alg)
457  @param psid - Port Set Identifier (PSID) value (valid only for MAP-E alg)
458  @param start_port - beginning of the port range
459  @param end_port - end of the port range
460 */
461 define nat_get_addr_and_port_alloc_alg_reply {
470 };
471 
472 /** \brief Set TCP MSS rewriting configuration
473  @param client_index - opaque cookie to identify the sender
474  @param context - sender context, to match reply w/ request
475  @param mss_value - MSS value to be used for MSS rewriting
476  @param enable - if true enable MSS rewriting feature else disable
477 */
478 autoreply define nat_set_mss_clamping {
482  bool enable;
483 };
484 
485 /** \brief Get TCP MSS rewriting configuration
486  @param client_index - opaque cookie to identify the sender
487  @param context - sender context, to match reply w/ request
488 */
489 define nat_get_mss_clamping {
492 };
493 
494 /** \brief Get TCP MSS rewriting configuration reply
495  @param context - sender context, to match reply w/ request
496  @param retval - return code
497  @param mss_value - MSS value to be used for MSS rewriting
498  @param enable - if true enable MSS rewriting feature else disable
499 */
500 define nat_get_mss_clamping_reply {
504  bool enable;
505 };
506 
507 /** \brief Set HA listener (local settings)
508  @param client_index - opaque cookie to identify the sender
509  @param context - sender context, to match reply w/ request
510  @param ip_address - local IP4 address
511  @param port - local UDP port number
512  @param path_mtu - path MTU between local and failover
513 */
514 autoreply define nat_ha_set_listener {
517  vl_api_ip4_address_t ip_address;
520 };
521 
522 /** \brief Set HA failover (remote settings)
523  @param client_index - opaque cookie to identify the sender
524  @param context - sender context, to match reply w/ request
525  @param ip_address - failover IP4 address
526  @param port - failvoer UDP port number
527  @param session_refresh_interval - number of seconds after which to send
528  session counters refresh
529 */
530 autoreply define nat_ha_set_failover {
533  vl_api_ip4_address_t ip_address;
536 };
537 
538 /** \brief Get HA listener/local configuration
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 listener/local configuration reply
548  @param context - sender context, to match reply w/ request
549  @param retval - return code
550  @param ip_address - local IP4 address
551  @param port - local UDP port number
552  @param path_mtu - Path MTU between local and failover
553 */
554 define nat_ha_get_listener_reply {
557  vl_api_ip4_address_t ip_address;
560 };
561 
562 /** \brief Get HA failover/remote settings
563  @param client_index - opaque cookie to identify the sender
564  @param context - sender context, to match reply w/ request
565 */
569 };
570 
571 /** \brief Get HA failover/remote settings reply
572  @param context - sender context, to match reply w/ request
573  @param retval - return code
574  @param ip_address - failover IP4 address
575  @param port - failvoer UDP port number
576  @param session_refresh_interval - number of seconds after which to send
577  session counters refresh
578 */
579 define nat_ha_get_failover_reply {
582  vl_api_ip4_address_t ip_address;
585 };
586 
587 /** \brief Flush the current HA data (for testing)
588  @param client_index - opaque cookie to identify the sender
589  @param context - sender context, to match reply w/ request
590 */
591 autoreply define nat_ha_flush {
594 };
595 
596 /** \brief Resync HA (resend existing sessions to new failover)
597  @param client_index - opaque cookie to identify the sender
598  @param context - sender context, to match reply w/ request
599  @param want_resync_event - resync completed event sent to the sender via
600  nat_ha_resync_completed_event API message if
601  non-zero
602  @param pid - sender's pid
603 */
604 autoreply define nat_ha_resync
605 {
610 };
611 
612 /** \brief Tell client about a HA resync completion event
613  @param client_index - opaque cookie to identify the sender
614  @param pid - client pid registered to receive notification
615  @param missed_count - number of missed (not ACKed) messages
616 */
617 define nat_ha_resync_completed_event
618 {
622 };
623 
625  rpc nat_ha_resync returns nat_ha_resync_reply events nat_ha_resync_completed_event;
626 };
627 
628 /** \brief Del NAT44 user
629  @param client_index - opaque cookie to identify the sender
630  @param context - sender context, to match reply w/ request
631  @param ip_address - IPv4 address
632  @param fib_index - FIB index
633 */
634 autoreply define nat44_del_user {
637  vl_api_ip4_address_t ip_address;
639 };
640 
641 /** \brief Add/del NAT44 address range
642  @param client_index - opaque cookie to identify the sender
643  @param context - sender context, to match reply w/ request
644  @param first_ip_address - first IPv4 address
645  @param last_ip_address - last IPv4 address
646  @param vrf_id - VRF id of tenant, ~0 means independent of VRF
647  @param is_add - true if add, false if delete
648  @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
649 
650 */
651 autoreply define nat44_add_del_address_range {
654  vl_api_ip4_address_t first_ip_address;
655  vl_api_ip4_address_t last_ip_address;
657  bool is_add;
658  vl_api_nat_config_flags_t flags;
659 };
660 
661 /** \brief Dump NAT44 addresses
662  @param client_index - opaque cookie to identify the sender
663  @param context - sender context, to match reply w/ request
664 */
665 define nat44_address_dump {
668 };
669 
670 /** \brief NAT44 address details response
671  @param context - sender context, to match reply w/ request
672  @param ip_address - IPv4 address
673  @param flags - flag NAT_IS_TWICE_NAT if NAT address range for external hosts
674  @param vrf_id - VRF id of tenant, ~0 means independent of VRF
675 */
676 define nat44_address_details {
678  vl_api_ip4_address_t ip_address;
679  vl_api_nat_config_flags_t flags;
681 };
682 
683 /** \brief Enable/disable NAT44 feature on the interface
684  @param client_index - opaque cookie to identify the sender
685  @param context - sender context, to match reply w/ request
686  @param is_add - true if add, false if delete
687  @param flags - flag NAT_IS_INSIDE if interface is inside else
688  interface is outside
689  @param sw_if_index - software index of the interface
690 */
691 autoreply define nat44_interface_add_del_feature {
694  bool is_add;
695  vl_api_nat_config_flags_t flags;
696  vl_api_interface_index_t sw_if_index;
697 };
698 
699 /** \brief Dump interfaces with NAT44 feature
700  @param client_index - opaque cookie to identify the sender
701  @param context - sender context, to match reply w/ request
702 */
703 define nat44_interface_dump {
706 };
707 
708 /** \brief NAT44 interface details response
709  @param context - sender context, to match reply w/ request
710  @param sw_if_index - software index of the interface
711  @param flags - flag NAT_IS_INSIDE if interface is inside,
712  flag NAT_IS_OUTSIDE if interface is outside
713  and if both flags are set the interface is
714  both inside and outside
715 */
716 define nat44_interface_details {
718  vl_api_nat_config_flags_t flags;
719  vl_api_interface_index_t sw_if_index;
720 };
721 
722 /** \brief Enable/disbale NAT44 as an interface output feature (postrouting
723  in2out translation)
724  @param client_index - opaque cookie to identify the sender
725  @param context - sender context, to match reply w/ request
726  @param is_add - true if add, false if delete
727  @param flags - flag NAT_IS_INSIDE if interface is inside else
728  interface is outside
729  @param sw_if_index - software index of the interface
730 */
731 autoreply define nat44_interface_add_del_output_feature {
734  bool is_add;
735  vl_api_nat_config_flags_t flags;
736  vl_api_interface_index_t sw_if_index;
737 };
738 
739 /** \brief Dump interfaces with NAT44 output feature
740  @param client_index - opaque cookie to identify the sender
741  @param context - sender context, to match reply w/ request
742 */
743 define nat44_interface_output_feature_dump {
746 };
747 
748 /** \brief NAT44 interface with output feature details response
749  @param context - sender context, to match reply w/ request
750  @param flags - flag NAT_IS_INSIDE if interface is inside else
751  interface is outside
752  @param sw_if_index - software index of the interface
753 */
754 define nat44_interface_output_feature_details {
756  vl_api_nat_config_flags_t flags;
757  vl_api_interface_index_t sw_if_index;
758 };
759 
760 /** \brief Add/delete NAT44 static mapping
761  @param client_index - opaque cookie to identify the sender
762  @param context - sender context, to match reply w/ request
763  @param is_add - true if add, false if delete
764  @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
765  flag nat_is_twice_nat if nat address range for external hosts,
766  flag NAT_IS_SELF_TWICE_NAT if translate external host address
767  and port whenever external host address equals local
768  address of internal host,
769  flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
770  @param local_ip_address - local IPv4 address
771  @param external_ip_address - external IPv4 address
772  @param protocol - IP protocol, used only if addr_only=0
773  @param local_port - local port number, used only if addr_only=0
774  @param external_port - external port number, used only if addr_only=0
775  @param external_sw_if_index - external interface (if set
776  external_ip_address is ignored, ~0 means not
777  used)
778  @param vfr_id - VRF ID
779  @param tag - opaque string tag
780 */
781 autoreply define nat44_add_del_static_mapping {
784  bool is_add;
785  vl_api_nat_config_flags_t flags;
786  vl_api_ip4_address_t local_ip_address;
787  vl_api_ip4_address_t external_ip_address;
791  vl_api_interface_index_t external_sw_if_index;
793  string tag[64];
794 };
795 
796 /** \brief Add/delete NAT44 static mapping
797  @param client_index - opaque cookie to identify the sender
798  @param context - sender context, to match reply w/ request
799  @param is_add - true if add, false if delete
800  @param match_pool - true if use specific pool_ip_address
801  @param flags - flag NAT_IS_ADDR_ONLY if address only mapping,
802  flag nat_is_twice_nat if nat address range for external hosts,
803  flag NAT_IS_SELF_TWICE_NAT if translate external host address
804  and port whenever external host address equals local
805  address of internal host,
806  flag NAT_IS_OUT2IN_ONLY if rule match only out2in direction
807  @param pool_ip_address - pool IPv4 address to match with pool
808  @param local_ip_address - local IPv4 address
809  @param external_ip_address - external IPv4 address
810  @param protocol - IP protocol, used only if addr_only=0
811  @param local_port - local port number, used only if addr_only=0
812  @param external_port - external port number, used only if addr_only=0
813  @param external_sw_if_index - external interface (if set
814  external_ip_address is ignored, ~0 means not
815  used)
816  @param vfr_id - VRF ID
817  @param tag - opaque string tag
818 */
819 autoreply define nat44_add_del_static_mapping_v2 {
820  option in_progress;
823  bool is_add;
825  vl_api_nat_config_flags_t flags;
826  vl_api_ip4_address_t pool_ip_address;
827  vl_api_ip4_address_t local_ip_address;
828  vl_api_ip4_address_t external_ip_address;
832  vl_api_interface_index_t external_sw_if_index;
834  string tag[64];
835 };
836 
837 /** \brief Dump NAT44 static mappings
838  @param client_index - opaque cookie to identify the sender
839  @param context - sender context, to match reply w/ request
840 */
841 define nat44_static_mapping_dump {
844 };
845 
846 /** \brief NAT44 static mapping details response
847  @param context - sender context, to match reply w/ request
848  @param flags - flag NAT_ADDR_ONLY if address only mapping,
849  flag NAT_TWICE_NAT if NAT address range for external hosts,
850  flag NAT_SELF_TWICE_NAT if translate external host address
851  and port whenever external host address equals local
852  address of internal host,
853  flag NAT_OUT2IN_ONLY if rule match only out2in direction
854  @param local_ip_address - local IPv4 address
855  @param external_ip_address - external IPv4 address
856  @param protocol - IP protocol, valid only if no NAT_ADDR_ONLY flag
857  @param local_port - local port number, valid only if no NAT_ADDR_ONLY flag
858  @param external_port - external port number, valid only if no NAT_ADDR_ONLY flag
859  @param external_sw_if_index - external interface
860  @param vfr_id - VRF ID
861  @param tag - opaque string tag
862 */
863 define nat44_static_mapping_details {
865  vl_api_nat_config_flags_t flags;
866  vl_api_ip4_address_t local_ip_address;
867  vl_api_ip4_address_t external_ip_address;
871  vl_api_interface_index_t external_sw_if_index;
873  string tag[64];
874 };
875 
876 /** \brief Add/delete NAT44 identity mapping
877  @param client_index - opaque cookie to identify the sender
878  @param context - sender context, to match reply w/ request
879  @param is_add - true if add, false if delete
880  @param flags - flag NAT_ADDR_ONLY if address only mapping
881  @param ip_address - IPv4 address
882  @param protocol - IP protocol
883  @param port - port number
884  @param sw_if_index - interface (if set ip_address is ignored, ~0 means not
885  used)
886  @param vfr_id - VRF ID (if ~0 use default VRF)
887  @param tag - opaque string tag
888 */
889 autoreply define nat44_add_del_identity_mapping {
892  bool is_add;
893  vl_api_nat_config_flags_t flags;
894  vl_api_ip4_address_t ip_address;
897  vl_api_interface_index_t sw_if_index;
899  string tag[64];
900 };
901 
902 /** \brief Dump NAT44 identity mappings
903  @param client_index - opaque cookie to identify the sender
904  @param context - sender context, to match reply w/ request
905 */
906 define nat44_identity_mapping_dump {
909 };
910 
911 /** \brief NAT44 identity mapping details response
912  @param context - sender context, to match reply w/ request
913  @param flags - flag NAT_ADDR_ONLY if address only mapping
914  @param ip_address - IPv4 address
915  @param protocol - IP protocol
916  @param port - port number
917  @param sw_if_index - interface
918  @param vfr_id - VRF ID
919  @param tag - opaque string tag
920 */
921 define nat44_identity_mapping_details {
923  vl_api_nat_config_flags_t flags;
924  vl_api_ip4_address_t ip_address;
927  vl_api_interface_index_t sw_if_index;
929  string tag[64];
930 };
931 
932 /** \brief Add/delete NAT44 pool address from specific interfce
933  @param client_index - opaque cookie to identify the sender
934  @param context - sender context, to match reply w/ request
935  @param is_add - true if add, false if delete
936  @param sw_if_index - software index of the interface
937  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
938 */
939 autoreply define nat44_add_del_interface_addr {
942  bool is_add;
943  vl_api_interface_index_t sw_if_index;
944  vl_api_nat_config_flags_t flags;
945 };
946 
947 /** \brief Dump NAT44 pool addresses interfaces
948  @param client_index - opaque cookie to identify the sender
949  @param context - sender context, to match reply w/ request
950 */
951 define nat44_interface_addr_dump {
954 };
955 
956 /** \brief NAT44 pool addresses interfaces details response
957  @param context - sender context, to match reply w/ request
958  @param sw_if_index - software index of the interface
959  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts
960 
961 */
962 define nat44_interface_addr_details {
964  vl_api_interface_index_t sw_if_index;
965  vl_api_nat_config_flags_t flags;
966 };
967 
968 /** \brief Dump NAT44 users
969  @param client_index - opaque cookie to identify the sender
970  @param context - sender context, to match reply w/ request
971 */
972 define nat44_user_dump {
975 };
976 
977 /** \brief NAT44 users response
978  @param context - sender context, to match reply w/ request
979  @vrf_id - VRF ID
980  @param ip_address - IPv4 address
981  @param nsessions - number of dynamic sessions
982  @param nstaticsessions - number of static sessions
983 */
984 define nat44_user_details {
987  vl_api_ip4_address_t ip_address;
990 };
991 
992 /** \brief NAT44 user's sessions
993  @param client_index - opaque cookie to identify the sender
994  @param context - sender context, to match reply w/ request
995  @param ip_address - IPv4 address of the user to dump
996  @param vrf_id - VRF_ID
997 */
998 define nat44_user_session_dump {
1001  vl_api_ip4_address_t ip_address;
1003 };
1004 
1005 /** \brief NAT44 user's sessions response
1006  @param context - sender context, to match reply w/ request
1007  @param outside_ip_address - outside IPv4 address
1008  @param outside_port - outside port
1009  @param inside_ip_address - inside IPv4 address
1010  @param inside_port - inside port
1011  @param protocol - protocol
1012  @param flags - flag NAT_IS_STATIC if session is static,
1013  flag NAT_IS_TWICE_NAT if session is twice-nat,
1014  flag NAT_IS_EXT_HOST_VALID if external host address
1015  and port are valid
1016  @param last_heard - last heard timer
1017  @param total_bytes - count of bytes sent through session
1018  @param total_pkts - count of pakets sent through session
1019  @param ext_host_address - external host IPv4 address
1020  @param ext_host_port - external host port
1021  @param ext_host_nat_address - post-NAT external host IPv4 address (valid
1022  only if twice-nat session)
1023  @param ext_host_nat_port - post-NAT external host port (valid only if
1024  twice-nat session)
1025 */
1026 define nat44_user_session_details {
1028  vl_api_ip4_address_t outside_ip_address;
1030  vl_api_ip4_address_t inside_ip_address;
1033  vl_api_nat_config_flags_t flags;
1037  vl_api_ip4_address_t ext_host_address;
1039  vl_api_ip4_address_t ext_host_nat_address;
1041 };
1042 
1043 /** \brief NAT44 load-balancing address and port pair
1044  @param addr - IPv4 address of the internal node
1045  @param port - L4 port number of the internal node
1046  @param probability - probability of the internal node to be randomly matched
1047  @param vrf_id - VRF id
1048 */
1050  vl_api_ip4_address_t addr;
1054 };
1055 
1056 /** \brief Add/delete NAT44 load-balancing static mapping rule
1057  @param client_index - opaque cookie to identify the sender
1058  @param context - sender context, to match reply w/ request
1059  @param is_add - true if add, false if delete
1060  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1061  flag NAT_SELF_TWICE_NAT if translate external host address
1062  and port whenever external host address equals local
1063  address of internal host,
1064  flag NAT_OUT2IN_ONLY if rule match only out2in direction
1065  @param external_addr - external IPv4 address of the service
1066  @param external_port - external L4 port number of the service
1067  @param protocol - IP protocol number of the service
1068  @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1069  in seconds
1070  @param local_num - number of local network nodes
1071  @param locals - local network nodes
1072  @param tag - opaque string tag
1073 */
1077  bool is_add;
1078  vl_api_nat_config_flags_t flags;
1079  vl_api_ip4_address_t external_addr;
1083  string tag[64];
1085  vl_api_nat44_lb_addr_port_t locals[local_num];
1086 };
1087 
1088 /** \brief Add/delete NAT44 load-balancing static mapping rule backend
1089  @param client_index - opaque cookie to identify the sender
1090  @param context - sender context, to match reply w/ request
1091  @param is_add - true if add, false if delete
1092  @param external_addr - external IPv4 address of the service
1093  @param external_port - external L4 port number of the service
1094  @param protocol - IP protocol number of the service
1095  @param local - local network node
1096 */
1100  bool is_add;
1101  vl_api_ip4_address_t external_addr;
1104  vl_api_nat44_lb_addr_port_t local;
1105 };
1106 
1107 /** \brief Dump NAT44 load-balancing static mapping rules
1108  @param client_index - opaque cookie to identify the sender
1109  @param context - sender context, to match reply w/ request
1110 */
1111 define nat44_lb_static_mapping_dump {
1114 };
1115 
1116 /** \brief NAT44 load-balancing static mapping rule details response
1117  @param context - sender context, to match reply w/ request
1118  @param external_addr - external IPv4 address of the service
1119  @param external_port - external L4 port number of the service
1120  @param protocol - IP protocol number of the service
1121  @param flags - flag NAT_TWICE_NAT if NAT address range for external hosts,
1122  flag NAT_SELF_TWICE_NAT if translate external host address
1123  and port whenever external host address equals local
1124  address of internal host,
1125  flag NAT_OUT2IN_ONLY if rule match only out2in direction
1126  @param affinity - if 0 disabled, otherwise client IP affinity sticky time
1127  in seconds
1128  @param local_num - number of local network nodes
1129  @param locals - local network nodes
1130  @param tag - opaque string tag
1131 */
1132 define nat44_lb_static_mapping_details {
1134  vl_api_ip4_address_t external_addr;
1137  vl_api_nat_config_flags_t flags;
1139  string tag[64];
1141  vl_api_nat44_lb_addr_port_t locals[local_num];
1142 };
1143 
1144 /** \brief Delete NAT44 session
1145  @param client_index - opaque cookie to identify the sender
1146  @param context - sender context, to match reply w/ request
1147  @param ip_address - IPv4 address
1148  @param protocol - IP protocol
1149  @param port - port number
1150  @param vfr_id - VRF ID
1151  @param flags - flag NAT_IS_INSIDE if interface is inside or
1152  interface is outside,
1153  flag NAT_IS_EXT_HOST_VALID if external host address and
1154  port are valid
1155  @param ext_host_address - external host IPv4 address
1156  @param ext_host_port - external host port
1157 */
1158 autoreply define nat44_del_session {
1161  vl_api_ip4_address_t address;
1165  vl_api_nat_config_flags_t flags;
1166  vl_api_ip4_address_t ext_host_address;
1168 };
1169 
1170 /** \brief Enable/disable forwarding for NAT44
1171  Forward packets which don't match existing translation
1172  or static mapping instead of dropping them.
1173  @param client_index - opaque cookie to identify the sender
1174  @param context - sender context, to match reply w/ request
1175  @param enable - true for enable, false for disable
1176 */
1177 autoreply define nat44_forwarding_enable_disable {
1178  option deprecated;
1181  bool enable;
1182 };
1183 
1184 /** \brief Check if forwarding is enabled or disabled
1185  @param client_index - opaque cookie to identify the sender
1186  @param context - sender context, to match reply w/ request
1187 */
1188 define nat44_forwarding_is_enabled {
1189  option deprecated;
1192 };
1193 
1194 /** \brief Response to check if forwarding is enabled or disabled
1195  @param context - sender context, to match reply w/ request
1196  @param enabled - true if enabled, false if disabled
1197 */
1198 define nat44_forwarding_is_enabled_reply {
1199  option deprecated;
1201  bool enabled;
1202 };
1203 
1204 /** \brief Set NAT handoff frame queue options
1205  @param client_index - opaque cookie to identify the sender
1206  @param context - sender context, to match reply w/ request
1207  @param frame_queue_nelts - number of worker handoff frame queue elements
1208 */
1209 autoreply define nat44_ed_set_fq_options {
1210  option in_progress;
1214 };
1215 
1216 /** \brief Show NAT handoff frame queue options
1217  @param client_index - opaque cookie to identify the sender
1218  @param context - sender context, to match reply w/ request
1219 */
1220 define nat44_ed_show_fq_options
1221 {
1222  option in_progress;
1225 };
1226 
1227 /** \brief Show NAT handoff frame queue options reply
1228  @param context - sender context, to match reply w/ request
1229  @param retval - return code for the request
1230  @param frame_queue_nelts - number of worker handoff frame queue elements
1231 */
1232 define nat44_ed_show_fq_options_reply
1233 {
1234  option in_progress;
1238 };
vl_api_ip4_address_t ext_host_address
Definition: nat44_ed.api:1037
vl_api_interface_index_t external_sw_if_index
Definition: nat44_ed.api:832
int nat_ha_set_failover(vlib_main_t *vm, ip4_address_t *addr, u16 port, u32 session_refresh_interval)
Set HA failover (remote settings)
Definition: nat44_ei_ha.c:540
vl_api_interface_index_t sw_if_index
Definition: nat44_ed.api:943
vl_api_interface_index_t external_sw_if_index
Definition: nat44_ed.api:791
vl_api_nat44_config_flags_t flags
Definition: nat44_ed.api:70
vl_api_interface_index_t sw_if_index
Definition: nat44_ed.api:696
unsigned long u64
Definition: types.h:89
u32 vrf_id
Definition: nat44_ed.api:1053
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:893
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:718
vl_api_ip4_address_t local_ip_address
Definition: nat44_ed.api:786
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:582
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:695
vl_api_ip4_address_t first_ip_address
Definition: nat44_ed.api:654
string name[64]
Definition: fib.api:25
vhost_vring_addr_t addr
Definition: vhost_user.h:130
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:965
unsigned char u8
Definition: types.h:56
int nat_ha_set_listener(vlib_main_t *vm, ip4_address_t *addr, u16 port, u32 path_mtu)
Set HA listener (local settings)
Definition: nat44_ei_ha.c:495
unsigned int u32
Definition: types.h:88
nat44_config_flags
Definition: nat44_ed.api:29
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:825
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:923
static perfmon_event_t events[]
Definition: core.c:21
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:1001
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:1165
vl_api_ip4_address_t external_ip_address
Definition: nat44_ed.api:828
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:1033
service
Definition: nat44_ed.api:624
int nat44_set_session_limit(u32 session_limit, u32 vrf_id)
Set NAT44 session limit (session limit, vrf id)
Definition: nat44_ed.c:2770
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:658
u8 probability
Definition: nat44_ed.api:1052
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:1078
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:865
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:1137
unsigned short u16
Definition: types.h:57
vl_api_ip4_address_t external_ip_address
Definition: nat44_ed.api:867
vl_api_ip4_address_t ext_host_nat_address
Definition: nat44_ed.api:1039
vl_api_ip4_address_t outside_ip_address
Definition: nat44_ed.api:1028
vl_api_ip4_address_t address
Definition: nat44_ed.api:1161
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:637
typedef nat44_lb_addr_port
NAT44 load-balancing address and port pair.
Definition: nat44_ed.api:1049
vl_api_ip4_address_t last_ip_address
Definition: nat44_ed.api:655
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:678
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: nat44_ed.c:1084
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:517
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:944
vl_api_ip4_address_t ext_host_address
Definition: nat44_ed.api:1166
signed int i32
Definition: types.h:77
vl_api_nat44_config_flags_t flags
Definition: nat44_ed.api:93
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: nat44_ed.c:856
void nat_ha_get_failover(ip4_address_t *addr, u16 *port, u32 *session_refresh_interval)
Get HA failover/remote settings.
Definition: nat44_ei_ha.c:555
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: nat44_ei_ha.c:1283
void nat_ha_flush(u8 is_resync)
Flush the current HA data (for testing)
Definition: nat44_ei_ha.c:827
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:785
vl_api_interface_index_t sw_if_index
Definition: nat44_ed.api:927
vl_api_interface_index_t external_sw_if_index
Definition: nat44_ed.api:871
vl_api_interface_index_t sw_if_index
Definition: nat44_ed.api:719
vl_api_interface_index_t sw_if_index
Definition: nat44_ed.api:964
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:987
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:533
vl_api_interface_index_t sw_if_index
Definition: nat44_ed.api:897
option version
Definition: nat44_ed.api:16
vl_api_ip4_address_t external_ip_address
Definition: nat44_ed.api:787
vl_api_ip4_address_t inside_ip_address
Definition: nat44_ed.api:1030
void nat_ha_get_listener(ip4_address_t *addr, u16 *port, u32 *path_mtu)
Get HA listener/local configuration.
Definition: nat44_ei_ha.c:530
vl_api_nat_config_flags_t flags
Definition: nat44_ed.api:679
vl_api_ip4_address_t local_ip_address
Definition: nat44_ed.api:866
u16 port
Definition: nat44_ed.api:1051
vl_api_nat_log_level_t log_level
Definition: nat44_ed.api:319
vl_api_ip4_address_t ip_address
Definition: nat44_ed.api:557
vl_api_nat44_config_flags_t flags
Definition: nat44_ed.api:284