1 /*
2 * Copyright (c) 1997, 2002 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 * $FreeBSD: releng/5.3/sys/i386/include/i4b_ioctl.h 101716 2002-08-12 07:53:55Z hm $
31 *
32 * last edit-date: [Sun Aug 11 19:19:08 2002]
33 *
34 *---------------------------------------------------------------------------*/
35
36 #ifndef _I4B_IOCTL_H_
37 #define _I4B_IOCTL_H_
38
39 /*---------------------------------------------------------------------------*
40 * version and release number for isdn4bsd package
41 *---------------------------------------------------------------------------*/
42 #define VERSION 1 /* version number */
43 #define REL 4 /* release number */
44 #define STEP 0 /* release step */
45
46 /*---------------------------------------------------------------------------*
47 * date/time format in i4b log messages
48 * ------------------------------------
49 * Being year 2000 clean is not easy with the current state of the
50 * ANSI C library standard and it's implementation for some locales.
51 * You might like to use the "%c" format of "strftime" sometimes,
52 * but this breaks Y2K in some locales. Also the old standard logfile
53 * format "%d.%m.%y %H:%M:%S" is non compliant.
54 * NetBSD's current toolset warns about this problems, and we compile
55 * with -Werror, so this problems need to be resolved.
56 *---------------------------------------------------------------------------*/
57 #define I4B_TIME_FORMAT "%d.%m.%Y %H:%M:%S"
58
59 /*---------------------------------------------------------------------------*
60 * max number of controllers in system
61 *---------------------------------------------------------------------------*/
62 #define MAX_CONTROLLERS 8 /* max number of controllers */
63
64 /*---------------------------------------------------------------------------*
65 * ISDN D-channel protocols
66 *---------------------------------------------------------------------------*/
67 #define PROTOCOL_DSS1 0 /* default, Euro-ISDN/DSS1 */
68 #define PROTOCOL_D64S 1 /* 64k leased line, no protocol */
69
70 /*---------------------------------------------------------------------------*
71 * controller types
72 *---------------------------------------------------------------------------*/
73 #define CTRL_INVALID (-1) /* invalid, error */
74 #define CTRL_UNKNOWN 0 /* unknown controller type */
75 #define CTRL_PASSIVE 1 /* passive ISDN controller cards*/
76 #define CTRL_DAIC 2 /* Diehl active controller cards*/
77 #define CTRL_TINADD 3 /* Stollmann Tina-dd active card*/
78 #define CTRL_AVMB1 4 /* AVM B1 active card */
79 #define CTRL_CAPI 5 /* cards seen via the CAPI layer*/
80 #define CTRL_NUMTYPES 6 /* number of controller types */
81
82 /*---------------------------------------------------------------------------*
83 * CTRL_PASSIVE: driver types
84 *---------------------------------------------------------------------------*/
85 #define MAXL1UNITS 8 /* max number of units */
86
87 #define L1DRVR_ISIC 0 /* isic - driver */
88 #define L1DRVR_IWIC 1 /* iwic - driver */
89 #define L1DRVR_IFPI 2 /* ifpi - driver */
90 #define L1DRVR_IHFC 3 /* ihfc - driver */
91 #define L1DRVR_IFPNP 4 /* ifpnp - driver */
92 #define L1DRVR_ICCHP 5 /* icchp - driver */
93 #define L1DRVR_ITJC 6 /* itjc - driver */
94 #define L1DRVR_IFPI2 7 /* ifpi2 - driver */
95
96 /* MAXL1DRVR MUST be updated when more passive drivers are added !!! */
97 #define MAXL1DRVR (L1DRVR_IFPI2 + 1)
98
99 /*---------------------------------------------------------------------------*
100 * card types for CTRL_PASSIVE
101 *---------------------------------------------------------------------------*/
102 #define CARD_TYPEP_INVAL (-1) /* invalid, error */
103 #define CARD_TYPEP_UNK 0 /* unknown */
104 #define CARD_TYPEP_8 1 /* Teles, S0/8 */
105 #define CARD_TYPEP_16 2 /* Teles, S0/16 */
106 #define CARD_TYPEP_16_3 3 /* Teles, S0/16.3 */
107 #define CARD_TYPEP_AVMA1 4 /* AVM A1 or AVM Fritz!Card */
108 #define CARD_TYPEP_163P 5 /* Teles, S0/16.3 PnP */
109 #define CARD_TYPEP_CS0P 6 /* Creatix, S0 PnP */
110 #define CARD_TYPEP_USRTA 7 /* US Robotics ISDN TA internal */
111 #define CARD_TYPEP_DRNNGO 8 /* Dr. Neuhaus Niccy GO@ */
112 #define CARD_TYPEP_SWS 9 /* Sedlbauer Win Speed */
113 #define CARD_TYPEP_DYNALINK 10 /* Dynalink IS64PH */
114 #define CARD_TYPEP_BLMASTER 11 /* ISDN Blaster / ISDN Master */
115 #define CARD_TYPEP_PCFRITZ 12 /* AVM PCMCIA Fritz!Card */
116 #define CARD_TYPEP_ELSAQS1ISA 13 /* ELSA QuickStep 1000pro ISA */
117 #define CARD_TYPEP_ELSAQS1PCI 14 /* ELSA QuickStep 1000pro PCI */
118 #define CARD_TYPEP_SIEMENSITALK 15 /* Siemens I-Talk */
119 #define CARD_TYPEP_ELSAMLIMC 16 /* ELSA MicroLink ISDN/MC */
120 #define CARD_TYPEP_ELSAMLMCALL 17 /* ELSA MicroLink MCall */
121 #define CARD_TYPEP_ITKIX1 18 /* ITK ix1 micro */
122 #define CARD_TYPEP_AVMA1PCI 19 /* AVM FRITZ!CARD PCI */
123 #define CARD_TYPEP_PCC16 20 /* ELSA PCC-16 */
124 #define CARD_TYPEP_AVM_PNP 21 /* AVM FRITZ!CARD PnP */
125 #define CARD_TYPEP_SIE_ISURF2 22 /* Siemens I-Surf 2 PnP */
126 #define CARD_TYPEP_ASUSCOMIPAC 23 /* Asuscom ISDNlink 128 K PnP */
127 #define CARD_TYPEP_WINB6692 24 /* Winbond W6692 based */
128 #define CARD_TYPEP_16_3C 25 /* Teles S0/16.3c PnP (HFC-S/SP */
129 #define CARD_TYPEP_ACERP10 26 /* Acer ISDN P10 (HFC-S) */
130 #define CARD_TYPEP_TELEINT_NO_1 27 /* TELEINT ISDN SPEED No. 1 (HFC-1) */
131 #define CARD_TYPEP_CCD_HFCS_PCI 28 /* Cologne Chip HFC-S PCI based */
132 #define CARD_TYPEP_NETJET_S 29 /* Traverse NetJet-S (Tiger300) */
133 #define CARD_TYPEP_DIVA_ISA 30 /* Eicon DIVA ISA PnP 2.0 or 2.02 */
134 #define CARD_TYPEP_COMPAQ_M610 31 /* Compaq Microcom 610 */
135 #define CARD_TYPEP_AVMA1PCI_V2 32 /* AVM FRITZ!CARD PCI Ver. 2 */
136 /*
137 * in case you add support for more cards, please update:
138 *
139 * isdnd: controller.c, name_of_controller()
140 *
141 * and adjust CARD_TYPEP_MAX below.
142 */
143
144 #define CARD_TYPEP_MAX 32 /* max type */
145
146 /*---------------------------------------------------------------------------*
147 * card types for CTRL_DAIC
148 *---------------------------------------------------------------------------*/
149 #define CARD_TYPEA_DAIC_UNK 0
150 #define CARD_TYPEA_DAIC_S 1
151 #define CARD_TYPEA_DAIC_SX 2
152 #define CARD_TYPEA_DAIC_SCOM 3
153 #define CARD_TYPEA_DAIC_QUAD 4
154
155 /*---------------------------------------------------------------------------*
156 * card types for CTRL_CAPI
157 *---------------------------------------------------------------------------*/
158 #define CARD_TYPEC_CAPI_UNK 0
159 #define CARD_TYPEC_AVM_T1_PCI 1
160 #define CARD_TYPEC_AVM_B1_PCI 2
161 #define CARD_TYPEC_AVM_B1_ISA 3
162
163 /*---------------------------------------------------------------------------*
164 * max length of some strings
165 *---------------------------------------------------------------------------*/
166 #define TELNO_MAX 41 /* max length of a telephone number (+ '\0') */
167 #define SUBADDR_MAX 21 /* max length of a subaddress (+ '\0') */
168 #define DISPLAY_MAX 91 /* max length of display information (+ '\0') */
169 #define DATETIME_MAX 21 /* max length of datetime information (+ '\0')*/
170 #define KEYPAD_MAX 35 /* max length of a keypad string (+ '\0') */
171
172 /*---------------------------------------------------------------------------*
173 * in case the src or dst telephone number is empty
174 *---------------------------------------------------------------------------*/
175 #define TELNO_EMPTY "NotAvailable"
176
177 /*---------------------------------------------------------------------------*
178 * B channel parameters
179 *---------------------------------------------------------------------------*/
180 #define BCH_MAX_DATALEN 2048 /* max length of a B channel frame */
181
182 /*---------------------------------------------------------------------------*
183 * userland driver types
184 * ---------------------
185 * a "driver" is defined here as a piece of software interfacing an
186 * ISDN B channel with a userland service, such as IP, Telephony etc.
187 *---------------------------------------------------------------------------*/
188 #define BDRV_RBCH 0 /* raw b-channel interface driver */
189 #define BDRV_TEL 1 /* telephone (speech) interface driver */
190 #define BDRV_IPR 2 /* IP over raw HDLC interface driver */
191 #define BDRV_ISPPP 3 /* sync Kernel PPP interface driver */
192 #define BDRV_IBC 4 /* BSD/OS point to point driver */
193 #define BDRV_ING 5 /* NetGraph ing driver */
194
195 /*---------------------------------------------------------------------------*
196 * B channel protocol
197 *---------------------------------------------------------------------------*/
198 #define BPROT_NONE 0 /* no protocol at all, raw data */
199 #define BPROT_RHDLC 1 /* raw HDLC: flag, data, crc, flag */
200
201 /*---------------------------------------------------------------------------*
202 * special bearer capability settings (i.e. Data over Voice)
203 *---------------------------------------------------------------------------*/
204 #define BCAP_NONE 0 /* no special bearer capability */
205 #define BCAP_DOV 1 /* Data over Voice */
206
207 /*---------------------------------------------------------------------------*
208 * causes data type
209 *---------------------------------------------------------------------------*/
210 typedef unsigned int cause_t; /* 32 bit unsigned int */
211
212 /*---------------------------------------------------------------------------*
213 * call descriptor id (cdid) definitions
214 *---------------------------------------------------------------------------*/
215 #define CDID_UNUSED 0 /* cdid is invalid and unused */
216 #define CDID_MAX 99999 /* highest valid cdid, wraparound to 1 */
217
218 /*---------------------------------------------------------------------------*
219 * The shorthold algorithm to use
220 *---------------------------------------------------------------------------*/
221 #define SHA_FIXU 0 /* timeout algorithm for fix unit charging */
222 #define SHA_VARU 1 /* timeout algorithm for variable unit charging */
223
224 /*---------------------------------------------------------------------------*
225 * The shorthold data struct
226 *---------------------------------------------------------------------------*/
227 typedef struct {
228 int shorthold_algorithm; /* shorthold algorithm to use */
229 int unitlen_time; /* length of a charging unit */
230 int idle_time; /* time without activity on b ch*/
231 int earlyhup_time; /* safety area at end of unit */
232 } msg_shorthold_t;
233
234
235 /****************************************************************************
236
237 outgoing call:
238 --------------
239
240 userland kernel
241 -------- ------
242
243 CDID_REQ ----------------->
244
245 <------------------ cdid
246
247 CONNECT_REQ -------------->
248
249 <------------------ PROCEEDING_IND (if connect req ok)
250
251 <------------------ CONNECT_ACTIVE_IND (if connection ok)
252
253 or
254
255 <------------------ DISCONNECT_IND (if connection failed)
256
257
258
259 incoming call:
260 --------------
261
262 userland kernel
263 -------- ------
264
265 <------------------ CONNECT_IND
266
267 CONNECT_RESP ------------->
268
269 <------------------ CONNECT_ACTIVE_IND (if accepted)
270
271
272
273 active disconnect:
274 ------------------
275
276 userland kernel
277 -------- ------
278
279 DISCONNECT_REQ ------------>
280
281 <------------------ DISCONNECT_IND
282
283
284 passive disconnect:
285 -------------------
286
287 userland kernel
288 -------- ------
289
290 <------------------ DISCONNECT_IND
291
292
293 ****************************************************************************/
294
295
296 /*===========================================================================*
297 *===========================================================================*
298 * "read" messages from kernel -> userland
299 *===========================================================================*
300 *===========================================================================*/
301
302
303 /*---------------------------------------------------------------------------*
304 * message header, included in every message
305 *---------------------------------------------------------------------------*/
306 typedef struct {
307 char type; /* message identifier */
308 #define MSG_CONNECT_IND 'a'
309 #define MSG_CONNECT_ACTIVE_IND 'b'
310 #define MSG_DISCONNECT_IND 'c'
311 #define MSG_DIALOUT_IND 'd'
312 #define MSG_IDLE_TIMEOUT_IND 'e'
313 #define MSG_ACCT_IND 'f'
314 #define MSG_CHARGING_IND 'g'
315 #define MSG_PROCEEDING_IND 'h'
316 #define MSG_ALERT_IND 'i'
317 #define MSG_DRVRDISC_REQ 'j'
318 #define MSG_L12STAT_IND 'k'
319 #define MSG_TEIASG_IND 'l'
320 #define MSG_PDEACT_IND 'm'
321 #define MSG_NEGCOMP_IND 'n'
322 #define MSG_IFSTATE_CHANGED_IND 'o'
323 #define MSG_DIALOUTNUMBER_IND 'p'
324 #define MSG_PACKET_IND 'q'
325 #define MSG_KEYPAD_IND 'r'
326 int cdid; /* call descriptor id */
327 } msg_hdr_t;
328
329 /*---------------------------------------------------------------------------*
330 * connect indication
331 * indicates incoming connection
332 *---------------------------------------------------------------------------*/
333 typedef struct {
334 msg_hdr_t header; /* common header */
335 int controller; /* controller number */
336 int channel; /* channel number */
337 #define CHAN_B1 0 /* this _must_ be 0, HSCX B1 is also 0 */
338 #define CHAN_B2 1 /* this _must_ be 1, HSCX B2 is also 1 */
339 #define CHAN_ANY (-1) /* outgoing, not possible for incoming */
340 #define CHAN_NO (-2) /* call waiting (CW) for incoming */
341 int bprot; /* b channel protocot, see BPROT_XXX */
342 int bcap; /* special bearer capability, see BCAP_XXX */
343 char dst_telno[TELNO_MAX]; /* destination telno */
344 char dst_subaddr[SUBADDR_MAX]; /* dest subaddr */
345 char src_telno[TELNO_MAX]; /* source telno */
346 char src_subaddr[SUBADDR_MAX]; /* src subaddr */
347 int dst_ton; /* dest. type of number */
348 int src_ton; /* src. type of number */
349 #define TON_OTHER 0 /* other type of number */
350 #define TON_INTERNAT 1 /* international number */
351 #define TON_NATIONAL 2 /* national number */
352 int scr_ind;/* screening indicator */
353 #define SCR_NONE 0 /* no screening indicator transmitted */
354 #define SCR_USR_NOSC 1 /* screening user provided, not screened*/
355 #define SCR_USR_PASS 2 /* screening user provided, verified & passed */
356 #define SCR_USR_FAIL 3 /* screening user provided, verified & failed */
357 #define SCR_NET 4 /* screening network provided */
358 int prs_ind;/* presentation indicator */
359 #define PRS_NONE 0 /* no presentation indicator transmitted*/
360 #define PRS_ALLOWED 1 /* presentation allowed */
361 #define PRS_RESTRICT 2 /* presentation restricted */
362 #define PRS_NNINTERW 3 /* number not available due to interworking */
363 #define PRS_RESERVED 4 /* reserved */
364 char display[DISPLAY_MAX]; /* content of display IE*/
365 } msg_connect_ind_t;
366
367 /*---------------------------------------------------------------------------*
368 * connect active indication
369 * indicates active connection
370 *---------------------------------------------------------------------------*/
371 typedef struct {
372 msg_hdr_t header; /* common header */
373 int controller; /* controller number actually used */
374 int channel; /* channel number actually used */
375 char datetime[DATETIME_MAX]; /* content of date/time IE */
376 } msg_connect_active_ind_t;
377
378 /*---------------------------------------------------------------------------*
379 * disconnect indication
380 * indicates a disconnect
381 *---------------------------------------------------------------------------*/
382 typedef struct {
383 msg_hdr_t header; /* common header */
384 cause_t cause; /* cause code */
385 } msg_disconnect_ind_t;
386
387 /*---------------------------------------------------------------------------*
388 * negotiation complete
389 * indicates an interface is completely up & running
390 *---------------------------------------------------------------------------*/
391 typedef struct {
392 msg_hdr_t header; /* common header */
393 } msg_negcomplete_ind_t;
394
395 /*---------------------------------------------------------------------------*
396 * interface changes internal state
397 * indicates an interface has somehow switched its FSM
398 *---------------------------------------------------------------------------*/
399 typedef struct {
400 msg_hdr_t header; /* common header */
401 int state; /* new interface state */
402 } msg_ifstatechg_ind_t;
403
404 /*---------------------------------------------------------------------------*
405 * initiate a call to a remote site
406 * i.e. the IP driver got a packet and wants a connection
407 *---------------------------------------------------------------------------*/
408 typedef struct {
409 msg_hdr_t header; /* common header */
410 int driver; /* driver type */
411 int driver_unit; /* driver unit number */
412 } msg_dialout_ind_t;
413
414 /*---------------------------------------------------------------------------*
415 * dial a number
416 *---------------------------------------------------------------------------*/
417 typedef struct {
418 msg_hdr_t header; /* common header */
419 int driver; /* driver type */
420 int driver_unit; /* driver unit number */
421 int cmdlen; /* length of string */
422 int subaddrlen; /* length of subaddr */
423 char cmd[TELNO_MAX]; /* the number to dial */
424 char subaddr[SUBADDR_MAX]; /* dest subaddr */
425 } msg_dialoutnumber_ind_t;
426
427 /*---------------------------------------------------------------------------*
428 * send keypad string
429 *---------------------------------------------------------------------------*/
430 typedef struct {
431 msg_hdr_t header; /* common header */
432 int driver; /* driver type */
433 int driver_unit; /* driver unit number */
434 int cmdlen; /* length of string */
435 char cmd[KEYPAD_MAX];/* keypad string */
436 } msg_keypad_ind_t;
437
438 /*---------------------------------------------------------------------------*
439 * idle timeout disconnect sent indication
440 * kernel has sent disconnect request because of b-ch idle
441 *---------------------------------------------------------------------------*/
442 typedef struct {
443 msg_hdr_t header; /* common header */
444 } msg_idle_timeout_ind_t;
445
446 /*---------------------------------------------------------------------------*
447 * accounting information from userland interface driver to daemon
448 *---------------------------------------------------------------------------*/
449 typedef struct {
450 msg_hdr_t header; /* common header */
451 int accttype; /* accounting type */
452 #define ACCT_DURING 0
453 #define ACCT_FINAL 1
454 int driver; /* driver type */
455 int driver_unit; /* driver unit number */
456 int ioutbytes; /* ISDN # of bytes sent */
457 int iinbytes; /* ISDN # of bytes received */
458 int outbps; /* bytes per sec out */
459 int inbps; /* bytes per sec in */
460 int outbytes; /* driver # of bytes sent */
461 int inbytes; /* driver # of bytes received */
462 } msg_accounting_ind_t;
463
464 /*---------------------------------------------------------------------------*
465 * charging information from isdn driver to daemon
466 *---------------------------------------------------------------------------*/
467 typedef struct {
468 msg_hdr_t header; /* common header */
469 int units; /* number of units */
470 int units_type; /* type of units info */
471 #define CHARGE_INVALID 0 /* invalid, unknown */
472 #define CHARGE_AOCD 1 /* advice of charge during call */
473 #define CHARGE_AOCE 2 /* advice of charge at end of call */
474 #define CHARGE_CALC 3 /* locally calculated from rates information */
475 } msg_charging_ind_t;
476
477 /*---------------------------------------------------------------------------*
478 * call proceeding indication
479 * indicates outgoing SETUP has been acknowleged
480 *---------------------------------------------------------------------------*/
481 typedef struct {
482 msg_hdr_t header; /* common header */
483 int controller; /* controller number actually used */
484 int channel; /* channel number actually used */
485 } msg_proceeding_ind_t;
486
487 /*---------------------------------------------------------------------------*
488 * alert indication
489 * indicates remote user side "rings"
490 *---------------------------------------------------------------------------*/
491 typedef struct {
492 msg_hdr_t header; /* common header */
493 } msg_alert_ind_t;
494
495 /*---------------------------------------------------------------------------*
496 * driver requests to disconnect line
497 *---------------------------------------------------------------------------*/
498 typedef struct {
499 msg_hdr_t header; /* common header */
500 int driver; /* driver type */
501 int driver_unit; /* driver unit number */
502 } msg_drvrdisc_req_t;
503
504 /*---------------------------------------------------------------------------*
505 * connect packet logging
506 *---------------------------------------------------------------------------*/
507
508 typedef struct {
509 msg_hdr_t header; /* common header */
510 int driver; /* driver type */
511 int driver_unit; /* driver unit number */
512 int direction; /* 0=in 1=out */
513 #define DIRECTION_IN 0 /* sending packet to remote */
514 #define DIRECTION_OUT 1 /* received packet from remote */
515 #define MAX_PACKET_LOG 40 /* space for IP and TCP header */
516 u_int8_t pktdata[MAX_PACKET_LOG];
517 } msg_packet_ind_t;
518
519 /*---------------------------------------------------------------------------*
520 * state of layer 1/2
521 *---------------------------------------------------------------------------*/
522 typedef struct {
523 msg_hdr_t header; /* common header */
524 int controller; /* controller unit */
525 int layer; /* layer number (1/2) */
526 #define LAYER_ONE 1
527 #define LAYER_TWO 2
528 int state; /* state info */
529 #define LAYER_IDLE 0
530 #define LAYER_ACTIVE 1
531 } msg_l12stat_ind_t;
532
533 /*---------------------------------------------------------------------------*
534 * TEI assignment messages
535 *---------------------------------------------------------------------------*/
536 typedef struct {
537 msg_hdr_t header; /* common header */
538 int controller; /* controller unit */
539 int tei; /* TEI or -1 if invalid */
540 } msg_teiasg_ind_t;
541
542 /*---------------------------------------------------------------------------*
543 * persistent deactivation state of stack
544 *---------------------------------------------------------------------------*/
545 typedef struct {
546 msg_hdr_t header; /* common header */
547 int controller; /* controller unit */
548 int numactive; /* number of active connections */
549 } msg_pdeact_ind_t;
550
551
552 /*===========================================================================*
553 *===========================================================================*
554 * "ioctl" messages from userland -> kernel
555 *===========================================================================*
556 *===========================================================================*/
557
558 /*---------------------------------------------------------------------------*
559 * request a unique cdid (to setup an outgoing call)
560 *---------------------------------------------------------------------------*/
561 typedef struct {
562 int cdid; /* call descriptor id */
563 } msg_cdid_req_t;
564
565 #define I4B_CDID_REQ _IOWR('4', 0, int)
566
567 /*---------------------------------------------------------------------------*
568 * connect request
569 * requests an outgoing connection
570 *---------------------------------------------------------------------------*/
571 typedef struct {
572 int cdid; /* call descriptor id */
573 int controller; /* controller to use */
574 int channel; /* channel to use */
575 int txdelay; /* tx delay after connect */
576 int bprot; /* b channel protocol */
577 int bcap; /* special bearer capability */
578 int driver; /* driver to route b channel data to */
579 int driver_unit; /* unit number for above driver */
580 msg_shorthold_t shorthold_data; /* the shorthold data */
581 int unitlen_method; /* how to calculate the unitlength */
582 #define ULEN_METHOD_STATIC 0 /* use unitlen_time value (see above) */
583 #define ULEN_METHOD_DYNAMIC 1 /* use AOCD */
584 char dst_telno[TELNO_MAX]; /* destination telephone no */
585 char dst_subaddr[SUBADDR_MAX]; /* dest subaddr */
586 char src_telno[TELNO_MAX]; /* source telephone number */
587 char src_subaddr[SUBADDR_MAX]; /* source subaddr */
588 char keypad[KEYPAD_MAX]; /* keypad string */
589 } msg_connect_req_t;
590
591 #define I4B_CONNECT_REQ _IOW('4', 1, msg_connect_req_t)
592
593 /*---------------------------------------------------------------------------*
594 * connect response
595 * this is the answer to an incoming connect indication
596 *---------------------------------------------------------------------------*/
597 typedef struct {
598 int cdid; /* call descriptor id */
599 int response; /* what to do with incoming call */
600 #define SETUP_RESP_DNTCRE 0 /* dont care, call is not for me */
601 #define SETUP_RESP_REJECT 1 /* reject call */
602 #define SETUP_RESP_ACCEPT 2 /* accept call */
603 cause_t cause; /* cause for case SETUP_RESP_REJECT */
604 /* the following are only used for SETUP_RESP_ACCEPT !! */
605 int txdelay; /* tx delay after connect */
606 int bprot; /* B chan protocol */
607 int bcap; /* special bearer capability */
608 int driver; /* driver to route b channel data to */
609 int driver_unit; /* unit number for above driver */
610 int max_idle_time; /* max time without activity on b ch */
611 } msg_connect_resp_t;
612
613 #define I4B_CONNECT_RESP _IOW('4', 2, msg_connect_resp_t)
614
615 /*---------------------------------------------------------------------------*
616 * disconnect request
617 * active disconnect request
618 *---------------------------------------------------------------------------*/
619 typedef struct {
620 int cdid; /* call descriptor id */
621 cause_t cause; /* protocol independent cause */
622 } msg_discon_req_t;
623
624 #define I4B_DISCONNECT_REQ _IOW('4', 3, msg_discon_req_t)
625
626 /*---------------------------------------------------------------------------*
627 * controller info request
628 *---------------------------------------------------------------------------*/
629 typedef struct {
630 int controller; /* controller number */
631 int ncontroller; /* number of controllers in system */
632 int ctrl_type; /* controller type passive/active */
633 int card_type; /* brand / version */
634 int tei; /* tei controller probably has */
635 int nbch; /* number of b channels provided */
636 } msg_ctrl_info_req_t;
637
638 #define I4B_CTRL_INFO_REQ _IOWR('4', 4, msg_ctrl_info_req_t)
639
640 /*---------------------------------------------------------------------------*
641 * dialout response
642 * status report to driver who requested a dialout
643 *---------------------------------------------------------------------------*/
644 typedef struct {
645 int driver; /* driver to route b channel data to */
646 int driver_unit; /* unit number for above driver */
647 int stat; /* state of dialout request */
648 #define DSTAT_NONE 0
649 #define DSTAT_TFAIL 1 /* transient failure */
650 #define DSTAT_PFAIL 2 /* permanent failure */
651 #define DSTAT_INONLY 3 /* no outgoing dials allowed */
652 cause_t cause; /* exact i4b cause */
653 } msg_dialout_resp_t;
654
655 #define I4B_DIALOUT_RESP _IOW('4', 5, msg_dialout_resp_t)
656
657 /*---------------------------------------------------------------------------*
658 * timeout value update
659 *---------------------------------------------------------------------------*/
660 typedef struct {
661 int cdid; /* call descriptor id */
662 msg_shorthold_t shorthold_data;
663 } msg_timeout_upd_t;
664
665 #define I4B_TIMEOUT_UPD _IOW('4', 6, msg_timeout_upd_t)
666
667 /*---------------------------------------------------------------------------*
668 * soft enable/disable
669 *---------------------------------------------------------------------------*/
670 typedef struct {
671 int driver; /* driver to route b channel data to */
672 int driver_unit; /* unit number for above driver */
673 int updown; /* what to do */
674 #define SOFT_ENA 0 /* enable interface */
675 #define SOFT_DIS 1 /* disable interface */
676 } msg_updown_ind_t;
677
678 #define I4B_UPDOWN_IND _IOW('4', 7, msg_updown_ind_t)
679
680 /*---------------------------------------------------------------------------*
681 * send alert request
682 *---------------------------------------------------------------------------*/
683 typedef struct {
684 int cdid; /* call descriptor id */
685 } msg_alert_req_t;
686
687 #define I4B_ALERT_REQ _IOW('4', 8, msg_alert_req_t)
688
689 /*---------------------------------------------------------------------------*
690 * request version and release info from kernel part
691 * (msg_vr_req_t is also used by tel & rbch drivers)
692 *---------------------------------------------------------------------------*/
693 typedef struct {
694 int version; /* version number */
695 int release; /* release number */
696 int step; /* release step number */
697 } msg_vr_req_t;
698
699 #define I4B_VR_REQ _IOR('4', 9, msg_vr_req_t)
700
701 /*---------------------------------------------------------------------------*
702 * set ISDN protocol used by a controller
703 *---------------------------------------------------------------------------*/
704 typedef struct {
705 int controller; /* controller number */
706 int protocol; /* ISDN D-channel protocol type */
707 } msg_prot_ind_t;
708
709 #define I4B_PROT_IND _IOW('4', 10, msg_prot_ind_t)
710
711 /*---------------------------------------------------------------------------*
712 * Protocol download to active cards
713 *---------------------------------------------------------------------------*/
714 struct isdn_dr_prot {
715 size_t bytecount; /* length of code */
716 u_int8_t *microcode; /* pointer to microcode */
717 };
718
719 struct isdn_download_request {
720 int controller; /* controller number */
721 int numprotos; /* number of protocols in 'protocols' */
722 struct isdn_dr_prot *protocols;
723 };
724
725 #define I4B_CTRL_DOWNLOAD _IOW('4', 100, struct isdn_download_request)
726
727 /*---------------------------------------------------------------------------*
728 * Generic diagnostic interface for active cards
729 *---------------------------------------------------------------------------*/
730 struct isdn_diagnostic_request {
731 int controller; /* controller number */
732 u_int32_t cmd; /* diagnostic command to execute */
733 size_t in_param_len; /* length of additional input parameter */
734 #define I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN 65536
735 void *in_param; /* optional input parameter */
736 size_t out_param_len; /* available output space */
737 void *out_param; /* output data goes here */
738 };
739
740 #define I4B_ACTIVE_DIAGNOSTIC _IOW('4', 102, struct isdn_diagnostic_request)
741
742 #endif /* _I4B_IOCTL_H_ */
Cache object: fd98ce359611f85a91737f2c6bc15c73
|