Commit Graph

4085 Commits

Author SHA1 Message Date
ginsbach
6e420616a8 Make sure that a netmask socket address value prints appropriately when the
family is unset.  Either the destination or interface address socket address
family value is used.  This change prevents the following sort of output:

RTM_NEWADDR: address being added to iface: len 60, metric 0, flags:<UP>
sockaddrs: <NETMASK,IFA,BRD>
 (0) 00.00.ff.00.00 127.0.0.1 127.0.0.1

With this change the last line becomes:

 255.0.0.0 127.0.0.1 127.0.0.1

Also make sure that when using a generated inet netmask the address family
is set.  With this change a generated netmask will print appropriately
when using the verbose (-v) option.
2005-08-15 19:28:08 +00:00
ginsbach
9992d68aff Make sure the get command always exits non-zero on error. This makes things
like the following work as expected.

#!/bin/sh

if ! route -sn get default >/dev/null 2>&1; then
	echo default gateway not set
	exit 1
fi
echo default gateway set

Handle routing socket write(2) errors when they occur.  This produces
better diagnostics by allowing for handling of the special route errno
values ESRCH, EBUSY, and ENOBUFS even with the quiet (-q) option or
when doing a get command.
2005-08-12 21:23:06 +00:00
ginsbach
9c8def382d Trim the local domain name in routename() for INET6 lookups; similar to
INET lookups.
2005-08-12 16:29:06 +00:00
rpaulo
aaf548920f Explained the '-h' option. 2005-08-11 20:56:57 +00:00
rpaulo
630caafc65 Added a new ifconfig flag, -h, allowing, in conjunction with -v, the display
of interface I/O bytes in human-format.

Reviewed by Christos Zoulas and Jason Thorpe.
2005-08-11 20:56:05 +00:00
he
8974f21b75 Make this build for __GNUC__ <= 2 (i.e. for vax). The cast to
caddr_t removes a const qualifier.  Instead, cast the first element
of the subtraction to "struct sockaddr *" to work around the problem.
2005-08-10 11:48:17 +00:00
ginsbach
08af90d648 Accept protocol flags, i.e. -inet, -inet6, with the show command.
[From OpenBSD via DragonFly BSD]
2005-08-09 21:25:42 +00:00
ginsbach
2cff02da42 Fix the default case in sodump(). Printing the address of the "which"
string isn't really that useful.  Instead print the string and the value
of sa_family.
2005-08-09 20:33:06 +00:00
ginsbach
3997584e62 More style nits (KNF); casts and sizeof's are not followed by a space. 2005-08-09 19:43:24 +00:00
he
488e14a7ad Undefine the 17 macros commonly defined by <ufs/ffs/fs.h> and
<ufs/lfs/lfs.h> before including the second of them, and also after
including the second, to ensure the rest of the code doesn't depend
on their (ambigious) definition.

This fixes a build problem for vax; gcc 2.95.3's preprocessor
apparently doesn't like redefinition of macros.

Discussed with xtraeme.
2005-08-09 12:59:29 +00:00
xtraeme
4ef578d357 * Replace lseek() and read() calls with one single pread()
* Align cpg/sgs correctly.
2005-08-09 01:49:23 +00:00
wiz
f309f02fd0 Bump date for previous; use more markup. 2005-08-07 11:17:31 +00:00
blymn
b7550dc6d4 Add and document some convenience aliases for commonly required option
combinations.
2005-08-06 09:00:20 +00:00
jmmv
68e38c123b Replace a dot with a colon, as a list of items follows it. 2005-08-05 13:32:06 +00:00
rpaulo
92c6f16501 Added net.bpf.peers and net.bpf.stats and bumped the date. 2005-08-04 20:10:24 +00:00
rpaulo
78d05017af Inform the user that net.bpf.stats and net.bpf.peers are viewable with
netstat(1).
2005-08-04 19:44:18 +00:00
elad
42735a8747 Sync with reality.
- Verified Exec -> Veriexec
- pseudo-device is `veriexec'
- veriexec.conf -> signatures, and mention /etc/signatures as the default
  location
- We use veriexec's strict level, not the system securelevel
- Mention the `direct' option
- Mention that the signatures file can have multiple options in a single
  entry, comma-separated
- Mention that both `direct' and `indirect' access modes are implied
  if no access modes are explicitly mention in the options
