⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ckcmai.c

📁 早期freebsd实现
💻 C
📖 第 1 页 / 共 3 页
字号:
\n\0";#else#ifdef OS2char *hlptxt = "C-Kermit Server REMOTE Commands:\n\\n\GET files  REMOTE CD [dir]     REMOTE DIRECTORY [files]\n\SEND files REMOTE SPACE [dir]  REMOTE HOST command\n\FINISH     REMOTE DELETE files REMOTE TYPE files\n\BYE        REMOTE HELP         REMOTE SET parameter value\n\\n\0";#else#ifdef MINIXchar *hlptxt = "C-Kermit Server REMOTE Commands:\n\GET SEND BYE FINISH REMOTE: CD DEL DIR HELP HOST SET SPACE TYPE WHO\n\0";#else#ifdef VMSchar *hlptxt = "C-Kermit Server REMOTE Commands:\r\n\\r\n\GET files  REMOTE CD [dir]     REMOTE DIRECTORY [files]\r\n\SEND files REMOTE SPACE [dir]  REMOTE HOST command\r\n\MAIL files REMOTE DELETE files REMOTE WHO [user]\r\n\BYE        REMOTE PRINT files  REMOTE TYPE files\r\n\FINISH     REMOTE HELP         REMOTE SET parameter value\r\n\\0";#else#ifdef datageneralchar *hlptxt = "C-Kermit Server REMOTE Commands:\n\\n\GET files  REMOTE CD [dir]     REMOTE DIRECTORY [filespec]\n\SEND files REMOTE SPACE [dir]  REMOTE HOST command\n\BYE        REMOTE TYPE file    REMOTE DELETE files\n\FINISH     REMOTE WHO          REMOTE SET\n\\0";#elsechar *hlptxt = "C-Kermit Server REMOTE Commands:\n\\n\GET files  REMOTE CD [dir]     REMOTE DIRECTORY [files]\n\SEND files REMOTE SPACE [dir]  REMOTE HOST command\n\MAIL files REMOTE DELETE files REMOTE WHO [user]\n\BYE        REMOTE PRINT files  REMOTE TYPE files\n\FINISH     REMOTE HELP         REMOTE SET parameter value\n\\n\0";#endif#endif#endif#endif#endif#endif#ifdef MINIXchar *srvtxt = "\r\n\Entering server mode.\r\n\0";#else#ifdef OSKchar *srvtxt = "\r\l\Entering server mode.  If your local Kermit software is menu driven, use\r\l\the menus to send commands to the server.  Otherwise, enter the escape\r\l\sequence to return to your local Kermit prompt and issue commands from\r\l\there.  Use SEND and GET for file transfer.  Use REMOTE HELP for a list of\r\l\other available services.  Use BYE or FINISH to end server mode.\r\l\0";#else /* UNIX, VMS, AOS/VS, and all others */char *srvtxt = "\r\n\Entering server mode.  If your local Kermit software is menu driven, use\r\n\the menus to send commands to the server.  Otherwise, enter the escape\r\n\sequence to return to your local Kermit prompt and issue commands from\r\n\there.  Use SEND and GET for file transfer.  Use REMOTE HELP for a list of\r\n\other available services.  Use BYE or FINISH to end server mode.\r\n\0";#endif /* OSK */#endif /* MINIX */#else  /* server mode disabled */char *srvtxt = "";#endif /* NOSERVER *//* Declarations for Send-Init Parameters */int spsiz = DSPSIZ,                     /* Current packet size to send */    spmax = DSPSIZ,			/* Biggest packet size we can send */    spsizr = DSPSIZ,			/* Send-packet size requested */    spsizf = 0,                         /* Flag to override size negotiation */    rpsiz = DRPSIZ,                     /* Biggest we want to receive */    urpsiz = DRPSIZ,			/* User-requested receive pkt size */    maxrps = MAXRP,			/* Maximum incoming long packet size */    maxsps = MAXSP,			/* Maximum outbound l.p. size */    maxtry = MAXTRY,			/* Maximum retries per packet */    wslots = 1,				/* Window size currently in use */    wslotr = 1,				/* Window size from SET WINDOW */    wslotn = 1,				/* Window size negotiated in S-pkt */    timeouts = 0,			/* For statistics reporting */    spackets = 0,			/*  ... */    rpackets = 0,			/*  ... */    retrans = 0,			/*  ... */    crunched = 0,			/*  ... */    wmax = 0,				/*  ... */    wcur = 0,				/*  ... */    srvdis = 0,				/* Server file xfer display */    srvtim = DSRVTIM,			/* Server command wait timeout *//*  timint is the timeout interval I use when waiting for a packet.  pkttim is the SET RECEIVE TIMEOUT value, sent to the other Kermit.  rtimo is the SET SEND TIMEOUT value.  rtimo is the initial value of  timint.  timint is changed by the value in the incoming negotiation  packet unless a SET SEND TIMEOUT command was given.*/    timint = DMYTIM,                    /* Timeout interval I use */    pkttim = URTIME,			/* Timeout I want you to use */    rtimo = DMYTIM,			/* Normal packet wait timeout */    timef = 0,                          /* Flag to override what you ask */    npad = MYPADN,                      /* How much padding to send */    mypadn = MYPADN,                    /* How much padding to ask for */    bctr = 1,                           /* Block check type requested */    bctu = 1,                           /* Block check type used */    bctl = 1,				/* Block check length */    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 */int capas = 9,				/* Position of Capabilities */    atcapb = 8,				/* Attribute capability */    atcapr = 1,				/*  requested */    atcapu = 0,				/*  used */    swcapb = 4,				/* Sliding Window capability */    swcapr = 1,				/*  requested (allowed) */    swcapu = 0,				/*  used */    lpcapb = 2,				/* Long Packet capability */    lpcapr = 1,				/*  requested */    lpcapu = 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;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 */struct zattr iattr;			/* Incoming file attributes *//* File related variables, mainly for the benefit of VAX/VMS */int fblksiz = DBLKSIZ;		/* File blocksize */int frecl = DLRECL;		/* File record length */int frecfm = XYFF_S;		/* File record format (default = stream) */int forg = XYFO_S;		/* File organization (sequential) */int fcctrl = XYFP_N;		/* File carriage control (ctrl chars) */#ifdef VMS/* VMS labeled file options */int lf_opts = LBL_NAM;#elseint lf_opts = 0;#endif /* VMS *//* Packet-related variables */int pktnum = 0,                         /* Current packet number */    sndtyp = 0,				/* Type of packet just sent */    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 */    rprintf,				/* REMOTE PRINT flag */    rmailf;				/* MAIL flag */CHAR#ifdef NO_MORE  /* Buffers used before sliding windows... */    sndpkt[MAXSP+100],			/* Entire packet being sent */    recpkt[MAXRP+200],			/* Packet most recently received */    data[MAXSP+4],			/* Packet data buffer */#endif#ifdef DYNAMIC    *srvcmd = (CHAR *)0,		/* Where to decode server command */#else    srvcmd[MAXRP+4],                    /* Where to decode server command */#endif    padbuf[95],				/* 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 */char filnam[257];                       /* Name of current file. */char cmdfil[80];			/* Application file name. */int nfils = 0;				/* Number of files in file group */long fsize;                             /* Size of current file */int wildxpand = 0;			/* Who expands wildcards */int clfils = 0;				/* Flag for command-line files */int stayflg = 0;			/* Flag for "stay", i.e. "-S" *//* Communication line variables */char ttname[80];                        /* Name of communication line. */#ifdef MACint connected = 0;			/* true if connected */int startconnected;			/* initial state of connected */#endif /* MAC */long speed = -1L;			/* Line speed */int parity,                             /* Parity specified, 0,'e','o',etc */    autopar = 0,			/* Automatic parity change flag */    sosi = 0,				/* Shift-In/Out flag */    flow,                               /* 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 */    delay = DDELAY,                     /* Initial delay before sending */    tnlm = 0,				/* Terminal newline mode */    mdmtyp = 0;                         /* Modem type (initially none)  *//* Networks for SET HOST */#define MYHOSTL 100    char myhost[MYHOSTL];		/* Local host name */    int network = 0;			/* Network vs tty connection */#ifdef OS2/* For now, DECnet is the only type supported by OS/2 */    int nettype = NET_DEC;#else    int nettype = NET_TCPB;		/* Assume TCP/IP (BSD sockets) */#endif /* OS2 */#ifdef SUNX25    extern initpad();    int revcall = 0;            /* X.25 reverse call not selected */    int closgr  = -1;		/* X.25 closed user group not selected */    int cudata = 0;		/* X.25 call user data not specified */    char udata[MAXCUDATA];	/* X.25 call user data */#endif /* SUNX25 *//* Other recent additions */    int tlevel = -1;			/* Take-file command level */#ifndef NOSPL    extern int cmdlvl;			/* Command level */    extern int maclvl;			/* Macro invocation level */#endif /* NOSPL */    int carrier = CAR_AUT;		/* Pay attention to carrier signal */    int cdtimo = 0;			/* Carrier wait timeout */    int xitsta = GOOD_EXIT;		/* Program exit status */#ifdef VMS				/* Default filename collision action */    int fncact = XYFX_X;		/* REPLACE for VAX/VMS */#else    int fncact = XYFX_B;		/* BACKUP for everybody else */#endif /* VMS */    int bgset = -1;			/* BACKGROUND mode set explicitly */#ifdef UNIX    int suspend = DFSUSP;		/* Whether SUSPEND command, etc, */#else					/* is to be allowed. */    int suspend = 0;#endif /* UNIX *//* Statistics variables */long filcnt,                    /* Number of files in transaction */    flci,                       /* Characters from line, current file */    flco,                       /* Chars to line, current file  */    tlci,                       /* Chars from line in transaction */    tlco,                       /* Chars to line in transaction */    ffc,                        /* Chars to/from current file */    tfc,                        /* Chars to/from files in transaction */    rptn;			/* Repeated characters compressed */int tsecs = 0;                  /* Seconds for transaction */int fsecs = 0;			/* Per-file timer *//* Flags */int deblog = 0,                         /* Flag for debug logging */    debses = 0,				/* Flag for DEBUG SESSION */    pktlog = 0,                         /* Flag for packet logging */    seslog = 0,                         /* Session logging */    tralog = 0,                         /* Transaction logging */    displa = 0,                         /* File transfer display on/off */    stdouf = 0,                         /* Flag for output to stdout */    stdinf = 0,				/* Flag for input from stdin */    xflg   = 0,                         /* Flag for X instead of F packet */    hcflg  = 0,                         /* Doing Host command */    fncnv  = 1,                         /* Flag for file name conversion */    binary = 0,                         /* Flag for binary file */    savmod = 0,                         /* Saved file mode (whole session) */    bsave  = 0,				/* Saved file mode (per file) */    bsavef = 0,				/* Flag if bsave was used. */    cmask  = 0177,			/* Connect byte mask */    fmask  = 0377,			/* File byte mask */    warn   = 0,                         /* Flag for file warning */    quiet  = 0,                         /* Be quiet during file transfer */    local  = 0,                         /* Flag for external tty vs stdout */    server = 0,                         /* Flag for being a server */    cflg   = 0,				/* Connect before transaction */    cnflg  = 0,                         /* Connect after transaction */    cxseen = 0,                         /* Flag for cancelling a file */    czseen = 0,                         /* Flag for cancelling file group */    discard = 0,			/* Flag for file to be discarded */    keep = 0,                           /* Keep incomplete files */    unkcs = 1,				/* Keep file w/unknown character set */    nakstate = 0,			/* In a state where we can send NAKs */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -