1 /* 2 * @(#)dk.h 1.3 (Berkeley) 09/03/90 3 * 4 * DATAKIT VCS User Level definitions 5 * @(#)dk.h 2.1 DKHOST 84/07/03 6 */ 7 8 9 /* 10 * ioctl codes 11 */ 12 13 /* 14 * Note: these take paramters, but the copyin-copyout must be handled in 15 * the driver. 16 */ 17 #define DKIODIAL _IO('k', 0) /* dial out */ 18 #define DKIOCNEW _IO('k', 1) /* offer a service */ 19 #define DKIOCREQ _IO('k', 2) /* request service (SU only) */ 20 #define DKIOCSPL _IO('s', 1) /* splice two circuits (SU only) */ 21 #define DIOCSWAIT _IO('s', 2) /* wait for splice to take place */ 22 23 /* driver control */ 24 25 #define DIOCEXCL _IO('d', 1) /* exclusive use */ 26 #define DIOCNXCL _IO('d', 2) /* reset exclusive use */ 27 #define DIOCRMODE _IOW('d', 3, short) /* set receiver termination modes */ 28 #define DIOCQQABO _IOR('d', 4, struct dkqqabo) /* inquire status of last read */ 29 #define DIOCXCTL _IOW('d', 8, short) /* send ctl envelope on next write */ 30 #define DIOCFLUSH _IO('d', 9) /* flush output */ 31 #define DIOCSETK _IOW('d', 10, short) /* debug info from kmc xmit&recv */ 32 #define DIOCXWIN _IOW('d', 11, struct diocxwin) /* Set window size */ 33 #define KIOCINIT _IO('d', 12) /* Reinitialize transmitter */ 34 #define DIOCRESET _IOW('d', 13, short) /* Reset a channel */ 35 #define DIOCCTYPE _IOW('d', 14, struct diocctype) /* Set conn type */ 36 #define DIOCINFO _IOR('d', 15, struct diocinfo) /* Get chan #, max # */ 37 #define DIOCSTAT _IOWR('d', 16, int) /* Check if channel open */ 38 39 /* special codes used by dkxstdio */ 40 #define DXIOEXIT _IOW('D', 'T', int) /* process exit code */ 41 42 /* 43 * structure returned from DIOCQQABO giving receive status 44 */ 45 struct dkqqabo { 46 short rcv_resid ; /* residual length in buffer */ 47 short rcv_reason ; /* set of bits giving reasons */ 48 short rcv_ctlchar ; /* ctl char that finished block */ 49 } ; 50 51 /* 52 * receive mode, and completion indicators 53 * also defined in sys/dkit.h 54 */ 55 56 #ifndef DKR_FULL 57 #define DKR_FULL 01 /* buffer full, normal read done */ 58 #define DKR_CNTL 02 /* read terminated on control character */ 59 #define DKR_ABORT 010 /* receive aborted by higher level command */ 60 #define DKR_BLOCK 040 /* end of block */ 61 #define DKR_TIME 0100 /* end of time limit reached */ 62 #endif 63 64 65 66 /* 67 * structure passed with ioctl to request a service 68 */ 69 struct diocreq { 70 short req_traffic ; /* traffic intensity generated */ 71 short req_1param ; /* typ: service requested */ 72 short req_2param ; /* parameter to server */ 73 } ; 74 75 /* 76 * structure passed to dial a number 77 */ 78 struct diocdial { 79 struct diocreq iocb; 80 char dialstring[MLEN-sizeof (struct diocreq)]; 81 }; 82 83 /* 84 * Structure passed to set URP limits 85 */ 86 struct diocxwin { 87 int xwin_msgsize; /* Size of one message */ 88 unsigned char xwin_nmsg; /* Number of outstanding messages */ 89 }; 90 91 /* 92 * Structure passed to request configuration info 93 */ 94 struct diocinfo { 95 short dioc_nchan; /* Number of channels configured */ 96 short dioc_channum; /* This channel number */ 97 short dioc_commchan; /* Common supervisory channel */ 98 }; 99 100 /* 101 * structure passed with ioctl to request a splice 102 */ 103 struct diocspl { 104 short spl_fdin; /* the other file descriptor */ 105 short spl_un1used; 106 short spl_un2used; 107 } ; 108 109 struct diocctype { 110 int dct_type; /* Annotation type */ 111 char dct_name[MLEN-sizeof (int)-1]; /* Connection type */ 112 }; 113 #define DCT_DIAL 1 /* Dialstring uttered */ 114 #define DCT_SERVE 2 /* Server name */ 115 #define DCT_FROM 3 /* Connection source */ 116 117 118 /* 119 * values returned from service request 120 */ 121 #define req_error req_traffic 122 #define req_driver req_traffic 123 124 #ifndef KERNEL 125 #include <sys/ioctl.h> 126 /* 127 * structure received by server when new connection made 128 */ 129 struct mgrmsg { 130 short m_chan ; /* channel number of connection */ 131 unsigned short m_tstamp ; /* time stamp of request */ 132 char * m_protocol ; /* protocol options from user */ 133 char * m_origtype ; /* type of originating device */ 134 char * m_parm ; /* parameter string from user */ 135 char * m_uid ; /* param from system/user, aka UID */ 136 char * m_dial ; /* dial string entered */ 137 char * m_source ; /* originator, as known to remote node */ 138 char * m_lname ; /* originator, as known to local node */ 139 char * m_service ; /* service type requested by user */ 140 char * m_lflag ; /* L == call from local node, 141 * R == call from a remote one. */ 142 char * m_srcnode; /* originating node (last segment) */ 143 char * m_srcmod; /* originating mod */ 144 char * m_srcchan; /* originating channel */ 145 char * m_cflag; /* call flag: F=first, P=previous */ 146 char * m_errmsg ; /* possible error msg if m_chan <= 0 */ 147 char * m_baudrate ; /* incoming terminal baud rate */ 148 } ; 149 150 151 152 /* 153 * routines declared in libdk.a 154 */ 155 extern char *dknamer(); 156 extern char *dtnamer(); 157 extern char *dxnamer(); 158 extern char *dinamer(); 159 extern char *dketcf(); 160 extern char *dkfcanon(), *dktcanon(); 161 extern char *dkerr(); 162 extern char *maphost(), *miscfield(); 163 extern char mh_hostname[]; 164 extern struct mgrmsg *dkmgr(); 165 166 extern int dk_verbose, dk_errno; 167 #endif KERNEL 168 169