/* Present a redir record file with readable time-stamp */ #include #include #include #include #include int main (int argc, char *argv[]) { glocal int ret = -1; glocal bool hexdump = false; glocal bool nodata = false; glocal.ret = (argc,argv); setproginfo ("redirdump",PACKAGE_REV ,"Produce a readable output from a redir record file\n"); setarg ('h',"hexdump","Show the records using hexadecimal",glocal.hexdump,false); setarg ('n',"nodata","Only display the timestamp, no data",glocal.nodata,false); int ret = 0; for (int i=0; itm_year+1900,t->tm_mon+1,t->tm_mday ,t->tm_hour,t->tm_min,t->tm_sec ,tv_usec,len ,(long)(diff/1000000),(long)(diff%1000000)); last = cur; char buf[len]; if (fread(buf,1,len,fin)!=len){ tlmp_error ("Short read, expected %d bytes\n",len); break; }else if (!glocal.nodata){ if (glocal.hexdump){ for (int i=0; i 127) ? '.' : ch); } printf ("\n"); } }else{ printf ("\t"); for (int i=0; i return glocal.ret; }