]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make the third octet of Country String configurable
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 1 Mar 2017 08:58:15 +0000 (10:58 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 1 Mar 2017 08:58:15 +0000 (10:58 +0200)
The new hostapd.conf parameter country3 can now be used to configure the
third octet of the Country String that was previously hardcoded to ' '
(= 0x20).

For example:

All environments of the current frequency band and country (default)
country3=0x20

Outdoor environment only
country3=0x4f

Indoor environment only
country3=0x49

Noncountry entity (country_code=XX)
country3=0x58

IEEE 802.11 standard Annex E table indication: 0x01 .. 0x1f
Annex E, Table E-4 (Global operating classes)
country3=0x04

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.c
src/ap/ap_config.h

index 85c634f84a1c295329d6112b93de24ef0357bb8a..953032d5354b76f03d87368df269068ce2fd5195 100644 (file)
@@ -2138,8 +2138,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                bss->skip_inactivity_poll = atoi(pos);
        } else if (os_strcmp(buf, "country_code") == 0) {
                os_memcpy(conf->country, pos, 2);
-               /* FIX: make this configurable */
-               conf->country[2] = ' ';
+       } else if (os_strcmp(buf, "country3") == 0) {
+               conf->country[2] = strtol(pos, NULL, 16);
        } else if (os_strcmp(buf, "ieee80211d") == 0) {
                conf->ieee80211d = atoi(pos);
        } else if (os_strcmp(buf, "ieee80211h") == 0) {
index da975050db917f612f99efa161d10e0278414d01..821910c10ea0e3999610758dc32658007d36e35a 100644 (file)
@@ -98,8 +98,25 @@ ssid=test
 # Country code (ISO/IEC 3166-1). Used to set regulatory domain.
 # Set as needed to indicate country in which device is operating.
 # This can limit available channels and transmit power.
+# These two octets are used as the first two octets of the Country String
+# (dot11CountryString)
 #country_code=US
 
+# The third octet of the Country String (dot11CountryString)
+# This parameter is used to set the third octet of the country string.
+#
+# All environments of the current frequency band and country (default)
+#country3=0x20
+# Outdoor environment only
+#country3=0x4f
+# Indoor environment only
+#country3=0x49
+# Noncountry entity (country_code=XX)
+#country3=0x58
+# IEEE 802.11 standard Annex E table indication: 0x01 .. 0x1f
+# Annex E, Table E-4 (Global operating classes)
+#country3=0x04
+
 # Enable IEEE 802.11d. This advertises the country_code and the set of allowed
 # channels and transmit power levels based on the regulatory limits. The
 # country_code setting must be configured with the correct country for
index a996ea81f42f7964a482b3a8493cefc9a5c6ec91..a03c006ab76a91ade881969064ac98e2f73ac4d4 100644 (file)
@@ -206,6 +206,11 @@ struct hostapd_config * hostapd_config_defaults(void)
        conf->acs_num_scans = 5;
 #endif /* CONFIG_ACS */
 
+       /* The third octet of the country string uses an ASCII space character
+        * by default to indicate that the regulations encompass all
+        * environments for the current frequency band in the country. */
+       conf->country[2] = ' ';
+
        return conf;
 }
 
index cbdb786f55e1cc226976c4c009ef9030a31f810a..82eb0063f38ead9c5cfebbcc885669ba4142bff6 100644 (file)
@@ -679,6 +679,9 @@ struct hostapd_config {
                          * ' ' (ascii 32): all environments
                          * 'O': Outdoor environemnt only
                          * 'I': Indoor environment only
+                         * 'X': Used with noncountry entity ("XXX")
+                         * 0x00..0x31: identifying IEEE 802.11 standard
+                         *     Annex E table (0x04 = global table)
                          */
 
        int ieee80211d;