From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 16 21:32:08 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 D536B106564A for ; Mon, 16 Mar 2009 21:32:08 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.delphij.net (delphij-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:2c9::2]) by mx1.freebsd.org (Postfix) with ESMTP id 69B508FC17 for ; Mon, 16 Mar 2009 21:32:08 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.delphij.net (Postfix) with ESMTPS id C774C28448 for ; Tue, 17 Mar 2009 05:32:06 +0800 (CST) Received: from localhost (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 84BC6EC5FC0; Tue, 17 Mar 2009 05:32:05 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by localhost (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with ESMTP id B+NIBW3isU9x; Tue, 17 Mar 2009 05:31:56 +0800 (CST) Received: from charlie.delphij.net (adsl-76-237-33-62.dsl.pltn13.sbcglobal.net [76.237.33.62]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 5407AEC5FBC; Tue, 17 Mar 2009 05:31:55 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=tEO9K3GL9gX9Q5XyfiqPVsVk0qPFQcD0CxwPnfCnX3xq/gHZ97i9Kk83X/O6BR20h 0bAATuGjSba5hzH2HwDFg== Message-ID: <49BEC548.90309@delphij.net> Date: Mon, 16 Mar 2009 14:31:52 -0700 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.19 (X11/20090217) MIME-Version: 1.0 To: Cipta H References: <13b997e60903160716x21881adfma588c32551c36e6f@mail.gmail.com> <21C1FF9D-4CDA-4476-9F11-3DE281279C1A@freebsd.org> <13b997e60903161141j8faaf7frd6ce9b1423b40164@mail.gmail.com> <49BEA2BC.6000405@delphij.net> <13b997e60903161213t320252dbg56e96335e79f7eb9@mail.gmail.com> In-Reply-To: <13b997e60903161213t320252dbg56e96335e79f7eb9@mail.gmail.com> X-Enigmail-Version: 0.95.7 OpenPGP: id=18EDEBA0; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, d@delphij.net Subject: Re: writing libnetstat for Summer of Code 2009 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net 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 21:32:09 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Cipta, 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 live > 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. Yes it's the markup language. I think whether or not to use XML really depends on whether you want structured data. The current approach we have used is to use kvm(3) and obtain the data directly based on knowledge of in-kernel data structure. By using XML, the structured data can be represented in a self-explaining form and known data can be easily extracted from it (of course you will need to design a schema for the data but that's fairly easy once you know what you are willing to expose). Note that you may want to contact Robert to better understand the problem that the libnetstat and friends is targeted to solve. XML is one possible approach (and we have a built-in XML parser library that can be used by userland programs) but it's not the only possible approach :) > 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)? Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) iEYEARECAAYFAkm+xUcACgkQi+vbBBjt66AGRwCgpN1jErbevmhllKqlQgYxuWZt 07AAn1iycaHQCrC74h/RHkokFyBdD9RD =QUDy -----END PGP SIGNATURE-----