remove xvm/ipagent
[unleashed.git] / usr / src / cmd / bnu / dk.h
blob8753068dedd5dde8019fd7a8862060254464508d
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
22 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
23 /* All Rights Reserved */
26 #ident "%Z%%M% %I% %E% SMI"
28 #ifndef _BNU_DK_H
29 #define _BNU_DK_H
31 #ifdef DIAL
32 #define GLOBAL static
33 #define EXTERN static
34 #else
35 #define EXTERN extern
36 #define GLOBAL
37 #endif
40 * DATAKIT VCS User Level definitions
41 * @(#)dk.h 2.13+BNU DKHOST 87/06/01
43 * CommKit(R) Software - Datakit(R) VCS Interface Release
48 * ioctl codes
51 #define DKIODIAL (('k'<<8)|0) /* dial out */
52 #define DKIOCNEW (('k'<<8)|1) /* offer a service */
53 #define DKIOCREQ (('k'<<8)|2) /* request service (SU only) */
54 #define DKIORESET (('k'<<8)|3) /* reset interface */
55 #define DKKMCSET (('k'<<8)|4) /* associate logical interface
56 with physical KMC # */
58 #define DKIOCSPL (('s'<<8)|1) /* splice two circuits together (SU only) */
59 #define DIOCSWAIT (('s'<<8)|2) /* wait for splice to take place */
62 /* driver control */
64 #define DIOCEXCL (('d'<<8)|1) /* exclusive use */
65 #define DIOCNXCL (('d'<<8)|2) /* reset exclusive use */
66 #define DIOCRMODE (('d'<<8)|3) /* set receiver termination modes */
67 #define DIOCQQABO (('d'<<8)|4) /* inquire status of last read */
68 #define DIOCSIG (('d'<<8)|5) /* start short read, signal when done */
70 #define DIOCXCTL (('d'<<8)|8) /* send ctl envelope on next write */
71 #define DIOCFLUSH (('d'<<8)|9) /* flush output */
72 #define DIOCSETK (('d'<<8)|10) /* debug info from kmc xmit&recv */
73 #define DIOCQSTAT (('d'<<8)|11) /* return 3B hw/fw log data */
74 #define DIOCBSIZE (('d'<<8)|12) /* set URP block size */
75 #define DIOCTIME (('d'<<8)|13) /* set stagnation timeout value */
76 #define DIOCTRAP (('d'<<8)|14) /* activate trsave trace for channel */
78 /* interface memory read/write codes */
80 #define DIOCHWREAD (('d'<<8)|15) /* read interface RAM */
81 #define DIOCHWRITE (('d'<<8)|16) /* write interface RAM */
83 /* diagnostic control codes */
85 #define DIOCDKDGN (('d'<<8)|17) /* execute on-line diagnostics */
86 #define DIOCDGNSET (('d'<<8)|18) /* initialize diagnostic mode */
87 #define DIOCDGNCLR (('d'<<8)|19) /* clear diagnostic mode */
89 /* 3b2/PE codes */
90 #define TCDKIDLD (('d'<<8)|20) /* download the PE */
91 #define TCDKIFCF (('d'<<8)|21) /* Force call to function */
92 #define TCDKIRST (('d'<<8)|22) /* Reset the PE board */
93 #define TCDKISYSG (('d'<<8)|23) /*sysgen the PE board */
95 /* Get info from driver */
96 #define DIOCINFO (('d'<<8)|24) /* get chans per interface*/
97 #define TCDKIBUG (('d'<<8)|25) /*turn debug on on the PE board */
98 #define DIOOPEN (('d'<<8)|26) /* inquire channel open status*/
99 /* special codes used by dkxstdio */
101 #define DXIOEXIT (('D'<<8)|'T') /* process exit code */
104 * structure returned from DIOCQQABO giving receive status
106 struct dkqqabo {
107 short rcv_resid ; /* residual length in buffer */
108 short rcv_reason ; /* set of bits giving reasons */
109 short rcv_ctlchar ; /* ctl char that finished block */
113 * receive mode, and completion indicators
114 * also defined in sys/dkit.h
117 #ifndef DKR_FULL
118 #define DKR_FULL 01 /* buffer full, normal read done */
119 #define DKR_CNTL 02 /* read terminated on control character */
120 #define DKR_ABORT 010 /* receive aborted by higher level command */
121 #define DKR_BLOCK 040 /* end of block */
122 #define DKR_TIME 0100 /* end of time limit reached */
123 #endif
128 * structure passed with ioctl to request a service
129 * actually used as a general-purpose struct to pass
130 * info from a kernel ioctl to user space.
132 struct diocreq {
133 short req_traffic ; /* traffic intensity generated */
134 short req_1param ; /* typ: service requested */
135 short req_2param ; /* parameter to server */
140 * values returned from service request
142 #define req_error req_traffic
143 #define req_driver req_traffic
144 #define req_chans req_traffic
145 #define req_chmin req_1param
149 * structure received by server when new connection made
151 struct mgrmsg {
152 short m_chan ; /* channel number of connection */
153 unsigned short m_tstamp ; /* time stamp of request */
154 char * m_protocol ; /* protocol options from user */
155 char * m_origtype ; /* type of originating device */
156 char * m_parm ; /* parameter string from user */
157 char * m_uid ; /* param from system/user, aka UID */
158 char * m_dial ; /* dial string entered */
159 char * m_source ; /* originator, as known to remote node */
160 char * m_lname ; /* originator, as known to local node */
161 char * m_service ; /* service type requested by user */
162 char * m_lflag ; /* L == call from local node,
163 * R == call from a remote one. */
164 char * m_srcnode; /* originating node (last segment) */
165 char * m_srcmod; /* originating mod */
166 char * m_srcchan; /* originating channel */
167 char * m_cflag; /* call flag: F=first, P=previous */
168 char * m_errmsg ; /* possible error msg if m_chan <= 0 */
174 * routines declared in libdk.a
176 EXTERN char *dknamer();
177 EXTERN char *dtnamer();
178 EXTERN char *dxnamer();
179 EXTERN char *dkfcanon(), *dktcanon();
180 EXTERN char *dkerr();
181 EXTERN char *maphost(), *miscfield();
182 #ifndef DIAL
183 EXTERN char mh_hostname[];
184 #endif
185 EXTERN struct mgrmsg *dkmgr();
187 EXTERN int dk_verbose, dk_errno;
191 * structure passed with ioctl to request a splice
193 struct diocspl {
194 short spl_fdin; /* the other file descriptor */
195 short spl_un1used;
196 short spl_un2used;
200 * Default file names
203 #define SRVTAB "/etc/dksrvtab"
204 #define UIDTAB "/etc/dkuidtab"
205 #define SRVLOG "/usr/adm/dksrvlog"
206 #define HOSTAB "/etc/dkhosts"
207 #define DOTAB "/usr/lib/dkdotab"
210 * Number of longs in the stat array returned by the firmware
212 #define STATLEN 16
214 #endif