From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1IlMh0-0004I8-TU for garchives@archives.gentoo.org; Fri, 26 Oct 2007 10:45:31 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.1/8.14.0) with SMTP id l9QAiebI000352; Fri, 26 Oct 2007 10:44:40 GMT Received: from mail.marples.name (rsm.demon.co.uk [80.177.111.50]) by robin.gentoo.org (8.14.1/8.14.0) with ESMTP id l9QAgmWn030331 for ; Fri, 26 Oct 2007 10:42:48 GMT Received: from [10.73.1.31] (uberlaptop.marples.name [10.73.1.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.marples.name (Postfix) with ESMTP id 859901900FF for ; Fri, 26 Oct 2007 11:42:47 +0100 (BST) Subject: Re: [gentoo-dev] Opinions Wanted - Arrays again :) From: Roy Marples To: gentoo-dev@lists.gentoo.org In-Reply-To: <4721BE92.4070200@thefreemanclan.net> References: <1193326831.4245.16.camel@uberlaptop.marples.name> <20071025213113.GJ29642@supernova> <1193348959.2910.9.camel@uberpc.marples.name> <20071025225641.GK29642@supernova> <1193380105.2913.1.camel@uberpc.marples.name> <4721BE92.4070200@thefreemanclan.net> Content-Type: text/plain Organization: Gentoo Date: Fri, 26 Oct 2007 11:42:46 +0100 Message-Id: <1193395366.4312.14.camel@uberlaptop.marples.name> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 7bit X-Archives-Salt: 76875db6-a56c-4a52-ba63-57957d171c35 X-Archives-Hash: ef7a2dbe4e0c6e68b1dd63dba10a378e On Fri, 2007-10-26 at 06:16 -0400, Richard Freeman wrote: > If there is some problem with this suggestion feel free to shoot it full > of holes, but how about something like: > > address_eth0="1.2.3.4" > netmask_eth0="255.255.255.0" > broadcast_eth0="1.2.3.255" > gateway_eth0="1.2.3.1" > network_eth0="1.2.3.0" > hostname_eth0="mypc" > options_eth0="bells and whistles" How would you construct that if you wanted to add 5 addresses to the interface? > Without digging through the original source I'm not sure what everything > else in that array is, but I think you get the picture. Instead of > sticking all these parameters into a big array why not break them down > into what they actually are used for? This should also make the code > that actually reads back these variables a lot more readable - instead > of wondering what the 5th field in the array is you would see something > meaningful like "netmask". We don't care what the actual options or values are, they are merely passed to ifconfig. Basically we need the equivalent of doing this ifconfig eth0 1.2.3.4 netmask 5.6.7.8 broadcast 1.2.3.4 ifconfig eth0 5.6.7.8 netmask 1.2.3.4 broadcast 5.6.7.8 ifconfig eth0 maybe some undocumented command And we do this with a few other tools as well. Lets take a list of preferred wireless AP's to connect to. How would you have that? As the only invalid character in an SSID is a NULL (daft, but I didn't write the specification) Thanks Roy -- gentoo-dev@gentoo.org mailing list