Any Wanda or Unix program which wishes to use MSNL must use the MSNL name service for address resolution if the required MSNL address is not known. The equivalent of the Unix gethostname, gethostbyname and gethostbyaddr routines are implemented within the MSRPC library on all platforms to support MSNL address resolution. On Unix these routines are named getmsnlhostname, getmsnlhostbyname and getmsnlhostbyaddr. The mechanism is as follows:
When the appropriate routine is called, the MSRPC library checks to see whether it has an existing session to the MSNL name server. If not then it uses the MSRPC library to become a client of the MSNL name server. It locates the MSNL name server by obtaining its address from the environment variable MSNL_NAME_SERVERS. Any number of alternative name servers can be listed in this variable. The format is:
Where h is the
octet in
internet dotted notation of the MSNL address of host h
. The port
0.0.0.223
is the MSNL name server port.
No assumption should be made on the selection of the current name server from the MSNL_NAME_SERVERS environment variable.
Information returned from the name server is returned to the calling process by means of a static area of memory. Results of such calls should thus be copied to ensure they remain valid. On Wanda there is no concurrency protection for this static memory area.
Session bindings to the name server are cached. However, data from the name server is not cached by the library, i.e. every name/address resolution resulted in a call to the name server.