ns_ntoa_r()--Translate Network Services Address from 12-byte Address
Syntax
#include <sys/types.h>
#include <netns/ns.h>
int ns_ntoa_r(struct ns_addr
network_services_address,
char *output_buffer,
int output_buffer_length)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: Yes
The ns_ntoa_r() function is used to translate a network services
address from a 12-byte address to a human readable format.
Authorities and Locks
None.
Parameters
struct ns_addr network_services_address
(input)
Specifies the 12-byte network services address that is to be converted to
human readable format.
char * output_buffer (input/output)
Specifies the pointer to the converted string.
int output_buffer_length (input)
Specifies the length of the output buffer (length should at least 35).
Return Value
The ns_ntoa_r() function returns:
-1 (unsuccessful call)
0 (successful call)
Error Conditions
When the ns_ntoa_r() function fails, errno can be set
to:
[EINVAL]
Parameter is not valid.
This error code indicates one of the following:
The output_buffer_length length is less than 35.
Usage Notes
The network services address consists of three fields, the network field,
the host field, and the port number field. ns_ntoa_r() will return
these fields as a single character string with the fields separated by the
period (.) character. The character string is always terminated with a NULL
character.
The fields are always returned in hexadecimal notation.
ns_ntoa_r() will insert an 'H' character at the end of each field that
does not contain an a,b,c,d,e,f,A,B,C,D,E or F character, in order to make it
obvious that the notation is in hexadecimal.
Not all fields need be returned. For example, if the host field and the
port number field of the network services address both contain hexadecimal
zeros, the ns_ntoa_r() routine will return a character string that
only contains the network field.