12#ifndef __WSUTIL_TO_STR_H__
13#define __WSUTIL_TO_STR_H__
51WS_DLL_PUBLIC
char *
word_to_hex(
char *out, uint16_t word);
92WS_DLL_PUBLIC
char *
dword_to_hex(
char *out, uint32_t dword);
120WS_DLL_PUBLIC
char *
qword_to_hex(
char *out, uint64_t qword);
149WS_DLL_PUBLIC
char *
bytes_to_hexstr(
char *out,
const uint8_t *ad,
size_t len);
181 const uint8_t *buf,
size_t buf_size,
182 char punct,
size_t max_bytes_len);
184#define bytes_to_str_punct(scope, buf, buf_size, punct) \
185 bytes_to_str_punct_maxlen(scope, buf, buf_size, punct, 24)
197 const uint8_t *buf,
size_t buf_size,
198 size_t max_bytes_len);
200#define bytes_to_str(scope, buf, buf_size) \
201 bytes_to_str_maxlen(scope, buf, buf_size, 36)
struct _wmem_allocator_t wmem_allocator_t
Definition wmem_core.h:44
struct e_in6_addr ws_in6_addr
Represents a 128-bit IPv6 address.
uint32_t ws_in4_addr
Represents a 32-bit IPv4 address in network byte order.
Definition inet_addr.h:22
WS_DLL_PUBLIC char * word_to_hex_punct(char *out, uint16_t word, char punct)
Converts a 16-bit word to a hexadecimal string with byte-level punctuation.
Definition to_str.c:112
WS_DLL_PUBLIC char * bytes_to_str_maxlen(wmem_allocator_t *scope, const uint8_t *buf, size_t buf_size, size_t max_bytes_len)
Turn an array of bytes into a string showing the bytes in hex.
Definition to_str.c:263
WS_DLL_PUBLIC char * bytes_to_hexstr(char *out, const uint8_t *ad, size_t len)
Converts a byte array to a hexadecimal string.
Definition to_str.c:176
WS_DLL_PUBLIC char * hex64_to_str_back_len(char *ptr, uint64_t value, int len)
Converts a 64-bit unsigned integer to hex string in reverse with fixed length.
Definition to_str.c:351
WS_DLL_PUBLIC char * hex_to_str_back_len(char *ptr, uint32_t value, int len)
Converts a 32-bit unsigned integer to hex string in reverse with fixed length.
Definition to_str.c:330
WS_DLL_PUBLIC char * word_to_hex_npad(char *out, uint16_t word)
Converts a 16-bit word to a hexadecimal string without padding.
Definition to_str.c:121
WS_DLL_PUBLIC int format_fractional_part_nsecs(char *buf, size_t buflen, uint32_t nsecs, const char *decimal_point, int precision)
Formats the fractional part of a timestamp in nanoseconds.
Definition to_str.c:688
WS_DLL_PUBLIC char * ip_addr_to_str(wmem_allocator_t *scope, const ws_in4_addr *ad)
Converts a ws_in4_addr structure to a string using memory scope.
Definition to_str.c:600
WS_DLL_PUBLIC void uint32_to_str_buf(uint32_t u, char *buf, size_t buf_len)
Converts a 32-bit unsigned integer to a decimal string.
Definition to_str.c:502
WS_DLL_PUBLIC char * bytes_to_str_punct_maxlen(wmem_allocator_t *scope, const uint8_t *buf, size_t buf_size, char punct, size_t max_bytes_len)
Turn an array of bytes into a string showing the bytes in hex, separated by a punctuation character.
Definition to_str.c:218
WS_DLL_PUBLIC void uint64_to_str_buf(uint64_t u, char *buf, size_t buf_len)
Converts a 64-bit unsigned integer to a decimal string.
Definition to_str.c:544
WS_DLL_PUBLIC char * qword_to_hex_punct(char *out, uint64_t qword, char punct)
Converts a 64-bit word to a hexadecimal string with punctuation.
Definition to_str.c:159
WS_DLL_PUBLIC char * bytes_to_hexstr_punct(char *out, const uint8_t *ad, size_t len, char punct)
Converts a byte array to a hexadecimal string with punctuation.
Definition to_str.c:196
WS_DLL_PUBLIC char * oct64_to_str_back(char *ptr, uint64_t value)
Converts a 64-bit unsigned integer to octal string in reverse.
Definition to_str.c:318
WS_DLL_PUBLIC char * ip6_to_str(wmem_allocator_t *scope, const ws_in6_addr *ad)
Converts a ws_in6_addr structure to a string using memory scope.
Definition to_str.c:635
WS_DLL_PUBLIC char * qword_to_hex(char *out, uint64_t qword)
Converts a 64-bit word to a fixed-width hexadecimal string.
Definition to_str.c:151
WS_DLL_PUBLIC void format_nstime_as_iso8601(char *buf, size_t buf_size, const nstime_t *nstime, char *frac_buf, bool include_tz, int precision)
Formats an nstime_t value as an ISO 8601 timestamp.
Definition to_str.c:953
WS_DLL_PUBLIC char * uint64_to_str_back_len(char *ptr, uint64_t value, int len)
Converts a 64-bit unsigned integer to a zero-padded decimal string in reverse.
Definition to_str.c:441
WS_DLL_PUBLIC char * dword_to_hex_punct(char *out, uint32_t dword, char punct)
Converts a 32-bit word to a hexadecimal string with punctuation.
Definition to_str.c:142
WS_DLL_PUBLIC void ip_num_to_str_buf(uint32_t ad, char *buf, const int buf_len)
Converts a 32-bit IPv4 address to string format.
Definition to_str.c:610
WS_DLL_PUBLIC char * dword_to_hex(char *out, uint32_t dword)
Converts a 32-bit word to a fixed-width hexadecimal string.
Definition to_str.c:134
WS_DLL_PUBLIC void ip6_to_str_buf(const ws_in6_addr *ad, char *buf, size_t buf_size)
Converts a ws_in6_addr structure to string format.
Definition to_str.c:625
WS_DLL_PUBLIC char * uint64_to_str_back(char *ptr, uint64_t value)
Converts a 64-bit unsigned integer to a decimal string in reverse.
Definition to_str.c:396
WS_DLL_PUBLIC char * int_to_str_back(char *ptr, int32_t value)
Converts a 32-bit signed integer to a decimal string in reverse.
Definition to_str.c:461
WS_DLL_PUBLIC char * ipxnet_to_str_punct(wmem_allocator_t *scope, const uint32_t ad, const char punct)
Converts an IPX network address to a string with punctuation.
Definition to_str.c:645
WS_DLL_PUBLIC char * word_to_hex(char *out, uint16_t word)
Converts a 16-bit word to a fixed-width hexadecimal string.
Definition to_str.c:104
WS_DLL_PUBLIC char * uint_to_str_back_len(char *ptr, uint32_t value, int len)
Converts a 32-bit unsigned integer to a zero-padded decimal string in reverse.
Definition to_str.c:421
WS_DLL_PUBLIC void display_epoch_time(char *buf, size_t buflen, const nstime_t *ns, int precision)
Formats an epoch time value for display.
Definition to_str.c:876
WS_DLL_PUBLIC void ip_addr_to_str_buf(const ws_in4_addr *ad, char *buf, const int buf_len)
Converts a ws_in4_addr structure to string format.
Definition to_str.c:562
WS_DLL_PUBLIC char * eui64_to_str(wmem_allocator_t *scope, const uint64_t ad)
Converts a 64-bit EUI-64 address to string format.
Definition to_str.c:656
WS_DLL_PUBLIC char * oct_to_str_back(char *ptr, uint32_t value)
Converts a 32-bit unsigned integer to octal string in reverse.
Definition to_str.c:306
WS_DLL_PUBLIC void display_signed_time(char *buf, size_t buf_size, const nstime_t *nstime, int precision)
Formats a signed time value for display.
Definition to_str.c:882
WS_DLL_PUBLIC char * uint_to_str_back(char *ptr, uint32_t value)
Converts a 32-bit unsigned integer to decimal string in reverse.
Definition to_str.c:372
WS_DLL_PUBLIC char * uint8_to_hex(char *out, uint8_t val)
Converts bytes to a hexadecimal string.
Definition to_str.c:98
WS_DLL_PUBLIC char * int64_to_str_back(char *ptr, int64_t value)
Converts a 64-bit signed integer to a decimal string in reverse.
Definition to_str.c:473
WS_DLL_PUBLIC char * ip_num_to_str(wmem_allocator_t *scope, uint32_t ad)
Converts a 32-bit IPv4 address to a string using memory scope.
Definition to_str.c:618