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