Sort options.

This commit is contained in:
ru 2003-02-23 01:50:07 +00:00
parent 5ecd4995a5
commit 8a2a909130
6 changed files with 158 additions and 139 deletions

View File

@ -45,8 +45,8 @@
.Op Fl 0123456789ackLnSu
.Op Fl B Ar records
.Op Fl b Ar blocksize
.Op Fl D Ar dumpdates
.Op Fl C Ar cachesize
.Op Fl D Ar dumpdates
.Op Fl d Ar density
.Op Fl f Ar file
.Op Fl h Ar level
@ -80,7 +80,8 @@ option below for doing remote backups).
A dump that is larger than the output medium is broken into
multiple volumes.
On most media the size is determined by writing until an
end-of-media indication is returned. This can be enforced
end-of-media indication is returned.
This can be enforced
by using the
.Fl a
option.
@ -103,7 +104,7 @@ as either its device-special file or its mount point
The following options are supported by
.Nm :
.Bl -tag -width Ds
.It Fl 0\-9
.It Fl 0-9
Dump levels.
A level 0, full backup,
guarantees the entire file system is copied
@ -119,8 +120,9 @@ The default level is 0.
.It Fl a
.Dq auto-size .
Bypass all tape length considerations, and enforce writing
until an end-of-media indication is returned. This fits best
for most modern tape drives. Use of this option is particularly
until an end-of-media indication is returned.
This fits best for most modern tape drives.
Use of this option is particularly
recommended when appending to an existing tape, or using a tape
drive with hardware compression (where you can never be sure about
the compression ratio).
@ -132,8 +134,24 @@ This option overrides the calculation of tape size
based on length and density.
.It Fl b Ar blocksize
The number of kilobytes per output block, except that if it is
larger than 64, the command uses 64. (See the BUGS section.)
larger than 64, the command uses 64.
(See the
.Sx BUGS
section.)
The default block size is 10.
.It Fl C Ar cachesize
Specify the cache size in megabytes.
This will greatly improve performance
at the cost of
.Nm
possibly not noticing changes in the file system between passes.
It is
recommended that you always use this option when dumping a snapshot.
Beware that
.Nm
forks, and the actual memory use may be larger than the specified cache
size.
The recommended cache size is between 8 and 32 (megabytes).
.It Fl c
Change the defaults for use with a cartridge tape drive, with a density
of 8000 bpi, and a length of 1700 feet.
@ -143,16 +161,6 @@ Specify an alternate path to the
file.
The default is
.Pa /etc/dumpdates .
.It Fl C Ar cachesize
Specify the cache size in megabytes. This will greatly improve performance
at the cost of
.Nm
possibly not noticing changes in the filesystem between passes. It is
recommended that you always use this option when dumping a snapshot.
Beware that
.Nm
forks, and the actual memory use may be larger then the specified cache
size. The recommended cache size is between 8 and 32 (megabytes).
.It Fl d Ar density
Set tape density to
.Ar density .
@ -201,7 +209,8 @@ The default honor level is 1,
so that incremental backups omit such files
but full backups retain them.
.It Fl k
Use Kerberos authentication to talk to remote tape servers. (Only
Use Kerberos authentication to talk to remote tape servers.
(Only
available if this option was enabled when
.Nm
was compiled.)
@ -222,6 +231,9 @@ notify all operators in the group
.Dq operator
by means similar to a
.Xr wall 1 .
.It Fl S
Display an estimate of the backup size and the number of
tapes required, and exit without actually performing the dump.
.It Fl s Ar feet
Attempt to calculate the amount of tape needed
at a particular density.
@ -230,9 +242,6 @@ If this amount is exceeded,
prompts for a new tape.
It is recommended to be a bit conservative on this option.
The default tape length is 2300 feet.
.It Fl S
Display an estimate of the backup size and the number of
tapes required, and exit without actually performing the dump.
.It Fl T Ar date
Use the specified date as the starting time for the dump
instead of the time determined from looking in
@ -299,7 +308,9 @@ option is set, all other options are ignored, and
.Nm
exits immediately.
.It Fl w
Is like W, but prints only those file systems which need to be dumped.
Is like
.Fl W ,
but prints only those file systems which need to be dumped.
.El
.Pp
Directories and regular files which have their
@ -442,7 +453,8 @@ is written.
.Pp
Currently,
.Xr physio 9
slices all requests into chunks of 64 KB. Therefore, it is
slices all requests into chunks of 64 KB.
Therefore, it is
impossible to use a larger output block size, so
.Nm
will prevent this from happening.
@ -472,7 +484,8 @@ for the operator running
The
.Nm
utility cannot do remote backups without being run as root, due to its
security history. This will be fixed in a later version of
security history.
This will be fixed in a later version of
.Fx .
Presently, it works if you set it setuid (like it used to be), but this
might constitute a security risk.

View File

@ -128,9 +128,9 @@ main(int argc, char *argv[])
obsolete(&argc, &argv);
#ifdef KERBEROS
#define optstring "0123456789aB:b:cd:f:h:kLns:ST:uWwD:C:"
#define optstring "0123456789aB:b:C:cD:d:f:h:kLnSs:T:uWw"
#else
#define optstring "0123456789aB:b:cd:f:h:Lns:ST:uWwD:C:"
#define optstring "0123456789aB:b:C:cD:d:f:h:LnSs:T:uWw"
#endif
while ((ch = getopt(argc, argv, optstring)) != -1)
#undef optstring
@ -155,10 +155,18 @@ main(int argc, char *argv[])
1L, 1000L);
break;
case 'C':
cachesize = numarg("cachesize", 0, 0) * 1024 * 1024;
break;
case 'c': /* Tape is cart. not 9-track */
cartridge = 1;
break;
case 'D':
dumpdates = optarg;
break;
case 'd': /* density, in bits per inch */
density = numarg("density", 10L, 327670L) / 10;
if (density >= 625 && !bflag)
@ -169,14 +177,6 @@ main(int argc, char *argv[])
tape = optarg;
break;
case 'D':
dumpdates = optarg;
break;
case 'C':
cachesize = numarg("cachesize", 0, 0) * 1024 * 1024;
break;
case 'h':
honorlevel = numarg("honor level", 0L, 10L);
break;
@ -195,14 +195,14 @@ main(int argc, char *argv[])
notify = 1;
break;
case 's': /* tape size, feet */
tsize = numarg("tape size", 1L, 0L) * 12 * 10;
break;
case 'S': /* exit after estimating # of tapes */
just_estimate = 1;
break;
case 's': /* tape size, feet */
tsize = numarg("tape size", 1L, 0L) * 12 * 10;
break;
case 'T': /* time of last dump */
spcl.c_ddate = unctime(optarg);
if (spcl.c_ddate < 0) {
@ -576,9 +576,9 @@ usage(void)
#ifdef KERBEROS
"k"
#endif
"nSu] [-B records] [-b blocksize] [-D dumpdates]\n"
" [-d density] [-f file] [-h level] [-s feet]\n"
" [-T date] [-C cachesizeMB] filesystem\n"
"LnSu] [-B records] [-b blocksize] [-C cachesize]\n"
" [-D dumpdates] [-d density] [-f file] [-h level] [-s feet]\n"
" [-T date] filesystem\n"
" dump -W | -w\n");
exit(X_STARTUP);
}

