l3ni1.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* $Id: l3ni1.h,v 2.3.6.2 2001/09/23 22:24:50 kai Exp $
  2. *
  3. * NI1 D-channel protocol
  4. *
  5. * Author Matt Henderson & Guy Ellis
  6. * Copyright by Traverse Technologies Pty Ltd, www.travers.com.au
  7. *
  8. * This software may be used and distributed according to the terms
  9. * of the GNU General Public License, incorporated herein by reference.
  10. *
  11. * 2000.6.6 Initial implementation of routines for US NI1
  12. * Layer 3 protocol based on the EURO/DSS1 D-channel protocol
  13. * driver written by Karsten Keil et al. Thanks also for the
  14. * code provided by Ragnar Paulson.
  15. *
  16. */
  17. #ifndef l3ni1_process
  18. #define T302 15000
  19. #define T303 4000
  20. #define T304 30000
  21. #define T305 30000
  22. #define T308 4000
  23. /* for layer 1 certification T309 < layer1 T3 (e.g. 4000) */
  24. /* This makes some tests easier and quicker */
  25. #define T309 40000
  26. #define T310 30000
  27. #define T313 4000
  28. #define T318 4000
  29. #define T319 4000
  30. #define TSPID 5000 /* was 2000 - Guy Ellis */
  31. /*
  32. * Message-Types
  33. */
  34. #define MT_ALERTING 0x01
  35. #define MT_CALL_PROCEEDING 0x02
  36. #define MT_CONNECT 0x07
  37. #define MT_CONNECT_ACKNOWLEDGE 0x0f
  38. #define MT_PROGRESS 0x03
  39. #define MT_SETUP 0x05
  40. #define MT_SETUP_ACKNOWLEDGE 0x0d
  41. #define MT_RESUME 0x26
  42. #define MT_RESUME_ACKNOWLEDGE 0x2e
  43. #define MT_RESUME_REJECT 0x22
  44. #define MT_SUSPEND 0x25
  45. #define MT_SUSPEND_ACKNOWLEDGE 0x2d
  46. #define MT_SUSPEND_REJECT 0x21
  47. #define MT_USER_INFORMATION 0x20
  48. #define MT_DISCONNECT 0x45
  49. #define MT_RELEASE 0x4d
  50. #define MT_RELEASE_COMPLETE 0x5a
  51. #define MT_RESTART 0x46
  52. #define MT_RESTART_ACKNOWLEDGE 0x4e
  53. #define MT_SEGMENT 0x60
  54. #define MT_CONGESTION_CONTROL 0x79
  55. #define MT_INFORMATION 0x7b
  56. #define MT_FACILITY 0x62
  57. #define MT_NOTIFY 0x6e
  58. #define MT_STATUS 0x7d
  59. #define MT_STATUS_ENQUIRY 0x75
  60. #define MT_DL_ESTABLISHED 0xfe
  61. #define IE_SEGMENT 0x00
  62. #define IE_BEARER 0x04
  63. #define IE_CAUSE 0x08
  64. #define IE_CALL_ID 0x10
  65. #define IE_CALL_STATE 0x14
  66. #define IE_CHANNEL_ID 0x18
  67. #define IE_FACILITY 0x1c
  68. #define IE_PROGRESS 0x1e
  69. #define IE_NET_FAC 0x20
  70. #define IE_NOTIFY 0x27
  71. #define IE_DISPLAY 0x28
  72. #define IE_DATE 0x29
  73. #define IE_KEYPAD 0x2c
  74. #define IE_SIGNAL 0x34
  75. #define IE_SPID 0x3a
  76. #define IE_ENDPOINT_ID 0x3b
  77. #define IE_INFORATE 0x40
  78. #define IE_E2E_TDELAY 0x42
  79. #define IE_TDELAY_SEL 0x43
  80. #define IE_PACK_BINPARA 0x44
  81. #define IE_PACK_WINSIZE 0x45
  82. #define IE_PACK_SIZE 0x46
  83. #define IE_CUG 0x47
  84. #define IE_REV_CHARGE 0x4a
  85. #define IE_CONNECT_PN 0x4c
  86. #define IE_CONNECT_SUB 0x4d
  87. #define IE_CALLING_PN 0x6c
  88. #define IE_CALLING_SUB 0x6d
  89. #define IE_CALLED_PN 0x70
  90. #define IE_CALLED_SUB 0x71
  91. #define IE_REDIR_NR 0x74
  92. #define IE_TRANS_SEL 0x78
  93. #define IE_RESTART_IND 0x79
  94. #define IE_LLC 0x7c
  95. #define IE_HLC 0x7d
  96. #define IE_USER_USER 0x7e
  97. #define IE_ESCAPE 0x7f
  98. #define IE_SHIFT 0x90
  99. #define IE_MORE_DATA 0xa0
  100. #define IE_COMPLETE 0xa1
  101. #define IE_CONGESTION 0xb0
  102. #define IE_REPEAT 0xd0
  103. #define IE_MANDATORY 0x0100
  104. /* mandatory not in every case */
  105. #define IE_MANDATORY_1 0x0200
  106. #define ERR_IE_COMPREHENSION 1
  107. #define ERR_IE_UNRECOGNIZED -1
  108. #define ERR_IE_LENGTH -2
  109. #define ERR_IE_SEQUENCE -3
  110. #else /* only l3ni1_process */
  111. /* l3ni1 specific data in l3 process */
  112. typedef struct
  113. { unsigned char invoke_id; /* used invoke id in remote ops, 0 = not active */
  114. ulong ll_id; /* remebered ll id */
  115. u8 remote_operation; /* handled remote operation, 0 = not active */
  116. int proc; /* rememered procedure */
  117. ulong remote_result; /* result of remote operation for statcallb */
  118. char uus1_data[35]; /* data send during alerting or disconnect */
  119. } ni1_proc_priv;
  120. /* l3dni1 specific data in protocol stack */
  121. typedef struct
  122. { unsigned char last_invoke_id; /* last used value for invoking */
  123. unsigned char invoke_used[32]; /* 256 bits for 256 values */
  124. } ni1_stk_priv;
  125. #endif /* only l3dni1_process */