Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

OpenBSD 3.3

  • Loading branch information...
commit 202eadb4d7b5d8a4f08c1953dcf49158cca10784 1 parent 02dfb0a
itojun authored
Showing with 1,093 additions and 698 deletions.
  1. +4 −4 openbsd/bin/ls/ls.1
  2. +3 −3 openbsd/include/Makefile
  3. +116 −39 openbsd/include/ctype.h
  4. +2 −2 openbsd/include/dirent.h
  5. +85 −0 openbsd/include/getopt.h
  6. +2 −2 openbsd/include/locale.h
  7. +5 −1 openbsd/include/md4.h
  8. +5 −1 openbsd/include/md5.h
  9. +5 −1 openbsd/include/rmd160.h
  10. +3 −3 openbsd/include/rpc/clnt.h
  11. +3 −3 openbsd/include/rpc/xdr.h
  12. +20 −16 openbsd/include/sha1.h
  13. +2 −2 openbsd/include/stddef.h
  14. +3 −2 openbsd/include/stdio.h
  15. +9 −2 openbsd/include/stdlib.h
  16. +3 −2 openbsd/include/string.h
  17. +2 −2 openbsd/include/time.h
  18. +11 −4 openbsd/include/unistd.h
  19. +16 −12 openbsd/sbin/ifconfig/ifconfig.8
  20. +11 −11 openbsd/sbin/ifconfig/ifconfig.c
  21. +3 −1 openbsd/sbin/ping/ping.8
  22. +7 −5 openbsd/sbin/route/route.8
  23. +48 −86 openbsd/sbin/route/route.c
  24. +47 −24 openbsd/sbin/route/show.c
  25. +69 −26 openbsd/sbin/sysctl/sysctl.8
  26. +99 −4 openbsd/sbin/sysctl/sysctl.c
  27. +2 −2 openbsd/usr.bin/fstat/fstat.1
  28. +12 −27 openbsd/usr.bin/netstat/atalk.c
  29. +7 −13 openbsd/usr.bin/netstat/if.c
  30. +28 −62 openbsd/usr.bin/netstat/inet.c
  31. +33 −41 openbsd/usr.bin/netstat/inet6.c
  32. +20 −28 openbsd/usr.bin/netstat/ipx.c
  33. +19 −49 openbsd/usr.bin/netstat/iso.c
  34. +22 −28 openbsd/usr.bin/netstat/main.c
  35. +6 −7 openbsd/usr.bin/netstat/mbuf.c
  36. +4 −7 openbsd/usr.bin/netstat/mroute.c
  37. +11 −18 openbsd/usr.bin/netstat/mroute6.c
  38. +15 −25 openbsd/usr.bin/netstat/ns.c
  39. +28 −50 openbsd/usr.bin/netstat/route.c
  40. +4 −7 openbsd/usr.bin/netstat/unix.c
  41. +25 −26 openbsd/usr.bin/systat/iostat.c
  42. +2 −2 openbsd/usr.bin/systat/systat.1
  43. +11 −11 openbsd/usr.bin/systat/vmstat.c
  44. +162 −25 openbsd/usr.bin/vmstat/dkstats.c
  45. +2 −1  openbsd/usr.bin/vmstat/dkstats.h
  46. +6 −7 openbsd/usr.bin/vmstat/vmstat.8
  47. +91 −4 openbsd/usr.bin/vmstat/vmstat.c
