📄 ckuus2.c
字号:
case XYPROM: puts("Prompt string for this program, normally 'C-Kermit>'."); return(0); case XYRETR: puts("\How many times to retransmit a particular packet before giving up"); return(0);case XYSPEE: puts("\Communication line speed for external tty line specified in most recent");#ifdef AMIGA puts("\'set line' command. Any baud rate between 110 and 292000, although you"); puts(" will receive a warning if you do not use a standard baud rate:"); puts("\110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600.");#else#ifdef datageneral puts("\'set line' command. Any of the common baud rates:"); puts(" 0, 50, 75, 110, 134, 150, 300, 600, 1200, 1800, "); puts(" 2400, 3600, 7200, 4800, 9600, 19200, 38400.");#else#ifdef MINIX puts("\'set line' command. Any of the common baud rates:"); puts(" 0, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200.");#else puts("\'set line' command. Any of the common baud rates:"); puts(" 0, 110, 150, 300, 600, 1200, 1800, 2400, 4800, 9600.");#endif#endif#endif return(0);case XYRECV: 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), Packet-Length (2000 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: printf("%s","Not available yet - %s\n",cmdbuf); return(0); }#endif /* MINIX */} /* D O H R M T -- Give help about REMOTE command */ dohrmt(xx) int xx; {#ifdef MINIX return(0);#else int x; if (xx == -3) return(hmsga(hmhrmt)); if (xx < 0) return(xx); switch (xx) { case XZCWD: return(hmsg("\Ask remote Kermit server to change its working directory.")); case XZDEL: return(hmsg("\Ask remote Kermit server to delete the named file(s).")); case XZDIR: return(hmsg("\Ask remote Kermit server to provide directory listing of the named file(s).")); case XZHLP: return(hmsg("\Ask remote Kermit server to tell you what services it provides.")); case XZHOS: return(hmsg("\Send a command to the remote system in its own command language\n\through the remote Kermit server.")); case XZSPA: return(hmsg("\Ask the remote Kermit server to tell you about its disk space.")); case XZTYP: return(hmsg("\Ask the remote Kermit server to type the named file(s) on your screen.")); case XZWHO: return(hmsg("\Ask the remote Kermit server to list who's logged in, or to give information\n\about the specified user.")); default: if (x = (cmcfm()) < 0) return(x); printf("%s","not working yet - %s\n",cmdbuf); return(-2); }#endif /* MINIX */}/*** The following functions moved here from ckuusr.c because that module ***//*** got too big for PDP-11s. ***//* D O L O G -- Do the log command */ dolog(x) int x; { int y; char *s; switch (x) { case LOGD:#ifdef DEBUG y = cmofi("Name of debugging log file","debug.log",&s);#else y = -2; s = ""; printf("%s","- Sorry, debug log not available\n");#endif break; case LOGP: y = cmofi("Name of packet log file","packet.log",&s); break; case LOGS: y = cmofi("Name of session log file","session.log",&s); break; case LOGT:#ifdef TLOG y = cmofi("Name of transaction log file","transact.log",&s);#else y = -2; s = ""; printf("%s","- Sorry, transaction log not available\n");#endif break; default: printf("\n?Unexpected log designator - %d\n",x); return(-2); } if (y < 0) return(y); strcpy(line,s); s = line; if ((y = cmcfm()) < 0) return(y); /* cont'd... *//* ...dolog, cont'd */ switch (x) { #ifdef DEBUG case LOGD: return(deblog = debopn(s));#endif 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); #ifdef TLOG 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);#endif default: return(-2); }} /* D E B O P N -- Open a debugging file */ debopn(s) char *s; {#ifdef DEBUG char *tp; zclose(ZDFILE); deblog = zopeno(ZDFILE,s); if (deblog > 0) { strcpy(debfil,s); debug(F110,"Debug Log ",versio,0); debug(F100,ckxsys,"",0); ztime(&tp); debug(F100,tp,"",0); } else *debfil = '\0'; return(deblog);#else return(0);#endif}/* S H O P A R -- Show Parameters */ shopar() { int i;#ifndef MINIX extern struct keytab mdmtab[]; extern int nmdm;#endif printf("\n%s,%s, ",versio,ckxsys); puts("Communications Parameters:"); printf(" Line: %s, speed: %d, mode: ",ttname,speed); if (local) printf("local"); else printf("remote"); #ifndef MINIX for (i = 0; i < nmdm; i++) { if (mdmtab[i].val == mdmtyp) { printf(", modem-dialer: %s",mdmtab[i].kwd); break; } }#endif printf("\n Bits: %d",(parity) ? 7 : 8); printf(", parity: "); switch (parity) { case 'e': printf("even"); break; case 'o': printf("odd"); break; case 'm': printf("mark"); break; case 's': printf("space"); break; case 0: printf("none"); break; default: printf("invalid - %d",parity); break; } printf(", duplex: "); if (duplex) printf("half, "); else printf("full, "); printf("flow: "); if (flow == 1) printf("xon/xoff"); else if (flow == 0) printf("none"); else printf("%d",flow); printf(", handshake: "); if (turn) printf("%d\n",turnch); else printf("none\n"); printf("Terminal emulation: %d bits\n", (cmask == 0177) ? 7 : 8); printf("\nProtocol Parameters: Send Receive"); if (timef || spsizf) printf(" (* = override)"); printf("\n Timeout: %11d%9d", rtimo, timint); if (timef) printf("*"); printf("\n Padding: %11d%9d", npad, mypadn); printf(" Block Check: %6d\n",bctr); printf( " Pad Character:%11d%9d", padch, mypadc); printf(" Delay: %6d\n",delay); printf( " Packet Start: %11d%9d", mystch, stchr); printf(" Max Retries: %6d\n",maxtry); printf( " Packet End: %11d%9d", seol, eol); if (ebqflg) printf(" 8th-Bit Prefix: '%c'",ebq); printf( "\n Packet Length:%11d", spsiz); printf( spsizf ? "*" : " " ); printf("%8d", urpsiz); printf( (urpsiz > 94) ? " (94)" : " "); if (rptflg) printf(" Repeat Prefix: '%c'",rptq); printf( "\n Length Limit: %11d%9d\n", maxsps, maxrps); printf("\nFile parameters:\n File Names: "); if (fncnv) printf("%-12s","converted"); else printf("%-12s","literal");#ifdef DEBUG printf(" Debugging Log: "); if (deblog) printf("%s",debfil); else printf("none");#endif printf("\n File Type: "); if (binary) printf("%-12s","binary"); else printf("%-12s","text"); printf(" Packet Log: "); if (pktlog) printf(pktfil); else printf("none"); 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");#ifdef TLOG printf(" Transaction Log: "); if (tralog) printf(trafil); else printf("none");#endif printf("\n\nFile Byte Size: %d",(fmask == 0177) ? 7 : 8); printf(", Incomplete File Disposition: "); if (keep) printf("keep"); else printf("discard");#ifdef KERMRC printf(", Init file: %s",KERMRC);#endif puts("\n");}/* D O S T A T -- Display file transfer statistics. */dostat() { 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); if (filcnt > 0) { if (tsecs > 0) { long lx; lx = (tfc * 10l) / tsecs; printf(" effective baud rate : %ld\n",lx); if (speed > 0) { lx = (lx * 100l) / speed; printf(" efficiency : %ld %%\n",lx); } } printf(" packet length : %d (send), %d (receive)\n", spsiz,urpsiz); printf(" block check type used : %d\n",bctu); printf(" compression : "); if (rptflg) printf("yes [%c]\n",rptq); else printf("no\n"); printf(" 8th bit prefixing : "); if (ebqflg) printf("yes [%c]\n",ebq); else printf("no\n\n"); } else printf("\n"); 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; { 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; { 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);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -