From patchwork Sat Jul 7 08:52:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/4] add configure option to set vlan naming scheme Date: Fri, 06 Jul 2012 22:52:06 -0000 From: michael-dev@fami-braun.de X-Patchwork-Id: 169566 Message-Id: <20120707085206.24229.63787.stgit@localhost6.localdomain6> To: projekt-wlan@fem.tu-ilmenau.de, hostap@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 eebbaa6..65f4c4a 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -2120,6 +2120,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 494f7ca..30b9bc9 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -796,6 +796,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 ca4fe58..87b0984 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 */