NIO CommKit Host Interface Installation and System Administration Manual

MAPHOST(3X) MAPHOST(3X)
E-69 CommKit Host Interface, Release 4.0
NAME
maphost – map destination name to an AT&T data switch dialstring
SYNOPSIS
char *maphost (host, service, defsufx, defprot, parm)
char *host, *defsufx, *defprot, *parm;
char service;
char *miscfield (service, field)
char service;
char field;
DESCRIPTION
maphost maps the destination host name into a full data switch address using the file /etc/opt/dk/dkhosts.
maphost is an auxiliary routine used with dkdial(3X). For the maphost routine to return a successful match
to an entry in dkhosts(4), the host and service class arguments to the maphost routine must match the host
and service classes fields, respectively, for some entry in dkhosts(4).
If the host argument is NULL, maphost will return the dialstring for the next host in dkhosts(4) that matches
the specified service class each time the routine is called. Therefore, the first call to maphost with a null host
argument will return the dialstring for the first host in dkhosts(4) that matches the service class specified.
maphost does not rewind it’s file pointer. Therefore, successive calls start searching from the last entry
found.
Once a successful call to maphost has been made, miscfield extracts information from the Miscellany
column in the dkhosts(4) file.
The dialstring is then constructed from the following:
dialstring: from dkhosts(4)
service: from defsufx or from the Miscellany field in dkhosts(4)
protocol: from defprot or from the Miscellany field in dkhosts(4)
parm: parameter string to append
FILES
/usr/lib/libdk.so host interface subroutine library
/etc/opt/dk/dkhosts host control file for destination mapping
SEE ALSO
dkdial(3X), dkhosts(4)
DIAGNOSTICS
The maphost routine will return a pointer to the dialstring (a static) if there was a match. If there was no
match and the host argument is not NULL, maphost will return a pointer to a character string (a static)
containing the value of the host argument. If there was no match and the host argument is NULL, maphost
will return a value of NULL.
The maphost routine will return a value of NULL if called with null host and service arguments.
Another item to note is if the host argument contains a full path name (any name with a ’/’ in it), the maphost
routine will not search the dkhosts(4) file. Instead, it will construct a dialstring using the arguments passed
to the maphost routine. The miscfield routine will return a value of NULL if the Miscellany [see
dkhosts(4)] field is not listed for that particular host/service combination entry.