| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: tip.h,v 1.33 2013/10/21 14:47:46 christos Exp $ */ | | 1 | /* $NetBSD: tip.h,v 1.34 2020/04/23 00:35:14 joerg Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1989, 1993 | | 4 | * Copyright (c) 1989, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * | | 6 | * |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -49,57 +49,57 @@ | | | @@ -49,57 +49,57 @@ |
49 | #include <pwd.h> | | 49 | #include <pwd.h> |
50 | #include <setjmp.h> | | 50 | #include <setjmp.h> |
51 | #include <signal.h> | | 51 | #include <signal.h> |
52 | #include <stdio.h> | | 52 | #include <stdio.h> |
53 | #include <stdlib.h> | | 53 | #include <stdlib.h> |
54 | #include <string.h> | | 54 | #include <string.h> |
55 | #include <termios.h> | | 55 | #include <termios.h> |
56 | #include <time.h> | | 56 | #include <time.h> |
57 | #include <unistd.h> | | 57 | #include <unistd.h> |
58 | | | 58 | |
59 | /* | | 59 | /* |
60 | * Remote host attributes | | 60 | * Remote host attributes |
61 | */ | | 61 | */ |
62 | char *DV; /* UNIX device(s) to open */ | | 62 | extern char *DV; /* UNIX device(s) to open */ |
63 | char *EL; /* chars marking an EOL */ | | 63 | extern char *EL; /* chars marking an EOL */ |
64 | char *CM; /* initial connection message */ | | 64 | extern char *CM; /* initial connection message */ |
65 | char *IE; /* EOT to expect on input */ | | 65 | extern char *IE; /* EOT to expect on input */ |
66 | char *OE; /* EOT to send to complete FT */ | | 66 | extern char *OE; /* EOT to send to complete FT */ |
67 | char *CU; /* call unit if making a phone call */ | | 67 | extern char *CU; /* call unit if making a phone call */ |
68 | char *AT; /* acu type */ | | 68 | extern char *AT; /* acu type */ |
69 | char *PN; /* phone number(s) */ | | 69 | extern char *PN; /* phone number(s) */ |
70 | char *DI; /* disconnect string */ | | 70 | extern char *DI; /* disconnect string */ |
71 | char *PA; /* parity to be generated */ | | 71 | extern char *PA; /* parity to be generated */ |
72 | | | 72 | |
73 | char *PH; /* phone number file */ | | 73 | extern char *PH; /* phone number file */ |
74 | char *RM; /* remote file name */ | | 74 | extern char *RM; /* remote file name */ |
75 | char *HO; /* host name */ | | 75 | extern char *HO; /* host name */ |
76 | | | 76 | |
77 | long BR; /* line speed for conversation */ | | 77 | extern long BR; /* line speed for conversation */ |
78 | long FS; /* frame size for transfers */ | | 78 | extern long FS; /* frame size for transfers */ |
79 | | | 79 | |
80 | long DU; /* this host is dialed up */ | | 80 | extern long DU; /* this host is dialed up */ |
81 | long HW; /* this device is hardwired, see hunt.c */ | | 81 | extern long HW; /* this device is hardwired, see hunt.c */ |
82 | char *ES; /* escape character */ | | 82 | extern char *ES; /* escape character */ |
83 | char *EX; /* exceptions */ | | 83 | extern char *EX; /* exceptions */ |
84 | char *FO; /* force (literal next) char*/ | | 84 | extern char *FO; /* force (literal next) char*/ |
85 | char *RC; /* raise character */ | | 85 | extern char *RC; /* raise character */ |
86 | char *RE; /* script record file */ | | 86 | extern char *RE; /* script record file */ |
87 | char *PR; /* remote prompt */ | | 87 | extern char *PR; /* remote prompt */ |
88 | long DL; /* line delay for file transfers to remote */ | | 88 | extern long DL; /* line delay for file transfers to remote */ |
89 | long CL; /* char delay for file transfers to remote */ | | 89 | extern long CL; /* char delay for file transfers to remote */ |
90 | long ET; /* echocheck timeout */ | | 90 | extern long ET; /* echocheck timeout */ |
91 | long HD; /* this host is half duplex - do local echo */ | | 91 | extern long HD; /* this host is half duplex - do local echo */ |
92 | char DC; /* this host is directly connected. */ | | 92 | extern char DC; /* this host is directly connected. */ |
93 | | | 93 | |
94 | /* | | 94 | /* |
95 | * String value table | | 95 | * String value table |
96 | */ | | 96 | */ |
97 | typedef | | 97 | typedef |
98 | struct { | | 98 | struct { |
99 | const char *v_name; /* whose name is it */ | | 99 | const char *v_name; /* whose name is it */ |
100 | uint8_t v_type; /* for interpreting set's */ | | 100 | uint8_t v_type; /* for interpreting set's */ |
101 | uint8_t v_access; /* protection of touchy ones */ | | 101 | uint8_t v_access; /* protection of touchy ones */ |
102 | const char *v_abrev; /* possible abreviation */ | | 102 | const char *v_abrev; /* possible abreviation */ |
103 | void *v_value; /* casted to a union later */ | | 103 | void *v_value; /* casted to a union later */ |
104 | /* | | 104 | /* |
105 | * XXX: this assumes that the storage space | | 105 | * XXX: this assumes that the storage space |
| @@ -213,57 +213,56 @@ extern value_t vtable[]; /* variable tab | | | @@ -213,57 +213,56 @@ extern value_t vtable[]; /* variable tab |
213 | #define HOME 21 | | 213 | #define HOME 21 |
214 | #define ECHOCHECK 22 | | 214 | #define ECHOCHECK 22 |
215 | #define DISCONNECT 23 | | 215 | #define DISCONNECT 23 |
216 | #define TAND 24 | | 216 | #define TAND 24 |
217 | #define LDELAY 25 | | 217 | #define LDELAY 25 |
218 | #define CDELAY 26 | | 218 | #define CDELAY 26 |
219 | #define ETIMEOUT 27 | | 219 | #define ETIMEOUT 27 |
220 | #define RAWFTP 28 | | 220 | #define RAWFTP 28 |
221 | #define HALFDUPLEX 29 | | 221 | #define HALFDUPLEX 29 |
222 | #define LECHO 30 | | 222 | #define LECHO 30 |
223 | #define PARITY 31 | | 223 | #define PARITY 31 |
224 | #define HARDWAREFLOW 32 | | 224 | #define HARDWAREFLOW 32 |
225 | | | 225 | |
226 | struct termios term; /* current mode of terminal */ | | 226 | extern struct termios term; /* current mode of terminal */ |
227 | struct termios defterm; /* initial mode of terminal */ | | 227 | extern struct termios defterm; /* initial mode of terminal */ |
228 | struct termios defchars; /* current mode with initial chars */ | | 228 | extern struct termios defchars; /* current mode with initial chars */ |
229 | | | 229 | |
230 | FILE *fscript; /* FILE for scripting */ | | 230 | extern FILE *fscript; /* FILE for scripting */ |
231 | | | 231 | |
232 | int attndes[2]; /* coprocess wakeup channel */ | | 232 | extern int attndes[2]; /* coprocess wakeup channel */ |
233 | int fildes[2]; /* file transfer synchronization channel */ | | 233 | extern int fildes[2]; /* file transfer synchronization channel */ |
234 | int repdes[2]; /* read process synchronization channel */ | | 234 | extern int repdes[2]; /* read process synchronization channel */ |
235 | int FD; /* open file descriptor to remote host */ | | 235 | extern int FD; /* open file descriptor to remote host */ |
236 | #ifndef __lint__ /* not used by hayes.c, but used by some other dialers */ | | 236 | #ifndef __lint__ /* not used by hayes.c, but used by some other dialers */ |
237 | int AC; /* open file descriptor to dialer (v831 only) */ | | 237 | extern int AC; /* open file descriptor to dialer (v831 only) */ |
238 | #endif /*__lint__*/ | | 238 | #endif /*__lint__*/ |
239 | int vflag; /* print .tiprc initialization sequence */ | | 239 | extern int sfd; /* for ~< operation */ |
240 | int sfd; /* for ~< operation */ | | 240 | extern int pid; /* pid of tipout */ |
241 | int pid; /* pid of tipout */ | | 241 | extern uid_t uid, euid; /* real and effective user id's */ |
242 | uid_t uid, euid; /* real and effective user id's */ | | 242 | extern gid_t gid, egid; /* real and effective group id's */ |
243 | gid_t gid, egid; /* real and effective group id's */ | | 243 | extern int stop; /* stop transfer session flag */ |
244 | int stop; /* stop transfer session flag */ | | 244 | extern int quit; /* same; but on other end */ |
245 | int quit; /* same; but on other end */ | | 245 | extern int stoprompt; /* for interrupting a prompt session */ |
246 | int stoprompt; /* for interrupting a prompt session */ | | 246 | extern int timedout; /* ~> transfer timedout */ |
247 | int timedout; /* ~> transfer timedout */ | | 247 | extern int cumode; /* simulating the "cu" program */ |
248 | int cumode; /* simulating the "cu" program */ | | 248 | extern int bits8; /* terminal is in 8-bit mode */ |
249 | int bits8; /* terminal is in 8-bit mode */ | | | |
250 | #define STRIP_PAR (bits8 ? 0377 : 0177) | | 249 | #define STRIP_PAR (bits8 ? 0377 : 0177) |
251 | | | 250 | |
252 | char fname[80]; /* file name buffer for ~< */ | | 251 | extern char fname[80]; /* file name buffer for ~< */ |
253 | char copyname[80]; /* file name buffer for ~> */ | | 252 | extern char copyname[80]; /* file name buffer for ~> */ |
254 | char ccc; /* synchronization character */ | | 253 | extern char ccc; /* synchronization character */ |
255 | | | 254 | |
256 | int odisc; /* initial tty line discipline */ | | 255 | extern int odisc; /* initial tty line discipline */ |
257 | | | 256 | |
258 | extern acu_t acutable[]; | | 257 | extern acu_t acutable[]; |
259 | extern esctable_t etable[]; | | 258 | extern esctable_t etable[]; |
260 | extern unsigned char evenpartab[]; | | 259 | extern unsigned char evenpartab[]; |
261 | | | 260 | |
262 | void alrmtimeout(int); | | 261 | void alrmtimeout(int); |
263 | int any(char, const char *); | | 262 | int any(char, const char *); |
264 | void chdirectory(char); | | 263 | void chdirectory(char); |
265 | void cleanup(int) __dead; | | 264 | void cleanup(int) __dead; |
266 | const char *tip_connect(void); | | 265 | const char *tip_connect(void); |
267 | void consh(char); | | 266 | void consh(char); |
268 | char *ctrl(char); | | 267 | char *ctrl(char); |
269 | void cumain(int, char **); | | 268 | void cumain(int, char **); |