summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-03-30 09:53:44 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-03-30 09:53:44 +0000
commitfc577400dc1feaf4fc94d4ec5afd76e2dfa4ab4f (patch)
tree3420f257d7f57094724ccaeae3e7b37549db3563
parente29cd64d5436256eac9c832805ce70df11b59a9f (diff)
In sysctl_dumpentry() pass the rt_refcnt by overloading rmx_rttvar.
This new rmx_refcnt can be used by route(8) to produce the same output as netstat(1). OK henning@
-rw-r--r--sys/net/route.h12
-rw-r--r--sys/net/rtsock.c3
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index c8c1e887fe0..03bb38f06d4 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.h,v 1.37 2006/03/22 14:37:44 henning Exp $ */
+/* $OpenBSD: route.h,v 1.38 2006/03/30 09:53:43 claudio Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
@@ -75,11 +75,13 @@ struct rt_metrics {
u_long rmx_expire; /* lifetime for route, e.g. redirect */
u_long rmx_recvpipe; /* inbound delay-bandwidth product */
u_long rmx_sendpipe; /* outbound delay-bandwidth product */
- u_long rmx_ssthresh; /* outbound gateway buffer limit */
- u_long rmx_rtt; /* estimated round trip time */
- u_long rmx_rttvar; /* estimated rtt variance */
+ u_long rmx_ssthresh; /* outbound gateway buffer limit (deprecated) */
+ u_long rmx_rtt; /* estimated round trip time (deprecated) */
+ u_long rmx_rttvar; /* estimated rtt variance (deprecated) */
u_long rmx_pksent; /* packets sent using this route */
};
+/* XXX overloading rttvar as that value is no longer used. */
+#define rmx_refcnt rmx_rttvar /* # held references only used by sysctl */
/*
* rmx_rtt and rmx_rttvar are stored as microseconds;
@@ -157,7 +159,7 @@ struct rtentry {
struct rtstat {
u_int32_t rts_badredirect; /* bogus redirect calls */
u_int32_t rts_dynamic; /* routes created by redirects */
- u_int32_t rts_newgateway; /* routes modified by redirects */
+ u_int32_t rts_newgateway; /* routes modified by redirects */
u_int32_t rts_unreach; /* lookups which failed */
u_int32_t rts_wildcard; /* lookups satisfied by a wildcard */
};
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 05c25ef73cb..56c7a20579f 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.55 2006/03/30 08:28:16 claudio Exp $ */
+/* $OpenBSD: rtsock.c,v 1.56 2006/03/30 09:53:43 claudio Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -811,6 +811,7 @@ sysctl_dumpentry(struct radix_node *rn, void *v)
rtm->rtm_flags = rt->rt_flags;
rtm->rtm_use = 0;
rt_getmetrics(&rt->rt_rmx, &rtm->rtm_rmx);
+ rtm->rtm_rmx.rmx_refcnt = (u_long)rt->rt_refcnt;
rtm->rtm_index = rt->rt_ifp->if_index;
rtm->rtm_errno = rtm->rtm_pid = rtm->rtm_seq = 0;
rtm->rtm_addrs = info.rti_addrs;