📄 ckcmai.c
字号:
pkttim = URTIME, /* Timeout I want you to use */ rtimo = DMYTIM, /* Normal packet wait timeout */ timef = 0, /* Flag to override what you ask */#ifdef CK_TIMERS rttflg = 1, /* Use dynamic round-trip timers */#else rttflg = 0, /* Use fixed timer */#endif /* CK_TIMERS */ mintime = 1, /* Minimum timeout */ maxtime = 0, /* Maximum timeout */ npad = MYPADN, /* How much padding to send */ mypadn = MYPADN, /* How much padding to ask for */ bctr = DFBCT, /* Block check type requested */ bctu = 1, /* Block check type used */ bctl = 1, /* Block check length */ c_save = -1, /* Block check saving and restoring */ ss_save = -1, /* Slow-start saving and restoring */ ebq = MYEBQ, /* 8th bit prefix */ ebqflg = 0, /* 8th-bit quoting flag */ rqf = -1, /* Flag used in 8bq negotiation */ rq = 0, /* Received 8bq bid */ sq = 'Y', /* Sent 8bq bid */ rpt = 0, /* Repeat count */ rptq = MYRPTQ, /* Repeat prefix */ rptflg = 0, /* Repeat processing flag */ rptena = 1, /* Repeat processing enabled */ xfrcan = 1, /* Transfer cancellation enabled */ xfrint = 1, /* Transfer interruption enabled */ xfrchr = 3, /* Transfer cancel char = Ctrl-C */ xfrnum = 3; /* Need three of them. */int epktflg = 0; /* E-PACKET command active */int capas = 9, /* Position of Capabilities */ lpcapb = 2, /* Long Packet capability */ lpcapr = 1, /* requested */ lpcapu = 0, /* used */ swcapb = 4, /* Sliding Window capability */ swcapr = 1, /* requested (allowed) */ swcapu = 0, /* used */ atcapb = 8, /* Attribute capability */ atcapr = 1, /* requested */ atcapu = 0, /* used */ rscapb = 16, /* RESEND capability */ rscapr = 1, /* requested by default */ rscapu = 0, /* used */ lscapb = 32, /* Locking Shift capability */ lscapr = 1, /* requested by default */ lscapu = 0; /* used *//* Flags for whether to use particular attributes */int atenci = 1, /* Encoding in */ atenco = 1, /* Encoding out */ atdati = 1, /* Date in */ atdato = 1, /* Date out */ atdisi = 1, /* Disposition in/out */ atdiso = 1, atleni = 1, /* Length in/out (both kinds) */ atleno = 1, atblki = 1, /* Blocksize in/out */ atblko = 1, attypi = 1, /* File type in/out */ attypo = 1, atsidi = 1, /* System ID in/out */ atsido = 1, atsysi = 1, /* System-dependent parameters in/out */ atsyso = 1;#ifdef CK_PERMSint atlpri = 1, atlpro = 1, atgpri = 1, atgpro = 1;#endif /* CK_PERMS */#ifdef STRATUSint atfrmi = 1, /* Format in/out */ atfrmo = 1, atcrei = 1, /* Creator ID in/out */ atcreo = 1, atacti = 1, /* Account in/out */ atacto = 1;#endif /* STRATUS */int sprmlen = -1; /* Send/Recieve protocol parameter */int rprmlen = -1; /* string length limits */CHAR padch = MYPADC, /* Padding character to send */ mypadc = MYPADC, /* Padding character to ask for */ seol = MYEOL, /* End-Of-Line character to send */ eol = MYEOL, /* End-Of-Line character to look for */ ctlq = CTLQ, /* Control prefix in incoming data */ myctlq = CTLQ, /* Outbound control character prefix */ myrptq = MYRPTQ; /* Repeat prefix I want to use */int rptmin = 3; /* Repeat-count minimum */int usepipes = 0; /* Used for xfer to/from pipes */char * filefile = NULL; /* File containing list of filenames *//* CD message filename list */char whoareu[16] = { NUL, NUL }; /* System ID of other Kermit */int sysindex = -1; /* and index to its system ID struct */int myindex = -1;int wearealike = 0; /* 2 Kermits have compatible sysids */char * cksysid = /* My system ID */#ifdef UNIX "U1"#else#ifdef VMS "D7"#else#ifdef OSK "UD"#else#ifdef AMIGA "L3"#else#ifdef MAC "A3"#else#ifdef OS2#ifdef NT "UN"#else /* NT */ "UO"#endif /* NT */#else /* OS2 */#ifdef datageneral "F3"#else#ifdef GEMDOS "K2"#else#ifdef STRATUS "MV"#else ""#endif /* STRATUS */#endif /* GEMDOS */#endif /* datageneral */#endif /* OS2 */#endif /* MAC */#endif /* AMIGA */#endif /* OSK */#endif /* VMS */#endif /* UNIX */ ;int oopts = -1; /* O-Packet Options */int omode = -1; /* O-Packet Transfer Mode */int oname = -1; /* O-Packet Filename Options */int opath = -1; /* O-Packet Pathname Options */struct zattr iattr; /* Incoming file attributes */#ifdef VMS/* VMS labeled file default options - name only. */int lf_opts = LBL_NAM;#else#ifdef OS2/* OS/2 labeled file default options, all attributes but archived. */unsigned long int lf_opts = LBL_EXT|LBL_HID|LBL_RO|LBL_SYS;#elseint lf_opts = 0;#endif /* OS2 */#endif /* VMS *//* Packet-related variables */int pktnum = 0, /* Current packet number */ sndtyp = 0, /* Type of packet just sent */ rcvtyp = 0, /* Type of packet just received */ rsn, /* Received packet sequence number */ rln, /* Received packet length */ size, /* Current size of output pkt data */ osize, /* Previous output packet data size */ maxsize, /* Max size for building data field */ spktl = 0, /* Length packet being sent */ rpktl = 0, /* Length of packet just received */ pktpaus = 0, /* Interpacket pause interval, msec */ rprintf, /* REMOTE PRINT flag */ rmailf, /* MAIL flag */ xferstat = -1, /* Status of last transaction */ filestatus = 0; /* Status of last file transfer */CHAR pktmsgbuf[PKTMSGLEN+1];CHAR *epktmsg = pktmsgbuf;CHAR#ifdef pdp11 srvcmdbuf[MAXRP+4], *srvcmd = srvcmdbuf,#else#ifdef DYNAMIC *srvcmd = (CHAR *)0, /* Where to decode server command */#else srvcmdbuf[MAXRP+4], *srvcmd = srvcmdbuf,#endif /* DYNAMIC */#endif /* pdp11 */ padbuf[96], /* Buffer for send-padding */ *recpkt, *rdatap, /* Pointer to received packet data */ *data = (CHAR *)0, /* Pointer to send-packet data */ *srvptr, /* Pointer to srvcmd */ mystch = SOH, /* Outbound packet-start character */ stchr = SOH; /* Incoming packet-start character *//* File-related variables */#ifndef NOMSEND /* Multiple SEND */struct filelist * filehead = NULL; /* SEND list */struct filelist * filetail = NULL;struct filelist * filenext = NULL;int addlist = 0;#endif /* NOMSEND */char filnam[CKMAXPATH + 1]; /* Name of current file. */#ifdef PIPESENDchar * sndfilter = NULL;char * rcvfilter = NULL;#endif /* PIPESEND */char ** sndarray = NULL; /* SEND /ARRAY pointer and range */#ifndef NOSPLint sndxlo = -1, sndxhi = -1, sndxin = -1;#endif /* NOSPL */#endif /* NOXFER */#ifndef NOSERVERint ngetpath = 0; /* GET search path */int fromgetpath = 0;char * getpath[MAXGETPATH];char * x_user = NULL; /* Server login information */char * x_passwd = NULL;char * x_acct = NULL;#endif /* NOSERVER */int x_login = 0; /* Login required */int x_logged = 0; /* User is logged in */extern int timelimit;#ifdef CK_LOGINint logintimo = 300; /* Login timeout */char * userfile = NULL; /* Forbidden user file */#endif /* CK_LOGIN */#ifdef IKSDchar * anonfile = NULL; /* Anonymous login init file */char * anonroot = NULL; /* Anonymous file-system root */int iks_timo = 300; /* 5 minutes idle timo */int iks_retry = 3; /* 3 attempts at login */#endif /* IKSD */#ifdef CKSYSLOGextern VOID zsyslog();extern int ckxlogging, ckxsyslog;#endif /* CKSYSLOG */int nzxopts = 0; /* Options for nzxpand() */int nfils = 0; /* Number of files in file group */long fsize = 0L; /* Size of current file */#ifdef UNIXint wildxpand = 0; /* Who expands wildcards */#else /* UNIX */#ifdef STRATUSint wildxpand = 1;#endif /* STRATUS */#endif /* UNIX */#ifdef UNIXOROSKint matchdot = 0; /* Whether to match dot files */#elseint matchdot = 1;#endif /* UNIXOROSK */int clfils = 0; /* Flag for command-line files */int stayflg = 0; /* Flag for "stay", i.e. "-S" */int xfinish = 0; /* Flag for FINISH = EXIT */long ztusec = -1L; /* Used with ztime() */long ztmsec = -1L; /* Ditto *//* Communication device / connection variables */char ttname[TTNAMLEN+1]; /* Name of communication device */#ifdef MACint connected = 0; /* True if connected */int startconnected; /* initial state of connected */#endif /* MAC */long speed = -1L; /* Communication device speed */int wasclosed = 0; /* Connection was just closed */int whyclosed = WC_REMO; /* why it was closed */int qnxportlock = 0; /* QNX port locking on/off */#ifndef CLSONDISC#define CLSONDISC 0#endif /* CLSONDISC */int cxflow[CXT_MAX+1]; /* See initflow() */#ifndef NOSHOWchar * floname[] = { /* Flow control names */ "none", "xon/xoff", "rts/cts", "dtr/cd", "etx/ack", "string", "xxx1", "xxx2", "dtr/cts", "keep", "auto"};int nfloname = (sizeof(floname) / sizeof(char *));char * cxname[] = { /* Connection type names */ "remote", "direct-serial", "modem", "tcp/ip", "x.25", "decnet", "lat", "netbios", "named-pipe", "ssh", "pipe"};int ncxname = (sizeof(cxname) / sizeof(char *));#endif /* NOSHOW */int parity = DEFPAR, /* Parity specified, 0,'e','o',etc */ hwparity = 0, /* Hardware parity for serial port */ stopbits = -1, /* Stop bits for serial port */ clsondisc = CLSONDISC, /* Serial port close on disconnect */ autopar = 0, /* Automatic parity change flag */ sosi = 0, /* Shift-In/Out flag */ flow = 0, /* Flow control (see initflow()) */ autoflow = 1, /* Automatic flow control */ turn = 0, /* Line turnaround handshake flag */ turnch = XON, /* Line turnaround character */ duplex = 0, /* Duplex, full by default */ escape = DFESC, /* Escape character for connect */ ckdelay = DDELAY, /* Initial delay before sending */ tnlm = 0, /* Terminal newline mode */ mdmtyp = 0; /* Modem type (initially none) *//* Networks for SET HOST */#ifdef BIGBUFOK#define MYHOSTL 1024#else#define MYHOSTL 100#endif /* BIGBUFOK */char myhost[MYHOSTL]; /* Local host name */int network = 0; /* Network vs serial connection */int inserver = 0; /* Running as an Internet server */int isguest = 0; /* User is anonymous */char * clienthost = NULL; /* Peer host name or address */int tcp_incoming = 0; /* Incoming TCP connection? */#ifdef NETCONN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -