ns_ntoa()--Translate Network Services Address from 12-byte Address/h2>


  Syntax
 #include <sys/types.h>
 #include <netns/ns.h>

 char *ns_ntoa
      (struct ns_addr network_services_address)

  Service Program Name: QSOSRV2

  Default Public Authority: *USE

  Threadsafe: No; see Usage Notes.

The ns_ntoa() 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) The 12-byte network services address that is to be converted to human readable format.

Return Value

The ns_ntoa() function returns:


Usage Notes

  1. The network services address consists of three fields, the network field, the host field, and the port number field. ns_ntoa() returns 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.

  2. The fields are always returned in hexadecimal notation. ns_ntoa() inserts 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.

  3. 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, ns_ntoa() returns a character string that only contains the network field.

  4. The pointer returned by ns_ntoa() points to static storage that is overridden on subsequent calls to ns_ntoa().

  5. Do not use the ns_ntoa() function in a multithread environment. See the multithread alternative ns_ntoa_r() function.


API introduced: V4R2
Top | UNIX-Type APIs | APIs by category