NAT44: LB NAT - local backends in multiple VRFs (VPP-1345)
[vpp.git] / src / plugins / nat / nat.api
index 24aa5d1..26d0fba 100644 (file)
@@ -13,7 +13,7 @@
  * limitations under the License.
  */
 
-option version = "2.5.0";
+option version = "3.0.0";
 
 /**
  * @file nat.api
@@ -558,7 +558,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_closed - 1 if TCP session is closed
+    @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;
@@ -571,7 +578,12 @@ define nat44_user_session_details {
   u64 last_heard;
   u64 total_bytes;
   u32 total_pkts;
-  u8 is_closed;
+  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
@@ -583,6 +595,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
@@ -592,7 +605,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
@@ -609,7 +621,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;
@@ -633,7 +644,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
@@ -648,7 +658,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;
@@ -665,6 +674,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;
@@ -674,6 +686,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