Subject: kern/1515 [Re: PR-7148 (causes kernel panic)]
To: Christos Zoulas <christos@zoulas.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-net
Date: 11/02/1999 18:13:28
--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii

Hi,
here are diffs for the 64bit interface counter. I basically followed
Christos's suggestion about versionning the sysctl and routing socket message.
The thing I don't know how to deal with is rt_ifmsg(). If it sends both
messages (RTM_OIFINFO and RTM_IFINFO) it will complain about out-of-sync
ifaddr, but I think it only does at startup (not checked yet).
I didn't check what gated does yet, I will tomorow.

I found a mail from Darren Reed on the topic (tech-net, Mon, 7 Jun 1999
17:04:11 +1000 (EST), <199906070704.RAA00417@avalon.reed.wattle.id.au>,
"Re: kern/1515 - Changing netstat variables to 64 bit") whith a patch
included where is increases the per-protocols stats to 64bit as well.
As this is used only by kmem growvelers no compat problem here :),
so I did it as well (and for ip6 too).

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--

--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ip.diff"

Index: sys/dev/ic/elinkxl.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/ic/elinkxl.c,v
retrieving revision 1.15
diff -u -r1.15 elinkxl.c
--- elinkxl.c	1999/10/15 06:07:26	1.15
+++ elinkxl.c	1999/11/02 16:35:22
@@ -1410,7 +1410,7 @@
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
 
 	ex_getstats(sc);
-	printf("in %ld out %ld ierror %ld oerror %ld ibytes %ld obytes %ld\n",
+	printf("in %qd out %qd ierror %qd oerror %qd ibytes %qd obytes %qd\n",
 	    ifp->if_ipackets, ifp->if_opackets, ifp->if_ierrors,
 	    ifp->if_oerrors, ifp->if_ibytes, ifp->if_obytes);
 }
Index: sys/net/if.h
===================================================================
RCS file: /cvsroot/syssrc/sys/net/if.h,v
retrieving revision 1.41
diff -u -r1.41 if.h
--- if.h	1999/10/26 22:32:45	1.41
+++ if.h	1999/11/02 16:35:54
@@ -69,6 +69,10 @@
 /*  XXX fast fix for SNMP, going away soon */
 #include <sys/time.h>
 
+#if defined(_KERNEL) && !defined(_LKM)
+#include "opt_compat_netbsd.h"
+#endif
+
 struct mbuf;
 struct proc;
 struct rtentry;
@@ -84,6 +88,31 @@
 	u_char	ifi_type;		/* ethernet, tokenring, etc. */
 	u_char	ifi_addrlen;		/* media address length */
 	u_char	ifi_hdrlen;		/* media header length */
+	u_quad_t ifi_mtu;		/* maximum transmission unit */
+	u_quad_t ifi_metric;		/* routing metric (external only) */
+	u_quad_t ifi_baudrate;		/* linespeed */
+	/* volatile statistics */
+	u_quad_t ifi_ipackets;		/* packets received on interface */
+	u_quad_t ifi_ierrors;		/* input errors on interface */
+	u_quad_t ifi_opackets;		/* packets sent on interface */
+	u_quad_t ifi_oerrors;		/* output errors on interface */
+	u_quad_t ifi_collisions;	/* collisions on csma interfaces */
+	u_quad_t ifi_ibytes;		/* total number of octets received */
+	u_quad_t ifi_obytes;		/* total number of octets sent */
+	u_quad_t ifi_imcasts;		/* packets received via multicast */
+	u_quad_t ifi_omcasts;		/* packets sent via multicast */
+	u_quad_t ifi_iqdrops;		/* dropped on input, this interface */
+	u_quad_t ifi_noproto;		/* destined for unsupported protocol */
+	struct	timeval ifi_lastchange;	/* last updated */
+};
+
+#ifdef COMPAT_14
+/* Pre-1.5 if_data struct */
+struct	if_odata {
+	/* generic interface information */
+	u_char	ifi_type;		/* ethernet, tokenring, etc. */
+	u_char	ifi_addrlen;		/* media address length */
+	u_char	ifi_hdrlen;		/* media header length */
 	u_long	ifi_mtu;		/* maximum transmission unit */
 	u_long	ifi_metric;		/* routing metric (external only) */
 	u_long	ifi_baudrate;		/* linespeed */
@@ -101,6 +130,7 @@
 	u_long	ifi_noproto;		/* destined for unsupported protocol */
 	struct	timeval ifi_lastchange;	/* last updated */
 };
+#endif
 
 /*
  * Structure defining a queue for a network interface.
@@ -290,6 +320,19 @@
 	u_short	ifm_index;	/* index for associated ifp */
 	struct	if_data ifm_data;/* statistics and other data about if */
 };
+
+#ifdef COMPAT_14
+/* pre-1.5 if_msghdr (ifm_data changed) */
+struct if_msghdr14 {
+	u_short	ifm_msglen;	/* to skip over non-understood messages */
+	u_char	ifm_version;	/* future binary compatability */
+	u_char	ifm_type;	/* message type */
+	int	ifm_addrs;	/* like rtm_addrs */
+	int	ifm_flags;	/* value of if_flags */
+	u_short	ifm_index;	/* index for associated ifp */
+	struct	if_odata ifm_data;/* statistics and other data about if */
+};
+#endif
 
 /*
  * Message format for use in obtaining information about interface addresses
Index: sys/net/route.h
===================================================================
RCS file: /cvsroot/syssrc/sys/net/route.h,v
retrieving revision 1.19
diff -u -r1.19 route.h
--- route.h	1999/07/30 10:35:39	1.19
+++ route.h	1999/11/02 16:35:55
@@ -185,7 +185,8 @@
 #define RTM_RESOLVE	0xb	/* req to resolve dst to LL addr */
 #define RTM_NEWADDR	0xc	/* address being added to iface */
 #define RTM_DELADDR	0xd	/* address being removed from iface */
-#define RTM_IFINFO	0xe	/* iface going up/down etc. */
+#define RTM_OIFINFO	0xe	/* Old (pre-1.5) RTM_IFINFO message */
+#define RTM_IFINFO	0xf	/* iface going up/down etc. */
 
 #define RTV_MTU		0x1	/* init or lock _mtu */
 #define RTV_HOPCOUNT	0x2	/* init or lock _hopcount */
Index: sys/net/rtsock.c
===================================================================
RCS file: /cvsroot/syssrc/sys/net/rtsock.c,v
retrieving revision 1.31
diff -u -r1.31 rtsock.c
--- rtsock.c	1999/07/09 23:41:16	1.31
+++ rtsock.c	1999/11/02 16:35:56
@@ -540,6 +540,12 @@
 		len = sizeof(struct ifa_msghdr);
 		break;
 
+#ifdef COMPAT_14
+	case RTM_OIFINFO:
+		len = sizeof(struct if_msghdr14);
+		break;
+#endif
+
 	case RTM_IFINFO:
 		len = sizeof(struct if_msghdr);
 		break;
@@ -604,6 +610,11 @@
 	case RTM_NEWADDR:
 		len = sizeof(struct ifa_msghdr);
 		break;
+#ifdef COMPAT_14
+	case RTM_OIFINFO:
+		len = sizeof(struct if_msghdr14);
+		break;
+#endif
 
 	case RTM_IFINFO:
 		len = sizeof(struct if_msghdr);
@@ -826,9 +837,10 @@
 }
 
 int
-sysctl_iflist(af, w)
+sysctl_iflist(af, w, type)
 	int	af;
 	register struct	walkarg *w;
