From owner-freebsd-current@FreeBSD.ORG Sun Oct 7 15:33:41 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CADD2106566C; Sun, 7 Oct 2012 15:33:41 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 823238FC18; Sun, 7 Oct 2012 15:33:41 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 099527300A; Sun, 7 Oct 2012 17:53:56 +0200 (CEST) Date: Sun, 7 Oct 2012 17:53:56 +0200 From: Luigi Rizzo To: Garrett Cooper Message-ID: <20121007155356.GA77558@onelab2.iet.unipi.it> References: <20121006172834.GB63649@onelab2.iet.unipi.it> <20121007104330.GA75115@onelab2.iet.unipi.it> <20121007150219.GA76853@onelab2.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: Adrian Chadd , current@freebsd.org Subject: Re: sysctl vs ifconfig vs other (was Re: sysctl-controlled key-value store ?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Oct 2012 15:33:41 -0000 On Sun, Oct 07, 2012 at 08:23:23AM -0700, Garrett Cooper wrote: > On Sun, Oct 7, 2012 at 8:02 AM, Luigi Rizzo wrote: ... > FWIW, I don't think that the problem is necessarily the fact that one > should do it either via ioctl, kvm, sysctl, etc: having a library/set > of interfaces as Adrian suggested would be indispensable for a number > of groups that copy code from FreeBSD net utilities wholesale -- actually, the mechanism does matter, and exactly for the reason you mention. Access through sysctl is incredibly easy from both userspace and from a C application, because all the work is done in the kernel side, whereas other mechanisms (ioctl, i'd rather leave kvm apart as we really don't want that!) require the definition of a specific API (ioctl, structs) _and_ some amount of wrapping code in userspace. cheers luigi > effectively forking it the code, which in turn becomes a burden to the > project/company hacking on the code, and a loss to the community if > it's not given back. It would also make FreeBSD adoption a whole lot > easier for outside projects like net-snmp, as well as tools that > should be more tightly integrated into base OSes for networking > configuration and statistics, jail management, etc. > > If something isn't done to make these interfaces more usable in a > generic manner and clean from the get-go, it doesn't matter what > interface I'll be getting the information via. The BSD socket > interfaces are extremely well thought out, but bits outside of struct > sockaddr* (e.g. stuff in net/...) could be better documented > (unfortunately the Unix Networking books are a bit long in the tooth, > in part because the original author passed on :(..). > > My 2 cents for what little it may be worth, > -Garrett