View File

@ -42,24 +42,22 @@
packets to network hosts
.Sh SYNOPSIS
.Nm
.Op Fl ADQRadfMnoqrv
.Op Fl AaDdfMnoQqRrv
.Op Fl c Ar count
.Op Fl i Ar wait
.Op Fl l Ar preload
.Op Fl m Ar ttl
.Op Fl p Ar pattern
.Op Fl P Ar policy
.Op Fl s Ar packetsize
.Op Fl p Ar pattern
.Op Fl S Ar src_addr
.Op Fl s Ar packetsize
.Op Fl t Ar timeout
.Op Fl z Ar tos
.Bo
.Ar host |
.Op Fl L
.Op Fl I Ar interface
.Op Fl T Ar ttl
.Ar mcast-group
.Bc
.Sh DESCRIPTION
The
.Nm
@ -79,7 +77,8 @@ header, followed by a
.Dq struct timeval
and then an arbitrary number of
.Dq pad
bytes used to fill out the packet. The options are as follows:
bytes used to fill out the packet.
The options are as follows:
.Bl -tag -width indent
.It Fl A
Audible.
@ -108,12 +107,12 @@ packets.
If this option is not specified,
.Nm
will operate until interrupted.
.It Fl D
Set the Don't Fragment bit.
.It Fl d
Set the
.Dv SO_DEBUG
option on the socket being used.
.It Fl D
Set the Don't Fragment bit.
.It Fl f
Flood ping.
Outputs packets as fast as they come back or one hundred times per second,
@ -130,6 +129,9 @@ Only the super-user may use this option.
.Bf -emphasis
This can be very hard on a network and should be used with caution.
.Ef
.It Fl I Ar interface
Source multicast packets with the given interface address.
This flag only applies if the ping destination is a multicast address.
.It Fl i Ar wait
Wait
.Ar wait
@ -141,8 +143,8 @@ values less than 1 second.
This option is incompatible with the
.Fl f
option.
.It Fl I Ar interface
Source multicast packets with the given interface address.
.It Fl L
Suppress loopback of multicast packets.
This flag only applies if the ping destination is a multicast address.
.It Fl l Ar preload
If
@ -152,24 +154,33 @@ is specified,
sends that many packets as fast as possible before falling into its normal
mode of behavior.
Only the super-user may use this option.
.It Fl L
Suppress loopback of multicast packets.
This flag only applies if the ping destination is a multicast address.
.It Fl M
Use
.Dv ICMP_MASKREQ
instead of
.Dv ICMP_ECHO .
Print the netmask of the remote machine.
Set the
.Va net.inet.icmp.maskrepl
MIB variable to enable
.Dv ICMP_MASKREPLY .
.It Fl m Ar ttl
Set the IP Time To Live for outgoing packets.
If not specified, the kernel uses the value of the
.Va net.inet.ip.ttl
MIB variable.
.It Fl M
Use ICMP_MASKREQ instead of ICMP_ECHO. Print the netmask of the remote
machine. Set the
.Va net.inet.icmp.maskrepl
MIB variable to enable ICMP_MASKREPLY.
.It Fl n
Numeric output only.
No attempt will be made to lookup symbolic names for host addresses.
.It Fl o
Exit successfully after receiving one reply packet.
.It Fl P Ar policy
.Ar policy
specifies IPsec policy for the ping session.
For details please refer to
.Xr ipsec 4
and
.Xr ipsec_set_policy 3 .
.It Fl p Ar pattern
You may specify up to 16
.Dq pad
@ -179,13 +190,6 @@ For example,
.Dq Li \-p ff
will cause the sent packet to be filled with all
ones.
.It Fl P Ar policy
.Ar policy
specifies IPsec policy for the ping session.
For details please refer to
.Xr ipsec 4
and
.Xr ipsec_set_policy 3 .
.It Fl Q
Somewhat quiet output.
.No Don Ap t
@ -194,8 +198,9 @@ Originally, the
.Fl v
flag was required to display such errors, but
.Fl v
displays all ICMP error messages. On a busy machine, this output can
be overbearing. Without the
displays all ICMP error messages.
On a busy machine, this output can be overbearing.
Without the
.Fl Q
flag,
.Nm
@ -232,6 +237,14 @@ This option can be used to ping a local host through an interface
that has no route through it
(e.g., after the interface was dropped by
.Xr routed 8 ) .
.It Fl S Ar src_addr
Use the following IP address as the source address in outgoing packets.
On hosts with more than one IP address, this option can be used to
force the source address to be something other than the IP address
of the interface the probe packet is sent on.
If the IP address
is not one of this machine's interface addresses, an error is
returned and nothing is sent.
.It Fl s Ar packetsize
Specify the number of data bytes to be sent.
The default is 56, which translates into 64
@ -241,19 +254,12 @@ with the 8 bytes of
.Tn ICMP
header data.
Only the super-user may specify values more than default.
.It Fl S Ar src_addr
Use the following IP address as the source address in outgoing packets.
On hosts with more than one IP address, this option can be used to
force the source address to be something other than the IP address
of the interface the probe packet is sent on. If the IP address
is not one of this machine's interface addresses, an error is
returned and nothing is sent.
.It Fl t Ar timeout
Specify a timeout, in seconds, before ping exits regardless of how
many packets have been received.
.It Fl T Ar ttl
Set the IP Time To Live for multicasted packets.
This flag only applies if the ping destination is a multicast address.
.It Fl t Ar timeout
Specify a timeout, in seconds, before ping exits regardless of how
many packets have been received.
.It Fl v
Verbose output.
.Tn ICMP