View
8 openbsd/bin/ls/ls.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ls.1,v 1.33 2002/02/11 18:43:51 mpech Exp $
+.\" $OpenBSD: ls.1,v 1.34 2003/03/12 20:12:35 deraadt Exp $
.\" $NetBSD: ls.1,v 1.14 1995/12/05 02:44:01 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@@ -394,18 +394,18 @@ The
.Nm
utility exits 0 on success or >0 if an error occurred.
.Sh EXAMPLES
-.Cm $ ls -l
+.Li $ ls -l
.Pp
List the contents of the current working directory in long format.
.Pp
-.Cm $ ls -lioF
+.Li $ ls -lioF
.Pp
In addition to listing the contents of the current working directory in
long format, show inode numbers, file flags (see
.Xr chflags 1 ) ,
and suffix each filename with a symbol representing its file type.
.Pp
-.Cm $ ls -lt /var/log
+.Li $ ls -lt /var/log
.Pp
List the files in
.Pa /var/log ,
View
6 openbsd/include/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.113 2002/09/03 18:59:55 markus Exp $
+# $OpenBSD: Makefile,v 1.115 2003/01/20 18:12:52 marc Exp $
# $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
# @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
@@ -10,7 +10,7 @@
FILES= a.out.h ar.h assert.h bitstring.h blf.h bm.h bsd_auth.h cast.h \
cpio.h ctype.h curses.h db.h dbm.h des.h dirent.h disktab.h \
- dlfcn.h elf_abi.h err.h fnmatch.h fstab.h fts.h glob.h grp.h \
+ dlfcn.h elf_abi.h err.h fnmatch.h fstab.h fts.h getopt.h glob.h grp.h \
ifaddrs.h inttypes.h iso646.h kvm.h langinfo.h libgen.h limits.h \
locale.h login_cap.h malloc.h math.h md4.h md5.h memory.h mpool.h \
ndbm.h netdb.h netgroup.h nlist.h nl_types.h ohash.h olf_abi.h \
@@ -34,7 +34,7 @@ LDIRS= crypto ddb dev isofs miscfs net netatalk netccitt netinet altq \
netinet6 netipx netiso netnatm netns nfs scsi sys ufs uvm xfs
# Directories with an includes target
-RDIRS= ../lib/libc_r ../lib/libcom_err ../lib/libcompat ../lib/libcurses \
+RDIRS= ../lib/libpthread ../lib/libcom_err ../lib/libcompat ../lib/libcurses \
../lib/libcurses++ ../lib/libform ../lib/libssl ../lib/libmenu \
../lib/libocurses ../lib/libossaudio ../lib/libpanel ../lib/librpcsvc \
../lib/libskey ../lib/libsectok ../lib/libedit ../lib/libpcap \
View
155 openbsd/include/ctype.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ctype.h,v 1.4 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: ctype.h,v 1.12 2002/12/30 21:36:05 millert Exp $ */
/* $NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $ */
/*
@@ -58,52 +58,129 @@ extern const char *_ctype_;
extern const short *_tolower_tab_;
extern const short *_toupper_tab_;
+#ifdef _ANSI_LIBRARY
__BEGIN_DECLS
-extern int isalnum(int);
-extern int isalpha(int);
-extern int iscntrl(int);
-extern int isdigit(int);
-extern int isgraph(int);
-extern int islower(int);
-extern int isprint(int);
-extern int ispunct(int);
-extern int isspace(int);
-extern int isupper(int);
-extern int isxdigit(int);
-extern int tolower(int);
-extern int toupper(int);
+int isalnum(int);
+int isalpha(int);
+int iscntrl(int);
+int isdigit(int);
+int isgraph(int);
+int islower(int);
+int isprint(int);
+int ispunct(int);
+int isspace(int);
+int isupper(int);
+int isxdigit(int);
+int tolower(int);
+int toupper(int);
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
-extern int isblank(int);
-extern int isascii(int);
-extern int toascii(int);
-extern int _tolower(int);
-extern int _toupper(int);
+int isblank(int);
+int isascii(int);
+int toascii(int);
+int _tolower(int);
+int _toupper(int);
#endif
__END_DECLS
-#define isdigit(c) ((_ctype_ + 1)[(unsigned char)(c)] & _N)
-#define islower(c) ((_ctype_ + 1)[(unsigned char)(c)] & _L)
-#define isspace(c) ((_ctype_ + 1)[(unsigned char)(c)] & _S)
-#define ispunct(c) ((_ctype_ + 1)[(unsigned char)(c)] & _P)
-#define isupper(c) ((_ctype_ + 1)[(unsigned char)(c)] & _U)
-#define isalpha(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_U|_L))
-#define isxdigit(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_N|_X))
-#define isalnum(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_U|_L|_N))
-#define isprint(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_P|_U|_L|_N|_B))
-#define isgraph(c) ((_ctype_ + 1)[(unsigned char)(c)] & (_P|_U|_L|_N))
-#define iscntrl(c) ((_ctype_ + 1)[(unsigned char)(c)] & _C)
-#define tolower(c) ((_tolower_tab_ + 1)[(unsigned char)(c)])
-#define toupper(c) ((_toupper_tab_ + 1)[(unsigned char)(c)])
+#else /* !_ANSI_LIBRARY */
+
+static __inline int isalnum(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L|_N)));
+}
+
+static __inline int isalpha(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_U|_L)));
+}
+
+static __inline int iscntrl(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _C));
+}
+
+static __inline int isdigit(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _N));
+}
+
+static __inline int isgraph(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N)));
+}
+
+static __inline int islower(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _L));
+}
+
+static __inline int isprint(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_P|_U|_L|_N|_B)));
+}
+
+static __inline int ispunct(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _P));
+}
+
+static __inline int isspace(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _S));
+}
+
+static __inline int isupper(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & _U));
+}
+
+static __inline int isxdigit(int c)
+{
+ return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)(c & 0xff)] & (_N|_X)));
+}
+
+static __inline int tolower(int c)
+{
+ if ((unsigned int)c > 0177)
+ return (c);
+ return ((_tolower_tab_ + 1)[c]);
+}
+
+static __inline int toupper(int c)
+{
+ if ((unsigned int)c > 0177)
+ return (c);
+ return ((_toupper_tab_ + 1)[c]);
+}
#if !defined(_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
-#if notyet
-#define isblank(c) ((_ctype_ + 1)[(unsigned char)(c)] & _B)
-#endif
-#define isascii(c) ((unsigned char)(c) <= 0177)
-#define toascii(c) ((c) & 0177)
-#define _tolower(c) ((c) - 'A' + 'a')
-#define _toupper(c) ((c) - 'a' + 'A')
+static __inline int isblank(int c)
+{
+ return (c == ' ' || c == '\t');
+}
+
+static __inline int isascii(int c)
+{
+ return ((unsigned int)c <= 0177);
+}
+
+static __inline int toascii(int c)
+{
+ return (c & 0177);
+}
+
+static __inline int _tolower(int c)
+{
+ return (c - 'A' + 'a');
+}
+
+static __inline int _toupper(int c)
+{
+ return (c - 'a' + 'A');
+}
#endif
+#endif /* !_ANSI_LIBRARY */
+
#endif /* !_CTYPE_H_ */
View
4 openbsd/include/dirent.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirent.h,v 1.8 2002/02/17 19:42:21 millert Exp $ */
+/* $OpenBSD: dirent.h,v 1.9 2002/10/25 21:55:28 millert Exp $ */
/* $NetBSD: dirent.h,v 1.9 1995/03/26 20:13:37 jtc Exp $ */
/*-
@@ -85,7 +85,7 @@ typedef struct _dirdesc {
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
View
85 openbsd/include/getopt.h
@@ -0,0 +1,85 @@
+/* $OpenBSD: getopt.h,v 1.1 2002/12/03 20:24:29 millert Exp $ */
+/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * 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 NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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 _GETOPT_H_
+#define _GETOPT_H_
+
+#include <sys/cdefs.h>
+
+/*
+ * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
+ */
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+struct option {
+ /* name of long option */
+ const char *name;
+ /*
+ * one of no_argument, required_argument, and optional_argument:
+ * whether option takes an argument
+ */
+ int has_arg;
+ /* if not NULL, set *flag to val when option found */
+ int *flag;
+ /* if flag not NULL, value to set *flag to; else return value */
+ int val;
+};
+
+__BEGIN_DECLS
+int getopt_long(int, char * const *, const char *,
+ const struct option *, int *);
+int getopt_long_only(int, char * const *, const char *,
+ const struct option *, int *);
+#ifndef _GETOPT_DEFINED_
+#define _GETOPT_DEFINED_
+int getopt(int, char * const *, const char *);
+int getsubopt(char **, char * const *, char **);
+
+extern char *optarg; /* getopt(3) external variables */
+extern int opterr;
+extern int optind;
+extern int optopt;
+extern int optreset;
+extern char *suboptarg; /* getsubopt(3) external variable */
+#endif
+__END_DECLS
+
+#endif /* !_GETOPT_H_ */
View
4 openbsd/include/locale.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: locale.h,v 1.4 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: locale.h,v 1.5 2002/10/25 21:55:28 millert Exp $ */
/* $NetBSD: locale.h,v 1.6 1994/10/26 00:56:02 cgd Exp $ */
/*
@@ -64,7 +64,7 @@ struct lconv {
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
View
6 openbsd/include/md4.h
@@ -1,5 +1,5 @@
/* MD4.H - header file for MD4C.C
- * $OpenBSD: md4.h,v 1.6 2002/02/16 21:27:17 millert Exp $
+ * $OpenBSD: md4.h,v 1.7 2002/12/23 04:33:31 millert Exp $
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
@@ -33,6 +33,9 @@ typedef struct MD4Context {
unsigned char buffer[64]; /* input buffer */
} MD4_CTX;
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
void MD4Init(MD4_CTX *);
void MD4Update(MD4_CTX *, const unsigned char *, size_t);
void MD4Final(unsigned char [16], MD4_CTX *);
@@ -40,5 +43,6 @@ void MD4Transform(u_int32_t [4], const unsigned char [64]);
char * MD4End(MD4_CTX *, char *);
char * MD4File(char *, char *);
char * MD4Data(const unsigned char *, size_t, char *);
+__END_DECLS
#endif /* _MD4_H_ */
View
6 openbsd/include/md5.h
@@ -1,5 +1,5 @@
/* MD5.H - header file for MD5C.C
- * $OpenBSD: md5.h,v 1.6 2002/02/16 21:27:17 millert Exp $
+ * $OpenBSD: md5.h,v 1.7 2002/12/23 04:33:31 millert Exp $
*/
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
@@ -34,6 +34,9 @@ typedef struct MD5Context {
unsigned char buffer[64]; /* input buffer */
} MD5_CTX;
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
void MD5Init(MD5_CTX *);
void MD5Update(MD5_CTX *, const unsigned char *, size_t);
void MD5Final(unsigned char [16], MD5_CTX *);
@@ -41,5 +44,6 @@ void MD5Transform(u_int32_t [4], const unsigned char [64]);
char * MD5End(MD5_CTX *, char *);
char * MD5File(char *, char *);
char * MD5Data(const unsigned char *, size_t, char *);
+__END_DECLS
#endif /* _MD5_H_ */
View
6 openbsd/include/rmd160.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmd160.h,v 1.6 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: rmd160.h,v 1.7 2002/12/23 04:33:31 millert Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
*
@@ -32,6 +32,9 @@ typedef struct RMD160Context {
u_char buffer[64]; /* input buffer */
} RMD160_CTX;
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
void RMD160Init(RMD160_CTX *);
void RMD160Transform(u_int32_t [5], const u_char [64]);
void RMD160Update(RMD160_CTX *, const u_char *, u_int32_t);
@@ -39,5 +42,6 @@ void RMD160Final(u_char [20], RMD160_CTX *);
char *RMD160End(RMD160_CTX *, char *);
char *RMD160File(char *, char *);
char *RMD160Data(const u_char *, size_t, char *);
+__END_DECLS
#endif /* _RMD160_H */
View
6 openbsd/include/rpc/clnt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: clnt.h,v 1.7 2002/02/17 19:42:21 millert Exp $ */
+/* $OpenBSD: clnt.h,v 1.9 2003/03/16 00:34:01 margarida Exp $ */
/* $NetBSD: clnt.h,v 1.6 1995/04/29 05:27:58 cgd Exp $ */
/*
@@ -73,7 +73,7 @@ enum clnt_stat {
* callrpc & clnt_create errors
*/
RPC_UNKNOWNHOST=13, /* unknown host name */
- RPC_UNKNOWNPROTO=17, /* unkown protocol */
+ RPC_UNKNOWNPROTO=17, /* unknown protocol */
/*
* _ create errors
@@ -93,7 +93,7 @@ enum clnt_stat {
struct rpc_err {
enum clnt_stat re_status;
union {
- int RE_errno; /* realated system error */
+ int RE_errno; /* related system error */
enum auth_stat RE_why; /* why the auth error occurred */
struct {
u_int32_t low; /* lowest verion supported */
View
6 openbsd/include/rpc/xdr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xdr.h,v 1.4 2002/02/17 19:42:21 millert Exp $ */
+/* $OpenBSD: xdr.h,v 1.6 2003/03/10 03:45:20 david Exp $ */
/* $NetBSD: xdr.h,v 1.7 1995/04/29 05:28:06 cgd Exp $ */
/*
@@ -120,7 +120,7 @@ typedef struct __rpc_xdr {
caddr_t x_public; /* users' data */
caddr_t x_private; /* pointer to private data */
caddr_t x_base; /* private used for position info */
- int x_handy; /* extra private word */
+ u_int x_handy; /* extra private word */
} XDR;
/*
@@ -203,7 +203,7 @@ struct xdr_discrim {
};
/*
- * In-line routines for fast encode/decode of primitve data types.
+ * In-line routines for fast encode/decode of primitive data types.
* Caveat emptor: these use single memory cycles to get the
* data from the underlying buffer, and will fail to operate
* properly if the data is not aligned. The standard way to use these
View
36 openbsd/include/sha1.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sha1.h,v 1.10 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: sha1.h,v 1.11 2002/12/23 04:33:31 millert Exp $ */
/*
* SHA-1 in C
@@ -11,10 +11,13 @@
typedef struct {
u_int32_t state[5];
- u_int32_t count[2];
+ u_int32_t count[2];
u_char buffer[64];
} SHA1_CTX;
-
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
void SHA1Transform(u_int32_t state[5], const u_char buffer[64]);
void SHA1Init(SHA1_CTX *context);
void SHA1Update(SHA1_CTX *context, const u_char *data, u_int len);
@@ -22,21 +25,22 @@ void SHA1Final(u_char digest[20], SHA1_CTX *context);
char *SHA1End(SHA1_CTX *, char *);
char *SHA1File(char *, char *);
char *SHA1Data(const u_char *, size_t, char *);
+__END_DECLS
#define SHA1_DIGESTSIZE 20
#define SHA1_BLOCKSIZE 64
-#define HTONDIGEST(x) { \
- x[0] = htonl(x[0]); \
- x[1] = htonl(x[1]); \
- x[2] = htonl(x[2]); \
- x[3] = htonl(x[3]); \
- x[4] = htonl(x[4]); }
-
-#define NTOHDIGEST(x) { \
- x[0] = ntohl(x[0]); \
- x[1] = ntohl(x[1]); \
- x[2] = ntohl(x[2]); \
- x[3] = ntohl(x[3]); \
- x[4] = ntohl(x[4]); }
+#define HTONDIGEST(x) do { \
+ x[0] = htonl(x[0]); \
+ x[1] = htonl(x[1]); \
+ x[2] = htonl(x[2]); \
+ x[3] = htonl(x[3]); \
+ x[4] = htonl(x[4]); } while (0)
+
+#define NTOHDIGEST(x) do { \
+ x[0] = ntohl(x[0]); \
+ x[1] = ntohl(x[1]); \
+ x[2] = ntohl(x[2]); \
+ x[3] = ntohl(x[3]); \
+ x[4] = ntohl(x[4]); } while (0)
#endif /* _SHA1_H */
View
4 openbsd/include/stddef.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stddef.h,v 1.4 1999/11/27 13:20:25 espie Exp $ */
+/* $OpenBSD: stddef.h,v 1.5 2002/10/25 21:55:28 millert Exp $ */
/* $NetBSD: stddef.h,v 1.4 1994/10/26 00:56:26 cgd Exp $ */
/*-
@@ -60,7 +60,7 @@ typedef _BSD_WCHAR_T_ wchar_t;
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
View
5 openbsd/include/stdio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdio.h,v 1.22 2002/02/19 19:39:36 millert Exp $ */
+/* $OpenBSD: stdio.h,v 1.25 2002/12/30 21:36:06 millert Exp $ */
/* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */
/*-
@@ -63,7 +63,7 @@ typedef _BSD_OFF_T_ off_t;
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
@@ -175,6 +175,7 @@ __END_DECLS
#define _IONBF 2 /* setvbuf should set unbuffered */
#define BUFSIZ 1024 /* size of buffer used by setbuf */
+
#define EOF (-1)
/*
View
11 openbsd/include/stdlib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: stdlib.h,v 1.20 2002/06/29 00:20:11 millert Exp $ */
+/* $OpenBSD: stdlib.h,v 1.24 2002/12/03 20:24:29 millert Exp $ */
/* $NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $ */
/*-
@@ -79,7 +79,7 @@ typedef struct {
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
@@ -108,12 +108,16 @@ int atexit(void (*)(void));
double atof(const char *);
int atoi(const char *);
long atol(const char *);
+long long atoll(const char *);
void *bsearch(const void *, const void *, size_t, size_t,
int (*)(const void *, const void *));
void *calloc(size_t, size_t);
div_t div(int, int);
+char *ecvt(double, int, int *, int *);
__dead void exit(int);
+char *fcvt(double, int, int *, int *);
void free(void *);
+char *gcvt(double, int, char *);
char *getenv(const char *);
long labs(long);
ldiv_t ldiv(long, long);
@@ -169,6 +173,8 @@ char *l64a(long);
void cfree(void *);
+#ifndef _GETOPT_DEFINED_
+#define _GETOPT_DEFINED_
int getopt(int, char * const *, const char *);
extern char *optarg; /* getopt(3) external variables */
extern int opterr;
@@ -177,6 +183,7 @@ extern int optopt;
extern int optreset;
int getsubopt(char **, char * const *, char **);
extern char *suboptarg; /* getsubopt(3) external variable */
+#endif /* _GETOPT_DEFINED_ */
int heapsort(void *, size_t, size_t, int (*)(const void *, const void *));
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
View
5 openbsd/include/string.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: string.h,v 1.7 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: string.h,v 1.9 2002/11/21 20:42:39 marc Exp $ */
/* $NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $ */
/*-
@@ -49,7 +49,7 @@ typedef _BSD_SIZE_T_ size_t;
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
@@ -68,6 +68,7 @@ int strcoll(const char *, const char *);
char *strcpy(char *, const char *);
size_t strcspn(const char *, const char *);
char *strerror(int);
+int strerror_r(int, char *, size_t);
size_t strlen(const char *);
char *strncat(char *, const char *, size_t);
int strncmp(const char *, const char *, size_t);
View
4 openbsd/include/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.11 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: time.h,v 1.12 2002/10/25 21:55:28 millert Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/*
@@ -51,7 +51,7 @@
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0
+#define NULL 0L
#endif
#endif
View
15 openbsd/include/unistd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unistd.h,v 1.42 2002/09/17 21:15:58 deraadt Exp $ */
+/* $OpenBSD: unistd.h,v 1.45 2002/12/03 20:24:29 millert Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@@ -51,7 +51,7 @@
#ifdef __GNUG__
#define NULL __null
#else
-#define NULL 0 /* null pointer constant */
+#define NULL 0L
#endif
#endif
@@ -146,6 +146,8 @@ long gethostid(void);
int gethostname(char *, size_t);
mode_t getmode(const void *, mode_t);
int getpagesize(void);
+int getresgid(gid_t *, gid_t *, gid_t *);
+int getresuid(uid_t *, uid_t *, uid_t *);
char *getpass(const char *);
char *getusershell(void);
char *getwd(char *); /* obsoleted by getcwd() */
@@ -194,8 +196,10 @@ int setkey(const char *);
int setlogin(const char *);
void *setmode(const char *);
int setpgrp(pid_t pid, pid_t pgrp); /* obsoleted by setpgid() */
-int setregid(int, int);
-int setreuid(int, int);
+int setregid(gid_t, gid_t);
+int setresgid(gid_t, gid_t, gid_t);
+int setresuid(uid_t, uid_t, uid_t);
+int setreuid(uid_t, uid_t);
int setrgid(gid_t);
int setruid(uid_t);
void setusershell(void);
@@ -215,6 +219,8 @@ void *valloc(size_t); /* obsoleted by malloc() */
pid_t vfork(void);
int issetugid(void);
+#ifndef _GETOPT_DEFINED_
+#define _GETOPT_DEFINED_
int getopt(int, char * const *, const char *);
extern char *optarg; /* getopt(3) external variables */
extern int opterr;
@@ -223,6 +229,7 @@ extern int optopt;
extern int optreset;
int getsubopt(char **, char * const *, char **);
extern char *suboptarg; /* getsubopt(3) external variable */
+#endif /* _GETOPT_DEFINED_ */
#endif /* !_POSIX_SOURCE */
#if (!defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) && \
View
28 openbsd/sbin/ifconfig/ifconfig.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ifconfig.8,v 1.58 2002/06/14 09:14:24 itojun Exp $
+.\" $OpenBSD: ifconfig.8,v 1.64 2003/03/12 20:12:36 deraadt Exp $
.\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $
.\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $
.\"
@@ -217,7 +217,7 @@ Packets routed to this interface will be encapsulated in
IPv4 or IPv6, depending on the source and destination address families.
Both addresses must be of the same family.
.It Cm deletetunnel
-Removes the source and dsetination tunnel addresses,
+Removes the source and destination tunnel addresses,
configured onto a tunnel interface.
.It Cm ipdst
This is used to specify an Internet host who is willing to receive
@@ -259,7 +259,7 @@ would activate twisted pair.
Refer to the interfaces' driver
specific man page for a complete list of the available types,
or use
-.Cm ifconfig -m interface
+.Li # ifconfig -m interface
for a listing of choices.
.It Cm mediaopt Ar opts
Set the specified media options on the interface.
@@ -456,7 +456,7 @@ Set the receiver sleep duration (in milliseconds) for 802.11 power saving mode.
(inet and inet6 only)
Effect is similar to
.Cm netmask ,
-but you can specify by prefix length by digits.
+but you can specify prefix length by digits.
.It Cm range
Under AppleTalk, set the interface to respond to a
.Em netrange
@@ -471,7 +471,7 @@ Set the IPv6 tentative address bit.
.It Fl tentative
(inet6 only)
Clear the IPv6 tentative address bit.
-.It eui64
+.It Cm eui64
(inet6 only)
Fill interface index
.Pq lowermost 64bit of an IPv6 address
@@ -509,6 +509,10 @@ the hardware will be re-initialized.
.It Cm vltime Ar n
(inet6 only)
Set valid lifetime for the address.
+.It Cm 802.2 802.2tr 802.3 snap EtherII
+Set the
+.Xr ipx 3
+frame type to be either 802.2, 802.2tr, 802.3, snap or Ethernet II.
.El
.Pp
.Pp
@@ -525,7 +529,7 @@ causes
to print information on all interfaces.
The protocol family may be specified as well.
Additionally, if
-.Fl am ,
+.Fl am
is used, interface media information is printed.
.Pp
If
@@ -545,24 +549,24 @@ for that interface will be printed.
Only the superuser may modify the configuration of a network interface.
.Sh EXAMPLES
.Bl -tag -width ifconfig
-.It Cm ifconfig fxp0 inet 192.168.1.10 netmask 255.255.255.0
+.It Cm # ifconfig fxp0 inet 192.168.1.10 netmask 255.255.255.0
Assign the inet(4) address of 192.168.1.10 with a network mask of
255.255.255.0 to interface fxp0.
.Pp
-.It Cm ifconfig fxp0 ipx 12625920
+.It Cm # ifconfig fxp0 ipx 12625920
Assign the ipx(3) address of 12625920 specified in decimal to interface fxp0.
.Pp
-.It Cm ifconfig fxp0 atalk 39108.128 range 39107-39109 phase 2
+.It Cm # ifconfig fxp0 atalk 39108.128 range 39107-39109 phase 2
Assign the AppleTalk network 39108 and server node 128 with a network
range of 39107-39109 to interface fxp0 on a phase 2 AppleTalk network.
.Pp
-.It Cm ifconfig xl0 media 10baseT
+.It Cm # ifconfig xl0 media 10baseT
Configure the xl0 interface to use 10baseT.
.Pp
-.It Cm ifconfig xl0 media 100baseTX mediaopt full-duplex
+.It Cm # ifconfig xl0 media 100baseTX mediaopt full-duplex
Configure the xl0 interface to use 100baseTX, full duplex.
.Pp
-.It Cm ifconfig vlan0 192.168.254.1 vlan 4 vlandev fxp0
+.It Cm # ifconfig vlan0 192.168.254.1 vlan 4 vlandev fxp0
Configure the vlan0 interface for IP address 192.168.254.1, vlan tag 4,
and vlan parent device fxp0.
.El
View
22 openbsd/sbin/ifconfig/ifconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifconfig.c,v 1.69 2002/07/08 00:48:54 deraadt Exp $ */
+/* $OpenBSD: ifconfig.c,v 1.73 2003/03/16 05:20:27 margarida Exp $ */
/* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */
/*
@@ -81,7 +81,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)ifconfig.c 8.2 (Berkeley) 2/16/94";
#else
-static const char rcsid[] = "$OpenBSD: ifconfig.c,v 1.69 2002/07/08 00:48:54 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: ifconfig.c,v 1.73 2003/03/16 05:20:27 margarida Exp $";
#endif
#endif /* not lint */
@@ -207,7 +207,7 @@ int prefix(void *val, int);
/*
* Media stuff. Whenever a media command is first performed, the
* currently select media is grabbed for this interface. If `media'
- * is given, the current media word is modifed. `mediaopt' commands
+ * is given, the current media word is modified. `mediaopt' commands
* only modify the set and clear words. They then operate on the
* current media word later.
*/
@@ -997,7 +997,7 @@ setia6eui64(cmd, val)
}
}
if (!lladdr)
- errx(1, "could not determine link local address");
+ errx(1, "could not determine link local address");
memcpy(&in6->s6_addr[8], &lladdr->s6_addr[8], 8);
@@ -2333,7 +2333,7 @@ in6_getaddr(s, which)
#ifndef KAME_SCOPEID
struct sockaddr_in6 *sin6 = sin6tab[which];
- sin->sin6_len = sizeof(*sin6);
+ sin6->sin6_len = sizeof(*sin6);
if (which != MASK)
sin6->sin6_family = AF_INET6;
@@ -2371,21 +2371,21 @@ in6_getprefix(plen, which)
char *plen;
int which;
{
- struct sockaddr_in6 *sin = sin6tab[which];
+ struct sockaddr_in6 *sin6 = sin6tab[which];
u_char *cp;
int len = strtol(plen, (char **)NULL, 10);
if ((len < 0) || (len > 128))
errx(1, "%s: bad value", plen);
- sin->sin6_len = sizeof(*sin);
+ sin6->sin6_len = sizeof(*sin6);
if (which != MASK)
- sin->sin6_family = AF_INET6;
+ sin6->sin6_family = AF_INET6;
if ((len == 0) || (len == 128)) {
- memset(&sin->sin6_addr, 0xff, sizeof(struct in6_addr));
+ memset(&sin6->sin6_addr, 0xff, sizeof(struct in6_addr));
return;
}
- memset((void *)&sin->sin6_addr, 0x00, sizeof(sin->sin6_addr));
- for (cp = (u_char *)&sin->sin6_addr; len > 7; len -= 8)
+ memset((void *)&sin6->sin6_addr, 0x00, sizeof(sin6->sin6_addr));
+ for (cp = (u_char *)&sin6->sin6_addr; len > 7; len -= 8)
*cp++ = 0xff;
if (len)
*cp = 0xff << (8 - len);
View
4 openbsd/sbin/ping/ping.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ping.8,v 1.25 2002/06/22 22:47:45 jakob Exp $
+.\" $OpenBSD: ping.8,v 1.26 2003/02/11 07:26:20 jmc Exp $
.\" $NetBSD: ping.8,v 1.10 1995/12/31 04:55:35 ghudson Exp $
.\"
.\" Copyright (c) 1985, 1991, 1993
@@ -44,6 +44,7 @@
packets to network hosts
.Sh SYNOPSIS
.Nm ping
+.Bk -words
.Op Fl DdfLnqRrv
.Op Fl c Ar count
.Op Fl I Ar ifaddr
@@ -55,6 +56,7 @@ packets to network hosts
.Op Fl t Ar ttl
.Op Fl w Ar maxwait
.Ar host
+.Ek
.Sh DESCRIPTION
.Nm
uses the
View
12 openbsd/sbin/route/route.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: route.8,v 1.27 2002/06/08 18:53:42 itojun Exp $
+.\" $OpenBSD: route.8,v 1.28 2003/02/11 07:26:20 jmc Exp $
.\" $NetBSD: route.8,v 1.6 1995/03/18 15:00:13 cgd Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -52,7 +52,7 @@
.Nm
is a utility used to manually manipulate the network routing tables.
It normally is not needed, as a
-system routing table management daemon such as
+system routing table management daemon, such as
.Xr routed 8 ,
should tend to this task.
.Pp
@@ -186,7 +186,7 @@ and
is interpreted as
.Li 128.32.130.0 .
A more detailed syntax is also available, for example
-.Li net 192.168.64.0/20
+.Fl net Li 192.168.64.0/20
is interpreted to specify that the high 20 bits of the address
192.168.64.0 are the requested network.
.Pp
@@ -234,7 +234,7 @@ The implicit network mask generated in the
case
can be overridden by making sure this option follows the destination parameter.
.Fl prefixlen
-is also available for similar purpose, in IPv6/v4 case.
+is also available for a similar purpose, for IPv6/v4.
.Pp
Routes have associated flags which influence operation of the protocols
when sending to destinations matched by the routes.
@@ -361,7 +361,9 @@ Some uses of the
.Fl ifa
or
.Fl ifp
-modifiers with the add command will incorrectly fail with a
+modifiers with the
+.Cm add
+command will incorrectly fail with a
.Dq Network is unreachable
message if there is no default route.
See case
View
134 openbsd/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.50 2002/06/10 21:19:24 itojun Exp $ */
+/* $OpenBSD: route.c,v 1.56 2003/03/13 09:09:27 deraadt Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1983, 1989, 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
+static const char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: route.c,v 1.50 2002/06/10 21:19:24 itojun Exp $";
+static const char rcsid[] = "$OpenBSD: route.c,v 1.56 2003/03/13 09:09:27 deraadt Exp $";
#endif
#endif /* not lint */
@@ -123,8 +123,7 @@ int x25_makemask(void);
extern void show(int, char **); /* XXX - from show.c */
__dead void
-usage(cp)
- char *cp;
+usage(char *cp)
{
if (cp)
(void) fprintf(stderr, "route: botched keyword: %s\n", cp);
@@ -137,8 +136,7 @@ usage(cp)
}
void
-quit(s)
- char *s;
+quit(char *s)
{
int sverrno = errno;
@@ -155,9 +153,7 @@ quit(s)
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
int ch;
int rval = 0;
@@ -189,9 +185,9 @@ main(argc, argv)
argv += optind;
pid = getpid();
- uid = getuid();
+ uid = geteuid();
if (tflag)
- s = open("/dev/null", O_WRONLY);
+ s = open(_PATH_DEVNULL, O_WRONLY);
else
s = socket(PF_ROUTE, SOCK_RAW, 0);
if (s < 0)
@@ -229,9 +225,7 @@ main(argc, argv)
* associated with network interfaces.
*/
void
-flushroutes(argc, argv)
- int argc;
- char *argv[];
+flushroutes(int argc, char **argv)
{
size_t needed;
int mib[6], rlen, seqno;
@@ -346,8 +340,7 @@ bad: usage(*argv);
static char hexlist[] = "0123456789abcdef";
char *
-any_ntoa(sa)
- const struct sockaddr *sa;
+any_ntoa(const struct sockaddr *sa)
{
static char obuf[240];
const char *in = sa->sa_data;
@@ -365,8 +358,7 @@ any_ntoa(sa)
}
char *
-routename(sa)
- struct sockaddr *sa;
+routename(struct sockaddr *sa)
{
char *cp = NULL;
static char line[MAXHOSTNAMELEN];
@@ -380,14 +372,14 @@ routename(sa)
first = 0;
if (gethostname(domain, sizeof domain) == 0 &&
(cp = strchr(domain, '.')))
- (void) strcpy(domain, cp + 1);
+ (void) strlcpy(domain, cp + 1, sizeof domain);
else
domain[0] = 0;
cp = NULL;
}
if (sa->sa_len == 0)
- strcpy(line, "default");
+ (void) strlcpy(line, "default", sizeof line);
else switch (sa->sa_family) {
case AF_INET:
@@ -471,8 +463,7 @@ routename(sa)
* The address is assumed to be that of a net or subnet, not a host.
*/
char *
-netname(sa)
- struct sockaddr *sa;
+netname(struct sockaddr *sa)
{
char *cp = NULL;
static char line[MAXHOSTNAMELEN];
@@ -579,9 +570,7 @@ netname(sa)
}
void
-set_metric(value, key)
- char *value;
- int key;
+set_metric(char *value, int key)
{
int flag = 0;
u_long noval, *valp = &noval;
@@ -606,9 +595,7 @@ set_metric(value, key)
}
int
-newroute(argc, argv)
- int argc;
- char **argv;
+newroute(int argc, char **argv)
{
char *cmd, *dest = "", *gateway = "", *err;
int ishost = 0, ret = 0, attempts, oerrno, flags = RTF_STATIC;
@@ -735,8 +722,9 @@ newroute(argc, argv)
forcenet++;
break;
case K_PREFIXLEN:
- argc--;
- prefixlen(*++argv);
+ if (!--argc)
+ usage(1+*argv);
+ ishost = prefixlen(*++argv);
break;
case K_MTU:
case K_HOPCOUNT:
@@ -841,10 +829,7 @@ newroute(argc, argv)
}
void
-inet_makenetandmask(net, sin, bits)
- u_int32_t net;
- struct sockaddr_in *sin;
- int bits;
+inet_makenetandmask(u_int32_t net, struct sockaddr_in *sin, int bits)
{
u_int32_t addr, mask = 0;
char *cp;
@@ -891,8 +876,7 @@ inet_makenetandmask(net, sin, bits)
* XXX the function may need more improvement...
*/
static int
-inet6_makenetandmask(sin6)
- struct sockaddr_in6 *sin6;
+inet6_makenetandmask(struct sockaddr_in6 *sin6)
{
char *plen = NULL;
struct in6_addr in6;
@@ -922,10 +906,7 @@ inet6_makenetandmask(sin6)
* returning 1 if a host address, 0 if a network address.
*/
int
-getaddr(which, s, hpp)
- int which;
- char *s;
- struct hostent **hpp;
+getaddr(int which, char *s, struct hostent **hpp)
{
sup su = NULL;
struct ns_addr ns_addr();
@@ -1131,8 +1112,7 @@ getaddr(which, s, hpp)
}
int
-prefixlen(s)
- char *s;
+prefixlen(char *s)
{
int len = atoi(s), q, r;
int max;
@@ -1152,12 +1132,12 @@ prefixlen(s)
exit(1);
}
- rtm_addrs |= RTA_NETMASK;
+ rtm_addrs |= RTA_NETMASK;
if (len < -1 || len > max) {
(void) fprintf(stderr, "%s: bad value\n", s);
exit(1);
}
-
+
q = len >> 3;
r = len & 7;
switch (af) {
@@ -1181,11 +1161,11 @@ prefixlen(s)
break;
#endif
}
- return(len);
+ return (len == max);
}
int
-x25_makemask()
+x25_makemask(void)
{
char *cp;
@@ -1203,8 +1183,7 @@ short ns_nullh[] = {0,0,0};
short ns_bh[] = {-1,-1,-1};
char *
-ns_print(sns)
- struct sockaddr_ns *sns;
+ns_print(struct sockaddr_ns *sns)
{
struct ns_addr work;
union { union ns_net net_e; u_int32_t long_e; } net;
@@ -1221,7 +1200,7 @@ ns_print(sns)
if (ns_nullhost(work) && net.long_e == 0) {
if (!port)
return ("*.*");
- (void) sprintf(mybuf, "*.0x%x", port);
+ (void) snprintf(mybuf, sizeof mybuf, "*.0x%x", port);
return (mybuf);
}
@@ -1231,12 +1210,12 @@ ns_print(sns)
host = "*";
else {
q = work.x_host.c_host;
- (void) sprintf(chost, "0x%02x%02x%02x%02x%02x%02x",
+ (void) snprintf(chost, sizeof chost, "0x%02x%02x%02x%02x%02x%02x",
q[0], q[1], q[2], q[3], q[4], q[5]);
host = chost;
}
if (port)
- (void) sprintf(cport, ".0x%x", htons(port));
+ (void) snprintf(cport, sizeof cport, ".0x%x", htons(port));
else
*cport = '\0';
@@ -1249,8 +1228,7 @@ short ipx_nullh[] = {0,0,0};
short ipx_bh[] = {-1,-1,-1};
char *
-ipx_print(sipx)
- struct sockaddr_ipx *sipx;
+ipx_print(struct sockaddr_ipx *sipx)
{
struct ipx_addr work;
union { union ipx_net net_e; u_int32_t long_e; } net;
@@ -1267,7 +1245,7 @@ ipx_print(sipx)
if (ipx_nullhost(work) && net.long_e == 0) {
if (!port)
return ("*.*");
- (void) sprintf(mybuf, "*.0x%XH", port);
+ (void) snprintf(mybuf, sizeof mybuf, "*.0x%XH", port);
return (mybuf);
}
@@ -1277,14 +1255,14 @@ ipx_print(sipx)
host = "*";
else {
q = work.ipx_host.c_host;
- (void) sprintf(chost, "%02X%02X%02X%02X%02X%02XH",
+ (void) snprintf(chost, sizeof chost, "%02X%02X%02X%02X%02X%02XH",
q[0], q[1], q[2], q[3], q[4], q[5]);
for (p = chost; *p == '0' && p < chost + 12; p++)
/* void */;
host = p;
}
if (port)
- (void) sprintf(cport, ".%XH", htons(port));
+ (void) snprintf(cport, sizeof cport, ".%XH", htons(port));
else
*cport = 0;
@@ -1294,7 +1272,7 @@ ipx_print(sipx)
}
void
-interfaces()
+interfaces(void)
{
size_t needed;
int mib[6];
@@ -1324,7 +1302,7 @@ interfaces()
}
void
-monitor()
+monitor(void)
{
int n;
char msg[2048];
@@ -1349,8 +1327,7 @@ struct {
} m_rtmsg;
int
-rtmsg(cmd, flags)
- int cmd, flags;
+rtmsg(int cmd, int flags)
{
static int seq;
int rlen;
@@ -1420,7 +1397,7 @@ rtmsg(cmd, flags)
}
void
-mask_addr()
+mask_addr(void)
{
int olen = so_mask.sa.sa_len;
char *cp1 = olen + (char *)&so_mask, *cp2;
@@ -1490,9 +1467,7 @@ char addrnames[] =
"\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD";
void
-print_rtmsg(rtm, msglen)
- struct rt_msghdr *rtm;
- int msglen;
+print_rtmsg(struct rt_msghdr *rtm, int msglen)
{
struct if_msghdr *ifm;
struct ifa_msghdr *ifam;
@@ -1528,9 +1503,7 @@ print_rtmsg(rtm, msglen)
}
void
-print_getmsg(rtm, msglen)
- struct rt_msghdr *rtm;
- int msglen;
+print_getmsg(struct rt_msghdr *rtm, int msglen)
{
struct sockaddr *dst = NULL, *gate = NULL, *mask = NULL;
struct sockaddr_dl *ifp = NULL;
@@ -1626,8 +1599,7 @@ print_getmsg(rtm, msglen)
}
void
-pmsg_common(rtm)
- struct rt_msghdr *rtm;
+pmsg_common(struct rt_msghdr *rtm)
{
(void) printf("\nlocks: ");
bprintf(stdout, rtm->rtm_rmx.rmx_locks, metricnames);
@@ -1637,9 +1609,7 @@ pmsg_common(rtm)
}
void
-pmsg_addrs(cp, addrs)
- char *cp;
- int addrs;
+pmsg_addrs(char *cp, int addrs)
{
struct sockaddr *sa;
int i;
@@ -1660,10 +1630,7 @@ pmsg_addrs(cp, addrs)
}
void
-bprintf(fp, b, s)
- FILE *fp;
- int b;
- u_char *s;
+bprintf(FILE *fp, int b, u_char *s)
{
int i;
int gotsome = 0;
@@ -1689,8 +1656,7 @@ bprintf(fp, b, s)
}
int
-keyword(cp)
- char *cp;
+keyword(char *cp)
{
struct keytab *kt = keywords;
@@ -1700,9 +1666,7 @@ keyword(cp)
}
void
-sodump(su, which)
- sup su;
- char *which;
+sodump(sup su, char *which)
{
#ifdef INET6
char ntop_buf[NI_MAXHOST]; /*for inet_ntop()*/
@@ -1750,9 +1714,7 @@ sodump(su, which)
#define DELIM (4*2)
void
-sockaddr(addr, sa)
- char *addr;
- struct sockaddr *sa;
+sockaddr(char *addr, struct sockaddr *sa)
{
char *cp = (char *)sa;
int size = sa->sa_len;
View
71 openbsd/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.21 2002/02/16 21:27:37 millert Exp $ */
+/* $OpenBSD: show.c,v 1.22 2003/03/13 09:09:27 deraadt Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: show.c,v 1.21 2002/02/16 21:27:37 millert Exp $";
+static char *rcsid = "$OpenBSD: show.c,v 1.22 2003/03/13 09:09:27 deraadt Exp $";
#endif
#endif /* not lint */
@@ -305,6 +305,7 @@ p_sockaddr(sa, flags, width)
{
char workbuf[128], *cplim;
char *cp = workbuf;
+ int len = sizeof workbuf;
switch(sa->sa_family) {
@@ -314,25 +315,32 @@ p_sockaddr(sa, flags, width)
if (sdl->sdl_nlen == 0 && sdl->sdl_alen == 0 &&
sdl->sdl_slen == 0)
- (void) sprintf(workbuf, "link#%d", sdl->sdl_index);
- else switch (sdl->sdl_type) {
- case IFT_ETHER:
- {
- int i;
- u_char *lla = (u_char *)sdl->sdl_data +
- sdl->sdl_nlen;
-
- cplim = "";
- for (i = 0; i < sdl->sdl_alen; i++, lla++) {
- cp += sprintf(cp, "%s%x", cplim, *lla);
- cplim = ":";
+ (void) snprintf(workbuf, sizeof workbuf,
+ "link#%d", sdl->sdl_index);
+ else {
+ switch (sdl->sdl_type) {
+ case IFT_ETHER:
+ {
+ int i;
+ u_char *lla = (u_char *)sdl->sdl_data +
+ sdl->sdl_nlen;
+
+ cplim = "";
+ for (i = 0; i < sdl->sdl_alen; i++, lla++) {
+ snprintf(cp, len, "%s%x", cplim, *lla);
+ len -= strlen(cp);
+ cp += strlen(cp);
+ if (len <= 0)
+ break; /* overflow */
+ cplim = ":";
+ }
+ cp = workbuf;
+ break;
+ }
+ default:
+ cp = link_ntoa(sdl);
+ break;
}
- cp = workbuf;
- break;
- }
- default:
- cp = link_ntoa(sdl);
- break;
}
break;
}
@@ -373,11 +381,26 @@ p_sockaddr(sa, flags, width)
slim = sa->sa_len + (u_char *) sa;
cplim = cp + sizeof(workbuf) - 6;
- cp += sprintf(cp, "(%d)", sa->sa_family);
+ snprintf(cp, len, "(%d)", sa->sa_family);
+ len -= strlen(cp);
+ cp += strlen(cp);
+ if (len <= 0) {
+ cp = workbuf;
+ break; /* overflow */
+ }
while (s < slim && cp < cplim) {
- cp += sprintf(cp, " %02x", *s++);
- if (s < slim)
- cp += sprintf(cp, "%02x", *s++);
+ snprintf(cp, len, " %02x", *s++);
+ len -= strlen(cp);
+ cp += strlen(cp);
+ if (len <= 0)
+ break; /* overflow */
+ if (s < slim) {
+ snprintf(cp, len, "%02x", *s++);
+ len -= strlen(cp);
+ cp += strlen(cp);
+ if (len <= 0)
+ break; /* overflow */
+ }
}
cp = workbuf;
}
View
95 openbsd/sbin/sysctl/sysctl.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sysctl.8,v 1.90 2002/09/29 22:08:22 deraadt Exp $
+.\" $OpenBSD: sysctl.8,v 1.97 2003/03/21 23:06:42 jason Exp $
.\" $NetBSD: sysctl.8,v 1.4 1995/09/30 07:12:49 thorpej Exp $
.\"
.\" Copyright (c) 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)sysctl.8 8.2 (Berkeley) 5/9/95
.\"
-.Dd May 9, 1995
+.Dd December 18, 2002
.Dt SYSCTL 8
.Os
.Sh NAME
@@ -101,17 +101,13 @@ privilege can change the value.
.It kern.ostype string no
.It kern.osrelease string no
.It kern.osrevision integer no
-.It kern.osversion string no
.It kern.version string no
.It kern.maxvnodes integer yes
.It kern.maxproc integer yes
.It kern.maxfiles integer yes
-.It kern.maxpartitions integer no
-.It kern.rawpartition integer no
.It kern.argmax integer no
.It kern.securelevel integer raise only
.It kern.hostname string yes
-.It kern.domainname string yes
.It kern.hostid u_int yes
.It kern.clockrate struct no
.It kern.posix1version integer no
@@ -119,9 +115,10 @@ privilege can change the value.
.It kern.job_control integer no
.It kern.saved_ids integer no
.It kern.boottime struct no
-.It kern.cp_time struct no
-.It kern.nchstats struct no
-.It kern.forkstat struct no
+.It kern.domainname string yes
+.It kern.maxpartitions integer no
+.It kern.rawpartition integer no
+.It kern.osversion string no
.It kern.somaxconn integer yes
.It kern.sominconn integer yes
.It kern.usermount integer yes
@@ -133,33 +130,58 @@ privilege can change the value.
.It kern.sysvshm integer no
.It kern.arandom u_int no
.It kern.msgbufsize integer no
-.It kern.nselcoll integer no
.It kern.malloc.buckets string no
.It kern.malloc.bucket.<sz> string no
.It kern.malloc.kmemnames string no
.It kern.malloc.kmemstat.<name> string no
+.It kern.cp_time struct no
+.It kern.nchstats struct no
+.It kern.forkstat struct no
+.It kern.nselcoll integer no
.It kern.tty.tk_nin int64_t no
.It kern.tty.tk_nout int64_t no
.It kern.tty.tk_rawcc int64_t no
.It kern.tty.tk_cancc int64_t no
-.It kern.fscale integer no
.It kern.ccpu u_int no
+.It kern.fscale integer no
.It kern.nprocs integer no
.It kern.stackgap_random integer yes
-.It kern.userasymcrypto integer yes
.It kern.usercrypto integer yes
.It kern.cryptodevallowsoft integer yes
+.It kern.splassert integer yes
.It kern.nfiles integer no
.It kern.ttycount integer no
.It kern.numvnodes integer no
-.It kern.mbstat struct no
+.It kern.userasymcrypto integer yes
+.It kern.seminfo.semmni integer yes
+.It kern.seminfo.semmns integer yes
+.It kern.seminfo.semmnu integer yes
+.It kern.seminfo.semmsl integer yes
+.It kern.seminfo.semopm integer yes
+.It kern.seminfo.semume integer no
+.It kern.seminfo.semusz integer no
+.It kern.seminfo.semvmx integer no
+.It kern.seminfo.semaem integer no
+.It kern.shminfo.shmmax integer yes
+.It kern.shminfo.shmmin integer yes
+.It kern.shminfo.shmmni integer yes
+.It kern.shminfo.shmseg integer yes
+.It kern.shminfo.shmall integer yes
+.It kern.watchdog.period integer yes
+.It kern.watchdog.auto integer yes
+.It vm.vmmeter struct no
.It vm.loadavg struct no
.It vm.psstrings struct no
+.It vm.uvmexp struct no
.It vm.swapencrypt.enable integer yes
.It vm.swapencrypt.keyscreated integer no
.It vm.swapencrypt.keysdeleted integer no
-.It vm.uvmexp struct no
-.It vm.vmmeter struct no
+.It vm.nkmempages integer no
+.It vm.anonmin integer yes
+.It vm.vtextmin integer yes
+.It vm.vnodemin integer yes
+.It vm.maxslp integer no
+.It vm.uspace integer no
.It fs.posix.setuid integer yes
.It net.inet.ip.forwarding integer yes
.It net.inet.ip.redirect integer yes
@@ -173,6 +195,8 @@ privilege can change the value.
.It net.inet.ip.porthilast integer yes
.It net.inet.ip.maxqueue integer yes
.It net.inet.ip.encdebug integer yes
+.It net.inet.ip.ipsec-expire-acquire integer yes
+.It net.inet.ip.ipsec-invalid-life integer yes
.It net.inet.ip.ipsec-pfs integer yes
.It net.inet.ip.ipsec-soft-allocs integer yes
.It net.inet.ip.ipsec-allocs integer yes
@@ -184,11 +208,9 @@ privilege can change the value.
.It net.inet.ip.ipsec-firstuse integer yes
.It net.inet.ip.ipsec-enc-alg string yes
.It net.inet.ip.ipsec-auth-alg string yes
-.It net.inet.ip.ipsec-comp-alg string yes
-.It net.inet.ip.ipsec-expire-acquire integer yes
-.It net.inet.ip.ipsec-invalid-life integer yes
.It net.inet.ip.mtudisc integer yes
.It net.inet.ip.mtudisctimeout integer yes
+.It net.inet.ip.ipsec-comp-alg string yes
.It net.inet.icmp.maskrepl integer yes
.It net.inet.icmp.bmcastecho integer yes
.It net.inet.icmp.errppslimit integer yes
@@ -196,7 +218,6 @@ privilege can change the value.
.It net.inet.icmp.redirtimeout integer yes
.It net.inet.icmp.tstamprepl integer yes
.It net.inet.ipip.allow integer yes
-.It net.inet.etherip.allow integer yes
.It net.inet.tcp.rfc1323 integer yes
.It net.inet.tcp.keepinittime integer yes
.It net.inet.tcp.keepidle integer yes
@@ -209,16 +230,18 @@ privilege can change the value.
.It net.inet.tcp.mssdflt integer yes
.It net.inet.tcp.rstppslimit integer yes
.It net.inet.tcp.ackonpush integer yes
+.It net.inet.tcp.ecn integer yes
.It net.inet.udp.checksum integer yes
.It net.inet.udp.baddynamic array yes
.It net.inet.udp.recvspace integer yes
.It net.inet.udp.sendspace integer yes
-.It net.inet.esp.enable integer yes
-.It net.inet.ah.enable integer yes
-.It net.inet.ipcomp.enable integer yes
.It net.inet.gre.allow integer yes
.It net.inet.gre.wccp integer yes
+.It net.inet.esp.enable integer yes
+.It net.inet.ah.enable integer yes
.It net.inet.mobileip.allow integer yes
+.It net.inet.etherip.allow integer yes
+.It net.inet.ipcomp.enable integer yes
.It net.inet6.ip6.forwarding integer yes
.It net.inet6.ip6.redirect integer yes
.It net.inet6.ip6.hlim integer yes
@@ -279,7 +302,8 @@ privilege can change the value.
.It machdep.kbdreset integer yes (i386 only)
.It machdep.allowaperture integer yes (XFree86)
.It machdep.led_blink integer yes (sparc/sparc64)
-.It machdep.vsyncblank integer yes (sparc only)
+.It machdep.ceccerrs integer no (sparc64)
+.It machdep.cecclast quad no (sparc64)
.It user.cs_path string no
.It user.bc_base_max integer no
.It user.bc_dim_max integer no
@@ -307,10 +331,22 @@ privilege can change the value.
.It ddb.panic integer yes
.It ddb.console integer yes
.It vfs.mounts.* struct no
-.It vfs.ffs.doasyncfree integer yes
.It vfs.ffs.doclusterread integer yes
.It vfs.ffs.doclusterwrite integer yes
.It vfs.ffs.doreallocblks integer yes
+.It vfs.ffs.doasyncfree integer yes
+.It vfs.ffs.max_softdeps integer yes
+.It vfs.ffs.sd_tickdelay integer yes
+.It vfs.ffs.sd_worklist_push integer no
+.It vfs.ffs.sd_blk_limit_push integer no
+.It vfs.ffs.sd_ino_limit_push integer no
+.It vfs.ffs.sd_blk_limit_hit integer no
+.It vfs.ffs.sd_ino_limit_hit integer no
+.It vfs.ffs.sd_sync_limit_hit integer no
+.It vfs.ffs.sd_indir_blk_ptrs integer no
+.It vfs.ffs.sd_inode_bitmap integer no
+.It vfs.ffs.sd_direct_blk_ptrs integer no
+.It vfs.ffs.sd_dir_entry integer no
.It vfs.nfs.iothreads integer yes
.El
.Pp
@@ -390,12 +426,19 @@ I/O requests on an NFS client machine:
# sysctl -w vfs.nfs.iothreads=4
.Ed
.Pp
-The number of 4 is the default, where the 20 is the maximum.
+The number of 4 is the default, 20 is the maximum.
See
.Xr nfssvc 2
and
.Xr nfsd 8
-for futher discussion.
+for further discussion.
+.Pp
+To set the amount of shared memory available in the system and
+the maximum number of shared memory segments:
+.Bd -literal noffset indent
+# sysctl -w kern.shminfo.shmmax=33554432
+# sysctl -w kern.shminfo.shmseg=32
+.Ed
.Sh FILES
.Bl -tag -width <ufs/ffs/ffs_extern.h> -compact
.It Pa <sys/sysctl.h>
View
103 openbsd/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.84 2002/07/06 19:14:20 nordin Exp $ */
+/* $OpenBSD: sysctl.c,v 1.86 2003/01/21 16:59:23 markus Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -35,16 +35,16 @@
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
-static char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95";
+static const char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95";
#else
-static char *rcsid = "$OpenBSD: sysctl.c,v 1.84 2002/07/06 19:14:20 nordin Exp $";
+static char *rcsid = "$OpenBSD: sysctl.c,v 1.86 2003/01/21 16:59:23 markus Exp $";
#endif
#endif /* not lint */
@@ -52,6 +52,8 @@ static char *rcsid = "$OpenBSD: sysctl.c,v 1.84 2002/07/06 19:14:20 nordin Exp $
#include <sys/gmon.h>
#include <sys/mount.h>
#include <sys/stat.h>
+#include <sys/sem.h>
+#include <sys/shm.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/malloc.h>
@@ -128,6 +130,9 @@ struct ctlname kernmallocname[] = CTL_KERN_MALLOC_NAMES;
struct ctlname forkstatname[] = CTL_KERN_FORKSTAT_NAMES;
struct ctlname nchstatsname[] = CTL_KERN_NCHSTATS_NAMES;
struct ctlname ttyname[] = CTL_KERN_TTY_NAMES;
+struct ctlname semname[] = CTL_KERN_SEMINFO_NAMES;
+struct ctlname shmname[] = CTL_KERN_SHMINFO_NAMES;
+struct ctlname watchdogname[] = CTL_KERN_WATCHDOG_NAMES;
struct ctlname *vfsname;
#ifdef CTL_MACHDEP_NAMES
struct ctlname machdepname[] = CTL_MACHDEP_NAMES;
@@ -199,6 +204,9 @@ int sysctl_forkstat(char *, char **, int *, int, int *);
int sysctl_tty(char *, char **, int *, int, int *);
int sysctl_nchstats(char *, char **, int *, int, int *);
int sysctl_malloc(char *, char **, int *, int, int *);
+int sysctl_seminfo(char *, char **, int *, int, int *);
+int sysctl_shminfo(char *, char **, int *, int, int *);
+int sysctl_watchdog(char *, char **, int *, int, int *);
#ifdef CPU_CHIPSET
int sysctl_chipset(char *, char **, int *, int, int *);
#endif
@@ -403,6 +411,22 @@ parse(char *string, int flags)
special |= LONGARRAY;
lal = CPUSTATES;
break;
+ case KERN_SEMINFO:
+ len = sysctl_seminfo(string, &bufp, mib, flags, &type);
+ if (len < 0)
+ return;
+ break;
+ case KERN_SHMINFO:
+ len = sysctl_shminfo(string, &bufp, mib, flags, &type);
+ if (len < 0)
+ return;
+ break;
+ case KERN_WATCHDOG:
+ len = sysctl_watchdog(string, &bufp, mib, flags,
+ &type);
+ if (len < 0)
+ return;
+ break;
}
break;
@@ -1319,6 +1343,9 @@ struct list kernmalloclist = { kernmallocname, KERN_MALLOC_MAXID };
struct list forkstatlist = { forkstatname, KERN_FORKSTAT_MAXID };
struct list nchstatslist = { nchstatsname, KERN_NCHSTATS_MAXID };
struct list ttylist = { ttyname, KERN_TTY_MAXID };
+struct list semlist = { semname, KERN_SEMINFO_MAXID };
+struct list shmlist = { shmname, KERN_SHMINFO_MAXID };
+struct list watchdoglist = { watchdogname, KERN_WATCHDOG_MAXID };
/*
* handle vfs namei cache statistics
@@ -1785,6 +1812,74 @@ sysctl_ipx(char *string, char **bufpp, int mib[], int flags, int *typep)
}
/*
+ * Handle SysV semaphore info requests
+ */
+int
+sysctl_seminfo(string, bufpp, mib, flags, typep)
+ char *string;
+ char **bufpp;
+ int mib[];
+ int flags;
+ int *typep;
+{
+ int indx;
+
+ if (*bufpp == NULL) {
+ listall(string, &semlist);
+ return(-1);
+ }
+ if ((indx = findname(string, "third", bufpp, &semlist)) == -1)
+ return(-1);
+ mib[2] = indx;
+ *typep = CTLTYPE_INT;
+ return(3);
+}
+
+/*
+ * Handle SysV shared memory info requests
+ */
+int
+sysctl_shminfo(string, bufpp, mib, flags, typep)
+ char *string;
+ char **bufpp;
+ int mib[];
+ int flags;
+ int *typep;
+{
+ int indx;
+
+ if (*bufpp == NULL) {
+ listall(string, &shmlist);
+ return(-1);
+ }
+ if ((indx = findname(string, "third", bufpp, &shmlist)) == -1)
+ return(-1);
+ mib[2] = indx;
+ *typep = CTLTYPE_INT;
+ return(3);
+}
+
+/*
+ * Handle watchdog support
+ */
+int
+sysctl_watchdog(char *string, char **bufpp, int mib[], int flags,
+ int *typep)
+{
+ int indx;
+
+ if (*bufpp == NULL) {
+ listall(string, &watchdoglist);
+ return(-1);
+ }
+ if ((indx = findname(string, "third", bufpp, &watchdoglist)) == -1)
+ return(-1);
+ mib[2] = indx;
+ *typep = watchdoglist.list[indx].ctl_type;
+ return(3);
+}
+
+/*
* Scan a list of names searching for a particular name.
*/
int
View
4 openbsd/usr.bin/fstat/fstat.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: fstat.1,v 1.23 2002/09/30 09:54:56 avsm Exp $
+.\" $OpenBSD: fstat.1,v 1.24 2003/03/10 15:37:30 jmc Exp $
.\"
.\" Copyright (c) 1987, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -186,7 +186,7 @@ from an open file back to the directory entry that was used to open
that file.
Also, since different directory entries may reference
the same file (via
-.Xr ln 2 ) ,
+.Xr ln 1 ) ,
the name printed may not be the actual
name that the process originally used to open that file.
.El
View
39 openbsd/usr.bin/netstat/atalk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atalk.c,v 1.9 2002/07/25 03:58:56 deraadt Exp $ */
+/* $OpenBSD: atalk.c,v 1.10 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: atalk.c,v 1.2 1997/05/22 17:21:26 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from @(#)atalk.c 1.1 (Whistle) 6/6/96";
#else
-static char rcsid[] = "$OpenBSD: atalk.c,v 1.9 2002/07/25 03:58:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: atalk.c,v 1.10 2003/02/01 01:51:31 deraadt Exp $";
#endif
#endif /* not lint */
@@ -82,9 +82,7 @@ static char *at_pr_port(struct sockaddr_at *);
*/
static char *
-at_pr_net(sat, numeric)
- struct sockaddr_at *sat;
- int numeric;
+at_pr_net(struct sockaddr_at *sat, int numeric)
{
static char mybuf[50];
@@ -102,9 +100,7 @@ at_pr_net(sat, numeric)
}
static char *
-at_pr_host(sat, numeric)
- struct sockaddr_at *sat;
- int numeric;
+at_pr_host(struct sockaddr_at *sat, int numeric)
{
static char mybuf[50];
@@ -122,8 +118,7 @@ at_pr_host(sat, numeric)
}
static char *
-at_pr_port(sat)
- struct sockaddr_at *sat;
+at_pr_port(struct sockaddr_at *sat)
{
static char mybuf[50];
struct servent *serv;
@@ -152,13 +147,12 @@ at_pr_port(sat)
}
static char *
-at_pr_range(sat)
- struct sockaddr_at *sat;
+at_pr_range(struct sockaddr_at *sat)
{
static char mybuf[50];
- if (sat->sat_range.r_netrange.nr_firstnet
- != sat->sat_range.r_netrange.nr_lastnet) {
+ if (sat->sat_range.r_netrange.nr_firstnet !=
+ sat->sat_range.r_netrange.nr_lastnet) {
(void) snprintf(mybuf, sizeof(mybuf), "%d-%d",
ntohs(sat->sat_range.r_netrange.nr_firstnet),
ntohs(sat->sat_range.r_netrange.nr_lastnet));
@@ -177,9 +171,7 @@ at_pr_range(sat)
* 8 for numeric only
*/
char *
-atalk_print(sa, what)
- const struct sockaddr *sa;
- int what;
+atalk_print(const struct sockaddr *sa, int what)
{
struct sockaddr_at *sat = (struct sockaddr_at *) sa;
static char mybuf[50];
@@ -215,10 +207,7 @@ atalk_print(sa, what)
}
char *
-atalk_print2(sa, mask, what)
- const struct sockaddr *sa;
- const struct sockaddr *mask;
- int what;
+atalk_print2(const struct sockaddr *sa, const struct sockaddr *mask, int what)
{
size_t n, l;
static char buf[100];
@@ -258,9 +247,7 @@ atalk_print2(sa, mask, what)
}
void
-atalkprotopr(off, name)
- u_long off;
- char *name;
+atalkprotopr(u_long off, char *name)
{
struct ddpcb cb;
struct ddpcb *prev, *next;
@@ -323,9 +310,7 @@ atalkprotopr(off, name)
* Dump DDP statistics structure.
*/
void
-ddp_stats(off, name)
- u_long off;
- char *name;
+ddp_stats(u_long off, char *name)
{
struct ddpstat ddpstat;
View
20 openbsd/usr.bin/netstat/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.32 2002/06/19 23:40:20 itojun Exp $ */
+/* $OpenBSD: if.c,v 1.33 2003/02/01 01:51:31 deraadt Exp $ */
/* $NetBSD: if.c,v 1.16.4.2 1996/06/07 21:46:46 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
#else
-static char *rcsid = "$OpenBSD: if.c,v 1.32 2002/06/19 23:40:20 itojun Exp $";