📄 ckudia.c
字号:
#define TB_UNK 0 /* Unknown Telebit model */#define TB_BLAZ 1 /* Original TrailBlazer */#define TB_PLUS 2 /* TrailBlazer Plus */#define TB_1000 3 /* T1000 */#define TB_1500 4 /* T1500 */#define TB_1600 5 /* T1600 */#define TB_2000 6 /* T2000 */#define TB_2500 7 /* T2500 */#define TB_3000 8 /* T3000 */#define TB_QBLA 9 /* Qblazer */#define TB_WBLA 10 /* WorldBlazer */#define TB__MAX 10 /* Highest number */char *tb_name[] = { /* Array of model names */ "Unknown", /* TB_UNK */ "TrailBlazer", /* TB_BLAZ */ "TrailBlazer-Plus", /* TB_PLUS */ "T1000", /* TB_1000 */ "T1500", /* TB_1500 */ "T1600", /* TB_1600 */ "T2000", /* TB_2000 */ "T2500", /* TB_2500 */ "T3000", /* TB_3000 */ "Qblazer", /* TB_QBLA */ "WorldBlazer", /* TB_WBLA */ ""};#endif /* MINIDIAL */extern int flow, local, mdmtyp, quiet, backgrd, parity, seslog, network;extern int carrier, duplex, mdmsav, reliable, setreliable;extern int ttnproto, nettype;extern long speed;extern char ttname[], sesfil[];#ifndef NOXFERextern CHAR stchr;extern int interrupted;#endif /* NOXFER *//* Failure codes */#define F_TIME 1 /* timeout */#define F_INT 2 /* interrupt */#define F_MODEM 3 /* modem-detected failure */#define F_MINIT 4 /* cannot initialize modem */#ifndef CK_TAPIstatic#endif /* CK_TAPI */#ifdef OS2 volatile#endif /* OS2 */ int fail_code = 0; /* Default failure reason. */static int xredial = 0;static int func_code; /* 0 = dialing, nonzero = answering */static int partial;static int mymdmtyp = 0;#define DW_NOTHING 0 /* What we are doing */#define DW_INIT 1#define DW_DIAL 2static int dial_what = DW_NOTHING; /* Nothing at first. */static int nonverbal = 0; /* Hayes in numeric response mode */static MDMINF * mp;static CHAR escbuf[6];static long mdmcapas;_PROTOTYP (static VOID dreset, (void) );_PROTOTYP (static int (*xx_ok), (int,int) );_PROTOTYP (static int ddinc, (int) );_PROTOTYP (int dialhup, (void) );_PROTOTYP (int getok, (int,int) );_PROTOTYP (char * ck_time, (void) );_PROTOTYP (static VOID ttslow, (char *, int) );#ifdef COMMENT_PROTOTYP (static VOID xcpy, (char *, char *, unsigned int) );#endif /* COMMENT */_PROTOTYP (static VOID waitfor, (char *) );_PROTOTYP (static VOID dialoc, (char) );_PROTOTYP (static int didweget, (char *, char *) );_PROTOTYP (static VOID spdchg, (long) );_PROTOTYP (static int dialfail, (int) );_PROTOTYP (static VOID gethrw, (void) );_PROTOTYP (static VOID gethrn, (void) );int dialudt = n_UDEF; /* Number of user-defined type *//* BEGIN MDMINF STRUCT DEFINITIONS *//* Declare structures containing modem-specific information. REMEMBER that only the first SEVEN characters of these names are guaranteed to be unique. First declare the three types that are allowed for MINIDIAL versions.*/staticMDMINF CCITT = /* CCITT / ITU-T V.25bis autodialer *//* According to V.25bis: . Even parity is required for giving commands to the modem. . Commands might or might not echo. . Responses ("Indications") from the modem are terminated by CR and LF. . Call setup is accomplished by: - DTE raises DTR (V.24 circuit 108) [ttopen() does this] - Modem raises CTS (V.24 circuit 106) [C-Kermit ignores this] - DTE issues a call request command ("CRN") - Modem responds with "VAL" ("command accepted") - If the call is completed: modem responds with "CNX" ("call connected"); modem turns CTS (106) OFF; modem turns DSR (107) ON; else: modem responds with "CFI <parameter>" ("call failure indication"). . To clear a call, the DTE turns DTR (108) OFF. . There is no mention of the Carrier Detect circuit (109) in the standard. . There is no provision for "escaping back" to the modem's command mode. It is not known whether there exists in real life a pure V.25bis modem. If there is, this code has never been tested on it. See the Digitel entry.*/ { "Any CCITT / ITU-T V.25bis conformant modem", "", /* pulse command */ "", /* tone command */ 40, /* dial_time -- programmable -- */ ",:", /* pause_chars -- "," waits for programmable time */ /* ":" waits for dial tone */ 10, /* pause_time (seconds, just a guess) */ "", /* wake_str (none) */ 200, /* wake_rate (msec) */ "VAL", /* wake_prompt */ "", /* dmode_str (none) */ "", /* dmode_prompt (none) */ "CRN%s\015", /* dial_str */ 200, /* dial_rate (msec) */ 0, /* No esc_time */ 0, /* No esc_char */ "", /* No hup_str */ "", /* hwfc_str */ "", /* swfc_str */ "", /* nofc_str */ "", /* ec_on_str */ "", /* ec_off_str */ "", /* dc_on_str */ "", /* dc_off_str */ "CIC\015", /* aa_on_str */ "DIC\015", /* aa_off_str */ "", /* sb_on_str */ "", /* sb_off_str */ "", /* sp_off_str */ "", /* sp_on_str */ "", /* vol1_str */ "", /* vol2_str */ "", /* vol3_str */ "", /* ignoredt */ "", /* ini2 */ 0L, /* max_speed */ CKD_V25, /* capas */ NULL /* No ok_fn */};staticMDMINF HAYES = /* Hayes 2400 and compatible modems */ { "Hayes Smartmodem 2400 and compatibles", "ATP\015", /* pulse command */ "ATT\015", /* tone command */ 35, /* dial_time */ ",", /* pause_chars */ 2, /* pause_time */#ifdef OS2 "ATE1Q0V1&S0&C1&D2\015", /* wake_str */#else#ifdef VMS "ATQ0&S1\015", /* wake_str */#else "ATQ0\015", /* wake_str */#endif /* VMS */#endif /* OS2 */ 0, /* wake_rate */ "OK\015", /* wake_prompt */ "", /* dmode_str */ "", /* dmode_prompt */ "ATD%s\015", /* dial_str, user supplies D or T */ 0, /* dial_rate */ 1100, /* esc_time */ 43, /* esc_char */ "ATQ0H0\015", /* hup_str */ "", /* hwfc_str */ "", /* swfc_str */ "", /* nofc_str */ "", /* ec_on_str */ "", /* ec_off_str */ "", /* dc_on_str */ "", /* dc_off_str */ "ATS0=1\015", /* aa_on_str */ "ATS0=0\015", /* aa_off_str */ "", /* sb_on_str */ "", /* sb_off_str */ "ATM1\015", /* sp_on_str */ "ATM0\015", /* sp_off_str */ "ATL1\015", /* vol1_str */ "ATL2\015", /* vol2_str */ "ATL3\015", /* vol3_str */ "ATX3\015", /* ignoredt */ "", /* ini2 */ 2400L, /* max_speed */ CKD_AT, /* capas */ getok /* ok_fn */};/* The intent of the "unknown" modem is to allow KERMIT to support unknown modems by having the user type the entire autodial sequence (possibly including control characters, etc.) as the "phone number". The protocol and other characteristics of this modem are unknown, with some "reasonable" values being chosen for some of them. The only way to detect if a connection is made is to look for carrier.*/staticMDMINF UNKNOWN = /* Information for "Unknown" modem */ { "Unknown", /* name */ "", /* pulse command */ "", /* tone command */ 30, /* dial_time */ "", /* pause_chars */ 0, /* pause_time */ "", /* wake_str */ 0, /* wake_rate */ "", /* wake_prompt */ "", /* dmode_str */ NULL, /* dmode_prompt */ "%s\015", /* dial_str */ 0, /* dial_rate */ 0, /* esc_time */ 0, /* esc_char */ "", /* hup_str */ "", /* hwfc_str */ "", /* swfc_str */ "", /* nofc_str */ "", /* ec_on_str */ "", /* ec_off_str */ "", /* dc_on_str */ "", /* dc_off_str */ "", /* aa_on_str */ "", /* aa_off_str */ "", /* sb_on_str */ "", /* sb_off_str */ "", /* sp_off_str */ "", /* sp_on_str */ "", /* vol1_str */ "", /* vol2_str */ "", /* vol3_str */ "", /* ignoredt */ "", /* ini2 */ 0L, /* max_speed */ 0, /* capas */ NULL /* ok_fn */};#ifndef MINIDIALstaticMDMINF ATTISN = /* AT&T ISN Network */ { "", /* pulse command */ "", /* tone command */ "AT&T ISN Network", 30, /* Dial time */ "", /* Pause characters */ 0, /* Pause time */ "\015\015\015\015", /* Wake string */ 900, /* Wake rate */ "DIAL", /* Wake prompt */ "", /* dmode_str */ "", /* dmode_prompt */ "%s\015", /* dial_str */ 0, /* dial_rate */ 0, /* esc_time */ 0, /* esc_char */ "", /* hup_str */ "", /* hwfc_str */ "", /* swfc_str */ "", /* nofc_str */ "", /* ec_on_str */ "", /* ec_off_str */ "", /* dc_on_str */ "", /* dc_off_str */ "", /* aa_on_str */ "", /* aa_off_str */ "", /* sb_on_str */ "", /* sb_off_str */ "", /* sp_off_str */ "", /* sp_on_str */ "", /* vol1_str */ "", /* vol2_str */ "", /* vol3_str */ "", /* ignoredt */ "", /* ini2 */ 0L, /* max_speed */ 0, /* capas */ NULL /* ok_fn */};staticMDMINF ATTMODEM = /* information for AT&T switched-network modems */ /* "Number" following "dial" can include: p's and * t's to indicate pulse or tone (default) dialing, * + for wait for dial tone, , for pause, r for * last number dialed, and, except for 2224B, some * comma-delimited options like o12=y, before number. * "Important" options for the modems: * * All: Except for 2224B, enable option 12 for "transparent * data," o12=y. If a computer port used for both * incoming and outgoing calls is connected to the * modem, disable "enter interactive mode on carriage * return," EICR. The Kermit "dial" command can * function with EIA leads standard, EIAS. * * 2212C: Internal hardware switches at their default * positions (four rockers down away from numbers) * unless EICR is not wanted (rocker down at the 4). * For EIAS, rocker down at the 1. * * 2224B: Front-panel switch position 1 must be up (at the 1, * closed). Disable EICR with position 2 down. * For EIAS, position 4 down. * All switches on the back panel down. * * 2224CEO: All front-panel switches down except either 5 or 6. * Enable interactive flow control with o16=y. * Select normal asynchronous mode with o34=0 (zero). * Disable EICR with position 3 up. For EIAS, 1 up. * Reset the modem after changing switches. * * 2296A: If option 00 (zeros) is present, use o00=0. * Enable interactive flow control with o16=y. * Select normal asynchronous mode with o34=0 (zero). * (available in Microcom Networking version, but * not necessarily other models of the 2296A). * Enable modem-port flow control (if available) with * o42=y. Enable asynchronous operation with o50=y. * Disable EICR with o69=n. For EIAS, o66=n, using * front panel. */ { "AT&T switched-network modems", "", /* pulse command */ "", /* tone command */ 20, /* dial_time */ ",", /* pause_chars */ 2, /* pause_time */ "+", /* wake_str */ 0, /* wake_rate */ "", /* wake_prompt */ "", /* dmode_str */ "", /* dmode_prompt */ "at%s\015", /* dial_str */ 0, /* dial_rate */ 0, /* esc_time */ 0, /* esc_char */ "", /* hup_str */ "", /* hwfc_str */ "", /* swfc_str */ "", /* nofc_str */ "", /* ec_on_str */ "", /* ec_off_str */ "", /* dc_on_str */ "", /* dc_off_str */ "", /* aa_on_str */ "", /* aa_off_str */ "", /* sb_on_str */ "", /* sb_off_str */ "", /* sp_off_str */ "", /* sp_on_str */ "", /* vol1_str */ "", /* vol2_str */ "", /* vol3_str */ "", /* ignoredt */ "", /* ini2 */ 0L, /* max_speed */ CKD_AT, /* capas */ NULL /* ok_fn */};staticMDMINF ATTDTDM = /* AT&T Digital Terminal Data Module */ /* For dialing: KYBD switch down, others usually up. */ { "AT&T Digital Terminal Data Module", "", /* pulse command */ "", /* tone command */ 20, /* dial_time */ "", /* pause_chars */ 0, /* pause_time */ "", /* wake_str */ 0, /* wake_rate */ "", /* wake_prompt */ "", /* dmode_str */ "", /* dmode_prompt */ "%s\015", /* dial_str */ 0, /* dial_rate */ 0, /* esc_time */ 0, /* esc_char */ "", /* hup_str */ "", /* hwfc_str */ "", /* swfc_str */ "", /* nofc_str */ "", /* ec_on_str */ "", /* ec_off_str */ "", /* dc_on_str */ "", /* dc_off_str */ "", /* aa_on_str */ "", /* aa_off_str */ "", /* sb_on_str */ "", /* sb_off_str */ "", /* sp_off_str */ "", /* sp_on_str */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -