api: string type to convert to vector
[vpp.git] / src / vlibapi / api_types.h
index ffcd24d..0289a41 100644 (file)
@@ -21,6 +21,8 @@
 #define included_api_types_h
 
 #include <vppinfra/types.h>
+#include <arpa/inet.h>
+#include <string.h>
 
 /* VPP API string type */
 typedef struct
@@ -29,25 +31,4 @@ typedef struct
   u8 buf[0];
 } __attribute__ ((packed)) vl_api_string_t;
 
-static inline int
-vl_api_to_api_string (u32 len, const char *buf, vl_api_string_t * str)
-{
-  clib_memcpy(str->buf, buf, len);
-  str->length = clib_host_to_net_u32 (len);
-  return len + sizeof (u32);
-}
-
-/* Return a pointer to the API string (not nul terminated */
-static inline u8 *
-vl_api_from_api_string (vl_api_string_t * astr)
-{
-  return astr->buf;
-}
-
-static inline u32
-vl_api_string_len (vl_api_string_t * astr)
-{
-  return clib_net_to_host_u32 (astr->length);
-}
-
 #endif