aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-01-11 04:04:56 (GMT)
committerJouni Malinen <j@w1.fi>2008-01-11 04:04:56 (GMT)
commit95ee364c63f7fde8a03cf87d5913523f53187e54 (patch)
treef0f5eb802b287fa2a38e18ec34b4f2b2bd170ad6 /hostapd
parent55b295fa4cb05422203ef3422dd22c758826a741 (diff)
downloadhostap-history-95ee364c63f7fde8a03cf87d5913523f53187e54.zip
hostap-history-95ee364c63f7fde8a03cf87d5913523f53187e54.tar.gz
hostap-history-95ee364c63f7fde8a03cf87d5913523f53187e54.tar.bz2
WPS: Allow device information to be configured in hostapd.conf
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config.c26
-rw-r--r--hostapd/config.h8
-rw-r--r--hostapd/hostapd.conf41
-rw-r--r--hostapd/wps_hostapd.c17
4 files changed, 92 insertions, 0 deletions
diff --git a/hostapd/config.c b/hostapd/config.c
index ca6a107..0ce05c8 100644
--- a/hostapd/config.c
+++ b/hostapd/config.c
@@ -1944,6 +1944,25 @@ struct hostapd_config * hostapd_config_read(const char *fname)
}
} else if (os_strcmp(buf, "wps_pin_requests") == 0) {
bss->wps_pin_requests = os_strdup(pos);
+ } else if (os_strcmp(buf, "device_name") == 0) {
+ bss->device_name = os_strdup(pos);
+ } else if (os_strcmp(buf, "manufacturer") == 0) {
+ bss->manufacturer = os_strdup(pos);
+ } else if (os_strcmp(buf, "model_name") == 0) {
+ bss->model_name = os_strdup(pos);
+ } else if (os_strcmp(buf, "model_number") == 0) {
+ bss->model_number = os_strdup(pos);
+ } else if (os_strcmp(buf, "serial_number") == 0) {
+ bss->serial_number = os_strdup(pos);
+ } else if (os_strcmp(buf, "device_type") == 0) {
+ bss->device_type = os_strdup(pos);
+ } else if (os_strcmp(buf, "config_methods") == 0) {
+ bss->config_methods = os_strdup(pos);
+ } else if (os_strcmp(buf, "os_version") == 0) {
+ if (hexstr2bin(pos, bss->os_version, 4)) {
+ printf("Line %d: invalid os_version\n", line);
+ errors++;
+ }
#endif /* CONFIG_WPS */
} else {
printf("Line %d: unknown configuration item '%s'\n",
@@ -2140,6 +2159,13 @@ static void hostapd_config_free_bss(struct hostapd_bss_config *conf)
#ifdef CONFIG_WPS
os_free(conf->wps_pin_requests);
+ os_free(conf->device_name);
+ os_free(conf->manufacturer);
+ os_free(conf->model_name);
+ os_free(conf->model_number);
+ os_free(conf->serial_number);
+ os_free(conf->device_type);
+ os_free(conf->config_methods);
#endif /* CONFIG_WPS */
}
diff --git a/hostapd/config.h b/hostapd/config.h
index 2d4a496..0fb730b 100644
--- a/hostapd/config.h
+++ b/hostapd/config.h
@@ -268,6 +268,14 @@ struct hostapd_bss_config {
int ap_setup_locked;
u8 uuid[16];
char *wps_pin_requests;
+ char *device_name;
+ char *manufacturer;
+ char *model_name;
+ char *model_number;
+ char *serial_number;
+ char *device_type;
+ char *config_methods;
+ u8 os_version[4];
#endif /* CONFIG_WPS */
};
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index a0ba216..e871b13 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -792,6 +792,47 @@ own_ip_addr=127.0.0.1
# be written to the configured file.
#wps_pin_requests=/var/run/hostapd_wps_pin_requests
+# Device Name
+# User-friendly description of device; up to 32 octets encoded in UTF-8
+#device_name=Wireless AP
+
+# Manufacturer
+# The manufacturer of the device (up to 64 ASCII characters)
+#manufacturer=Company
+
+# Model Name
+# Model of the device (up to 32 ASCII characters)
+#model_name=WAP
+
+# Model Number
+# Additional device description (up to 32 ASCII characters)
+#model_number=123
+
+# Serial Number
+# Serial number of the device (up to 32 characters)
+#serial_number=12345
+
+# Primary Device Type
+# Used format: <categ>-<OUI>-<subcateg>
+# categ = Category as an integer value
+# OUI = OUI and type octet as a 4-octet hex-encoded value; 0050F204 for
+# default WPS OUI
+# subcateg = OUI-specific Sub Category as an integer value
+# Examples:
+# 1-0050F204-1 (Computer / PC)
+# 1-0050F204-2 (Computer / Server)
+# 5-0050F204-1 (Storage / NAS)
+# 6-0050F204-1 (Network Infrastructure / AP)
+#device_type=6-0050F204-1
+
+# OS Version
+# 4-octet operating system version number (hex string)
+#os_version=01020300
+
+# Config Methods
+# List of the supported configuration methods
+#config_methods=label display push_button keypad
+
# Multiple BSSID support
#
diff --git a/hostapd/wps_hostapd.c b/hostapd/wps_hostapd.c
index 916ddb4..ee9e779 100644
--- a/hostapd/wps_hostapd.c
+++ b/hostapd/wps_hostapd.c
@@ -172,6 +172,23 @@ int hostapd_init_wps(struct hostapd_data *hapd,
cfg.uuid = hapd->conf->uuid;
cfg.ssid = (const u8 *) hapd->conf->ssid.ssid;
cfg.ssid_len = hapd->conf->ssid.ssid_len;
+ cfg.device_name = hapd->conf->device_name;
+ cfg.manufacturer = hapd->conf->manufacturer;
+ cfg.model_name = hapd->conf->model_name;
+ cfg.model_number = hapd->conf->model_number;
+ cfg.serial_number = hapd->conf->serial_number;
+ if (hapd->conf->config_methods) {
+ char *m = hapd->conf->config_methods;
+ if (os_strstr(m, "label"))
+ cfg.config_methods |= WPS_CONFIG_LABEL;
+ if (os_strstr(m, "display"))
+ cfg.config_methods |= WPS_CONFIG_DISPLAY;
+ if (os_strstr(m, "push_button"))
+ cfg.config_methods |= WPS_CONFIG_PUSHBUTTON;
+ if (os_strstr(m, "keypad"))
+ cfg.config_methods |= WPS_CONFIG_KEYPAD;
+ }
+ cfg.os_version = WPA_GET_BE32(hapd->conf->os_version);
if (conf->wpa & WPA_PROTO_RSN) {
if (conf->wpa_key_mgmt & WPA_KEY_MGMT_PSK)