kst_ifc.h 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. /*
  2. *
  3. Copyright (c) Eicon Networks, 2000.
  4. *
  5. This source file is supplied for the use with
  6. Eicon Networks range of DIVA Server Adapters.
  7. *
  8. Eicon File Revision : 1.9
  9. *
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14. *
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  17. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. See the GNU General Public License for more details.
  19. *
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. #ifndef __DIVA_EICON_TRACE_API__
  26. #define __DIVA_EICON_TRACE_API__
  27. #define DIVA_TRACE_LINE_TYPE_LEN 64
  28. #define DIVA_TRACE_IE_LEN 64
  29. #define DIVA_TRACE_FAX_PRMS_LEN 128
  30. typedef struct _diva_trace_ie {
  31. byte length;
  32. byte data[DIVA_TRACE_IE_LEN];
  33. } diva_trace_ie_t;
  34. /*
  35. Structure used to represent "State\\BX\\Modem" directory
  36. to user.
  37. */
  38. typedef struct _diva_trace_modem_state {
  39. dword ChannelNumber;
  40. dword Event;
  41. dword Norm;
  42. dword Options; /* Options received from Application */
  43. dword TxSpeed;
  44. dword RxSpeed;
  45. dword RoundtripMsec;
  46. dword SymbolRate;
  47. int RxLeveldBm;
  48. int EchoLeveldBm;
  49. dword SNRdb;
  50. dword MAE;
  51. dword LocalRetrains;
  52. dword RemoteRetrains;
  53. dword LocalResyncs;
  54. dword RemoteResyncs;
  55. dword DiscReason;
  56. } diva_trace_modem_state_t;
  57. /*
  58. Representation of "State\\BX\\FAX" directory
  59. */
  60. typedef struct _diva_trace_fax_state {
  61. dword ChannelNumber;
  62. dword Event;
  63. dword Page_Counter;
  64. dword Features;
  65. char Station_ID[DIVA_TRACE_FAX_PRMS_LEN];
  66. char Subaddress[DIVA_TRACE_FAX_PRMS_LEN];
  67. char Password[DIVA_TRACE_FAX_PRMS_LEN];
  68. dword Speed;
  69. dword Resolution;
  70. dword Paper_Width;
  71. dword Paper_Length;
  72. dword Scanline_Time;
  73. dword Disc_Reason;
  74. dword dummy;
  75. } diva_trace_fax_state_t;
  76. /*
  77. Structure used to represent Interface State in the abstract
  78. and interface/D-channel protocol independent form.
  79. */
  80. typedef struct _diva_trace_interface_state {
  81. char Layer1[DIVA_TRACE_LINE_TYPE_LEN];
  82. char Layer2[DIVA_TRACE_LINE_TYPE_LEN];
  83. } diva_trace_interface_state_t;
  84. typedef struct _diva_incoming_call_statistics {
  85. dword Calls;
  86. dword Connected;
  87. dword User_Busy;
  88. dword Call_Rejected;
  89. dword Wrong_Number;
  90. dword Incompatible_Dst;
  91. dword Out_of_Order;
  92. dword Ignored;
  93. } diva_incoming_call_statistics_t;
  94. typedef struct _diva_outgoing_call_statistics {
  95. dword Calls;
  96. dword Connected;
  97. dword User_Busy;
  98. dword No_Answer;
  99. dword Wrong_Number;
  100. dword Call_Rejected;
  101. dword Other_Failures;
  102. } diva_outgoing_call_statistics_t;
  103. typedef struct _diva_modem_call_statistics {
  104. dword Disc_Normal;
  105. dword Disc_Unspecified;
  106. dword Disc_Busy_Tone;
  107. dword Disc_Congestion;
  108. dword Disc_Carr_Wait;
  109. dword Disc_Trn_Timeout;
  110. dword Disc_Incompat;
  111. dword Disc_Frame_Rej;
  112. dword Disc_V42bis;
  113. } diva_modem_call_statistics_t;
  114. typedef struct _diva_fax_call_statistics {
  115. dword Disc_Normal;
  116. dword Disc_Not_Ident;
  117. dword Disc_No_Response;
  118. dword Disc_Retries;
  119. dword Disc_Unexp_Msg;
  120. dword Disc_No_Polling;
  121. dword Disc_Training;
  122. dword Disc_Unexpected;
  123. dword Disc_Application;
  124. dword Disc_Incompat;
  125. dword Disc_No_Command;
  126. dword Disc_Long_Msg;
  127. dword Disc_Supervisor;
  128. dword Disc_SUB_SEP_PWD;
  129. dword Disc_Invalid_Msg;
  130. dword Disc_Page_Coding;
  131. dword Disc_App_Timeout;
  132. dword Disc_Unspecified;
  133. } diva_fax_call_statistics_t;
  134. typedef struct _diva_prot_statistics {
  135. dword X_Frames;
  136. dword X_Bytes;
  137. dword X_Errors;
  138. dword R_Frames;
  139. dword R_Bytes;
  140. dword R_Errors;
  141. } diva_prot_statistics_t;
  142. typedef struct _diva_ifc_statistics {
  143. diva_incoming_call_statistics_t inc;
  144. diva_outgoing_call_statistics_t outg;
  145. diva_modem_call_statistics_t mdm;
  146. diva_fax_call_statistics_t fax;
  147. diva_prot_statistics_t b1;
  148. diva_prot_statistics_t b2;
  149. diva_prot_statistics_t d1;
  150. diva_prot_statistics_t d2;
  151. } diva_ifc_statistics_t;
  152. /*
  153. Structure used to represent "State\\BX" directory
  154. to user.
  155. */
  156. typedef struct _diva_trace_line_state {
  157. dword ChannelNumber;
  158. char Line[DIVA_TRACE_LINE_TYPE_LEN];
  159. char Framing[DIVA_TRACE_LINE_TYPE_LEN];
  160. char Layer2[DIVA_TRACE_LINE_TYPE_LEN];
  161. char Layer3[DIVA_TRACE_LINE_TYPE_LEN];
  162. char RemoteAddress[DIVA_TRACE_LINE_TYPE_LEN];
  163. char RemoteSubAddress[DIVA_TRACE_LINE_TYPE_LEN];
  164. char LocalAddress[DIVA_TRACE_LINE_TYPE_LEN];
  165. char LocalSubAddress[DIVA_TRACE_LINE_TYPE_LEN];
  166. diva_trace_ie_t call_BC;
  167. diva_trace_ie_t call_HLC;
  168. diva_trace_ie_t call_LLC;
  169. dword Charges;
  170. dword CallReference;
  171. dword LastDisconnecCause;
  172. char UserID[DIVA_TRACE_LINE_TYPE_LEN];
  173. diva_trace_modem_state_t modem;
  174. diva_trace_fax_state_t fax;
  175. diva_trace_interface_state_t *pInterface;
  176. diva_ifc_statistics_t *pInterfaceStat;
  177. } diva_trace_line_state_t;
  178. #define DIVA_SUPER_TRACE_NOTIFY_LINE_CHANGE ('l')
  179. #define DIVA_SUPER_TRACE_NOTIFY_MODEM_CHANGE ('m')
  180. #define DIVA_SUPER_TRACE_NOTIFY_FAX_CHANGE ('f')
  181. #define DIVA_SUPER_TRACE_INTERFACE_CHANGE ('i')
  182. #define DIVA_SUPER_TRACE_NOTIFY_STAT_CHANGE ('s')
  183. #define DIVA_SUPER_TRACE_NOTIFY_MDM_STAT_CHANGE ('M')
  184. #define DIVA_SUPER_TRACE_NOTIFY_FAX_STAT_CHANGE ('F')
  185. struct _diva_strace_library_interface;
  186. typedef void (*diva_trace_channel_state_change_proc_t)(void *user_context,
  187. struct _diva_strace_library_interface *hLib,
  188. int Adapter,
  189. diva_trace_line_state_t *channel, int notify_subject);
  190. typedef void (*diva_trace_channel_trace_proc_t)(void *user_context,
  191. struct _diva_strace_library_interface *hLib,
  192. int Adapter, void *xlog_buffer, int length);
  193. typedef void (*diva_trace_error_proc_t)(void *user_context,
  194. struct _diva_strace_library_interface *hLib,
  195. int Adapter,
  196. int error, const char *file, int line);
  197. /*
  198. This structure creates interface from user to library
  199. */
  200. typedef struct _diva_trace_library_user_interface {
  201. void *user_context;
  202. diva_trace_channel_state_change_proc_t notify_proc;
  203. diva_trace_channel_trace_proc_t trace_proc;
  204. diva_trace_error_proc_t error_notify_proc;
  205. } diva_trace_library_user_interface_t;
  206. /*
  207. Interface from Library to User
  208. */
  209. typedef int (*DivaSTraceLibraryStart_proc_t)(void *hLib);
  210. typedef int (*DivaSTraceLibraryFinit_proc_t)(void *hLib);
  211. typedef int (*DivaSTraceMessageInput_proc_t)(void *hLib);
  212. typedef void* (*DivaSTraceGetHandle_proc_t)(void *hLib);
  213. /*
  214. Turn Audio Tap trace on/off
  215. Channel should be in the range 1 ... Number of Channels
  216. */
  217. typedef int (*DivaSTraceSetAudioTap_proc_t)(void *hLib, int Channel, int on);
  218. /*
  219. Turn B-channel trace on/off
  220. Channel should be in the range 1 ... Number of Channels
  221. */
  222. typedef int (*DivaSTraceSetBChannel_proc_t)(void *hLib, int Channel, int on);
  223. /*
  224. Turn D-channel (Layer1/Layer2/Layer3) trace on/off
  225. Layer1 - All D-channel frames received/sent over the interface
  226. inclusive Layer 2 headers, Layer 2 frames and TEI management frames
  227. Layer2 - Events from LAPD protocol instance with SAPI of signalling protocol
  228. Layer3 - All D-channel frames addressed to assigned to the card TEI and
  229. SAPI of signalling protocol, and signalling protocol events.
  230. */
  231. typedef int (*DivaSTraceSetDChannel_proc_t)(void *hLib, int on);
  232. /*
  233. Get overall card statistics
  234. */
  235. typedef int (*DivaSTraceGetOutgoingCallStatistics_proc_t)(void *hLib);
  236. typedef int (*DivaSTraceGetIncomingCallStatistics_proc_t)(void *hLib);
  237. typedef int (*DivaSTraceGetModemStatistics_proc_t)(void *hLib);
  238. typedef int (*DivaSTraceGetFaxStatistics_proc_t)(void *hLib);
  239. typedef int (*DivaSTraceGetBLayer1Statistics_proc_t)(void *hLib);
  240. typedef int (*DivaSTraceGetBLayer2Statistics_proc_t)(void *hLib);
  241. typedef int (*DivaSTraceGetDLayer1Statistics_proc_t)(void *hLib);
  242. typedef int (*DivaSTraceGetDLayer2Statistics_proc_t)(void *hLib);
  243. /*
  244. Call control
  245. */
  246. typedef int (*DivaSTraceClearCall_proc_t)(void *hLib, int Channel);
  247. typedef struct _diva_strace_library_interface {
  248. void *hLib;
  249. DivaSTraceLibraryStart_proc_t DivaSTraceLibraryStart;
  250. DivaSTraceLibraryStart_proc_t DivaSTraceLibraryStop;
  251. DivaSTraceLibraryFinit_proc_t DivaSTraceLibraryFinit;
  252. DivaSTraceMessageInput_proc_t DivaSTraceMessageInput;
  253. DivaSTraceGetHandle_proc_t DivaSTraceGetHandle;
  254. DivaSTraceSetAudioTap_proc_t DivaSTraceSetAudioTap;
  255. DivaSTraceSetBChannel_proc_t DivaSTraceSetBChannel;
  256. DivaSTraceSetDChannel_proc_t DivaSTraceSetDChannel;
  257. DivaSTraceSetDChannel_proc_t DivaSTraceSetInfo;
  258. DivaSTraceGetOutgoingCallStatistics_proc_t \
  259. DivaSTraceGetOutgoingCallStatistics;
  260. DivaSTraceGetIncomingCallStatistics_proc_t \
  261. DivaSTraceGetIncomingCallStatistics;
  262. DivaSTraceGetModemStatistics_proc_t \
  263. DivaSTraceGetModemStatistics;
  264. DivaSTraceGetFaxStatistics_proc_t \
  265. DivaSTraceGetFaxStatistics;
  266. DivaSTraceGetBLayer1Statistics_proc_t \
  267. DivaSTraceGetBLayer1Statistics;
  268. DivaSTraceGetBLayer2Statistics_proc_t \
  269. DivaSTraceGetBLayer2Statistics;
  270. DivaSTraceGetDLayer1Statistics_proc_t \
  271. DivaSTraceGetDLayer1Statistics;
  272. DivaSTraceGetDLayer2Statistics_proc_t \
  273. DivaSTraceGetDLayer2Statistics;
  274. DivaSTraceClearCall_proc_t DivaSTraceClearCall;
  275. } diva_strace_library_interface_t;
  276. /*
  277. Create and return Library interface
  278. */
  279. diva_strace_library_interface_t *DivaSTraceLibraryCreateInstance(int Adapter,
  280. const diva_trace_library_user_interface_t *user_proc,
  281. byte *pmem);
  282. dword DivaSTraceGetMemotyRequirement(int channels);
  283. #define DIVA_MAX_ADAPTERS 64
  284. #define DIVA_MAX_LINES 32
  285. #endif