From owner-freebsd-arch@FreeBSD.ORG Thu Dec 3 22:02:23 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEE6F106568B for ; Thu, 3 Dec 2009 22:02:23 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp1.dlr.de (smtp1.dlr.de [129.247.252.32]) by mx1.freebsd.org (Postfix) with ESMTP id 56AC88FC0A for ; Thu, 3 Dec 2009 22:02:23 +0000 (UTC) Received: from beagle.kn.op.dlr.de ([129.247.178.136]) by smtp1.dlr.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Dec 2009 22:18:12 +0100 Date: Thu, 3 Dec 2009 22:18:08 +0100 (CET) From: Harti Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: freebsd-arch@freebsd.org Message-ID: <20091203220011.H53516@beagle.kn.op.dlr.de> X-OpenPGP-Key: harti@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-OriginalArrivalTime: 03 Dec 2009 21:18:12.0177 (UTC) FILETIME=[1E8CC410:01CA745E] Subject: struct if_data and ifmibdata X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Harti Brandt List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Dec 2009 22:02:23 -0000 Hi, I'm currently working on the networking MIBs for bsnmpd to implement the more recent RFCs (including IPv6 stuff). While doing this I run into numerous problems accessing interface information. The two sources of this information are $subj, each of which has some problems. The main problem is missing flexibility because of ABI issues. I have some ideas how to relax this somewhat, but before starting to implement anything I though I ask around whether this makes sense. 1. struct if_data. This is embedded into struct ifnet, so any change in size changes the ifnet offsets which is bad once we start keeping the ABI stable in -current. Other problems are: - hard to find out what version of struct if_data one is retrieving via either the if_msghdr routing message or via the interface MIB - we've run out of ifi_type (u_char) space. IANAIfType is currently at 251. Actually some of our private defines in if_types.h already overlap IANA assigned types - ifi_physical is not used anywhere in the kernel as far as I can see and should probably be removed together with the associated ioctls. This seems to be replaced long time ago by the if_media stuff. - we've run out of if_baudrate space (u_long) on 32-bit architectures for 10GBit/s interfaces - broadcast packet statistics are missing (they are required by the actual IF-MIB) - ifi_datalen is rather short (u_char) and restricts structure size to 256 bytes. So what I would like to do is: - add a version field at the beginning and a #define to help user programs in working with different versions of this structure - add a couple of dozens of bytes at the end to allow extending the structure without changing its size 2. struct ifmibdata - add a version field here too. 3. struct ifmib_iso_8802_3 - add a version field here too. - add dot3StatsSymbolErrors which are required by the current EtherLike-MIB. Unfortunately only 4 drivers actually implement the ethernet statistics :-( so far So, does this make any sense? harti