isdn.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
  2. *
  3. * Main header for the Linux ISDN subsystem (linklevel).
  4. *
  5. * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
  6. * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg
  7. * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
  8. *
  9. * This software may be used and distributed according to the terms
  10. * of the GNU General Public License, incorporated herein by reference.
  11. *
  12. */
  13. #ifndef __ISDN_H__
  14. #define __ISDN_H__
  15. #include <linux/ioctl.h>
  16. #define ISDN_MAX_DRIVERS 32
  17. #define ISDN_MAX_CHANNELS 64
  18. /* New ioctl-codes */
  19. #define IIOCNETAIF _IO('I',1)
  20. #define IIOCNETDIF _IO('I',2)
  21. #define IIOCNETSCF _IO('I',3)
  22. #define IIOCNETGCF _IO('I',4)
  23. #define IIOCNETANM _IO('I',5)
  24. #define IIOCNETDNM _IO('I',6)
  25. #define IIOCNETGNM _IO('I',7)
  26. #define IIOCGETSET _IO('I',8) /* no longer supported */
  27. #define IIOCSETSET _IO('I',9) /* no longer supported */
  28. #define IIOCSETVER _IO('I',10)
  29. #define IIOCNETHUP _IO('I',11)
  30. #define IIOCSETGST _IO('I',12)
  31. #define IIOCSETBRJ _IO('I',13)
  32. #define IIOCSIGPRF _IO('I',14)
  33. #define IIOCGETPRF _IO('I',15)
  34. #define IIOCSETPRF _IO('I',16)
  35. #define IIOCGETMAP _IO('I',17)
  36. #define IIOCSETMAP _IO('I',18)
  37. #define IIOCNETASL _IO('I',19)
  38. #define IIOCNETDIL _IO('I',20)
  39. #define IIOCGETCPS _IO('I',21)
  40. #define IIOCGETDVR _IO('I',22)
  41. #define IIOCNETLCR _IO('I',23) /* dwabc ioctl for LCR from isdnlog */
  42. #define IIOCNETDWRSET _IO('I',24) /* dwabc ioctl to reset abc-values to default on a net-interface */
  43. #define IIOCNETALN _IO('I',32)
  44. #define IIOCNETDLN _IO('I',33)
  45. #define IIOCNETGPN _IO('I',34)
  46. #define IIOCDBGVAR _IO('I',127)
  47. #define IIOCDRVCTL _IO('I',128)
  48. /* cisco hdlck device private ioctls */
  49. #define SIOCGKEEPPERIOD (SIOCDEVPRIVATE + 0)
  50. #define SIOCSKEEPPERIOD (SIOCDEVPRIVATE + 1)
  51. #define SIOCGDEBSERINT (SIOCDEVPRIVATE + 2)
  52. #define SIOCSDEBSERINT (SIOCDEVPRIVATE + 3)
  53. /* Packet encapsulations for net-interfaces */
  54. #define ISDN_NET_ENCAP_ETHER 0
  55. #define ISDN_NET_ENCAP_RAWIP 1
  56. #define ISDN_NET_ENCAP_IPTYP 2
  57. #define ISDN_NET_ENCAP_CISCOHDLC 3 /* Without SLARP and keepalive */
  58. #define ISDN_NET_ENCAP_SYNCPPP 4
  59. #define ISDN_NET_ENCAP_UIHDLC 5
  60. #define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
  61. #define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt*/
  62. #define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
  63. /* Facility which currently uses an ISDN-channel */
  64. #define ISDN_USAGE_NONE 0
  65. #define ISDN_USAGE_RAW 1
  66. #define ISDN_USAGE_MODEM 2
  67. #define ISDN_USAGE_NET 3
  68. #define ISDN_USAGE_VOICE 4
  69. #define ISDN_USAGE_FAX 5
  70. #define ISDN_USAGE_MASK 7 /* Mask to get plain usage */
  71. #define ISDN_USAGE_DISABLED 32 /* This bit is set, if channel is disabled */
  72. #define ISDN_USAGE_EXCLUSIVE 64 /* This bit is set, if channel is exclusive */
  73. #define ISDN_USAGE_OUTGOING 128 /* This bit is set, if channel is outgoing */
  74. #define ISDN_MODEM_NUMREG 24 /* Number of Modem-Registers */
  75. #define ISDN_LMSNLEN 255 /* Length of tty's Listen-MSN string */
  76. #define ISDN_CMSGLEN 50 /* Length of CONNECT-Message to add for Modem */
  77. #define ISDN_MSNLEN 32
  78. #define NET_DV 0x06 /* Data version for isdn_net_ioctl_cfg */
  79. #define TTY_DV 0x06 /* Data version for iprofd etc. */
  80. #define INF_DV 0x01 /* Data version for /dev/isdninfo */
  81. typedef struct {
  82. char drvid[25];
  83. unsigned long arg;
  84. } isdn_ioctl_struct;
  85. typedef struct {
  86. char name[10];
  87. char phone[ISDN_MSNLEN];
  88. int outgoing;
  89. } isdn_net_ioctl_phone;
  90. typedef struct {
  91. char name[10]; /* Name of interface */
  92. char master[10]; /* Name of Master for Bundling */
  93. char slave[10]; /* Name of Slave for Bundling */
  94. char eaz[256]; /* EAZ/MSN */
  95. char drvid[25]; /* DriverId for Bindings */
  96. int onhtime; /* Hangup-Timeout */
  97. int charge; /* Charge-Units */
  98. int l2_proto; /* Layer-2 protocol */
  99. int l3_proto; /* Layer-3 protocol */
  100. int p_encap; /* Encapsulation */
  101. int exclusive; /* Channel, if bound exclusive */
  102. int dialmax; /* Dial Retry-Counter */
  103. int slavedelay; /* Delay until slave starts up */
  104. int cbdelay; /* Delay before Callback */
  105. int chargehup; /* Flag: Charge-Hangup */
  106. int ihup; /* Flag: Hangup-Timeout on incoming line */
  107. int secure; /* Flag: Secure */
  108. int callback; /* Flag: Callback */
  109. int cbhup; /* Flag: Reject Call before Callback */
  110. int pppbind; /* ippp device for bindings */
  111. int chargeint; /* Use fixed charge interval length */
  112. int triggercps; /* BogoCPS needed for triggering slave */
  113. int dialtimeout; /* Dial-Timeout */
  114. int dialwait; /* Time to wait after failed dial */
  115. int dialmode; /* Flag: off / on / auto */
  116. } isdn_net_ioctl_cfg;
  117. #define ISDN_NET_DIALMODE_MASK 0xC0 /* bits for status */
  118. #define ISDN_NET_DM_OFF 0x00 /* this interface is stopped */
  119. #define ISDN_NET_DM_MANUAL 0x40 /* this interface is on (manual) */
  120. #define ISDN_NET_DM_AUTO 0x80 /* this interface is autodial */
  121. #define ISDN_NET_DIALMODE(x) ((&(x))->flags & ISDN_NET_DIALMODE_MASK)
  122. #endif /* __ISDN_H__ */