From patchwork Thu Aug 9 09:55:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 176039 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0132F2C00CF for ; Thu, 9 Aug 2012 19:55:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 7F7899C20E; Thu, 9 Aug 2012 05:55:15 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8hbC99urekIc; Thu, 9 Aug 2012 05:55:15 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4538D9C234; Thu, 9 Aug 2012 05:55:07 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C60FB9C234 for ; Thu, 9 Aug 2012 05:55:05 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lkQsiJrEdyvk for ; Thu, 9 Aug 2012 05:55:02 -0400 (EDT) Received: from a251.fem.tu-ilmenau.de (gast-001.fem.tu-ilmenau.de [141.24.44.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 187439C20E for ; Thu, 9 Aug 2012 05:55:02 -0400 (EDT) Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by konsullaptop.a-keller (Postfix) with ESMTP id 9FDFC22156A; Thu, 9 Aug 2012 11:55:01 +0200 (CEST) Subject: [PATCH v2 1/4] add configure option to set vlan naming scheme To: hostap@lists.shmoo.com From: Michael Braun Date: Thu, 09 Aug 2012 11:55:01 +0200 Message-ID: <20120809095501.14256.94045.stgit@localhost6.localdomain6> In-Reply-To: <20120809095325.14256.38207.stgit@localhost6.localdomain6> References: <20120809095325.14256.38207.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 Cc: projekt-wlan@fem.tu-ilmenau.de X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com --- hostapd/config_file.c | 9 +++++++++ hostapd/hostapd.conf | 6 ++++++ src/ap/ap_config.h | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index 03f29ad..b5315a5 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2133,6 +2133,15 @@ static int hostapd_config_fill(struct hostapd_config *conf, "read VLAN file '%s'", line, pos); errors++; } + } else if (os_strcmp(buf, "vlan_naming") == 0) { + bss->ssid.vlan_naming = atoi(pos); + if (bss->ssid.vlan_naming >= DYNAMIC_VLAN_NAMING_END + || bss->ssid.vlan_naming < 0) { + wpa_printf(MSG_ERROR, "Line %d: invalid naming " + "scheme %d", line, + bss->ssid.vlan_naming); + errors++; + } #ifdef CONFIG_FULL_DYNAMIC_VLAN } else if (os_strcmp(buf, "vlan_tagged_interface") == 0) { bss->ssid.vlan_tagged_interface = os_strdup(pos); diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index 7e4e5d2..1ffdf8a 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -801,6 +801,12 @@ own_ip_addr=127.0.0.1 # to the bridge. #vlan_tagged_interface=eth0 +# When hostapd creates a vlan interface on vlan_tagged_interfaces, it needs +# to know how name it. +# 0 = vlan, e.g. vlan1 +# 1 = ., e.g. eth0.1 +#vlan_naming=0 + # Arbitrary RADIUS attributes can be added into Access-Request and # Accounting-Request packets by specifying the contents of the attributes with # the following configuration parameters. There can be multiple of these to diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index bfb2d8a..9a546ee 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -65,6 +65,10 @@ struct hostapd_ssid { #define DYNAMIC_VLAN_OPTIONAL 1 #define DYNAMIC_VLAN_REQUIRED 2 int dynamic_vlan; +#define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0 +#define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1 +#define DYNAMIC_VLAN_NAMING_END 2 + int vlan_naming; #ifdef CONFIG_FULL_DYNAMIC_VLAN char *vlan_tagged_interface; #endif /* CONFIG_FULL_DYNAMIC_VLAN */