31 |
static char sccsid[] = "@(#)slc.c 8.2 (Berkeley) 5/30/95"; |
static char sccsid[] = "@(#)slc.c 8.2 (Berkeley) 5/30/95"; |
32 |
#endif /* not lint */ |
#endif /* not lint */ |
33 |
|
|
|
#ifdef HAVE_CONFIG_H |
|
|
#include <config.h> |
|
|
#endif |
|
|
|
|
34 |
#include "telnetd.h" |
#include "telnetd.h" |
35 |
|
|
|
#ifdef LINEMODE |
|
36 |
/* |
/* |
37 |
* local varibles |
* local variables |
38 |
*/ |
*/ |
39 |
static unsigned char *def_slcbuf = (unsigned char *)0; |
static unsigned char *def_slcbuf = (unsigned char *)0; |
40 |
static int def_slclen = 0; |
static int def_slclen = 0; |
89 |
slcchange = 1; |
slcchange = 1; |
90 |
|
|
91 |
} /* end of default_slc */ |
} /* end of default_slc */ |
|
#endif /* LINEMODE */ |
|
92 |
|
|
93 |
/* |
/* |
94 |
* get_slc_defaults |
* get_slc_defaults |
111 |
|
|
112 |
} /* end of get_slc_defaults */ |
} /* end of get_slc_defaults */ |
113 |
|
|
|
#ifdef LINEMODE |
|
114 |
/* |
/* |
115 |
* add_slc |
* add_slc |
116 |
* |
* |
189 |
(void) sprintf((char *)slcptr, "%c%c", IAC, SE); |
(void) sprintf((char *)slcptr, "%c%c", IAC, SE); |
190 |
slcptr += 2; |
slcptr += 2; |
191 |
len = slcptr - slcbuf; |
len = slcptr - slcbuf; |
192 |
writenet(slcbuf, len); |
net_output_datalen(slcbuf, len); |
193 |
netflush(); /* force it out immediately */ |
netflush(); /* force it out immediately */ |
194 |
DIAG(TD_OPTIONS, printsub('>', slcbuf+2, len-2);); |
DEBUG(debug_options, 1, |
195 |
|
printsub('>', slcbuf+2, len-2)); |
196 |
} |
} |
197 |
} |
} |
198 |
return (0); |
return (0); |
364 |
|
|
365 |
} /* end of change_slc */ |
} /* end of change_slc */ |
366 |
|
|
|
#if defined(USE_TERMIO) && (VEOF == VMIN) |
|
|
cc_t oldeofc = '\004'; |
|
|
#endif |
|
|
|
|
367 |
/* |
/* |
368 |
* check_slc |
* check_slc |
369 |
* |
* |
378 |
register int i; |
register int i; |
379 |
|
|
380 |
for (i = 1; i <= NSLC; i++) { |
for (i = 1; i <= NSLC; i++) { |
381 |
#if defined(USE_TERMIO) && (VEOF == VMIN) |
if (i == SLC_EOF && term_change_eof ()) |
382 |
/* |
continue; |
|
* In a perfect world this would be a neat little |
|
|
* function. But in this world, we should not notify |
|
|
* client of changes to the VEOF char when |
|
|
* ICANON is off, because it is not representing |
|
|
* a special character. |
|
|
*/ |
|
|
if (i == SLC_EOF) { |
|
|
if (!tty_isediting()) |
|
|
continue; |
|
|
else if (slctab[i].sptr) |
|
|
oldeofc = *(slctab[i].sptr); |
|
|
} |
|
|
#endif /* defined(USE_TERMIO) && defined(SYSV_TERMIO) */ |
|
383 |
if (slctab[i].sptr && |
if (slctab[i].sptr && |
384 |
(*(slctab[i].sptr) != slctab[i].current.val)) { |
(*(slctab[i].sptr) != slctab[i].current.val)) { |
385 |
slctab[i].current.val = *(slctab[i].sptr); |
slctab[i].current.val = *(slctab[i].sptr); |
403 |
* ptr points to the beginning of the buffer, len is the length. |
* ptr points to the beginning of the buffer, len is the length. |
404 |
*/ |
*/ |
405 |
void |
void |
406 |
do_opt_slc(register unsigend char *ptr, register int len) |
do_opt_slc(register unsigned char *ptr, register int len) |
407 |
{ |
{ |
408 |
register unsigned char func, flag; |
register unsigned char func, flag; |
409 |
cc_t val; |
cc_t val; |
455 |
|
|
456 |
} /* end of deferslc */ |
} /* end of deferslc */ |
457 |
|
|
|
#endif /* LINEMODE */ |
|