isdn.h 5.7 KB

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