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