From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 16 22:11:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA16510656E6 for ; Mon, 16 Mar 2009 22:11:35 +0000 (UTC) (envelope-from ciphwn@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 25E288FC1D for ; Mon, 16 Mar 2009 22:11:34 +0000 (UTC) (envelope-from ciphwn@gmail.com) Received: by fg-out-1718.google.com with SMTP id l26so12159fgb.35 for ; Mon, 16 Mar 2009 15:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6bYhYuMC7g0lepTsVI5Mt/RO4briCyfbc4O+d30S2iw=; b=hGKif2ttfgZTqlPAAZEvexo6VJKxzZl2u4mO8okUHom/x6dXVin7rp4jA6YxTQ44ec +TbgHgpOx3/fdr7l6iMFGKgHsTFORf6GQWFv3vyL3xavzJDtLaQak/kqNSsAqJGUoKjo ezri51jqEqsJrGJkTxQycT3IypZKSs+CWr+As= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=tUfeRAyXOEs7gOZwDNIkGno8pUHXrolJSkt/SuUWEcEWG3y6HHp2gLkfav5LW2oJhk /fsYv6X4SAJHqvBPTO2dtt+xG2lM7mIo6ba4ThGlGM6D3iA73T7R3UtBdnnVph0u65f+ 9AIjMep0U/RMq7K9Z7MG2tM+iUVcFNG7mWHjs= MIME-Version: 1.0 Received: by 10.86.92.7 with SMTP id p7mr3025567fgb.24.1237241494281; Mon, 16 Mar 2009 15:11:34 -0700 (PDT) In-Reply-To: <49BEC656.50702@freebsd.org> References: <13b997e60903160716x21881adfma588c32551c36e6f@mail.gmail.com> <21C1FF9D-4CDA-4476-9F11-3DE281279C1A@freebsd.org> <13b997e60903161141j8faaf7frd6ce9b1423b40164@mail.gmail.com> <49BEA2BC.6000405@delphij.net> <13b997e60903161213t320252dbg56e96335e79f7eb9@mail.gmail.com> <49BEC656.50702@freebsd.org> Date: Mon, 16 Mar 2009 18:11:34 -0400 Message-ID: <13b997e60903161511p70ee2252qf6d594dae13e4ec@mail.gmail.com> From: Cipta H To: Tim Kientzle Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: writing libnetstat for Summer of Code 2009 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Mar 2009 22:11:36 -0000 On Mon, Mar 16, 2009 at 5:36 PM, Tim Kientzle wrote: > Many people consider top-posting to be rude. =A0FYI. > My comments below, where they belong. > > Cipta H wrote: >> >> Thanks for the reply, Xin. I'm aware of something called sysctl, and if >> I am accepted to work on this project, my main task is to ensure all liv= e >> network data will come from sysctl, but the only XML I know of is the >> markup language. Perhaps someone more knowledgeable can point me >> to the right resource? Thanks in advance. >> >> Cipta >> >> On Mon, Mar 16, 2009 at 3:04 PM, Xin LI wrote: >> >>> I'm not very sure but I think Rui is referring XML like the GEOM >>> subsystem has used (perhaps to have the kernel expose the statistics >>> data with XML and the userland part of the library parse and return the >>> result)? > > There are two different issues: > =A0* Kernel <-> userland communications > =A0* library <-> client program communications > > There is ample precedent for the former to use sysctl > interfaces that return XML from the kernel that is then > parsed in userland. =A0In particular, this makes it much > easier to extend in the future, as long as the proposed > libnetstat library ignores data it doesn't understand. > (In the past, many tools parsed in-kernel data > structures to obtain this kind of information, which is > prone to breakage whenever the kernel changes. =A0Making > this so that kernel and tools can evolve more independently > is a major goal here.) > > For the latter, some kind of opaque C structure > makes sense, since that simplifies the client programs. > > So really this breaks down into two very different > tasks: > =A0* Designing and implementing a sysctl that returns > =A0 network statistics as an XML blob > =A0* Designing and implementing a C library that knows > =A0 how to fetch the XML blob, parse it, and return > =A0 data to client programs. > > Does this make more sense now? > > Tim > Yes, it does, Tim, thank you so much. I'll be sure to look into sysctl.h and study its ability to return XML. I will also contact Robert about this project once I finish gathering more info. Thank you all for answering my questions. Cipta P.S. Sorry about top-posting. I'll be sure to remember it from now on.