/* C K U U S 2 -- "User Interface" STRINGS module for NCR-VRX Kermit */ /********************************************************************** * * * IVS / MCS-Kermit REL 2 * * source code * * * * Change History: * * * * 1. Modify C-Kermit(4E) source code to * * produce new module for MCS/IVS-Kermit * * ORIGINAL RELEASE * * June 22, 1990 * * * * * ***********************************************************************/ /* Author: Frank da Cruz (SY.FDC@CU20B), Columbia University Center for Computing Activities, January 1985. Copyright (C) 1985, Trustees of Columbia University in the City of New York. Permission is granted to any individual or institution to use, copy, or redistribute this software so long as it is not sold for profit, provided this copyright notice is retained. */ /* This module separates long strings from the body of the ckuser module. */ #include "ckcdeb.h" #include #include #include "ckcker.h" #include "ckucmd.h" #include "ckuusr.h" #ifdef MCS_FLAG #include "mcs.h" #endif extern CHAR mystch, stchr, eol, seol, padch, mypadc, ctlq; extern CHAR data[], *rdatap, ttname[]; extern char cmdbuf[], line[], debfil[], pktfil[], sesfil[], trafil[]; extern int nrmt, nprm, dfloc, deblog, seslog, speed, local, parity, duplex; extern int send_id, recv_id, send_num, recv_num, send_renum, recv_renum; extern int send_addnum, recv_addnum, rptflg; extern int turn, turnch, pktlog, tralog, mdmtyp, flow, cmask, timef, spsizf; extern int rtimo, timint, npad, mypadn, bctr, delay; extern int maxtry, spsiz, urpsiz, maxsps, maxrps, ebqflg, ebq; extern int rptflg, rptq, fncnv, binary, pktlog, /* warn,*/ quiet, fmask, keep; extern int tsecs, bctu, len, atcapu, lpcapu, swcapu, wsize, sq, rpsiz; extern int capas; extern long filcnt, tfc, tlci, tlco, ffc, flci, flco; extern char *dftty, *versio, *ckxsys; extern struct keytab prmtab[]; extern struct keytab remcmd[]; static char *hlp1[] = { /* unless the kermit CNTLSTR is set up properly this message will never be output */ "\n", " Usage: kermit [-x arg [-x arg]...[-yyy]..]]\n", " x requires an argument, y requires option with no argument:\n", " actions (* options also require -l and -b) --\n", " -s file(s) send\n", " -r receive\n", " -k receive to stdout\n", " -a name alternate name, used with -s, -r, -g\n", " -x enter server mode\n", " * -c connect before transaction\n", " * -n connect after transaction\n", " settings --\n", " -l line communication line device\n", " -b baud line speed, e.g. 1200\n", " -i binary file or NCR-VRX-to-PC (text by default)\n", " -p x parity, x is one of e,o,m,s,n\n", " -t line turnaround handshake = xon, half duplex\n", " -q be quiet during file transfer\n", " -d log debugging info to debuglog\n", " -e length (extended) receive packet length\n", " If no action command is included, enter interactive dialog.\n", "" }; /* U S A G E */ usage() { conola(hlp1); } /* Help string definitions */ static char *tophlp[] = { "\n", "Type ? for a list of commands, type 'help x' for any command x.\n", "While typing commands, use the following special characters:\n\n", " DEL, RUBOUT, BACKSPACE, CTRL-H: Delete the most recent character typed.\n", " ? (question mark) display help on the current command or field.\n", " \\ (backslash) include the following character literally.\n\n", "\n", "" }; static char *hmxxbye = "V-Kermit does not support this functionality"; static char *hmxxclo = "Close logs: 'help log' for further info."; static char *hmxxcon = "V-Kermit does not support this functionality"; static char *hmxxget = "V-Kermit does not support this functionality"; static char *hmxxlg[] = { "Record information in a log file:\n\n", " debugging Debugging information, to help track down\n", " (default debuglog) bugs in the V-Kermit program.\n\n", " packets Kermit packets, to help track down protocol problems.\n", " (packetlog)\n\n", " transactions Names and statistics about files transferred.\n", " (transactlog)\n", "" }; static char *hmxxlogi[] = { "V-Kermit does not support this functionality\n", "" }; static char *hmxxrc[] = { "V-Kermit does not support this functionality", "" }; static char *hmxxsen = "V-Kermit does not support this functionality"; static char *hmxxser = "Enter server mode. Commands are in packet form from other Kermit program."; static char *hmhset[] = { "The 'set' command is used to establish various communication or file\n", "parameters. The 'show' command can be used to display the values of\n", "'set' parameters. Help is available for each individual parameter;\n", "type 'help set ?' to see what's available.\n", "" }; static char *hmxychkt[] = { "Type of packet block check to be used for error detection, 1, 2, or 3.\n", "Type 1 is standard, and catches most errors. Types 2 and 3 specify more\n", "rigorous checking at the cost of higher overhead. Not all Kermit programs\n", "support types 2 and 3.\n", "" }; static char *hmxyf[] = { "set file: names, type, display.\n\n", "'names' are normally 'converted', which means file names are converted\n", "to 'common form' during transmission; 'literal' means use filenames\n", "literally (useful between like systems).\n\n", "'type' is normally 'text', in which conversion is done between NCR-VRX\n", "newlines and CRLF line delimiters; 'binary' means to do no conversion.\n", "Use 'binary' for executable programs or binary data.\n\n", "\n'display' is normally 'on', causing file transfer ", "progress to be displayed\n", "on your screen when in local mode. 'set display off' is useful for\n", "allowing file transfers to proceed in the background.\n\n", "" }; static char *hmhrmt[] = { "V-Kermit does not support this functionality", "" }; /* D O H L P -- Give a help message */ dohlp(xx) int xx; { int x, y; if (xx < 0) return(xx); switch (xx) { case XXBYE: return(hmsg(hmxxbye)); case XXCLO: return(hmsg(hmxxclo)); /* case XXCON: return(hmsg(hmxxcon)); */ /* case XXCWD: return(hmsg( "Change Working Directory, equivalent to VRX filen command")); */ /* case XXDEL: return(hmsg("Delete a local file or files")); */ /* case XXDIAL: return(hmsg("Dial a number using modem autodialer")); */ /* case XXDIR: return(hmsg("Display a directory of local files")); */ case XXECH: return(hmsg("Display the rest of the command on the terminal.")); case XXEXI: case XXQUI: return(hmsg("Exit from the Kermit program, closing any open logs.")); /* case XXFIN: return(hmsg( "Tell the remote Kermit server to shut down without logging out.")); */ /* case XXGET: return(hmsg(hmxxget)); */ /* case XXHAN: return(hmsg("Hang up the phone.")); */ case XXHLP: return(hmsga(tophlp)); case XXLOG: return(hmsga(hmxxlg)); /* case XXLOGI: return(hmsga(hmxxlogi)); */ /* case XXREC: return(hmsga(hmxxrc)); */ /* case XXREM: if ((y = cmkey(remcmd,nrmt,"Remote command","")) == -2) return(y); if (y == -1) return(y); if (x = (cmcfm()) < 0) return(x); return(dohrmt(y)); */ /* case XXSEN: return(hmsg(hmxxsen)); */ case XXSER: return(hmsg(hmxxser)); case XXSET: if ((y = cmkey(prmtab, nprm, "Parameter", "")) == -2) return(y); if (y == -2) return(y); if (x = (cmcfm()) < 0) return(x); return(dohset(y)); /* case XXSHE: return(hmsg( "Issue a command to the VRX shell (space req.after '!')")); */ case XXSHO: return(hmsg("Display current values of 'set' parameters.")); /* case XXSPA: return(hmsg("Display disk usage in current device, directory")); */ case XXSTA: return(hmsg("Display statistics about most recent file transfer")); case XXTAK: return(hmsg("Take Kermit commands from the named file.")); default: if (x = (cmcfm()) < 0) return(x); #ifndef MCS_FLAG printf("V-Kermit does not support: %s\n", cmdbuf); #else sprintf(print_str,"V-Kermit does not support: %s\n", cmdbuf); mcs_printf(print_str); #endif break; } return(0); } /* H M S G -- Get confirmation, then print the given message */ hmsg(s) char *s; { int x; if ((x = cmcfm()) < 0) return(x); puts(s); return(0); } hmsga(s) char *s[]; { /* Same function, but for arrays */ int x, i; if ( x = (cmcfm()) < 0) return(x); for ( i = 0; *s[i] ; i++) fputs(s[i], stdout); fputc( '\n', stdout); return(0); } /* D O H S E T -- Give help for SET command */ dohset(xx) int xx; { if (xx == -3) return(hmsga(hmhset)); if (xx < 0) return(xx); switch (xx) { case XYCHKT: return(hmsga(hmxychkt)); /* case XYDELA: puts( "\# of secs to wait before SND first packet after 'send' command."); return(0); */ case XYDUPL: puts("During 'connect': 'full' means remote echoes, "); puts("'half' means this program does its own echoing."); return(0); /* case XYESC: printf( "Dec ASCII for ESC char during 'connect',\n(Control-\\)\n"); return(0); */ case XYFILE: return(hmsga(hmxyf)); case XYFLOW: puts("Type of flow control used. Choices 'xon/xoff' and 'none'."); puts("normally xon/xoff."); return(0); case XYHAND: puts("Dec ASCII for char to use for half duplex line turnaround"); puts("handshake. Normally, handshaking is not done."); return(0); /* case XYLINE: printf("Device name of communication line to use. Normally %s.\n", dftty); if (!dfloc) { printf("If you set the line to other than %s, then Kermit\n",dftty); printf("will be in 'local' mode; 'set line' will reset Kermit "); printf("to remote mode.\n"); } return(0); */ /* case XYMODM: puts("Type of modem for dialing remote connections. "); puts(" Needed to indicate modem can"); puts(" be commanded to dial without 'CD' from modem. "); puts(" Many recently") ; puts("manufactured modems use 'hayes' protocol. "); puts("Type 'set modem ?' to see what"); puts("types of modems are supported by this program."); return(0); */ case XYPARI: puts("Parity to use during terminal connection and file transfer:"); puts("even, odd, mark, space, or none. Normally none."); return(0); case XYPROM: #ifndef MCS_FLAG puts("Prompt string for this program, normally 'IVS-Kermit>'."); #else puts("Prompt string for this program, normally 'MCS-Kermit>'."); #endif return(0); case XYRETR: puts("How many times to retransmit a packet before giving up"); return(0); case XYSPEE: puts("Communication line speed for external tty line "); puts("specified in most recent"); puts("'set line' command. Any of the common baud rates:"); puts(" 0, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200."); return(0); case XYRECV: /* puts("Specify parameters for inbound packets:"); puts("End-Of-Packet (ASCII value), Id-Fields ('keep' or 'discard'),"); puts("Line-Numbers ('keep' or 'discard'), Renumber ('on' or 'off'),"); puts("Packet-Length (1000 or less), Padding (amount, 94 or less),"); puts("Pad-Character (ASCII value), Start-Of-Packet (ASCII value),"); puts("and Timeout (94 seconds or less), all specified as decimal numbers"); puts("except for Id-Fields, Line-Numbers and Renumber."); return(0); */ puts("Specify parameters for inbound packets:"); puts(" End-of-Packet (ASCII value), Packet-Length (1000 or less),"); puts(" Padding (amount, 94 or less), Pad-Character (ASCII value),"); puts(" Start-of-Packet (ASCII value), and Timeout (94 seconds or less),"); puts(" all specified as decimal numbers."); return(0); case XYSEND: /* puts("Specify parameters for outbound packets:"); puts("End-Of-Packet (ASCII value), Id-Fields ('keep' or 'discard'),"); puts("Line-Numbers ('keep' or 'discard'), Renumber ('on' or 'off'),"); puts("Packet-Length (1000 or less), Padding (amount, 94 or less),"); puts("Pad-Character (ASCII value), Start-Of-Packet (ASCII value),"); puts("and Timeout (94 seconds or less), all specified as decimal numbers"); puts("except for Id-Fields, Line-Numbers and Renumber."); return(0); */ puts("Specify parameters for outbound packets:"); puts(" End-of-Packet (ASCII value), Packet-Length (1000 or less),"); puts(" Padding (amount, 94 or less), Pad-Character (ASCII value),"); puts(" Start-of-Packet (ASCII value), and Timeout (94 seconds or less),"); puts(" all specified as decimal numbers."); return(0); default: #ifndef MCS_FLAG printf("V-Kermit does not support: %s\n", cmdbuf); #else sprintf(print_str,"V-Kermit does not support: %s\n", cmdbuf); mcs_printf(print_str); #endif return(0); } } /* D O H R M T -- Give help about REMOTE command */ dohrmt(xx) int xx; { int x; if (xx == -3) return(hmsga(hmhrmt)); if (xx < 0) return(xx); if (x = (cmcfm()) < 0) return(x); #ifndef MCS_FLAG printf("V-Kermit does not support this functionality- %s\n", cmdbuf); #else sprintf(print_str,"V-Kermit does not support this functionality- %s\n", cmdbuf); mcs_printf(print_str); #endif return(-2); } /* D O L O G -- Do the log command */ dolog(x) int x; { int y; char *s; switch (x) { case LOGD: y = cmofi("Name of debugging log file", "debuglog", &s); break; case LOGP: y = cmofi("Name of packet log file", "packetlog", &s); break; /* case LOGS: y = cmofi("Name of session log file","sessionlog",&s); break; */ case LOGT: y = cmofi("Name of transaction log file", "transactlog", &s); break; default: #ifndef MCS_FLAG printf("\n?Unexpected log designator - %d\n", x); #else sprintf(print_str,"\n?Unexpected log designator - %d\n", x); mcs_printf(print_str); #endif return(-2); } if (y < 0) return(y); strcpy(line, s); s = line; if ((y = cmcfm()) < 0) return(y); switch (x) { case LOGD: return(deblog = debopn(s)); case LOGP: zclose(ZPFILE); y = zopeno(ZPFILE, s); if (y > 0) strcpy(pktfil, s); else *pktfil = '\0'; return(pktlog = y); /* case LOGS: zclose(ZSFILE); y = zopeno(ZSFILE,s); if (y > 0) strcpy(sesfil,s); else *sesfil = '\0'; return(seslog = y); */ case LOGT: zclose(ZTFILE); tralog = zopeno(ZTFILE, s); if (tralog > 0) { strcpy(trafil, s); tlog(F110, "Transaction Log:", versio, 0l); tlog(F100, ckxsys, "", 0); ztime(&s); tlog(F100, s, "", 0l); } else *trafil = '\0'; return(tralog); default: return(-2); } } /* D E B O P N -- Open a debugging file */ debopn(s) char *s; { char *tp; zclose(ZDFILE); deblog = zopeno(ZDFILE, s); if (deblog > 0) { strcpy(debfil, s); if (deblog) debug(F110, "Debug Log ", versio, 0); if (deblog) debug(F100, ckxsys, "", 0); ztime(&tp); if (deblog) debug(F100, tp, "", 0); } else *debfil = '\0'; return(deblog); } /* S H O P A R -- Show Parameters */ shopar() { int i; extern struct keytab mdmtab[]; extern int nmdm; #ifndef MCS_FLAG printf("\n%s, %s\n", versio, ckxsys); printf("Communications Parameters:\n"); #else sprintf(print_str,"\n%s, %s\n", versio, ckxsys); mcs_printf(print_str); mcs_printf("Communications Parameters:\n"); #endif /* printf(" Line: %s, speed: %d, mode: ",ttname,speed); if (local) printf("local"); else printf("remote"); for (i = 0; i < nmdm; i++) { if (mdmtab[i].val == mdmtyp) { printf(", modem-dialer: %s",mdmtab[i].kwd); break; } } */ #ifndef MCS_FLAG printf(" Bits: %d", (parity) ? 7 : 8); printf(", Parity: "); #else sprintf(print_str," Bits: %d", (parity) ? 7 : 8); mcs_printf(print_str); mcs_printf(", Parity: "); #endif switch (parity) { case 'e': #ifndef MCS_FLAG printf("even"); #else mcs_printf("even"); #endif break; case 'o': #ifndef MCS_FLAG printf("odd"); #else mcs_printf("odd"); #endif break; case 'm': #ifndef MCS_FLAG printf("mark"); #else mcs_printf("mark"); #endif break; case 's': #ifndef MCS_FLAG printf("space"); #else mcs_printf("space"); #endif break; case 0: #ifndef MCS_FLAG printf("none"); #else mcs_printf("none"); #endif break; default: #ifndef MCS_FLAG printf("invalid - %d", parity); #else sprintf(print_str,"invalid - %d", parity); mcs_printf(print_str); #endif break; } #ifndef MCS_FLAG printf(", Duplex: "); #else mcs_printf(", Duplex: "); #endif if (duplex) #ifndef MCS_FLAG printf("half, "); #else mcs_printf("half, "); #endif else #ifndef MCS_FLAG printf("full, "); printf("Flow: "); #else mcs_printf("full, "); mcs_printf("Flow: "); #endif if (flow == 1) #ifndef MCS_FLAG printf("xon/xoff"); #else mcs_printf("xon/xoff"); #endif else if (flow == 0) #ifndef MCS_FLAG printf("none"); #else mcs_printf("none"); #endif else #ifndef MCS_FLAG printf("%d", flow); #else sprintf(print_str,"%d",flow); mcs_printf(print_str); #endif #ifndef MCS_FLAG printf(", Handshake: "); #else mcs_printf(", Handshake: "); #endif #ifndef MCS_FLAG if (turn) printf("%d\n", turnch); #else if (turn) { sprintf(print_str,"%d\n", turnch); mcs_printf(print_str); } #endif else #ifndef MCS_FLAG printf("none\n"); #else mcs_printf("none\n"); #endif /* printf(" Terminal emulation: %d bits\n", (cmask == 0177) ? 7 : 8); */ #ifndef MCS_FLAG printf("\nProtocol & Transfer Parameters: Send Receive"); #else mcs_printf("\nProtocol & Transfer Parameters: Send Receive"); #endif if (timef || spsizf) #ifndef MCS_FLAG printf(" (* = override)"); #else mcs_printf(" (* = override)"); #endif #ifndef MCS_FLAG printf("\n Timeout: %23d%12d", rtimo, timint); #else sprintf(print_str,"\n Timeout: %23d%12d",rtimo,timint); mcs_printf(print_str); #endif if (timef) #ifndef MCS_FLAG printf("*"); #else mcs_printf("*"); #endif #ifndef MCS_FLAG printf("\n Padding: %23d%12d\n", npad, mypadn); printf( " Pad Character:%23d%12d\n", padch, mypadc); printf( " Packet Start: %23d%12d\n", mystch, stchr); printf( " Packet End: %23d%12d\n", seol, eol); printf( " Packet Length:%23d", spsiz); printf( spsizf ? "*" : " " ); #else sprintf(print_str,"\n Padding: %23d%12d\n", npad, mypadn); mcs_printf(print_str); sprintf(print_str," Pad Character:%23d%12d\n", padch, mypadc); mcs_printf(print_str); sprintf(print_str," Packet Start: %23d%12d\n", mystch, stchr); mcs_printf(print_str); sprintf(print_str," Packet End: %23d%12d\n", seol, eol); mcs_printf(print_str); sprintf(print_str," Packet Length:%23d", spsiz); mcs_printf(print_str); sprintf(print_str,(spsizf ? "*" : " ")); mcs_printf(print_str); #endif /* printf("%11d\n", rpsiz); */ #ifndef MCS_FLAG if (urpsiz > 94) printf("%11d (%d)\n", urpsiz, rpsiz); #else if (urpsiz > 94) { sprintf(print_str,"%11d (%d)\n", urpsiz, rpsiz); mcs_printf(print_str); } #endif #ifndef MCS_FLAG else printf("%11d\n", rpsiz); #else else { sprintf(print_str,"%11d\n", rpsiz); mcs_printf(print_str); } #endif /* printf( " ID Fields: "); if (send_id) printf("%23s","keep"); else printf("%23s","discard"); if (recv_id) printf("%12s\n","keep"); else printf("%12s\n","discard"); printf( " Line Numbers: "); if (send_num) printf("%23s","keep"); else printf("%23s","discard"); if (recv_num) printf("%12s\n","keep"); else printf("%12s\n","discard"); printf( " Renumbering: "); if (send_renum) printf("%23s","on"); else printf("%23s","off"); if (recv_renum) printf("%12s\n","on"); else printf("%12s\n","off"); printf( " Number Adding:"); if (send_addnum) printf("%23s","on"); else printf("%23s","off"); if (recv_addnum) printf("%12s\n","on"); else printf("%12s\n","off"); printf(" Block Check Type: %d, Delay: %d\n",bctr,delay); */ #ifndef MCS_FLAG printf(" Block Check Type: %d\n", bctr); #else sprintf(print_str," Block Check Type: %d\n", bctr); mcs_printf(print_str); #endif #ifndef MCS_FLAG if (ebqflg) printf(" 8th-Bit Prefix: '%c'\n", ebq); #else if (ebqflg) { sprintf(print_str," 8th-Bit Prefix: '%c'\n", ebq); mcs_printf(print_str); } #endif #ifndef MCS_FLAG if (rptflg) printf(" Repeat-Count Prefix: '%c'\n", rptq); #else if (rptflg) { sprintf(print_str," Repeat-Count Prefix: '%c'\n", rptq); mcs_printf(print_str); } #endif #ifndef MCS_FLAG printf("\nFile Parameters:\n File Names: "); #else mcs_printf("\nFile Parameters:\n File Names: "); #endif #ifndef MCS_FLAG if (fncnv) printf("%-12s", "converted"); #else if (fncnv) { sprintf(print_str,"%-12s", "converted"); mcs_printf(print_str); } #endif #ifndef MCS_FLAG else printf("%-12s", "literal"); #else else { sprintf(print_str,"%-12s", "literal"); mcs_printf(print_str); } #endif #ifndef MCS_FLAG printf(" Debugging Log: "); #else sprintf(print_str," Debugging Log: "); mcs_printf(print_str); #endif #ifndef MCS_FLAG if (deblog) printf("%s", debfil); #else if (deblog) { sprintf(print_str,"%s", debfil); mcs_printf(print_str); } #endif else #ifndef MCS_FLAG printf("none"); #else mcs_printf("none"); #endif #ifndef MCS_FLAG printf("\n File Type: "); #else mcs_printf("\n File Type: "); #endif #ifndef MCS_FLAG if (binary) printf("%-12s", "binary"); #else if (binary) { sprintf(print_str,"%-12s", "binary"); mcs_printf(print_str); } #endif #ifndef MCS_FLAG else printf("%-12s", "text"); #else else { sprintf(print_str,"%-12s", "text"); mcs_printf(print_str); } #endif #ifndef MCS_FLAG printf(" Packet Log: "); #else mcs_printf(" Packet Log: "); #endif if (pktlog) #ifndef MCS_FLAG printf(pktfil); #else mcs_printf(pktfil); #endif else #ifndef MCS_FLAG printf("none"); #else mcs_printf("none"); #endif /* printf("\n File Warning: "); if (warn) printf("%-12s","on"); else printf("%-12s","off"); printf(" Session Log: "); if (seslog) printf(sesfil); else printf("none"); printf("\n File Display: "); if (quiet) printf("%-12s","off"); else printf("%-12s","on"); printf(" Session Log: "); if (seslog) printf(sesfil); else printf("none"); */ #ifndef MCS_FLAG printf("\n File Byte Size: %-12d", (fmask == 0177) ? 7 : 8); printf(" Transaction Log: "); #else sprintf(print_str,"\n File Byte Size: %-12d", (fmask == 0177) ? 7 : 8); mcs_printf(print_str); mcs_printf(" Transaction Log: "); #endif if (tralog) #ifndef MCS_FLAG printf(trafil); #else mcs_printf(trafil); #endif else #ifndef MCS_FLAG printf("none"); #else mcs_printf("none"); #endif /* printf("\n\nFile Byte Size: %d",(fmask == 0177) ? 7 : 8); */ #ifndef MCS_FLAG printf("\n Incomplete File Disposition: "); #else mcs_printf("\n Incomplete File Disposition: "); #endif if (keep) #ifndef MCS_FLAG printf("keep"); #else mcs_printf("keep"); #endif else #ifndef MCS_FLAG printf("discard"); printf(", Init file: %s", KERMRC); #else mcs_printf("discard"); sprintf(print_str,", Init file: %s", KERMRC); mcs_printf(print_str); #endif puts("\n"); } /* D O S T A T -- Display file transfer statistics. */ dostat() { #ifndef MCS_FLAG printf("\nMost recent transaction --\n"); printf(" files: %ld\n", filcnt); printf(" total file characters : %ld\n", tfc); printf(" communication line in : %ld\n", tlci); printf(" communication line out : %ld\n", tlco); printf(" elapsed time : %d sec\n", tsecs); #else sprintf(print_str,"\nMost recent transaction --\n"); mcs_printf(print_str); sprintf(print_str," files: %ld\n", filcnt); mcs_printf(print_str); sprintf(print_str," total file characters : %ld\n", tfc); mcs_printf(print_str); sprintf(print_str," communication line in : %ld\n", tlci); mcs_printf(print_str); sprintf(print_str," communication line out : %ld\n", tlco); mcs_printf(print_str); sprintf(print_str," elapsed time : %d sec\n", tsecs); mcs_printf(print_str); #endif if (filcnt > 0) { if (tsecs > 0) { long lx; lx = (tfc * 10l) / tsecs; #ifndef MCS_FLAG printf(" effective baud rate : %ld\n", lx); #else sprintf(print_str," effective baud rate : %ld\n", lx); mcs_printf(print_str); #endif if (speed > 0) { lx = (lx * 100l) / speed; #ifndef MCS_FLAG printf(" efficiency : %ld %%\n",lx); #else sprintf(print_str," efficiency : %ld %%\n", lx); mcs_printf(print_str); #endif } } #ifndef MCS_FLAG printf(" packet length : %d (send), %d (receive)\n", spsiz, urpsiz); printf(" block check type used : %d\n", bctu); printf(" compression : "); #else sprintf(print_str, " packet length : %d (send), %d (receive)\n", spsiz, urpsiz); mcs_printf(print_str); sprintf(print_str," block check type used : %d\n", bctu); mcs_printf(print_str); mcs_printf(" compression : "); #endif #ifndef MCS_FLAG if (rptflg) printf("yes [%c]\n", rptq); #else if (rptflg) { sprintf(print_str,"yes [%c]\n", rptq); mcs_printf(print_str); } #endif else #ifndef MCS_FLAG printf("no\n"); printf(" 8th bit prefixing : "); #else mcs_printf("no\n"); mcs_printf(" 8th bit prefixing : "); #endif #ifndef MCS_FLAG if (ebqflg) printf("yes [%c]\n", ebq); #else if (ebqflg) { sprintf(print_str,"yes [%c]\n", ebq); mcs_printf(print_str); } #endif else #ifndef MCS_FLAG printf("no\n\n"); #else mcs_printf("no\n\n"); #endif } else #ifndef MCS_FLAG printf("\n"); #else mcs_printf("\n"); #endif return(0); } /* F S T A T S -- Record file statistics in transaction log */ fstats() { tlog(F100, " end of file", "", 0l); tlog(F101, " file characters ", "", ffc); tlog(F101, " communication line in ", "", flci); tlog(F101, " communication line out ", "", flco); } /* T S T A T S -- Record statistics in transaction log */ tstats() { char *tp; int x; ztime(&tp); /* Get time stamp */ tlog(F110, "End of transaction", tp, 0l); /* Record it */ if (filcnt < 1) return; /* If no files, done. */ /* If multiple files, record character totals for all files */ if (filcnt > 1) { tlog(F101, " files", "", filcnt); tlog(F101, " total file characters ", "", tfc); tlog(F101, " communication line in ", "", tlci); tlog(F101, " communication line out ", "", tlco); } /* Record timing info for one or more files */ tlog(F101, " elapsed time (seconds) ", "", (long) tsecs); if (tsecs > 0) { x = (tfc / tsecs) * 10; tlog(F101, " effective baud rate ", "", x); if (speed > 0) { x = (x * 100) / speed; tlog(F101, " efficiency (percent) ", "", x); } } tlog(F100, "", "", 0); /* Leave a blank line */ } /* S D E B U -- Record spar results in debugging log */ sdebu(len) int len; { if (!deblog) return; debug(F111, "spar: data", rdatap, len); debug(F101, " spsiz ", "", spsiz); debug(F101, " timint", "", timint); debug(F101, " npad ", "", npad); debug(F101, " padch ", "", padch); debug(F101, " seol ", "", seol); debug(F101, " ctlq ", "", ctlq); debug(F101, " ebq ", "", ebq); debug(F101, " ebqflg", "", ebqflg); debug(F101, " bctr ", "", bctr); debug(F101, " rptq ", "", rptq); debug(F101, " rptflg", "", rptflg); debug(F101, " atcapu", "", atcapu); debug(F101, " lpcapu", "", lpcapu); debug(F101, " swcapu", "", swcapu); debug(F101, " wsize ", "", wsize); } /* R D E B U -- Debugging display of rpar() values */ rdebu(len) int len; { if (!deblog) return; debug(F111, "spar: data", rdatap, len); debug(F101, " rpsiz ", "", xunchar(data[1])); debug(F101, " rtimo ", "", rtimo); debug(F101, " mypadn", "", mypadn); debug(F101, " mypadc", "", mypadc); debug(F101, " eol ", "", eol); debug(F101, " ctlq ", "", ctlq); debug(F101, " sq ", "", sq); debug(F101, " ebq ", "", ebq); debug(F101, " ebqflg", "", ebqflg); debug(F101, " bctr ", "", bctr); debug(F101, " rptq ", "", data[9]); debug(F101, " rptflg", "", rptflg); debug(F101, " capas ", "", capas); debug(F101, " bits ", "", data[capas]); debug(F101, " atcapu", "", atcapu); debug(F101, " lpcapu", "", lpcapu); debug(F101, " swcapu", "", swcapu); debug(F101, " wsize ", "", wsize); debug(F101, " rpsiz(extended)", "", rpsiz); }