+	int type;
 {
 	register struct ifnet *ifp;
 	register struct ifaddr *ifa;
@@ -841,21 +853,92 @@
 			continue;
 		ifa = ifp->if_addrlist.tqh_first;
 		ifpaddr = ifa->ifa_addr;
-		if ((error = rt_msg2(RTM_IFINFO, &info, (caddr_t)0, w, &len)))
+		switch(type) {
+		case NET_RT_IFLIST:
+			error =
+			    rt_msg2(RTM_IFINFO, &info, (caddr_t)0, w, &len);
+			break;
+#ifdef COMPAT_14
+		case NET_RT_OIFLIST:
+			error =
+			    rt_msg2(RTM_OIFINFO, &info, (caddr_t)0, w, &len);
+			break;
+#endif
+		default:
+			panic("sysctl_iflist(1)");
+		}
+		if (error)
 			return (error);
 		ifpaddr = 0;
 		if (w->w_where && w->w_tmem && w->w_needed <= 0) {
-			register struct if_msghdr *ifm;
+			switch(type) {
+			case NET_RT_IFLIST: {
+				register struct if_msghdr *ifm;
+
+				ifm = (struct if_msghdr *)w->w_tmem;
+				ifm->ifm_index = ifp->if_index;
+				ifm->ifm_flags = ifp->if_flags;
+				ifm->ifm_data = ifp->if_data;
+				ifm->ifm_addrs = info.rti_addrs;
+				error = copyout(ifm, w->w_where, len);
+				if (error)
+					return (error);
+				w->w_where += len;
+				break;
+			}
 
-			ifm = (struct if_msghdr *)w->w_tmem;
-			ifm->ifm_index = ifp->if_index;
-			ifm->ifm_flags = ifp->if_flags;
-			ifm->ifm_data = ifp->if_data;
-			ifm->ifm_addrs = info.rti_addrs;
-			error = copyout(ifm, w->w_where, len);
-			if (error)
-				return (error);
-			w->w_where += len;
+#ifdef COMPAT_14
+			case NET_RT_OIFLIST: {
+				register struct if_msghdr14 *ifm;
+
+				ifm = (struct if_msghdr14 *)w->w_tmem;
+				ifm->ifm_index = ifp->if_index;
+				ifm->ifm_flags = ifp->if_flags;
+				ifm->ifm_data.ifi_type = ifp->if_data.ifi_type;
+				ifm->ifm_data.ifi_addrlen =
+				    ifp->if_data.ifi_addrlen;
+				ifm->ifm_data.ifi_hdrlen =
+				    ifp->if_data.ifi_hdrlen;
+				ifm->ifm_data.ifi_mtu = ifp->if_data.ifi_mtu;
+				ifm->ifm_data.ifi_metric =
+				    ifp->if_data.ifi_metric;
+				ifm->ifm_data.ifi_baudrate =
+				    ifp->if_data.ifi_baudrate;
+				ifm->ifm_data.ifi_ipackets =
+				    ifp->if_data.ifi_ipackets;
+				ifm->ifm_data.ifi_ierrors =
+				    ifp->if_data.ifi_ierrors;
+				ifm->ifm_data.ifi_opackets =
+				    ifp->if_data.ifi_opackets;
+				ifm->ifm_data.ifi_oerrors =
+				    ifp->if_data.ifi_oerrors;
+				ifm->ifm_data.ifi_collisions =
+				    ifp->if_data.ifi_collisions;
+				ifm->ifm_data.ifi_ibytes =
+				    ifp->if_data.ifi_ibytes;
+				ifm->ifm_data.ifi_obytes =
+				    ifp->if_data.ifi_obytes;
+				ifm->ifm_data.ifi_imcasts =
+				    ifp->if_data.ifi_imcasts;
+				ifm->ifm_data.ifi_omcasts =
+				    ifp->if_data.ifi_omcasts;
+				ifm->ifm_data.ifi_iqdrops =
+				    ifp->if_data.ifi_iqdrops;
+				ifm->ifm_data.ifi_noproto =
+				    ifp->if_data.ifi_noproto;
+				ifm->ifm_data.ifi_lastchange =
+				    ifp->if_data.ifi_lastchange;
+				ifm->ifm_addrs = info.rti_addrs;
+				error = copyout(ifm, w->w_where, len);
+				if (error)
+					return (error);
+				w->w_where += len;
+				break;
+			}
+#endif
+			default:
+				panic("sysctl_iflist(2)");
+			}
 		}
 		while ((ifa = ifa->ifa_list.tqe_next) != NULL) {
 			if (af && af != ifa->ifa_addr->sa_family)
@@ -931,8 +1014,14 @@
 				break;
 		break;
 
+#ifdef COMPAT_14
+	case NET_RT_OIFLIST:
+		error = sysctl_iflist(af, &w, w.w_op);
+		break;
+#endif
+
 	case NET_RT_IFLIST:
-		error = sysctl_iflist(af, &w);
+		error = sysctl_iflist(af, &w, w.w_op);
 	}
 	splx(s);
 
Index: sys/netinet/icmp_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/icmp_var.h,v
retrieving revision 1.12
diff -u -r1.12 icmp_var.h
--- icmp_var.h	1998/02/10 01:26:19	1.12
+++ icmp_var.h	1999/11/02 16:35:56
@@ -44,17 +44,17 @@
  */
 struct	icmpstat {
 /* statistics related to icmp packets generated */
-	u_long	icps_error;		/* # of calls to icmp_error */
-	u_long	icps_oldshort;		/* no error 'cuz old ip too short */
-	u_long	icps_oldicmp;		/* no error 'cuz old was icmp */
-	u_long	icps_outhist[ICMP_MAXTYPE + 1];
+	u_quad_t icps_error;		/* # of calls to icmp_error */
+	u_quad_t icps_oldshort;		/* no error 'cuz old ip too short */
+	u_quad_t icps_oldicmp;		/* no error 'cuz old was icmp */
+	u_quad_t icps_outhist[ICMP_MAXTYPE + 1];
 /* statistics related to input messages processed */
- 	u_long	icps_badcode;		/* icmp_code out of range */
-	u_long	icps_tooshort;		/* packet < ICMP_MINLEN */
-	u_long	icps_checksum;		/* bad checksum */
-	u_long	icps_badlen;		/* calculated bound mismatch */
-	u_long	icps_reflect;		/* number of responses */
-	u_long	icps_inhist[ICMP_MAXTYPE + 1];
+ 	u_quad_t icps_badcode;		/* icmp_code out of range */
+	u_quad_t icps_tooshort;		/* packet < ICMP_MINLEN */
+	u_quad_t icps_checksum;		/* bad checksum */
+	u_quad_t icps_badlen;		/* calculated bound mismatch */
+	u_quad_t icps_reflect;		/* number of responses */
+	u_quad_t icps_inhist[ICMP_MAXTYPE + 1];
 };
 
 /*
Index: sys/netinet/igmp_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/igmp_var.h,v
retrieving revision 1.10
diff -u -r1.10 igmp_var.h
--- igmp_var.h	1998/02/10 01:26:31	1.10
+++ igmp_var.h	1999/11/02 16:35:56
@@ -54,15 +54,15 @@
  */
 
 struct igmpstat {
-	u_long	igps_rcv_total;		/* total IGMP messages received */
-	u_long	igps_rcv_tooshort;	/* received with too few bytes */
-	u_long	igps_rcv_badsum;	/* received with bad checksum */
-	u_long	igps_rcv_queries;	/* received membership queries */
-	u_long	igps_rcv_badqueries;	/* received invalid queries */
-	u_long	igps_rcv_reports;	/* received membership reports */
-	u_long	igps_rcv_badreports;	/* received invalid reports */
-	u_long	igps_rcv_ourreports;	/* received reports for our groups */
-	u_long	igps_snd_reports;	/* sent membership reports */
+	u_quad_t igps_rcv_total;	/* total IGMP messages received */
+	u_quad_t igps_rcv_tooshort;	/* received with too few bytes */
+	u_quad_t igps_rcv_badsum;	/* received with bad checksum */
+	u_quad_t igps_rcv_queries;	/* received membership queries */
+	u_quad_t igps_rcv_badqueries;	/* received invalid queries */
+	u_quad_t igps_rcv_reports;	/* received membership reports */
+	u_quad_t igps_rcv_badreports;	/* received invalid reports */
+	u_quad_t igps_rcv_ourreports;	/* received reports for our groups */
+	u_quad_t igps_snd_reports;	/* sent membership reports */
 };
 
 #ifdef _KERNEL
Index: sys/netinet/ip_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/ip_var.h,v
retrieving revision 1.38
diff -u -r1.38 ip_var.h
--- ip_var.h	1999/07/06 12:23:21	1.38
+++ ip_var.h	1999/11/02 16:35:56
@@ -124,35 +124,35 @@
 };
 
 struct	ipstat {
-	u_long	ips_total;		/* total packets received */
-	u_long	ips_badsum;		/* checksum bad */
-	u_long	ips_tooshort;		/* packet too short */
-	u_long	ips_toosmall;		/* not enough data */
-	u_long	ips_badhlen;		/* ip header length < data size */
-	u_long	ips_badlen;		/* ip length < ip header length */
-	u_long	ips_fragments;		/* fragments received */
-	u_long	ips_fragdropped;	/* frags dropped (dups, out of space) */
-	u_long	ips_fragtimeout;	/* fragments timed out */
-	u_long	ips_forward;		/* packets forwarded */
-	u_long	ips_fastforward;	/* packets fast forwarded */
-	u_long	ips_cantforward;	/* packets rcvd for unreachable dest */
-	u_long	ips_redirectsent;	/* packets forwarded on same net */
-	u_long	ips_noproto;		/* unknown or unsupported protocol */
-	u_long	ips_delivered;		/* datagrams delivered to upper level*/
-	u_long	ips_localout;		/* total ip packets generated here */
-	u_long	ips_odropped;		/* lost packets due to nobufs, etc. */
-	u_long	ips_reassembled;	/* total packets reassembled ok */
-	u_long	ips_fragmented;		/* datagrams sucessfully fragmented */
-	u_long	ips_ofragments;		/* output fragments created */
-	u_long	ips_cantfrag;		/* don't fragment flag was set, etc. */
-	u_long	ips_badoptions;		/* error in option processing */
-	u_long	ips_noroute;		/* packets discarded due to no route */
-	u_long	ips_badvers;		/* ip version != 4 */
-	u_long	ips_rawout;		/* total raw ip packets generated */
-	u_long	ips_badfrags;		/* malformed fragments (bad length) */
-	u_long	ips_rcvmemdrop;		/* frags dropped for lack of memory */
-	u_long	ips_toolong;		/* ip length > max ip packet size */
-	u_long	ips_nogif;		/* no match gif found */
+	u_quad_t ips_total;		/* total packets received */
+	u_quad_t ips_badsum;		/* checksum bad */
+	u_quad_t ips_tooshort;		/* packet too short */
+	u_quad_t ips_toosmall;		/* not enough data */
+	u_quad_t ips_badhlen;		/* ip header length < data size */
+	u_quad_t ips_badlen;		/* ip length < ip header length */
+	u_quad_t ips_fragments;		/* fragments received */
+	u_quad_t ips_fragdropped;	/* frags dropped (dups, out of space) */
+	u_quad_t ips_fragtimeout;	/* fragments timed out */
+	u_quad_t ips_forward;		/* packets forwarded */
+	u_quad_t ips_fastforward;	/* packets fast forwarded */
+	u_quad_t ips_cantforward;	/* packets rcvd for unreachable dest */
+	u_quad_t ips_redirectsent;	/* packets forwarded on same net */
+	u_quad_t ips_noproto;		/* unknown or unsupported protocol */
+	u_quad_t ips_delivered;		/* datagrams delivered to upper level*/
+	u_quad_t ips_localout;		/* total ip packets generated here */
+	u_quad_t ips_odropped;		/* lost packets due to nobufs, etc. */
+	u_quad_t ips_reassembled;	/* total packets reassembled ok */
+	u_quad_t ips_fragmented;	/* datagrams sucessfully fragmented */
+	u_quad_t ips_ofragments;	/* output fragments created */
+	u_quad_t ips_cantfrag;		/* don't fragment flag was set, etc. */
+	u_quad_t ips_badoptions;	/* error in option processing */
+	u_quad_t ips_noroute;		/* packets discarded due to no route */
+	u_quad_t ips_badvers;		/* ip version != 4 */
+	u_quad_t ips_rawout;		/* total raw ip packets generated */
+	u_quad_t ips_badfrags;		/* malformed fragments (bad length) */
+	u_quad_t ips_rcvmemdrop;	/* frags dropped for lack of memory */
+	u_quad_t ips_toolong;		/* ip length > max ip packet size */
+	u_quad_t ips_nogif;		/* no match gif found */
 };
 
 #define	IPFLOW_HASHBITS			6 /* should not be a multiple of 8 */
