|
Wireshark 4.7.0
The Wireshark network protocol analyzer
|
#include <wireshark.h>#include <wsutil/wmem/wmem.h>#include <wsutil/inet_addr.h>#include <wsutil/nstime.h>Go to the source code of this file.
Functions | |
| WS_DLL_PUBLIC char * | uint8_to_hex (char *out, uint8_t val) |
| WS_DLL_PUBLIC char * | word_to_hex (char *out, uint16_t word) |
| Converts a 16-bit word to a fixed-width hexadecimal string. | |
| 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. | |
| WS_DLL_PUBLIC char * | word_to_hex_npad (char *out, uint16_t word) |
| Converts a 16-bit word to a hexadecimal string without padding. | |
| WS_DLL_PUBLIC char * | dword_to_hex (char *out, uint32_t dword) |
| Converts a 32-bit word to a fixed-width hexadecimal string. | |
| 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. | |
| WS_DLL_PUBLIC char * | qword_to_hex (char *out, uint64_t qword) |
| Converts a 64-bit word to a fixed-width hexadecimal string. | |
| 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. | |
| WS_DLL_PUBLIC char * | bytes_to_hexstr (char *out, const uint8_t *ad, size_t len) |
| Converts a byte array to a hexadecimal string. | |
| 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. | |
| 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. | |
| 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. | |
| WS_DLL_PUBLIC char * | oct_to_str_back (char *ptr, uint32_t value) |
| Converts a 32-bit unsigned integer to octal string in reverse. | |
| WS_DLL_PUBLIC char * | oct64_to_str_back (char *ptr, uint64_t value) |
| Converts a 64-bit unsigned integer to octal string in reverse. | |
| 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. | |
| 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. | |
| WS_DLL_PUBLIC char * | uint_to_str_back (char *ptr, uint32_t value) |
| Converts a 32-bit unsigned integer to decimal string in reverse. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| WS_DEPRECATED_X ("Use ip_num_to_str_buf() or ip_addr_to_str() instead") WS_DLL_PUBLIC void ip_to_str_buf(const uint8_t *ad | |
| WS_DEPRECATED_X ("Use ip_num_to_str() or ip_addr_to_str() instead") WS_DLL_PUBLIC char *ip_to_str(wmem_allocator_t *scope | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
Variables | |
| char * | buf |
| char const int | buf_len |
| const uint8_t * | ad |
Definitions for utilities to convert various other types to strings.
Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs
SPDX-License-Identifier: GPL-2.0-or-later
| WS_DLL_PUBLIC char * bytes_to_hexstr | ( | char * | out, |
| const uint8_t * | ad, | ||
| size_t | len | ||
| ) |
Converts a byte array to a hexadecimal string.
Writes the hexadecimal representation of a byte array to the provided buffer. Each byte is represented by two hex characters. The result is not NUL-terminated. The caller must ensure the buffer has at least len * 2 bytes.
| out | Pointer to the destination buffer. |
| ad | Pointer to the byte array. |
| len | Number of bytes in the array. |
| 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.
Writes the hexadecimal representation of a byte array to the provided buffer, inserting the specified punctuation character between each byte. Each byte is represented by two hex digits, and the output is not NUL-terminated. The caller must ensure the buffer has at least (len * 3) - 1 bytes.
Example: For input {0xAB, 0xCD, 0xEF} and ‘punct = ’:', the output will be"AB:CD:EF"`.
| out | Pointer to the destination buffer. |
| ad | Pointer to the byte array to convert. |
| len | Number of bytes in the array. |
| punct | The punctuation character to insert between bytes (must not be NUL). |
| 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.
| scope | memory allocation scheme used |
| buf | A pointer to the byte array |
| buf_size | The length of the byte array |
| max_bytes_len | Maximum number of bytes to represent, zero for no limit. |
| 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.
| scope | memory allocation scheme used |
| buf | A pointer to the byte array |
| buf_size | The length of the byte array |
| punct | The punctuation character |
| max_bytes_len | Maximum number of bytes to represent, zero for no limit. |
| 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.
Converts an nstime_t value to a human-readable string representing the epoch time.
| buf | Destination buffer. |
| buflen | Size of the buffer. |
| ns | Pointer to the time value. |
| precision | Number of fractional digits to include. |
| 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.
Converts an nstime_t value to a human-readable string, preserving sign and precision.
| buf | Destination buffer. |
| buf_size | Size of the buffer. |
| nstime | Pointer to the time value. |
| precision | Number of fractional digits to include. |
| WS_DLL_PUBLIC char * dword_to_hex | ( | char * | out, |
| uint32_t | dword | ||
| ) |
Converts a 32-bit word to a fixed-width hexadecimal string.
Writes the zero-padded 8-character hexadecimal representation of a uint32_t value to the provided buffer. The result is not NUL-terminated. The caller must ensure the buffer has at least 8 bytes.
| out | Pointer to the destination buffer. |
| dword | The 32-bit value to convert. |
| 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.
Writes the hexadecimal representation of a uint32_t value to the buffer, inserting the specified punctuation character between each byte. The output is always 11 characters long and not NUL-terminated. The caller must ensure the buffer has at least 11 bytes.
| out | Pointer to the destination buffer. |
| dword | The 32-bit value to convert. |
| punct | The punctuation character to insert (must not be NUL). |
| 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.
Formats the EUI-64 address as a colon-separated hexadecimal string and allocates the result using the provided memory scope.
| scope | Memory allocator scope. |
| ad | EUI-64 address. |
| 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.
Converts the nanosecond portion of a timestamp to a string with optional formatting.
| buf | Destination buffer. |
| buflen | Length of the buffer. |
| nsecs | Nanoseconds to format. |
| decimal_point | String to use as the decimal point. |
| precision | Number of digits to include. |
| 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.
Converts the time value to a string in ISO 8601 format, optionally including fractional seconds.
| buf | Destination buffer. |
| buf_size | Size of the buffer. |
| nstime | Pointer to the time value. |
| frac_buf | Optional buffer for fractional part. |
| include_tz | Whether to include timezone information. |
| precision | Number of fractional digits to include. |
| 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.
Writes the hexadecimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The output is zero-padded to at least len characters. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 64-bit unsigned integer to convert. |
| len | Minimum number of hex digits to output. |
| 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.
Writes the hexadecimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The output is zero-padded to at least len characters. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 32-bit unsigned integer to convert. |
| len | Minimum number of hex digits to output. |
| 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.
Writes the decimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. Handles negative values by prepending a minus sign. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 64-bit signed integer to convert. |
| 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.
Writes the decimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. Handles negative values by prepending a minus sign. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 32-bit signed integer to convert. |
| 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.
Allocates and returns the colon-separated hexadecimal representation of the IPv6 address.
| scope | Memory allocator scope. |
| ad | Pointer to the IPv6 address structure. |
| 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.
Writes the colon-separated hexadecimal representation of the IPv6 address to the buffer.
| ad | Pointer to the IPv6 address structure. |
| buf | Destination buffer for the string. |
| buf_size | Size of the destination buffer. |
| 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.
Allocates and returns the dotted-decimal representation of the IPv4 address.
| scope | Memory allocator scope. |
| ad | Pointer to the IPv4 address structure. |
| 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.
Writes the dotted-decimal representation of the IPv4 address to the buffer.
| ad | Pointer to the IPv4 address structure. |
| buf | Destination buffer for the string. |
| buf_len | Size of the destination buffer. |
| 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.
Converts an IPv4 address in host byte order to dotted-decimal notation and allocates the result using the provided memory scope.
| scope | Memory allocator scope. |
| ad | IPv4 address in host byte order. |
| 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.
Converts an IPv4 address in host byte order to dotted-decimal notation and writes it to the provided buffer.
| ad | IPv4 address in host byte order. |
| buf | Destination buffer for the string. |
| buf_len | Size of the destination buffer. |
| 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.
Formats the 32-bit IPX network address using the specified punctuation character between bytes and allocates the result using the provided memory scope.
| scope | Memory allocator scope. |
| ad | IPX network address. |
| punct | Punctuation character to insert between bytes. |
| WS_DLL_PUBLIC char * oct64_to_str_back | ( | char * | ptr, |
| uint64_t | value | ||
| ) |
Converts a 64-bit unsigned integer to octal string in reverse.
Writes the octal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer (last character will be written at ptr - 1). |
| value | The 64-bit unsigned integer to convert. |
| WS_DLL_PUBLIC char * oct_to_str_back | ( | char * | ptr, |
| uint32_t | value | ||
| ) |
Converts a 32-bit unsigned integer to octal string in reverse.
Writes the octal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer (last character will be written at ptr - 1). |
| value | The 32-bit unsigned integer to convert. |
| WS_DLL_PUBLIC char * qword_to_hex | ( | char * | out, |
| uint64_t | qword | ||
| ) |
Converts a 64-bit word to a fixed-width hexadecimal string.
Writes the zero-padded 16-character hexadecimal representation of a uint64_t value to the provided buffer. The result is not NUL-terminated. The caller must ensure the buffer has at least 16 bytes.
| out | Pointer to the destination buffer. |
| qword | The 64-bit value to convert. |
| 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.
Writes the hexadecimal representation of a uint64_t value to the buffer, inserting the specified punctuation character between each byte. The output is always 22 characters long and not NUL-terminated. The caller must ensure the buffer has at least 22 bytes.
| out | Pointer to the destination buffer. |
| qword | The 64-bit value to convert. |
| punct | The punctuation character to insert (must not be NUL). |
| 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.
Writes the decimal representation of u into the provided buffer. The output is NUL-terminated and truncated if it exceeds buf_len - 1 characters.
| u | The 32-bit unsigned integer to convert. |
| buf | Pointer to the destination buffer. |
| buf_len | Size of the destination buffer, including space for the NUL terminator. |
| 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.
Writes the decimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 64-bit unsigned integer to convert. |
| 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.
Writes the decimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The output is padded with zeros to ensure at least len digits. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 64-bit unsigned integer to convert. |
| len | Minimum number of decimal digits to output. |
| 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.
Writes the decimal representation of u into the provided buffer. The output is NUL-terminated and truncated if it exceeds buf_len - 1 characters. This function ensures safe formatting within the given buffer size.
| u | The 64-bit unsigned integer to convert. |
| buf | Pointer to the destination buffer. |
| buf_len | Size of the destination buffer, including space for the NUL terminator. |
| WS_DLL_PUBLIC char * uint8_to_hex | ( | char * | out, |
| uint8_t | val | ||
| ) |
Output uint8_t hex representation to 'out', and return pointer after last character (out + 2). It will always output full representation (padded with 0).
String is not NUL terminated by this routine. There needs to be at least 2 bytes in the buffer.
| WS_DLL_PUBLIC char * uint_to_str_back | ( | char * | ptr, |
| uint32_t | value | ||
| ) |
Converts a 32-bit unsigned integer to decimal string in reverse.
Writes the decimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 32-bit unsigned integer to convert. |
| 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.
Writes the decimal representation of value backward into the buffer, ending at ptr - 1, and returns a pointer to the first character written. The output is padded with zeros to ensure at least len digits. The result is not NUL-terminated.
| ptr | Pointer to the end of the buffer. |
| value | The 32-bit unsigned integer to convert. |
| len | Minimum number of decimal digits to output. |
| WS_DLL_PUBLIC char * word_to_hex | ( | char * | out, |
| uint16_t | word | ||
| ) |
Converts a 16-bit word to a fixed-width hexadecimal string.
Writes the hexadecimal representation of a uint16_t value to the provided buffer. The output is always 4 characters long, zero-padded if necessary (e.g., 0x000A → "000A"). The result is not NUL-terminated, and the caller must ensure the buffer has at least 4 bytes.
| out | Pointer to the destination buffer (must have space for at least 4 characters). |
| word | The 16-bit value to convert. |
out + 4). | WS_DLL_PUBLIC char * word_to_hex_npad | ( | char * | out, |
| uint16_t | word | ||
| ) |
Converts a 16-bit word to a hexadecimal string without padding.
Writes the hexadecimal representation of a uint16_t value to the provided buffer. The output is not zero-padded and is not NUL-terminated. The caller must ensure the buffer has at least 4 bytes.
| out | Pointer to the destination buffer. |
| word | The 16-bit value to convert. |
| 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.
Writes the hexadecimal representation of a uint16_t value to the provided buffer, inserting the specified punctuation character between the high and low bytes. The output is always 5 characters long (e.g., "12:34" for 0x1234 with ‘’:'`). The result is not NUL-terminated, and the caller must ensure the buffer has at least 5 bytes.
| out | Pointer to the destination buffer (must have space for at least 5 characters). |
| word | The 16-bit value to convert. |
| punct | The punctuation character to insert between bytes (must not be NUL). |
out + 5).