diff options
author | João Valverde <j@v6e.pt> | 2021-09-16 16:04:11 +0100 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2021-09-16 20:55:03 +0100 |
commit | 8c4a479c52c7c4abdef7eb82fd0c2d704cd14c0e (patch) | |
tree | 0990798dfe9182bbecc5a020871a93ce837b4349 /wsutil/to_str.h | |
parent | cc1e5b83349d837fe442883842170230fc7a400c (diff) |
Move more numerical functions to wsutil/to_str.h
Diffstat (limited to 'wsutil/to_str.h')
-rw-r--r-- | wsutil/to_str.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/wsutil/to_str.h b/wsutil/to_str.h index 0ad18b972d..d43141dc7c 100644 --- a/wsutil/to_str.h +++ b/wsutil/to_str.h @@ -15,6 +15,7 @@ #include <ws_symbol_export.h> #include <wsutil/wmem/wmem.h> +#include <wsutil/inet_ipv6.h> #ifdef __cplusplus extern "C" { @@ -279,6 +280,22 @@ WS_DLL_PUBLIC char *int_to_str_back(char *ptr, gint32 value); */ WS_DLL_PUBLIC char *int64_to_str_back(char *ptr, gint64 value); +WS_DLL_PUBLIC void guint32_to_str_buf(guint32 u, gchar *buf, int buf_len); + +WS_DLL_PUBLIC void guint64_to_str_buf(guint64 u, gchar *buf, int buf_len); + +WS_DLL_PUBLIC void ip_to_str_buf(const guint8 *ad, gchar *buf, const int buf_len); + +/* Returns length of the result. */ +WS_DLL_PUBLIC int ip6_to_str_buf(const ws_in6_addr *ad, gchar *buf, int buf_size); + +/* Returns length of the result. Takes a prefix to be inserted before the address. */ +WS_DLL_PUBLIC int ip6_to_str_buf_with_pfx(const ws_in6_addr *ad, gchar *buf, int buf_size, const char *prefix); + +WS_DLL_PUBLIC gchar *ipxnet_to_str_punct(wmem_allocator_t *scope, const guint32 ad, const char punct); + +WS_DLL_PUBLIC gchar *eui64_to_str(wmem_allocator_t *scope, const guint64 ad); + #ifdef __cplusplus } #endif /* __cplusplus */ |