intro(3N) intro(3N)
intro - introduction to SVR4 networking functions and libraries
This section describes functions found in the SVR4 networking library.
Function declarations can be obtained from the #include files indicated
on each page. Certain major collections are identified by a letter after
the section number:
The SVR4 networking functions are contained in a single libraries known
as the Network Services library, libnsl.
The following functions constitute the libnsl library:
netdir
Network Directory functions. This contains look-up functions
and the access point to network directory libraries for various
network transports.
netselect
Network Selection routines. These functions manipulate the
/etc/netconfig file and return entries.
nsl Transport Level Interface (TLI). These functions contain the
implementation of X/OPEN's Transport Level Interface.
rexec
REXEC library interface
rpc User-level Remote Procedure Call library
saf Service Access Facility library
yp Network Information Service functions. [The NIS functions have
been moved to libc.]
In the Network Services library, netbuf is a structure used in various
TLI functions to send and receive data and information. netbuf is
defined in sys/tiuser.h, and includes the following members:
struct netbuf {
unsigned int maxlen; /* The physical size of the buffer */
unsigned int len; /* The number of bytes in the buffer */
char *buf; /* Points to user input and/or output buffer */
};
If netbuf is used for output, the function will set the user value of len
on return. maxlen generally has significance only when buf is used to
receive output from the TLI function. In this case, it specifies the
maximum value of len that can be set by the function. If maxlen is not
Page 1
intro(3N) intro(3N)
large enough to hold the returned information, an TBUFOVFLW error will
generally result. However, certain functions may return part of the data
and not generate an error.
INCDIR usually /usr/include
LIBDIR usually /usr/ccs/lib
LIBDIR<b>/libsocket.so (normally unused, see below)
LIBDIR<b>/libnsl.so
intro(3)
None of the functions, external variables, or macros should be redefined
in the user's programs. Any other name may be redefined without
affecting the behavior of other library functions, but such redefinition
may conflict with a declaration in an included header file.
The header files in INCDIR provide function prototypes (function
declarations including the types of arguments) for most of the functions
listed in this manual. Function prototypes allow the compiler to check
for correct usage of these functions in the user's program. The lint
program checker may also be used and will report discrepancies even if
the header files are not included with #include statements. Use of lint
is highly recommended.
In detailed definitions of components, it is sometimes necessary to refer
to symbolic names that are implementation-specific, but which are not
necessarily expected to be accessible to an application program. Many of
these symbolic names describe boundary conditions and system limits.
In this section, for readability, these implementation-specific values
are given symbolic names. These names always appear enclosed in curly
brackets to distinguish them from symbolic names of other
implementation-specific constants that are accessible to application
programs by header files. These names are not necessarily accessible to
an application program through a header file, although they may be
defined in the documentation for a particular system.
In general, a portable application program should not refer to these
symbolic names in its code. For example, an application program would
not be expected to test the length of an argument list given to a routine
to determine if it was greater than {ARG_MAX}.
There are 2 types of networking in IRIX.
1) BSD sockets implemented in the kernel, along with SUN RPC and
NIS (YP). The functions that implement these calls are in libc [see
intro(3)].
Page 2
intro(3N) intro(3N)
2) SVR4-style STREAMS/TLI/DLPI networking (not sockets), along with
SVR4-style RPC. SVR4-style RPC doesn't work with sockets, only with
the TLI. Also, SVR4-style networking does not support NIS. The
functions that implement these calls are in libnsl, and to use them,
the code must be compiled with :
cc -D_SVR4_TIRPC prog.c -lnsl
eoe.sw.svr4net must be installed to use the TLI functionality.
eoe.sw.dlpi must be installed to use the DLPI (Data-link Provider
Interface) functionality.
In order to fully support the MIPS ABI, there is a library
(libsocket) that can be linked with explicitly. There are no header
file or semantic differences when using libsocket. The MIPS ABIcompliant
programs that use sockets must (in order to be ABIcompliant)
link with libsocket. To compile such a program, use:
cc prog.c -lsocket
This library exists solely to satisfy the ABI; it uses the standard
IRIX socket services described above to implement the specified
functionality.
PPPPaaaaggggeeee 3333 [ Back ]
|