V8/usr/man/man3/dkmgr.3

.TH DKMGR 3X
.SH NAME
dkmgr, dkmgrack, dkmgrnak, dkfilename \- establish datakit server
.SH SYNOPSIS
.B #include <dkmgr.h>
.PP
.B struct mgrmsg *
.br
.B dkmgr(srvname, traffic)
.br
.B char *srvname;
.PP
.B char *
.br
.B dkfilename(chan)
.PP
.B dkmgrack(chan)
.PP
.B dkmgrnak(chan, error)
.SH DESCRIPTION
These routines are loaded by option
.B \-ldk
of
.IR ld (1).
.PP
.I Dkmgr
sets up the calling process as a datakit server, and
waits for service requests.
It returns a pointer to an
incoming service request in the form:
.IP
.nf
struct mgrmsg {
          short m_chan;
          short m_tstamp;
          short m_traffic;
          char *m_dial;
          char *m_service;
          char *m_source;
          char *m_uid;
          char *m_param1;
          char *m_param2;
};
.fi
.PP
Field
.I  m_chan 
gives the channel number of the incoming request. 
The circuit is already established, and this channel need only be
opened.
The appropriate special file name is returned as a static string
by
.IR dkfilename .
Field
.I  m_uid 
is generated by the caller (see
.IR tdkdial (3)),
if the
request originated in a standard UNIX system, and is
the userid of the requester.
It can be trusted if, and only if, you trust the administrators
and super-users on the calling system.
Field
.I  m_param1 
and 
.I m_param2 
are the first and subsequent strings after
the destination name in the dialstring.
They can be used to pass short
pieces of information from the requester to the server about how to 
handle the call.
.PP
.I Traffic
tells the network what types of requests this server
is capable of handling.
Value 0 indicates terminal-like traffic only,
value 2 allows either terminal or high-speed host-host traffic.
The field
.I  m_traffic 
of the incoming call message tells the traffic
requested by the caller.
.PP
The string 
.I m_dial 
gives the dialing string used by the calling process,
and
.I  m_source 
is the name of the port in the network where the call 
originated.
.PP
The server program is expected to call either
.I dkmgrack 
or
.I dkmgrnak
to complete the call setup.
The first acknowledges and accepts the call,
the second rejects the call with a specific error code giving the reason.
.SH FILES
/dev/dk	directory containing files naming each channel.
.SH SEE ALSO
tdkdial(3)
.SH DIAGNOSTICS
In case of a major setup error, a message is printed on the
standard error file and the process
exits.
For minor errors, a message is printed and the process tries again
after a wait interval.
.SH BUGS
It always waits for connection requests;
there should be a version that accepts them asynchronously.