+# $OpenBSD: Makefile,v 1.7 1996/03/27 19:32:19 niklas Exp $
+# $NetBSD: Makefile,v 1.62 1996/03/10 05:45:43 thorpej Exp $
# from: @(#)Makefile 5.8.1.1 (Berkeley) 5/8/91
-# $Id: Makefile,v 1.6 1996/02/03 12:11:34 dm Exp $
SUBDIR= apply apropos asa at banner basename bdes biff cal calendar cap_mkdb \
checknr chflags chpass cksum cmp col colcrt colrm column comm \
compress cpp crontab ctags cut dirname du \
- env error expand false file find finger fmt fold fpr from \
+ eject env error expand false file find finger fmt fold fpr from \
fsplit fstat ftp gencat getconf getopt head hexdump id indent \
- ipcrm ipcs join jot kdump ktrace lam last lastcomm leave less \
- lex locate \
- lock logger login logname look lorder m4 machine mail make man mesg \
- mkdep mkfifo mkstr modstat msgs netstat newsyslog nfsstat nice \
+ ipcrm ipcs join jot kdump ktrace lam last lastcomm leave less lex \
+ locate lock logger login logname look lorder m4 machine mail make man \
+ mesg mkdep mkfifo mkstr modstat msgs netstat newsyslog nfsstat nice \
nohup oldrdist pagesize passwd paste patch pr printenv printf quota \
rdist rdistd renice rev rlogin rpcgen rpcinfo rs \
rsh rup ruptime rusers rwall rwho \
which who whois window write \
xargs xinstall xlint xstr yacc yes ypcat ypmatch ypwhich
-# Don't use the standard tool chain on the alpha.
+# Don't use the standard tool chain on the alpha or mips.
.if (${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "mips")
SUBDIR+= ar gprof nm ranlib size strip
.endif
-/* $NetBSD: crc.c,v 1.5 1995/03/26 05:15:18 glass Exp $ */
+/* $OpenBSD: crc.c,v 1.2 1996/03/27 19:32:21 niklas Exp $ */
+/* $NetBSD: crc.c,v 1.7 1996/02/27 21:29:53 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993
#ifndef lint
#if 0
static char sccsid[] = "@(#)crc.c 8.1 (Berkeley) 6/17/93";
+static char rcsid[] = "$NetBSD: crc.c,v 1.7 1996/02/27 21:29:53 jtc Exp $";
#else
-static char rcsid[] = "$NetBSD: crc.c,v 1.5 1995/03/26 05:15:18 glass Exp $";
+static char rcsid[] = "$OpenBSD: crc.c,v 1.2 1996/03/27 19:32:21 niklas Exp $";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <unistd.h>
-static u_int32_t crctab[] = {
+#include "extern.h"
+
+static const u_int32_t crctab[] = {
0x0,
0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6,
-/* $NetBSD: sum1.c,v 1.4 1995/03/26 05:15:23 glass Exp $ */
+/* $OpenBSD: sum1.c,v 1.2 1996/03/27 19:32:22 niklas Exp $ */
+/* $NetBSD: sum1.c,v 1.5 1996/02/27 21:17:27 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
#ifndef lint
#if 0
static char sccsid[] = "@(#)sum1.c 8.1 (Berkeley) 6/6/93";
+static char rcsid[] = "$NetBSD: sum1.c,v 1.5 1996/02/27 21:17:27 cgd Exp $";
#else
-static char rcsid[] = "$NetBSD: sum1.c,v 1.4 1995/03/26 05:15:23 glass Exp $";
+static char rcsid[] = "$OpenBSD: sum1.c,v 1.2 1996/03/27 19:32:22 niklas Exp $";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <unistd.h>
+#include "extern.h"
+
int
csum1(fd, cval, clen)
register int fd;
- u_long *cval, *clen;
+ u_int32_t *cval, *clen;
{
- register u_long total;
+ register u_int32_t total;
register int nr;
register u_int crc;
register u_char *p;
-/* $NetBSD: sum2.c,v 1.4 1995/03/26 05:15:25 glass Exp $ */
+/* $OpenBSD: sum2.c,v 1.2 1996/03/27 19:32:23 niklas Exp $ */
+/* $NetBSD: sum2.c,v 1.5 1996/02/27 21:17:28 cgd Exp $ */
/*-
* Copyright (c) 1991, 1993
#ifndef lint
#if 0
static char sccsid[] = "@(#)sum2.c 8.1 (Berkeley) 6/6/93";
+static char rcsid[] = "$NetBSD: sum2.c,v 1.5 1996/02/27 21:17:28 cgd Exp $";
#else
-static char rcsid[] = "$NetBSD: sum2.c,v 1.4 1995/03/26 05:15:25 glass Exp $";
+static char rcsid[] = "$OpenBSD: sum2.c,v 1.2 1996/03/27 19:32:23 niklas Exp $";
#endif
#endif /* not lint */
#include <sys/types.h>
#include <unistd.h>
+#include "extern.h"
+
int
csum2(fd, cval, clen)
register int fd;
- u_long *cval, *clen;
+ u_int32_t *cval, *clen;
{
- register u_long crc, total;
+ register u_int32_t crc, total;
register int nr;
register u_char *p;
u_char buf[8192];
+/* $OpenBSD: fstat.c,v 1.2 1996/03/27 19:32:24 niklas Exp $ */
+
/*-
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
#ifndef lint
/*static char sccsid[] = "from: @(#)fstat.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: fstat.c,v 1.1.1.1 1995/10/18 08:45:16 deraadt Exp $";
+static char *rcsid = "$OpenBSD: fstat.c,v 1.2 1996/03/27 19:32:24 niklas Exp $";
#endif /* not lint */
#include <sys/param.h>
#undef _KERNEL
#define NFS
#include <sys/mount.h>
-#include <nfs/nfsv2.h>
+#include <nfs/nfsproto.h>
#include <nfs/rpcv2.h>
#include <nfs/nfs.h>
#include <nfs/nfsnode.h>
#include <ctype.h>
#include <errno.h>
#include <kvm.h>
+#include <limits.h>
#include <nlist.h>
#include <paths.h>
#include <pwd.h>
struct kinfo_proc *p, *plast;
int arg, ch, what;
char *memf, *nlistf;
+ char buf[_POSIX2_LINE_MAX];
int cnt;
arg = 0;
if (nlistf != NULL || memf != NULL)
setgid(getgid());
- if ((kd = kvm_open(nlistf, memf, NULL, O_RDONLY, NULL)) == NULL) {
- fprintf(stderr, "fstat: %s\n", kvm_geterr(kd));
+ if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) {
+ fprintf(stderr, "fstat: %s\n", buf);
exit(1);
}
#ifdef notdef
+# $OpenBSD: Makefile,v 1.2 1996/03/27 19:32:29 niklas Exp $
# from: @(#)Makefile 8.2 (Berkeley) 1/25/94
-# $Id: Makefile,v 1.1.1.1 1995/10/18 08:45:37 deraadt Exp $
PROG= mail
-CFLAGS+=-DUSE_OLD_TTY
SRCS= version.c aux.c cmd1.c cmd2.c cmd3.c cmdtab.c collect.c edit.c fio.c \
getname.c head.c v7.local.c lex.c list.c main.c names.c popen.c \
quit.c send.c strings.c temp.c tty.c vars.c
+/* $OpenBSD: cmd1.c,v 1.2 1996/03/27 19:32:30 niklas Exp $ */
+
/*-
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
#ifndef lint
static char sccsid[] = "from: @(#)cmd1.c 8.1 (Berkeley) 6/6/93";
-static char rcsid[] = "$Id: cmd1.c,v 1.1.1.1 1995/10/18 08:45:38 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: cmd1.c,v 1.2 1996/03/27 19:32:30 niklas Exp $";
#endif /* not lint */
#include "rcv.h"
int
pcmdlist()
{
- register struct cmd *cp;
+ extern const struct cmd cmdtab[];
+ register const struct cmd *cp;
register int cc;
- extern struct cmd cmdtab[];
printf("Commands are:\n");
for (cc = 0, cp = cmdtab; cp->c_name != NULL; cp++) {
+/* $OpenBSD: cmdtab.c,v 1.2 1996/03/27 19:32:31 niklas Exp $ */
+
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
#ifndef lint
static char sccsid[] = "from: @(#)cmdtab.c 8.1 (Berkeley) 6/6/93";
-static char rcsid[] = "$Id: cmdtab.c,v 1.1.1.1 1995/10/18 08:45:38 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: cmdtab.c,v 1.2 1996/03/27 19:32:31 niklas Exp $";
#endif /* not lint */
#include "def.h"
* Define all of the command names and bindings.
*/
-struct cmd cmdtab[] = {
+const struct cmd cmdtab[] = {
"next", next, NDMLIST, 0, MMNDEL,
"alias", group, M|RAWLIST, 0, 1000,
"print", type, MSGLIST, 0, MMNDEL,
+/* $OpenBSD: extern.h,v 1.2 1996/03/27 19:32:32 niklas Exp $ */
+
/*-
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
int isign __P((char *, struct ignoretab []));
int isprefix __P((char *, char *));
void istrcpy __P((char *, char *));
-struct cmd *
+const struct cmd *
lex __P((char []));
void load __P((char *));
struct var *
+/* $OpenBSD: lex.c,v 1.2 1996/03/27 19:32:33 niklas Exp $ */
+
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
#ifndef lint
static char sccsid[] = "from: @(#)lex.c 8.1 (Berkeley) 6/6/93";
-static char rcsid[] = "$Id: lex.c,v 1.1.1.1 1995/10/18 08:45:39 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: lex.c,v 1.2 1996/03/27 19:32:33 niklas Exp $";
#endif /* not lint */
#include "rcv.h"
{
char word[LINESIZE];
char *arglist[MAXARGC];
- struct cmd *com;
+ const struct cmd *com;
register char *cp, *cp2;
register int c;
int muvec[2];
* to the passed command "word"
*/
-struct cmd *
+const struct cmd *
lex(word)
char word[];
{
- register struct cmd *cp;
- extern struct cmd cmdtab[];
+ extern const struct cmd cmdtab[];
+ register const struct cmd *cp;
for (cp = &cmdtab[0]; cp->c_name != NOSTR; cp++)
if (isprefix(word, cp->c_name))
-# $NetBSD: Makefile,v 1.9 1996/02/04 22:20:27 christos Exp $
+# $OpenBSD: Makefile,v 1.3 1996/03/27 19:32:34 niklas Exp $
+# $NetBSD: Makefile,v 1.10 1996/03/11 13:45:31 christos Exp $
# @(#)Makefile 5.2 (Berkeley) 12/28/90
PROG= make
CFLAGS+= -I${.CURDIR} -DPOSIX -DSYSVINCLUDE
SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
- make.c parse.c str.c suff.c targ.c var.c
+ make.c parse.c str.c suff.c targ.c var.c util.c
SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
-.\" $NetBSD: tutorial.ms,v 1.2 1995/06/14 15:20:31 christos Exp $
+.\" $OpenBSD: tutorial.ms,v 1.3 1996/03/27 19:32:44 niklas Exp $
+.\" $NetBSD: tutorial.ms,v 1.3 1996/03/06 00:15:31 christos Exp $
.\" Copyright (c) 1988, 1989 by Adam de Boor
.\" Copyright (c) 1989 by Berkeley Softworks
.\" Copyright (c) 1988, 1989, 1993
-/* $NetBSD: arch.c,v 1.13 1996/02/04 22:20:34 christos Exp $ */
+/* $OpenBSD: arch.c,v 1.4 1996/03/27 19:32:35 niklas Exp $ */
+/* $NetBSD: arch.c,v 1.14 1996/03/12 18:04:27 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
#ifndef lint
#if 0
static char sccsid[] = "@(#)arch.c 5.7 (Berkeley) 12/28/90";
+static char rcsid[] = "$NetBSD: arch.c,v 1.14 1996/03/12 18:04:27 christos Exp $";
#else
-static char rcsid[] = "$NetBSD: arch.c,v 1.13 1996/02/04 22:20:34 christos Exp $";
+static char rcsid[] = "$OpenBSD: arch.c,v 1.4 1996/03/27 19:32:35 niklas Exp $";
#endif
#endif /* not lint */
oodate = TRUE;
}
#else
- oodata = FALSE;
+ oodate = FALSE;
#endif
}
return (oodate);
-/* $NetBSD: main.c,v 1.24 1996/02/04 22:20:49 christos Exp $ */
+/* $OpenBSD: main.c,v 1.6 1996/03/27 19:32:36 niklas Exp $ */
+/* $NetBSD: main.c,v 1.26 1996/03/11 13:45:33 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 5.25 (Berkeley) 4/1/91";
+static char rcsid[] = "$NetBSD: main.c,v 1.26 1996/03/11 13:45:33 christos Exp $";
#else
-static char rcsid[] = "$NetBSD: main.c,v 1.24 1996/02/04 22:20:49 christos Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.6 1996/03/27 19:32:36 niklas Exp $";
#endif
#endif /* not lint */
#include <sys/signal.h>
#include <sys/stat.h>
#include <sys/utsname.h>
-#include <sys/resource.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
* MACHINE_ARCH is always known at compile time.
*/
if (!machine) {
+#ifndef MACHINE
if (uname(&utsname) == -1) {
perror("make: uname");
exit(2);
}
machine = utsname.machine;
+#else
+ machine = MACHINE;
+#endif
}
/*
-.\" $NetBSD: make.1,v 1.12 1995/12/16 05:03:09 christos Exp $
+.\" $OpenBSD: make.1,v 1.6 1996/03/27 19:32:37 niklas Exp $
+.\" $NetBSD: make.1,v 1.14 1996/03/15 21:52:32 christos Exp $
.\" Copyright (c) 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
found in the current directory.
If no sources are specified, any previously specified directories are
deleted.
+.It Ic .PHONY
+Apply the
+.Ic .PHONY
+attribute to any specified sources. Targets with this attribute are always
+considered to be out of date.
.It Ic .PRECIOUS
Apply the
.Ic .PRECIOUS
-/* $NetBSD: make.c,v 1.7 1995/06/14 15:19:40 christos Exp $ */
+/* $OpenBSD: make.c,v 1.2 1996/03/27 19:32:38 niklas Exp $ */
+/* $NetBSD: make.c,v 1.8 1996/03/15 21:52:37 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 5.3 (Berkeley) 6/1/90";
+static char rcsid[] = "$NetBSD: make.c,v 1.8 1996/03/15 21:52:37 christos Exp $";
#else
-static char rcsid[] = "$NetBSD: make.c,v 1.7 1995/06/14 15:19:40 christos Exp $";
+static char rcsid[] = "$OpenBSD: make.c,v 1.2 1996/03/27 19:32:38 niklas Exp $";
#endif
#endif /* not lint */
printf(".JOIN node...");
}
oodate = gn->childMade;
- } else if (gn->type & (OP_FORCE|OP_EXEC)) {
+ } else if (gn->type & (OP_FORCE|OP_EXEC|OP_PHONY)) {
/*
* A node which is the object of the force (!) operator or which has
* the .EXEC attribute is always considered out-of-date.
if (DEBUG(MAKE)) {
if (gn->type & OP_FORCE) {
printf("! operator...");
+ } else if (gn->type & OP_PHONY) {
+ printf(".PHONY node...");
} else {
printf(".EXEC node...");
}
-/* $NetBSD: make.h,v 1.8 1996/02/04 22:20:53 christos Exp $ */
+/* $OpenBSD: make.h,v 1.5 1996/03/27 19:32:39 niklas Exp $ */
+/* $NetBSD: make.h,v 1.9 1996/03/06 00:15:21 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
-/* $NetBSD: parse.c,v 1.19 1996/02/07 23:04:04 thorpej Exp $ */
+/* $OpenBSD: parse.c,v 1.7 1996/03/27 19:32:41 niklas Exp $ */
+/* $NetBSD: parse.c,v 1.22 1996/03/15 21:52:41 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
#if 0
static char sccsid[] = "@(#)parse.c 5.18 (Berkeley) 2/19/91";
#else
-static char rcsid[] = "$NetBSD: parse.c,v 1.19 1996/02/07 23:04:04 thorpej Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.22 1996/03/15 21:52:41 christos Exp $";
#endif
#endif /* not lint */
Order, /* .ORDER */
Parallel, /* .PARALLEL */
ExPath, /* .PATH */
+ Phony, /* .PHONY */
Precious, /* .PRECIOUS */
ExShell, /* .SHELL */
Silent, /* .SILENT */
{ ".ORDER", Order, 0 },
{ ".PARALLEL", Parallel, 0 },
{ ".PATH", ExPath, 0 },
+{ ".PHONY", Phony, OP_PHONY },
{ ".PRECIOUS", Precious, OP_PRECIOUS },
{ ".RECURSIVE", Attribute, OP_MAKE },
{ ".SHELL", ExShell, 0 },
* life easier later, when we'll
* use Make_HandleUse to actually
* apply the .DEFAULT commands.
+ * .PHONY The list of targets
* .BEGIN
* .END
* .INTERRUPT Are not to be considered the
-/* $NetBSD: pathnames.h,v 1.3 1995/06/14 15:19:52 christos Exp $ */
+/* $OpenBSD: pathnames.h,v 1.3 1996/03/27 19:32:42 niklas Exp $ */
+/* $NetBSD: pathnames.h,v 1.4 1996/03/06 00:15:26 christos Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
* SUCH DAMAGE.
*
* from: @(#)pathnames.h 5.2 (Berkeley) 6/1/90
- * $Id: pathnames.h,v 1.2 1996/02/23 18:33:00 niklas Exp $
*/
#define _PATH_OBJDIR "obj"
+# $OpenBSD: Makefile,v 1.2 1996/03/27 19:32:47 niklas Exp $
+# $NetBSD: Makefile,v 1.5 1996/03/03 17:21:25 thorpej Exp $
# from: @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $Id: Makefile,v 1.1.1.1 1995/10/18 08:45:52 deraadt Exp $
PROG= nfsstat
CFLAGS+=-DNFS
+.\" $OpenBSD: nfsstat.1,v 1.2 1996/03/27 19:32:48 niklas Exp $
+.\" $NetBSD: nfsstat.1,v 1.8 1996/03/03 17:21:28 thorpej Exp $
+.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" SUCH DAMAGE.
.\"
.\" from: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93
-.\" $Id: nfsstat.1,v 1.1.1.1 1995/10/18 08:45:52 deraadt Exp $
.\"
.Dd June 6, 1993
.Dt NFSSTAT 1
+/* $OpenBSD: nfsstat.c,v 1.2 1996/03/27 19:32:49 niklas Exp $ */
+/* $NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $ */
+
/*
* Copyright (c) 1983, 1989, 1993
* The Regents of the University of California. All rights reserved.
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)nfsstat.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: nfsstat.c,v 1.1.1.1 1995/10/18 08:45:52 deraadt Exp $";
+#if 0
+static char sccsid[] = "from: @(#)nfsstat.c 8.1 (Berkeley) 6/6/93";
+static char *rcsid = "$NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $";
+#else
+static char *rcsid = "$OpenBSD: nfsstat.c,v 1.2 1996/03/27 19:32:49 niklas Exp $";
+#endif
#endif /* not lint */
#include <sys/param.h>
-#if BSD >= 199103
-#define NEWVM
-#endif
-#ifndef NEWVM
-#include <sys/vmmac.h>
-#include <sys/ucred.h>
-#include <machine/pte.h>
-#endif
#include <sys/mount.h>
-#include <nfs/nfsv2.h>
+#include <sys/sysctl.h>
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
#include <nfs/nfs.h>
#include <signal.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <paths.h>
+#include <err.h>
struct nlist nl[] = {
#define N_NFSSTAT 0
nfsstats.rpccnt[NFSPROC_REMOVE]);
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Rename", "Link", "Symlink", "Mkdir", "Rmdir",
- "Readdir", "Statfs", "RdirLook");
+ "Readdir", "RdirPlus", "Access");
printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
nfsstats.rpccnt[NFSPROC_RENAME],
nfsstats.rpccnt[NFSPROC_LINK],
nfsstats.rpccnt[NFSPROC_MKDIR],
nfsstats.rpccnt[NFSPROC_RMDIR],
nfsstats.rpccnt[NFSPROC_READDIR],
- nfsstats.rpccnt[NFSPROC_STATFS],
- nfsstats.rpccnt[NQNFSPROC_READDIRLOOK]);
- printf("%9.9s %9.9s %9.9s\n",
+ nfsstats.rpccnt[NFSPROC_READDIRPLUS],
+ nfsstats.rpccnt[NFSPROC_ACCESS]);
+ printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
+ "Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit",
"GLease", "Vacate", "Evict");
- printf("%9d %9d %9d\n",
+ printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
+ nfsstats.rpccnt[NFSPROC_MKNOD],
+ nfsstats.rpccnt[NFSPROC_FSSTAT],
+ nfsstats.rpccnt[NFSPROC_FSINFO],
+ nfsstats.rpccnt[NFSPROC_PATHCONF],
+ nfsstats.rpccnt[NFSPROC_COMMIT],
nfsstats.rpccnt[NQNFSPROC_GETLEASE],
nfsstats.rpccnt[NQNFSPROC_VACATED],
nfsstats.rpccnt[NQNFSPROC_EVICTED]);
nfsstats.srvrpccnt[NFSPROC_REMOVE]);
printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
"Rename", "Link", "Symlink", "Mkdir", "Rmdir",
- "Readdir", "Statfs", "RdirLook");
+ "Readdir", "RdirPlus", "Access");
printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
nfsstats.srvrpccnt[NFSPROC_RENAME],
nfsstats.srvrpccnt[NFSPROC_LINK],
nfsstats.srvrpccnt[NFSPROC_MKDIR],
nfsstats.srvrpccnt[NFSPROC_RMDIR],
nfsstats.srvrpccnt[NFSPROC_READDIR],
- nfsstats.srvrpccnt[NFSPROC_STATFS],
- nfsstats.srvrpccnt[NQNFSPROC_READDIRLOOK]);
- printf("%9.9s %9.9s %9.9s\n",
+ nfsstats.srvrpccnt[NFSPROC_READDIRPLUS],
+ nfsstats.srvrpccnt[NFSPROC_ACCESS]);
+ printf("%9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s\n",
+ "Mknod", "Fsstat", "Fsinfo", "PathConf", "Commit",
"GLease", "Vacate", "Evict");
- printf("%9d %9d %9d\n",
+ printf("%9d %9d %9d %9d %9d %9d %9d %9d\n",
+ nfsstats.srvrpccnt[NFSPROC_MKNOD],
+ nfsstats.srvrpccnt[NFSPROC_FSSTAT],
+ nfsstats.srvrpccnt[NFSPROC_FSINFO],
+ nfsstats.srvrpccnt[NFSPROC_PATHCONF],
+ nfsstats.srvrpccnt[NFSPROC_COMMIT],
nfsstats.srvrpccnt[NQNFSPROC_GETLEASE],
nfsstats.srvrpccnt[NQNFSPROC_VACATED],
nfsstats.srvrpccnt[NQNFSPROC_EVICTED]);
nfsstats.srvnqnfs_leases,
nfsstats.srvnqnfs_maxleases,
nfsstats.srvnqnfs_getleases);
+ printf("Server Write Gathering:\n");
+ printf("%9.9s %9.9s %9.9s\n",
+ "WriteOps", "WriteRPC", "Opsaved");
+ printf("%9d %9d %9d\n",
+ nfsstats.srvvop_writes,
+ nfsstats.srvrpccnt[NFSPROC_WRITE],
+ nfsstats.srvrpccnt[NFSPROC_WRITE] - nfsstats.srvvop_writes);
}
u_char signalled; /* set if alarm goes off "early" */
exit(1);
}
printf("Client: %8d %8d %8d %8d %8d %8d %8d %8d\n",
- nfsstats.rpccnt[1]-lastst.rpccnt[1],
- nfsstats.rpccnt[4]-lastst.rpccnt[4],
- nfsstats.rpccnt[5]-lastst.rpccnt[5],
- nfsstats.rpccnt[6]-lastst.rpccnt[6],
- nfsstats.rpccnt[8]-lastst.rpccnt[8],
- nfsstats.rpccnt[11]-lastst.rpccnt[11],
- nfsstats.rpccnt[12]-lastst.rpccnt[12],
- nfsstats.rpccnt[16]-lastst.rpccnt[16]);
+ nfsstats.rpccnt[NFSPROC_GETATTR]-lastst.rpccnt[NFSPROC_GETATTR],
+ nfsstats.rpccnt[NFSPROC_LOOKUP]-lastst.rpccnt[NFSPROC_LOOKUP],
+ nfsstats.rpccnt[NFSPROC_READLINK]-lastst.rpccnt[NFSPROC_READLINK],
+ nfsstats.rpccnt[NFSPROC_READ]-lastst.rpccnt[NFSPROC_READ],
+ nfsstats.rpccnt[NFSPROC_WRITE]-lastst.rpccnt[NFSPROC_WRITE],
+ nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME],
+ nfsstats.rpccnt[NFSPROC_ACCESS]-lastst.rpccnt[NFSPROC_ACCESS],
+ (nfsstats.rpccnt[NFSPROC_READDIR]-lastst.rpccnt[NFSPROC_READDIR])
+ +(nfsstats.rpccnt[NFSPROC_READDIRPLUS]-lastst.rpccnt[NFSPROC_READDIRPLUS]));
printf("Server: %8d %8d %8d %8d %8d %8d %8d %8d\n",
- nfsstats.srvrpccnt[1]-lastst.srvrpccnt[1],
- nfsstats.srvrpccnt[4]-lastst.srvrpccnt[4],
- nfsstats.srvrpccnt[5]-lastst.srvrpccnt[5],
- nfsstats.srvrpccnt[6]-lastst.srvrpccnt[6],
- nfsstats.srvrpccnt[8]-lastst.srvrpccnt[8],
- nfsstats.srvrpccnt[11]-lastst.srvrpccnt[11],
- nfsstats.srvrpccnt[12]-lastst.srvrpccnt[12],
- nfsstats.srvrpccnt[16]-lastst.srvrpccnt[16]);
+ nfsstats.srvrpccnt[NFSPROC_GETATTR]-lastst.srvrpccnt[NFSPROC_GETATTR],
+ nfsstats.srvrpccnt[NFSPROC_LOOKUP]-lastst.srvrpccnt[NFSPROC_LOOKUP],
+ nfsstats.srvrpccnt[NFSPROC_READLINK]-lastst.srvrpccnt[NFSPROC_READLINK],
+ nfsstats.srvrpccnt[NFSPROC_READ]-lastst.srvrpccnt[NFSPROC_READ],
+ nfsstats.srvrpccnt[NFSPROC_WRITE]-lastst.srvrpccnt[NFSPROC_WRITE],
+ nfsstats.srvrpccnt[NFSPROC_RENAME]-lastst.srvrpccnt[NFSPROC_RENAME],
+ nfsstats.srvrpccnt[NFSPROC_ACCESS]-lastst.srvrpccnt[NFSPROC_ACCESS],
+ (nfsstats.srvrpccnt[NFSPROC_READDIR]-lastst.srvrpccnt[NFSPROC_READDIR])
+ +(nfsstats.srvrpccnt[NFSPROC_READDIRPLUS]-lastst.srvrpccnt[NFSPROC_READDIRPLUS]));
lastst = nfsstats;
fflush(stdout);
oldmask = sigblock(sigmask(SIGALRM));
{
printf(" %8.8s %8.8s %8.8s %8.8s %8.8s %8.8s %8.8s %8.8s\n",
"Getattr", "Lookup", "Readlink", "Read", "Write", "Rename",
- "Link", "Readdir");
+ "Access", "Readdir");
fflush(stdout);
}
-/* $NetBSD: rpc_main.c,v 1.8 1995/08/29 23:05:53 cgd Exp $ */
+/* $OpenBSD: rpc_main.c,v 1.2 1996/03/27 19:32:51 niklas Exp $ */
+/* $NetBSD: rpc_main.c,v 1.9 1996/02/19 11:12:43 pk Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
#ifndef lint
static char sccsid[] = "@(#)rpc_main.c 1.30 89/03/30 (C) 1987 SMI";
-static char cvsid[] = "$Id: rpc_main.c,v 1.1.1.1 1995/10/18 08:46:01 deraadt Exp $";
+static char cvsid[] = "$OpenBSD: rpc_main.c,v 1.2 1996/03/27 19:32:51 niklas Exp $";
#endif
/*
* rpc_main.c, Top level of the RPC protocol compiler.
*/
+#define RPCGEN_VERSION "199506" /* This program's version (year & month) */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
f_print(fout,"#ifndef _%s\n#define _%s\n\n", guard,
guard);
+ f_print(fout, "#define RPCGEN_VERSION\t%s\n\n", RPCGEN_VERSION);
f_print(fout, "#include <rpc/rpc.h>\n\n");
tell = ftell(fout);
-/* $NetBSD: disks.c,v 1.2 1995/01/20 08:51:53 jtc Exp $ */
+/* $OpenBSD: disks.c,v 1.2 1996/03/27 19:32:52 niklas Exp $ */
+/* $NetBSD: disks.c,v 1.3 1996/03/15 22:19:23 ragge Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
#ifndef lint
#if 0
static char sccsid[] = "@(#)disks.c 8.1 (Berkeley) 6/6/93";
+static char rcsid[] = "$NetBSD: disks.c,v 1.3 1996/03/15 22:19:23 ragge Exp $";
#endif
-static char rcsid[] = "$NetBSD: disks.c,v 1.2 1995/01/20 08:51:53 jtc Exp $";
+static char rcsid[] = "$OpenBSD: disks.c,v 1.2 1996/03/27 19:32:52 niklas Exp $";
#endif /* not lint */
#include <sys/types.h>
{ "_dk_ndrive" },
#define X_DK_WPMS 1
{ "_dk_wpms" },
-#ifdef vax
-#define X_MBDINIT (X_DK_WPMS+1)
- { "_mbdinit" },
-#define X_UBDINIT (X_DK_WPMS+2)
- { "_ubdinit" },
-#endif
#ifdef sun
#define X_MBDINIT (X_DK_WPMS+1)
{ "_mbdinit" },
-/* $NetBSD: iostat.c,v 1.3 1995/05/17 15:51:47 mycroft Exp $ */
+/* $OpenBSD: iostat.c,v 1.2 1996/03/27 19:32:54 niklas Exp $ */
+/* $NetBSD: iostat.c,v 1.4 1996/03/15 22:19:25 ragge Exp $ */
/*
* Copyright (c) 1980, 1992, 1993
#ifndef lint
#if 0
static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93";
+static char rcsid[] = "$NetBSD: iostat.c,v 1.4 1996/03/15 22:19:25 ragge Exp $";
#endif
-static char rcsid[] = "$NetBSD: iostat.c,v 1.3 1995/05/17 15:51:47 mycroft Exp $";
+static char rcsid[] = "$OpenBSD: iostat.c,v 1.2 1996/03/27 19:32:54 niklas Exp $";
#endif not lint
#include <sys/param.h>
{ "_dk_seek" },
#define X_CP_TIME 5
{ "_cp_time" },
-#ifdef vax
-#define X_MBDINIT (X_CP_TIME+1)
- { "_mbdinit" },
-#define X_UBDINIT (X_CP_TIME+2)
- { "_ubdinit" },
-#endif
#ifdef tahoe
#define X_VBDINIT (X_CP_TIME+1)
{ "_vbdinit" },
+# $OpenBSD: Makefile,v 1.2 1996/03/27 19:32:55 niklas Exp $
+# $NetBSD: Makefile,v 1.6 1996/02/28 21:03:49 thorpej Exp $
#
# Copyright (c) 1990 The Regents of the University of California.
# All rights reserved.
# SUCH DAMAGE.
#
# from: @(#)Makefile 8.1 (Berkeley) 6/6/93
-# $Id: Makefile,v 1.1.1.1 1995/10/18 08:46:13 deraadt Exp $
#
PROG= telnet
CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -Dunix
CFLAGS+=-DENV_HACK
CFLAGS+=-I${.CURDIR}/../../lib
-
-LDADD= -ltermcap -ltelnet
+LDADD+= -ltermcap -ltelnet
DPADD= ${LIBTERMCAP}
+
SRCS= authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \
terminal.c tn3270.c utilities.c
-
+ $OpenBSD: README,v 1.2 1996/03/27 19:32:56 niklas Exp $
This is a distribution of both client and server telnet. These programs
have been compiled on:
telnet telnetd
- BSD 4.3 Reno X X
- UNICOS 5.1 X X
- UNICOS 6.0 X X
- UNICOS 6.1 X X
- UNICOS 7.0 X X
- SunOs 3.5 X X (no linemode in server)
- SunOs 4.1 X X (no linemode in server)
- DYNIX V3.0.17.9 X X (no linemode in server)
- Ultrix 3.1 X X (no linemode in server)
- Ultrix 4.0 X X (no linemode in server)
+ 4.4 BSD-Lite x x
+ 4.3 BSD Reno X X
+ UNICOS 9.1 X X
+ UNICOS 9.0 X X
+ UNICOS 8.0 X X
+ BSDI 2.0 X X
+ Solaris 2.4 x x (no linemode in server)
+ SunOs 4.1.4 X X (no linemode in server)
+ Ultrix 4.3 X X (no linemode in server)
+ Ultrix 4.1 X X (no linemode in server)
In addition, previous versions have been compiled on the following
machines, but were not available for testing this version.
telnet telnetd
+ Next1.0 X X
+ UNICOS 8.3 X X
+ UNICOS 7.C X X
+ UNICOS 7.0 X X
SunOs 4.0.3c X X (no linemode in server)
- BSD 4.3 X X (no linemode in server)
+ 4.3 BSD X X (no linemode in server)
DYNIX V3.0.12 X X (no linemode in server)
+ Ultrix 3.1 X X (no linemode in server)
+ Ultrix 4.0 X X (no linemode in server)
+ SunOs 3.5 X X (no linemode in server)
+ SunOs 4.1.3 X X (no linemode in server)
+ Solaris 2.2 x x (no linemode in server)
+ Solaris 2.3 x x (no linemode in server)
+ BSDI 1.0 X X
+ BSDI 1.1 X X
+ DYNIX V3.0.17.9 X X (no linemode in server)
+ HP-UX 8.0 x x (no linemode in server)
+
+This code should work, but there are no guarantees.
+
+Oct 23, 1995
+
+This is a bugfix release.
+
+ The change in the previous release from using makeutx() to
+ pututxline() caused problems on SunOS/Solaris. It has been
+ changed back to using makeutx(). Symptoms include users
+ getting error messages when logging in about not being able
+ to open the tty.
+
+ Using memmove() instead of memcpy() caused problems under
+ SunOS 4.x, since it doesn't have memmove(). Config.generic
+ has been modified to include mem.o for SunOS 4.x.
+
+ Some new code was added to telnetd to do some enviornment
+ variable cleanup before execing login. Thanks to Sam Hartman
+ at MIT for pointing this out.
+
+ A couple of other minor bugfixes.
+
+May 30, 1995
+
+This release represents what is on the 4.4BSD-Lite2 release, which
+should be the final BSD release. I will continue to support of
+telnet, The code (without encryption) is available via anonymous ftp
+from ftp.cray.com, in src/telnet/telnet.YY.MM.DD.NE.tar.Z, where
+YY.MM.DD is replaced with the year, month and day of the release.
+If you can't find it at one of these places, at some point in the
+near future information about the latest releases should be available
+from ftp.borman.com.
+
+In addition, the version with the encryption code is available via
+ftp from net-dist.mit.edu, in the directory /pub/telnet. There
+is a README file there that gives further information on how
+to get the distribution.
+
+Questions, comments, bug reports and bug fixes can be sent to
+one of these addresses:
+ dab@borman.com
+ dab@cray.com
+ dab@bsdi.com
+
+This release is mainly bug fixes and code cleanup.
+
+ Replace all calls to bcopy()/bzero() with calls to
+ memmove()/memset() and all calls to index()/rindex()
+ with calls to strchr()/strrchr().
+
+ Add some missing diagnostics for option tracing
+ to telnetd.
+
+ Add support for BSDI 2.0 and Solaris 2.4.
+
+ Add support for UNICOS 8.0
+
+ Get rid of expanded tabs and trailing white spaces.
+
+ From Paul Vixie:
+ Fix for telnet going into an endless spin
+ when the session dies abnormally.
+
+ From Jef Poskanzer:
+ Changes to allow telnet to compile
+ under SunOS 3.5.
+
+ From Philip Guenther:
+ makeutx() doesn't expand utmpx,
+ use pututxline() instead.
+
+ From Chris Torek:
+ Add a sleep(1) before execing login
+ to avoid race condition that can eat
+ up the login prompt.
+ Use terminal speed directly if it is
+ not an encoded value.
+
+ From Steve Parker:
+ Fix to realloc() call. Fix for execing
+ login on solaris with no user name.
+
+January 19, 1994
+
+This is a list of some of the changes since the last tar release
+of telnet/telnetd. There are probably other changes that aren't
+listed here, but this should hit a lot of the main ones.
+
+ General:
+ Changed #define for AUTHENTICATE to AUTHENTICATION
+ Changed #define for ENCRYPT to ENCRYPTION
+ Changed #define for DES_ENCRYPT to DES_ENCRYPTION
+
+ Added support for SPX authentication: -DSPX
+
+ Added support for Kerberos Version 5 authentication: -DKRB5
+
+ Added support for ANSI C function prototypes
+
+ Added support for the NEW-ENVIRON option (RFC-1572)
+ including support for USERVAR.
+
+ Made support for the old Environment Option (RFC-1408)
+ conditional on -DOLD_ENVIRON
+
+ Added #define ENV_HACK - support for RFC 1571
+
+ The encryption code is removed from the public distributions.
+ Domestic 4.4 BSD distributions contain the encryption code.
+
+ ENV_HACK: Code to deal with systems that only implement
+ the old ENVIRON option, and have reversed definitions
+ of ENV_VAR and ENV_VAL. Also fixes ENV processing in
+ client to handle things besides just the default set...
+
+ NO_BSD_SETJMP: UNICOS configuration for
+ UNICOS 6.1/6.0/5.1/5.0 systems.
+
+ STREAMSPTY: Use /dev/ptmx to get a clean pty. This
+ is for SVr4 derivatives (Like Solaris)
+
+ UTMPX: For systems that have /etc/utmpx. This is for
+ SVr4 derivatives (Like Solaris)
+
+ Definitions for BSDI 1.0
+
+ Definitions for 4.3 Reno and 4.4 BSD.
+
+ Definitions for UNICOS 8.0 and UNICOS 7.C
+
+ Definitions for Solaris 2.0
+
+ Definitions for HP-UX 8.0
+
+ Latest Copyright notices from Berkeley.
+
+ FLOW-CONTROL: support for RFC-XXXx
+
+
+ Client Specific:
+
+ Fix the "send" command to not send garbage...
+
+ Fix status message for "skiprc"
+
+ Make sure to send NAWS after telnet has been suspended
+ or an external command has been run, if the window size
+ has changed.
+
+ sysV88 support.
+
+ Server Specific:
+
+ Support flowcontrol option in non-linemode servers.
+
+ -k Server supports Kludge Linemode, but will default to
+ either single character mode or real Linemode support.
+ The user will have to explicitly ask to switch into
+ kludge linemode. ("stty extproc", or escape back to
+ to telnet and say "mode line".)
+
+ -u Specify the length of the hostname field in the utmp
+ file. Hostname longer than this length will be put
+ into the utmp file in dotted decimal notation, rather
+ than putting in a truncated hostname.
+
+ -U Registered hosts only. If a reverse hostname lookup
+ fails, the connection will be refused.
+
+ -f/-F
+ Allows forwarding of credentials for KRB5.
Februrary 22, 1991:
AUTHENTICATION option is fairly well defined, and
an option number has been assigned to it. The
ENCRYPTION option is still in a state of flux; an
- option number has NOT been assigned to it yet.
- The code is provided in this release for experimental
- and testing purposes.
+ option number has been assigned to, but it is still
+ subject to change. The code is provided in this release
+ for experimental and testing purposes.
The telnet "send" command can now be used to send
do/dont/will/wont commands, with any telnet option
A new telnet command, "auth" has been added (if
AUTHENTICATE is defined). It has four sub-commands,
- "status", "debug", "disable", "enable" and "help".
+ "status", "disable", "enable" and "help".
A new telnet command, "encrypt" has been added (if
ENCRYPT is defined). It has many sub-commands:
"enable", "type", "start", "stop", "input",
- "-input", "output", "-output", "status", "auto",
- "verbose", "debug", and "help".
+ "-input", "output", "-output", "status", and "help".
+
+ The LOGOUT option is now supported by both telnet
+ and telnetd, a new command, "logout", was added
+ to support this.
+
+ Several new toggle options were added:
+ "autoencrypt", "autodecrypt", "autologin", "authdebug",
+ "encdebug", "skiprc", "verbose_encrypt"
An "rlogin" interface has been added. If the program
is named "rlogin", or the "-r" flag is given, then
with option negotiation loops. The algorithm that is
used is described in this file.
-tmac.doc:
- Macros for use in formatting the man pages on non-4.3Reno
- systems.
-
telnet:
This directory contains the client code. No kernel changes are
needed to use this code.
arpa:
This directory has a new <arpa/telnet.h>
+libtelnet/Makefile.4.4:
+telnet/Makefile.4.4:
+telnetd/Makefile.4.4:
+ These are the makefiles that can be used on a 4.3Reno
+ system when this software is installed in /usr/src/lib/libtelnet,
+ /usr/src/libexec/telnetd, and /usr/src/usr.bin/telnet.
+
The following TELNET options are supported:
ECHO: As per RFC 857
+ LOGOUT: As per RFC 727
+
STATUS:
The server will send its current status upon
request. It does not ask for the clients status.
but the definitions for the specific authentication
schemes is still in a state of flux.
- ENCRYPT:
+ ENCRYPTION:
This option is currently being defined by the IETF
Telnet Working Group, and an RFC has not yet been
issued. The draft RFC is still in a state of flux,
+/* $OpenBSD: authenc.c,v 1.2 1996/03/27 19:32:57 niklas Exp $ */
+/* $NetBSD: authenc.c,v 1.5 1996/02/28 21:03:52 thorpej Exp $ */
+
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: authenc.c,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)authenc.c 8.1 (Berkeley) 6/6/93";
+static char rcsid[] = "$NetBSD: authenc.c,v 1.5 1996/02/28 21:03:52 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: authenc.c,v 1.2 1996/03/27 19:32:57 niklas Exp $";
+#endif
#endif /* not lint */
#if defined(AUTHENTICATION)
+/* $OpenBSD: commands.c,v 1.3 1996/03/27 19:32:58 niklas Exp $ */
+/* $NetBSD: commands.c,v 1.13 1996/02/28 21:03:53 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)commands.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: commands.c,v 1.2 1996/01/05 16:41:21 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)commands.c 8.4 (Berkeley) 5/30/95";
+static char rcsid[] = "$NetBSD: commands.c,v 1.13 1996/02/28 21:03:53 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: commands.c,v 1.3 1996/03/27 19:32:58 niklas Exp $";
+#endif
#endif /* not lint */
#if defined(unix)
#include <errno.h>
#include <arpa/telnet.h>
+#include <sys/cdefs.h>
+#define P __P
#include "general.h"
#include <netinet/ip.h>
-#ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64
-#endif MAXHOSTNAMELEN
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 64
+#endif MAXHOSTNAMELEN
#if defined(IPPROTO_IP) && defined(IP_TOS)
int tos = -1;
* the "send" command.
*
*/
-
+
struct sendlist {
char *name; /* How user refers to it (case independent) */
char *help; /* Help information (0 ==> no help) */
extern char *telopts[];
register int val = 0;
- if (isprefix(name, "help") || isprefix(name, "?")) {
+ if (isprefix(name, "?")) {
register int col, len;
printf("Usage: send %s <value|option>\n", cmd);
(void) kill(0, SIGTSTP);
/*
* If we didn't get the window size before the SUSPEND, but we
- * can get them now (???), then send the NAWS to make sure that
+ * can get them now (?), then send the NAWS to make sure that
* we are set up for the right window size.
*/
if (TerminalWindowSize(&newrows, &newcols) && connected &&
* Fire up the shell in the child.
*/
register char *shellp, *shellname;
- extern char *rindex();
+ extern char *strrchr();
shellp = getenv("SHELL");
if (shellp == NULL)
shellp = "/bin/sh";
- if ((shellname = rindex(shellp, '/')) == 0)
+ if ((shellname = strrchr(shellp, '/')) == 0)
shellname = shellp;
else
shellname++;
}
c = getslc(argv[1]);
if (c == 0) {
- fprintf(stderr, "'%s': unknown argument ('slc ?' for help).\n",
+ fprintf(stderr, "'%s': unknown argument ('slc ?' for help).\n",
argv[1]);
- return 0;
+ return 0;
}
if (Ambiguous(c)) {
- fprintf(stderr, "'%s': ambiguous argument ('slc ?' for help).\n",
+ fprintf(stderr, "'%s': ambiguous argument ('slc ?' for help).\n",
argv[1]);
- return 0;
+ return 0;
}
(*c->handler)(c->arg);
slcstate();
}
c = getenvcmd(argv[1]);
if (c == 0) {
- fprintf(stderr, "'%s': unknown argument ('environ ?' for help).\n",
+ fprintf(stderr, "'%s': unknown argument ('environ ?' for help).\n",
argv[1]);
- return 0;
+ return 0;
}
if (Ambiguous(c)) {
- fprintf(stderr, "'%s': ambiguous argument ('environ ?' for help).\n",
+ fprintf(stderr, "'%s': ambiguous argument ('environ ?' for help).\n",
argv[1]);
- return 0;
+ return 0;
}
if (c->narg + 2 != argc) {
fprintf(stderr,
extern char **environ;
register char **epp, *cp;
register struct env_lst *ep;
- extern char *index();
+ extern char *strchr();
for (epp = environ; *epp; epp++) {
- if (cp = index(*epp, '=')) {
+ if (cp = strchr(*epp, '=')) {
*cp = '\0';
ep = env_define((unsigned char *)*epp,
(unsigned char *)cp+1);
*/
if ((ep = env_find("DISPLAY"))
&& ((*ep->value == ':')
- || (strncmp((char *)ep->value, "unix:", 5) == 0))) {
+ || (strncmp((char *)ep->value, "unix:", 5) == 0))) {
char hbuf[256+1];
- char *cp2 = index((char *)ep->value, ':');
+ char *cp2 = strchr((char *)ep->value, ':');
gethostname(hbuf, 256);
hbuf[256] = '\0';
{
register struct env_lst *ep;
- if (my_state_is_wont(TELOPT_NEW_ENVIRON)
+ if (my_state_is_wont(TELOPT_NEW_ENVIRON)
#ifdef OLD_ENVIRON
&& my_state_is_wont(TELOPT_OLD_ENVIRON)
#endif
};
extern int
- auth_enable P((int)),
- auth_disable P((int)),
+ auth_enable P((char *)),
+ auth_disable P((char *)),
auth_status P((void));
static int
auth_help P((void));
{
struct authlist *c;
+ if (argc < 2) {
+ fprintf(stderr,
+ "Need an argument to 'auth' command. 'auth ?' for help.\n");
+ return 0;
+ }
+
c = (struct authlist *)
genget(argv[1], (char **) AuthList, sizeof(struct authlist));
if (c == 0) {
- fprintf(stderr, "'%s': unknown argument ('auth ?' for help).\n",
+ fprintf(stderr, "'%s': unknown argument ('auth ?' for help).\n",
argv[1]);
- return 0;
+ return 0;
}
if (Ambiguous(c)) {
- fprintf(stderr, "'%s': ambiguous argument ('auth ?' for help).\n",
+ fprintf(stderr, "'%s': ambiguous argument ('auth ?' for help).\n",
argv[1]);
- return 0;
+ return 0;
}
if (c->narg + 2 != argc) {
fprintf(stderr,
char *cmd, *hostp = 0, *portp = 0, *user = 0;
/* clear the socket address prior to use */
- bzero((char *)&sin, sizeof(sin));
+ memset((char *)&sin, 0, sizeof(sin));
if (connected) {
printf("?Already connected to %s\n", hostname);
cmd = *argv;
--argc; ++argv;
while (argc) {
- if (isprefix(*argv, "?"))
+ if (strcmp(*argv, "help") == 0 || isprefix(*argv, "?"))
goto usage;
if (strcmp(*argv, "-l") == 0) {
--argc; ++argv;
if (host) {
sin.sin_family = host->h_addrtype;
#if defined(h_addr) /* In 4.3, this is a #define */
- memcpy((caddr_t)&sin.sin_addr,
+ memmove((caddr_t)&sin.sin_addr,
host->h_addr_list[0], host->h_length);
#else /* defined(h_addr) */
- memcpy((caddr_t)&sin.sin_addr, host->h_addr, host->h_length);
+ memmove((caddr_t)&sin.sin_addr, host->h_addr, host->h_length);
#endif /* defined(h_addr) */
strncpy(_hostname, host->h_name, sizeof(_hostname));
_hostname[sizeof(_hostname)-1] = '\0';
hostname = _hostname;
} else {
herror(hostp);
- setuid(getuid());
+ setuid(getuid());
return 0;
}
}
sin.sin_port = sp->s_port;
else {
printf("%s: bad port number\n", portp);
- setuid(getuid());
+ setuid(getuid());
return 0;
}
} else {
sp = getservbyname("telnet", "tcp");
if (sp == 0) {
fprintf(stderr, "telnet: tcp/telnet: unknown service\n");
- setuid(getuid());
+ setuid(getuid());
return 0;
}
sin.sin_port = sp->s_port;
tos = tp->t_tos;
# endif
if (tos < 0)
- tos = IPTOS_LOWDELAY;
+ tos = IPTOS_LOWDELAY; /* Low Delay bit */
if (tos
&& (setsockopt(net, IPPROTO_IP, IP_TOS,
(char *)&tos, sizeof(int)) < 0)
errno = oerrno;
perror((char *)0);
host->h_addr_list++;
- memcpy((caddr_t)&sin.sin_addr,
+ memmove((caddr_t)&sin.sin_addr,
host->h_addr_list[0], host->h_length);
(void) NetClose(net);
continue;
goto getline;
*cp = '\0';
if (rlogin == _POSIX_VDISABLE)
- printf("%s\n", line);
+ printf("%s\n", line);
} else {
getline:
if (rlogin != _POSIX_VDISABLE)
* *cpp: If *cpp was equal to NULL, it will be filled
* in with a pointer to our static area that has
* the option filled in. This will be 32bit aligned.
- *
+ *
* *lenp: This will be filled in with how long the option
* pointed to by *cpp is.
- *
+ *
*/
unsigned long
sourceroute(arg, cpp, lenp)
sin_addr.s_addr = tmp;
} else if (host = gethostbyname(cp)) {
#if defined(h_addr)
- memcpy((caddr_t)&sin_addr,
+ memmove((caddr_t)&sin_addr,
host->h_addr_list[0], host->h_length);
#else
- memcpy((caddr_t)&sin_addr, host->h_addr, host->h_length);
+ memmove((caddr_t)&sin_addr, host->h_addr, host->h_length);
#endif
} else {
*cpp = cp;
return(0);
}
- memcpy(lsrp, (char *)&sin_addr, 4);
+ memmove(lsrp, (char *)&sin_addr, 4);
lsrp += 4;
if (cp2)
cp = cp2;
+/* $OpenBSD: defines.h,v 1.2 1996/03/27 19:33:00 niklas Exp $ */
+/* $NetBSD: defines.h,v 1.5 1996/02/28 21:03:55 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* SUCH DAMAGE.
*
* from: @(#)defines.h 8.1 (Berkeley) 6/6/93
- * $Id: defines.h,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $
*/
#define settimer(x) clocks.x = clocks.system++
+/* $OpenBSD: externs.h,v 1.2 1996/03/27 19:33:01 niklas Exp $ */
+/* $NetBSD: externs.h,v 1.8 1996/02/28 21:03:58 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)externs.h 8.1 (Berkeley) 6/6/93
- * $Id: externs.h,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $
+ * from: @(#)externs.h 8.3 (Berkeley) 5/30/95
*/
#ifndef BSD
#ifndef NO_STRING_H
#include <string.h>
-#endif
+#else
#include <strings.h>
+#endif
#ifndef _POSIX_VDISABLE
# ifdef sun
extern int errno; /* outside this world */
#endif /* !CRAY */
-#if !defined(P)
-# ifdef __STDC__
-# define P(x) x
-# else
-# define P(x) ()
-# endif
-#endif
+#include <sys/cdefs.h>
+#define P __P
extern int
autologin, /* Autologin enabled */
flushout, /* flush output */
connected, /* Are we connected to the other side? */
globalmode, /* Mode tty should be in */
- In3270, /* Are we in 3270 mode? */
+ In3270, /* Are we in 3270 mode? */
telnetport, /* Are we connected to the telnet port? */
localflow, /* Flow control handled locally */
restartany, /* If flow control, restart output on any character */
localchars, /* we recognize interrupt/quit */
- donelclchars, /* the user has set "localchars" */
+ donelclchars, /* the user has set "localchars" */
showoptions,
net, /* Network file descriptor */
tin, /* Terminal input file descriptor */
#endif /* defined(TN3270) */
termdata, /* Print out terminal data flow */
#endif /* defined(unix) */
- debug, /* Debug level */
+ debug, /* Debug level */
clienteof; /* Client received EOF */
extern cc_t escape; /* Escape to command mode */
+/* $OpenBSD: fdset.h,v 1.2 1996/03/27 19:33:02 niklas Exp $ */
+/* $NetBSD: fdset.h,v 1.5 1996/02/28 21:04:00 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* SUCH DAMAGE.
*
* from: @(#)fdset.h 8.1 (Berkeley) 6/6/93
- * $Id: fdset.h,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $
*/
/*
+/* $OpenBSD: general.h,v 1.2 1996/03/27 19:33:03 niklas Exp $ */
+/* $NetBSD: general.h,v 1.5 1996/02/28 21:04:02 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* SUCH DAMAGE.
*
* from: @(#)general.h 8.1 (Berkeley) 6/6/93
- * $Id: general.h,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $
*/
/*
+/* $OpenBSD: main.c,v 1.2 1996/03/27 19:33:03 niklas Exp $ */
+/* $NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $ */
+
/*
- * Copyright (c) 1988, 1990 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1988, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1988, 1990 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1988, 1990, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/* from: static char sccsid[] = "@(#)main.c 5.5 (Berkeley) 12/18/92"; */
-static char *rcsid = "$Id: main.c,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 5/30/95";
+static char rcsid[] = "$NetBSD: main.c,v 1.5 1996/02/28 21:04:05 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: main.c,v 1.2 1996/03/27 19:33:03 niklas Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
/* These values need to be the same as defined in libtelnet/kerberos5.c */
/* Either define them in both places, or put in some common header file. */
-#define OPTS_FORWARD_CREDS 0x00000002
-#define OPTS_FORWARDABLE_CREDS 0x00000001
+#define OPTS_FORWARD_CREDS 0x00000002
+#define OPTS_FORWARDABLE_CREDS 0x00000001
#if 0
#define FORWARD
init_terminal();
init_network();
-
+
init_telnet();
init_sys();
fprintf(stderr, "Usage: %s %s%s%s%s\n",
prompt,
#ifdef AUTHENTICATION
- " [-8] [-E] [-K] [-L] [-X atype] [-a] [-d] [-e char] [-k realm]",
- "\n\t[-l user] [-f/-F] [-n tracefile] ",
+ "[-8] [-E] [-K] [-L] [-S tos] [-X atype] [-a] [-c] [-d] [-e char]",
+ "\n\t[-k realm] [-l user] [-f/-F] [-n tracefile] ",
#else
- " [-8] [-E] [-L] [-a] [-d] [-e char] [-l user] [-n tracefile]",
- "\n\t",
+ "[-8] [-E] [-L] [-S tos] [-a] [-c] [-d] [-e char] [-l user]",
+ "\n\t[-n tracefile]",
#endif
#if defined(TN3270) && defined(unix)
# ifdef AUTHENTICATION
- "[-noasynch] [-noasynctty] [-noasyncnet]\n\t[-r] [-t transcom] ",
+ "[-noasynch] [-noasynctty]\n\t[-noasyncnet] [-r] [-t transcom] ",
# else
- "[-noasynch] [-noasynctty] [-noasyncnet] [-r] [-t transcom]\n\t",
+ "[-noasynch] [-noasynctty] [-noasyncnet] [-r]\n\t[-t transcom]",
# endif
#else
"[-r] ",
case 'f':
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
if (forward_flags & OPTS_FORWARD_CREDS) {
- fprintf(stderr,
+ fprintf(stderr,
"%s: Only one of -f and -F allowed.\n",
prompt);
usage();
forward_flags |= OPTS_FORWARD_CREDS;
#else
fprintf(stderr,
- "%s: Warning: -f ignored, no Kerberos V5 support.\n",
+ "%s: Warning: -f ignored, no Kerberos V5 support.\n",
prompt);
#endif
break;
case 'F':
#if defined(AUTHENTICATION) && defined(KRB5) && defined(FORWARD)
if (forward_flags & OPTS_FORWARD_CREDS) {
- fprintf(stderr,
+ fprintf(stderr,
"%s: Only one of -f and -F allowed.\n",
prompt);
usage();
forward_flags |= OPTS_FORWARDABLE_CREDS;
#else
fprintf(stderr,
- "%s: Warning: -F ignored, no Kerberos V5 support.\n",
+ "%s: Warning: -F ignored, no Kerberos V5 support.\n",
prompt);
#endif
break;
+/* $OpenBSD: network.c,v 1.2 1996/03/27 19:33:04 niklas Exp $ */
+/* $NetBSD: network.c,v 1.5 1996/02/28 21:04:06 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)network.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: network.c,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)network.c 8.2 (Berkeley) 12/15/93";
+static char rcsid[] = "$NetBSD: network.c,v 1.5 1996/02/28 21:04:06 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: network.c,v 1.2 1996/03/27 19:33:04 niklas Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
+/* $OpenBSD: ring.c,v 1.2 1996/03/27 19:33:05 niklas Exp $ */
+/* $NetBSD: ring.c,v 1.7 1996/02/28 21:04:07 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)ring.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: ring.c,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)ring.c 8.2 (Berkeley) 5/30/95";
+static char rcsid[] = "$NetBSD: ring.c,v 1.7 1996/02/28 21:04:07 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: ring.c,v 1.2 1996/03/27 19:33:05 niklas Exp $";
+#endif
#endif /* not lint */
/*
while (count) {
i = MIN(count, ring_empty_consecutive(ring));
- memcpy(ring->supply, buffer, i);
+ memmove(ring->supply, buffer, i);
ring_supplied(ring, i);
count -= i;
buffer += i;
while (count) {
i = MIN(count, ring_full_consecutive(ring));
- memcpy(buffer, ring->consume, i);
+ memmove(buffer, ring->consume, i);
ring_consumed(ring, i);
count -= i;
buffer += i;
+/* $OpenBSD: ring.h,v 1.2 1996/03/27 19:33:06 niklas Exp $ */
+/* $NetBSD: ring.h,v 1.5 1996/02/28 21:04:09 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* SUCH DAMAGE.
*
* from: @(#)ring.h 8.1 (Berkeley) 6/6/93
- * $Id: ring.h,v 1.1.1.1 1995/10/18 08:46:14 deraadt Exp $
*/
-#if defined(P)
-# undef P
-#endif
-
-#if defined(__STDC__) || defined(LINT_ARGS)
-# define P(x) x
-#else
-# define P(x) ()
-#endif
+#include <sys/cdefs.h>
+#define P __P
/*
* This defines a structure for a ring buffer.
+/* $OpenBSD: sys_bsd.c,v 1.3 1996/03/27 19:33:07 niklas Exp $ */
+/* $NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)sys_bsd.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: sys_bsd.c,v 1.2 1996/02/23 15:13:01 niklas Exp $";
+#if 0
+from: static char sccsid[] = "@(#)sys_bsd.c 8.4 (Berkeley) 5/30/95";
+static char rcsid[] = "$NetBSD: sys_bsd.c,v 1.11 1996/02/28 21:04:10 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: sys_bsd.c,v 1.3 1996/03/27 19:33:07 niklas Exp $";
+#endif
#endif /* not lint */
/*
int
TerminalRead(buf, n)
- char *buf;
+ unsigned char *buf;
int n;
{
return read(tin, buf, n);
/*
* Flush output to the terminal
*/
-
+
void
TerminalFlushOutput()
{
nttyb.sg_kill = ottyb.sg_kill;
nttyb.sg_erase = ottyb.sg_erase;
#else /* USE_TERMIO */
- memcpy(new_tc.c_cc, old_tc.c_cc, sizeof(old_tc.c_cc));
+ memmove(new_tc.c_cc, old_tc.c_cc, sizeof(old_tc.c_cc));
# ifndef VDISCARD
termFlushChar = CONTROL('O');
# endif
#endif
#ifdef SIGTSTP
(void) signal(SIGTSTP, SIG_DFL);
+# ifndef SOLARIS
(void) sigsetmask(sigblock(0) & ~(1<<(SIGTSTP-1)));
+# else SOLARIS
+ (void) sigrelse(SIGTSTP);
+# endif SOLARIS
#endif /* SIGTSTP */
#ifndef USE_TERMIO
ltc = oltc;
}
+/*
+ * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD).
+ */
+#if B4800 != 4800
+#define DECODE_BAUD
+#endif
+
+#ifdef DECODE_BAUD
+#ifndef B7200
+#define B7200 B4800
+#endif
+
+#ifndef B14400
+#define B14400 B9600
+#endif
+
#ifndef B19200
-# define B19200 B9600
+# define B19200 B14400
+#endif
+
+#ifndef B28800
+#define B28800 B19200
#endif
#ifndef B38400
-# define B38400 B19200
+# define B38400 B28800
+#endif
+
+#ifndef B57600
+#define B57600 B38400
#endif
+#ifndef B76800
+#define B76800 B57600
+#endif
+
+#ifndef B115200
+#define B115200 B76800
+#endif
+
+#ifndef B230400
+#define B230400 B115200
+#endif
+
+
/*
* This code assumes that the values B0, B50, B75...
* are in ascending order. They do not have to be
long speed;
long value;
} termspeeds[] = {
- { 0, B0 }, { 50, B50 }, { 75, B75 },
- { 110, B110 }, { 134, B134 }, { 150, B150 },
- { 200, B200 }, { 300, B300 }, { 600, B600 },
- { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 },
- { 4800, B4800 }, { 9600, B9600 }, { 19200, B19200 },
- { 38400, B38400 }, { -1, B38400 }
+ { 0, B0 }, { 50, B50 }, { 75, B75 },
+ { 110, B110 }, { 134, B134 }, { 150, B150 },
+ { 200, B200 }, { 300, B300 }, { 600, B600 },
+ { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 },
+ { 4800, B4800 }, { 7200, B7200 }, { 9600, B9600 },
+ { 14400, B14400 }, { 19200, B19200 }, { 28800, B28800 },
+ { 38400, B38400 }, { 57600, B57600 }, { 115200, B115200 },
+ { 230400, B230400 }, { -1, B230400 }
};
+#endif /* DECODE_BAUD */
void
TerminalSpeeds(ispeed, ospeed)
long *ispeed;
long *ospeed;
{
+#ifdef DECODE_BAUD
register struct termspeeds *tp;
+#endif /* DECODE_BAUD */
register long in, out;
out = cfgetospeed(&old_tc);
if (in == 0)
in = out;
+#ifdef DECODE_BAUD
tp = termspeeds;
while ((tp->speed != -1) && (tp->value < in))
tp++;
while ((tp->speed != -1) && (tp->value < out))
tp++;
*ospeed = tp->speed;
+#else /* DECODE_BAUD */
+ *ispeed = in;
+ *ospeed = out;
+#endif /* DECODE_BAUD */
}
int
if (netout) {
FD_SET(net, &obits);
- }
+ }
if (ttyout) {
FD_SET(tout, &obits);
}
int i;
i = recv(net, netiring.supply + c, canread - c, MSG_OOB);
if (i == c &&
- bcmp(netiring.supply, netiring.supply + c, i) == 0) {
+ memcmp(netiring.supply, netiring.supply + c, i) == 0) {
bogus_oob = 1;
first = 0;
} else if (i < 0) {
if (FD_ISSET(tin, &ibits)) {
FD_CLR(tin, &ibits);
c = TerminalRead(ttyiring.supply, ring_empty_consecutive(&ttyiring));
+ if (c < 0 && errno == EIO)
+ c = 0;
if (c < 0 && errno == EWOULDBLOCK) {
c = 0;
} else {
+.\" $OpenBSD: telnet.1,v 1.2 1996/03/27 19:33:08 niklas Exp $
+.\" $NetBSD: telnet.1,v 1.5 1996/02/28 21:04:12 thorpej Exp $
+.\"
.\" Copyright (c) 1983, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" SUCH DAMAGE.
.\"
.\" from: @(#)telnet.1 8.4 (Berkeley) 2/3/94
-.\" $Id: telnet.1,v 1.1.1.1 1995/10/18 08:46:15 deraadt Exp $
.\"
.Dd February 3, 1994
.Dt TELNET 1
+/* $OpenBSD: telnet.c,v 1.2 1996/03/27 19:33:10 niklas Exp $ */
+/* $NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)telnet.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: telnet.c,v 1.1.1.1 1995/10/18 08:46:15 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)telnet.c 8.4 (Berkeley) 5/30/95";
+static char rcsid[] = "$NetBSD: telnet.c,v 1.7 1996/02/28 21:04:15 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: telnet.c,v 1.2 1996/03/27 19:33:10 niklas Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
#include "general.h"
\f
-#define strip(x) ((x)&0x7f)
+#define strip(x) ((my_want_state_is_wont(TELOPT_BINARY)) ? ((x)&0x7f) : (x))
static unsigned char subbuffer[SUBBUFSIZE],
*subpointer, *subend; /* buffer for sub-options */
ClearArray(options);
connected = In3270 = ISend = localflow = donebinarytoggle = 0;
-#if defined(AUTHENTICATION)
+#if defined(AUTHENTICATION)
auth_encrypt_connect(connected);
#endif /* defined(AUTHENTICATION) */
restartany = -1;
register char c, *cp, **argvp, *cp2, **argv, **avt;
if (name) {
- if (strlen(name) > 40) {
+ if ((int)strlen(name) > 40) {
name = 0;
unknown[0] = name_unknown;
} else {
else if (islower(c))
*cp = toupper(c);
}
-
+
/*
* Check for an old V6 2 character name. If the second
* name points to the beginning of the buffer, and is
(setupterm(tname, 1, &err) == 0)) {
tnamep = mklist(termbuf, tname);
} else {
- if (tname && (strlen(tname) <= 40)) {
+ if (tname && ((int)strlen(tname) <= 40)) {
unknown[0] = tname;
upcase(tname);
} else
case TS_IAC:
process_iac:
switch (c) {
-
+
case WILL:
telrcv_state = TS_WILL;
continue;
ring_full_consecutive(&ttyiring));
if (c) {
returnValue = 1;
- ring_consumed(&ttyiring, c);
+ ring_consumed(&ttyiring, c);
}
} else {
# endif /* defined(TN3270) */
{
sys_telnet_init();
-#if defined(AUTHENTICATION)
+#if defined(AUTHENTICATION)
{
static char local_host[256] = { 0 };
next = nextitem(next);
} while (wewant(next) && (nfrontp > next));
length = next-thisitem;
- memcpy(good, thisitem, length);
+ memmove(good, thisitem, length);
good += length;
thisitem = next;
} else {
+/* $OpenBSD: terminal.c,v 1.2 1996/03/27 19:33:11 niklas Exp $ */
+/* $NetBSD: terminal.c,v 1.5 1996/02/28 21:04:17 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1990, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)terminal.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: terminal.c,v 1.1.1.1 1995/10/18 08:46:15 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)terminal.c 8.2 (Berkeley) 2/16/95";
+static char rcsid[] = "$NetBSD: terminal.c,v 1.5 1996/02/28 21:04:17 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: terminal.c,v 1.2 1996/03/27 19:33:11 niklas Exp $";
+#endif
#endif /* not lint */
#include <arpa/telnet.h>
n1 = n0 - n;
if (!drop)
n1 = TerminalWrite(ttyoring.bottom, n1);
- n += n1;
+ if (n1 > 0)
+ n += n1;
}
ring_consumed(&ttyoring, n);
}
+/* $OpenBSD: tn3270.c,v 1.2 1996/03/27 19:33:12 niklas Exp $ */
+/* $NetBSD: tn3270.c,v 1.5 1996/02/28 21:04:18 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)tn3270.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: tn3270.c,v 1.1.1.1 1995/10/18 08:46:15 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)tn3270.c 8.2 (Berkeley) 5/30/95";
+static char rcsid[] = "$NetBSD: tn3270.c,v 1.5 1996/02/28 21:04:18 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: tn3270.c,v 1.2 1996/03/27 19:33:12 niklas Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
if (save) {
if (Ifrontp+save > Ibuf+sizeof Ibuf) {
if (Ibackp != Ibuf) {
- memcpy(Ibuf, Ibackp, Ifrontp-Ibackp);
+ memmove(Ibuf, Ibackp, Ifrontp-Ibackp);
Ifrontp -= (Ibackp-Ibuf);
Ibackp = Ibuf;
}
+/* $OpenBSD: types.h,v 1.2 1996/03/27 19:33:13 niklas Exp $ */
+/* $NetBSD: types.h,v 1.5 1996/02/28 21:04:20 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
* SUCH DAMAGE.
*
* from: @(#)types.h 8.1 (Berkeley) 6/6/93
- * $Id: types.h,v 1.1.1.1 1995/10/18 08:46:15 deraadt Exp $
*/
typedef struct {
+/* $OpenBSD: utilities.c,v 1.2 1996/03/27 19:33:15 niklas Exp $ */
+/* $NetBSD: utilities.c,v 1.5 1996/02/28 21:04:21 thorpej Exp $ */
+
/*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*/
#ifndef lint
-/* from: static char sccsid[] = "@(#)utilities.c 8.1 (Berkeley) 6/6/93"; */
-static char *rcsid = "$Id: utilities.c,v 1.1.1.1 1995/10/18 08:46:15 deraadt Exp $";
+#if 0
+static char sccsid[] = "@(#)utilities.c 8.3 (Berkeley) 5/30/95";
+static char rcsid[] = "$NetBSD: utilities.c,v 1.5 1996/02/28 21:04:21 thorpej Exp $";
+#else
+static char rcsid[] = "$OpenBSD: utilities.c,v 1.2 1996/03/27 19:33:15 niklas Exp $";
+#endif
#endif /* not lint */
#define TELOPTS
break;
}
break;
-
+
case LM_SLC:
fprintf(NetTrace, "SLC");
for (i = 2; i < length - 2; i += 3) {
fprintf(NetTrace, "\n");
break;
-
+
default:
fprintf(NetTrace, " %d", pointer[i]);
break;
+++ /dev/null
-/* $NetBSD: remcap.c,v 1.5 1994/12/24 17:56:29 cgd Exp $ */
-
-/*
- * Copyright (c) 1983, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)remcap.c 8.1 (Berkeley) 6/6/93";
-#endif
-static char rcsid[] = "$NetBSD: remcap.c,v 1.5 1994/12/24 17:56:29 cgd Exp $";
-#endif /* not lint */
-
-/*
- * remcap - routines for dealing with the remote host data base
- *
- * derived from termcap
- */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include "pathnames.h"
-
-#ifndef BUFSIZ
-#define BUFSIZ 1024
-#endif
-#define MAXHOP 32 /* max number of tc= indirections */
-
-#define tgetent rgetent
-#define tnchktc rnchktc
-#define tnamatch rnamatch
-#define tgetnum rgetnum
-#define tgetflag rgetflag
-#define tgetstr rgetstr
-#define E_TERMCAP RM = _PATH_REMOTE
-#define V_TERMCAP "REMOTE"
-#define V_TERM "HOST"
-
-char *RM;
-
-/*
- * termcap - routines for dealing with the terminal capability data base
- *
- * BUG: Should use a "last" pointer in tbuf, so that searching
- * for capabilities alphabetically would not be a n**2/2
- * process when large numbers of capabilities are given.
- * Note: If we add a last pointer now we will screw up the
- * tc capability. We really should compile termcap.
- *
- * Essentially all the work here is scanning and decoding escapes
- * in string capabilities. We don't use stdio because the editor
- * doesn't, and because living w/o it is not hard.
- */
-
-static char *tbuf;
-static int hopcount; /* detect infinite loops in termcap, init 0 */
-static char *tskip();
-static char *tdecode();
-char *tgetstr();
-static char *remotefile;
-
-/*
- * Get an entry for terminal name in buffer bp,
- * from the termcap file. Parse is very rudimentary;
- * we just notice escaped newlines.
- */
-tgetent(bp, name)
- char *bp, *name;
-{
- char lbuf[BUFSIZ], *cp, *p;
- int rc1, rc2;
-
- remotefile = cp = getenv(V_TERMCAP);
- if (cp == (char *)0 || strcmp(cp, _PATH_REMOTE) == 0) {
- remotefile = cp = _PATH_REMOTE;
- return (getent(bp, name, cp));
- } else {
- if ((rc1 = getent(bp, name, cp)) != 1)
- *bp = '\0';
- remotefile = cp = _PATH_REMOTE;
- rc2 = getent(lbuf, name, cp);
- if (rc1 != 1 && rc2 != 1)
- return (rc2);
- if (rc2 == 1) {
- p = lbuf;
- if (rc1 == 1)
- while (*p++ != ':')
- ;
- if (strlen(bp) + strlen(p) > BUFSIZ) {
- write(2, "Remcap entry too long\n", 23);
- return (-1);
- }
- strcat(bp, p);
- }
- tbuf = bp;
- return (1);
- }
-}
-
-getent(bp, name, cp)
- char *bp, *name, *cp;
-{
- register int c;
- register int i = 0, cnt = 0;
- char ibuf[BUFSIZ], *cp2;
- int tf;
-
- tbuf = bp;
- tf = 0;
- /*
- * TERMCAP can have one of two things in it. It can be the
- * name of a file to use instead of /etc/termcap. In this
- * case it better start with a "/". Or it can be an entry to
- * use so we don't have to read the file. In this case it
- * has to already have the newlines crunched out.
- */
- if (cp && *cp) {
- if (*cp!='/') {
- cp2 = getenv(V_TERM);
- if (cp2 == (char *)0 || strcmp(name,cp2) == 0) {
- strcpy(bp,cp);
- return (tnchktc());
- } else
- tf = open(E_TERMCAP, O_RDONLY);
- } else
- tf = open(RM = cp, O_RDONLY);
- }
- if (tf == 0)
- tf = open(E_TERMCAP, O_RDONLY);
- if (tf < 0)
- return (-1);
- for (;;) {
- cp = bp;
- for (;;) {
- if (i == cnt) {
- cnt = read(tf, ibuf, BUFSIZ);
- if (cnt <= 0) {
- close(tf);
- return (0);
- }
- i = 0;
- }
- c = ibuf[i++];
- if (c == '\n') {
- if (cp > bp && cp[-1] == '\\') {
- cp--;
- continue;
- }
- break;
- }
- if (cp >= bp+BUFSIZ) {
- write(2,"Remcap entry too long\n", 23);
- break;
- } else
- *cp++ = c;
- }
- *cp = 0;
-
- /*
- * The real work for the match.
- */
- if (tnamatch(name)) {
- close(tf);
- return (tnchktc());
- }
- }
-}
-
-/*
- * tnchktc: check the last entry, see if it's tc=xxx. If so,
- * recursively find xxx and append that entry (minus the names)
- * to take the place of the tc=xxx entry. This allows termcap
- * entries to say "like an HP2621 but doesn't turn on the labels".
- * Note that this works because of the left to right scan.
- */
-tnchktc()
-{
- register char *p, *q;
- char tcname[16]; /* name of similar terminal */
- char tcbuf[BUFSIZ];
- char *holdtbuf = tbuf;
- int l;
- char *cp;
-
- p = tbuf + strlen(tbuf) - 2; /* before the last colon */
- while (*--p != ':')
- if (p<tbuf) {
- write(2, "Bad remcap entry\n", 18);
- return (0);
- }
- p++;
- /* p now points to beginning of last field */
- if (p[0] != 't' || p[1] != 'c')
- return (1);
- strcpy(tcname, p+3);
- q = tcname;
- while (*q && *q != ':')
- q++;
- *q = 0;
- if (++hopcount > MAXHOP) {
- write(2, "Infinite tc= loop\n", 18);
- return (0);
- }
- if (getent(tcbuf, tcname, remotefile) != 1) {
- if (strcmp(remotefile, _PATH_REMOTE) == 0)
- return (0);
- else if (getent(tcbuf, tcname, _PATH_REMOTE) != 1)
- return (0);
- }
- for (q = tcbuf; *q++ != ':'; )
- ;
- l = p - holdtbuf + strlen(q);
- if (l > BUFSIZ) {
- write(2, "Remcap entry too long\n", 23);
- q[BUFSIZ - (p-holdtbuf)] = 0;
- }
- strcpy(p, q);
- tbuf = holdtbuf;
- return (1);
-}
-
-/*
- * Tnamatch deals with name matching. The first field of the termcap
- * entry is a sequence of names separated by |'s, so we compare
- * against each such name. The normal : terminator after the last
- * name (before the first field) stops us.
- */
-tnamatch(np)
- char *np;
-{
- register char *Np, *Bp;
-
- Bp = tbuf;
- if (*Bp == '#')
- return (0);
- for (;;) {
- for (Np = np; *Np && *Bp == *Np; Bp++, Np++)
- continue;
- if (*Np == 0 && (*Bp == '|' || *Bp == ':' || *Bp == 0))
- return (1);
- while (*Bp && *Bp != ':' && *Bp != '|')
- Bp++;
- if (*Bp == 0 || *Bp == ':')
- return (0);
- Bp++;
- }
-}
-
-/*
- * Skip to the next field. Notice that this is very dumb, not
- * knowing about \: escapes or any such. If necessary, :'s can be put
- * into the termcap file in octal.
- */
-static char *
-tskip(bp)
- register char *bp;
-{
-
- while (*bp && *bp != ':')
- bp++;
- if (*bp == ':')
- bp++;
- return (bp);
-}
-
-/*
- * Return the (numeric) option id.
- * Numeric options look like
- * li#80
- * i.e. the option string is separated from the numeric value by
- * a # character. If the option is not found we return -1.
- * Note that we handle octal numbers beginning with 0.
- */
-tgetnum(id)
- char *id;
-{
- register int i, base;
- register char *bp = tbuf;
-
- for (;;) {
- bp = tskip(bp);
- if (*bp == 0)
- return (-1);
- if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1])
- continue;
- if (*bp == '@')
- return (-1);
- if (*bp != '#')
- continue;
- bp++;
- base = 10;
- if (*bp == '0')
- base = 8;
- i = 0;
- while (isdigit(*bp))
- i *= base, i += *bp++ - '0';
- return (i);
- }
-}
-
-/*
- * Handle a flag option.
- * Flag options are given "naked", i.e. followed by a : or the end
- * of the buffer. Return 1 if we find the option, or 0 if it is
- * not given.
- */
-tgetflag(id)
- char *id;
-{
- register char *bp = tbuf;
-
- for (;;) {
- bp = tskip(bp);
- if (!*bp)
- return (0);
- if (*bp++ == id[0] && *bp != 0 && *bp++ == id[1]) {
- if (!*bp || *bp == ':')
- return (1);
- else if (*bp == '@')
- return (0);
- }
- }
-}
-
-/*
- * Get a string valued option.
- * These are given as
- * cl=^Z
- * Much decoding is done on the strings, and the strings are
- * placed in area, which is a ref parameter which is updated.
- * No checking on area overflow.
- */
-char *
-tgetstr(id, area)
- char *id, **area;
-{
- register char *bp = tbuf;
-
- for (;;) {
- bp = tskip(bp);
- if (!*bp)
- return (0);
- if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1])
- continue;
- if (*bp == '@')
- return (0);
- if (*bp != '=')
- continue;
- bp++;
- return (tdecode(bp, area));
- }
-}
-
-/*
- * Tdecode does the grung work to decode the
- * string capability escapes.
- */
-static char *
-tdecode(str, area)
- register char *str;
- char **area;
-{
- register char *cp;
- register int c;
- register char *dp;
- int i;
-
- cp = *area;
- while ((c = *str++) && c != ':') {
- switch (c) {
-
- case '^':
- c = *str++ & 037;
- break;
-
- case '\\':
- dp = "E\033^^\\\\::n\nr\rt\tb\bf\f";
- c = *str++;
-nextc:
- if (*dp++ == c) {
- c = *dp++;
- break;
- }
- dp++;
- if (*dp)
- goto nextc;
- if (isdigit(c)) {
- c -= '0', i = 2;
- do
- c <<= 3, c |= *str++ - '0';
- while (--i && isdigit(*str));
- }
- break;
- }
- *cp++ = c;
- }
- *cp++ = 0;
- str = *area;
- *area = cp;
- return (str);
-}
-/* $Id: defs.h,v 1.2 1996/02/04 08:37:00 etheisen Exp $ */
+/* $OpenBSD: defs.h,v 1.3 1996/03/27 19:33:18 niklas Exp $ */
#include <assert.h>
#include <ctype.h>
+/* $OpenBSD: reader.c,v 1.3 1996/03/27 19:33:19 niklas Exp $ */
+
#ifndef lint
-static char rcsid[] = "$Id: reader.c,v 1.2 1996/02/04 08:37:02 etheisen Exp $";
+static char rcsid[] = "$OpenBSD: reader.c,v 1.3 1996/03/27 19:33:19 niklas Exp $";
#endif /* not lint */
#include "defs.h"
}
-/*
- * %expect requires special handling
- * as it really isn't part of the yacc
- * grammar only a flag for yacc proper.
- */
-declare_expect(assoc)
-int assoc;
-{
- register int c;
-
- if (assoc != EXPECT) ++prec;
-
- /*
- * Stay away from nextc - doesn't
- * detect EOL and will read to EOF.
- */
- c = *++cptr;
- if (c == EOF) unexpected_EOF();
-
- for(;;)
- {
- if (isdigit(c))
- {
- SRexpect = get_number();
- break;
- }
- /*
- * Looking for number before EOL.
- * Spaces, tabs, and numbers are ok,
- * words, punc., etc. are syntax errors.
- */
- else if (c == '\n' || isalpha(c) || !isspace(c))
- {
- syntax_error(lineno, line, cptr);
- }
- else
- {
- c = *++cptr;
- if (c == EOF) unexpected_EOF();
- }
- }
-}
-
-
declare_types()
{
register int c;
goal = bp;
}
+handle_expect()
+{
+ register int c;
+ register int num;
+
+ c = nextc();
+ if (c == EOF) unexpected_EOF();
+ if (!isdigit(c))
+ syntax_error(lineno, line, cptr);
+ num = get_number();
+ if (num == 1)
+ fprintf (stderr, "%s: Expect 1 shift/reduce conflict.\n", myname);
+ else
+ fprintf (stderr, "%s: Expect %d shift/reduce conflicts.\n", myname,
+ num);
+}
+
read_declarations()
{
declare_tokens(k);
break;
- case EXPECT:
- declare_expect(k);
- break;
-
case TYPE:
declare_types();
break;
case START:
declare_start();
break;
+
+ case EXPECT:
+ handle_expect();
+ break;
}
}
}
+/* $OpenBSD: skeleton.c,v 1.3 1996/03/27 19:33:21 niklas Exp $ */
+
#include "defs.h"
/* The definition of yysccsid in the banner should be replaced with */
{
"#ifndef lint",
"/*static char yysccsid[] = \"from: @(#)yaccpar 1.9 (Berkeley) 02/21/93\";*/",
- "static char yyrcsid[] = \"$Id: skeleton.c,v 1.2 1995/12/22 01:41:55 niklas Exp $\";",
+ "static char yyrcsid[] = \"$OpenBSD: skeleton.c,v 1.3 1996/03/27 19:33:21 niklas Exp $\";",
"#endif",
"#define YYBYACC 1",
"#define YYMAJOR 1",