From owner-freebsd-net@FreeBSD.ORG Fri Aug 27 20:03:28 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B42516A4CE for ; Fri, 27 Aug 2004 20:03:28 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBC1C43D31 for ; Fri, 27 Aug 2004 20:03:27 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id i7RK5WSo020613 for ; Fri, 27 Aug 2004 13:05:32 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id i7RK5WOF020612 for net@freebsd.org; Fri, 27 Aug 2004 13:05:32 -0700 Date: Fri, 27 Aug 2004 13:05:32 -0700 From: Brooks Davis To: net@freebsd.org Message-ID: <20040827200532.GE22253@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="98e8jtXdkpgskNou" Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Subject: proposed new if_data variable X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2004 20:03:28 -0000 --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 ----- From: Brooks Davis Date: Wed, 25 Aug 2004 19:46:15 GMT To: Perforce Change Reviews 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--