1 /*
2  * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23  * SUCH DAMAGE.
24  *
25  *---------------------------------------------------------------------------
26  *
27  *	i4b_ioctl.h - messages kernel <--> userland
28  *	-------------------------------------------
29  *
30  *	$Id: i4b_ioctl.h,v 1.13 2015/09/06 06:01:01 dholland Exp $
31  *
32  * $FreeBSD$
33  *
34  *      last edit-date: [Tue Oct 10 15:30:55 2000]
35  *
36  *---------------------------------------------------------------------------*/
37 
38 #ifndef _NETISDN_I4B_IOCTL_H_
39 #define _NETISDN_I4B_IOCTL_H_
40 
41 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
42 #ifndef _MACHINE_TYPES_H_
43 #include <machine/types.h>
44 #endif /* _MACHINE_TYPES_H_ */
45 #endif /* __FreeBSD__ */
46 
47 #include <sys/ioccom.h>
48 
49 /*---------------------------------------------------------------------------*
50  *	version and release number for isdn4bsd package
51  *---------------------------------------------------------------------------*/
52 #define	VERSION		0		/* version number	*/
53 #define	REL		96		/* release number	*/
54 #define STEP		00		/* release step		*/
55 
56 /*---------------------------------------------------------------------------*
57  * date/time format in i4b log messages
58  * ------------------------------------
59  * Being year 2000 clean is not easy with the current state of the
60  * ANSI C library standard and its implementation for some locales.
61  * You might like to use the "%c" format of "strftime" sometimes,
62  * but this breaks Y2K in some locales. Also the old standard logfile
63  * format "%d.%m.%y %H:%M:%S" is non compliant.
64  * NetBSD's current toolset warns about this problems, and we compile
65  * with -Werror, so this problems need to be resolved.
66  *---------------------------------------------------------------------------*/
67 #define I4B_TIME_FORMAT	"%d.%m.%Y %H:%M:%S"
68 
69 /*---------------------------------------------------------------------------*
70  *	ISDN D-channel protocols
71  *---------------------------------------------------------------------------*/
72 #define PROTOCOL_DSS1	0		/* default, Euro-ISDN/DSS1 */
73 #define PROTOCOL_D64S	1		/* 64k leased line, no protocol */
74 
75 /*---------------------------------------------------------------------------*
76  *	max length of some strings
77  *---------------------------------------------------------------------------*/
78 #define TELNO_MAX	41  /* max length of a telephone number (+ '\0')  */
79 #define	SUBADDR_MAX	22  /* max length of subaddres IE		  */
80 #define DISPLAY_MAX	91  /* max length of display information (+ '\0') */
81 #define DATETIME_MAX	21  /* max length of datetime information (+ '\0')*/
82 
83 /*---------------------------------------------------------------------------*
84  *	in case the src or dst telephone number is empty
85  *---------------------------------------------------------------------------*/
86 #define TELNO_EMPTY	"NotAvailable"
87 
88 /*---------------------------------------------------------------------------*
89  *	B channel parameters
90  *---------------------------------------------------------------------------*/
91 #define BCH_MAX_DATALEN	2048	/* max length of a B channel frame */
92 
93 /*---------------------------------------------------------------------------*
94  * B channel protocol
95  *---------------------------------------------------------------------------*/
96 #define BPROT_NONE	0	/* no protocol at all, raw data		*/
97 #define BPROT_RHDLC	1	/* raw HDLC: flag, data, crc, flag	*/
98 
99 /*---------------------------------------------------------------------------*
100  * causes data type
101  *---------------------------------------------------------------------------*/
102 typedef	unsigned int cause_t;		/* 32 bit unsigned int	*/
103 
104 /*---------------------------------------------------------------------------*
105  * call descriptor id (cdid) definitions
106  *---------------------------------------------------------------------------*/
107 #define CDID_UNUSED	0	/* cdid is invalid and unused		*/
108 #define CDID_MAX	99999	/* highest valid cdid, wraparound to 1	*/
109 
110 /*---------------------------------------------------------------------------*
111  *	The shorthold algorithm to use
112  *---------------------------------------------------------------------------*/
113 #define SHA_FIXU	0    /* timeout algorithm for fix unit charging */
114 #define SHA_VARU	1    /* timeout algorithm for variable unit charging */
115 
116 /*---------------------------------------------------------------------------*
117  *	The shorthold data struct
118  *---------------------------------------------------------------------------*/
119 typedef struct {
120 	int	shorthold_algorithm;	/* shorthold algorithm to use	*/
121 	int	unitlen_time;		/* length of a charging unit	*/
122 	int	idle_time;		/* time without activity on b ch*/
123 	int	earlyhup_time;		/* safety area at end of unit	*/
124 } msg_shorthold_t;
125 
126 
127 /****************************************************************************
128 
129 	outgoing call:
130 	--------------
131 
132 		userland		kernel
133 		--------		------
134 
135 		CDID_REQ ----------------->
136 
137 	            <------------------ cdid
138 
139 		CONNECT_REQ -------------->
140 
141 		    <------------------ PROCEEDING_IND (if connect req ok)
142 
143 	            <------------------ CONNECT_ACTIVE_IND (if connection ok)
144 
145 		or
146 
147 	            <------------------ DISCONNECT_IND (if connection failed)
148 
149 
150 
151 	incoming call:
152 	--------------
153 
154 		userland		kernel
155 		--------		------
156 
157 	            <------------------ CONNECT_IND
158 
159 		CONNECT_RESP ------------->
160 
161 	            <------------------ CONNECT_ACTIVE_IND (if accepted)
162 
163 
164 
165 	active disconnect:
166 	------------------
167 
168 		userland		kernel
169 		--------		------
170 
171 		DISCONNECT_REQ ------------>
172 
173 	            <------------------ DISCONNECT_IND
174 
175 
176 	passive disconnect:
177 	-------------------
178 
179 		userland		kernel
180 		--------		------
181 
182 	            <------------------ DISCONNECT_IND
183 
184 
185 ****************************************************************************/
186 
187 
188 /*===========================================================================*
189  *===========================================================================*
190  *	"read" messages from kernel -> userland
191  *===========================================================================*
192  *===========================================================================*/
193 
194 
195 /*---------------------------------------------------------------------------*
196  *	message header, included in every message
197  *---------------------------------------------------------------------------*/
198 typedef struct {
199 	char		type;		/* message identifier		*/
200 #define MSG_CONNECT_IND		'a'
201 #define MSG_CONNECT_ACTIVE_IND	'b'
202 #define MSG_DISCONNECT_IND	'c'
203 #define MSG_DIALOUT_IND		'd'
204 #define MSG_IDLE_TIMEOUT_IND	'e'
205 #define MSG_ACCT_IND		'f'
206 #define MSG_CHARGING_IND	'g'
207 #define MSG_PROCEEDING_IND	'h'
208 #define MSG_ALERT_IND		'i'
209 #define MSG_DRVRDISC_REQ	'j'
210 #define MSG_L12STAT_IND		'k'
211 #define MSG_TEIASG_IND		'l'
212 #define MSG_PDEACT_IND		'm'
213 #define	MSG_NEGCOMP_IND		'n'
214 #define	MSG_IFSTATE_CHANGED_IND	'o'
215 #define MSG_DIALOUTNUMBER_IND	'p'
216 #define MSG_PACKET_IND		'q'
217 #define	MSG_CONTR_EV_IND	'r'
218 	int		cdid;		/* call descriptor id		*/
219 } msg_hdr_t;
220 
221 /*---------------------------------------------------------------------------*
222  *	connect indication
223  *		indicates incoming connection
224  *---------------------------------------------------------------------------*/
225 typedef struct {
226 	msg_hdr_t	header;		/* common header		*/
227 	int		controller;	/* controller number		*/
228 	int		channel;	/* channel number		*/
229 #define  CHAN_B1  0		/* this _must_ be 0, HSCX B1 is also 0	*/
230 #define  CHAN_B2  1		/* this _must_ be 1, HSCX B2 is also 1	*/
231 #define  CHAN_ANY (-1)		/* outgoing, not possible for incoming	*/
232 #define  CHAN_NO  (-2)		/* call waiting (CW) for incoming	*/
233 	int		bprot;	/* b channel protocot, see BPROT_XXX	*/
234 	char		dst_telno[TELNO_MAX];	/* destination telno	*/
235 	char		src_telno[TELNO_MAX];	/* source telno		*/
236 	int		scr_ind;/* screening indicator			*/
237 #define  SCR_NONE     0		/* no screening indicator transmitted	*/
238 #define  SCR_USR_NOSC 1		/* screening user provided, not screened*/
239 #define  SCR_USR_PASS 2		/* screening user provided, verified & passed */
240 #define  SCR_USR_FAIL 3		/* screening user provided, verified & failed */
241 #define  SCR_NET      4		/* screening network provided		*/
242 	int		prs_ind;/* presentation indicator		*/
243 #define  PRS_NONE     0		/* no presentation indicator transmitted*/
244 #define  PRS_ALLOWED  1		/* presentation allowed			*/
245 #define  PRS_RESTRICT 2		/* presentation restricted		*/
246 #define  PRS_NNINTERW 3		/* number not available due to interworking */
247 #define  PRS_RESERVED 4		/* reserved				*/
248 	char		display[DISPLAY_MAX];	/* content of display IE*/
249 	u_int8_t	src_subaddr[SUBADDR_MAX];
250 	u_int8_t	dest_subaddr[SUBADDR_MAX];
251 	u_int8_t	type_plan;
252 } msg_connect_ind_t;
253 
254 /*---------------------------------------------------------------------------*
255  *	connect active indication
256  *		indicates active connection
257  *---------------------------------------------------------------------------*/
258 typedef struct {
259 	msg_hdr_t	header;		/* common header		   */
260 	int		controller;	/* controller number actually used */
261 	int		channel;	/* channel number actually used    */
262 	char		datetime[DATETIME_MAX];	/* content of date/time IE */
263 } msg_connect_active_ind_t;
264 
265 /*---------------------------------------------------------------------------*
266  *	disconnect indication
267  *		indicates a disconnect
268  *---------------------------------------------------------------------------*/
269 typedef struct {
270 	msg_hdr_t	header;		/* common header	*/
271 	cause_t		cause;		/* cause code		*/
272 } msg_disconnect_ind_t;
273 
274 /*---------------------------------------------------------------------------*
275  *	negotiation complete
276  *		indicates an interface is completely up & running
277  *---------------------------------------------------------------------------*/
278 typedef struct {
279 	msg_hdr_t	header;		/* common header	*/
280 } msg_negcomplete_ind_t;
281 
282 /*---------------------------------------------------------------------------*
283  *	interface changes internal state
284  *		indicates an interface has somehow switched its FSM
285  *---------------------------------------------------------------------------*/
286 typedef struct {
287 	msg_hdr_t	header;		/* common header	*/
288 	int state;			/* new interface state */
289 } msg_ifstatechg_ind_t;
290 
291 /*---------------------------------------------------------------------------*
292  *	initiate a call to a remote site
293  *		i.e. the IP driver got a packet and wants a connection
294  *---------------------------------------------------------------------------*/
295 typedef struct {
296 	msg_hdr_t	header;		/* common header	*/
297 	int		driver;		/* driver type		*/
298 	int		driver_unit;	/* driver unit number	*/
299 } msg_dialout_ind_t;
300 
301 /*---------------------------------------------------------------------------*
302  *	dial a number
303  *---------------------------------------------------------------------------*/
304 typedef struct {
305 	msg_hdr_t	header;		/* common header	*/
306 	int		driver;		/* driver type		*/
307 	int		driver_unit;	/* driver unit number	*/
308 	int		cmdlen;		/* length of string	*/
309 	char		cmd[TELNO_MAX];	/* the number to dial	*/
310 } msg_dialoutnumber_ind_t;
311 
312 /*---------------------------------------------------------------------------*
313  *	idle timeout disconnect sent indication
314  *		kernel has sent disconnect request because of b-ch idle
315  *---------------------------------------------------------------------------*/
316 typedef struct {
317 	msg_hdr_t	header;		/* common header	*/
318 } msg_idle_timeout_ind_t;
319 
320 /*---------------------------------------------------------------------------*
321  *	accounting information from userland interface driver to daemon
322  *---------------------------------------------------------------------------*/
323 typedef struct {
324 	msg_hdr_t	header;		/* common header		*/
325 	int		accttype;	/* accounting type		*/
326 #define  ACCT_DURING 0
327 #define  ACCT_FINAL  1
328 	int		ioutbytes;	/* ISDN # of bytes sent		*/
329 	int		iinbytes;	/* ISDN # of bytes received	*/
330 	int		outbps;		/* bytes per sec out		*/
331 	int		inbps;		/* bytes per sec in		*/
332 	int		outbytes;	/* driver # of bytes sent	*/
333 	int		inbytes;	/* driver # of bytes received	*/
334 } msg_accounting_ind_t;
335 
336 /*---------------------------------------------------------------------------*
337  *	charging information from isdn driver to daemon
338  *---------------------------------------------------------------------------*/
339 typedef struct {
340 	msg_hdr_t	header;		/* common header		*/
341 	int		units;		/* number of units		*/
342 	int		units_type;	/* type of units info		*/
343 #define  CHARGE_INVALID	0	/* invalid, unknown */
344 #define  CHARGE_AOCD	1	/* advice of charge during call */
345 #define  CHARGE_AOCE	2	/* advice of charge at end of call */
346 #define  CHARGE_CALC	3	/* locally calculated from rates information */
347 } msg_charging_ind_t;
348 
349 /*---------------------------------------------------------------------------*
350  *	call proceeding indication
351  *		indicates outgoing SETUP has been acknowleged
352  *---------------------------------------------------------------------------*/
353 typedef struct {
354 	msg_hdr_t	header;		/* common header		   */
355 	int		controller;	/* controller number actually used */
356 	int		channel;	/* channel number actually used    */
357 } msg_proceeding_ind_t;
358 
359 /*---------------------------------------------------------------------------*
360  *	alert indication
361  *		indicates remote user side "rings"
362  *---------------------------------------------------------------------------*/
363 typedef struct {
364 	msg_hdr_t	header;		/* common header		   */
365 } msg_alert_ind_t;
366 
367 /*---------------------------------------------------------------------------*
368  *	driver requests to disconnect line
369  *---------------------------------------------------------------------------*/
370 typedef struct {
371 	msg_hdr_t	header;		/* common header	*/
372 } msg_drvrdisc_req_t;
373 
374 /*---------------------------------------------------------------------------*
375  *	connect packet logging
376  *---------------------------------------------------------------------------*/
377 
378 typedef struct {
379 	msg_hdr_t	header;		/* common header	*/
380 	int		driver;		/* driver type		*/
381 	int		driver_unit;	/* driver unit number	*/
382 	int		direction;	/* 0=in 1=out		*/
383 #define DIRECTION_IN	0		/* sending packet to remote	*/
384 #define DIRECTION_OUT	1		/* received packet from remote	*/
385 #define MAX_PACKET_LOG	40		/* space for IP and TCP header	*/
386 	u_int8_t	pktdata[MAX_PACKET_LOG];
387 } msg_packet_ind_t;
388 
389 /*---------------------------------------------------------------------------*
390  *	state of layer 1/2
391  *---------------------------------------------------------------------------*/
392 typedef struct {
393 	msg_hdr_t	header;		/* common header	*/
394 	int		controller;	/* controller unit 	*/
395 	int		layer;		/* layer number (1/2)	*/
396 #define LAYER_ONE	1
397 #define LAYER_TWO	2
398 	int		state;		/* state info		*/
399 #define LAYER_IDLE	0
400 #define LAYER_ACTIVE	1
401 } msg_l12stat_ind_t;
402 
403 /*---------------------------------------------------------------------------*
404  *	TEI assignment messages
405  *---------------------------------------------------------------------------*/
406 typedef struct {
407 	msg_hdr_t	header;		/* common header	*/
408 	int		controller;	/* controller unit 	*/
409 	int		tei;		/* TEI or -1 if invalid */
410 } msg_teiasg_ind_t;
411 
412 /*---------------------------------------------------------------------------*
413  *	persistent deactivation state of stack
414  *---------------------------------------------------------------------------*/
415 typedef struct {
416 	msg_hdr_t	header;		/* common header	*/
417 	int		controller;	/* controller unit 	*/
418 	int		numactive;	/* number of active connections */
419 } msg_pdeact_ind_t;
420 
421 /*---------------------------------------------------------------------------*
422  *	connect indication
423  *		indicates incoming connection
424  *---------------------------------------------------------------------------*/
425 typedef struct {
426 	msg_hdr_t	header;		/* common header		*/
427 	int		controller;	/* controller number		*/
428 	int		event;
429 #define CTRL_EV_IND_DETACH	0
430 #define CTRL_EV_IND_ATTACH	1
431 } msg_ctrl_ev_ind_t;
432 
433 /*===========================================================================*
434  *===========================================================================*
435  *	"ioctl" messages from userland -> kernel
436  *===========================================================================*
437  *===========================================================================*/
438 
439 /*---------------------------------------------------------------------------*
440  *	request a unique cdid (to setup an outgoing call)
441  *---------------------------------------------------------------------------*/
442 typedef struct {
443 	int		cdid;			/* call descriptor id	*/
444 } msg_cdid_req_t;
445 
446 #define	I4B_CDID_REQ		_IOWR('4', 0, int)
447 
448 /*---------------------------------------------------------------------------*
449  *	connect request
450  *		requests an outgoing connection
451  *---------------------------------------------------------------------------*/
452 typedef struct {
453 	int		cdid;		/* call descriptor id		     */
454 	int		controller;	/* controller to use		     */
455 	int		channel;	/* channel to use		     */
456 	int		txdelay;	/* tx delay after connect	     */
457 	int		bprot;		/* b channel protocol		     */
458 	int		driver;		/* driver to route b channel data to */
459 	int		driver_unit;	/*      unit number for above driver */
460 	msg_shorthold_t	shorthold_data;	/* the shorthold data		     */
461 	int		unitlen_method;	/* how to calculate the unitlength   */
462 #define  ULEN_METHOD_STATIC  0	/* use unitlen_time value (see above) */
463 #define  ULEN_METHOD_DYNAMIC 1	/* use AOCD */
464 	char		dst_telno[TELNO_MAX];	/* destination telephone no  */
465 	char		src_telno[TELNO_MAX];	/* source telephone number   */
466 } msg_connect_req_t;
467 
468 #define	I4B_CONNECT_REQ	_IOW('4', 1, msg_connect_req_t)
469 
470 /*---------------------------------------------------------------------------*
471  *	connect response
472  *		this is the answer to an incoming connect indication
473  *---------------------------------------------------------------------------*/
474 typedef struct {
475 	int	cdid;		/* call descriptor id			*/
476 	int	response;	/* what to do with incoming call	*/
477 #define  SETUP_RESP_DNTCRE 0	/* dont care, call is not for me	*/
478 #define  SETUP_RESP_REJECT 1	/* reject call				*/
479 #define  SETUP_RESP_ACCEPT 2	/* accept call				*/
480 	cause_t	cause;		/* cause for case SETUP_RESP_REJECT	*/
481 		/* the following are only used for SETUP_RESP_ACCEPT !! */
482 	int	txdelay;	/* tx delay after connect		*/
483 	int	bprot;		/* B chan protocol			*/
484 	int	driver;		/* driver to route b channel data to	*/
485 	int	driver_unit;	/*      unit number for above driver	*/
486 	int	max_idle_time;	/* max time without activity on b ch	*/
487 } msg_connect_resp_t;
488 
489 #define	I4B_CONNECT_RESP	_IOW('4', 2, msg_connect_resp_t)
490 
491 /*---------------------------------------------------------------------------*
492  *	disconnect request
493  *		active disconnect request
494  *---------------------------------------------------------------------------*/
495 typedef struct {
496 	int	cdid;		/* call descriptor id			*/
497 	cause_t	cause;		/* protocol independent cause		*/
498 } msg_discon_req_t;
499 
500 #define	I4B_DISCONNECT_REQ	_IOW('4', 3, msg_discon_req_t)
501 
502 /*---------------------------------------------------------------------------*
503  *	controller info request
504  *---------------------------------------------------------------------------*/
505 typedef struct {
506 	int	controller;	/* controller number			*/
507 	int	ncontroller;	/* number of controllers in system	*/
508 	int	max_isdnif;	/* highest available ISDN interface num */
509 	int	tei;		/* tei controller probably has		*/
510 	char	devname[64];	/* autoconfig device name, i.e. "isic0"	*/
511 	char	cardname[80];	/* human readable brand / version	*/
512 	int	nbch;		/* number of b channels provided	*/
513 } msg_ctrl_info_req_t;
514 
515 #define	I4B_CTRL_INFO_REQ	_IOWR('4', 4, msg_ctrl_info_req_t)
516 
517 /*---------------------------------------------------------------------------*
518  *	dialout response
519  *		status report to driver who requested a dialout
520  *---------------------------------------------------------------------------*/
521 typedef struct {
522 	int		driver;		/* driver to route b channel data to */
523 	int		driver_unit;	/*      unit number for above driver */
524 	int		stat;		/* state of dialout request	     */
525 #define  DSTAT_NONE	0
526 #define  DSTAT_TFAIL	1		/* transient failure */
527 #define  DSTAT_PFAIL	2		/* permanent failure */
528 #define  DSTAT_INONLY	3		/* no outgoing dials allowed */
529 	cause_t		cause;		/* exact i4b cause */
530 } msg_dialout_resp_t;
531 
532 #define	I4B_DIALOUT_RESP	_IOW('4', 5, msg_dialout_resp_t)
533 
534 /*---------------------------------------------------------------------------*
535  *	timeout value update
536  *---------------------------------------------------------------------------*/
537 typedef struct {
538 	int	cdid;		/* call descriptor id			*/
539 	msg_shorthold_t	shorthold_data;
540 } msg_timeout_upd_t;
541 
542 #define	I4B_TIMEOUT_UPD		_IOW('4', 6, msg_timeout_upd_t)
543 
544 /*---------------------------------------------------------------------------*
545  *	soft enable/disable
546  *---------------------------------------------------------------------------*/
547 typedef struct {
548 	int		driver;		/* driver to route b channel data to */
549 	int		driver_unit;	/*      unit number for above driver */
550 	int		updown;		/* what to do			     */
551 #define  SOFT_ENA	0	/* enable interface */
552 #define  SOFT_DIS	1	/* disable interface */
553 } msg_updown_ind_t;
554 
555 #define	I4B_UPDOWN_IND		_IOW('4', 7, msg_updown_ind_t)
556 
557 /*---------------------------------------------------------------------------*
558  *	send alert request
559  *---------------------------------------------------------------------------*/
560 typedef struct {
561 	int	cdid;		/* call descriptor id			*/
562 } msg_alert_req_t;
563 
564 #define	I4B_ALERT_REQ		_IOW('4', 8, msg_alert_req_t)
565 
566 /*---------------------------------------------------------------------------*
567  *	request version and release info from kernel part
568  *	(msg_vr_req_t is also used by tel & rbch drivers)
569  *---------------------------------------------------------------------------*/
570 typedef struct {
571 	int	version;	/* version number */
572 	int	release;	/* release number */
573 	int	step;		/* release step number */
574 } msg_vr_req_t;
575 
576 #define I4B_VR_REQ              _IOR('4', 9, msg_vr_req_t)
577 
578 /*---------------------------------------------------------------------------*
579  *	set ISDN protocol used by a controller
580  *---------------------------------------------------------------------------*/
581 typedef struct {
582 	int	controller;	/* controller number		*/
583 	int	protocol;	/* ISDN D-channel protocol type	*/
584 } msg_prot_ind_t;
585 
586 #define I4B_PROT_IND		_IOW('4', 10, msg_prot_ind_t)
587 
588 /*---------------------------------------------------------------------------*
589  *	Query the identifier for a B channel driver
590  *---------------------------------------------------------------------------*/
591 #define	L4DRIVER_NAME_SIZ	16
592 typedef struct {
593 	char name[L4DRIVER_NAME_SIZ];	/* lookup this driver */
594 	int  driver_id;			/* returned driver id */
595 } msg_l4driver_lookup_t;
596 
597 #define I4B_L4DRIVER_LOOKUP	_IOWR('4', 11, msg_l4driver_lookup_t)
598 
599 /*---------------------------------------------------------------------------*
600  *	Protocol download to active cards
601  *---------------------------------------------------------------------------*/
602 struct isdn_dr_prot {
603 	size_t bytecount;	/* length of code */
604 	u_int8_t *microcode;	/* pointer to microcode */
605 };
606 
607 struct isdn_download_request {
608 	int controller;		/* controller number */
609 	int numprotos;		/* number of protocols in 'protocols' */
610 	struct isdn_dr_prot *protocols;
611 };
612 
613 #define	I4B_CTRL_DOWNLOAD	_IOW('4', 100, struct isdn_download_request)
614 
615 /*---------------------------------------------------------------------------*
616  *	Generic diagnostic interface for active cards
617  *---------------------------------------------------------------------------*/
618 struct isdn_diagnostic_request {
619 	int controller;		/* controller number */
620 	u_int32_t cmd;		/* diagnostic command to execute */
621 	size_t in_param_len;	/* length of additional input parameter */
622 #define I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN	65536
623 	void *in_param;		/* optional input parameter */
624 	size_t out_param_len;	/* available output space */
625 	void *out_param;	/* output data goes here */
626 };
627 
628 #define	I4B_ACTIVE_DIAGNOSTIC	_IOW('4', 102, struct isdn_diagnostic_request)
629 
630 #endif /* !_NETISDN_I4B_IOCTL_H_ */
631