NAT: update nat_show_config_reply API (VPP-1403)
[vpp.git] / src / plugins / nat / nat.api
index 23c89ad..45e504f 100644 (file)
@@ -13,7 +13,7 @@
  * limitations under the License.
  */
 
-option version = "2.4.1";
+option version = "3.1.0";
 
 /**
  * @file nat.api
@@ -67,6 +67,8 @@ define nat_show_config
     @param static_mapping_only - if 1 dynamic translations disabled
     @param static_mapping_connection_tracking - if 1 create session data
     @param deterministic - if 1 deterministic mapping
+    @param endpoint_dependent - if 1 endpoint-dependent mode
+    @param out2in_dpo - if 1 out2in dpo mode
     @param translation_buckets - number of translation hash buckets
     @param translation_memory_size - translation hash memory size
     @param user_buckets - number of user hash buckets
@@ -74,6 +76,11 @@ define nat_show_config
     @param max_translations_per_user - maximum number of translations per user
     @param outside_vrf_id - outside VRF id
     @param inside_vrf_id - default inside VRF id
+    @param dslite_ce - if DS-Lite is CE/B4 element, if 0 AFTR elemet
+    @param nat64_bib_buckets - number of NAT64 BIB hash buckets
+    @param nat64_bib_memory_size - memory size of NAT64 BIB hash
+    @param nat64_st_buckets - number of NAT64 session table hash buckets
+    @param nat64_st_memory_size - memory size of NAT64 session table hash
 */
 define nat_show_config_reply
 {
@@ -82,6 +89,8 @@ define nat_show_config_reply
   u8 static_mapping_only;
   u8 static_mapping_connection_tracking;
   u8 deterministic;
+  u8 endpoint_dependent;
+  u8 out2in_dpo;
   u32 translation_buckets;
   u32 translation_memory_size;
   u32 user_buckets;
@@ -89,6 +98,11 @@ define nat_show_config_reply
   u32 max_translations_per_user;
   u32 outside_vrf_id;
   u32 inside_vrf_id;
+  u8 dslite_ce;
+  u32 nat64_bib_buckets;
+  u32 nat64_bib_memory_size;
+  u32 nat64_st_buckets;
+  u32 nat64_st_memory_size;
 };
 
 /** \brief Set NAT workers
@@ -558,6 +572,14 @@ define nat44_user_session_dump {
     @param last_heard - last heard timer
     @param total_bytes - count of bytes sent through session
     @param total_pkts - count of pakets sent through session
+    @param is_twicenat - 1 if session is twice-nat
+    @param ext_host_valid - 1 if external host address and port are valid
+    @param ext_host_address - external host IPv4 address
+    @param ext_host_port - external host port
+    @param ext_host_nat_address - post-NAT external host IPv4 address (valid
+                                  only if twice-nat session)
+    @param ext_host_nat_port - post-NAT external host port (valid only if
+                               twice-nat session)
 */
 define nat44_user_session_details {
   u32 context;
@@ -570,6 +592,12 @@ define nat44_user_session_details {
   u64 last_heard;
   u64 total_bytes;
   u32 total_pkts;
+  u8 is_twicenat;
+  u8 ext_host_valid;
+  u8 ext_host_address[4];
+  u16 ext_host_port;
+  u8 ext_host_nat_address[4];
+  u16 ext_host_nat_port;
 };
 
 /** \brief NAT44 load-balancing address and port pair
@@ -581,6 +609,7 @@ typeonly manual_endian define nat44_lb_addr_port {
   u8 addr[4];
   u16 port;
   u8 probability;
+  u32 vrf_id;
 };
 
 /** \brief Add/delete NAT44 load-balancing static mapping rule
@@ -590,7 +619,6 @@ typeonly manual_endian define nat44_lb_addr_port {
     @param external_addr - external IPv4 address of the service
     @param external_port - external L4 port number of the service
     @param protocol - IP protocol number of the service
-    @param vrf_id - internal network VRF ID
     @param twice_nat - if 1 translate external host address and port
     @param self_twice_nat - if 1 translate external host address and port
                             whenever external host address equals
@@ -607,7 +635,6 @@ autoreply manual_endian define nat44_add_del_lb_static_mapping {
   u8 external_addr[4];
   u16 external_port;
   u8 protocol;
-  u32 vrf_id;
   u8 twice_nat;
   u8 self_twice_nat;
   u8 out2in_only;
@@ -631,7 +658,6 @@ define nat44_lb_static_mapping_dump {
     @param external_addr - external IPv4 address of the service
     @param external_port - external L4 port number of the service
     @param protocol - IP protocol number of the service
-    @param vrf_id - internal network VRF ID
     @param twice_nat - if 1 translate external host address and port
     @param self_twice_nat - if 1 translate external host address and port
                             whenever external host address equals
@@ -646,7 +672,6 @@ manual_endian define nat44_lb_static_mapping_details {
   u8 external_addr[4];
   u16 external_port;
   u8 protocol;
-  u32 vrf_id;
   u8 twice_nat;
   u8 self_twice_nat;
   u8 out2in_only;
@@ -663,6 +688,9 @@ manual_endian define nat44_lb_static_mapping_details {
     @param protocol - IP protocol
     @param port - port number
     @param vfr_id - VRF ID
+    @param ext_host_valid - 1 if external host address and port are valid
+    @param ext_host_address - external host IPv4 address
+    @param ext_host_port - external host port
 */
 autoreply define nat44_del_session {
   u32 client_index;
@@ -672,6 +700,9 @@ autoreply define nat44_del_session {
   u8 protocol;
   u16 port;
   u32 vrf_id;
+  u8 ext_host_valid;
+  u8 ext_host_address[4];
+  u16 ext_host_port;
 };
 
 /** \brief Enable/disable forwarding for NAT44
@@ -920,7 +951,6 @@ define nat_det_session_dump {
     @param expire - session expiration timestamp
 */
 define nat_det_session_details {
-  u32 client_index;
   u32 context;
   u16 in_port;
   u8 ext_addr[4];