📄 maintidi.c
字号:
strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\FAX\\Disc SUB SEP PWD"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.fax.Disc_SUB_SEP_PWD; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\FAX\\Disc Invalid Msg"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.fax.Disc_Invalid_Msg; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\FAX\\Disc Page Coding"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.fax.Disc_Page_Coding; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\FAX\\Disc App Timeout"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.fax.Disc_App_Timeout; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\FAX\\Disc Unspecified"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.fax.Disc_Unspecified; pLib->fax_statistic_parse_last = pLib->cur_parse_entry - 1; /* B-Layer1" */ strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer1\\X-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b1.X_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer1\\X-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b1.X_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer1\\X-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b1.X_Errors; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer1\\R-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b1.R_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer1\\R-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b1.R_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer1\\R-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b1.R_Errors; /* B-Layer2 */ strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer2\\X-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b2.X_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer2\\X-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b2.X_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer2\\X-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b2.X_Errors; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer2\\R-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b2.R_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer2\\R-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b2.R_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\B-Layer2\\R-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.b2.R_Errors; /* D-Layer1 */ strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer1\\X-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d1.X_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer1\\X-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d1.X_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer1\\X-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d1.X_Errors; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer1\\R-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d1.R_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer1\\R-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d1.R_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer1\\R-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d1.R_Errors; /* D-Layer2 */ strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer2\\X-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d2.X_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer2\\X-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d2.X_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer2\\X-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d2.X_Errors; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer2\\R-Frames"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d2.R_Frames; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer2\\R-Bytes"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d2.R_Bytes; strcpy (pLib->parse_table[pLib->cur_parse_entry].path, "Statistics\\D-Layer2\\R-Errors"); pLib->parse_table[pLib->cur_parse_entry++].variable = \ &pLib->InterfaceStat.d2.R_Errors; pLib->statistic_parse_last = pLib->cur_parse_entry - 1;}static void diva_trace_error (diva_strace_context_t* pLib, int error, const char* file, int line) { if (pLib->user_proc_table.error_notify_proc) { (*(pLib->user_proc_table.error_notify_proc))(\ pLib->user_proc_table.user_context, &pLib->instance, pLib->Adapter, error, file, line); }}/* Delivery notification to user */static void diva_trace_notify_user (diva_strace_context_t* pLib, int Channel, int notify_subject) { if (pLib->user_proc_table.notify_proc) { (*(pLib->user_proc_table.notify_proc))(pLib->user_proc_table.user_context, &pLib->instance, pLib->Adapter, &pLib->lines[Channel], notify_subject); }}/* Read variable value to they destination based on the variable type */static int diva_trace_read_variable (diva_man_var_header_t* pVar, void* variable) { switch (pVar->type) { case 0x03: /* MI_ASCIIZ - syting */ return (diva_strace_read_asz (pVar, (char*)variable)); case 0x04: /* MI_ASCII - string */ return (diva_strace_read_asc (pVar, (char*)variable)); case 0x05: /* MI_NUMBER - counted sequence of bytes */ return (diva_strace_read_ie (pVar, (diva_trace_ie_t*)variable)); case 0x81: /* MI_INT - signed integer */ return (diva_strace_read_int (pVar, (int*)variable)); case 0x82: /* MI_UINT - unsigned integer */ return (diva_strace_read_uint (pVar, (dword*)variable)); case 0x83: /* MI_HINT - unsigned integer, hex representetion */ return (diva_strace_read_uint (pVar, (dword*)variable)); case 0x87: /* MI_BITFLD - unsigned integer, bit representation */ return (diva_strace_read_uint (pVar, (dword*)variable)); } /* This type of variable is not handled, indicate error Or one problem in management interface, or in application recodeing table, or this application should handle it. */ return (-1);}/* Read signed integer to destination */static int diva_strace_read_int (diva_man_var_header_t* pVar, int* var) { byte* ptr = (char*)&pVar->path_length; int value; ptr += (pVar->path_length + 1); switch (pVar->value_length) { case 1: value = *(char*)ptr; break; case 2: value = (short)GET_WORD(ptr); break; case 4: value = (int)GET_DWORD(ptr); break; default: return (-1); } *var = value; return (0);}static int diva_strace_read_uint (diva_man_var_header_t* pVar, dword* var) { byte* ptr = (char*)&pVar->path_length; dword value; ptr += (pVar->path_length + 1); switch (pVar->value_length) { case 1: value = (byte)(*ptr); break; case 2: value = (word)GET_WORD(ptr); break; case 3: value = (dword)GET_DWORD(ptr); value &= 0x00ffffff; break; case 4: value = (dword)GET_DWORD(ptr); break; default: return (-1); } *var = value; return (0);}/* Read zero terminated ASCII string */static int diva_strace_read_asz (diva_man_var_header_t* pVar, char* var) { char* ptr = (char*)&pVar->path_length; int length; ptr += (pVar->path_length + 1); if (!(length = pVar->value_length)) { length = strlen (ptr); } memcpy (var, ptr, length); var[length] = 0; return (0);}/* Read counted (with leading length byte) ASCII string */static int diva_strace_read_asc (diva_man_var_header_t* pVar, char* var) { char* ptr = (char*)&pVar->path_length; ptr += (pVar->path_length + 1); memcpy (var, ptr+1, *ptr); var[(int)*ptr] = 0; return (0);}/* Read one information element - i.e. one string of byte values with one length byte in front */static int diva_strace_read_ie (diva_man_var_header_t* pVar, diva_trace_ie_t* var) { char* ptr = (char*)&pVar->path_length; ptr += (pVar->path_length + 1); var->length = *ptr; memcpy (&var->data[0], ptr+1, *ptr); return (0);}static int SuperTraceSetAudioTap (void* hLib, int Channel, int on) { diva_strace_context_t* pLib = (diva_strace_context_t*)hLib; if ((Channel < 1) || (Channel > pLib->Channels)) { return (-1); } Channel--; if (on) { pLib->audio_tap_mask |= (1L << Channel); } else { pLib->audio_tap_mask &= ~(1L << Channel); } /* EYE patterns have TM_M_DATA set as additional condition */ if (pLib->audio_tap_mask) { pLib->trace_event_mask |= TM_M_DATA; } else { pLib->trace_event_mask &= ~TM_M_DATA; } return (ScheduleNextTraceRequest (pLib));}static int SuperTraceSetBChannel (void* hLib, int Channel, int on) { diva_strace_context_t* pLib = (diva_strace_context_t*)hLib; if ((Channel < 1) || (Channel > pLib->Channels)) { return (-1); } Channel--; if (on) { pLib->bchannel_trace_mask |= (1L << Channel); } else { pLib->bchannel_trace_mask &= ~(1L << Channel); } return (ScheduleNextTraceRequest (pLib));}static int SuperTraceSetDChannel (void* hLib, int on) { diva_strace_context_t* pLib = (diva_strace_context_t*)hLib; if (on) { pLib->trace_event_mask |= (TM_D_CHAN | TM_C_COMM | TM_DL_ERR | TM_LAYER1); } else { pLib->trace_event_mask &= ~(TM_D_CHAN | TM_C_COMM | TM_DL_ERR | TM_LAYER1); } return (ScheduleNextTraceRequest (pLib));}static int SuperTraceSetInfo (void* hLib, int on) { diva_strace_context_t* pLib = (diva_strace_context_t*)hLib; if (on) { pLib->trace_event_mask |= TM_STRING; } else { pLib->trace_event_mask &= ~TM_STRING; } return (ScheduleNextTraceRequest (pLib));}static int SuperTraceClearCall (void* hLib, int Channel) { diva_strace_context_t* pLib = (diva_strace_context_t*)hLib; if ((Channel < 1) || (Channel > pLib->Channels)) { return (-1); } Channel--; pLib->clear_call_command |= (1L << Channel); return (ScheduleNextTraceRequest (pLib));}/* Parse and update cumulative statistice */static int diva_ifc_statistics (diva_strace_context_t* pLib, diva_man_var_header_t* pVar) { diva_man_var_header_t* cur; int i, one_updated = 0, mdm_updated = 0, fax_updated = 0; for (i = pLib->statistic_parse_first; i <= pLib->statistic_parse_last; i++) { if ((
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -