proposed new if_data variable
Brooks Davis
brooks at one-eyed-alien.net
Fri Aug 27 13:03:28 PDT 2004
I'd like to proposed adding a new variable, ifi_epoch, to struct
if_data. It will be set to the time the counters were zeroed,
currently, the time if_attach was called. The intent is to provide a
correct value for RFC2233's ifCounterDiscontinuityTime and to make it
easier for applications to verify that the interface they are looking at
is the same one that had this index last time.
Since this will increase the size of struct if_data and thus struct
ifnet, the change needs to be made now if it's going to be made for
5-STABLE. Any comments on this idea?
-- Brooks
----- Forwarded message from Brooks Davis <brooks at freebsd.org> -----
From: Brooks Davis <brooks at freebsd.org>
Date: Wed, 25 Aug 2004 19:46:15 GMT
To: Perforce Change Reviews <perforce at freebsd.org>
X-Virus-Status: No
Subject: PERFORCE change 60419 for review
http://perforce.freebsd.org/chv.cgi?CH=60419
Change 60419 by brooks at brooks_minya on 2004/08/25 19:45:20
Add a new member to if_data, ifi_epoch (aka ifp->if_epoch).
if_epoch is indended to be set to the time the interface was
attached or the last time the stats were reset (we don't
currently support that, but it is a potentialy useful concept
and I've got plans to cause resets to happen in certain
circumstances). if_epoch is indended to always be a valid value
for ifCounterDiscontinuityTime in RFC2233.
Affected files ...
.. //depot/user/brooks/cleanup/sys/net/if.c#28 edit
.. //depot/user/brooks/cleanup/sys/net/if.h#7 edit
.. //depot/user/brooks/cleanup/sys/net/if_var.h#19 edit
Differences ...
==== //depot/user/brooks/cleanup/sys/net/if.c#28 (text+ko) ====
@@ -387,6 +387,7 @@
TAILQ_INIT(&ifp->if_multiaddrs);
knlist_init(&ifp->if_klist, NULL);
getmicrotime(&ifp->if_lastchange);
+ getmicrotime(&ifp->if_epoch);
#ifdef MAC
mac_init_ifnet(ifp);
==== //depot/user/brooks/cleanup/sys/net/if.h#7 (text+ko) ====
@@ -103,6 +103,7 @@
u_long ifi_hwassist; /* HW offload capabilities */
u_long ifi_unused; /* XXX was ifi_xmittiming */
struct timeval ifi_lastchange; /* time of last administrative change */
+ struct timeval ifi_epoch; /* time of creation or stat reset */
};
#define IFF_UP 0x1 /* interface is up */
==== //depot/user/brooks/cleanup/sys/net/if_var.h#19 (text+ko) ====
@@ -227,6 +227,7 @@
#define if_iqdrops if_data.ifi_iqdrops
#define if_noproto if_data.ifi_noproto
#define if_lastchange if_data.ifi_lastchange
+#define if_epoch if_data.ifi_epoch
#define if_recvquota if_data.ifi_recvquota
#define if_xmitquota if_data.ifi_xmitquota
#define if_rawoutput(if, m, sa) if_output(if, m, sa, (struct rtentry *)0)
----- End forwarded message -----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20040827/19ee8253/attachment.bin
More information about the freebsd-net
mailing list