35 #define MODEM_PARSE_ENTRIES 16
36 #define FAX_PARSE_ENTRIES 12
37 #define LINE_PARSE_ENTRIES 15
38 #define STAT_PARSE_ENTRIES 70
43 static int DivaSTraceLibraryStart(
void *hLib);
44 static int DivaSTraceLibraryStop(
void *hLib);
45 static int SuperTraceLibraryFinit(
void *hLib);
46 static void *SuperTraceGetHandle(
void *hLib);
47 static int SuperTraceMessageInput(
void *hLib);
48 static int SuperTraceSetAudioTap(
void *hLib,
int Channel,
int on);
49 static int SuperTraceSetBChannel(
void *hLib,
int Channel,
int on);
50 static int SuperTraceSetDChannel(
void *hLib,
int on);
51 static int SuperTraceSetInfo(
void *hLib,
int on);
52 static int SuperTraceClearCall(
void *hLib,
int Channel);
53 static int SuperTraceGetOutgoingCallStatistics(
void *hLib);
54 static int SuperTraceGetIncomingCallStatistics(
void *hLib);
55 static int SuperTraceGetModemStatistics(
void *hLib);
56 static int SuperTraceGetFaxStatistics(
void *hLib);
57 static int SuperTraceGetBLayer1Statistics(
void *hLib);
58 static int SuperTraceGetBLayer2Statistics(
void *hLib);
59 static int SuperTraceGetDLayer1Statistics(
void *hLib);
60 static int SuperTraceGetDLayer2Statistics(
void *hLib);
118 pmem +=
sizeof(*pLib);
119 memset(pLib, 0x00,
sizeof(*pLib));
137 SuperTraceGetOutgoingCallStatistics;
139 SuperTraceGetIncomingCallStatistics;
141 SuperTraceGetModemStatistics;
143 SuperTraceGetFaxStatistics;
145 SuperTraceGetBLayer1Statistics;
147 SuperTraceGetBLayer2Statistics;
149 SuperTraceGetDLayer1Statistics;
151 SuperTraceGetDLayer2Statistics;
173 STAT_PARSE_ENTRIES + \
174 LINE_PARSE_ENTRIES + 1) * pLib->
Channels;
177 for (i = 0; i < 30; i++) {
187 diva_create_parse_table(pLib);
192 static int DivaSTraceLibraryStart(
void *hLib) {
203 static int DivaSTraceLibraryStop(
void *hLib) {
213 ScheduleNextTraceRequest(pLib);
223 static int SuperTraceLibraryFinit(
void *hLib) {
234 static void *SuperTraceGetHandle(
void *hLib) {
245 static int SuperTraceMessageInput(
void *hLib) {
263 if (Rc != pLib->
rc_ok) {
316 if ((ret = ScheduleNextTraceRequest(pLib))) {
351 word this_ind_length;
353 while (total_length > 3 && *p) {
355 this_ind_length = (
word)p[0] | ((
word)p[1] << 8);
390 p += (this_ind_length + 1);
391 total_length -= (4 + this_ind_length);
429 if ((ret = ScheduleNextTraceRequest(pLib))) {
526 "Trace\\Event Enable",
538 dword tmp = 0x00000000;
541 "Trace\\AudioCh# Enable",
553 dword tmp = 0x00000000;
556 "Trace\\B-Ch# Enable",
571 "Trace\\Max Log Length",
596 "Trace\\Event Enable",
610 "Trace\\AudioCh# Enable",
625 "Trace\\EyeCh# Enable",
640 "Trace\\B-Ch# Enable",
684 for (i = 0; i < 30; i++) {
686 sprintf(name,
"State\\B%d", i + 1);
695 sprintf(name,
"State\\B%d\\Modem", i + 1);
704 sprintf(name,
"State\\B%d\\FAX", i + 1);
713 sprintf(name,
"State\\B%d\\Clear Call", i + 1);
725 "Statistics\\Outgoing Calls",
736 "Statistics\\Incoming Calls",
769 "Statistics\\B-Layer1",
780 "Statistics\\B-Layer2",
791 "Statistics\\D-Layer1",
802 "Statistics\\D-Layer2",
813 sprintf(name,
"%s",
"Statistics\\Incoming Calls\\Calls");
823 sprintf(name,
"%s",
"Statistics\\Incoming Calls\\Connected");
833 sprintf(name,
"%s",
"Statistics\\Outgoing Calls\\Calls");
843 sprintf(name,
"%s",
"Statistics\\Outgoing Calls\\Connected");
863 if (!diva_trace_read_variable(pVar, &ch_id)) {
865 for (i = 1; i <= pLib->
Channels; i++) {
866 diva_line_event(pLib, i);
869 }
else if (ch_id && ch_id <= pLib->Channels) {
870 return (diva_line_event(pLib, (
int)ch_id));
879 if (!diva_trace_read_variable(pVar, &ch_id)) {
881 for (i = 1; i <= pLib->
Channels; i++) {
882 diva_fax_event(pLib, i);
885 }
else if (ch_id && ch_id <= pLib->Channels) {
886 return (diva_fax_event(pLib, (
int)ch_id));
895 if (!diva_trace_read_variable(pVar, &ch_id)) {
897 for (i = 1; i <= pLib->
Channels; i++) {
898 diva_modem_event(pLib, i);
901 }
else if (ch_id && ch_id <= pLib->Channels) {
902 return (diva_modem_event(pLib, (
int)ch_id));
912 for (i = 1; i <= pLib->
Channels; i++) {
913 sprintf(name,
"State\\B%d\\Line", i);
914 if (find_var(pVar, name)) {
915 return (diva_line_event(pLib, i));
922 for (i = 1; i <= pLib->
Channels; i++) {
923 sprintf(name,
"State\\B%d\\Modem\\Event", i);
924 if (find_var(pVar, name)) {
925 return (diva_modem_event(pLib, i));
932 for (i = 1; i <= pLib->
Channels; i++) {
933 sprintf(name,
"State\\B%d\\FAX\\Event", i);
934 if (find_var(pVar, name)) {
935 return (diva_fax_event(pLib, i));
946 diva_trace_error(pLib, 1,
"Events Down", 0);
963 if (diva_strace_read_uint(pVar, &l2_state))
974 strcpy(tmp,
"Layer2 Disconnecting");
977 strcpy(tmp,
"Layer2 Connecting");
980 strcpy(tmp,
"SPID Initializing");
983 strcpy(tmp,
"SPID Initialised");
986 strcpy(tmp,
"Layer2 Connecting");
990 strcpy(tmp,
"Auto SPID Stopped");
994 strcpy(tmp,
"Auto SPID Idle");
998 strcpy(tmp,
"Auto SPID Requested");
1002 strcpy(tmp,
"Auto SPID Delivery");
1006 strcpy(tmp,
"Auto SPID Complete");
1010 sprintf(tmp,
"U:%d", (
int)l2_state);
1022 return (SuperTraceGetIncomingCallStatistics(pLib));
1027 return (SuperTraceGetOutgoingCallStatistics(pLib));
1055 const char *path = (
char *)&pVar->
path_length + 1;
1064 if (!
strncmp(name, path, len)) {
1065 return (diva_modem_info(pLib, i, pVar));
1072 for (i = pLib->
Channels; i > 0; i--) {
1074 if (!
strncmp(name, path, len)) {
1075 return (diva_fax_info(pLib, i, pVar));
1082 for (i = pLib->
Channels; i > 0; i--) {
1084 if (!
strncmp(name, path, len)) {
1085 return (diva_line_info(pLib, i, pVar));
1089 if (!diva_ifc_statistics(pLib, pVar)) {
1107 int i,
nr = Channel - 1;
1110 i <= pLib->modem_parse_entry_last[nr]; i++) {
1113 diva_trace_error(pLib, -3, __FILE__, __LINE__);
1117 diva_trace_error(pLib, -2, __FILE__, __LINE__);
1140 int i, nr = Channel - 1;
1143 i <= pLib->fax_parse_entry_last[nr]; i++) {
1146 diva_trace_error(pLib, -3, __FILE__, __LINE__);
1150 diva_trace_error(pLib, -2, __FILE__, __LINE__);
1178 int i, nr = Channel - 1;
1181 i <= pLib->line_parse_entry_last[nr]; i++) {
1184 diva_trace_error(pLib, -3, __FILE__, __LINE__);
1188 diva_trace_error(pLib, -2 , __FILE__, __LINE__);
1224 msg_length = *(msg + 1);
1225 msg = (start + msg_length);
1245 }
while ((pVar = get_next_var(pVar)));
1253 int nr = Channel + 1;
1256 diva_trace_error(pLib, -1, __FILE__, __LINE__);
1265 "State\\B%d\\Framing", nr);
1269 "State\\B%d\\Line", nr);
1273 "State\\B%d\\Layer2", nr);
1277 "State\\B%d\\Layer3", nr);
1281 "State\\B%d\\Remote Address", nr);
1286 "State\\B%d\\Remote SubAddr", nr);
1291 "State\\B%d\\Local Address", nr);
1296 "State\\B%d\\Local SubAddr", nr);
1301 "State\\B%d\\BC", nr);
1305 "State\\B%d\\HLC", nr);
1309 "State\\B%d\\LLC", nr);
1313 "State\\B%d\\Charges", nr);
1317 "State\\B%d\\Call Reference", nr);
1321 "State\\B%d\\Last Disc Cause", nr);
1326 "State\\B%d\\User ID", nr);
1335 int nr = Channel + 1;
1338 diva_trace_error(pLib, -1, __FILE__, __LINE__);
1346 "State\\B%d\\FAX\\Event", nr);
1350 "State\\B%d\\FAX\\Page Counter", nr);
1354 "State\\B%d\\FAX\\Features", nr);
1358 "State\\B%d\\FAX\\Station ID", nr);
1362 "State\\B%d\\FAX\\Subaddress", nr);
1366 "State\\B%d\\FAX\\Password", nr);
1370 "State\\B%d\\FAX\\Speed", nr);
1374 "State\\B%d\\FAX\\Resolution", nr);
1378 "State\\B%d\\FAX\\Paper Width", nr);
1382 "State\\B%d\\FAX\\Paper Length", nr);
1386 "State\\B%d\\FAX\\Scanline Time", nr);
1390 "State\\B%d\\FAX\\Disc Reason", nr);
1399 int nr = Channel + 1;
1402 diva_trace_error(pLib, -1, __FILE__, __LINE__);
1410 "State\\B%d\\Modem\\Event", nr);
1414 "State\\B%d\\Modem\\Norm", nr);
1418 "State\\B%d\\Modem\\Options", nr);
1422 "State\\B%d\\Modem\\TX Speed", nr);
1426 "State\\B%d\\Modem\\RX Speed", nr);
1430 "State\\B%d\\Modem\\Roundtrip ms", nr);
1434 "State\\B%d\\Modem\\Symbol Rate", nr);
1438 "State\\B%d\\Modem\\RX Level dBm", nr);
1442 "State\\B%d\\Modem\\Echo Level dBm", nr);
1446 "State\\B%d\\Modem\\SNR dB", nr);
1450 "State\\B%d\\Modem\\MAE", nr);
1454 "State\\B%d\\Modem\\Local Retrains", nr);
1458 "State\\B%d\\Modem\\Remote Retrains", nr);
1462 "State\\B%d\\Modem\\Local Resyncs", nr);
1466 "State\\B%d\\Modem\\Remote Resyncs", nr);
1470 "State\\B%d\\Modem\\Disc Reason", nr);
1479 for (i = 0; i < pLib->
Channels; i++) {
1480 diva_create_line_parse_table(pLib, i);
1481 diva_create_modem_parse_table(pLib, i);
1482 diva_create_fax_parse_table(pLib, i);
1491 "Statistics\\Outgoing Calls\\Calls");
1496 "Statistics\\Outgoing Calls\\Connected");
1501 "Statistics\\Outgoing Calls\\User Busy");
1506 "Statistics\\Outgoing Calls\\No Answer");
1511 "Statistics\\Outgoing Calls\\Wrong Number");
1516 "Statistics\\Outgoing Calls\\Call Rejected");
1521 "Statistics\\Outgoing Calls\\Other Failures");
1529 "Statistics\\Incoming Calls\\Calls");
1534 "Statistics\\Incoming Calls\\Connected");
1539 "Statistics\\Incoming Calls\\User Busy");
1544 "Statistics\\Incoming Calls\\Call Rejected");
1549 "Statistics\\Incoming Calls\\Wrong Number");
1554 "Statistics\\Incoming Calls\\Incompatible Dst");
1559 "Statistics\\Incoming Calls\\Out of Order");
1564 "Statistics\\Incoming Calls\\Ignored");
1574 "Statistics\\Modem\\Disc Normal");
1579 "Statistics\\Modem\\Disc Unspecified");
1584 "Statistics\\Modem\\Disc Busy Tone");
1589 "Statistics\\Modem\\Disc Congestion");
1594 "Statistics\\Modem\\Disc Carr. Wait");
1599 "Statistics\\Modem\\Disc Trn Timeout");
1604 "Statistics\\Modem\\Disc Incompat.");
1609 "Statistics\\Modem\\Disc Frame Rej.");
1614 "Statistics\\Modem\\Disc V42bis");
1626 "Statistics\\FAX\\Disc Normal");
1631 "Statistics\\FAX\\Disc Not Ident.");
1636 "Statistics\\FAX\\Disc No Response");
1641 "Statistics\\FAX\\Disc Retries");
1646 "Statistics\\FAX\\Disc Unexp. Msg.");
1651 "Statistics\\FAX\\Disc No Polling.");
1656 "Statistics\\FAX\\Disc Training");
1661 "Statistics\\FAX\\Disc Unexpected");
1666 "Statistics\\FAX\\Disc Application");
1671 "Statistics\\FAX\\Disc Incompat.");
1676 "Statistics\\FAX\\Disc No Command");
1681 "Statistics\\FAX\\Disc Long Msg");
1686 "Statistics\\FAX\\Disc Supervisor");
1691 "Statistics\\FAX\\Disc SUB SEP PWD");
1696 "Statistics\\FAX\\Disc Invalid Msg");
1701 "Statistics\\FAX\\Disc Page Coding");
1706 "Statistics\\FAX\\Disc App Timeout");
1711 "Statistics\\FAX\\Disc Unspecified");
1721 "Statistics\\B-Layer1\\X-Frames");
1726 "Statistics\\B-Layer1\\X-Bytes");
1731 "Statistics\\B-Layer1\\X-Errors");
1736 "Statistics\\B-Layer1\\R-Frames");
1741 "Statistics\\B-Layer1\\R-Bytes");
1746 "Statistics\\B-Layer1\\R-Errors");
1754 "Statistics\\B-Layer2\\X-Frames");
1759 "Statistics\\B-Layer2\\X-Bytes");
1764 "Statistics\\B-Layer2\\X-Errors");
1769 "Statistics\\B-Layer2\\R-Frames");
1774 "Statistics\\B-Layer2\\R-Bytes");
1779 "Statistics\\B-Layer2\\R-Errors");
1787 "Statistics\\D-Layer1\\X-Frames");
1792 "Statistics\\D-Layer1\\X-Bytes");
1797 "Statistics\\D-Layer1\\X-Errors");
1802 "Statistics\\D-Layer1\\R-Frames");
1807 "Statistics\\D-Layer1\\R-Bytes");
1812 "Statistics\\D-Layer1\\R-Errors");
1820 "Statistics\\D-Layer2\\X-Frames");
1825 "Statistics\\D-Layer2\\X-Bytes");
1830 "Statistics\\D-Layer2\\X-Errors");
1835 "Statistics\\D-Layer2\\R-Frames");
1840 "Statistics\\D-Layer2\\R-Bytes");
1845 "Statistics\\D-Layer2\\R-Errors");
1857 pLib->user_proc_table.user_context,
1868 int notify_subject) {
1883 switch (pVar->
type) {
1885 return (diva_strace_read_asz(pVar, (
char *)variable));
1887 return (diva_strace_read_asc(pVar, (
char *)variable));
1891 return (diva_strace_read_int(pVar, (
int *)variable));
1893 return (diva_strace_read_uint(pVar, (
dword *)variable));
1895 return (diva_strace_read_uint(pVar, (
dword *)variable));
1897 return (diva_strace_read_uint(pVar, (
dword *)variable));
1919 value = *(
char *)ptr;
1956 value &= 0x00ffffff;
1997 memcpy(var, ptr + 1, *ptr);
2019 static int SuperTraceSetAudioTap(
void *hLib,
int Channel,
int on) {
2022 if ((Channel < 1) || (Channel > pLib->
Channels)) {
2043 return (ScheduleNextTraceRequest(pLib));
2046 static int SuperTraceSetBChannel(
void *hLib,
int Channel,
int on) {
2049 if ((Channel < 1) || (Channel > pLib->
Channels)) {
2060 return (ScheduleNextTraceRequest(pLib));
2063 static int SuperTraceSetDChannel(
void *hLib,
int on) {
2072 return (ScheduleNextTraceRequest(pLib));
2075 static int SuperTraceSetInfo(
void *hLib,
int on) {
2084 return (ScheduleNextTraceRequest(pLib));
2087 static int SuperTraceClearCall(
void *hLib,
int Channel) {
2090 if ((Channel < 1) || (Channel > pLib->
Channels)) {
2097 return (ScheduleNextTraceRequest(pLib));
2106 int i, one_updated = 0, mdm_updated = 0, fax_updated = 0;
2111 diva_trace_error(pLib, -3 , __FILE__, __LINE__);
2131 }
else if (fax_updated) {
2133 }
else if (one_updated) {
2137 return (one_updated ? 0 : -1);
2140 static int SuperTraceGetOutgoingCallStatistics(
void *hLib) {
2143 return (ScheduleNextTraceRequest(pLib));
2146 static int SuperTraceGetIncomingCallStatistics(
void *hLib) {
2149 return (ScheduleNextTraceRequest(pLib));
2152 static int SuperTraceGetModemStatistics(
void *hLib) {
2155 return (ScheduleNextTraceRequest(pLib));
2158 static int SuperTraceGetFaxStatistics(
void *hLib) {
2161 return (ScheduleNextTraceRequest(pLib));
2164 static int SuperTraceGetBLayer1Statistics(
void *hLib) {
2167 return (ScheduleNextTraceRequest(pLib));
2170 static int SuperTraceGetBLayer2Statistics(
void *hLib) {
2173 return (ScheduleNextTraceRequest(pLib));
2176 static int SuperTraceGetDLayer1Statistics(
void *hLib) {
2179 return (ScheduleNextTraceRequest(pLib));
2182 static int SuperTraceGetDLayer2Statistics(
void *hLib) {
2185 return (ScheduleNextTraceRequest(pLib));
2190 STAT_PARSE_ENTRIES + \
2191 LINE_PARSE_ENTRIES + 1) * channels;