Index: sys/netinet/tcp_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/tcp_var.h,v
retrieving revision 1.68
diff -u -r1.68 tcp_var.h
--- tcp_var.h	1999/09/23 02:21:32	1.68
+++ tcp_var.h	1999/11/02 16:36:10
@@ -433,80 +433,80 @@
  * but that's inconvenient at the moment.
  */
 struct	tcpstat {
-	u_long	tcps_connattempt;	/* connections initiated */
-	u_long	tcps_accepts;		/* connections accepted */
-	u_long	tcps_connects;		/* connections established */
-	u_long	tcps_drops;		/* connections dropped */
-	u_long	tcps_conndrops;		/* embryonic connections dropped */
-	u_long	tcps_closed;		/* conn. closed (includes drops) */
-	u_long	tcps_segstimed;		/* segs where we tried to get rtt */
-	u_long	tcps_rttupdated;	/* times we succeeded */
-	u_long	tcps_delack;		/* delayed acks sent */
-	u_long	tcps_timeoutdrop;	/* conn. dropped in rxmt timeout */
-	u_long	tcps_rexmttimeo;	/* retransmit timeouts */
-	u_long	tcps_persisttimeo;	/* persist timeouts */
-	u_long	tcps_keeptimeo;		/* keepalive timeouts */
-	u_long	tcps_keepprobe;		/* keepalive probes sent */
-	u_long	tcps_keepdrops;		/* connections dropped in keepalive */
-	u_long	tcps_persistdrops;	/* connections dropped in persist */
-	u_long	tcps_connsdrained;	/* connections drained due to memory
+	u_quad_t tcps_connattempt;	/* connections initiated */
+	u_quad_t tcps_accepts;		/* connections accepted */
+	u_quad_t tcps_connects;		/* connections established */
+	u_quad_t tcps_drops;		/* connections dropped */
+	u_quad_t tcps_conndrops;	/* embryonic connections dropped */
+	u_quad_t tcps_closed;		/* conn. closed (includes drops) */
+	u_quad_t tcps_segstimed;	/* segs where we tried to get rtt */
+	u_quad_t tcps_rttupdated;	/* times we succeeded */
+	u_quad_t tcps_delack;		/* delayed acks sent */
+	u_quad_t tcps_timeoutdrop;	/* conn. dropped in rxmt timeout */
+	u_quad_t tcps_rexmttimeo;	/* retransmit timeouts */
+	u_quad_t tcps_persisttimeo;	/* persist timeouts */
+	u_quad_t tcps_keeptimeo;	/* keepalive timeouts */
+	u_quad_t tcps_keepprobe;	/* keepalive probes sent */
+	u_quad_t tcps_keepdrops;	/* connections dropped in keepalive */
+	u_quad_t tcps_persistdrops;	/* connections dropped in persist */
+	u_quad_t tcps_connsdrained;	/* connections drained due to memory
 					   shortage */
 
-	u_long	tcps_sndtotal;		/* total packets sent */
-	u_long	tcps_sndpack;		/* data packets sent */
-	u_long	tcps_sndbyte;		/* data bytes sent */
-	u_long	tcps_sndrexmitpack;	/* data packets retransmitted */
-	u_long	tcps_sndrexmitbyte;	/* data bytes retransmitted */
-	u_long	tcps_sndacks;		/* ack-only packets sent */
-	u_long	tcps_sndprobe;		/* window probes sent */
-	u_long	tcps_sndurg;		/* packets sent with URG only */
-	u_long	tcps_sndwinup;		/* window update-only packets sent */
-	u_long	tcps_sndctrl;		/* control (SYN|FIN|RST) packets sent */
+	u_quad_t tcps_sndtotal;		/* total packets sent */
+	u_quad_t tcps_sndpack;		/* data packets sent */
+	u_quad_t tcps_sndbyte;		/* data bytes sent */
+	u_quad_t tcps_sndrexmitpack;	/* data packets retransmitted */
+	u_quad_t tcps_sndrexmitbyte;	/* data bytes retransmitted */
+	u_quad_t tcps_sndacks;		/* ack-only packets sent */
+	u_quad_t tcps_sndprobe;		/* window probes sent */
+	u_quad_t tcps_sndurg;		/* packets sent with URG only */
+	u_quad_t tcps_sndwinup;		/* window update-only packets sent */
+	u_quad_t tcps_sndctrl;		/* control (SYN|FIN|RST) packets sent */
 
-	u_long	tcps_rcvtotal;		/* total packets received */
-	u_long	tcps_rcvpack;		/* packets received in sequence */
-	u_long	tcps_rcvbyte;		/* bytes received in sequence */
-	u_long	tcps_rcvbadsum;		/* packets received with ccksum errs */
-	u_long	tcps_rcvbadoff;		/* packets received with bad offset */
-	u_long	tcps_rcvmemdrop;	/* packets dropped for lack of memory */
-	u_long	tcps_rcvshort;		/* packets received too short */
-	u_long	tcps_rcvduppack;	/* duplicate-only packets received */
-	u_long	tcps_rcvdupbyte;	/* duplicate-only bytes received */
-	u_long	tcps_rcvpartduppack;	/* packets with some duplicate data */
-	u_long	tcps_rcvpartdupbyte;	/* dup. bytes in part-dup. packets */
-	u_long	tcps_rcvoopack;		/* out-of-order packets received */
-	u_long	tcps_rcvoobyte;		/* out-of-order bytes received */
-	u_long	tcps_rcvpackafterwin;	/* packets with data after window */
-	u_long	tcps_rcvbyteafterwin;	/* bytes rcvd after window */
-	u_long	tcps_rcvafterclose;	/* packets rcvd after "close" */
-	u_long	tcps_rcvwinprobe;	/* rcvd window probe packets */
-	u_long	tcps_rcvdupack;		/* rcvd duplicate acks */
-	u_long	tcps_rcvacktoomuch;	/* rcvd acks for unsent data */
-	u_long	tcps_rcvackpack;	/* rcvd ack packets */
-	u_long	tcps_rcvackbyte;	/* bytes acked by rcvd acks */
-	u_long	tcps_rcvwinupd;		/* rcvd window update packets */
-	u_long	tcps_pawsdrop;		/* segments dropped due to PAWS */
-	u_long	tcps_predack;		/* times hdr predict ok for acks */
-	u_long	tcps_preddat;		/* times hdr predict ok for data pkts */
+	u_quad_t tcps_rcvtotal;		/* total packets received */
+	u_quad_t tcps_rcvpack;		/* packets received in sequence */
+	u_quad_t tcps_rcvbyte;		/* bytes received in sequence */
+	u_quad_t tcps_rcvbadsum;	/* packets received with ccksum errs */
+	u_quad_t tcps_rcvbadoff;	/* packets received with bad offset */
+	u_quad_t tcps_rcvmemdrop;	/* packets dropped for lack of memory */
+	u_quad_t tcps_rcvshort;		/* packets received too short */
+	u_quad_t tcps_rcvduppack;	/* duplicate-only packets received */
+	u_quad_t tcps_rcvdupbyte;	/* duplicate-only bytes received */
+	u_quad_t tcps_rcvpartduppack;	/* packets with some duplicate data */
+	u_quad_t tcps_rcvpartdupbyte;	/* dup. bytes in part-dup. packets */
+	u_quad_t tcps_rcvoopack;	/* out-of-order packets received */
+	u_quad_t tcps_rcvoobyte;	/* out-of-order bytes received */
+	u_quad_t tcps_rcvpackafterwin;	/* packets with data after window */
+	u_quad_t tcps_rcvbyteafterwin;	/* bytes rcvd after window */
+	u_quad_t tcps_rcvafterclose;	/* packets rcvd after "close" */
+	u_quad_t tcps_rcvwinprobe;	/* rcvd window probe packets */
+	u_quad_t tcps_rcvdupack;	/* rcvd duplicate acks */
+	u_quad_t tcps_rcvacktoomuch;	/* rcvd acks for unsent data */
+	u_quad_t tcps_rcvackpack;	/* rcvd ack packets */
+	u_quad_t tcps_rcvackbyte;	/* bytes acked by rcvd acks */
+	u_quad_t tcps_rcvwinupd;	/* rcvd window update packets */
+	u_quad_t tcps_pawsdrop;		/* segments dropped due to PAWS */
+	u_quad_t tcps_predack;		/* times hdr predict ok for acks */
+	u_quad_t tcps_preddat;		/* times hdr predict ok for data pkts */
 
-	u_long	tcps_pcbhashmiss;	/* input packets missing pcb hash */
-	u_long	tcps_noport;		/* no socket on port */
-	u_long	tcps_badsyn;		/* received ack for which we have
+	u_quad_t tcps_pcbhashmiss;	/* input packets missing pcb hash */
+	u_quad_t tcps_noport;		/* no socket on port */
+	u_quad_t tcps_badsyn;		/* received ack for which we have
 					   no SYN in compressed state */
 
 	/* These statistics deal with the SYN cache. */
-	u_long	tcps_sc_added;		/* # of entries added */
-	u_long	tcps_sc_completed;	/* # of connections completed */
-	u_long	tcps_sc_timed_out;	/* # of entries timed out */
-	u_long	tcps_sc_overflowed;	/* # dropped due to overflow */
-	u_long	tcps_sc_reset;		/* # dropped due to RST */
-	u_long	tcps_sc_unreach;	/* # dropped due to ICMP unreach */
-	u_long	tcps_sc_bucketoverflow;	/* # dropped due to bucket overflow */
-	u_long	tcps_sc_aborted;	/* # of entries aborted (no mem) */
-	u_long	tcps_sc_dupesyn;	/* # of duplicate SYNs received */
-	u_long	tcps_sc_dropped;	/* # of SYNs dropped (no route/mem) */
-	u_long	tcps_sc_collisions;	/* # of hash collisions */
-	u_long	tcps_sc_retransmitted;	/* # of retransmissions */
+	u_quad_t tcps_sc_added;		/* # of entries added */
+	u_quad_t tcps_sc_completed;	/* # of connections completed */
+	u_quad_t tcps_sc_timed_out;	/* # of entries timed out */
+	u_quad_t tcps_sc_overflowed;	/* # dropped due to overflow */
+	u_quad_t tcps_sc_reset;		/* # dropped due to RST */
+	u_quad_t tcps_sc_unreach;	/* # dropped due to ICMP unreach */
+	u_quad_t tcps_sc_bucketoverflow;/* # dropped due to bucket overflow */
+	u_quad_t tcps_sc_aborted;	/* # of entries aborted (no mem) */
+	u_quad_t tcps_sc_dupesyn;	/* # of duplicate SYNs received */
+	u_quad_t tcps_sc_dropped;	/* # of SYNs dropped (no route/mem) */
+	u_quad_t tcps_sc_collisions;	/* # of hash collisions */
+	u_quad_t tcps_sc_retransmitted;	/* # of retransmissions */
 };
 
 /*
Index: sys/netinet/udp_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet/udp_var.h,v
retrieving revision 1.15
diff -u -r1.15 udp_var.h
--- udp_var.h	1998/02/10 01:27:25	1.15
+++ udp_var.h	1999/11/02 16:36:10
@@ -56,17 +56,17 @@
 #define	ui_sum		ui_u.uh_sum
 
 struct	udpstat {
-				/* input statistics: */
-	u_long	udps_ipackets;		/* total input packets */
-	u_long	udps_hdrops;		/* packet shorter than header */
-	u_long	udps_badsum;		/* checksum error */
-	u_long	udps_badlen;		/* data length larger than packet */
-	u_long	udps_noport;		/* no socket on port */
-	u_long	udps_noportbcast;	/* of above, arrived as broadcast */
-	u_long	udps_fullsock;		/* not delivered, input socket full */
-	u_long	udps_pcbhashmiss;	/* input packets missing pcb hash */
-				/* output statistics: */
-	u_long	udps_opackets;		/* total output packets */
+					/* input statistics: */
+	u_quad_t udps_ipackets;		/* total input packets */
+	u_quad_t udps_hdrops;		/* packet shorter than header */
+	u_quad_t udps_badsum;		/* checksum error */
+	u_quad_t udps_badlen;		/* data length larger than packet */
+	u_quad_t udps_noport;		/* no socket on port */
+	u_quad_t udps_noportbcast;	/* of above, arrived as broadcast */
+	u_quad_t udps_fullsock;		/* not delivered, input socket full */
+	u_quad_t udps_pcbhashmiss;	/* input packets missing pcb hash */
+					/* output statistics: */
+	u_quad_t udps_opackets;		/* total output packets */
 };
 
 /*
Index: sys/netinet6/icmp6.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/icmp6.h,v
retrieving revision 1.4
diff -u -r1.4 icmp6.h
--- icmp6.h	1999/07/31 18:41:16	1.4
+++ icmp6.h	1999/11/02 16:36:11
@@ -497,17 +497,17 @@
  */
 struct icmp6stat {
 /* statistics related to icmp6 packets generated */
-	u_long	icp6s_error;		/* # of calls to icmp6_error */
-	u_long	icp6s_canterror;	/* no error 'cuz old was icmp */
-	u_long	icp6s_toofreq;		/* no error 'cuz rate limitation */
-	u_long	icp6s_outhist[256];
+	u_quad_t icp6s_error;		/* # of calls to icmp6_error */
+	u_quad_t icp6s_canterror;	/* no error 'cuz old was icmp */
+	u_quad_t icp6s_toofreq;		/* no error 'cuz rate limitation */
+	u_quad_t icp6s_outhist[256];
 /* statistics related to input messages proccesed */
-	u_long	icp6s_badcode;		/* icmp6_code out of range */
-	u_long	icp6s_tooshort;		/* packet < sizeof(struct icmp6_hdr) */
-	u_long	icp6s_checksum;		/* bad checksum */
-	u_long	icp6s_badlen;		/* calculated bound mismatch */
-	u_long	icp6s_reflect;		/* number of responses */
-	u_long	icp6s_inhist[256];	
+	u_quad_t icp6s_badcode;		/* icmp6_code out of range */
+	u_quad_t icp6s_tooshort;	/* packet < sizeof(struct icmp6_hdr) */
+	u_quad_t icp6s_checksum;	/* bad checksum */
+	u_quad_t icp6s_badlen;		/* calculated bound mismatch */
+	u_quad_t icp6s_reflect;		/* number of responses */
+	u_quad_t icp6s_inhist[256];	
 };
 
 /*
Index: sys/netinet6/ip6_mroute.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/ip6_mroute.h,v
retrieving revision 1.3
diff -u -r1.3 ip6_mroute.h
--- ip6_mroute.h	1999/07/03 21:30:19	1.3
+++ ip6_mroute.h	1999/11/02 16:36:11
@@ -125,7 +125,7 @@
 /*
  * The kernel's multicast routing statistics.
  */
-#ifdef __bsdi__
+#if defined(__bsdi__) || defined(__NetBSD__)
 struct mrt6stat {
 	u_quad_t mrt6s_mfc_lookups;	/* # forw. cache hash table hits   */
 	u_quad_t mrt6s_mfc_misses;	/* # forw. cache hash table misses */
Index: sys/netinet6/ip6_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/ip6_var.h,v
retrieving revision 1.4
diff -u -r1.4 ip6_var.h
--- ip6_var.h	1999/07/22 03:59:42	1.4
+++ ip6_var.h	1999/11/02 16:36:12
@@ -139,37 +139,37 @@
 };
 
 struct	ip6stat {
-	u_long	ip6s_total;		/* total packets received */
-	u_long 	ip6s_tooshort;		/* packet too short */
-	u_long 	ip6s_toosmall;		/* not enough data */
-	u_long 	ip6s_fragments;		/* fragments received */
-	u_long 	ip6s_fragdropped;       /* frags dropped(dups, out of space) */
-	u_long 	ip6s_fragtimeout;	/* fragments timed out */
-	u_long	ip6s_fragoverflow;	/* fragments that exceeded limit */
-	u_long  ip6s_forward;		/* packets forwarded */
-	u_long 	ip6s_cantforward;	/* packets rcvd for unreachable dest */
-	u_long 	ip6s_redirectsent;	/* packets forwarded on same net */
-	u_long 	ip6s_delivered;	        /* datagrams delivered to upper level*/
-	u_long 	ip6s_localout;		/* total ip packets generated here */
-	u_long 	ip6s_odropped;		/* lost packets due to nobufs, etc. */
-	u_long 	ip6s_reassembled;	/* total packets reassembled ok */
-	u_long 	ip6s_fragmented;	/* datagrams sucessfully fragmented */
-	u_long 	ip6s_ofragments;	/* output fragments created */
-	u_long 	ip6s_cantfrag;		/* don't fragment flag was set, etc. */
-	u_long 	ip6s_badoptions;	/* error in option processing */
-	u_long 	ip6s_noroute;		/* packets discarded due to no route */
-	u_long 	ip6s_badvers;		/* ip6 version != 6 */
-	u_long 	ip6s_rawout;		/* total raw ip packets generated */
-	u_long	ip6s_badscope;		/* scope error */
-	u_long	ip6s_notmember;		/* don't join this multicast group */
-	u_long	ip6s_nxthist[256];	/* next header history */
-	u_long	ip6s_m1;		/* one mbuf */
-	u_long	ip6s_m2m[32];		/* two or more mbuf */
-	u_long	ip6s_mext1;		/* one ext mbuf */
-	u_long	ip6s_mext2m;		/* two or more ext mbuf */
-	u_long	ip6s_exthdrtoolong;	/* ext hdr are not continuous */
-	u_long	ip6s_nogif;		/* no match gif found */
-	u_long	ip6s_toomanyhdr;	/* discarded due to too many headers */
+	u_quad_t ip6s_total;		/* total packets received */
+	u_quad_t ip6s_tooshort;		/* packet too short */
+	u_quad_t ip6s_toosmall;		/* not enough data */
+	u_quad_t ip6s_fragments;	/* fragments received */
+	u_quad_t ip6s_fragdropped;	/* frags dropped(dups, out of space) */
+	u_quad_t ip6s_fragtimeout;	/* fragments timed out */
+	u_quad_t ip6s_fragoverflow;	/* fragments that exceeded limit */
+	u_quad_t ip6s_forward;		/* packets forwarded */
+	u_quad_t ip6s_cantforward;	/* packets rcvd for unreachable dest */
+	u_quad_t ip6s_redirectsent;	/* packets forwarded on same net */
+	u_quad_t ip6s_delivered;        /* datagrams delivered to upper level*/
+	u_quad_t ip6s_localout;		/* total ip packets generated here */
+	u_quad_t ip6s_odropped;		/* lost packets due to nobufs, etc. */
+	u_quad_t ip6s_reassembled;	/* total packets reassembled ok */
+	u_quad_t ip6s_fragmented;	/* datagrams sucessfully fragmented */
+	u_quad_t ip6s_ofragments;	/* output fragments created */
+	u_quad_t ip6s_cantfrag;		/* don't fragment flag was set, etc. */
+	u_quad_t ip6s_badoptions;	/* error in option processing */
+	u_quad_t ip6s_noroute;		/* packets discarded due to no route */
+	u_quad_t ip6s_badvers;		/* ip6 version != 6 */
+	u_quad_t ip6s_rawout;		/* total raw ip packets generated */
+	u_quad_t ip6s_badscope;		/* scope error */
+	u_quad_t ip6s_notmember;	/* don't join this multicast group */
+	u_quad_t ip6s_nxthist[256];	/* next header history */
+	u_quad_t ip6s_m1;		/* one mbuf */
+	u_quad_t ip6s_m2m[32];		/* two or more mbuf */
+	u_quad_t ip6s_mext1;		/* one ext mbuf */
+	u_quad_t ip6s_mext2m;		/* two or more ext mbuf */
+	u_quad_t ip6s_exthdrtoolong;	/* ext hdr are not continuous */
+	u_quad_t ip6s_nogif;		/* no match gif found */
+	u_quad_t ip6s_toomanyhdr;	/* discarded due to too many headers */
 };
 
 #ifdef _KERNEL
Index: sys/netinet6/ipsec.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/ipsec.h,v
retrieving revision 1.5
diff -u -r1.5 ipsec.h
--- ipsec.h	1999/07/31 18:41:17	1.5
+++ ipsec.h	1999/11/02 16:36:12
@@ -108,26 +108,26 @@
 
 /* statistics for ipsec processing */
 struct ipsecstat {
-	u_long in_success;  /* succeeded inbound process */
-	u_long in_polvio;   /* security policy violation for inbound process */
-	u_long in_nosa;     /* inbound SA is unavailable */
-	u_long in_inval;    /* inbound processing failed due to EINVAL */
-	u_long in_badspi;   /* failed getting a SPI */
-	u_long in_ahreplay; /* AH replay check failed */
-	u_long in_espreplay; /* ESP replay check failed */
-	u_long in_ahauthsucc; /* AH authentication success */
-	u_long in_ahauthfail; /* AH authentication failure */
-	u_long in_espauthsucc; /* ESP authentication success */
-	u_long in_espauthfail; /* ESP authentication failure */
-	u_long in_esphist[SADB_EALG_MAX];
-	u_long in_ahhist[SADB_AALG_MAX];
-	u_long out_success; /* succeeded outbound process */
-	u_long out_polvio;  /* security policy violation for outbound process */
-	u_long out_nosa;    /* outbound SA is unavailable */
-	u_long out_inval;   /* outbound process failed due to EINVAL */
-	u_long out_noroute; /* there is no route */
-	u_long out_esphist[SADB_EALG_MAX];
-	u_long out_ahhist[SADB_AALG_MAX];
+	u_quad_t in_success; /* succeeded inbound process */
+	u_quad_t in_polvio;  /* security policy violation for inbound process */
+	u_quad_t in_nosa;    /* inbound SA is unavailable */
+	u_quad_t in_inval;   /* inbound processing failed due to EINVAL */
+	u_quad_t in_badspi;   /* failed getting a SPI */
+	u_quad_t in_ahreplay; /* AH replay check failed */
+	u_quad_t in_espreplay; /* ESP replay check failed */
+	u_quad_t in_ahauthsucc; /* AH authentication success */
+	u_quad_t in_ahauthfail; /* AH authentication failure */
+	u_quad_t in_espauthsucc; /* ESP authentication success */
+	u_quad_t in_espauthfail; /* ESP authentication failure */
+	u_quad_t in_esphist[SADB_EALG_MAX];
+	u_quad_t in_ahhist[SADB_AALG_MAX];
+	u_quad_t out_success; /* succeeded outbound process */
+	u_quad_t out_polvio;  /* security policy violation for outbound process */
+	u_quad_t out_nosa;    /* outbound SA is unavailable */
+	u_quad_t out_inval;   /* outbound process failed due to EINVAL */
+	u_quad_t out_noroute; /* there is no route */
+	u_quad_t out_esphist[SADB_EALG_MAX];
+	u_quad_t out_ahhist[SADB_AALG_MAX];
 };
 
 /*
Index: sys/netinet6/pim6_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/pim6_var.h,v
retrieving revision 1.4
diff -u -r1.4 pim6_var.h
--- pim6_var.h	1999/07/06 12:23:23	1.4
+++ pim6_var.h	1999/11/02 16:36:12
@@ -42,13 +42,13 @@
  */
 
 struct pim6stat {
-	u_int	pim6s_rcv_total;	/* total PIM messages received	*/
-	u_int	pim6s_rcv_tooshort;	/* received with too few bytes	*/
-	u_int	pim6s_rcv_badsum;	/* received with bad checksum	*/
-	u_int	pim6s_rcv_badversion;	/* received bad PIM version	*/
-	u_int	pim6s_rcv_registers;	/* received registers		*/
-	u_int	pim6s_rcv_badregisters;	/* received invalid registers	*/
-	u_int	pim6s_snd_registers;	/* sent registers		*/
+	u_quad_t pim6s_rcv_total;	/* total PIM messages received	*/
+	u_quad_t pim6s_rcv_tooshort;	/* received with too few bytes	*/
+	u_quad_t pim6s_rcv_badsum;	/* received with bad checksum	*/
+	u_quad_t pim6s_rcv_badversion;	/* received bad PIM version	*/
+	u_quad_t pim6s_rcv_registers;	/* received registers		*/
+	u_quad_t pim6s_rcv_badregisters; /* received invalid registers	*/
+	u_quad_t pim6s_snd_registers;	/* sent registers		*/
 };
 
 #if (defined(KERNEL)) || (defined(_KERNEL))
Index: sys/netinet6/udp6_var.h
===================================================================
RCS file: /cvsroot/syssrc/sys/netinet6/udp6_var.h,v
retrieving revision 1.3
diff -u -r1.3 udp6_var.h
--- udp6_var.h	1999/07/03 21:30:20	1.3
+++ udp6_var.h	1999/11/02 16:36:12
@@ -73,17 +73,17 @@
  */
 struct	udp6stat {
 				/* input statistics: */
-	u_long	udp6s_ipackets;		/* total input packets */
-	u_long	udp6s_hdrops;		/* packet shorter than header */
-	u_long	udp6s_badsum;		/* checksum error */
-	u_long	udp6s_nosum;		/* no checksum */
-	u_long	udp6s_badlen;		/* data length larger than packet */
-	u_long	udp6s_noport;		/* no socket on port */
-	u_long	udp6s_noportmcast;	/* of above, arrived as broadcast */
-	u_long	udp6s_fullsock;		/* not delivered, input socket full */
-	u_long	udp6ps_pcbcachemiss;	/* input packets missing pcb cache */
+	u_quad_t udp6s_ipackets;	/* total input packets */
+	u_quad_t udp6s_hdrops;		/* packet shorter than header */
+	u_quad_t udp6s_badsum;		/* checksum error */
+	u_quad_t udp6s_nosum;		/* no checksum */
+	u_quad_t udp6s_badlen;		/* data length larger than packet */
+	u_quad_t udp6s_noport;		/* no socket on port */
+	u_quad_t udp6s_noportmcast;	/* of above, arrived as broadcast */
+	u_quad_t udp6s_fullsock;	/* not delivered, input socket full */
+	u_quad_t udp6ps_pcbcachemiss;	/* input packets missing pcb cache */
 				/* output statistics: */
-	u_long	udp6s_opackets;		/* total output packets */
+	u_quad_t udp6s_opackets;	/* total output packets */
 };
 
 /*
Index: sys/sys/socket.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/socket.h,v
retrieving revision 1.46
diff -u -r1.46 socket.h
--- socket.h	1999/07/03 13:37:34	1.46
+++ socket.h	1999/11/02 16:36:13
@@ -339,13 +339,15 @@
  */
 #define NET_RT_DUMP	1		/* dump; may limit to a.f. */
 #define NET_RT_FLAGS	2		/* by flags, e.g. RESOLVING */
-#define NET_RT_IFLIST	3		/* survey interface list */
-#define	NET_RT_MAXID	4
+#define NET_RT_OIFLIST	3		/* old NET_RT_IFLIST (pre 1.5) */
+#define NET_RT_IFLIST	4		/* survey interface list */
+#define	NET_RT_MAXID	5
 
 #define CTL_NET_RT_NAMES { \
 	{ 0, 0 }, \
 	{ "dump", CTLTYPE_STRUCT }, \
 	{ "flags", CTLTYPE_STRUCT }, \
+	{ 0, 0 }, \
 	{ "iflist", CTLTYPE_STRUCT }, \
 }
 #endif /* !_XOPEN_SOURCE */
Index: sys/sys/sysctl.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/sysctl.h,v
retrieving revision 1.38
diff -u -r1.38 sysctl.h
--- sysctl.h	1999/09/29 11:58:45	1.38
+++ sysctl.h	1999/11/02 16:36:13
@@ -466,7 +466,7 @@
 struct radix_node;
 struct walkarg;
 int sysctl_dumpentry __P((struct radix_node *, void *));
-int sysctl_iflist __P((int, struct walkarg *));
+int sysctl_iflist __P((int, struct walkarg *, int));
 int sysctl_rtable __P((int *, u_int, void *, size_t *, void *, size_t));
 int sysctl_clockrate __P((char *, size_t *));
 int sysctl_rdstring __P((void *, size_t *, void *, char *));
