dpdk: expose xstats in stats segment
[vpp.git] / src / vnet / ip / ip_types_api.c
index 72a16ad..7a9d4d6 100644 (file)
 #include <vlibapi/api_types.h>
 #include <vnet/ip/ip_types_api.h>
 
-#define vl_typedefs            /* define message structures */
-#include <vnet/vnet_all_api_h.h>
-#undef vl_typedefs
-
-#define vl_endianfun           /* define message structures */
-#include <vnet/vnet_all_api_h.h>
-#undef vl_endianfun
-
-/* instantiate all the print functions we know about */
-#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
-#define vl_printfun
-#include <vnet/vnet_all_api_h.h>
-#undef vl_printfun
-
 int
 ip_address_family_decode (vl_api_address_family_t af,
                          ip_address_family_t * out)
@@ -107,6 +93,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)
 {