This chapter discusses the location of site configuration files and provides a detailed explanation of how your SAS/C Socket Library finds these files.
/etc/hosts
/etc/networks
/etc/services
/etc/protocols
/etc/resolv.conf
/etc/rpc
.
/etc/hosts
.
The socket library uses the following search logic when searching for the data set containing configuration information:
DSN:
for a data set name, or HFS:
for a hierarchical file
system (HFS) name. If the name does not begin with a prefix, it
is interpreted according to the SAS/C Library defaults, which
vary from program to program. For example,
the default
prefix for MVS is DDN:, and for CMS it is CMS:.
Use the DSN: prefix if you are supplying
the name in DSName form.
TCPIP_PREFIX
environment variable is not
TCPIP. See Specifying TCPIP_PREFIX for MVS
for a discussion of TCPIP_PREFIX
.
TCPIP_PREFIX
value.
/etc/protocols
:
ETC_PROTOCOLS
environment variable, if defined
TCPIP_PREFIX
is
not blank.
/etc/services
:
ETC_SERVICES
environment variable, if defined
TCPIP_PREFIX
is not blank.
/etc/hosts
:
ETC_HOSTS
environment variable, if defined
TCPIP_PREFIX
is
not blank.
/etc/networks
:
ETC_NETWORKS
environment variable, if defined
TCPIP_PREFIX
is
not blank.
/etc/resolv.conf
:
ETC_RESOLV_CONF
environment variable, if defined
TCPIP_PREFIX
is not blank.
/etc/rpc
:
ETC_RPC
environment variable, if defined.
TCPIP_PREFIX
is not
blank.
TCPIP_PREFIX
environment variable
used in finding
configuration data sets is determined in the
following way:
TCPIP_PREFIX
variable to
locate a data set, the library uses the value set
by the user.
TCPIP_PREFIX
variable
is undefined when the socket library
attempts to use it to locate a data set,
the TCPIP_PREFIX
variable is set with a 27-character string array in
L$CNDBA in the transient library.
However, the library may search the TCPIP.DATA file for the
DATASETPREFIX keyword value before using the
array. (See item 2 under gethostbyname and Resolver Configuration for search order.)
The default value of
this array is
TCPIP. A zap that changes this default
is provided with the transient library installation
instructions.
Some SAS/C programs received from
software vendors or other sites may not use the transient
library and could require their own zaps.
For this reason, avoid using
the zap, if possible, and instead use the ETC high-level
qualifier derived from the UNIX filename
or make
TCPIP the default high-level qualifier.
TCPIP_MACH
environment variable to determine the value of
this name. If the TCPIP_MACH
variable does not exist, the socket library searches for the
name in the TCPIP.DATA
file under MVS or the TCPIP DATA file under CMS.
(See item 2 under gethostbyname and Resolver Configuration for search order.)
If this file is not available, the socket
library uses a default value of
TCPIP to locate the TCP/IP virtual machine or address space.
gethostbyname
and
gethostbyaddr
routines may
use the /etc/hosts
file, or they may call the resolver to
contact the name server for the host name information.
The SAS/C Socket Library uses the following logic when looking up host names and addresses:
/etc/resolv.conf
file
using the
rules listed in /etc/resolv.conf .
If the socket library finds the /etc/resolv.conf
file, it
performs the requested queries
through the resolver, and it returns any answer it
receives.
If attempts to connect to name servers are refused
(errno
ECONNREFUSED
), it goes to step 3.
TCPIP_DATA
string.
If found, the string is passed to fopen
fopen
TCPIP_PREFIX
and
then searches for tcpip_prefix.TCPIP.DATA
TCPIP_PREFIX
and searches for
default-value.TCPIP.DATA
/etc/hosts
file using the rules listed in
/etc/hosts . If the socket library finds an
/etc/hosts
file,
it returns the result, including failure.
domain
statement of
the /etc/resolv.conf
file, the file
specified by the HOSTALIASES
environment variable and the value of the LOCALDOMAIN
environment variable.
Name-server addresses are also determined from the
/etc/resolv.conf
file.
If, because there is no /etc/resolv.conf
file,
an IBM TCP/IP TCPIP.DATA file is read,
resolver configuration is determined
by the statements, including IBM defaults, in the TCPIP.DATA
file.
The SAS/C
Library only
recognizes the first three name servers specified in this file.
Both the UNIX operating system and
the SAS/C environment have a limit of three name servers.
TCPIP_PREFIX
environment
variable, and you do not apply the zap to the TCPIP_PREFIX
in the transient
library, your programs will always be able to find the
configuration data sets. If you want to use
the resolver for
name resolution, you can create an ETC.RESOLV.CONF
file.
An IBM TCP/IP site that prefers to use existing data sets can use the tcpip-prefix.TCPIP.DATA file to control name resolution.
An MVS site that does not use
TCPIP as the
high-level qualifier and that cannot use the ETC prefix
will have to rely on environment variables (possibly
DATASET_PREFIX
in the TCPIP.DATA file) or the zap
provided in the installation instructions.
Environment variables work well if there is a
way to set them, such as a
CLIST that all TCP/IP users can run when they
log on or
before they run a client program.
Also, using environment variables that have a
permanent scope enables the user to set the variable once and
then use the setting from that point onward.
A site that
cannot use the environment variables must rely on the zap provided in the installation
instructions.
Programs received from other sites may also require this zap.
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.