ipsec: Support MPLS over IPSec[46] interface
[vpp.git] / src / vnet / ip / ip_types_api.c
index 98fb528..6e5f997 100644 (file)
@@ -107,6 +107,32 @@ ip_dscp_encode (ip_dscp_t dscp)
   return ((vl_api_ip_dscp_t) dscp);
 }
 
+int
+ip_feature_location_decode (vl_api_ip_feature_location_t loc,
+                           ip_feature_location_t * out)
+{
+  /* Not all feature_locationcol are defined in vl_api_ip_feature_location_t
+   * so we must cast to a different type.
+   */
+  switch (loc)
+    {
+#define _(n,s)                                    \
+      case IP_API_FEATURE_##n:                    \
+        *out = IP_FEATURE_##n;                    \
+        return (0);
+      foreach_ip_feature_location
+#undef _
+    }
+  return (VNET_API_ERROR_FEATURE_DISABLED);
+}
+
+vl_api_ip_feature_location_t
+ip_feature_location_encode (ip_feature_location_t loc)
+{
+  return ((vl_api_ip_feature_location_t) (loc));
+}
+
+
 void
 ip6_address_encode (const ip6_address_t * in, vl_api_ip6_address_t out)
 {
@@ -292,7 +318,6 @@ void
 ip_mprefix_encode (const mfib_prefix_t * in, vl_api_mprefix_t * out)
 {
   out->af = (FIB_PROTOCOL_IP6 == in->fp_proto ? ADDRESS_IP6 : ADDRESS_IP4);
-  out->af = out->af;
   out->grp_address_length = clib_host_to_net_u16 (in->fp_len);
 
   ip_address_union_encode (&in->fp_grp_addr, out->af, &out->grp_address);