Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Aug 2004 13:05:32 -0700
From:      Brooks Davis <brooks@one-eyed-alien.net>
To:        net@freebsd.org
Subject:   proposed new if_data variable
Message-ID:  <20040827200532.GE22253@odin.ac.hmc.edu>

next in thread | raw e-mail | index | archive | help

--98e8jtXdkpgskNou
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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=3D60419

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 ...

=2E. //depot/user/brooks/cleanup/sys/net/if.c#28 edit
=2E. //depot/user/brooks/cleanup/sys/net/if.h#7 edit
=2E. //depot/user/brooks/cleanup/sys/net/if_var.h#19 edit

Differences ...

=3D=3D=3D=3D //depot/user/brooks/cleanup/sys/net/if.c#28 (text+ko) =3D=3D=
=3D=3D

@@ -387,6 +387,7 @@
 	TAILQ_INIT(&ifp->if_multiaddrs);
 	knlist_init(&ifp->if_klist, NULL);
 	getmicrotime(&ifp->if_lastchange);
+	getmicrotime(&ifp->if_epoch);
=20
 #ifdef MAC
 	mac_init_ifnet(ifp);

=3D=3D=3D=3D //depot/user/brooks/cleanup/sys/net/if.h#7 (text+ko) =3D=3D=3D=
=3D

@@ -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 */
 };
=20
 #define	IFF_UP		0x1		/* interface is up */

=3D=3D=3D=3D //depot/user/brooks/cleanup/sys/net/if_var.h#19 (text+ko) =3D=
=3D=3D=3D

@@ -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 -----

--98e8jtXdkpgskNou
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBL5QLXY6L6fI4GtQRAkWhAJ9Uqcsr4JhibUfNNM8G9tiGzleazwCgzmEc
QLi3KXkgN671xngGZxjTj44=
=LWRj
-----END PGP SIGNATURE-----

--98e8jtXdkpgskNou--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040827200532.GE22253>