Permalink
Browse files

OpenBSD 3.1

  • Loading branch information...
1 parent 91a0195 commit a5d2456379157684000993ec7ba2ab005b86d806 itojun committed May 22, 2002
Showing with 2,167 additions and 1,736 deletions.
  1. +20 −18 openbsd/bin/ls/extern.h
  2. +5 −7 openbsd/bin/ls/ls.1
  3. +14 −14 openbsd/bin/ls/ls.c
  4. +2 −2 openbsd/bin/ls/main.c
  5. +7 −7 openbsd/bin/ls/print.c
  6. +4 −3 openbsd/bin/ls/util.c
  7. +79 −13 openbsd/sbin/ifconfig/ifconfig.8
  8. +453 −170 openbsd/sbin/ifconfig/ifconfig.c
  9. +8 −8 openbsd/sbin/ping/ping.8
  10. +37 −28 openbsd/sbin/ping/ping.c
  11. +7 −7 openbsd/sbin/route/ccitt_addr.c
  12. +1 −2 openbsd/sbin/route/keywords.c
  13. +42 −43 openbsd/sbin/route/keywords.h
  14. +1 −2 openbsd/sbin/route/keywords.sh
  15. +8 −7 openbsd/sbin/route/route.8
  16. +78 −87 openbsd/sbin/route/route.c
  17. +67 −119 openbsd/sbin/route/show.c
  18. +27 −18 openbsd/sbin/sysctl/sysctl.8
  19. +25 −23 openbsd/sbin/sysctl/sysctl.c
  20. +3 −4 openbsd/usr.bin/fstat/Makefile
  21. +87 −60 openbsd/usr.bin/fstat/fstat.1
  22. +173 −59 openbsd/usr.bin/fstat/fstat.c
  23. +1 −2 openbsd/usr.bin/fstat/isofs.c
  24. +13 −13 openbsd/usr.bin/netstat/atalk.c
  25. +9 −9 openbsd/usr.bin/netstat/if.c
  26. +83 −86 openbsd/usr.bin/netstat/inet.c
  27. +58 −58 openbsd/usr.bin/netstat/inet6.c
  28. +9 −9 openbsd/usr.bin/netstat/ipx.c
  29. +17 −17 openbsd/usr.bin/netstat/iso.c
  30. +12 −12 openbsd/usr.bin/netstat/main.c
  31. +12 −13 openbsd/usr.bin/netstat/mbuf.c
  32. +3 −3 openbsd/usr.bin/netstat/mroute.c
  33. +9 −9 openbsd/usr.bin/netstat/mroute6.c
  34. +3 −12 openbsd/usr.bin/netstat/netstat.1
  35. +73 −74 openbsd/usr.bin/netstat/netstat.h
  36. +7 −7 openbsd/usr.bin/netstat/ns.c
  37. +115 −114 openbsd/usr.bin/netstat/route.c
  38. +5 −5 openbsd/usr.bin/netstat/unix.c
  39. +6 −1 openbsd/usr.bin/systat/Makefile
  40. +44 −44 openbsd/usr.bin/systat/cmds.c
  41. +12 −9 openbsd/usr.bin/systat/cmdtab.c
  42. +6 −5 openbsd/usr.bin/systat/disks.c
  43. +69 −59 openbsd/usr.bin/systat/extern.h
  44. +4 −4 openbsd/usr.bin/systat/fetch.c
  45. +12 −13 openbsd/usr.bin/systat/iostat.c
  46. +73 −55 openbsd/usr.bin/systat/keyboard.c
  47. +81 −97 openbsd/usr.bin/systat/main.c
  48. +5 −4 openbsd/usr.bin/systat/mbufs.c
  49. +24 −24 openbsd/usr.bin/systat/netcmds.c
  50. +34 −36 openbsd/usr.bin/systat/netstat.c
  51. +36 −47 openbsd/usr.bin/systat/pigs.c
  52. +3 −4 openbsd/usr.bin/systat/swap.c
  53. +5 −21 openbsd/usr.bin/systat/systat.1
  54. +8 −9 openbsd/usr.bin/systat/systat.h
  55. +92 −94 openbsd/usr.bin/systat/vmstat.c
  56. +2 −2 openbsd/usr.bin/vmstat/dkstats.c
  57. +4 −4 openbsd/usr.bin/vmstat/dkstats.h
  58. +7 −14 openbsd/usr.bin/vmstat/vmstat.8
  59. +63 −46 openbsd/usr.bin/vmstat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.6 2000/07/19 19:27:36 mickey Exp $ */
