aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorTerry Burton <tez@terryburton.co.uk>2019-07-21 12:05:56 (GMT)
committerJouni Malinen <j@w1.fi>2019-07-30 16:58:09 (GMT)
commitf4111ff3d1f19d219f3818f72cbfab80da10754a (patch)
tree722314a9f298cbe01473ab34c1d86847bd1e0dfd /hostapd
parent74707def8f1b8cdb1755f4f5698bb52b9c8a5442 (diff)
downloadhostap-f4111ff3d1f19d219f3818f72cbfab80da10754a.zip
hostap-f4111ff3d1f19d219f3818f72cbfab80da10754a.tar.gz
hostap-f4111ff3d1f19d219f3818f72cbfab80da10754a.tar.bz2
Extra RADIUS request attributes from SQLite
Add an SQLite table for defining per station MAC address version of radius_auth_req_attr/radius_acct_req_attr information. Create the necessary table and index where this doesn't exist. Select attributes from the table keyed by station MAC address and request type (auth or acct), parse and apply to a RADIUS message. Add radius_req_attr_sqlite hostapd config option for SQLite database file. Open/close RADIUS attribute database for a lifetime of a BSS and invoke functions to add extra attributes during RADIUS auth and accounting request generation. Signed-off-by: Terry Burton <tez@terryburton.co.uk>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c3
-rw-r--r--hostapd/hostapd.conf11
2 files changed, 14 insertions, 0 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 29ea92e..1f2c565 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2832,6 +2832,9 @@ static int hostapd_config_fill(struct hostapd_config *conf,
a = a->next;
a->next = attr;
}
+ } else if (os_strcmp(buf, "radius_req_attr_sqlite") == 0) {
+ os_free(bss->radius_req_attr_sqlite);
+ bss->radius_req_attr_sqlite = os_strdup(pos);
} else if (os_strcmp(buf, "radius_das_port") == 0) {
bss->radius_das_port = atoi(pos);
} else if (os_strcmp(buf, "radius_das_client") == 0) {
diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf
index f2d5873..5138aee 100644
--- a/hostapd/hostapd.conf
+++ b/hostapd/hostapd.conf
@@ -1384,6 +1384,17 @@ own_ip_addr=127.0.0.1
# Operator-Name = "Operator"
#radius_acct_req_attr=126:s:Operator
+# If SQLite support is included, path to a database from which additional
+# RADIUS request attributes are extracted based on the station MAC address.
+#
+# The schema for the radius_attributes table is:
+# id | sta | reqtype | attr : multi-key (sta, reqtype)
+# id = autonumber
+# sta = station MAC address in `11:22:33:44:55:66` format.
+# type = `auth` | `acct` | NULL (match any)
+# attr = existing config file format, e.g. `126:s:Test Operator`
+#radius_req_attr_sqlite=radius_attr.sqlite
+
# Dynamic Authorization Extensions (RFC 5176)
# This mechanism can be used to allow dynamic changes to user session based on
# commands from a RADIUS server (or some other disconnect client that has the