sr: API cleanup
[vpp.git] / src / vnet / srmpls / sr_mpls.api
index 2c98141..4c91818 100644 (file)
  * under the License.
  */
 
-option version = "1.0.0";
+option version = "2.0.0";
+
+import "vnet/interface_types.api";
+import "vnet/ip/ip_types.api";
 
 /** \brief MPLS SR policy add
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
-    @param bsid is the bindingSID of the SR Policy. MPLS label (20bit)
-    @param weight is the weight of the sid list. optional.
-    @param type is the type of the SR policy. (0.Default // 1.Spray)
-    @param segments vector of labels (20bit) composing the segment list
+    @param bsid is the bindingSID of the SR Policy. MPLS label (20bit)
+    @param weight is the weight of the sid list. optional.
+    @param is_spray - is the type of the SR policy. (0.Default // 1.Spray)
+    @param segments vector of labels (20bit) composing the segment list
 */
 autoreply define sr_mpls_policy_add
 {
@@ -29,11 +32,20 @@ autoreply define sr_mpls_policy_add
   u32 context;
   u32 bsid;
   u32 weight;
-  u8 type;
+  bool is_spray;
   u8 n_segments;
   u32 segments[n_segments];
 };
 
+enum sr_mpls_policy_op
+{
+  SR_MPLS_POLICY_OP_API_NONE = 0,
+  SR_MPLS_POLICY_OP_API_ADD = 1,
+  SR_MPLS_POLICY_OP_API_DEL = 2,
+  SR_MPLS_POLICY_OP_API_MOD = 3,
+
+};
+
 /** \brief MPLS SR policy modification
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
@@ -51,7 +63,7 @@ autoreply define sr_mpls_policy_mod
   u32 client_index;
   u32 context;
   u32 bsid;
-  u8 operation;
+  vl_api_sr_mpls_policy_op_t operation;
   u32 sl_index;
   u32 weight;
   u8 n_segments;
@@ -74,30 +86,25 @@ autoreply define sr_mpls_policy_del
     @param client_index - opaque cookie to identify the sender
     @param context - sender context, to match reply w/ request
     @param is_del
-    @param bsid is the bindingSID of the SR Policy (~0 is no bsid)
-    @param table_id is the VRF where to install the FIB entry for the BSID
-    @param prefix is the IPv4/v6 address for L3 traffic type. If IPv4 (first 4B).
-    @param mask_width is the mask for L3 traffic type
-    @param sw_if_index is the incoming interface for L2 traffic
-    @param traffic_type describes the type of traffic
-    @param next_hop describes the next_hop (in case no BSID)
-    @param nh_type describes type of NH (IPv4=4, IPv6=6)
-    @param color describes the color
-    @param co_bits are the CO_bits of the steering policy
-    @param vpn_label is an additonal last VPN label. (~0 is no label)
+    @param bsid - is the bindingSID of the SR Policy (~0 is no bsid)
+    @param table_id - is the VRF where to install the FIB entry for the BSID
+    @param prefix - is the IPv4/v6 address for L3 traffic type.
+    @param mask_width - is the mask for L3 traffic type
+    @param next_hop - describes the next_hop (in case no BSID)
+    @param color - describes the color
+    @param co_bits - are the CO_bits of the steering policy
+    @param vpn_label - is an additonal last VPN label. (~0 is no label)
 */
 autoreply define sr_mpls_steering_add_del
 {
   u32 client_index;
   u32 context;
-  u8 is_del;
+  bool is_del[default = false];
   u32 bsid;
   u32 table_id;
-  u8 prefix_addr[16];
+  vl_api_prefix_t prefix;
   u32 mask_width;
-  u8 traffic_type;
-  u8 next_hop[16];
-  u8 nh_type;
+  vl_api_address_t next_hop;
   u32 color;
   u8 co_bits;
   u32 vpn_label;
@@ -108,7 +115,6 @@ autoreply define sr_mpls_steering_add_del
     @param context - sender context, to match reply w/ request
     @param bsid is the bindingSID of the SR Policy
     @param endpoint is the endpoint of the SR policy
-    @param endpoint_type describes type of NH (IPv4=4, IPv6=6)
     @param color is the color of the sr policy
 */
 autoreply define sr_mpls_policy_assign_endpoint_color
@@ -116,8 +122,7 @@ autoreply define sr_mpls_policy_assign_endpoint_color
   u32 client_index;
   u32 context;
   u32 bsid;
-  u8 endpoint[16];
-  u8 endpoint_type;
+  vl_api_address_t endpoint;
   u32 color;
 };