+/* $OpenBSD: extern.h,v 1.8 2002/02/16 21:27:07 millert Exp $ */
/* $NetBSD: extern.h,v 1.5 1995/03/21 09:06:24 cgd Exp $ */
/*-
@@ -36,21 +36,23 @@
* @(#)extern.h 8.1 (Berkeley) 5/31/93
*/
-int acccmp __P((const FTSENT *, const FTSENT *));
-int revacccmp __P((const FTSENT *, const FTSENT *));
-int modcmp __P((const FTSENT *, const FTSENT *));
-int revmodcmp __P((const FTSENT *, const FTSENT *));
-int namecmp __P((const FTSENT *, const FTSENT *));
-int revnamecmp __P((const FTSENT *, const FTSENT *));
-int statcmp __P((const FTSENT *, const FTSENT *));
-int revstatcmp __P((const FTSENT *, const FTSENT *));
-int sizecmp __P((const FTSENT *, const FTSENT *));
-int revsizecmp __P((const FTSENT *, const FTSENT *));
+extern char *__progname;
-int putname __P((char *));
-void printcol __P((DISPLAY *));
-void printacol __P((DISPLAY *));
-void printlong __P((DISPLAY *));
-void printscol __P((DISPLAY *));
-void printstream __P((DISPLAY *));
-void usage __P((void));
+int acccmp(const FTSENT *, const FTSENT *);
+int revacccmp(const FTSENT *, const FTSENT *);
+int modcmp(const FTSENT *, const FTSENT *);
+int revmodcmp(const FTSENT *, const FTSENT *);
+int namecmp(const FTSENT *, const FTSENT *);
+int revnamecmp(const FTSENT *, const FTSENT *);
+int statcmp(const FTSENT *, const FTSENT *);
+int revstatcmp(const FTSENT *, const FTSENT *);
+int sizecmp(const FTSENT *, const FTSENT *);
+int revsizecmp(const FTSENT *, const FTSENT *);
+
+int putname(char *);
+void printcol(DISPLAY *);
+void printacol(DISPLAY *);
+void printlong(DISPLAY *);
+void printscol(DISPLAY *);
+void printstream(DISPLAY *);
+void usage(void);
View
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ls.1,v 1.30 2000/11/09 23:58:55 aaron Exp $
+.\" $OpenBSD: ls.1,v 1.33 2002/02/11 18:43:51 mpech Exp $
.\" $NetBSD: ls.1,v 1.14 1995/12/05 02:44:01 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@@ -394,26 +394,24 @@ The
.Nm
utility exits 0 on success or >0 if an error occurred.
.Sh EXAMPLES
-.Cm ls -l
+.Cm $ ls -l
.Pp
List the contents of the current working directory in long format.
.Pp
-.Cm ls -lioF
+.Cm $ 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
+.Cm $ ls -lt /var/log
.Pp
List the files in
.Pa /var/log ,
sorting the output such that the mostly recently modified entries are
printed first.
.Sh ENVIRONMENT
-The following environment variables affect the execution of
-.Nm ls :
.Bl -tag -width BLOCKSIZE
.It Ev BLOCKSIZE
If the environment variable
@@ -462,4 +460,4 @@ specification.
An
.Nm
utility appeared in
-.At v5 .
+.At v3 .
View
@@ -1,4 +1,4 @@
-/* $OpenBSD: ls.c,v 1.14 2000/07/19 19:27:36 mickey Exp $ */
+/* $OpenBSD: ls.c,v 1.17 2002/03/12 01:05:15 millert Exp $ */
/* $NetBSD: ls.c,v 1.18 1996/07/09 09:16:29 mycroft Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94";
#else
-static char rcsid[] = "$OpenBSD: ls.c,v 1.14 2000/07/19 19:27:36 mickey Exp $";
+static char rcsid[] = "$OpenBSD: ls.c,v 1.17 2002/03/12 01:05:15 millert Exp $";
#endif
#endif /* not lint */
@@ -59,6 +59,8 @@ static char rcsid[] = "$OpenBSD: ls.c,v 1.14 2000/07/19 19:27:36 mickey Exp $";
#include <err.h>
#include <errno.h>
#include <fts.h>
+#include <grp.h>
+#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -67,15 +69,12 @@ static char rcsid[] = "$OpenBSD: ls.c,v 1.14 2000/07/19 19:27:36 mickey Exp $";
#include "ls.h"
#include "extern.h"
-char *group_from_gid __P((u_int, int));
-char *user_from_uid __P((u_int, int));
+static void display(FTSENT *, FTSENT *);
+static int mastercmp(const FTSENT **, const FTSENT **);
+static void traverse(int, char **, int);
-static void display __P((FTSENT *, FTSENT *));
-static int mastercmp __P((const FTSENT **, const FTSENT **));
-static void traverse __P((int, char **, int));
-
-static void (*printfcn) __P((DISPLAY *));
-static int (*sortfcn) __P((const FTSENT *, const FTSENT *));
+static void (*printfcn)(DISPLAY *);
+static int (*sortfcn)(const FTSENT *, const FTSENT *);
#define BY_NAME 0
#define BY_SIZE 1
@@ -420,7 +419,7 @@ display(p, list)
u_long btotal, maxblock, maxinode, maxlen, maxnlink;
int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser;
int entries, needstats;
- char *user, *group, buf[20]; /* 32 bits == 10 digits */
+ char *user, *group, buf[21]; /* 64 bits == 20 digits */
char nuser[12], ngroup[12];
char *flags = NULL;
@@ -440,7 +439,7 @@ display(p, list)
bcfile = 0;
maxuser = maxgroup = maxflags = 0;
maxsize = 0;
- for (cur = list, entries = 0; cur; cur = cur->fts_link) {
+ for (cur = list, entries = 0; cur != NULL; cur = cur->fts_link) {
if (cur->fts_info == FTS_ERR || cur->fts_info == FTS_NS) {
warnx("%s: %s",
cur->fts_name, strerror(cur->fts_errno));
@@ -554,7 +553,7 @@ display(p, list)
output = 1;
if (f_longform)
- for (cur = list; cur; cur = cur->fts_link)
+ for (cur = list; cur != NULL; cur = cur->fts_link)
free(cur->fts_pointer);
}
@@ -577,13 +576,14 @@ mastercmp(a, b)
if (b_info == FTS_ERR)
return (0);
- if (a_info == FTS_NS || b_info == FTS_NS)
+ if (a_info == FTS_NS || b_info == FTS_NS) {
if (b_info != FTS_NS)
return (1);
else if (a_info != FTS_NS)
return (-1);
else
return (namecmp(*a, *b));
+ }
if (a_info != b_info &&
(*a)->fts_level == FTS_ROOTLEVEL && !f_listdir) {
@@ -1,12 +1,12 @@
-/* $OpenBSD: main.c,v 1.1 1999/02/23 23:54:17 art Exp $ */
+/* $OpenBSD: main.c,v 1.2 2002/02/16 21:27:07 millert Exp $ */
/*
* Public domain - no warranty.
*/
#include <sys/cdefs.h>
-int ls_main __P((int argc, char **argv));
+int ls_main(int argc, char **argv);
int
main(argc, argv)
@@ -1,4 +1,4 @@
-/* $OpenBSD: print.c,v 1.15 2000/01/06 21:32:40 espie Exp $ */
+/* $OpenBSD: print.c,v 1.16 2002/02/16 21:27:07 millert Exp $ */
/* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.5 (Berkeley) 7/28/94";
#else
-static char rcsid[] = "$OpenBSD: print.c,v 1.15 2000/01/06 21:32:40 espie Exp $";
+static char rcsid[] = "$OpenBSD: print.c,v 1.16 2002/02/16 21:27:07 millert Exp $";
#endif
#endif /* not lint */
@@ -64,11 +64,11 @@ static char rcsid[] = "$OpenBSD: print.c,v 1.15 2000/01/06 21:32:40 espie Exp $"
#include "ls.h"
#include "extern.h"
-static int printaname __P((FTSENT *, u_long, u_long));
-static void printlink __P((FTSENT *));
-static void printtime __P((time_t));
-static int printtype __P((u_int));
-static int compute_columns __P((DISPLAY *, int *));
+static int printaname(FTSENT *, u_long, u_long);
+static void printlink(FTSENT *);
+static void printtime(time_t);
+static int printtype(u_int);
+static int compute_columns(DISPLAY *, int *);
#define IS_NOPRINT(p) ((p)->fts_number == NO_PRINT)
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.6 1999/05/05 07:06:01 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.7 2001/09/06 13:29:08 mpech Exp $ */
/* $NetBSD: util.c,v 1.12 1995/09/07 06:43:02 jtc Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)util.c 8.5 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: util.c,v 1.6 1999/05/05 07:06:01 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.7 2001/09/06 13:29:08 mpech Exp $";
#endif
#endif /* not lint */
@@ -72,6 +72,7 @@ void
usage()
{
(void)fprintf(stderr,
- "usage: ls [-1ACFLRSTWacdfiklmnopqrstux] [file ...]\n");
+ "usage: %s [-1ACFLRSTWacdfiklmnopqrstux] [file ...]\n",
+ __progname);
exit(1);
}
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ifconfig.8,v 1.52 2001/09/15 18:06:56 mickey Exp $
+.\" $OpenBSD: ifconfig.8,v 1.55 2002/04/08 09: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 $
.\"
@@ -257,13 +257,19 @@ or
.Dq UTP
would activate twisted pair.
Refer to the interfaces' driver
-specific man page for a complete list of the available types.
+specific man page for a complete list of the available types,
+or use
+.Cm ifconfig -m interface
+for a listing of choices.
.It Cm mediaopt Ar opts
Set the specified media options on the interface.
.Ar opts
is a comma delimited list of options to apply to the interface.
Refer to the interfaces' driver specific man page for a complete
-list of available options.
+list of available options,
+or use
+.Cm ifconfig -m interface
+for a listing of choices.
.It Fl mediaopt Ar opts
Disable the specified media options on the interface.
.It Cm mtu Ar value
@@ -283,7 +289,8 @@ If the interface is a vlan pseudo interface, set the vlan tag value
to
.Ar vlan_tag .
This value is a 16-bit number which is used to create an 802.1Q
-vlan header for packets sent from the vlan interface. Note that
+vlan header for packets sent from the vlan interface.
+Note that
.Cm vlan
and
.Cm vlandev
@@ -294,17 +301,20 @@ If the interface is a vlan pseudo device, associate physical interface
with it. Packets transmitted through the vlan interface will be
diverted to the specified physical interface
.Ar iface
-with 802.1Q vlan encapsulation. Packets with 802.1Q encapsulation received
+with 802.1Q vlan encapsulation.
+Packets with 802.1Q encapsulation received
by the parent interface with the correct vlan tag will be diverted to
-the associated vlan pseudo-interface. The vlan interface is assigned a
+the associated vlan pseudo-interface.
+The vlan interface is assigned a
copy of the parent interface's flags and the parent's ethernet address.
The
.Cm vlandev
and
.Cm vlan
-must both be set at the same time. If the vlan interface already has
-a physical interface associated with it, this command will fail. To
-change the association to another physical interface, the existing
+must both be set at the same time.
+If the vlan interface already has
+a physical interface associated with it, this command will fail.
+To change the association to another physical interface, the existing
association must be cleared first.
.Pp
Note: if the
@@ -318,7 +328,8 @@ own (usually in firmware) and that it should pass packets to and from
the parent unaltered.
.It Fl vlandev
If the driver is a vlan pseudo device, disassociate the physical interface
-from it. This breaks the link between the vlan interface and its parent,
+from it.
+This breaks the link between the vlan interface and its parent,
clears its vlan tag, flags and its link address and shuts the interface down.
.It Cm metric Ar n
Set the routing metric of the interface to
@@ -373,17 +384,72 @@ for
.Tn AFI
37 type addresses.
.It Cm nwid Ar id
-(IEEE 802.11 devices only, specifically
-.Xr ray 4 )
-.br
+(IEEE 802.11 devices only)
Configure network ID for IEEE 802.11-based wireless network interfaces.
+The
+.Ar id
+can either be any text string up to 32 characters in length,
+or a series of hexadecimal digits up to 64 digits.
+The empty string allows the interface to connect to any available
+access points.
+.It Cm nwkey Ar key
+(IEEE 802.11 devices only)
+Enable WEP encryption for IEEE 802.11-based wireless network interfaces
+using the specified
+.Ar key .
+The
+.Ar key
+can either be a string, a series of hexadecimal digits, or a set of keys
+of the form
+.Ar n:k1,k2,k3,k4 ,
+where
+.Ar n
+specifies which of the keys will be used for transmitted packets,
+and the four keys,
+.Ar k1
+through
+.Ar k4 ,
+are configured as WEP keys.
+If a set of keys is specified, a comma
+.Po So , Sc Pc
+within the key must be escaped with a backslash.
+Note that if multiple keys are used, their order must be the same within
+the network.
+For IEEE 802.11 wireless networks, the length of each key is restricted to
+40 bits, i.e. a 5-character string or 10 hexadecimal digits.
+WaveLAN/IEEE Gold and newer Prism cards will also accept a 104 bit
+(13 character) key.
+.It Cm nwkey Cm persist
+(IEEE 802.11 devices only)
+Enable WEP encryption for IEEE 802.11-based wireless network interfaces
+with the persistent key stored in the network card.
+.It Cm nwkey Cm persist: Ns Ar key
+(IEEE 802.11 devices only)
+Write
+.Ar key
+to the persistent memory of the network card, and
+enable WEP encryption for IEEE 802.11-based wireless network interfaces
+using that
+.Ar key .
+.It Fl nwkey
+(IEEE 802.11 devices only)
+Disable WEP encryption for IEEE 802.11-based wireless network interfaces.
.It Cm phase
The argument following this specifies the version (phase) of the
AppleTalk network attached to the interface.
Values of 1 or 2 are permitted.
.It Cm pltime Ar n
(inet6 only)
Set preferred lifetime for the address.
+.It Cm powersave
+(IEEE 802.11 devices only)
+Enable 802.11 power saving mode.
+.It Fl powersave
+(IEEE 802.11 devices only)
+Disable 802.11 power saving mode.
+.It Cm powersavesleep Ar duration
+(IEEE 802.11 devices only)
+Set the receiver sleep duration (in milliseconds) for 802.11 power saving mode.
.It Cm prefixlen Ar n
(inet and inet6 only)
Effect is similar to
Oops, something went wrong.

0 comments on commit a5d2456

Please sign in to comment.