View File

@ -250,7 +250,7 @@ main(argc, argv)
outpack = outpackhdr + sizeof(struct ip);
while ((ch = getopt(argc, argv,
"ADI:LQRS:T:c:adfi:l:m:Mnop:qrs:t:vz:"
"Aac:DdfI:i:Ll:Mm:nop:QqRrS:s:T:t:vz:"
#ifdef IPSEC
#ifdef IPSEC_POLICY_IPSEC
"P:"
@ -288,6 +288,13 @@ main(argc, argv)
options |= F_FLOOD;
setbuf(stdout, (char *)NULL);
break;
case 'I': /* multicast interface */
if (inet_aton(optarg, &ifaddr) == 0)
errx(EX_USAGE,
"invalid multicast interface: `%s'",
optarg);
options |= F_MIF;
break;
case 'i': /* wait between sending packets */
t = strtod(optarg, &ep) * 1000.0;
if (*ep || ep == optarg || t > (double)INT_MAX)
@ -300,12 +307,9 @@ main(argc, argv)
err(EX_NOPERM, "-i interval too short");
}
break;
case 'I': /* multicast interface */
if (inet_aton(optarg, &ifaddr) == 0)
errx(EX_USAGE,
"invalid multicast interface: `%s'",
optarg);
options |= F_MIF;
case 'L':
options |= F_NOLOOP;
loop = 0;
break;
case 'l':
ultmp = strtoul(optarg, &ep, 0);
@ -318,9 +322,8 @@ main(argc, argv)
}
preload = ultmp;
break;
case 'L':
options |= F_NOLOOP;
loop = 0;
case 'M':
options |= F_MASK;
break;
case 'm': /* TTL */
ultmp = strtoul(optarg, &ep, 0);
@ -329,15 +332,25 @@ main(argc, argv)
ttl = ultmp;
options |= F_TTL;
break;
case 'M':
options |= F_MASK;
break;
case 'n':
options |= F_NUMERIC;
break;
case 'o':
options |= F_ONCE;
break;
#ifdef IPSEC
#ifdef IPSEC_POLICY_IPSEC
case 'P':
options |= F_POLICY;
if (!strncmp("in", optarg, 2))
policy_in = strdup(optarg);
else if (!strncmp("out", optarg, 3))
policy_out = strdup(optarg);
else
errx(1, "invalid security policy");
break;
#endif /*IPSEC_POLICY_IPSEC*/
#endif /*IPSEC*/
case 'p': /* fill buffer with user pattern */
options |= F_PINGFILLED;
payload = optarg;
@ -354,6 +367,9 @@ main(argc, argv)
case 'r':
options |= F_SO_DONTROUTE;
break;
case 'S':
source = optarg;
break;
case 's': /* size of packet to send */
ultmp = strtoul(optarg, &ep, 0);
if (*ep || ep == optarg)
@ -367,8 +383,13 @@ main(argc, argv)
}
datalen = ultmp;
break;
case 'S':
source = optarg;
case 'T': /* multicast TTL */
ultmp = strtoul(optarg, &ep, 0);
if (*ep || ep == optarg || ultmp > MAXTTL)
errx(EX_USAGE, "invalid multicast TTL: `%s'",
optarg);
mttl = ultmp;
options |= F_MTTL;
break;
case 't':
alarmtimeout = strtoul(optarg, &ep, 0);
@ -380,28 +401,9 @@ main(argc, argv)
optarg, MAXALARM);
alarm((int)alarmtimeout);
break;
case 'T': /* multicast TTL */
ultmp = strtoul(optarg, &ep, 0);
if (*ep || ep == optarg || ultmp > MAXTTL)
errx(EX_USAGE, "invalid multicast TTL: `%s'",
optarg);
mttl = ultmp;
options |= F_MTTL;
break;
case 'v':
options |= F_VERBOSE;
break;
#ifdef IPSEC
#ifdef IPSEC_POLICY_IPSEC
case 'P':
options |= F_POLICY;
if (!strncmp("in", optarg, 2))
policy_in = strdup(optarg);
else if (!strncmp("out", optarg, 3))
policy_out = strdup(optarg);
else
errx(1, "invalid security policy");
break;
case 'z':
options |= F_HDRINCL;
ultmp = strtoul(optarg, &ep, 0);
@ -409,8 +411,6 @@ main(argc, argv)
errx(EX_USAGE, "invalid TOS: `%s'", optarg);
tos = ultmp;
break;
#endif /*IPSEC_POLICY_IPSEC*/
#endif /*IPSEC*/
default:
usage();
}
@ -1515,14 +1515,14 @@ static void
usage()
{
(void)fprintf(stderr, "%s\n%s\n%s\n",
"usage: ping [-ADQRadfnoqrv] [-c count] [-i wait] [-l preload] [-m ttl]",
" [-p pattern] "
"usage: ping [-AaDdfMnoQqRrv] [-c count] [-i wait] [-l preload] [-m ttl]",
" "
#ifdef IPSEC
#ifdef IPSEC_POLICY_IPSEC
"[-P policy] "
#endif
#endif
"[-s packetsize] [-S src_addr] [-t timeout]",
" [-z tos ] [host | [-L] [-I iface] [-T ttl] mcast-group]");
"[-p pattern] [-S src_addr] [-s packetsize] [-t timeout]",
" [-z tos ] host | [-L] [-I iface] [-T ttl] mcast-group");
exit(EX_USAGE);
}