Index: usr.bin/netstat/if.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/netstat/if.c,v
retrieving revision 1.32
diff -u -r1.32 if.c
--- if.c	1999/07/01 18:40:35	1.32
+++ if.c	1999/11/02 16:36:53
@@ -157,7 +157,7 @@
 			*cp = '\0';
 			ifaddraddr = (u_long)ifnet.if_addrlist.tqh_first;
 		}
-		printf("%-5.5s %-5lu ", name, ifnet.if_mtu);
+		printf("%-5.5s %-5qu ", name, ifnet.if_mtu);
 		if (ifaddraddr == 0) {
 			printf("%-13.13s ", "none");
 			printf("%-17.17s ", "none");
@@ -277,10 +277,10 @@
 			ifaddraddr = (u_long)ifaddr.ifa.ifa_list.tqe_next;
 		}
 		if (bflag) {
-			printf("%10lu %10lu", 
+			printf("%10qu %10qu", 
 			       ifnet.if_ibytes, ifnet.if_obytes);
 		} else {
-			printf("%8lu %5lu %8lu %5lu %5lu",
+			printf("%8qu %5qu %8qu %5qu %5qu",
 			       ifnet.if_ipackets, ifnet.if_ierrors,
 			       ifnet.if_opackets, ifnet.if_oerrors,
 			       ifnet.if_collisions);
@@ -296,14 +296,14 @@
 #define	MAXIF	100
 struct	iftot {
 	char	ift_name[IFNAMSIZ];	/* interface name */
-	u_long	ift_ip;			/* input packets */
-	u_long	ift_ib;			/* input bytes */
-	u_long	ift_ie;			/* input errors */
-	u_long	ift_op;			/* output packets */
-	u_long	ift_ob;			/* output bytes */
-	u_long	ift_oe;			/* output errors */
-	u_long	ift_co;			/* collisions */
-	int	ift_dr;			/* drops */
+	u_quad_t ift_ip;			/* input packets */
+	u_quad_t ift_ib;			/* input bytes */
+	u_quad_t ift_ie;			/* input errors */
+	u_quad_t ift_op;			/* output packets */
+	u_quad_t ift_ob;			/* output bytes */
+	u_quad_t ift_oe;			/* output errors */
+	u_quad_t ift_co;			/* collisions */
+	u_quad_t ift_dr;			/* drops */
 } iftot[MAXIF];
 
 u_char	signalled;			/* set if alarm goes off "early" */
@@ -431,11 +431,11 @@
 		}
 		if (ip == interesting) {
 			if (bflag) {
-				printf("%10lu %8.8s %10lu %5.5s",
+				printf("%10qu %8.8s %10qu %5.5s",
 					ifnet.if_ibytes - ip->ift_ib, " ",
 					ifnet.if_obytes - ip->ift_ob, " ");
 			} else {
-				printf("%8lu %5lu %8lu %5lu %5lu",
+				printf("%8qu %5qu %8qu %5qu %5qu",
 					ifnet.if_ipackets - ip->ift_ip,
 					ifnet.if_ierrors - ip->ift_ie,
 					ifnet.if_opackets - ip->ift_op,
@@ -443,7 +443,7 @@
 					ifnet.if_collisions - ip->ift_co);
 			}
 			if (dflag)
-				printf(" %5d",
+				printf(" %5qu",
 				    ifnet.if_snd.ifq_drops - ip->ift_dr);
 		}
 		ip->ift_ip = ifnet.if_ipackets;
@@ -466,11 +466,11 @@
 	}
 	if (lastif - iftot > 0) {
 		if (bflag) {
-			printf("  %10lu %8.8s %10lu %5.5s",
+			printf("  %10qu %8.8s %10qu %5.5s",
 				sum->ift_ib - total->ift_ib, " ",
 				sum->ift_ob - total->ift_ob, " ");
 		} else {
-			printf("  %8lu %5lu %8lu %5lu %5lu",
+			printf("  %8qu %5qu %8qu %5qu %5qu",
 				sum->ift_ip - total->ift_ip,
 				sum->ift_ie - total->ift_ie,
 				sum->ift_op - total->ift_op,
@@ -478,7 +478,7 @@
 				sum->ift_co - total->ift_co);
 		}
 		if (dflag)
-			printf(" %5d", sum->ift_dr - total->ift_dr);
+			printf(" %5qu", sum->ift_dr - total->ift_dr);
 	}
 	*total = *sum;
 	putchar('\n');
Index: usr.bin/netstat/inet.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/netstat/inet.c,v
retrieving revision 1.37
diff -u -r1.37 inet.c
--- inet.c	1999/07/01 18:40:35	1.37
+++ inet.c	1999/11/02 16:36:53
@@ -222,72 +222,72 @@
 #define	p3(f, m) if (tcpstat.f || sflag <= 1) \
     printf(m, tcpstat.f, plurales(tcpstat.f))
 
-	p(tcps_sndtotal, "\t%lu packet%s sent\n");
+	p(tcps_sndtotal, "\t%qu packet%s sent\n");
 	p2(tcps_sndpack,tcps_sndbyte,
-		"\t\t%lu data packet%s (%lu byte%s)\n");
+		"\t\t%qu data packet%s (%qu byte%s)\n");
 	p2(tcps_sndrexmitpack, tcps_sndrexmitbyte,
-		"\t\t%lu data packet%s (%lu byte%s) retransmitted\n");
+		"\t\t%qu data packet%s (%qu byte%s) retransmitted\n");
 	p2s(tcps_sndacks, tcps_delack,
-		"\t\t%lu ack-only packet%s (%lu delayed)\n");
-	p(tcps_sndurg, "\t\t%lu URG only packet%s\n");
-	p(tcps_sndprobe, "\t\t%lu window probe packet%s\n");
-	p(tcps_sndwinup, "\t\t%lu window update packet%s\n");
-	p(tcps_sndctrl, "\t\t%lu control packet%s\n");
-	p(tcps_rcvtotal, "\t%lu packet%s received\n");
-	p2(tcps_rcvackpack, tcps_rcvackbyte, "\t\t%lu ack%s (for %lu byte%s)\n");
-	p(tcps_rcvdupack, "\t\t%lu duplicate ack%s\n");
-	p(tcps_rcvacktoomuch, "\t\t%lu ack%s for unsent data\n");
+		"\t\t%qu ack-only packet%s (%qu delayed)\n");
+	p(tcps_sndurg, "\t\t%qu URG only packet%s\n");
+	p(tcps_sndprobe, "\t\t%qu window probe packet%s\n");
+	p(tcps_sndwinup, "\t\t%qu window update packet%s\n");
+	p(tcps_sndctrl, "\t\t%qu control packet%s\n");
+	p(tcps_rcvtotal, "\t%qu packet%s received\n");
+	p2(tcps_rcvackpack, tcps_rcvackbyte, "\t\t%qu ack%s (for %qu byte%s)\n");
+	p(tcps_rcvdupack, "\t\t%qu duplicate ack%s\n");
+	p(tcps_rcvacktoomuch, "\t\t%qu ack%s for unsent data\n");
 	p2(tcps_rcvpack, tcps_rcvbyte,
-		"\t\t%lu packet%s (%lu byte%s) received in-sequence\n");
+		"\t\t%qu packet%s (%qu byte%s) received in-sequence\n");
 	p2(tcps_rcvduppack, tcps_rcvdupbyte,
-		"\t\t%lu completely duplicate packet%s (%lu byte%s)\n");
-	p(tcps_pawsdrop, "\t\t%lu old duplicate packet%s\n");
+		"\t\t%qu completely duplicate packet%s (%qu byte%s)\n");
+	p(tcps_pawsdrop, "\t\t%qu old duplicate packet%s\n");
 	p2(tcps_rcvpartduppack, tcps_rcvpartdupbyte,
-		"\t\t%lu packet%s with some dup. data (%lu byte%s duped)\n");
+		"\t\t%qu packet%s with some dup. data (%qu byte%s duped)\n");
 	p2(tcps_rcvoopack, tcps_rcvoobyte,
-		"\t\t%lu out-of-order packet%s (%lu byte%s)\n");
+		"\t\t%qu out-of-order packet%s (%qu byte%s)\n");
 	p2(tcps_rcvpackafterwin, tcps_rcvbyteafterwin,
-		"\t\t%lu packet%s (%lu byte%s) of data after window\n");
-	p(tcps_rcvwinprobe, "\t\t%lu window probe%s\n");
-	p(tcps_rcvwinupd, "\t\t%lu window update packet%s\n");
-	p(tcps_rcvafterclose, "\t\t%lu packet%s received after close\n");
-	p(tcps_rcvbadsum, "\t\t%lu discarded for bad checksum%s\n");
-	p(tcps_rcvbadoff, "\t\t%lu discarded for bad header offset field%s\n");
-	ps(tcps_rcvshort, "\t\t%lu discarded because packet too short\n");
-	p(tcps_connattempt, "\t%lu connection request%s\n");
-	p(tcps_accepts, "\t%lu connection accept%s\n");
-	p(tcps_connects, "\t%lu connection%s established (including accepts)\n");
+		"\t\t%qu packet%s (%qu byte%s) of data after window\n");
+	p(tcps_rcvwinprobe, "\t\t%qu window probe%s\n");
+	p(tcps_rcvwinupd, "\t\t%qu window update packet%s\n");
+	p(tcps_rcvafterclose, "\t\t%qu packet%s received after close\n");
+	p(tcps_rcvbadsum, "\t\t%qu discarded for bad checksum%s\n");
+	p(tcps_rcvbadoff, "\t\t%qu discarded for bad header offset field%s\n");
+	ps(tcps_rcvshort, "\t\t%qu discarded because packet too short\n");
+	p(tcps_connattempt, "\t%qu connection request%s\n");
+	p(tcps_accepts, "\t%qu connection accept%s\n");
+	p(tcps_connects, "\t%qu connection%s established (including accepts)\n");
 	p2(tcps_closed, tcps_drops,
-		"\t%lu connection%s closed (including %lu drop%s)\n");
-	p(tcps_conndrops, "\t%lu embryonic connection%s dropped\n");
+		"\t%qu connection%s closed (including %qu drop%s)\n");
+	p(tcps_conndrops, "\t%qu embryonic connection%s dropped\n");
 	p2(tcps_rttupdated, tcps_segstimed,
-		"\t%lu segment%s updated rtt (of %lu attempt%s)\n");
-	p(tcps_rexmttimeo, "\t%lu retransmit timeout%s\n");
-	p(tcps_timeoutdrop, "\t\t%lu connection%s dropped by rexmit timeout\n");
+		"\t%qu segment%s updated rtt (of %qu attempt%s)\n");
+	p(tcps_rexmttimeo, "\t%qu retransmit timeout%s\n");
+	p(tcps_timeoutdrop, "\t\t%qu connection%s dropped by rexmit timeout\n");
 	p2(tcps_persisttimeo, tcps_persistdrops,
-	   "\t%lu persist timeout%s (resulting in %lu dropped connection%s)\n");
-	p(tcps_keeptimeo, "\t%lu keepalive timeout%s\n");
-	p(tcps_keepprobe, "\t\t%lu keepalive probe%s sent\n");
-	p(tcps_keepdrops, "\t\t%lu connection%s dropped by keepalive\n");
-	p(tcps_predack, "\t%lu correct ACK header prediction%s\n");
-	p(tcps_preddat, "\t%lu correct data packet header prediction%s\n");
-	p3(tcps_pcbhashmiss, "\t%lu PCB hash miss%s\n");
-	ps(tcps_noport, "\t%lu dropped due to no socket\n");
-	p(tcps_connsdrained, "\t%lu connection%s drained due to memory shortage\n");
-
-	p(tcps_badsyn, "\t%lu bad connection attempt%s\n");
-	ps(tcps_sc_added, "\t%lu SYN cache entries added\n");
-	p(tcps_sc_collisions, "\t\t%lu hash collision%s\n");
-	ps(tcps_sc_completed, "\t\t%lu completed\n");
-	ps(tcps_sc_aborted, "\t\t%lu aborted (no space to build PCB)\n");
-	ps(tcps_sc_timed_out, "\t\t%lu timed out\n");
-	ps(tcps_sc_overflowed, "\t\t%lu dropped due to overflow\n");
-	ps(tcps_sc_bucketoverflow, "\t\t%lu dropped due to bucket overflow\n");
-	ps(tcps_sc_reset, "\t\t%lu dropped due to RST\n");
-	ps(tcps_sc_unreach, "\t\t%lu dropped due to ICMP unreachable\n");
-	p(tcps_sc_retransmitted, "\t%lu SYN,ACK%s retransmitted\n");
-	p(tcps_sc_dupesyn, "\t%lu duplicate SYN%s received for entries already in the cache\n");
-	p(tcps_sc_dropped, "\t%lu SYN%s dropped (no route or no space)\n");
+	   "\t%qu persist timeout%s (resulting in %qu dropped connection%s)\n");
+	p(tcps_keeptimeo, "\t%qu keepalive timeout%s\n");
+	p(tcps_keepprobe, "\t\t%qu keepalive probe%s sent\n");
+	p(tcps_keepdrops, "\t\t%qu connection%s dropped by keepalive\n");
+	p(tcps_predack, "\t%qu correct ACK header prediction%s\n");
+	p(tcps_preddat, "\t%qu correct data packet header prediction%s\n");
+	p3(tcps_pcbhashmiss, "\t%qu PCB hash miss%s\n");
+	ps(tcps_noport, "\t%qu dropped due to no socket\n");
+	p(tcps_connsdrained, "\t%qu connection%s drained due to memory shortage\n");
+
+	p(tcps_badsyn, "\t%qu bad connection attempt%s\n");
+	ps(tcps_sc_added, "\t%qu SYN cache entries added\n");
+	p(tcps_sc_collisions, "\t\t%qu hash collision%s\n");
+	ps(tcps_sc_completed, "\t\t%qu completed\n");
+	ps(tcps_sc_aborted, "\t\t%qu aborted (no space to build PCB)\n");
+	ps(tcps_sc_timed_out, "\t\t%qu timed out\n");
+	ps(tcps_sc_overflowed, "\t\t%qu dropped due to overflow\n");
+	ps(tcps_sc_bucketoverflow, "\t\t%qu dropped due to bucket overflow\n");
+	ps(tcps_sc_reset, "\t\t%qu dropped due to RST\n");
+	ps(tcps_sc_unreach, "\t\t%qu dropped due to ICMP unreachable\n");
+	p(tcps_sc_retransmitted, "\t%qu SYN,ACK%s retransmitted\n");
+	p(tcps_sc_dupesyn, "\t%qu duplicate SYN%s received for entries already in the cache\n");
+	p(tcps_sc_dropped, "\t%qu SYN%s dropped (no route or no space)\n");
 
 #undef p
 #undef ps
