From owner-freebsd-wireless@FreeBSD.ORG Sun Apr 17 14:05:58 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1B91106564A for ; Sun, 17 Apr 2011 14:05:58 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 533AD8FC18 for ; Sun, 17 Apr 2011 14:05:57 +0000 (UTC) Received: by bwz12 with SMTP id 12so4397881bwz.13 for ; Sun, 17 Apr 2011 07:05:57 -0700 (PDT) Received: by 10.204.19.74 with SMTP id z10mr3386815bka.183.1303049156954; Sun, 17 Apr 2011 07:05:56 -0700 (PDT) Received: from amy.lab.techwires.net (dslb-088-065-057-126.pools.arcor-ip.net [88.65.57.126]) by mx.google.com with ESMTPS id w3sm2609631bkt.17.2011.04.17.07.05.54 (version=SSLv3 cipher=OTHER); Sun, 17 Apr 2011 07:05:55 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: Adrian Chadd Date: Sun, 17 Apr 2011 16:05:58 +0200 User-Agent: KMail/1.13.6 (FreeBSD/8.2-STABLE; KDE/4.6.2; amd64; ; ) References: <201104170909.44508.bschmidt@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201104171605.59340.bschmidt@freebsd.org> Cc: freebsd-wireless@freebsd.org Subject: Re: RFC: supporting multiple hostap instances in /etc/rc.conf X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Apr 2011 14:05:58 -0000 On Sunday 17 April 2011 15:25:55 Adrian Chadd wrote: > On 17 April 2011 15:09, Bernhard Schmidt wrote: > > > > Given that hostapd needs to be started with a configuration file as an > > argument and not an interface like wpa_supplicant you need to add a way > > to add multiple configuration files. The conf_file variable is > > currently hard-coded to /etc/hostapd.conf, if you add another one like > > hostapd_conf_files="" and iterate over it, that should do the trick. > > > > But I'm not sure how to handle the pidfile, or how to name it.. > > > > I was thinking of say: > > hostapd_instances="a b c" > hostapd_a_conf="/etc/hostapd.wlan0.conf" > hostapd_a_flags="-B -p /var/run/hostapd.wlan0.pid" > hostapd_a_cmd="/usr/sbin/hostapd" > > hostapd_b_conf="/etc/hostapd.wlan1.conf" > hostapd_b_flags="-B -p /var/run/hostapd.wlan1.pid" > hostapd_b_cmd="/usr/sbin/hostapd" > > It's not terribly automagic, but it'll work well enough to run multiple > hostapds. > > How's that sound? Way to complex for my taste :) How about hostapd_enable="YES" hostapd_interfaces="wlan0 wlan1 .." # defaults to empty and then if [ -n $hostapd_interfaces ]; then for interface in $interface; do pidfile=/var/run/hostapd/$interface.pid conffile=/etc/hostapd-$interface.conf .. done else pidfile=/var/run/hostapd.pid conffile=/etc/hostapd.conf fi -- Bernhard