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