2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

new functions isc_netaddr_totext() and isc_netaddr_format()

This commit is contained in:
Andreas Gustafsson
2000-05-26 00:41:03 +00:00
parent 46e8a97c7c
commit 8eaa51a699
2 changed files with 72 additions and 0 deletions

View File

@@ -57,6 +57,26 @@ isc_netaddr_masktoprefixlen(const isc_netaddr_t *s, unsigned int *lenp);
* ISC_R_MASKNONCONTIG
*/
isc_result_t
isc_netaddr_totext(const isc_netaddr_t *netaddr, isc_buffer_t *target);
/*
* Append a text representation of 'sockaddr' to the buffer 'target'.
* The text is NOT null terminated. Handles IPv4 and IPv6 addresses.
*
* Returns:
* ISC_R_SUCCESS
* ISC_R_NOSPACE The text or the null termination did not fit.
* ISC_R_FAILURE Unspecified failure
*/
void
isc_netaddr_format(isc_netaddr_t *na, char *array, unsigned int size);
/*
* Format a human-readable representation of the network address '*na'
* into the character array 'array', which is of size 'size'.
* The resulting string is guaranteed to be null-terminated.
*/
void
isc_netaddr_fromsockaddr(isc_netaddr_t *netaddr, const isc_sockaddr_t *source);