Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

imported freebsd521

  • Loading branch information...
commit dc982102801e8d38f9cda6562673c18da7396814 1 parent 724d4fb
suz authored
42 freebsd5/etc/mtree/BSD.include.dist
View
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.66 2003/03/05 19:21:23 peter Exp $
+# $FreeBSD: src/etc/mtree/BSD.include.dist,v 1.77 2003/11/29 18:22:01 ru Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -7,6 +7,18 @@
.
arpa
..
+ bsnmp
+ ..
+ c++
+ 3.3
+ backward
+ ..
+ bits
+ ..
+ ext
+ ..
+ ..
+ ..
cam
scsi
..
@@ -16,12 +28,12 @@
dev
an
..
+ firewire
+ ..
ic
..
iicbus
..
- firewire
- ..
ofw
..
ppbus
@@ -30,6 +42,8 @@
..
usb
..
+ utopia
+ ..
wi
..
..
@@ -54,19 +68,13 @@
..
smbfs
..
+ udf
+ ..
umapfs
..
unionfs
..
..
- g++
- backward
- ..
- bits
- ..
- ext
- ..
- ..
geom
..
isc
@@ -75,6 +83,8 @@
cd9660
..
..
+ kadm5
+ ..
libmilter
..
machine
@@ -83,6 +93,8 @@
..
net
..
+ net80211
+ ..
netatalk
..
netatm
@@ -96,6 +108,8 @@
..
..
netgraph
+ atm
+ ..
bluetooth
include
..
@@ -112,6 +126,12 @@
netkey
..
netnatm
+ msg
+ ..
+ saal
+ ..
+ sig
+ ..
..
netncp
..
16 freebsd5/etc/mtree/BSD.local.dist
View
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.95 2003/03/24 09:39:09 ru Exp $
+# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.104 2003/11/29 18:22:01 ru Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -277,6 +277,8 @@
..
af_ZA.ISO8859-15
..
+ am_ET.UTF-8
+ ..
bg_BG.CP1251
..
ca_ES.ISO8859-1
@@ -363,6 +365,8 @@
..
hu_HU.ISO8859-2
..
+ hy_AM.ARMSCII-8
+ ..
is_IS.ISO8859-1
..
is_IS.ISO8859-15
@@ -379,6 +383,8 @@
..
ja_JP.eucJP
..
+ ko_KR.CP949
+ ..
ko_KR.eucKR
..
la_LN.ISO8859-1
@@ -417,6 +423,8 @@
..
ro_RO.ISO8859-2
..
+ ru_RU.CP1251
+ ..
ru_RU.CP866
..
ru_RU.ISO8859-5
@@ -441,6 +449,12 @@
..
uk_UA.KOI8-U
..
+ zh_CN.GB18030
+ ..
+ zh_CN.GB2312
+ ..
+ zh_CN.GBK
+ ..
zh_CN.eucCN
..
zh_TW.Big5
10 freebsd5/etc/mtree/BSD.root.dist
View
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.root.dist,v 1.62 2003/03/11 11:14:34 ru Exp $
+# $FreeBSD: src/etc/mtree/BSD.root.dist,v 1.65 2003/10/26 19:09:11 emax Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -20,6 +20,8 @@
etc
X11
..
+ bluetooth
+ ..
defaults
..
gnats
@@ -59,10 +61,16 @@
ssl
..
..
+ lib
+ ..
+ libexec
+ ..
mnt
..
proc mode=0555
..
+ rescue
+ ..
root
..
sbin
8 freebsd5/etc/mtree/BSD.sendmail.dist
View
@@ -1,12 +1,12 @@
-# $FreeBSD: src/etc/mtree/BSD.sendmail.dist,v 1.1 2002/04/20 19:00:11 gshapiro Exp $
+# $FreeBSD: src/etc/mtree/BSD.sendmail.dist,v 1.2 2003/11/29 18:22:01 ru Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
/set type=dir uname=root gname=wheel mode=0755
-. nochange
- var nochange
- spool nochange
+. nochange
+ var nochange
+ spool nochange
clientmqueue uname=smmsp gname=smmsp mode=0770
..
..
44 freebsd5/etc/mtree/BSD.usr.dist
View
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.273 2003/03/12 14:29:15 ru Exp $
+# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.287 2003/11/29 18:22:01 ru Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -30,8 +30,6 @@
..
lint
..
- msdosfs
- ..
stallion
..
..
@@ -52,6 +50,12 @@
sbin
..
share
+ bsnmp
+ defs
+ ..
+ mibs
+ ..
+ ..
calendar
de_DE.ISO8859-1
..
@@ -67,6 +71,8 @@
doc
IPv6
..
+ atm
+ ..
bind
html
..
@@ -242,6 +248,8 @@
meteor
..
netgraph
+ bluetooth
+ ..
..
nwclient
..
@@ -337,6 +345,8 @@
..
af_ZA.ISO8859-15
..
+ am_ET.UTF-8
+ ..
bg_BG.CP1251
..
ca_ES.ISO8859-1
@@ -425,6 +435,8 @@
..
hu_HU.ISO8859-2
..
+ hy_AM.ARMSCII-8
+ ..
is_IS.ISO8859-1
..
is_IS.ISO8859-15
@@ -441,6 +453,8 @@
..
ja_JP.eucJP
..
+ ko_KR.CP949
+ ..
ko_KR.eucKR
..
la_LN.ISO8859-1
@@ -479,6 +493,8 @@
..
ro_RO.ISO8859-2
..
+ ru_RU.CP1251
+ ..
ru_RU.CP866
..
ru_RU.ISO8859-5
@@ -503,6 +519,12 @@
..
uk_UA.KOI8-U
..
+ zh_CN.GB18030
+ ..
+ zh_CN.GB2312
+ ..
+ zh_CN.GBK
+ ..
zh_CN.eucCN
..
zh_TW.Big5
@@ -659,6 +681,8 @@
..
af_ZA.ISO8859-15
..
+ am_ET.UTF-8
+ ..
bg_BG.CP1251
..
ca_ES.ISO8859-1
@@ -745,6 +769,8 @@
..
hu_HU.ISO8859-2
..
+ hy_AM.ARMSCII-8
+ ..
is_IS.ISO8859-1
..
is_IS.ISO8859-15
@@ -761,6 +787,8 @@
..
ja_JP.eucJP
..
+ ko_KR.CP949
+ ..
ko_KR.eucKR
..
la_LN.ISO8859-1
@@ -799,6 +827,8 @@
..
ro_RO.ISO8859-2
..
+ ru_RU.CP1251
+ ..
ru_RU.CP866
..
ru_RU.ISO8859-5
@@ -823,6 +853,12 @@
..
uk_UA.KOI8-U
..
+ zh_CN.GB18030
+ ..
+ zh_CN.GB2312
+ ..
+ zh_CN.GBK
+ ..
zh_CN.eucCN
..
zh_TW.Big5
@@ -854,6 +890,8 @@
Etc
..
..
+ security
+ ..
sendmail
..
skel
8 freebsd5/etc/mtree/BSD.var.dist
View
@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.var.dist,v 1.67 2002/11/04 07:50:48 markm Exp $
+# $FreeBSD: src/etc/mtree/BSD.var.dist,v 1.68 2003/11/29 18:22:01 ru Exp $
#
# Please see the file src/etc/mtree/README before making changes to this file.
#
@@ -33,12 +33,10 @@
pkg
..
..
- empty mode=0555 flags=schg
+ empty mode=0555 flags=schg
..
-/set gname=games mode=0775
- games
+ games gname=games mode=0775
..
-/set gname=wheel mode=0755
heimdal mode=0700
..
log
4 freebsd5/etc/rc.d/network_ipv6
View
@@ -24,12 +24,12 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $FreeBSD: src/etc/rc.d/network_ipv6,v 1.34 2003/05/12 11:36:50 ume Exp $
+# $FreeBSD: src/etc/rc.d/network_ipv6,v 1.35 2003/06/29 05:15:57 mtm Exp $
# From: src/etc/rc.network6,v 1.29 2002/04/06 15:15:43
#
# PROVIDE: network_ipv6
-# REQUIRE: network2
+# REQUIRE: routing
# KEYWORD: FreeBSD
. /etc/rc.subr
40 freebsd5/usr.bin/netstat/if.c
View
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)if.c 8.3 (Berkeley) 4/28/95";
*/
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/netstat/if.c,v 1.53 2003/03/05 19:20:28 peter Exp $";
+ "$FreeBSD: src/usr.bin/netstat/if.c,v 1.55 2003/11/28 17:34:23 bms Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -169,7 +169,7 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
short timer;
int drops;
struct sockaddr *sa = NULL;
- char name[32], tname[16];
+ char name[IFNAMSIZ];
short network_layer;
short link_layer;
@@ -188,8 +188,12 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
return;
if (!pfunc) {
- printf("%-5.5s %5.5s %-13.13s %-17.17s %8.8s %5.5s",
- "Name", "Mtu", "Network", "Address", "Ipkts", "Ierrs");
+ if (Wflag)
+ printf("%-7.7s", "Name");
+ else
+ printf("%-5.5s", "Name");
+ printf(" %5.5s %-13.13s %-17.17s %8.8s %5.5s",
+ "Mtu", "Network", "Address", "Ipkts", "Ierrs");
if (bflag)
printf(" %10.10s","Ibytes");
printf(" %8.8s %5.5s", "Opkts", "Oerrs");
@@ -216,13 +220,10 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
if (ifaddraddr == 0) {
ifnetfound = ifnetaddr;
- if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet) ||
- kread((u_long)ifnet.if_name, tname, 16))
+ if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet))
return;
- tname[sizeof(tname) - 1] = '\0';
+ strlcpy(name, ifnet.if_xname, sizeof(name));
ifnetaddr = (u_long)TAILQ_NEXT(&ifnet, if_link);
- snprintf(name, sizeof(name), "%s%d", tname,
- ifnet.if_unit);
if (interface != 0 && (strcmp(name, interface) != 0))
continue;
cp = index(name, '\0');
@@ -254,7 +255,11 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
drops = ifnet.if_snd.ifq_drops;
if (ifaddraddr == 0) {
- printf("%-5.5s %5lu ", name, ifnet.if_mtu);
+ if (Wflag)
+ printf("%-7.7s", name);
+ else
+ printf("%-5.5s", name);
+ printf(" %5lu ", ifnet.if_mtu);
printf("%-13.13s ", "none");
printf("%-17.17s ", "none");
} else {
@@ -271,7 +276,11 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
(u_long)TAILQ_NEXT(&ifaddr.ifa, ifa_link);
continue;
}
- printf("%-5.5s %5lu ", name, ifnet.if_mtu);
+ if (Wflag)
+ printf("%-7.7s", name);
+ else
+ printf("%-5.5s", name);
+ printf(" %5lu ", ifnet.if_mtu);
switch (sa->sa_family) {
case AF_UNSPEC:
printf("%-13.13s ", "none");
@@ -464,7 +473,7 @@ intpr(int _interval, u_long ifnetaddr, void (*pfunc)(char *))
struct iftot {
SLIST_ENTRY(iftot) chain;
- char ift_name[16]; /* interface name */
+ char ift_name[IFNAMSIZ]; /* interface name */
u_long ift_ip; /* input packets */
u_long ift_ie; /* input errors */
u_long ift_op; /* output packets */
@@ -508,14 +517,11 @@ sidewaysintpr(unsigned interval1, u_long off)
interesting = NULL;
interesting_off = 0;
for (off = firstifnet, ip = iftot; off;) {
- char name[16], tname[16];
+ char name[IFNAMSIZ];
if (kread(off, (char *)&ifnet, sizeof ifnet))
break;
- if (kread((u_long)ifnet.if_name, tname, sizeof(tname)))
- break;
- tname[sizeof(tname) - 1] = '\0';
- snprintf(name, sizeof(name), "%s%d", tname, ifnet.if_unit);
+ strlcpy(name, ifnet.if_xname, sizeof(name));
if (interface && strcmp(name, interface) == 0) {
interesting = ip;
interesting_off = off;
43 freebsd5/usr.bin/netstat/inet.c
View
@@ -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.58 2003/04/02 20:14:44 mdodd Exp $";
+ "$FreeBSD: src/usr.bin/netstat/inet.c,v 1.60 2003/10/23 13:53:19 ru 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>
@@ -657,7 +658,7 @@ icmp_stats(u_long off __unused, const char *name, int af1 __unused)
}
p(icps_reflect, "\t%lu message response%s generated\n");
p2(icps_badaddr, "\t%lu invalid return address%s\n");
- p(icps_badaddr, "\t%lu no return route%s\n");
+ p(icps_noroute, "\t%lu no return route%s\n");
#undef p
#undef p1a
#undef p2
@@ -706,6 +707,44 @@ igmp_stats(u_long off __unused, const char *name, int af1 __unused)
}
/*
+ * Dump PIM statistics structure.
+ */
+void
+pim_stats(u_long off __unused, const 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
4 freebsd5/usr.bin/netstat/main.c
View
@@ -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.61 2003/03/05 19:20:29 peter Exp $";
+ "$FreeBSD: src/usr.bin/netstat/main.c,v 1.62 2003/08/07 18:21:21 hsu Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -168,6 +168,8 @@ struct protox {
#endif
{ -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 }
};
125 freebsd5/usr.bin/netstat/mroute.c
View
@@ -39,11 +39,11 @@
#ifndef lint
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/netstat/mroute.c,v 1.19 2002/09/05 17:06:51 dwmalone Exp $";
+ "$FreeBSD: src/usr.bin/netstat/mroute.c,v 1.21 2003/08/07 18:21:21 hsu Exp $";
#endif /* not lint */
/*
- * Print DVMRP multicast routing structures and statistics.
+ * Print multicast routing structures and statistics.
*
* MROUTING 1.0
*/
@@ -68,6 +68,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)
{
@@ -80,16 +82,35 @@ mroutepr(u_long mfcaddr, u_long vifaddr)
int banner_printed;
int saved_numeric_addr;
vifi_t maxvif = 0;
+ size_t len;
+
+ len = sizeof(mfctable);
+ if (sysctlbyname("net.inet.ip.mfctable", mfctable, &len, NULL, 0) < 0) {
+ warn("sysctl: net.inet.ip.mfctable");
+ /* Compatability with older kernels - candidate for removal */
+ if (mfcaddr == 0) {
+ printf("No IPv4 multicast routing compiled into this system.\n");
+ return;
+ }
+
+ kread(mfcaddr, (char *)mfctable, sizeof(mfctable));
+ }
- if (mfcaddr == 0 || vifaddr == 0) {
- printf("No IPv4 multicast routing compiled into this system.\n");
- return;
+ len = sizeof(viftable);
+ if (sysctlbyname("net.inet.ip.viftable", viftable, &len, NULL, 0) < 0) {
+ warn("sysctl: net.inet.ip.viftable");
+ /* Compatability with older kernels - candidate for removal */
+ if (vifaddr == 0) {
+ printf("No IPv4 multicast routing compiled into this system.\n");
+ return;
+ }
+
+ kread(vifaddr, (char *)viftable, sizeof(viftable));
}
saved_numeric_addr = numeric_addr;
numeric_addr = 1;
- kread(vifaddr, (char *)&viftable, sizeof(viftable));
banner_printed = 0;
for (vifi = 0, v = viftable; vifi < MAXVIFS; ++vifi, ++v) {
if (v->v_lcl_addr.s_addr == 0)
@@ -115,7 +136,6 @@ mroutepr(u_long mfcaddr, u_long vifaddr)
if (!banner_printed)
printf("\nVirtual Interface Table is empty\n");
- kread(mfcaddr, (char *)&mfctable, sizeof(mfctable));
banner_printed = 0;
for (i = 0; i < MFCTBLSIZ; ++i) {
m = mfctable[i];
@@ -139,6 +159,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;
}
}
@@ -149,6 +189,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)
12 freebsd5/usr.bin/netstat/netstat.1
View
@@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)netstat.1 8.8 (Berkeley) 4/18/94
-.\" $FreeBSD: src/usr.bin/netstat/netstat.1,v 1.44 2003/05/21 20:52:57 ru Exp $
+.\" $FreeBSD: src/usr.bin/netstat/netstat.1,v 1.46 2003/11/28 17:34:23 bms Exp $
.\"
.Dd September 7, 2001
.Dt NETSTAT 1
@@ -119,6 +119,9 @@ is also present, show the number of dropped packets.
If
.Fl t
is also present, show the contents of watchdog timers.
+If
+.Fl W
+is also present, print interface names using a wider field size.
.It Xo
.Bk -words
.Nm
@@ -215,7 +218,10 @@ When
.Fl W
is also present,
show the path MTU
-for each route.
+for each route,
+and print interface
+names with a wider
+field size.
.It Xo
.Bk -words
.Nm
@@ -271,7 +277,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
3  freebsd5/usr.bin/netstat/netstat.h
View
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)netstat.h 8.2 (Berkeley) 1/4/94
- * $FreeBSD: src/usr.bin/netstat/netstat.h,v 1.34 2003/02/20 04:26:58 bmilekic Exp $
+ * $FreeBSD: src/usr.bin/netstat/netstat.h,v 1.35 2003/08/07 18:21:21 hsu Exp $
*/
#include <sys/cdefs.h>
@@ -69,6 +69,7 @@ void udp_stats (u_long, const char *, int);
void ip_stats (u_long, const char *, int);
void icmp_stats (u_long, const char *, int);
void igmp_stats (u_long, const char *, int);
+void pim_stats (u_long, const char *, int);
#ifdef IPSEC
void ipsec_stats (u_long, const char *, int);
#endif
16 freebsd5/usr.bin/netstat/route.c
View
@@ -36,7 +36,7 @@
static char sccsid[] = "From: @(#)route.c 8.6 (Berkeley) 4/28/95";
#endif
static const char rcsid[] =
- "$FreeBSD: src/usr.bin/netstat/route.c,v 1.69 2003/03/05 19:20:29 peter Exp $";
+ "$FreeBSD: src/usr.bin/netstat/route.c,v 1.72 2003/11/28 17:34:23 bms Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -49,6 +49,7 @@ static const char rcsid[] =
#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/if_types.h>
+#include <net/radix.h>
#include <net/route.h>
#include <netinet/in.h>
@@ -224,13 +225,13 @@ pr_family(int af1)
#ifndef INET6
#define WID_DST_DEFAULT(af) 18 /* width of destination column */
#define WID_GW_DEFAULT(af) 18 /* width of gateway column */
-#define WID_IF_DEFAULT(af) 6 /* width of netif column */
+#define WID_IF_DEFAULT(af) (Wflag ? 8 : 6) /* width of netif column */
#else
#define WID_DST_DEFAULT(af) \
((af) == AF_INET6 ? (numeric_addr ? 33: 18) : 18)
#define WID_GW_DEFAULT(af) \
((af) == AF_INET6 ? (numeric_addr ? 29 : 18) : 18)
-#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : 6)
+#define WID_IF_DEFAULT(af) ((af) == AF_INET6 ? 8 : (Wflag ? 8 : 6))
#endif /*INET6*/
static int wid_dst;
@@ -328,12 +329,9 @@ size_cols_rtentry(struct rtentry *rt)
}
if (rt->rt_ifp) {
if (rt->rt_ifp != lastif) {
- len = snprintf(buffer, sizeof(buffer), "%d",
- ifnet.if_unit);
kget(rt->rt_ifp, ifnet);
- kread((u_long)ifnet.if_name, buffer, sizeof(buffer));
lastif = rt->rt_ifp;
- len += strlen(buffer);
+ len = strlen(ifnet.if_xname);
wid_if = MAX(len, wid_if);
}
if (rt->rt_rmx.rmx_expire) {
@@ -749,10 +747,8 @@ p_rtentry(struct rtentry *rt)
if (rt->rt_ifp) {
if (rt->rt_ifp != lastif) {
kget(rt->rt_ifp, ifnet);
- kread((u_long)ifnet.if_name, buffer, sizeof(buffer));
lastif = rt->rt_ifp;
- snprintf(prettyname, sizeof(prettyname),
- "%s%d", buffer, ifnet.if_unit);
+ strlcpy(prettyname, ifnet.if_xname, sizeof(prettyname));
}
printf("%*.*s", wid_if, wid_if, prettyname);
if (rt->rt_rmx.rmx_expire) {
Please sign in to comment.
Something went wrong with that request. Please try again.