core.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #ifndef mISDN_CORE_H
  15. #define mISDN_CORE_H
  16. extern struct mISDNdevice *get_mdevice(u_int);
  17. extern int get_mdevice_count(void);
  18. /* stack status flag */
  19. #define mISDN_STACK_ACTION_MASK 0x0000ffff
  20. #define mISDN_STACK_COMMAND_MASK 0x000f0000
  21. #define mISDN_STACK_STATUS_MASK 0xfff00000
  22. /* action bits 0-15 */
  23. #define mISDN_STACK_WORK 0
  24. #define mISDN_STACK_SETUP 1
  25. #define mISDN_STACK_CLEARING 2
  26. #define mISDN_STACK_RESTART 3
  27. #define mISDN_STACK_WAKEUP 4
  28. #define mISDN_STACK_ABORT 15
  29. /* command bits 16-19 */
  30. #define mISDN_STACK_STOPPED 16
  31. #define mISDN_STACK_INIT 17
  32. #define mISDN_STACK_THREADSTART 18
  33. /* status bits 20-31 */
  34. #define mISDN_STACK_BCHANNEL 20
  35. #define mISDN_STACK_ACTIVE 29
  36. #define mISDN_STACK_RUNNING 30
  37. #define mISDN_STACK_KILLED 31
  38. /* manager options */
  39. #define MGR_OPT_USER 24
  40. #define MGR_OPT_NETWORK 25
  41. extern int connect_Bstack(struct mISDNdevice *, struct mISDNchannel *,
  42. u_int, struct sockaddr_mISDN *);
  43. extern int connect_layer1(struct mISDNdevice *, struct mISDNchannel *,
  44. u_int, struct sockaddr_mISDN *);
  45. extern int create_l2entity(struct mISDNdevice *, struct mISDNchannel *,
  46. u_int, struct sockaddr_mISDN *);
  47. extern int create_stack(struct mISDNdevice *);
  48. extern int create_teimanager(struct mISDNdevice *);
  49. extern void delete_teimanager(struct mISDNchannel *);
  50. extern void delete_channel(struct mISDNchannel *);
  51. extern void delete_stack(struct mISDNdevice *);
  52. extern void mISDN_initstack(u_int *);
  53. extern int misdn_sock_init(u_int *);
  54. extern void misdn_sock_cleanup(void);
  55. extern void add_layer2(struct mISDNchannel *, struct mISDNstack *);
  56. extern void __add_layer2(struct mISDNchannel *, struct mISDNstack *);
  57. extern u_int get_all_Bprotocols(void);
  58. struct Bprotocol *get_Bprotocol4mask(u_int);
  59. struct Bprotocol *get_Bprotocol4id(u_int);
  60. extern int mISDN_inittimer(u_int *);
  61. extern void mISDN_timer_cleanup(void);
  62. extern int l1_init(u_int *);
  63. extern void l1_cleanup(void);
  64. extern int Isdnl2_Init(u_int *);
  65. extern void Isdnl2_cleanup(void);
  66. extern void mISDN_init_clock(u_int *);
  67. #endif