View File

@ -41,10 +41,10 @@
.Sh SYNOPSIS
.Nm
.Op Fl A
.Op Fl L Ar volname
.Op Fl a Cm enable | disable
.Op Fl e Ar maxbpg
.Op Fl f Ar avgfilesize
.Op Fl L Ar volname
.Op Fl l Cm enable | disable
.Op Fl m Ar minfree
.Op Fl n Cm enable | disable
@ -72,8 +72,6 @@ Specifying
this option will cause all backups to be modified as well as the
primary super-block.
This is potentially dangerous - use with caution.
.It Fl L Ar volname
Add/modify an optional file system volume label.
.It Fl a Cm enable | disable
Turn on/off the administrative ACL enable flag.
.It Fl e Ar maxbpg
@ -93,6 +91,8 @@ For file systems with exclusively large files,
this parameter should be set higher.
.It Fl f Ar avgfilesize
Specify the expected average file size.
.It Fl L Ar volname
Add/modify an optional file system volume label.
.It Fl l Cm enable | disable
Turn on/off MAC multilabel flag.
.It Fl m Ar minfree

View File

@ -96,28 +96,12 @@ main(int argc, char *argv[])
if (argc < 3)
usage();
found_arg = 0; /* at least one arg is required */
while ((ch = getopt(argc, argv, "AL:a:e:f:l:m:n:o:ps:")) != -1)
while ((ch = getopt(argc, argv, "Aa:e:f:L:l:m:n:o:ps:")) != -1)
switch (ch) {
case 'A':
found_arg = 1;
Aflag++;
break;
case 'L':
found_arg = 1;
name = "volume label";
Lvalue = optarg;
i = -1;
while (isalnum(Lvalue[++i]));
if (Lvalue[i] != '\0') {
errx(10, "bad %s. Valid characters are alphanumerics.",
name);
}
if (strlen(Lvalue) >= MAXVOLLEN) {
errx(10, "bad %s. Length is longer than %d.",
name, MAXVOLLEN - 1);
}
Lflag = 1;
break;
case 'a':
found_arg = 1;
name = "ACLs";
@ -144,6 +128,22 @@ main(int argc, char *argv[])
errx(10, "%s must be >= 1 (was %s)", name, optarg);
fflag = 1;
break;
case 'L':
found_arg = 1;
name = "volume label";
Lvalue = optarg;
i = -1;
while (isalnum(Lvalue[++i]));
if (Lvalue[i] != '\0') {
errx(10, "bad %s. Valid characters are alphanumerics.",
name);
}
if (strlen(Lvalue) >= MAXVOLLEN) {
errx(10, "bad %s. Length is longer than %d.",
name, MAXVOLLEN - 1);
}
Lflag = 1;
break;
case 'l':
found_arg = 1;
name = "multilabel MAC file system";
@ -376,8 +376,8 @@ void
usage(void)
{
fprintf(stderr, "%s\n%s\n%s\n%s\n",
"usage: tunefs [-A] [-L volname] [-a enable | disable] [-e maxbpg]",
" [-f avgfilesize] [-l enable | disable] [-m minfree]",
"usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]",
" [-L volname] [-l enable | disable] [-m minfree]",
" [-n enable | disable] [-o space | time] [-p]",
" [-s avgfpdir] special | filesystem");
exit(2);