void CNSKListener::FSTraceOutput(_cc_status cc) { request_def *request = (request_def*)m_RequestBuf; CFSystemSrvr* node; struct timeb CurrentTime; ftime(&CurrentTime); FILE* fp = NULL; if (_status_gt(cc)) { if (request->request_code == ZSYS_VAL_SMSG_TIMESIGNAL) { // signaltimeout message (-22) } else { // it is a system message if( request->request_code == ZSYS_VAL_SMSG_OPEN ) { if ((fp = OpenTraceFileA()) != NULL) fprintf(fp,"<------FS OUTPUT OPEN MESSAGE------>\n%s cc=%d\n",frmt_current_time(CurrentTime),cc); } else if( request->request_code == ZSYS_VAL_SMSG_CLOSE ) { if ((fp = OpenTraceFileA()) != NULL) fprintf(fp,"<------FS OUTPUT CLOSE MESSAGE------>\n%s cc=%d\n",frmt_current_time(CurrentTime),cc); } } } else { receive_info_def receive_info; FILE_GETRECEIVEINFO_ ((TPT_RECEIVE)&receive_info ); if ((fp = OpenTraceFileA()) != NULL) { if (GTransport.m_FSystemSrvr_list != NULL) { node = GTransport.m_FSystemSrvr_list->find_node(&receive_info); if (node != NULL) { if (node->m_whdr.operation_id == 0) fprintf(fp,"<------FS OUTPUT USER MESSAGE (REPLYX only)------>\n%s\n",frmt_current_time(CurrentTime)); else { fprintf(fp,"<------FS OUTPUT USER MESSAGE------>\n%s\n",frmt_current_time(CurrentTime)); frmt_header(sizeof(HEADER), (char*)&node->m_whdr, fp); } } } } } finish_trace(fp); }
void CNSKListener::TCPIPTraceOutputR0() { struct timeb CurrentTime; ftime(&CurrentTime); FILE* fp = NULL; if ((fp = OpenTraceFileA()) != NULL) fprintf(fp,"<------TCPIP OUTPUT R0------>\n%s\n",frmt_current_time(CurrentTime)); finish_trace(fp); }
void CNSKListener::TCPIPTraceOutputCC(_cc_status cc) { struct timeb CurrentTime; ftime(&CurrentTime); FILE* fp = NULL; if ((fp = OpenTraceFileA()) != NULL) fprintf(fp,"<------TCPIP OUTPUT CC------>\n%s cc=%s(%d)\n",frmt_current_time(CurrentTime),DecodeNSKSocketErrors(cc),cc); finish_trace(fp); }
void CNSKListener::TraceUnknownInput() { struct timeb CurrentTime; ftime(&CurrentTime); FILE* fp = NULL; if ((fp = OpenTraceFileA()) != NULL) fprintf(fp,"<------TRACE UNKNOWN INPUT------>\n%s\n",frmt_current_time(CurrentTime)); finish_trace(fp); }
void CNSKListener::ListenOnSocket(short socket) { struct timeb CurrentTime; ftime(&CurrentTime); FILE* fp; if ((fp=OpenTraceFileA()) != NULL) fprintf(fp,"<------LISTEN ON SOCKET------>\n%s socket=%d\n",frmt_current_time(CurrentTime),socket); finish_trace(fp); }
void CNSKListener::TCPIPTraceOutput(HEADER* phdr) { struct timeb CurrentTime; ftime(&CurrentTime); FILE* fp = NULL; if ((fp = OpenTraceFileA()) != NULL) { fprintf(fp,"<------TCPIP OUTPUT------>\n%s\n",frmt_current_time(CurrentTime)); frmt_header(sizeof(HEADER), (char*)phdr, fp); } finish_trace(fp); }
/* * eval - eval all macros and builtins calls * argc - number of elements in argv. * argv - element vector : * argv[0] = definition of a user * macro or NULL if built-in. * argv[1] = name of the macro or * built-in. * argv[2] = parameters to user-defined * . macro or built-in. * . * * A call in the form of macro-or-builtin() will result in: * argv[0] = nullstr * argv[1] = macro-or-builtin * argv[2] = nullstr * * argc is 3 for macro-or-builtin() and 2 for macro-or-builtin */ void eval(const char *argv[], int argc, int td, int is_traced) { size_t mark = SIZE_MAX; expansion_id++; if (td & RECDEF) m4errx(1, "expanding recursive definition for %s.", argv[1]); if (is_traced) mark = trace(argv, argc, infile+ilevel); if (td == MACRTYPE) expand_macro(argv, argc); else expand_builtin(argv, argc, td); if (mark != SIZE_MAX) finish_trace(mark); }
/* * eval - eval all macros and builtins calls * argc - number of elements in argv. * argv - element vector : * argv[0] = definition of a user * macro or nil if built-in. * argv[1] = name of the macro or * built-in. * argv[2] = parameters to user-defined * . macro or built-in. * . * * A call in the form of macro-or-builtin() will result in: * argv[0] = nullstr * argv[1] = macro-or-builtin * argv[2] = nullstr * * argc is 3 for macro-or-builtin() and 2 for macro-or-builtin */ void eval(const char *argv[], int argc, int td) { ssize_t mark = -1; expansion_id++; if (td & RECDEF) errx(1, "%s at line %lu: expanding recursive definition for %s", CURRENT_NAME, CURRENT_LINE, argv[1]); if (traced_macros && is_traced(argv[1])) mark = trace(argv, argc, infile+ilevel); if (td == MACRTYPE) expand_macro(argv, argc); else expand_builtin(argv, argc, td); if (mark != -1) finish_trace(mark); }
void CNSKListener::TraceInput(short fnum,int countRead,long tag,_cc_status cc) { struct timeb CurrentTime; ftime(&CurrentTime); CTCPIPSystemSrvr* pnode; FILE* fp = NULL; if (fnum == m_ReceiveFnum) { request_def *request = (request_def*)m_RequestBuf; if (_status_gt(cc)) { if (request->request_code == ZSYS_VAL_SMSG_TIMESIGNAL) { // signaltimeout message (-22) } else { // it is a system message if( request->request_code == ZSYS_VAL_SMSG_OPEN ) { receive_info_def receive_info; FILE_GETRECEIVEINFO_ ((TPT_RECEIVE)&receive_info ); if ((fp = OnCountReOpenFile()) != NULL) { fprintf(fp,"<------FS INPUT OPEN MESSAGE------>\n%s fnum=%d, countRead=%d, tag=%ld, cc=%d\n",frmt_current_time(CurrentTime),fnum, countRead, tag, cc); frmt_SMSG(&receive_info,fp); } } else if( request->request_code == ZSYS_VAL_SMSG_CLOSE ) { receive_info_def receive_info; FILE_GETRECEIVEINFO_ ((TPT_RECEIVE)&receive_info ); if ((fp = OnCountReOpenFile()) != NULL) { fprintf(fp,"<------FS INPUT CLOSE MESSAGE------>\n%s fnum=%d, countRead=%d, tag=%ld, cc=%d\n",frmt_current_time(CurrentTime),fnum, countRead, tag, cc); frmt_SMSG(&receive_info,fp); } } } } else { // it is a user message if ((fp = OnCountReOpenFile()) != NULL) { fprintf(fp,"<------FS INPUT USER MESSAGE------>\n%s fnum=%d, countRead=%d, tag=%ld, cc=%d\n",frmt_current_time(CurrentTime),fnum, countRead, tag, cc); if (countRead >= sizeof(HEADER)) frmt_header((short)countRead, m_RequestBuf, fp); } } } #ifdef TRACE_TCPIP else if (GTransport.m_TCPIPSystemSrvr_list != NULL) { if (fnum == m_nListenSocketFnum) { if ((fp = OnCountReOpenFile()) != NULL) fprintf(fp,"<------TCPIP NEW SESSION------>\n%s fnum=%d, countRead=%d, tag=%ld, cc=%d\n",frmt_current_time(CurrentTime),fnum, countRead, tag, cc); } else if ((pnode=GTransport.m_TCPIPSystemSrvr_list->find_node(fnum)) != NULL) { if ((fp = OnCountReOpenFile()) != NULL) { fprintf(fp,"<------TCPIP INPUT------>\n%s fnum=%d, countRead=%d, tag=%ld, cc=%d\n",frmt_current_time(CurrentTime),fnum, countRead, tag, cc); if (countRead >= sizeof(HEADER)) frmt_header(countRead, pnode->m_IObuffer, fp); } } else { if ((fp = OnCountReOpenFile()) != NULL) fprintf(fp,"<------TCPIP UNKNOWN INPUT------>\n%s fnum=%d, countRead=%d, tag=%ld, cc=%d\n",frmt_current_time(CurrentTime),fnum, countRead, tag, cc); } } else { if ((fp = OnCountReOpenFile()) != NULL) fprintf(fp,"<------TCPIP UNKNOWN INPUT------>\n%s fnum=%d, countRead=%d, tag=%ld, cc=%d\n",frmt_current_time(CurrentTime),fnum, countRead, tag, cc); } #endif finish_trace(fp); }