summaryrefslogtreecommitdiffstats
path: root/src/vlibapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlibapi')
-rw-r--r--src/vlibapi/api_types.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vlibapi/api_types.h b/src/vlibapi/api_types.h
index ffcd24d12b2..8a86612f0fb 100644
--- a/src/vlibapi/api_types.h
+++ b/src/vlibapi/api_types.h
@@ -50,4 +50,10 @@ vl_api_string_len (vl_api_string_t * astr)
return clib_net_to_host_u32 (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));
+}
+
#endif