XNSLIB(3X) — Silicon Graphics
NAME
xnslib: xcmd, xnsconnect, xnseof, xnsfile, xnslisten, xnsread, xnswrite, xsh − XNS network support routines
SYNOPSIS
#include <xns/Xns.h>
extern char *xnsmsg
xcmd (host, command)
char *host, *command;
xnsconnect (host, socket)
char *host;
int socket;
xnseof (fd)
int fd;
int xnsfile()
int xnslisten (socket)
int socket;
int xnsread(fd, buf, count, dtype, control)
int fd, count;
char *buf, *dtype, *control;
int xnswrite(fd, buf, count, dtype, control)
int fd, count, dtype, control;
char *buf;
int xsh(host)
char *host;
DESCRIPTION
xcmd makes a network connection on socket EXECSOCKET, on host, and causes command to be executed remotely. If a connecti cannot be made, it returns a −1. If execution is successful, a file descriptor is returned, to which the remote process is attached. Reads and writes to this file descriptor will retrieve/send data to/from a remote process.
xnsconnect creastes a connection with host at the indicated socket number. After it makes a Sequenced Packet Protocol (SPP) connection to the indicated socket at host, it returns a file descriptor. If the connection is not made, it returns a −1 and an error message is left in xnsmsg.
xnseof sends an SPP data packet. The data packet is of zero length and has a data type value of DST_EOF.
xnsfile is used by other routines in the library that make or accept connections. xnsfile returns a file descriptor that is intended to be used with device driver ioctl(2) calls before reading and writing.
xnslisten waits for an SPP connection to the socket number specified by the argument socket . A socket number can be in the range 100 to 2000. When the connection is set up, xnslisten returns a file descriptor.
xnsread allows you to read an SPP stream and recover the data type dtype, and control bits control, for each packet. The fd, buf, and count have similar meaning as the arguments to read(2). dtype and control are the addresses in the application program where the extra information is to be stored. xnsread is the “companion” to xnswrite That is, the dtype and control parameters passed by a sender to xnswrite are returned to a reader on the opposite end of an SPP connection.
xnswrite allows you to write an SPP stream while specifying a particular data type, dtype and control bits control. This data type can be recognized by the server and can be used to pase out-of-band information, for example. buf is the source of the bytes written to fd. If xnswrite is not successful, a −1 is returned. The data type, dtype, is set to the default after each write.
xsh makes a network connection on socket XSHSOCKET and starts a shell. If a connection cannot be made, xsh returns a −1.
To link with these routines, use the loader option −lxns.
FILES
/usr/lib/libxns.aXNS network support library
SEE ALSO
xcp(1C), xx(1C), ioctl(2), read(2).
Version 3.6 — December 20, 1987