Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

imported freebsd49

  • Loading branch information...
commit cf6cf3603a349060015e4bcba1b5c2b5ab5e946e 1 parent 8a4fcd6
suz authored
View
54 freebsd4/etc/mtree/BSD.local.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.55.2.19 2002/08/17 19:11:15 ache Exp $
+# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.55.2.22 2003/08/21 17:34:43 mtm Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -218,6 +218,54 @@
..
mann
..
+ ru.KOI8-R
+/set uname=man
+ cat1
+ ..
+ cat2
+ ..
+ cat3
+ ..
+ cat4
+ ..
+ cat5
+ ..
+ cat6
+ ..
+ cat7
+ ..
+ cat8
+ ..
+ cat9
+ ..
+ catl
+ ..
+ catn
+ ..
+/set uname=root
+ man1
+ ..
+ man2
+ ..
+ man3
+ ..
+ man4
+ ..
+ man5
+ ..
+ man6
+ ..
+ man7
+ ..
+ man8
+ ..
+ man9
+ ..
+ manl
+ ..
+ mann
+ ..
+ ..
..
sbin
..
@@ -249,6 +297,8 @@
..
af_ZA.ISO8859-15
..
+ am_ET.UTF-8
+ ..
bg_BG.CP1251
..
cs_CZ.ISO8859-2
@@ -383,6 +433,8 @@
..
ro_RO.ISO8859-2
..
+ ru_RU.CP1251
+ ..
ru_RU.CP866
..
ru_RU.ISO8859-5
View
20 freebsd4/etc/mtree/BSD.usr.dist
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.188.2.40 2003/02/14 22:38:14 nectar Exp $
+# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.188.2.44 2003/08/21 17:34:43 mtm Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -445,6 +445,8 @@
..
af_ZA.ISO8859-15
..
+ am_ET.UTF-8
+ ..
bg_BG.CP1251
..
cs_CZ.ISO8859-2
@@ -581,6 +583,8 @@
..
ro_RO.ISO8859-2
..
+ ru_RU.CP1251
+ ..
ru_RU.CP866
..
ru_RU.ISO8859-5
@@ -638,8 +642,6 @@
i386
..
..
- catn
- ..
en.ISO8859-1 uname=root
cat1
..
@@ -671,8 +673,6 @@
i386
..
..
- catn
- ..
..
ja uname=root
cat1
@@ -693,8 +693,6 @@
..
cat9
..
- catn
- ..
/set uname=root
man1
..
@@ -714,8 +712,6 @@
..
man9
..
- mann
- ..
..
man1
..
@@ -747,8 +743,6 @@
i386
..
..
- mann
- ..
..
me
..
@@ -767,6 +761,8 @@
..
af_ZA.ISO8859-15
..
+ am_ET.UTF-8
+ ..
bg_BG.CP1251
..
cs_CZ.ISO8859-2
@@ -901,6 +897,8 @@
..
ro_RO.ISO8859-2
..
+ ru_RU.CP1251
+ ..
ru_RU.CP866
..
ru_RU.ISO8859-5
View
4 freebsd4/etc/rc.network6
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $FreeBSD: src/etc/rc.network6,v 1.5.2.23 2002/07/24 18:25:42 ume Exp $
+# $FreeBSD: src/etc/rc.network6,v 1.5.2.24 2003/08/15 09:19:01 ume Exp $
#
# Note that almost all of the user-configurable behavior is not in this
@@ -319,7 +319,7 @@ network6_interface_setup() {
sysctl net.inet6.ip6.accept_rtadv=1
set ${rtsol_interfaces}
ifconfig $1 up
- rtsol $1
+ rtsol ${rtsol_flags} $1
fi
for i in $interfaces; do
View
9 freebsd4/libexec/tftpd/tftpd.8
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)tftpd.8 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/libexec/tftpd/tftpd.8,v 1.6.2.5 2001/08/16 10:44:21 ru Exp $
+.\" $FreeBSD: src/libexec/tftpd/tftpd.8,v 1.6.2.6 2003/04/06 19:42:56 dwmalone Exp $
.\"
.Dd September 14, 2000
.Dt TFTPD 8
@@ -45,8 +45,9 @@
.Op Fl u Ar user
.Op Ar directory ...
.Sh DESCRIPTION
-.Nm Tftpd
-is a server which supports the
+The
+.Nm
+utility is a server which supports the
Internet Trivial File Transfer
Protocol
.Pq Tn RFC 1350 .
@@ -177,7 +178,7 @@ The user must be specified by name, not a numeric UID.
.Sh HISTORY
The
.Nm
-command appeared in
+utility appeared in
.Bx 4.2 ;
the
.Fl s
View
234 freebsd4/libexec/tftpd/tftpd.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)tftpd.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$FreeBSD: src/libexec/tftpd/tftpd.c,v 1.15.2.4 2002/04/26 17:22:41 ume Exp $";
+ "$FreeBSD: src/libexec/tftpd/tftpd.c,v 1.15.2.5 2003/04/06 19:42:56 dwmalone Exp $";
#endif /* not lint */
/*
@@ -79,10 +79,11 @@ static const char rcsid[] =
#include "tftpsubs.h"
#define TIMEOUT 5
+#define MAX_TIMEOUTS 5
int peer;
int rexmtval = TIMEOUT;
-int maxtimeout = 5*TIMEOUT;
+int max_rexmtval = 2*TIMEOUT;
#define PKTSIZE SEGSIZE+4
char buf[PKTSIZE];
@@ -90,8 +91,8 @@ char ackbuf[PKTSIZE];
struct sockaddr_storage from;
int fromlen;
-void tftp __P((struct tftphdr *, int));
-static void unmappedaddr __P((struct sockaddr_in6 *));
+void tftp(struct tftphdr *, int);
+static void unmappedaddr(struct sockaddr_in6 *);
/*
* Null-terminated directory prefix list for absolute pathname requests and
@@ -102,29 +103,31 @@ static void unmappedaddr __P((struct sockaddr_in6 *));
*/
#define MAXDIRS 20
static struct dirlist {
- char *name;
+ const char *name;
int len;
} dirs[MAXDIRS+1];
static int suppress_naks;
static int logging;
static int ipchroot;
-static char *errtomsg __P((int));
-static void nak __P((int));
+static const char *errtomsg(int);
+static void nak(int);
+static void oack(void);
+
+static void timer(int);
+static void justquit(int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
- register struct tftphdr *tp;
- register int n;
+ struct tftphdr *tp;
+ int n;
int ch, on;
struct sockaddr_storage me;
int len;
char *chroot_dir = NULL;
struct passwd *nobody;
- char *chuser = "nobody";
+ const char *chuser = "nobody";
openlog("tftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
while ((ch = getopt(argc, argv, "cClns:u:")) != -1) {
@@ -271,6 +274,7 @@ main(argc, argv)
}
chdir( "/" );
setuid(nobody->pw_uid);
+ setgroups(1, &nobody->pw_gid);
}
len = sizeof(me);
@@ -315,15 +319,15 @@ main(argc, argv)
}
struct formats;
-int validate_access __P((char **, int));
-void xmitfile __P((struct formats *));
-void recvfile __P((struct formats *));
+int validate_access(char **, int);
+void xmitfile(struct formats *);
+void recvfile(struct formats *);
struct formats {
- char *f_mode;
- int (*f_validate) __P((char **, int));
- void (*f_send) __P((struct formats *));
- void (*f_recv) __P((struct formats *));
+ const char *f_mode;
+ int (*f_validate)(char **, int);
+ void (*f_send)(struct formats *);
+ void (*f_recv)(struct formats *);
int f_convert;
} formats[] = {
{ "netascii", validate_access, xmitfile, recvfile, 1 },
@@ -331,21 +335,34 @@ struct formats {
#ifdef notdef
{ "mail", validate_user, sendmail, recvmail, 1 },
#endif
- { 0 }
+ { 0, NULL, NULL, NULL, 0 }
+};
+
+struct options {
+ const char *o_type;
+ char *o_request;
+ int o_reply; /* turn into union if need be */
+} options[] = {
+ { "tsize", NULL, 0 }, /* OPT_TSIZE */
+ { "timeout", NULL, 0 }, /* OPT_TIMEOUT */
+ { NULL, NULL, 0 }
+};
+
+enum opt_enum {
+ OPT_TSIZE = 0,
+ OPT_TIMEOUT,
};
/*
* Handle initial connection protocol.
*/
void
-tftp(tp, size)
- struct tftphdr *tp;
- int size;
+tftp(struct tftphdr *tp, int size)
{
- register char *cp;
- int first = 1, ecode;
- register struct formats *pf;
- char *filename, *mode;
+ char *cp;
+ int i, first = 1, has_options = 0, ecode;
+ struct formats *pf;
+ char *filename, *mode, *option, *ccp;
filename = cp = tp->th_stuff;
again:
@@ -373,7 +390,47 @@ tftp(tp, size)
nak(EBADOP);
exit(1);
}
+ while (++cp < buf + size) {
+ for (i = 2, ccp = cp; i > 0; ccp++) {
+ if (ccp >= buf + size) {
+ /*
+ * Don't reject the request, just stop trying
+ * to parse the option and get on with it.
+ * Some Apple OpenFirmware versions have
+ * trailing garbage on the end of otherwise
+ * valid requests.
+ */
+ goto option_fail;
+ } else if (*ccp == '\0')
+ i--;
+ }
+ for (option = cp; *cp; cp++)
+ if (isupper(*cp))
+ *cp = tolower(*cp);
+ for (i = 0; options[i].o_type != NULL; i++)
+ if (strcmp(option, options[i].o_type) == 0) {
+ options[i].o_request = ++cp;
+ has_options = 1;
+ }
+ cp = ccp-1;
+ }
+
+option_fail:
+ if (options[OPT_TIMEOUT].o_request) {
+ int to = atoi(options[OPT_TIMEOUT].o_request);
+ if (to < 1 || to > 255) {
+ nak(EBADOP);
+ exit(1);
+ }
+ else if (to <= max_rexmtval)
+ options[OPT_TIMEOUT].o_reply = rexmtval = to;
+ else
+ options[OPT_TIMEOUT].o_request = NULL;
+ }
+
ecode = (*pf->f_validate)(&filename, tp->th_opcode);
+ if (has_options)
+ oack();
if (logging) {
char hbuf[NI_MAXHOST];
@@ -416,9 +473,7 @@ FILE *file;
* given as we have no login directory.
*/
int
-validate_access(filep, mode)
- char **filep;
- int mode;
+validate_access(char **filep, int mode)
{
struct stat stbuf;
int fd;
@@ -492,6 +547,14 @@ validate_access(filep, mode)
return (err);
*filep = filename = pathname;
}
+ if (options[OPT_TSIZE].o_request) {
+ if (mode == RRQ)
+ options[OPT_TSIZE].o_reply = stbuf.st_size;
+ else
+ /* XXX Allows writes of all sizes. */
+ options[OPT_TSIZE].o_reply =
+ atoi(options[OPT_TSIZE].o_request);
+ }
fd = open(filename, mode == RRQ ? O_RDONLY : O_WRONLY|O_TRUNC);
if (fd < 0)
return (errno + 100);
@@ -502,15 +565,13 @@ validate_access(filep, mode)
return (0);
}
-int timeout;
+int timeouts;
jmp_buf timeoutbuf;
void
-timer()
+timer(int sig __unused)
{
-
- timeout += rexmtval;
- if (timeout >= maxtimeout)
+ if (++timeouts > MAX_TIMEOUTS)
exit(1);
longjmp(timeoutbuf, 1);
}
@@ -519,12 +580,11 @@ timer()
* Send the requested file.
*/
void
-xmitfile(pf)
- struct formats *pf;
+xmitfile(struct formats *pf)
{
- struct tftphdr *dp, *r_init();
- register struct tftphdr *ap; /* ack packet */
- register int size, n;
+ struct tftphdr *dp;
+ struct tftphdr *ap; /* ack packet */
+ int size, n;
volatile unsigned short block;
signal(SIGALRM, timer);
@@ -539,7 +599,7 @@ xmitfile(pf)
}
dp->th_opcode = htons((u_short)DATA);
dp->th_block = htons((u_short)block);
- timeout = 0;
+ timeouts = 0;
(void)setjmp(timeoutbuf);
send_data:
@@ -589,7 +649,7 @@ xmitfile(pf)
}
void
-justquit()
+justquit(int sig __unused)
{
exit(0);
}
@@ -599,12 +659,11 @@ justquit()
* Receive a file.
*/
void
-recvfile(pf)
- struct formats *pf;
+recvfile(struct formats *pf)
{
- struct tftphdr *dp, *w_init();
- register struct tftphdr *ap; /* ack buffer */
- register int n, size;
+ struct tftphdr *dp;
+ struct tftphdr *ap; /* ack buffer */
+ int n, size;
volatile unsigned short block;
signal(SIGALRM, timer);
@@ -612,7 +671,7 @@ recvfile(pf)
ap = (struct tftphdr *)ackbuf;
block = 0;
do {
- timeout = 0;
+ timeouts = 0;
ap->th_opcode = htons((u_short)ACK);
ap->th_block = htons((u_short)block);
block++;
@@ -675,7 +734,7 @@ recvfile(pf)
struct errmsg {
int e_code;
- char *e_msg;
+ const char *e_msg;
} errmsgs[] = {
{ EUNDEF, "Undefined error code" },
{ ENOTFOUND, "File not found" },
@@ -685,22 +744,22 @@ struct errmsg {
{ EBADID, "Unknown transfer ID" },
{ EEXISTS, "File already exists" },
{ ENOUSER, "No such user" },
+ { EOPTNEG, "Option negotiation" },
{ -1, 0 }
};
-static char *
-errtomsg(error)
- int error;
+static const char *
+errtomsg(int error)
{
- static char buf[20];
- register struct errmsg *pe;
+ static char ebuf[20];
+ struct errmsg *pe;
if (error == 0)
return "success";
for (pe = errmsgs; pe->e_code >= 0; pe++)
if (pe->e_code == error)
return pe->e_msg;
- snprintf(buf, sizeof(buf), "error %d", error);
- return buf;
+ snprintf(ebuf, sizeof(buf), "error %d", error);
+ return ebuf;
}
/*
@@ -710,12 +769,11 @@ errtomsg(error)
* offset by 100.
*/
static void
-nak(error)
- int error;
+nak(int error)
{
- register struct tftphdr *tp;
+ struct tftphdr *tp;
int length;
- register struct errmsg *pe;
+ struct errmsg *pe;
tp = (struct tftphdr *)buf;
tp->th_opcode = htons((u_short)ERROR);
@@ -755,3 +813,57 @@ unmappedaddr(struct sockaddr_in6 *sin6)
sin4->sin_family = AF_INET;
sin4->sin_len = sizeof(struct sockaddr_in);
}
+
+/*
+ * Send an oack packet (option acknowledgement).
+ */
+static void
+oack(void)
+{
+ struct tftphdr *tp, *ap;
+ int size, i, n;
+ char *bp;
+
+ tp = (struct tftphdr *)buf;
+ bp = buf + 2;
+ size = sizeof(buf) - 2;
+ tp->th_opcode = htons((u_short)OACK);
+ for (i = 0; options[i].o_type != NULL; i++) {
+ if (options[i].o_request) {
+ n = snprintf(bp, size, "%s%c%d", options[i].o_type,
+ 0, options[i].o_reply);
+ bp += n+1;
+ size -= n+1;
+ if (size < 0) {
+ syslog(LOG_ERR, "oack: buffer overflow");
+ exit(1);
+ }
+ }
+ }
+ size = bp - buf;
+ ap = (struct tftphdr *)ackbuf;
+ signal(SIGALRM, timer);
+ timeouts = 0;
+
+ (void)setjmp(timeoutbuf);
+ if (send(peer, buf, size, 0) != size) {
+ syslog(LOG_INFO, "oack: %m");
+ exit(1);
+ }
+
+ for (;;) {
+ alarm(rexmtval);
+ n = recv(peer, ackbuf, sizeof (ackbuf), 0);
+ alarm(0);
+ if (n < 0) {
+ syslog(LOG_ERR, "recv: %m");
+ exit(1);
+ }
+ ap->th_opcode = ntohs((u_short)ap->th_opcode);
+ ap->th_block = ntohs((u_short)ap->th_block);
+ if (ap->th_opcode == ERROR)
+ exit(1);
+ if (ap->th_opcode == ACK && ap->th_block == 0)
+ break;
+ }
+}
View
41 freebsd4/usr.bin/netstat/inet.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95";
*/
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/netstat/inet.c,v 1.37.2.9 2001/12/17 20:03:59 jlemon Exp $";
+ "$FreeBSD: src/usr.bin/netstat/inet.c,v 1.37.2.10 2003/08/24 09:04:19 hsu Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -58,6 +58,7 @@ static const char rcsid[] =
#include <netinet/icmp_var.h>
#include <netinet/igmp_var.h>
#include <netinet/ip_var.h>
+#include <netinet/pim_var.h>
#include <netinet/tcp.h>
#include <netinet/tcpip.h>
#include <netinet/tcp_seq.h>
@@ -705,6 +706,44 @@ igmp_stats(u_long off __unused, char *name, int af __unused)
}
/*
+ * Dump PIM statistics structure.
+ */
+void
+pim_stats(u_long off __unused, char *name, int af1 __unused)
+{
+ struct pimstat pimstat, zerostat;
+ size_t len = sizeof pimstat;
+
+ if (zflag)
+ memset(&zerostat, 0, len);
+ if (sysctlbyname("net.inet.pim.stats", &pimstat, &len,
+ zflag ? &zerostat : NULL, zflag ? len : 0) < 0) {
+ warn("sysctl: net.inet.pim.stats");
+ return;
+ }
+
+ printf("%s:\n", name);
+
+#define p(f, m) if (pimstat.f || sflag <= 1) \
+ printf(m, pimstat.f, plural(pimstat.f))
+#define py(f, m) if (pimstat.f || sflag <= 1) \
+ printf(m, pimstat.f, pimstat.f != 1 ? "ies" : "y")
+ p(pims_rcv_total_msgs, "\t%llu message%s received\n");
+ p(pims_rcv_total_bytes, "\t%llu byte%s received\n");
+ p(pims_rcv_tooshort, "\t%llu message%s received with too few bytes\n");
+ p(pims_rcv_badsum, "\t%llu message%s received with bad checksum\n");
+ p(pims_rcv_badversion, "\t%llu message%s received with bad version\n");
+ p(pims_rcv_registers_msgs, "\t%llu data register message%s received\n");
+ p(pims_rcv_registers_bytes, "\t%llu data register byte%s received\n");
+ p(pims_rcv_registers_wrongiif, "\t%llu data register message%s received on wrong iif\n");
+ p(pims_rcv_badregisters, "\t%llu bad register%s received\n");
+ p(pims_snd_registers_msgs, "\t%llu data register message%s sent\n");
+ p(pims_snd_registers_bytes, "\t%llu data register byte%s sent\n");
+#undef p
+#undef py
+}
+
+/*
* Pretty print an Internet address (net address + port).
*/
void
View
4 freebsd4/usr.bin/netstat/main.c
@@ -42,7 +42,7 @@ char const copyright[] =
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94";
#endif
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/netstat/main.c,v 1.34.2.12 2001/09/17 15:17:46 ru Exp $";
+ "$FreeBSD: src/usr.bin/netstat/main.c,v 1.34.2.13 2003/08/24 09:04:19 hsu Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -214,6 +214,8 @@ struct protox ip6protox[] = {
rip6_stats, NULL, "rip6", 0 },
{ -1, -1, 1, 0,
bdg_stats, NULL, "bdg", 1 /* bridging... */ },
+ { -1, -1, 1, protopr,
+ pim_stats, NULL, "pim", IPPROTO_PIM },
{ -1, -1, 0, 0,
0, NULL, 0, 0 }
};
View
97 freebsd4/usr.bin/netstat/mroute.c
@@ -39,11 +39,11 @@
#ifndef lint
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/netstat/mroute.c,v 1.11.2.4 2001/09/17 14:53:17 ru Exp $";
+ "$FreeBSD: src/usr.bin/netstat/mroute.c,v 1.11.2.5 2003/08/24 09:04:19 hsu Exp $";
#endif /* not lint */
/*
- * Print DVMRP multicast routing structures and statistics.
+ * Print multicast routing structures and statistics.
*
* MROUTING 1.0
*/
@@ -66,6 +66,8 @@ static const char rcsid[] =
#include <stdlib.h>
#include "netstat.h"
+static void print_bw_meter(struct bw_meter *bw_meter, int *banner_printed);
+
void
mroutepr(u_long mfcaddr, u_long vifaddr)
{
@@ -137,6 +139,26 @@ mroutepr(u_long mfcaddr, u_long vifaddr)
mfc.mfc_ttls[vifi]);
}
printf("\n");
+
+ /* Print the bw meter information */
+ {
+ struct bw_meter bw_meter, *bwm;
+ int banner_printed2 = 0;
+
+ bwm = mfc.mfc_bw_meter;
+ while (bwm) {
+ kread((u_long)bwm, (char *)&bw_meter,
+ sizeof bw_meter);
+ print_bw_meter(&bw_meter,
+ &banner_printed2);
+ bwm = bw_meter.bm_mfc_next;
+ }
+#if 0 /* Don't ever print it? */
+ if (! banner_printed2)
+ printf("\n No Bandwidth Meters\n");
+#endif
+ }
+
m = mfc.mfc_next;
}
}
@@ -147,6 +169,77 @@ mroutepr(u_long mfcaddr, u_long vifaddr)
numeric_addr = saved_numeric_addr;
}
+static void
+print_bw_meter(struct bw_meter *bw_meter, int *banner_printed)
+{
+ char s0[256], s1[256], s2[256], s3[256];
+ struct timeval now, end, delta;
+
+ gettimeofday(&now, NULL);
+
+ if (! *banner_printed) {
+ printf(" Bandwidth Meters\n");
+ printf(" %-30s", "Measured(Start|Packets|Bytes)");
+ printf(" %s", "Type");
+ printf(" %-30s", "Thresh(Interval|Packets|Bytes)");
+ printf(" Remain");
+ printf("\n");
+ *banner_printed = 1;
+ }
+
+ /* The measured values */
+ if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS)
+ sprintf(s1, "%llu", bw_meter->bm_measured.b_packets);
+ else
+ sprintf(s1, "?");
+ if (bw_meter->bm_flags & BW_METER_UNIT_BYTES)
+ sprintf(s2, "%llu", bw_meter->bm_measured.b_bytes);
+ else
+ sprintf(s2, "?");
+ sprintf(s0, "%lu.%lu|%s|%s",
+ bw_meter->bm_start_time.tv_sec,
+ bw_meter->bm_start_time.tv_usec,
+ s1, s2);
+ printf(" %-30s", s0);
+
+ /* The type of entry */
+ sprintf(s0, "%s", "?");
+ if (bw_meter->bm_flags & BW_METER_GEQ)
+ sprintf(s0, "%s", ">=");
+ else if (bw_meter->bm_flags & BW_METER_LEQ)
+ sprintf(s0, "%s", "<=");
+ printf(" %-3s", s0);
+
+ /* The threshold values */
+ if (bw_meter->bm_flags & BW_METER_UNIT_PACKETS)
+ sprintf(s1, "%llu", bw_meter->bm_threshold.b_packets);
+ else
+ sprintf(s1, "?");
+ if (bw_meter->bm_flags & BW_METER_UNIT_BYTES)
+ sprintf(s2, "%llu", bw_meter->bm_threshold.b_bytes);
+ else
+ sprintf(s2, "?");
+ sprintf(s0, "%lu.%lu|%s|%s",
+ bw_meter->bm_threshold.b_time.tv_sec,
+ bw_meter->bm_threshold.b_time.tv_usec,
+ s1, s2);
+ printf(" %-30s", s0);
+
+ /* Remaining time */
+ timeradd(&bw_meter->bm_start_time,
+ &bw_meter->bm_threshold.b_time, &end);
+ if (timercmp(&now, &end, <=)) {
+ timersub(&end, &now, &delta);
+ sprintf(s3, "%lu.%lu", delta.tv_sec, delta.tv_usec);
+ } else {
+ /* Negative time */
+ timersub(&now, &end, &delta);
+ sprintf(s3, "-%lu.%lu", delta.tv_sec, delta.tv_usec);
+ }
+ printf(" %s", s3);
+
+ printf("\n");
+}
void
mrt_stats(u_long mstaddr)
View
17 freebsd4/usr.bin/netstat/netstat.1
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
-.\" $FreeBSD: src/usr.bin/netstat/netstat.1,v 1.22.2.12 2001/11/18 16:41:52 murray Exp $
+.\" $FreeBSD: src/usr.bin/netstat/netstat.1,v 1.22.2.14 2003/08/24 09:04:19 hsu Exp $
.\"
.Dd September 7, 2001
.Dt NETSTAT 1
@@ -49,7 +49,7 @@ depending on the options for the information presented.
.It Xo
.Bk -words
.Nm
-.Op Fl AaLnSW
+.Op Fl AaLlnSW
.Op Fl f Ar protocol_family | Fl p Ar protocol
.Op Fl M Ar core
.Op Fl N Ar system
@@ -189,7 +189,7 @@ The network manages a private pool of memory buffers.
.Bk -words
.Nm
.Fl r
-.Op Fl AanW
+.Op Fl AalnW
.Op Fl f Ar address_family
.Op Fl M Ar core
.Op Fl N Ar system
@@ -213,6 +213,8 @@ parent route);
normally these routes are not shown.
When
.Fl W
+or
+.Fl l
is also present,
show the path MTU
for each route.
@@ -233,7 +235,7 @@ is repeated, counters with a value of zero are suppressed.
.Bk -words
.Nm
.Fl g
-.Op Fl W
+.Op Fl lW
.Op Fl f Ar address_family
.Op Fl M Ar core
.Op Fl N Ar system
@@ -271,7 +273,7 @@ The following address families and protocols are recognized:
.It Em Family
.Em Protocols
.It Cm inet Pq Dv AF_INET
-.Cm bdg , divert , icmp , igmp , ip , ipsec , tcp , udp
+.Cm bdg , divert , icmp , igmp , ip , ipsec , pim , tcp , udp
.It Cm inet6 Pq Dv AF_INET6
.Cm bdg , icmp6 , ip6 , ipsec6 , rip6 , tcp , udp
.It Cm pfkey Pq Dv PF_KEY
@@ -293,6 +295,11 @@ The following address families and protocols are recognized:
The program will complain if
.Ar protocol
is unknown or if there is no statistics routine for it.
+.It Fl l
+The
+.Fl l
+option is equivalent to
+.Fl W .
.It Fl M
Extract values associated with the name list from the specified core
instead of the default
View
3  freebsd4/usr.bin/netstat/netstat.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)netstat.h 8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/usr.bin/netstat/netstat.h,v 1.16.2.7 2001/09/17 15:17:46 ru Exp $
+ * $FreeBSD: src/usr.bin/netstat/netstat.h,v 1.16.2.8 2003/08/24 09:04:19 hsu Exp $
*/
#include <sys/cdefs.h>
@@ -69,6 +69,7 @@ void udp_stats (u_long, char *, int);
void ip_stats (u_long, char *, int);
void icmp_stats (u_long, char *, int);
void igmp_stats (u_long, char *, int);
+void pim_stats (u_long, char *, int);
#ifdef IPSEC
void ipsec_stats (u_long, char *, int);
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.