@@ -305,7 +305,7 @@
 	char *name;
 {
 	struct udpstat udpstat;
-	u_long delivered;
+	u_quad_t delivered;
 
 	if (off == 0)
 		return;
@@ -319,13 +319,13 @@
 #define	p3(f, m) if (udpstat.f || sflag <= 1) \
     printf(m, udpstat.f, plurales(udpstat.f))
 
-	p(udps_ipackets, "\t%lu datagram%s received\n");
-	ps(udps_hdrops, "\t%lu with incomplete header\n");
-	ps(udps_badlen, "\t%lu with bad data length field\n");
-	ps(udps_badsum, "\t%lu with bad checksum\n");
-	ps(udps_noport, "\t%lu dropped due to no socket\n");
-	p(udps_noportbcast, "\t%lu broadcast/multicast datagram%s dropped due to no socket\n");
-	ps(udps_fullsock, "\t%lu dropped due to full socket buffers\n");
+	p(udps_ipackets, "\t%qu datagram%s received\n");
+	ps(udps_hdrops, "\t%qu with incomplete header\n");
+	ps(udps_badlen, "\t%qu with bad data length field\n");
+	ps(udps_badsum, "\t%qu with bad checksum\n");
+	ps(udps_noport, "\t%qu dropped due to no socket\n");
+	p(udps_noportbcast, "\t%qu broadcast/multicast datagram%s dropped due to no socket\n");
+	ps(udps_fullsock, "\t%qu dropped due to full socket buffers\n");
 	delivered = udpstat.udps_ipackets -
 		    udpstat.udps_hdrops -
 		    udpstat.udps_badlen -
@@ -334,9 +334,9 @@
 		    udpstat.udps_noportbcast -
 		    udpstat.udps_fullsock;
 	if (delivered || sflag <= 1)
-		printf("\t%lu delivered\n", delivered);
-	p3(udps_pcbhashmiss, "\t%lu PCB hash miss%s\n");
-	p(udps_opackets, "\t%lu datagram%s output\n");
+		printf("\t%qu delivered\n", delivered);
+	p3(udps_pcbhashmiss, "\t%qu PCB hash miss%s\n");
+	p(udps_opackets, "\t%qu datagram%s output\n");
 
 #undef ps
 #undef p
@@ -363,35 +363,35 @@
 #define	p(f, m) if (ipstat.f || sflag <= 1) \
     printf(m, ipstat.f, plural(ipstat.f))
 
-	p(ips_total, "\t%lu total packet%s received\n");
-	p(ips_badsum, "\t%lu bad header checksum%s\n");
-	ps(ips_toosmall, "\t%lu with size smaller than minimum\n");
-	ps(ips_tooshort, "\t%lu with data size < data length\n");
-	ps(ips_toolong, "\t%lu with length > max ip packet size\n");
-	ps(ips_badhlen, "\t%lu with header length < data size\n");
-	ps(ips_badlen, "\t%lu with data length < header length\n");
-	ps(ips_badoptions, "\t%lu with bad options\n");
-	ps(ips_badvers, "\t%lu with incorrect version number\n");
-	p(ips_fragments, "\t%lu fragment%s received");
-	p(ips_fragdropped, "\t%lu fragment%s dropped (dup or out of space)\n");
-	p(ips_badfrags, "\t%lu malformed fragment%s dropped\n");
-	p(ips_fragtimeout, "\t%lu fragment%s dropped after timeout\n");
-	p(ips_reassembled, "\t%lu packet%s reassembled ok\n");
-	p(ips_delivered, "\t%lu packet%s for this host\n");
-	p(ips_noproto, "\t%lu packet%s for unknown/unsupported protocol\n");
-	p(ips_forward, "\t%lu packet%s forwarded");
-	p(ips_fastforward, " (%lu packet%s fast forwarded)");
+	p(ips_total, "\t%qu total packet%s received\n");
+	p(ips_badsum, "\t%qu bad header checksum%s\n");
+	ps(ips_toosmall, "\t%qu with size smaller than minimum\n");
+	ps(ips_tooshort, "\t%qu with data size < data length\n");
+	ps(ips_toolong, "\t%qu with length > max ip packet size\n");
+	ps(ips_badhlen, "\t%qu with header length < data size\n");
+	ps(ips_badlen, "\t%qu with data length < header length\n");
+	ps(ips_badoptions, "\t%qu with bad options\n");
+	ps(ips_badvers, "\t%qu with incorrect version number\n");
+	p(ips_fragments, "\t%qu fragment%s received");
+	p(ips_fragdropped, "\t%qu fragment%s dropped (dup or out of space)\n");
+	p(ips_badfrags, "\t%qu malformed fragment%s dropped\n");
+	p(ips_fragtimeout, "\t%qu fragment%s dropped after timeout\n");
+	p(ips_reassembled, "\t%qu packet%s reassembled ok\n");
+	p(ips_delivered, "\t%qu packet%s for this host\n");
+	p(ips_noproto, "\t%qu packet%s for unknown/unsupported protocol\n");
+	p(ips_forward, "\t%qu packet%s forwarded");
+	p(ips_fastforward, " (%qu packet%s fast forwarded)");
 	if (ipstat.ips_forward || sflag <= 1)
 		putchar('\n');
-	p(ips_cantforward, "\t%lu packet%s not forwardable\n");
-	p(ips_redirectsent, "\t%lu redirect%s sent\n");
-	p(ips_localout, "\t%lu packet%s sent from this host\n");
-	p(ips_rawout, "\t%lu packet%s sent with fabricated ip header\n");
-	p(ips_odropped, "\t%lu output packet%s dropped due to no bufs, etc.\n");
-	p(ips_noroute, "\t%lu output packet%s discarded due to no route\n");
-	p(ips_fragmented, "\t%lu output datagram%s fragmented\n");
-	p(ips_ofragments, "\t%lu fragment%s created\n");
-	p(ips_cantfrag, "\t%lu datagram%s that can't be fragmented\n");
+	p(ips_cantforward, "\t%qu packet%s not forwardable\n");
+	p(ips_redirectsent, "\t%qu redirect%s sent\n");
+	p(ips_localout, "\t%qu packet%s sent from this host\n");
+	p(ips_rawout, "\t%qu packet%s sent with fabricated ip header\n");
+	p(ips_odropped, "\t%qu output packet%s dropped due to no bufs, etc.\n");
+	p(ips_noroute, "\t%qu output packet%s discarded due to no route\n");
+	p(ips_fragmented, "\t%qu output datagram%s fragmented\n");
+	p(ips_ofragments, "\t%qu fragment%s created\n");
+	p(ips_cantfrag, "\t%qu datagram%s that can't be fragmented\n");
 #undef ps
 #undef p
 }
@@ -437,32 +437,32 @@
 #define	p(f, m) if (icmpstat.f || sflag <= 1) \
     printf(m, icmpstat.f, plural(icmpstat.f))
 
-	p(icps_error, "\t%lu call%s to icmp_error\n");
+	p(icps_error, "\t%qu call%s to icmp_error\n");
 	p(icps_oldicmp,
-	    "\t%lu error%s not generated because old message was icmp\n");
+	    "\t%qu error%s not generated because old message was icmp\n");
 	for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++)
 		if (icmpstat.icps_outhist[i] != 0) {
 			if (first) {
 				printf("\tOutput histogram:\n");
 				first = 0;
 			}
-			printf("\t\t%s: %lu\n", icmpnames[i],
+			printf("\t\t%s: %qu\n", icmpnames[i],
 				icmpstat.icps_outhist[i]);
 		}
-	p(icps_badcode, "\t%lu message%s with bad code fields\n");
-	p(icps_tooshort, "\t%lu message%s < minimum length\n");
-	p(icps_checksum, "\t%lu bad checksum%s\n");
-	p(icps_badlen, "\t%lu message%s with bad length\n");
+	p(icps_badcode, "\t%qu message%s with bad code fields\n");
+	p(icps_tooshort, "\t%qu message%s < minimum length\n");
+	p(icps_checksum, "\t%qu bad checksum%s\n");
+	p(icps_badlen, "\t%qu message%s with bad length\n");
 	for (first = 1, i = 0; i < ICMP_MAXTYPE + 1; i++)
 		if (icmpstat.icps_inhist[i] != 0) {
 			if (first) {
 				printf("\tInput histogram:\n");
 				first = 0;
 			}
-			printf("\t\t%s: %lu\n", icmpnames[i],
+			printf("\t\t%s: %qu\n", icmpnames[i],
 				icmpstat.icps_inhist[i]);
 		}
-	p(icps_reflect, "\t%lu message response%s generated\n");
+	p(icps_reflect, "\t%qu message response%s generated\n");
 #undef p
 }
 
@@ -485,15 +485,15 @@
     printf(m, igmpstat.f, plural(igmpstat.f))
 #define	py(f, m) if (igmpstat.f || sflag <= 1) \
     printf(m, igmpstat.f, igmpstat.f != 1 ? "ies" : "y")
-	p(igps_rcv_total, "\t%lu message%s received\n");
-        p(igps_rcv_tooshort, "\t%lu message%s received with too few bytes\n");
-        p(igps_rcv_badsum, "\t%lu message%s received with bad checksum\n");
-        py(igps_rcv_queries, "\t%lu membership quer%s received\n");
-        py(igps_rcv_badqueries, "\t%lu membership quer%s received with invalid field(s)\n");
-        p(igps_rcv_reports, "\t%lu membership report%s received\n");
-        p(igps_rcv_badreports, "\t%lu membership report%s received with invalid field(s)\n");
-        p(igps_rcv_ourreports, "\t%lu membership report%s received for groups to which we belong\n");
-        p(igps_snd_reports, "\t%lu membership report%s sent\n");
+	p(igps_rcv_total, "\t%qu message%s received\n");
+        p(igps_rcv_tooshort, "\t%qu message%s received with too few bytes\n");
+        p(igps_rcv_badsum, "\t%qu message%s received with bad checksum\n");
+        py(igps_rcv_queries, "\t%qu membership quer%s received\n");
+        py(igps_rcv_badqueries, "\t%qu membership quer%s received with invalid field(s)\n");
+        p(igps_rcv_reports, "\t%qu membership report%s received\n");
+        p(igps_rcv_badreports, "\t%qu membership report%s received with invalid field(s)\n");
+        p(igps_rcv_ourreports, "\t%qu membership report%s received for groups to which we belong\n");
+        p(igps_snd_reports, "\t%qu membership report%s sent\n");
 #undef p
 #undef py
 }