- Bump date
2005-08-02 18:06:14 +00:00
elad
6e4a854552 Support multiple entry types. Direct, indirect, and file can now be
combined in the signatures file using commas.
2005-08-02 16:14:10 +00:00
christos
b6a232217f Pass lint and get/setprogname. 2005-07-31 20:19:40 +00:00
xtraeme
c99f08c80d typo 2005-07-31 19:40:50 +00:00
xtraeme
016ad35975 Add scan_lfs(8), utility to find LFS partitions on disk, useful
to recover lost disklabels.
2005-07-31 19:26:06 +00:00
wiz
f3ce44eee2 Sort options. Various other fixes. 2005-07-24 21:07:52 +00:00
rpaulo
d49bebea61 Add examples for scroll.fastlines and scroll.slowlines.
Also, bump the man page date.

ok wiz@, hubertf@
2005-07-24 20:54:06 +00:00
ginsbach
89cdec0594 switch is not a function, so add a space; sort switch elements
alphabetically (KNF).
2005-07-20 21:12:40 +00:00
ginsbach
d313757b82 * Exit non-zero error code when flushroute() fails operating on the
routing socket, e.g. running route flush as non-root.

* When quiet (-q) don't append error string to a non-existent
  diagnostic output (stdout).  The error diagnostic is still written
  to stderr.  [from FreeBSD]

* Use warn(3) in place of perror(3).
2005-07-15 21:29:54 +00:00
he
36fc2f101b Add const to a duplicate declaration of sd_state(). 2005-07-05 22:21:38 +00:00
wiz
d0b93cc137 Mark up more paths with .Pa, and
break a line (<=80 chars per line).
2005-07-01 17:07:33 +00:00
snj
23b31bb2ee Use more macros and sort xrefs. 2005-06-30 21:36:34 +00:00
christos
fdfc4891f9 Patch from Jeremy Reed to describe how MFS /dev works. Thanks! 2005-06-30 16:38:06 +00:00
drochner
5597e3b8c5 add some (long long) casts to printf() arguments to avoid
gcc warnings
2005-06-30 12:18:16 +00:00
he
fb84548b30 Allow this to build under -Wcast-qual -Werror by adding const to a few
variables/fields initialized to point to string constants.
2005-06-28 18:14:45 +00:00
christos
cc9c2b575d - constify.
- don't dup extern declarations on each file because they end up being
  inconsistent (yyerror).
2005-06-27 03:07:45 +00:00
christos
acdcf67bb0 constify. 2005-06-27 02:56:20 +00:00
christos
9be35a638f more const. 2005-06-27 02:49:32 +00:00
christos
e0dd0ca293 constify 2005-06-27 02:48:28 +00:00
christos
e4b2253c50 add const. 2005-06-27 02:05:30 +00:00
christos
58874431a5 add const 2005-06-27 02:03:28 +00:00
christos
cb1c4f11bb sprinkle const. 2005-06-27 01:55:52 +00:00
christos
64747563b4 sprinkle const 2005-06-27 01:37:32 +00:00
christos
c236bddb0f sprinkle const. 2005-06-27 01:25:35 +00:00
christos
2c6eadc9ce Move WARNS=3 to the Makefile.inc, and add a little const to the remaining
programs that did not compile before.
2005-06-27 01:00:04 +00:00
christos
042582c125 more const. 2005-06-26 23:04:19 +00:00
christos
97880e96ed constify. 2005-06-26 23:01:39 +00:00
christos
6499bd69c1 constify. 2005-06-26 22:45:50 +00:00
christos
79f5327ef7 This is the textbook example of why global variables are harmful. Fix multiple
shadowing warnings for variables with the same name used both in global and
local context. Really this needs either to rename all the global variables
something different (prefix them with gl_ or something) or even better get
rid of them altogether.
2005-06-26 22:36:55 +00:00
christos
a9274bf3fb Don't abuse writing to const strings. We can pass const strings to this,
and we write to them. Allocate memory instead.
2005-06-26 21:43:33 +00:00
christos
dea4bd707c const poisoning. 2005-06-26 21:28:15 +00:00
dyoung
256aff6693 Teach route(8) to print the messages generated by net80211. 2005-06-25 06:38:35 +00:00
hubertf
6912ea355e it is iso8859, not 8869 2005-06-24 23:35:06 +00:00
wiz
4e5ff88a4c Bump date for previous. 2005-06-24 11:39:11 +00:00