OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [userland/] [telnet/] [externs.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 763 simons
/*
2
 * Copyright (c) 1988, 1990, 1993
3
 *      The Regents of the University of California.  All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 * 3. All advertising materials mentioning features or use of this software
14
 *    must display the following acknowledgement:
15
 *      This product includes software developed by the University of
16
 *      California, Berkeley and its contributors.
17
 * 4. Neither the name of the University nor the names of its contributors
18
 *    may be used to endorse or promote products derived from this software
19
 *    without specific prior written permission.
20
 *
21
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31
 * SUCH DAMAGE.
32
 *
33
 *      @(#)externs.h   8.2 (Berkeley) 12/15/93
34
 */
35
 
36
#ifndef BSD
37
# define BSD 43
38
#endif
39
 
40
/*
41
 * ucb stdio.h defines BSD as something wierd
42
 */
43
#if defined(sun) && defined(__svr4__)
44
#define BSD 43
45
#endif
46
 
47
#ifndef USE_TERMIO
48
# if BSD > 43 || defined(SYSV_TERMIO)
49
#  define USE_TERMIO
50
# endif
51
#endif
52
 
53
#include <stdio.h>
54
#include <setjmp.h>
55
#if defined(CRAY) && !defined(NO_BSD_SETJMP)
56
#include <bsdsetjmp.h>
57
#endif
58
#ifndef FILIO_H
59
#include <sys/ioctl.h>
60
#else
61
#include <sys/filio.h>
62
#endif
63
#ifdef CRAY
64
# include <errno.h>
65
#endif /* CRAY */
66
#ifdef  USE_TERMIO
67
# ifndef        VINTR
68
#  ifdef SYSV_TERMIO
69
#   include <sys/termio.h>
70
#  else
71
#   include <sys/termios.h>
72
#   define termio termios
73
#  endif
74
# endif
75
#endif
76
#ifdef VEOL2
77
#undef termio
78
#define termio termios
79
#endif
80
#if defined(NO_CC_T) || !defined(USE_TERMIO)
81
# if !defined(USE_TERMIO)
82
typedef char cc_t;
83
# else
84
typedef unsigned char cc_t;
85
# endif
86
#endif
87
 
88
#ifndef NO_STRING_H
89
#include <string.h>
90
#endif
91
#include <strings.h>
92
 
93
#include "ring.h"
94
 
95
#ifndef MIN
96
#define MIN(a,b)        (((a)<(b))? (a):(b))
97
#endif
98
 
99
#ifndef _POSIX_VDISABLE
100
# ifdef sun
101
#  include <sys/param.h>        /* pick up VDISABLE definition, mayby */
102
# endif
103
# ifdef VDISABLE
104
#  define _POSIX_VDISABLE VDISABLE
105
# else
106
#  define _POSIX_VDISABLE ((cc_t)'\377')
107
# endif
108
#endif
109
 
110
#define SUBBUFSIZE      256
111
 
112
#ifndef CRAY
113
extern int errno;               /* outside this world */
114
#endif /* !CRAY */
115
 
116
#if     !defined(P)
117
# ifdef __STDC__
118
#  define       P(x)    x
119
# else
120
#  define       P(x)    ()
121
# endif
122
#endif
123
 
124
extern int
125
    autologin,          /* Autologin enabled */
126
    skiprc,             /* Don't process the ~/.telnetrc file */
127
    eight,              /* use eight bit mode (binary in and/or out */
128
    flushout,           /* flush output */
129
    connected,          /* Are we connected to the other side? */
130
    globalmode,         /* Mode tty should be in */
131
    In3270,                     /* Are we in 3270 mode? */
132
    telnetport,         /* Are we connected to the telnet port? */
133
    localflow,          /* Flow control handled locally */
134
    restartany,         /* If flow control, restart output on any character */
135
    localchars,         /* we recognize interrupt/quit */
136
    donelclchars,               /* the user has set "localchars" */
137
    showoptions,
138
    net,                /* Network file descriptor */
139
    tin,                /* Terminal input file descriptor */
140
    tout,               /* Terminal output file descriptor */
141
    crlf,               /* Should '\r' be mapped to <CR><LF> (or <CR><NUL>)? */
142
    autoflush,          /* flush output when interrupting? */
143
    autosynch,          /* send interrupt characters with SYNCH? */
144
    SYNCHing,           /* Is the stream in telnet SYNCH mode? */
145
    donebinarytoggle,   /* the user has put us in binary */
146
    dontlecho,          /* do we suppress local echoing right now? */
147
    crmod,
148
    netdata,            /* Print out network data flow */
149
    prettydump,         /* Print "netdata" output in user readable format */
150
#if     defined(unix)
151
#if     defined(TN3270)
152
    cursesdata,         /* Print out curses data flow */
153
    apitrace,           /* Trace API transactions */
154
#endif  /* defined(TN3270) */
155
    termdata,           /* Print out terminal data flow */
156
#endif  /* defined(unix) */
157
    debug,              /* Debug level */
158
    doaddrlookup,       /* do a reverse lookup? */
159
    clienteof;          /* Client received EOF */
160
 
161
extern cc_t escape;     /* Escape to command mode */
162
extern cc_t rlogin;     /* Rlogin mode escape character */
163
#ifdef  KLUDGELINEMODE
164
extern cc_t echoc;      /* Toggle local echoing */
165
#endif
166
 
167
extern char
168
    *prompt;            /* Prompt for command. */
169
 
170
extern char
171
    doopt[],
172
    dont[],
173
    will[],
174
    wont[],
175
    options[],          /* All the little options */
176
    *hostname;          /* Who are we connected to? */
177
 
178
/*
179
 * We keep track of each side of the option negotiation.
180
 */
181
 
182
#define MY_STATE_WILL           0x01
183
#define MY_WANT_STATE_WILL      0x02
184
#define MY_STATE_DO             0x04
185
#define MY_WANT_STATE_DO        0x08
186
 
187
/*
188
 * Macros to check the current state of things
189
 */
190
 
191
#define my_state_is_do(opt)             (options[opt]&MY_STATE_DO)
192
#define my_state_is_will(opt)           (options[opt]&MY_STATE_WILL)
193
#define my_want_state_is_do(opt)        (options[opt]&MY_WANT_STATE_DO)
194
#define my_want_state_is_will(opt)      (options[opt]&MY_WANT_STATE_WILL)
195
 
196
#define my_state_is_dont(opt)           (!my_state_is_do(opt))
197
#define my_state_is_wont(opt)           (!my_state_is_will(opt))
198
#define my_want_state_is_dont(opt)      (!my_want_state_is_do(opt))
199
#define my_want_state_is_wont(opt)      (!my_want_state_is_will(opt))
200
 
201
#define set_my_state_do(opt)            {options[opt] |= MY_STATE_DO;}
202
#define set_my_state_will(opt)          {options[opt] |= MY_STATE_WILL;}
203
#define set_my_want_state_do(opt)       {options[opt] |= MY_WANT_STATE_DO;}
204
#define set_my_want_state_will(opt)     {options[opt] |= MY_WANT_STATE_WILL;}
205
 
206
#define set_my_state_dont(opt)          {options[opt] &= ~MY_STATE_DO;}
207
#define set_my_state_wont(opt)          {options[opt] &= ~MY_STATE_WILL;}
208
#define set_my_want_state_dont(opt)     {options[opt] &= ~MY_WANT_STATE_DO;}
209
#define set_my_want_state_wont(opt)     {options[opt] &= ~MY_WANT_STATE_WILL;}
210
 
211
/*
212
 * Make everything symetrical
213
 */
214
 
215
#define HIS_STATE_WILL                  MY_STATE_DO
216
#define HIS_WANT_STATE_WILL             MY_WANT_STATE_DO
217
#define HIS_STATE_DO                    MY_STATE_WILL
218
#define HIS_WANT_STATE_DO               MY_WANT_STATE_WILL
219
 
220
#define his_state_is_do                 my_state_is_will
221
#define his_state_is_will               my_state_is_do
222
#define his_want_state_is_do            my_want_state_is_will
223
#define his_want_state_is_will          my_want_state_is_do
224
 
225
#define his_state_is_dont               my_state_is_wont
226
#define his_state_is_wont               my_state_is_dont
227
#define his_want_state_is_dont          my_want_state_is_wont
228
#define his_want_state_is_wont          my_want_state_is_dont
229
 
230
#define set_his_state_do                set_my_state_will
231
#define set_his_state_will              set_my_state_do
232
#define set_his_want_state_do           set_my_want_state_will
233
#define set_his_want_state_will         set_my_want_state_do
234
 
235
#define set_his_state_dont              set_my_state_wont
236
#define set_his_state_wont              set_my_state_dont
237
#define set_his_want_state_dont         set_my_want_state_wont
238
#define set_his_want_state_wont         set_my_want_state_dont
239
 
240
 
241
extern FILE
242
    *NetTrace;          /* Where debugging output goes */
243
extern unsigned char
244
    NetTraceFile[];     /* Name of file where debugging output goes */
245
extern void
246
    SetNetTrace P((char *));    /* Function to change where debugging goes */
247
 
248
extern jmp_buf
249
    peerdied,
250
    toplevel;           /* For error conditions. */
251
 
252
extern void
253
    command P((int, char *, int)),
254
    Dump P((int, unsigned char *, int)),
255
    init_3270 P((void)),
256
    printoption P((char *, int, int)),
257
    printsub P((int, unsigned char *, int)),
258
    sendnaws P((void)),
259
    setconnmode P((int)),
260
    setcommandmode P((void)),
261
    setneturg P((void)),
262
    sys_telnet_init P((void)),
263
    telnet P((char *)),
264
    tel_enter_binary P((int)),
265
    TerminalFlushOutput P((void)),
266
    TerminalNewMode P((int)),
267
    TerminalRestoreState P((void)),
268
    TerminalSaveState P((void)),
269
    tninit P((void)),
270
    upcase P((char *)),
271
    willoption P((int)),
272
    wontoption P((int));
273
 
274
extern void
275
    send_do P((int, int)),
276
    send_dont P((int, int)),
277
    send_will P((int, int)),
278
    send_wont P((int, int));
279
 
280
extern void
281
    lm_will P((unsigned char *, int)),
282
    lm_wont P((unsigned char *, int)),
283
    lm_do P((unsigned char *, int)),
284
    lm_dont P((unsigned char *, int)),
285
    lm_mode P((unsigned char *, int, int));
286
 
287
extern void
288
    slc_init P((void)),
289
    slcstate P((void)),
290
    slc_mode_export P((void)),
291
    slc_mode_import P((int)),
292
    slc_import P((int)),
293
    slc_export P((void)),
294
    slc P((unsigned char *, int)),
295
    slc_check P((void)),
296
    slc_start_reply P((void)),
297
    slc_add_reply P((int, int, int)),
298
    slc_end_reply P((void));
299
extern int
300
    slc_update P((void));
301
 
302
extern void
303
    env_opt P((unsigned char *, int)),
304
    env_opt_start P((void)),
305
    env_opt_start_info P((void)),
306
    env_opt_add P((unsigned char *)),
307
    env_opt_end P((int));
308
 
309
extern unsigned char
310
    *env_default P((int, int)),
311
    *env_getvalue P((unsigned char *));
312
 
313
extern int
314
    getconnmode P((void)),
315
    opt_welldefined P((char *)),
316
    netflush P((void)),
317
    get_status P((void)),
318
    dosynch P((void));
319
 
320
extern int
321
    telrcv P((void)),
322
    TerminalWrite P((char *, int)),
323
    TerminalAutoFlush P((void)),
324
    process_rings P((int, int, int, int, int, int)),
325
    TerminalSpecialChars P((int)),
326
    stilloob P((void)),
327
    is_unique P((char *, char **, char **)),
328
    rlogin_susp P((void)),
329
    ttyflush P((int)),
330
    ring_at_mark P((Ring *)),
331
    tn P((int, char **)),
332
    TerminalWindowSize P((long *, long *)),
333
    SetSockOpt P((int, int, int, int)),
334
    NetClose P((int));
335
 
336
extern void
337
    TerminalDefaultChars P((void)),
338
    TerminalSpeeds P((long *, long *)),
339
    env_init P((void)),
340
    sendsusp P((void)),
341
    sendeof P((void)),
342
    sendabort P((void)),
343
    quit P((void)),
344
    set_escape_char P((char *)),
345
    init_sys P((void)),
346
    init_telnet P((void)),
347
    init_network P((void)),
348
    init_terminal P((void)),
349
    ExitString P((char *, int)),
350
    cmdrc P((char *, char *)),
351
    optionstatus P((void)),
352
    tel_leave_binary  P((int)),
353
    Exit P((int));
354
 
355
extern cc_t
356
    *tcval P((int));
357
 
358
#ifndef USE_TERMIO
359
 
360
extern struct   tchars ntc;
361
extern struct   ltchars nltc;
362
extern struct   sgttyb nttyb;
363
 
364
# define termEofChar            ntc.t_eofc
365
# define termEraseChar          nttyb.sg_erase
366
# define termFlushChar          nltc.t_flushc
367
# define termIntChar            ntc.t_intrc
368
# define termKillChar           nttyb.sg_kill
369
# define termLiteralNextChar    nltc.t_lnextc
370
# define termQuitChar           ntc.t_quitc
371
# define termSuspChar           nltc.t_suspc
372
# define termRprntChar          nltc.t_rprntc
373
# define termWerasChar          nltc.t_werasc
374
# define termStartChar          ntc.t_startc
375
# define termStopChar           ntc.t_stopc
376
# define termForw1Char          ntc.t_brkc
377
extern cc_t termForw2Char;
378
extern cc_t termAytChar;
379
 
380
# define termEofCharp           (cc_t *)&ntc.t_eofc
381
# define termEraseCharp         (cc_t *)&nttyb.sg_erase
382
# define termFlushCharp         (cc_t *)&nltc.t_flushc
383
# define termIntCharp           (cc_t *)&ntc.t_intrc
384
# define termKillCharp          (cc_t *)&nttyb.sg_kill
385
# define termLiteralNextCharp   (cc_t *)&nltc.t_lnextc
386
# define termQuitCharp          (cc_t *)&ntc.t_quitc
387
# define termSuspCharp          (cc_t *)&nltc.t_suspc
388
# define termRprntCharp         (cc_t *)&nltc.t_rprntc
389
# define termWerasCharp         (cc_t *)&nltc.t_werasc
390
# define termStartCharp         (cc_t *)&ntc.t_startc
391
# define termStopCharp          (cc_t *)&ntc.t_stopc
392
# define termForw1Charp         (cc_t *)&ntc.t_brkc
393
# define termForw2Charp         (cc_t *)&termForw2Char
394
# define termAytCharp           (cc_t *)&termAytChar
395
 
396
# else
397
 
398
extern struct   termio new_tc;
399
 
400
# define termEofChar            new_tc.c_cc[VEOF]
401
# define termEraseChar          new_tc.c_cc[VERASE]
402
# define termIntChar            new_tc.c_cc[VINTR]
403
# define termKillChar           new_tc.c_cc[VKILL]
404
# define termQuitChar           new_tc.c_cc[VQUIT]
405
 
406
# ifndef        VSUSP
407
extern cc_t termSuspChar;
408
# else
409
#  define termSuspChar          new_tc.c_cc[VSUSP]
410
# endif
411
# if    defined(VFLUSHO) && !defined(VDISCARD)
412
#  define VDISCARD VFLUSHO
413
# endif
414
# ifndef        VDISCARD
415
extern cc_t termFlushChar;
416
# else
417
#  define termFlushChar         new_tc.c_cc[VDISCARD]
418
# endif
419
# ifndef VWERASE
420
extern cc_t termWerasChar;
421
# else
422
#  define termWerasChar         new_tc.c_cc[VWERASE]
423
# endif
424
# ifndef        VREPRINT
425
extern cc_t termRprntChar;
426
# else
427
#  define termRprntChar         new_tc.c_cc[VREPRINT]
428
# endif
429
# ifndef        VLNEXT
430
extern cc_t termLiteralNextChar;
431
# else
432
#  define termLiteralNextChar   new_tc.c_cc[VLNEXT]
433
# endif
434
# ifndef        VSTART
435
extern cc_t termStartChar;
436
# else
437
#  define termStartChar         new_tc.c_cc[VSTART]
438
# endif
439
# ifndef        VSTOP
440
extern cc_t termStopChar;
441
# else
442
#  define termStopChar          new_tc.c_cc[VSTOP]
443
# endif
444
# ifndef        VEOL
445
extern cc_t termForw1Char;
446
# else
447
#  define termForw1Char         new_tc.c_cc[VEOL]
448
# endif
449
# ifndef        VEOL2
450
extern cc_t termForw2Char;
451
# else
452
#  define termForw2Char         new_tc.c_cc[VEOL]
453
# endif
454
# ifndef        VSTATUS
455
extern cc_t termAytChar;
456
#else
457
#  define termAytChar           new_tc.c_cc[VSTATUS]
458
#endif
459
 
460
# if !defined(CRAY) || defined(__STDC__)
461
#  define termEofCharp          &termEofChar
462
#  define termEraseCharp        &termEraseChar
463
#  define termIntCharp          &termIntChar
464
#  define termKillCharp         &termKillChar
465
#  define termQuitCharp         &termQuitChar
466
#  define termSuspCharp         &termSuspChar
467
#  define termFlushCharp        &termFlushChar
468
#  define termWerasCharp        &termWerasChar
469
#  define termRprntCharp        &termRprntChar
470
#  define termLiteralNextCharp  &termLiteralNextChar
471
#  define termStartCharp        &termStartChar
472
#  define termStopCharp         &termStopChar
473
#  define termForw1Charp        &termForw1Char
474
#  define termForw2Charp        &termForw2Char
475
#  define termAytCharp          &termAytChar
476
# else
477
        /* Work around a compiler bug */
478
#  define termEofCharp          0
479
#  define termEraseCharp        0
480
#  define termIntCharp          0
481
#  define termKillCharp         0
482
#  define termQuitCharp         0
483
#  define termSuspCharp         0
484
#  define termFlushCharp        0
485
#  define termWerasCharp        0
486
#  define termRprntCharp        0
487
#  define termLiteralNextCharp  0
488
#  define termStartCharp        0
489
#  define termStopCharp         0
490
#  define termForw1Charp        0
491
#  define termForw2Charp        0
492
#  define termAytCharp          0
493
# endif
494
#endif
495
 
496
 
497
/* Ring buffer structures which are shared */
498
 
499
extern Ring
500
    netoring,
501
    netiring,
502
    ttyoring,
503
    ttyiring;
504
 
505
/* Tn3270 section */
506
#if     defined(TN3270)
507
 
508
extern int
509
    HaveInput,          /* Whether an asynchronous I/O indication came in */
510
    noasynchtty,        /* Don't do signals on I/O (SIGURG, SIGIO) */
511
    noasynchnet,        /* Don't do signals on I/O (SIGURG, SIGIO) */
512
    sigiocount,         /* Count of SIGIO receptions */
513
    shell_active;       /* Subshell is active */
514
 
515
extern char
516
    *Ibackp,            /* Oldest byte of 3270 data */
517
    Ibuf[],             /* 3270 buffer */
518
    *Ifrontp,           /* Where next 3270 byte goes */
519
    tline[],
520
    *transcom;          /* Transparent command */
521
 
522
extern int
523
    settranscom P((int, char**));
524
 
525
extern void
526
    inputAvailable P((int));
527
#endif  /* defined(TN3270) */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.