@@ -537,16 +537,16 @@
 #define	p(f, m) if (ipsecstat.f || sflag <= 1) \
     printf(m, ipsecstat.f, plural(ipsecstat.f))
 
-	p(in_success, "\t%lu inbound packet%s processed successfully\n");
-	p(in_polvio, "\t%lu inbound packet%s violated process security "
+	p(in_success, "\t%qu inbound packet%s processed successfully\n");
+	p(in_polvio, "\t%qu inbound packet%s violated process security "
 		"policy\n");
-	p(in_nosa, "\t%lu inbound packet%s with no SA available\n");
-	p(in_inval, "\t%lu inbound packet%s failed processing due to EINVAL\n");
-	p(in_badspi, "\t%lu inbound packet%s failed getting SPI\n");
-	p(in_ahreplay, "\t%lu inbound packet%s failed on AH replay check\n");
-	p(in_espreplay, "\t%lu inbound packet%s failed on ESP replay check\n");
-	p(in_ahauthsucc, "\t%lu inbound packet%s considered authentic\n");
-	p(in_ahauthfail, "\t%lu inbound packet%s failed on authentication\n");
+	p(in_nosa, "\t%qu inbound packet%s with no SA available\n");
+	p(in_inval, "\t%qu inbound packet%s failed processing due to EINVAL\n");
+	p(in_badspi, "\t%qu inbound packet%s failed getting SPI\n");
+	p(in_ahreplay, "\t%qu inbound packet%s failed on AH replay check\n");
+	p(in_espreplay, "\t%qu inbound packet%s failed on ESP replay check\n");
+	p(in_ahauthsucc, "\t%qu inbound packet%s considered authentic\n");
+	p(in_ahauthfail, "\t%qu inbound packet%s failed on authentication\n");
 	for (first = 1, proto = 0; proto < SADB_AALG_MAX; proto++) {
 		if (ipsecstat.in_ahhist[proto] <= 0)
 			continue;
@@ -554,7 +554,7 @@
 			printf("\tAH input histogram:\n");
 			first = 0;
 		}
-		printf("\t\t%s: %lu\n", ipsec_ahnames[proto],
+		printf("\t\t%s: %qu\n", ipsec_ahnames[proto],
 			ipsecstat.in_ahhist[proto]);
 	}
 	for (first = 1, proto = 0; proto < SADB_EALG_MAX; proto++) {
@@ -564,17 +564,17 @@
 			printf("\tESP input histogram:\n");
 			first = 0;
 		}
-		printf("\t\t%s: %lu\n", ipsec_espnames[proto],
+		printf("\t\t%s: %qu\n", ipsec_espnames[proto],
 			ipsecstat.in_esphist[proto]);
 	}
 
-	p(out_success, "\t%lu outbound packet%s processed successfully\n");
-	p(out_polvio, "\t%lu outbound packet%s violated process security "
+	p(out_success, "\t%qu outbound packet%s processed successfully\n");
+	p(out_polvio, "\t%qu outbound packet%s violated process security "
 		"policy\n");
-	p(out_nosa, "\t%lu outbound packet%s with no SA available\n");
-	p(out_inval, "\t%lu outbound packet%s failed processing due to "
+	p(out_nosa, "\t%qu outbound packet%s with no SA available\n");
+	p(out_inval, "\t%qu outbound packet%s failed processing due to "
 		"EINVAL\n");
-	p(out_noroute, "\t%lu outbound packet%s with no route\n");
+	p(out_noroute, "\t%qu outbound packet%s with no route\n");
 	for (first = 1, proto = 0; proto < SADB_AALG_MAX; proto++) {
 		if (ipsecstat.out_ahhist[proto] <= 0)
 			continue;
@@ -582,7 +582,7 @@
 			printf("\tAH output histogram:\n");
 			first = 0;
 		}
-		printf("\t\t%s: %lu\n", ipsec_ahnames[proto],
+		printf("\t\t%s: %qu\n", ipsec_ahnames[proto],
 			ipsecstat.out_ahhist[proto]);
 	}
 	for (first = 1, proto = 0; proto < SADB_EALG_MAX; proto++) {
@@ -592,7 +592,7 @@
 			printf("\tESP output histogram:\n");
 			first = 0;
 		}
-		printf("\t\t%s: %lu\n", ipsec_espnames[proto],
+		printf("\t\t%s: %qu\n", ipsec_espnames[proto],
 			ipsecstat.out_esphist[proto]);
 	}
 #undef p
Index: usr.bin/netstat/inet6.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/netstat/inet6.c,v
retrieving revision 1.3
diff -u -r1.3 inet6.c
--- inet6.c	1999/07/30 10:31:22	1.3
+++ inet6.c	1999/11/02 16:36:54
@@ -289,7 +289,7 @@
 	char *name;
 {
 	struct udp6stat udp6stat;
-	u_long delivered;
+	u_quad_t delivered;
 
 	if (off == 0)
 		return;
@@ -299,14 +299,14 @@
     printf(m, udp6stat.f, plural(udp6stat.f))
 #define	p1(f, m) if (udp6stat.f || sflag <= 1) \
     printf(m, udp6stat.f)
-	p(udp6s_ipackets, "\t%lu datagram%s received\n");
-	p1(udp6s_hdrops, "\t%lu with incomplete header\n");
-	p1(udp6s_badlen, "\t%lu with bad data length field\n");
-	p1(udp6s_badsum, "\t%lu with bad checksum\n");
-	p1(udp6s_nosum, "\t%lu with no checksum\n");
-	p1(udp6s_noport, "\t%lu dropped due to no socket\n");
-	p(udp6s_noportmcast, "\t%lu multicast datagram%s dropped due to no socket\n");
-	p1(udp6s_fullsock, "\t%lu dropped due to full socket buffers\n");
+	p(udp6s_ipackets, "\t%qu datagram%s received\n");
+	p1(udp6s_hdrops, "\t%qu with incomplete header\n");
+	p1(udp6s_badlen, "\t%qu with bad data length field\n");
+	p1(udp6s_badsum, "\t%qu with bad checksum\n");
+	p1(udp6s_nosum, "\t%qu with no checksum\n");
+	p1(udp6s_noport, "\t%qu dropped due to no socket\n");
+	p(udp6s_noportmcast, "\t%qu multicast datagram%s dropped due to no socket\n");
+	p1(udp6s_fullsock, "\t%qu dropped due to full socket buffers\n");
 	delivered = udp6stat.udp6s_ipackets -
 		    udp6stat.udp6s_hdrops -
 		    udp6stat.udp6s_badlen -
@@ -315,8 +315,8 @@
 		    udp6stat.udp6s_noportmcast -
 		    udp6stat.udp6s_fullsock;
 	if (delivered || sflag <= 1)
-		printf("\t%lu delivered\n", delivered);
-	p(udp6s_opackets, "\t%lu datagram%s output\n");
+		printf("\t%qu delivered\n", delivered);
+	p(udp6s_opackets, "\t%qu datagram%s output\n");
 #undef p
 #undef p1
 }
@@ -602,40 +602,40 @@
 #define	p1(f, m) if (ip6stat.f || sflag <= 1) \
     printf(m, ip6stat.f)
 
-	p(ip6s_total, "\t%lu total packet%s received\n");
-	p1(ip6s_toosmall, "\t%lu with size smaller than minimum\n");
-	p1(ip6s_tooshort, "\t%lu with data size < data length\n");
-	p1(ip6s_badoptions, "\t%lu with bad options\n");
-	p1(ip6s_badvers, "\t%lu with incorrect version number\n");
-	p(ip6s_fragments, "\t%lu fragment%s received\n");
-	p(ip6s_fragdropped, "\t%lu fragment%s dropped (dup or out of space)\n");
-	p(ip6s_fragtimeout, "\t%lu fragment%s dropped after timeout\n");
-	p(ip6s_fragoverflow, "\t%lu fragment%s that exceeded limit\n");
-	p(ip6s_reassembled, "\t%lu packet%s reassembled ok\n");
-	p(ip6s_delivered, "\t%lu packet%s for this host\n");
-	p(ip6s_forward, "\t%lu packet%s forwarded\n");
-	p(ip6s_cantforward, "\t%lu packet%s not forwardable\n");
-	p(ip6s_redirectsent, "\t%lu redirect%s sent\n");
-	p(ip6s_localout, "\t%lu packet%s sent from this host\n");
-	p(ip6s_rawout, "\t%lu packet%s sent with fabricated ip header\n");
-	p(ip6s_odropped, "\t%lu output packet%s dropped due to no bufs, etc.\n");
-	p(ip6s_noroute, "\t%lu output packet%s discarded due to no route\n");
-	p(ip6s_fragmented, "\t%lu output datagram%s fragmented\n");
-	p(ip6s_ofragments, "\t%lu fragment%s created\n");
-	p(ip6s_cantfrag, "\t%lu datagram%s that can't be fragmented\n");
-	p(ip6s_badscope, "\t%lu packet%s that violated scope rules\n");
-	p(ip6s_notmember, "\t%lu multicast packet%s which we don't join\n");
+	p(ip6s_total, "\t%qu total packet%s received\n");
+	p1(ip6s_toosmall, "\t%qu with size smaller than minimum\n");
+	p1(ip6s_tooshort, "\t%qu with data size < data length\n");
+	p1(ip6s_badoptions, "\t%qu with bad options\n");
+	p1(ip6s_badvers, "\t%qu with incorrect version number\n");
+	p(ip6s_fragments, "\t%qu fragment%s received\n");
+	p(ip6s_fragdropped, "\t%qu fragment%s dropped (dup or out of space)\n");
+	p(ip6s_fragtimeout, "\t%qu fragment%s dropped after timeout\n");
+	p(ip6s_fragoverflow, "\t%qu fragment%s that exceeded limit\n");
+	p(ip6s_reassembled, "\t%qu packet%s reassembled ok\n");
+	p(ip6s_delivered, "\t%qu packet%s for this host\n");
+	p(ip6s_forward, "\t%qu packet%s forwarded\n");
+	p(ip6s_cantforward, "\t%qu packet%s not forwardable\n");
+	p(ip6s_redirectsent, "\t%qu redirect%s sent\n");
+	p(ip6s_localout, "\t%qu packet%s sent from this host\n");
+	p(ip6s_rawout, "\t%qu packet%s sent with fabricated ip header\n");
+	p(ip6s_odropped, "\t%qu output packet%s dropped due to no bufs, etc.\n");
+	p(ip6s_noroute, "\t%qu output packet%s discarded due to no route\n");
+	p(ip6s_fragmented, "\t%qu output datagram%s fragmented\n");
+	p(ip6s_ofragments, "\t%qu fragment%s created\n");
+	p(ip6s_cantfrag, "\t%qu datagram%s that can't be fragmented\n");
+	p(ip6s_badscope, "\t%qu packet%s that violated scope rules\n");
+	p(ip6s_notmember, "\t%qu multicast packet%s which we don't join\n");
 	for (first = 1, i = 0; i < 256; i++)
 		if (ip6stat.ip6s_nxthist[i] != 0) {
 			if (first) {
 				printf("\tInput histogram:\n");
 				first = 0;
 			}
-			printf("\t\t%s: %lu\n", ip6nh[i],
+			printf("\t\t%s: %qu\n", ip6nh[i],
 			       ip6stat.ip6s_nxthist[i]);
 		}
 	printf("\tMbuf statics:\n");
-	printf("\t\t%lu one mbuf\n", ip6stat.ip6s_m1);
+	printf("\t\t%qu one mbuf\n", ip6stat.ip6s_m1);
 	for (first = 1, i = 0; i < 32; i++) {
 		char ifbuf[IFNAMSIZ];
 		if (ip6stat.ip6s_m2m[i] != 0) {		
@@ -643,15 +643,15 @@
 				printf("\t\ttwo or more mbuf:\n");
 				first = 0;
 			}
-			printf("\t\t\t%s = %ld\n",
+			printf("\t\t\t%s = %qu\n",
 			       if_indextoname(i, ifbuf),
 			       ip6stat.ip6s_m2m[i]);
 		}
 	}
-	printf("\t\t%lu one ext mbuf\n", ip6stat.ip6s_mext1);
-	printf("\t\t%lu two or more ext mbuf\n", ip6stat.ip6s_mext2m);	
-	p(ip6s_exthdrtoolong, "\t%lu packet%s whose headers are not continuous\n");
-	p(ip6s_nogif, "\t%lu tunneling packet%s that can't find gif\n");
+	printf("\t\t%qu one ext mbuf\n", ip6stat.ip6s_mext1);
+	printf("\t\t%qu two or more ext mbuf\n", ip6stat.ip6s_mext2m);	
+	p(ip6s_exthdrtoolong, "\t%qu packet%s whose headers are not continuous\n");
+	p(ip6s_nogif, "\t%qu tunneling packet%s that can't find gif\n");
 #undef p
 #undef p1
 }
@@ -934,32 +934,32 @@
 #define	p(f, m) if (icmp6stat.f || sflag <= 1) \
     printf(m, icmp6stat.f, plural(icmp6stat.f))
 
-	p(icp6s_error, "\t%lu call%s to icmp_error\n");
+	p(icp6s_error, "\t%qu call%s to icmp_error\n");
 	p(icp6s_canterror,
-	    "\t%lu error%s not generated because old message was icmp or so\n");
+	    "\t%qu error%s not generated because old message was icmp or so\n");
 	for (first = 1, i = 0; i < 256; i++)
 		if (icmp6stat.icp6s_outhist[i] != 0) {
 			if (first) {
 				printf("\tOutput histogram:\n");
 				first = 0;
 			}
-			printf("\t\t%s: %lu\n", icmp6names[i],
+			printf("\t\t%s: %qu\n", icmp6names[i],
 				icmp6stat.icp6s_outhist[i]);
 		}
-	p(icp6s_badcode, "\t%lu message%s with bad code fields\n");
-	p(icp6s_tooshort, "\t%lu message%s < minimum length\n");
-	p(icp6s_checksum, "\t%lu bad checksum%s\n");
-	p(icp6s_badlen, "\t%lu message%s with bad length\n");
+	p(icp6s_badcode, "\t%qu message%s with bad code fields\n");
+	p(icp6s_tooshort, "\t%qu message%s < minimum length\n");
+	p(icp6s_checksum, "\t%qu bad checksum%s\n");
+	p(icp6s_badlen, "\t%qu message%s with bad length\n");
 	for (first = 1, i = 0; i < ICMP6_MAXTYPE; i++)
 		if (icmp6stat.icp6s_inhist[i] != 0) {
 			if (first) {
 				printf("\tInput histogram:\n");
 				first = 0;
 			}
-			printf("\t\t%s: %lu\n", icmp6names[i],
+			printf("\t\t%s: %qu\n", icmp6names[i],
 				icmp6stat.icp6s_inhist[i]);
 		}
-	p(icp6s_reflect, "\t%lu message response%s generated\n");
+	p(icp6s_reflect, "\t%qu message response%s generated\n");
 #undef p
 }
 
@@ -980,13 +980,13 @@
 
 #define	p(f, m) if (pim6stat.f || sflag <= 1) \
     printf(m, pim6stat.f, plural(pim6stat.f))
-	p(pim6s_rcv_total, "\t%u message%s received\n");
-	p(pim6s_rcv_tooshort, "\t%u message%s received with too few bytes\n");
-	p(pim6s_rcv_badsum, "\t%u message%s received with bad checksum\n");
-	p(pim6s_rcv_badversion, "\t%u message%s received with bad version\n");
-	p(pim6s_rcv_registers, "\t%u register%s received\n");
-	p(pim6s_rcv_badregisters, "\t%u bad register%s received\n");
-	p(pim6s_snd_registers, "\t%u register%s sent\n");
+	p(pim6s_rcv_total, "\t%qu message%s received\n");
+	p(pim6s_rcv_tooshort, "\t%qu message%s received with too few bytes\n");
+	p(pim6s_rcv_badsum, "\t%qu message%s received with bad checksum\n");
+	p(pim6s_rcv_badversion, "\t%qu message%s received with bad version\n");
+	p(pim6s_rcv_registers, "\t%qu register%s received\n");
+	p(pim6s_rcv_badregisters, "\t%qu bad register%s received\n");
+	p(pim6s_snd_registers, "\t%qu register%s sent\n");
 #undef p
 }
 
@@ -1105,17 +1105,17 @@
 
 	printf("snd_una %u, snd_nxt %u, snd_up %u\n",
 	    tcp6cb.snd_una, tcp6cb.snd_nxt, tcp6cb.snd_up);
-	printf("snd_wl1 %u, snd_wl2 %u, iss %u, snd_wnd %lu\n\n",
+	printf("snd_wl1 %u, snd_wl2 %u, iss %u, snd_wnd %qu\n\n",
 	    tcp6cb.snd_wl1, tcp6cb.snd_wl2, tcp6cb.iss, tcp6cb.snd_wnd);
 
-	printf("rcv_wnd %lu, rcv_nxt %u, rcv_up %u, irs %u\n\n",
+	printf("rcv_wnd %qu, rcv_nxt %u, rcv_up %u, irs %u\n\n",
 	    tcp6cb.rcv_wnd, tcp6cb.rcv_nxt, tcp6cb.rcv_up, tcp6cb.irs);
 
-	printf("rcv_adv %u, snd_max %u, snd_cwnd %lu, snd_ssthresh %lu\n",
+	printf("rcv_adv %u, snd_max %u, snd_cwnd %qu, snd_ssthresh %qu\n",
 	    tcp6cb.rcv_adv, tcp6cb.snd_max, tcp6cb.snd_cwnd, tcp6cb.snd_ssthresh);
 
 	printf("idle %d, rtt %d, rtseq %u, srtt %d, rttvar %d, rttmin %d, "
-	    "max_sndwnd %lu\n\n", tcp6cb.t_idle, tcp6cb.t_rtt, tcp6cb.t_rtseq,
+	    "max_sndwnd %qu\n\n", tcp6cb.t_idle, tcp6cb.t_rtt, tcp6cb.t_rtseq,
 	    tcp6cb.t_srtt, tcp6cb.t_rttvar, tcp6cb.t_rttmin, tcp6cb.max_sndwnd);
 
 	printf("oobflags %d, iobc %d, softerror %d\n\n", tcp6cb.t_oobflags,
Index: usr.bin/netstat/mroute6.c
===================================================================
RCS file: /cvsroot/basesrc/usr.bin/netstat/mroute6.c,v
retrieving revision 1.2
diff -u -r1.2 mroute6.c
--- mroute6.c	1999/07/06 13:18:46	1.2
+++ mroute6.c	1999/11/02 16:36:54
@@ -250,31 +250,31 @@
 
 	kread(mstaddr, (char *)&mrtstat, sizeof(mrtstat));
 	printf("multicast forwarding:\n");
-	printf(" %10lu multicast forwarding cache lookup%s\n",
+	printf(" %10qu multicast forwarding cache lookup%s\n",
 	       mrtstat.mrt6s_mfc_lookups, plural(mrtstat.mrt6s_mfc_lookups));
-	printf(" %10lu multicast forwarding cache miss%s\n",
+	printf(" %10qu multicast forwarding cache miss%s\n",
 	       mrtstat.mrt6s_mfc_misses, plurales(mrtstat.mrt6s_mfc_misses));
-	printf(" %10lu upcall%s to mrouted\n",
+	printf(" %10qu upcall%s to mrouted\n",
 	       mrtstat.mrt6s_upcalls, plural(mrtstat.mrt6s_upcalls));
-	printf(" %10lu upcall queue overflow%s\n",
+	printf(" %10qu upcall queue overflow%s\n",
 	  mrtstat.mrt6s_upq_ovflw, plural(mrtstat.mrt6s_upq_ovflw));
-	printf(" %10lu upcall%s dropped due to full socket buffer\n",
+	printf(" %10qu upcall%s dropped due to full socket buffer\n",
 	  mrtstat.mrt6s_upq_sockfull, plural(mrtstat.mrt6s_upq_sockfull));
-	printf(" %10lu cache cleanup%s\n",
+	printf(" %10qu cache cleanup%s\n",
 	  mrtstat.mrt6s_cache_cleanups, plural(mrtstat.mrt6s_cache_cleanups));
-	printf(" %10lu datagram%s with no route for origin\n",
+	printf(" %10qu datagram%s with no route for origin\n",
 	  mrtstat.mrt6s_no_route, plural(mrtstat.mrt6s_no_route));
-	printf(" %10lu datagram%s arrived with bad tunneling\n",
+	printf(" %10qu datagram%s arrived with bad tunneling\n",
 	  mrtstat.mrt6s_bad_tunnel, plural(mrtstat.mrt6s_bad_tunnel));
-	printf(" %10lu datagram%s could not be tunneled\n",
+	printf(" %10qu datagram%s could not be tunneled\n",
 	  mrtstat.mrt6s_cant_tunnel, plural(mrtstat.mrt6s_cant_tunnel));
-	printf(" %10lu datagram%s arrived on wrong interface\n",
+	printf(" %10qu datagram%s arrived on wrong interface\n",
 	  mrtstat.mrt6s_wrong_if, plural(mrtstat.mrt6s_wrong_if));
-	printf(" %10lu datagram%s selectively dropped\n",
+	printf(" %10qu datagram%s selectively dropped\n",
 	  mrtstat.mrt6s_drop_sel, plural(mrtstat.mrt6s_drop_sel));
-	printf(" %10lu datagram%s dropped due to queue overflow\n",
+	printf(" %10qu datagram%s dropped due to queue overflow\n",
 	  mrtstat.mrt6s_q_overflow, plural(mrtstat.mrt6s_q_overflow));
-	printf(" %10lu datagram%s dropped for being too large\n",
+	printf(" %10qu datagram%s dropped for being too large\n",
 	  mrtstat.mrt6s_pkt2large, plural(mrtstat.mrt6s_pkt2large));
 }
 #endif /*INET6*/
Index: usr.sbin/slstats/slstats.c
===================================================================
RCS file: /cvsroot/basesrc/usr.sbin/slstats/slstats.c,v
retrieving revision 1.11
diff -u -r1.11 slstats.c
--- slstats.c	1998/07/06 07:50:20	1.11
+++ slstats.c	1999/11/02 16:38:02
@@ -212,20 +212,20 @@
 				(void)printf(" %6.6s %6.6s", "SEARCH", "MISS");
 			(void)putchar('\n');
 		}
-		(void)printf("%8lu %6ld %6u %6u %6u",
+		(void)printf("%8qu %6ld %6u %6u %6u",
 			V(sc_if.if_ibytes),
 			(long)V(sc_if.if_ipackets),
 			V(sc_comp.sls_compressedin),
 			V(sc_comp.sls_uncompressedin),
 			V(sc_comp.sls_errorin));
 		if (vflag)
-			(void)printf(" %6u %6lu",
+			(void)printf(" %6u %6qu",
 				V(sc_comp.sls_tossed),
 				V(sc_if.if_ipackets) -
 				  V(sc_comp.sls_compressedin) -
 				  V(sc_comp.sls_uncompressedin) -
 				  V(sc_comp.sls_errorin));
-		(void)printf(" | %8lu %6ld %6u %6u %6lu",
+		(void)printf(" | %8qu %6qd %6u %6u %6qu",
 			V(sc_if.if_obytes),
 			V(sc_if.if_opackets),
 			V(sc_comp.sls_compressed),

--opJtzjQTFsWo+cga--