aboutsummaryrefslogtreecommitdiffstats
path: root/usr.bin/telnet
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 00:00:00 -0800
committersvn2git <svn2git@FreeBSD.org>1994-05-01 00:00:00 -0800
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /usr.bin/telnet
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
downloadsrc-a16f65c7d117419bd266c28a1901ef129a337569.tar.gz
src-a16f65c7d117419bd266c28a1901ef129a337569.zip
Release FreeBSD 1.1release/1.1.0_cvs
This commit was manufactured to restore the state of the 1.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'usr.bin/telnet')
-rw-r--r--usr.bin/telnet/Makefile2
-rw-r--r--usr.bin/telnet/commands.c20
-rw-r--r--usr.bin/telnet/sys_bsd.c24
-rw-r--r--usr.bin/telnet/telnet.110
-rw-r--r--usr.bin/telnet/telnet.c8
-rw-r--r--usr.bin/telnet/tn3270.c2
-rw-r--r--usr.bin/telnet/utilities.c10
7 files changed, 48 insertions, 28 deletions
diff --git a/usr.bin/telnet/Makefile b/usr.bin/telnet/Makefile
index 96bf01563d2c..80f52d9c97c6 100644
--- a/usr.bin/telnet/Makefile
+++ b/usr.bin/telnet/Makefile
@@ -4,7 +4,7 @@
PROG= telnet
-CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO
+CFLAGS+=-DTERMCAP -DUSE_TERMIO
CFLAGS+=-I${.CURDIR}/../../lib
.if exists(/usr/lib/libcrypt.a)
diff --git a/usr.bin/telnet/commands.c b/usr.bin/telnet/commands.c
index 863064f04ab7..c5e175bfec95 100644
--- a/usr.bin/telnet/commands.c
+++ b/usr.bin/telnet/commands.c
@@ -46,6 +46,7 @@ static char sccsid[] = "@(#)commands.c 5.5 (Berkeley) 3/22/91";
#endif /* defined(unix) */
#include <sys/socket.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#ifdef CRAY
#include <fcntl.h>
#endif /* CRAY */
@@ -75,6 +76,10 @@ static char sccsid[] = "@(#)commands.c 5.5 (Berkeley) 3/22/91";
#endif /* CRAY */
#include <netinet/ip.h>
+extern void send_do();
+extern void send_dont();
+extern void send_will();
+extern void send_wont();
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 64
@@ -246,7 +251,7 @@ struct sendlist {
};
-extern int
+static int
send_esc P((void)),
send_help P((void)),
send_docmd P((char *)),
@@ -381,7 +386,6 @@ send_esc()
send_docmd(name)
char *name;
{
- void send_do();
return(send_tncmd(send_do, "do", name));
}
@@ -389,21 +393,18 @@ send_docmd(name)
send_dontcmd(name)
char *name;
{
- void send_dont();
return(send_tncmd(send_dont, "dont", name));
}
static int
send_willcmd(name)
char *name;
{
- void send_will();
return(send_tncmd(send_will, "will", name));
}
static int
send_wontcmd(name)
char *name;
{
- void send_wont();
return(send_tncmd(send_wont, "wont", name));
}
@@ -602,7 +603,7 @@ togxbinary(val)
}
-extern int togglehelp P((void));
+static int togglehelp P((void));
#if defined(AUTHENTICATE)
extern int auth_togdebug P((int));
#endif
@@ -1464,7 +1465,7 @@ struct slclist {
int arg;
};
-extern void slc_help();
+static void slc_help();
struct slclist SlcList[] = {
{ "export", "Use local special character definitions",
@@ -1547,7 +1548,8 @@ extern void
env_export P((unsigned char *)),
env_unexport P((unsigned char *)),
env_send P((unsigned char *)),
- env_list P((void)),
+ env_list P((void));
+static void
env_help P((void));
struct envlist EnvList[] = {
@@ -2388,7 +2390,7 @@ static char
envhelp[] = "change environment variables ('environ ?' for more)",
modestring[] = "try to enter line or character mode ('mode ?' for more)";
-extern int help();
+static int help();
static Command cmdtab[] = {
{ "close", closehelp, bye, 1 },
diff --git a/usr.bin/telnet/sys_bsd.c b/usr.bin/telnet/sys_bsd.c
index 52b28554d0c3..85d9540354b5 100644
--- a/usr.bin/telnet/sys_bsd.c
+++ b/usr.bin/telnet/sys_bsd.c
@@ -62,6 +62,10 @@ static char sccsid[] = "@(#)sys_bsd.c 5.2 (Berkeley) 3/1/91";
#else
#define SIG_FUNC_RET int
#endif
+#ifdef SIGINFO
+extern SIG_FUNC_RET ayt_status();
+#endif
+extern void intp(), sendbrk();
int
tout, /* Output file descriptor */
@@ -175,7 +179,7 @@ extern int kludgelinemode;
TerminalSpecialChars(c)
int c;
{
- void xmitAO(), xmitEL(), xmitEC(), intp(), sendbrk();
+ void xmitAO(), xmitEL(), xmitEC();
if (c == termIntChar) {
intp();
@@ -575,13 +579,15 @@ TerminalNewMode(f)
if (f & MODE_INBIN)
lmode |= LPASS8;
- else
+ else {
lmode &= ~LPASS8;
+ lmode |= olmode & LPASS8;
+ }
#else
if (f & MODE_INBIN)
tmp_tc.c_iflag &= ~ISTRIP;
else
- tmp_tc.c_iflag |= ISTRIP;
+ tmp_tc.c_iflag |= old_tc.c_iflag & ISTRIP;
if (f & MODE_OUTBIN) {
tmp_tc.c_cflag &= ~(CSIZE|PARENB);
tmp_tc.c_cflag |= CS8;
@@ -649,7 +655,6 @@ TerminalNewMode(f)
#endif
} else {
#ifdef SIGINFO
- SIG_FUNC_RET ayt_status();
(void) signal(SIGINFO, ayt_status);
#endif SIGINFO
@@ -696,6 +701,14 @@ TerminalNewMode(f)
# define B38400 B19200
#endif
+#ifndef B57600
+# define B57600 B38400
+#endif
+
+#ifndef B115200
+# define B115200 B57600
+#endif
+
/*
* This code assumes that the values B0, B50, B75...
* are in ascending order. They do not have to be
@@ -710,7 +723,8 @@ struct termspeeds {
{ 200, B200 }, { 300, B300 }, { 600, B600 },
{ 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 },
{ 4800, B4800 }, { 9600, B9600 }, { 19200, B19200 },
- { 38400, B38400 }, { -1, B38400 }
+ { 38400, B38400 }, { 57600, B57600 },{ 115200,B115200},
+ { -1, B115200 }
};
void
diff --git a/usr.bin/telnet/telnet.1 b/usr.bin/telnet/telnet.1
index 6dfcf2490bfc..84c55c529e66 100644
--- a/usr.bin/telnet/telnet.1
+++ b/usr.bin/telnet/telnet.1
@@ -328,12 +328,12 @@ When connecting to a non-standard port,
.Nm telnet
omits any automatic initiation of
.Tn TELNET
-options. When the port number is preceeded by a minus sign,
-the inital option negotiation is done.
+options. When the port number is preceded by a minus sign,
+the initial option negotiation is done.
After establishing a connection, the file
.Pa \&.telnetrc
in the
-users home directory is opened. Lines begining with a # are
+users home directory is opened. Lines beginning with a # are
comment lines. Blank lines are ignored. Lines that begin
without whitespace are the start of a machine entry. The
first thing on the line is the name of the machine that is
@@ -1018,9 +1018,9 @@ is enabled the output from the
.Ic netdata
command will be formated in a more user readable format.
Spaces are put between each character in the output, and the
-begining of any
+beginning of any
.Tn TELNET
-escape sequence is preceeded by a '*' to aid in locating them.
+escape sequence is preceded by a '*' to aid in locating them.
.It Ic \&?
Displays the legal
.Ic toggle
diff --git a/usr.bin/telnet/telnet.c b/usr.bin/telnet/telnet.c
index 46a980c37f06..386295261d4e 100644
--- a/usr.bin/telnet/telnet.c
+++ b/usr.bin/telnet/telnet.c
@@ -57,8 +57,6 @@ static char sccsid[] = "@(#)telnet.c 5.53 (Berkeley) 3/22/91";
#include "general.h"
-#define strip(x) ((x)&0x7f)
-
static unsigned char subbuffer[SUBBUFSIZE],
*subpointer, *subend; /* buffer for sub-options */
#define SB_CLEAR() subpointer = subbuffer;
@@ -1918,7 +1916,7 @@ telsnd()
break;
}
}
- c = *tbp++ & 0xff, sc = strip(c), tcc--; count++;
+ c = *tbp++, sc = c, tcc--; count++;
if (rlogin != _POSIX_VDISABLE) {
if (bol) {
bol = 0;
@@ -1959,7 +1957,7 @@ telsnd()
/*
* Double escape is a pass through of a single escape character.
*/
- if (tcc && strip(*tbp) == escape) {
+ if (tcc && *tbp == escape) {
tbp++;
tcc--;
count++;
@@ -1976,7 +1974,7 @@ telsnd()
bol = 0;
#ifdef KLUDGELINEMODE
if (kludgelinemode && (globalmode&MODE_EDIT) && (sc == echoc)) {
- if (tcc > 0 && strip(*tbp) == echoc) {
+ if (tcc > 0 && *tbp == echoc) {
tcc--; tbp++; count++;
} else {
dontlecho = !dontlecho;
diff --git a/usr.bin/telnet/tn3270.c b/usr.bin/telnet/tn3270.c
index 67aa569bdd24..a157ce44494a 100644
--- a/usr.bin/telnet/tn3270.c
+++ b/usr.bin/telnet/tn3270.c
@@ -286,6 +286,7 @@ StringToTerminal(s)
}
+#if 0
#if ((!defined(NOT43)) || defined(PUTCHAR))
/* _putchar - output a single character to the terminal. This name is so that
* curses(3x) can call us to send out data.
@@ -308,6 +309,7 @@ _putchar(c)
}
}
#endif /* ((!defined(NOT43)) || defined(PUTCHAR)) */
+#endif /* 0 */
void
SetIn3270()
diff --git a/usr.bin/telnet/utilities.c b/usr.bin/telnet/utilities.c
index 0a6a8828d4cd..7fb7594cd405 100644
--- a/usr.bin/telnet/utilities.c
+++ b/usr.bin/telnet/utilities.c
@@ -294,6 +294,7 @@ printsub(direction, pointer, length)
int length; /* length of suboption data */
{
register int i;
+ int tmpint;
char buf[512];
extern int want_status_response;
@@ -589,7 +590,8 @@ printsub(direction, pointer, length)
case LM_SLC:
fprintf(NetTrace, "SLC");
for (i = 2; i < length - 2; i += 3) {
- if (SLC_NAME_OK(pointer[i+SLC_FUNC]))
+ tmpint = pointer[i+SLC_FUNC];
+ if (SLC_NAME_OK(tmpint))
fprintf(NetTrace, " %s", SLC_NAME(pointer[i+SLC_FUNC]));
else
fprintf(NetTrace, " %d", pointer[i+SLC_FUNC]);
@@ -678,7 +680,8 @@ printsub(direction, pointer, length)
case WONT: cp = "WONT"; goto common2;
common2:
i++;
- if (TELOPT_OK((int)pointer[i]))
+ tmpint = (int) pointer[i];
+ if (TELOPT_OK(tmpint))
fprintf(NetTrace, " %s %s", cp, TELOPT(pointer[i]));
else
fprintf(NetTrace, " %s %d", cp, pointer[i]);
@@ -800,7 +803,8 @@ printsub(direction, pointer, length)
break;
default:
- if (TELOPT_OK(pointer[0]))
+ tmpint = pointer[0];
+ if (TELOPT_OK(tmpint))
fprintf(NetTrace, "%s (unknown)", TELOPT(pointer[0]));
else
fprintf(NetTrace, "%d (unknown)", pointer[i]);