1*1b2b03f8SKarsten Keil /* 2*1b2b03f8SKarsten Keil * Copyright 2008 by Karsten Keil <kkeil@novell.com> 3*1b2b03f8SKarsten Keil * 4*1b2b03f8SKarsten Keil * This program is free software; you can redistribute it and/or modify 5*1b2b03f8SKarsten Keil * it under the terms of the GNU General Public License version 2 as 6*1b2b03f8SKarsten Keil * published by the Free Software Foundation. 7*1b2b03f8SKarsten Keil * 8*1b2b03f8SKarsten Keil * This program is distributed in the hope that it will be useful, 9*1b2b03f8SKarsten Keil * but WITHOUT ANY WARRANTY; without even the implied warranty of 10*1b2b03f8SKarsten Keil * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11*1b2b03f8SKarsten Keil * GNU General Public License for more details. 12*1b2b03f8SKarsten Keil * 13*1b2b03f8SKarsten Keil */ 14*1b2b03f8SKarsten Keil 15*1b2b03f8SKarsten Keil #ifndef mISDN_CORE_H 16*1b2b03f8SKarsten Keil #define mISDN_CORE_H 17*1b2b03f8SKarsten Keil 18*1b2b03f8SKarsten Keil extern struct mISDNdevice *get_mdevice(u_int); 19*1b2b03f8SKarsten Keil extern int get_mdevice_count(void); 20*1b2b03f8SKarsten Keil 21*1b2b03f8SKarsten Keil /* stack status flag */ 22*1b2b03f8SKarsten Keil #define mISDN_STACK_ACTION_MASK 0x0000ffff 23*1b2b03f8SKarsten Keil #define mISDN_STACK_COMMAND_MASK 0x000f0000 24*1b2b03f8SKarsten Keil #define mISDN_STACK_STATUS_MASK 0xfff00000 25*1b2b03f8SKarsten Keil /* action bits 0-15 */ 26*1b2b03f8SKarsten Keil #define mISDN_STACK_WORK 0 27*1b2b03f8SKarsten Keil #define mISDN_STACK_SETUP 1 28*1b2b03f8SKarsten Keil #define mISDN_STACK_CLEARING 2 29*1b2b03f8SKarsten Keil #define mISDN_STACK_RESTART 3 30*1b2b03f8SKarsten Keil #define mISDN_STACK_WAKEUP 4 31*1b2b03f8SKarsten Keil #define mISDN_STACK_ABORT 15 32*1b2b03f8SKarsten Keil /* command bits 16-19 */ 33*1b2b03f8SKarsten Keil #define mISDN_STACK_STOPPED 16 34*1b2b03f8SKarsten Keil #define mISDN_STACK_INIT 17 35*1b2b03f8SKarsten Keil #define mISDN_STACK_THREADSTART 18 36*1b2b03f8SKarsten Keil /* status bits 20-31 */ 37*1b2b03f8SKarsten Keil #define mISDN_STACK_BCHANNEL 20 38*1b2b03f8SKarsten Keil #define mISDN_STACK_ACTIVE 29 39*1b2b03f8SKarsten Keil #define mISDN_STACK_RUNNING 30 40*1b2b03f8SKarsten Keil #define mISDN_STACK_KILLED 31 41*1b2b03f8SKarsten Keil 42*1b2b03f8SKarsten Keil 43*1b2b03f8SKarsten Keil /* manager options */ 44*1b2b03f8SKarsten Keil #define MGR_OPT_USER 24 45*1b2b03f8SKarsten Keil #define MGR_OPT_NETWORK 25 46*1b2b03f8SKarsten Keil 47*1b2b03f8SKarsten Keil extern int connect_Bstack(struct mISDNdevice *, struct mISDNchannel *, 48*1b2b03f8SKarsten Keil u_int, struct sockaddr_mISDN *); 49*1b2b03f8SKarsten Keil extern int connect_layer1(struct mISDNdevice *, struct mISDNchannel *, 50*1b2b03f8SKarsten Keil u_int, struct sockaddr_mISDN *); 51*1b2b03f8SKarsten Keil extern int create_l2entity(struct mISDNdevice *, struct mISDNchannel *, 52*1b2b03f8SKarsten Keil u_int, struct sockaddr_mISDN *); 53*1b2b03f8SKarsten Keil 54*1b2b03f8SKarsten Keil extern int create_stack(struct mISDNdevice *); 55*1b2b03f8SKarsten Keil extern int create_teimanager(struct mISDNdevice *); 56*1b2b03f8SKarsten Keil extern void delete_teimanager(struct mISDNchannel *); 57*1b2b03f8SKarsten Keil extern void delete_channel(struct mISDNchannel *); 58*1b2b03f8SKarsten Keil extern void delete_stack(struct mISDNdevice *); 59*1b2b03f8SKarsten Keil extern void mISDN_initstack(u_int *); 60*1b2b03f8SKarsten Keil extern int misdn_sock_init(u_int *); 61*1b2b03f8SKarsten Keil extern void misdn_sock_cleanup(void); 62*1b2b03f8SKarsten Keil extern void add_layer2(struct mISDNchannel *, struct mISDNstack *); 63*1b2b03f8SKarsten Keil extern void __add_layer2(struct mISDNchannel *, struct mISDNstack *); 64*1b2b03f8SKarsten Keil 65*1b2b03f8SKarsten Keil extern u_int get_all_Bprotocols(void); 66*1b2b03f8SKarsten Keil struct Bprotocol *get_Bprotocol4mask(u_int); 67*1b2b03f8SKarsten Keil struct Bprotocol *get_Bprotocol4id(u_int); 68*1b2b03f8SKarsten Keil 69*1b2b03f8SKarsten Keil extern int mISDN_inittimer(u_int *); 70*1b2b03f8SKarsten Keil extern void mISDN_timer_cleanup(void); 71*1b2b03f8SKarsten Keil 72*1b2b03f8SKarsten Keil extern int l1_init(u_int *); 73*1b2b03f8SKarsten Keil extern void l1_cleanup(void); 74*1b2b03f8SKarsten Keil extern int Isdnl2_Init(u_int *); 75*1b2b03f8SKarsten Keil extern void Isdnl2_cleanup(void); 76*1b2b03f8SKarsten Keil 77*1b2b03f8SKarsten Keil #endif 78