X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlibapi%2Fapi_types.h;h=406ccfa67454661cdc1a936c9b6ea8457851619e;hb=003d5da298b2cd1e20400fb5fdcefce752ca616e;hp=8a86612f0fb804aa72621e3a6b3df81442c6e58e;hpb=91bfa6e2666c56f79cc97407c929d188cb34e90f;p=vpp.git diff --git a/src/vlibapi/api_types.h b/src/vlibapi/api_types.h index 8a86612f0fb..406ccfa6745 100644 --- a/src/vlibapi/api_types.h +++ b/src/vlibapi/api_types.h @@ -21,6 +21,8 @@ #define included_api_types_h #include +#include +#include /* VPP API string type */ typedef struct @@ -32,8 +34,8 @@ typedef struct 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); + memcpy(str->buf, buf, len); + str->length = htonl (len); return len + sizeof (u32); } @@ -47,13 +49,13 @@ vl_api_from_api_string (vl_api_string_t * astr) static inline u32 vl_api_string_len (vl_api_string_t * astr) { - return clib_net_to_host_u32 (astr->length); + return ntohl (astr->length); } static inline char * vl_api_from_api_string_c (vl_api_string_t *astr) { - return strndup((char *)astr->buf, clib_net_to_host_u32(astr->length)); + return strndup((char *)astr->buf, ntohl (astr->length)); } #endif