proposed new if_data variable
From: Brooks Davis (brooks_at_one-eyed-alien.net)
Date: 08/27/04
- Previous message: Brooks Davis: "Re: kern/52260: sys/net/if.c:if_detach in FreeBSD4 forgets resetting the ifindex2ifnet array"
- Next in thread: Andre Oppermann: "Re: proposed new if_data variable"
- Reply: Andre Oppermann: "Re: proposed new if_data variable"
- Reply: Charles Swiger: "Re: proposed new if_data variable"
- Reply: Bruce M Simpson: "Re: proposed new if_data variable"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 27 Aug 2004 13:05:32 -0700 To: net@freebsd.org
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@freebsd.org> -----
From: Brooks Davis <brooks@freebsd.org>
Date: Wed, 25 Aug 2004 19:46:15 GMT
To: Perforce Change Reviews <perforce@freebsd.org>
X-Virus-Status: No
Subject: PERFORCE change 60419 for review
http://perforce.freebsd.org/chv.cgi?CH=60419
Change 60419 by brooks@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 -----
- application/pgp-signature attachment: stored
- Previous message: Brooks Davis: "Re: kern/52260: sys/net/if.c:if_detach in FreeBSD4 forgets resetting the ifindex2ifnet array"
- Next in thread: Andre Oppermann: "Re: proposed new if_data variable"
- Reply: Andre Oppermann: "Re: proposed new if_data variable"
- Reply: Charles Swiger: "Re: proposed new if_data variable"
- Reply: Bruce M Simpson: "Re: proposed new if_data variable"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|