mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-11-01 19:07:47 +00:00
opensync: passpoint config
- Add support for configuring Passpoint parameters - Add support for configuring RADIUS accounting parameters Signed-off-by: Arif Alam <arif.alam@connectus.ai>
This commit is contained in:
@@ -109,7 +109,7 @@ ifeq ($(SSL_VARIANT),openssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_HS20=y CONFIG_INTERWORKING=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),hs20)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_DPP=y CONFIG_HS20=y CONFIG_INTERWORKING=y
|
||||
|
||||
@@ -282,8 +282,19 @@ hostapd_common_add_bss_config() {
|
||||
config_add_array osu_provider
|
||||
config_add_array operator_icon
|
||||
config_add_array hs20_conn_capab
|
||||
config_add_array roaming_consortium
|
||||
config_add_array venue_name
|
||||
config_add_array venue_url
|
||||
config_add_array domain_name
|
||||
config_add_array nai_realm
|
||||
config_add_string osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp
|
||||
|
||||
config_add_boolean interworking internet
|
||||
config_add_int access_network_type asra esr uesa venue_group venue_type ipaddr_type_availability \
|
||||
gas_address3
|
||||
config_add_string hessid network_auth_type \
|
||||
anqp_3gpp_cell_net anqp_elem qos_map_set hs20_t_c_server_url
|
||||
|
||||
config_add_int airtime_bss_weight airtime_bss_limit
|
||||
config_add_int rts_threshold
|
||||
}
|
||||
@@ -321,12 +332,32 @@ hostapd_set_psk() {
|
||||
for_each_station hostapd_set_psk_file ${ifname}
|
||||
}
|
||||
|
||||
append_roaming_consortium() {
|
||||
[ -n "$1" ] && append bss_conf "roaming_consortium=$1" "$N"
|
||||
}
|
||||
|
||||
append_venue_name() {
|
||||
[ -n "$1" ] && append bss_conf "venue_name=$1" "$N"
|
||||
}
|
||||
|
||||
append_venue_url() {
|
||||
[ -n "$1" ] && append bss_conf "venue_url=$1" "$N"
|
||||
}
|
||||
|
||||
append_domain_name() {
|
||||
[ -n "$1" ] && append bss_conf "domain_name=$1" "$N"
|
||||
}
|
||||
|
||||
append_nai_realm() {
|
||||
[ -n "$1" ] && append bss_conf "nai_realm=$1" "$N"
|
||||
}
|
||||
|
||||
append_hs20_oper_friendly_name() {
|
||||
append bss_conf "hs20_oper_friendly_name=$1" "$N"
|
||||
[ -n "$1" ] && append bss_conf "hs20_oper_friendly_name=$1" "$N"
|
||||
}
|
||||
|
||||
append_osu_provider_service_desc() {
|
||||
append bss_conf "osu_service_desc=$1" "$N"
|
||||
[ -n "$1" ] && append bss_conf "osu_service_desc=$1" "$N"
|
||||
}
|
||||
|
||||
append_hs20_icon() {
|
||||
@@ -346,15 +377,15 @@ append_hs20_icons() {
|
||||
}
|
||||
|
||||
append_operator_icon() {
|
||||
append bss_conf "operator_icon=$1" "$N"
|
||||
[ -n "$1" ] append bss_conf "operator_icon=$1" "$N"
|
||||
}
|
||||
|
||||
append_osu_icon() {
|
||||
append bss_conf "osu_icon=$1" "$N"
|
||||
[ -n "$1" ] append bss_conf "osu_icon=$1" "$N"
|
||||
}
|
||||
|
||||
append_osu_provider() {
|
||||
local cfgtype osu_server_uri osu_friendly_name osu_nai osu_nai2 osu_method_list
|
||||
local cfgtype osu_server_uri osu_nai osu_nai2 osu_method_list
|
||||
|
||||
config_load wireless
|
||||
config_get cfgtype "$1" TYPE
|
||||
@@ -366,12 +397,13 @@ append_osu_provider() {
|
||||
config_get osu_nai2 "$1" osu_nai2
|
||||
config_get osu_method_list "$1" osu_method
|
||||
|
||||
append bss_conf "osu_server_uri=$osu_server_uri" "$N"
|
||||
append bss_conf "osu_nai=$osu_nai" "$N"
|
||||
append bss_conf "osu_nai2=$osu_nai2" "$N"
|
||||
append bss_conf "osu_method_list=$osu_method_list" "$N"
|
||||
[ -n "$osu_server_uri" ] append bss_conf "osu_server_uri=$osu_server_uri" "$N"
|
||||
[ -n "$osu_nai" ] append bss_conf "osu_nai=$osu_nai" "$N"
|
||||
[ -n "$osu_nai2" ] append bss_conf "osu_nai2=$osu_nai2" "$N"
|
||||
[ -n "$osu_method_list" ] append bss_conf "osu_method_list=$osu_method_list" "$N"
|
||||
|
||||
config_list_foreach "$1" osu_service_desc append_osu_provider_service_desc
|
||||
config_list_foreach "$1" osu_friendly_name append_osu_friendly_name
|
||||
config_list_foreach "$1" osu_icon append_osu_icon
|
||||
|
||||
append bss_conf "$N"
|
||||
@@ -799,9 +831,17 @@ hostapd_set_bss_options() {
|
||||
}
|
||||
|
||||
local hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \
|
||||
osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp
|
||||
osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp \
|
||||
interworking internet access_network_type asra esr uesa venue_group venue_type \
|
||||
ipaddr_type_availability gas_address3 hessid \
|
||||
network_auth_type anqp_3gpp_cell_net anqp_elem qos_map_set \
|
||||
hs20_t_c_server_url
|
||||
json_get_vars hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \
|
||||
osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp
|
||||
osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp \
|
||||
interworking internet access_network_type asra esr uesa venue_group venue_type \
|
||||
ipaddr_type_availability gas_address3 hessid \
|
||||
network_auth_type anqp_3gpp_cell_net anqp_elem qos_map_set \
|
||||
hs20_t_c_server_url
|
||||
|
||||
set_default hs20 0
|
||||
set_default disable_dgaf $hs20
|
||||
@@ -810,20 +850,42 @@ hostapd_set_bss_options() {
|
||||
set_default hs20_deauth_req_timeout 60
|
||||
if [ "$hs20" = "1" ]; then
|
||||
append bss_conf "hs20=1" "$N"
|
||||
append_hs20_icons
|
||||
append bss_conf "disable_dgaf=$disable_dgaf" "$N"
|
||||
append bss_conf "osen=$osen" "$N"
|
||||
append bss_conf "anqp_domain_id=$anqp_domain_id" "$N"
|
||||
append bss_conf "hs20_deauth_req_timeout=$hs20_deauth_req_timeout" "$N"
|
||||
[ -n "$disable_dgaf"] && append bss_conf "disable_dgaf=$disable_dgaf" "$N"
|
||||
[ -n "$osen"] && append bss_conf "osen=$osen" "$N"
|
||||
[ -n "$anqp_domain_id"] && append bss_conf "anqp_domain_id=$anqp_domain_id" "$N"
|
||||
[ -n "$hs20_deauth_req_timeout"] && append bss_conf "hs20_deauth_req_timeout=$hs20_deauth_req_timeout" "$N"
|
||||
[ -n "$osu_ssid" ] && append bss_conf "osu_ssid=$osu_ssid" "$N"
|
||||
[ -n "$hs20_wan_metrics" ] && append bss_conf "hs20_wan_metrics=$hs20_wan_metrics" "$N"
|
||||
[ -n "$hs20_operating_class" ] && append bss_conf "hs20_operating_class=$hs20_operating_class" "$N"
|
||||
[ -n "$hs20_t_c_filename" ] && append bss_conf "hs20_t_c_filename=$hs20_t_c_filename" "$N"
|
||||
[ -n "$hs20_t_c_timestamp" ] && append bss_conf "hs20_t_c_timestamp=$hs20_t_c_timestamp" "$N"
|
||||
json_for_each_item append_hs20_oper_friendly_name hs20_oper_friendly_name
|
||||
json_for_each_item append_roaming_consortium roaming_consortium
|
||||
json_for_each_item append_venue_name venue_name
|
||||
json_for_each_item append_venue_url venue_url
|
||||
json_for_each_item append_domain_name domain_name
|
||||
json_for_each_item append_nai_realm nai_realm
|
||||
json_for_each_item append_hs20_conn_capab hs20_conn_capab
|
||||
json_for_each_item append_hs20_oper_friendly_name hs20_oper_friendly_name
|
||||
json_for_each_item append_osu_provider osu_provider
|
||||
json_for_each_item append_operator_icon operator_icon
|
||||
[ -n "$interworking" ] && append bss_conf "interworking=$interworking" "$N"
|
||||
[ -n "$internet" ] && append bss_conf "internet=$internet" "$N"
|
||||
[ -n "$access_network_type" ] && append bss_conf "access_network_type=$access_network_type" "$N"
|
||||
[ -n "$asra" ] && append bss_conf "asra=$asra" "$N"
|
||||
[ -n "$esr" ] && append bss_conf "esr=$esr" "$N"
|
||||
[ -n "$uesa" ] && append bss_conf "uesa=$uesa" "$N"
|
||||
[ -n "$venue_group" ] && append bss_conf "venue_group=$venue_group" "$N"
|
||||
[ -n "$venue_type" ] && append bss_conf "venue_type=$venue_type" "$N"
|
||||
[ -n "$ipaddr_type_availability" ] && append bss_conf "ipaddr_type_availability=$ipaddr_type_availability" "$N"
|
||||
[ -n "$gas_address3" ] && append bss_conf "gas_address3=$gas_address3" "$N"
|
||||
[ -n "$hessid" ] && append bss_conf "hessid=$hessid" "$N"
|
||||
[ -n "$network_auth_type" ] && append bss_conf "network_auth_type=$network_auth_type" "$N"
|
||||
[ -n "$anqp_3gpp_cell_net" ] && append bss_conf "anqp_3gpp_cell_net=$anqp_3gpp_cell_net" "$N"
|
||||
[ -n "$nai_realm" ] && append bss_conf "nai_realm=$nai_realm" "$N"
|
||||
[ -n "$anqp_elem" ] && append bss_conf "anqp_elem=$anqp_elem" "$N"
|
||||
[ -n "$qos_map_set" ] && append bss_conf "qos_map_set=$qos_map_set" "$N"
|
||||
[ -n "$hs20_t_c_server_url" ] && append bss_conf "hs20_t_c_server_url=$hs20_t_c_server_url" "$N"
|
||||
fi
|
||||
|
||||
bss_md5sum=$(echo $bss_conf | md5sum | cut -d" " -f1)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/interfaces/opensync.ovsschema
|
||||
+++ b/interfaces/opensync.ovsschema
|
||||
@@ -8825,6 +8825,361 @@
|
||||
@@ -8828,6 +8828,433 @@
|
||||
}
|
||||
},
|
||||
"isRoot": true
|
||||
@@ -60,15 +60,6 @@
|
||||
+ "min": 0,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "path": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1,
|
||||
+ "maxLength": 32
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ "isRoot": true
|
||||
@@ -253,10 +244,72 @@
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ "wan_metrics": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "string",
|
||||
+ "maxLength": 128
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ "qos_map_set": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "string",
|
||||
+ "maxLength": 128
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ "internet": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "asra": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "esr": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "uesa": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "disable_dgaf": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "osu_ssid": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "string"
|
||||
+ "type": "string",
|
||||
+ "maxLength": 36
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
@@ -276,7 +329,7 @@
|
||||
+ "key": {
|
||||
+ "type": "uuid",
|
||||
+ "refTable": "Wifi_VIF_Config",
|
||||
+ "refType": "weak"
|
||||
+ "refType" : "weak"
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": "unlimited"
|
||||
@@ -298,6 +351,15 @@
|
||||
+ },
|
||||
+ "Hotspot20_OSU_Providers": {
|
||||
+ "columns": {
|
||||
+ "osu_provider_name": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "string"
|
||||
+ },
|
||||
+ "min": 1,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "server_uri": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
@@ -324,7 +386,17 @@
|
||||
+ "maxLength": 256
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": 32
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "osu_nai2": {
|
||||
+ "type": {
|
||||
+ "key": {
|
||||
+ "type": "string",
|
||||
+ "maxLength": 256
|
||||
+ },
|
||||
+ "min": 0,
|
||||
+ "max": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "method_list": {
|
||||
|
||||
@@ -19,9 +19,13 @@
|
||||
#define OVSDB_SECURITY_RADIUS_SERVER_IP "radius_server_ip"
|
||||
#define OVSDB_SECURITY_RADIUS_SERVER_PORT "radius_server_port"
|
||||
#define OVSDB_SECURITY_RADIUS_SERVER_SECRET "radius_server_secret"
|
||||
#define OVSDB_SECURITY_RADIUS_ACCT_IP "radius_acct_ip"
|
||||
#define OVSDB_SECURITY_RADIUS_ACCT_PORT "radius_acct_port"
|
||||
#define OVSDB_SECURITY_RADIUS_ACCT_SECRET "radius_acct_secret"
|
||||
|
||||
|
||||
bool vif_get_security(struct schema_Wifi_VIF_State *vstate, char *mode, char *encryption, char *radiusServerIP, char *password, char *port);
|
||||
extern bool vif_state_update(struct uci_section *s, struct schema_Wifi_VIF_Config *vconf);
|
||||
void vif_hs20_update(struct schema_Hotspot20_Config *hs2conf);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
#include "utils.h"
|
||||
#include "captive.h"
|
||||
|
||||
ovsdb_table_t table_Hotspot20_Config;
|
||||
ovsdb_table_t table_Hotspot20_OSU_Providers;
|
||||
|
||||
static struct uci_package *wireless;
|
||||
struct uci_context *uci;
|
||||
struct blob_buf b = { };
|
||||
@@ -452,6 +455,13 @@ void radio_maverick(void *arg)
|
||||
uci_unload(uci, wireless);
|
||||
}
|
||||
|
||||
static void callback_Hotspot20_Config(ovsdb_update_monitor_t *mon,
|
||||
struct schema_Hotspot20_Config *old,
|
||||
struct schema_Hotspot20_Config *conf)
|
||||
{
|
||||
vif_hs20_update(conf);
|
||||
}
|
||||
|
||||
bool target_radio_init(const struct target_radio_ops *ops)
|
||||
{
|
||||
uci = uci_alloc_context();
|
||||
@@ -465,6 +475,11 @@ bool target_radio_init(const struct target_radio_ops *ops)
|
||||
|
||||
radio_ops = ops;
|
||||
|
||||
OVSDB_TABLE_INIT(Hotspot20_Config, _uuid);
|
||||
OVSDB_TABLE_MONITOR(Hotspot20_Config, false);
|
||||
|
||||
OVSDB_TABLE_INIT(Hotspot20_OSU_Providers, _uuid);
|
||||
|
||||
evsched_task(&periodic_task, NULL, EVSCHED_SEC(5));
|
||||
|
||||
radio_nl80211_init();
|
||||
|
||||
@@ -22,10 +22,16 @@
|
||||
#include "utils.h"
|
||||
#include "phy.h"
|
||||
#include "captive.h"
|
||||
#include "ovsdb_table.h"
|
||||
#include "ovsdb_sync.h"
|
||||
|
||||
#define MODULE_ID LOG_MODULE_ID_VIF
|
||||
#define UCI_BUFFER_SIZE 80
|
||||
|
||||
extern ovsdb_table_t table_Hotspot20_Config;
|
||||
extern ovsdb_table_t table_Hotspot20_OSU_Providers;
|
||||
extern ovsdb_table_t table_Wifi_VIF_Config;
|
||||
|
||||
extern struct blob_buf b;
|
||||
|
||||
enum {
|
||||
@@ -42,9 +48,12 @@ enum {
|
||||
WIF_ATTR_HIDDEN,
|
||||
WIF_ATTR_ISOLATE,
|
||||
WIF_ATTR_NETWORK,
|
||||
WIF_ATTR_SERVER,
|
||||
WIF_ATTR_PORT,
|
||||
WIF_ATTR_AUTH_SERVER,
|
||||
WIF_ATTR_AUTH_PORT,
|
||||
WIF_ATTR_AUTH_SECRET,
|
||||
WIF_ATTR_ACCT_SERVER,
|
||||
WIF_ATTR_ACCT_PORT,
|
||||
WIF_ATTR_ACCT_SECRET,
|
||||
WIF_ATTR_IEEE80211R,
|
||||
WIF_ATTR_IEEE80211W,
|
||||
WIF_ATTR_MOBILITY_DOMAIN,
|
||||
@@ -66,6 +75,31 @@ enum {
|
||||
WIF_ATTR_IEEE80211K,
|
||||
WIF_ATTR_RTS_THRESHOLD,
|
||||
WIF_ATTR_DTIM_PERIOD,
|
||||
WIF_ATTR_INTERWORKING,
|
||||
WIF_ATTR_HS20,
|
||||
WIF_ATTR_HESSID,
|
||||
WIF_ATTR_ROAMING_CONSORTIUM,
|
||||
WIF_ATTR_VENUE_NAME,
|
||||
WIF_ATTR_VENUE_GROUP,
|
||||
WIF_ATTR_VENUE_TYPE,
|
||||
WIF_ATTR_VENUE_URL,
|
||||
WIF_ATTR_NETWORK_AUTH_TYPE,
|
||||
WIF_ATTR_IPADDR_TYPE_AVAILABILITY,
|
||||
WIF_ATTR_DOMAIN_NAME,
|
||||
WIF_ATTR_MCC_MNC,
|
||||
WIF_ATTR_NAI_REALM,
|
||||
WIF_ATTR_GAS_ADDR3,
|
||||
WIF_ATTR_OSEN,
|
||||
WIF_ATTR_ANQP_DOMAIN_ID,
|
||||
WIF_ATTR_DEAUTH_REQUEST_TIMEOUT,
|
||||
WIF_ATTR_OPER_FRIENDLY_NAME,
|
||||
WIF_ATTR_OPERATING_CLASS,
|
||||
WIF_ATTR_OSU_FRIENDLY_NAME,
|
||||
WIF_ATTR_OSU_SERVICE_DESCRIPTION,
|
||||
WIF_ATTR_OSU_NAI,
|
||||
WIF_ATTR_OSU_NAI2,
|
||||
WIF_ATTR_OSU_SERVER_URI,
|
||||
WIF_ATTR_OSU_METHOD_LIST,
|
||||
__WIF_ATTR_MAX,
|
||||
};
|
||||
|
||||
@@ -83,9 +117,12 @@ static const struct blobmsg_policy wifi_iface_policy[__WIF_ATTR_MAX] = {
|
||||
[WIF_ATTR_HIDDEN] = { .name = "hidden", .type = BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_ISOLATE] = { .name = "isolate", .type = BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_NETWORK] = { .name = "network", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_SERVER] = { .name = "server", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_PORT] = { .name = "port", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_AUTH_SERVER] = { .name = "auth_server", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_AUTH_PORT] = { .name = "auth_port", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_AUTH_SECRET] = { .name = "auth_secret", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_ACCT_SERVER] = { .name = "acct_server", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_ACCT_PORT] = { .name = "acct_port", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_ACCT_SECRET] = { .name = "acct_secret", .type = BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_IEEE80211R] = { .name = "ieee80211r", BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_IEEE80211W] = { .name = "ieee80211w", BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_MOBILITY_DOMAIN] = { .name = "mobility_domain", BLOBMSG_TYPE_STRING },
|
||||
@@ -107,6 +144,31 @@ static const struct blobmsg_policy wifi_iface_policy[__WIF_ATTR_MAX] = {
|
||||
[WIF_ATTR_IEEE80211K] = { .name = "ieee80211k", BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_RTS_THRESHOLD] = { .name = "rts_threshold", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_DTIM_PERIOD] = { .name = "dtim_period", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_INTERWORKING] = { .name = "interworking", BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_HS20] = { .name = "hs20", BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_HESSID] = { .name = "hessid", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_ROAMING_CONSORTIUM] = { .name = "roaming_consortium", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_VENUE_NAME] = { .name = "venue_name", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_VENUE_GROUP] = { .name = "venue_group", BLOBMSG_TYPE_INT32 },
|
||||
[WIF_ATTR_VENUE_TYPE] = { .name = "venue_type", BLOBMSG_TYPE_INT32 },
|
||||
[WIF_ATTR_VENUE_URL] = { .name = "venue_url", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_NETWORK_AUTH_TYPE] = { .name = "network_auth_type", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_IPADDR_TYPE_AVAILABILITY] = { .name = "ipaddr_type_availability", BLOBMSG_TYPE_INT32 },
|
||||
[WIF_ATTR_DOMAIN_NAME] = { .name = "domain_name", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_MCC_MNC] = { .name = "anqp_3gpp_cell_net", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_NAI_REALM] = { .name = "nai_realm", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_GAS_ADDR3] = { .name = "gas_address3", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_OSEN] = { .name = "osen", BLOBMSG_TYPE_BOOL },
|
||||
[WIF_ATTR_ANQP_DOMAIN_ID] = { .name = "anqp_domain_id", BLOBMSG_TYPE_INT32 },
|
||||
[WIF_ATTR_DEAUTH_REQUEST_TIMEOUT] = { .name = "hs20_deauth_req_timeout", BLOBMSG_TYPE_INT32 },
|
||||
[WIF_ATTR_OPER_FRIENDLY_NAME] = { .name = "hs20_oper_friendly_name", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_OPERATING_CLASS] = { .name = "hs20_operating_class", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_OSU_FRIENDLY_NAME] = { .name = "osu_friendly_name", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_OSU_SERVICE_DESCRIPTION] = { .name = "service_description", BLOBMSG_TYPE_ARRAY },
|
||||
[WIF_ATTR_OSU_NAI] = { .name = "osu_nai", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_OSU_NAI2] = { .name = "osu_nai2", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_OSU_SERVER_URI] = { .name = "osu_server_uri", BLOBMSG_TYPE_STRING },
|
||||
[WIF_ATTR_OSU_METHOD_LIST] = { .name = "osu_method_list", BLOBMSG_TYPE_STRING },
|
||||
};
|
||||
|
||||
const struct uci_blob_param_list wifi_iface_param = {
|
||||
@@ -145,12 +207,18 @@ static void vif_config_security_set(struct blob_buf *b,
|
||||
blobmsg_add_string(b, "encryption", vif_crypto[i].uci);
|
||||
blobmsg_add_bool(b, "ieee80211w", 1);
|
||||
if (vif_crypto[i].enterprise) {
|
||||
blobmsg_add_string(b, "server",
|
||||
blobmsg_add_string(b, "auth_server",
|
||||
SCHEMA_KEY_VAL(vconf->security, SCHEMA_CONSTS_SECURITY_RADIUS_IP));
|
||||
blobmsg_add_string(b, "port",
|
||||
blobmsg_add_string(b, "auth_port",
|
||||
SCHEMA_KEY_VAL(vconf->security, SCHEMA_CONSTS_SECURITY_RADIUS_PORT));
|
||||
blobmsg_add_string(b, "auth_secret",
|
||||
SCHEMA_KEY_VAL(vconf->security, SCHEMA_CONSTS_SECURITY_RADIUS_SECRET));
|
||||
blobmsg_add_string(b, "acct_server",
|
||||
SCHEMA_KEY_VAL(vconf->security, OVSDB_SECURITY_RADIUS_ACCT_IP));
|
||||
blobmsg_add_string(b, "acct_port",
|
||||
SCHEMA_KEY_VAL(vconf->security, OVSDB_SECURITY_RADIUS_ACCT_PORT));
|
||||
blobmsg_add_string(b, "acct_secret",
|
||||
SCHEMA_KEY_VAL(vconf->security, OVSDB_SECURITY_RADIUS_ACCT_SECRET));
|
||||
} else {
|
||||
blobmsg_add_string(b, "key",
|
||||
SCHEMA_KEY_VAL(vconf->security, SCHEMA_CONSTS_SECURITY_KEY));
|
||||
@@ -191,18 +259,24 @@ static void vif_state_security_get(struct schema_Wifi_VIF_State *vstate,
|
||||
goto out_none;
|
||||
|
||||
if (vc->enterprise) {
|
||||
if (!tb[WIF_ATTR_SERVER] || !tb[WIF_ATTR_PORT] || !tb[WIF_ATTR_AUTH_SECRET])
|
||||
if (!tb[WIF_ATTR_AUTH_SERVER] || !tb[WIF_ATTR_AUTH_PORT] || !tb[WIF_ATTR_AUTH_SECRET])
|
||||
goto out_none;
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_ENCRYPTION,
|
||||
OVSDB_SECURITY_ENCRYPTION_WPA_EAP);
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_MODE,
|
||||
vc->mode);
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_RADIUS_SERVER_IP,
|
||||
blobmsg_get_string(tb[WIF_ATTR_SERVER]));
|
||||
blobmsg_get_string(tb[WIF_ATTR_AUTH_SERVER]));
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_RADIUS_SERVER_PORT,
|
||||
blobmsg_get_string(tb[WIF_ATTR_PORT]));
|
||||
blobmsg_get_string(tb[WIF_ATTR_AUTH_PORT]));
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_RADIUS_SERVER_SECRET,
|
||||
blobmsg_get_string(tb[WIF_ATTR_AUTH_SECRET]));
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_RADIUS_ACCT_IP,
|
||||
blobmsg_get_string(tb[WIF_ATTR_ACCT_SERVER]));
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_RADIUS_ACCT_PORT,
|
||||
blobmsg_get_string(tb[WIF_ATTR_ACCT_PORT]));
|
||||
vif_state_security_append(vstate, &index, OVSDB_SECURITY_RADIUS_ACCT_SECRET,
|
||||
blobmsg_get_string(tb[WIF_ATTR_ACCT_SECRET]));
|
||||
} else {
|
||||
if (!tb[WIF_ATTR_KEY])
|
||||
goto out_none;
|
||||
@@ -524,6 +598,177 @@ bool vif_state_update(struct uci_section *s, struct schema_Wifi_VIF_Config *vcon
|
||||
return true;
|
||||
}
|
||||
|
||||
static void hs20_osu_config(struct blob_buf *b,
|
||||
const struct schema_Hotspot20_OSU_Providers *osuconf)
|
||||
{
|
||||
int i;
|
||||
struct blob_attr *n;
|
||||
|
||||
n = blobmsg_open_array(b, "osu_friendly_name");
|
||||
for (i = 0; i < osuconf->osu_friendly_name_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, osuconf->osu_friendly_name[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
n = blobmsg_open_array(b, "osu_service_desc");
|
||||
for (i = 0; i < osuconf->service_description_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, osuconf->service_description[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
if (strlen(osuconf->osu_nai))
|
||||
blobmsg_add_string(b, "osu_nai", osuconf->osu_nai);
|
||||
|
||||
if (strlen(osuconf->osu_nai2))
|
||||
blobmsg_add_string(b, "osu_nai2", osuconf->osu_nai2);
|
||||
|
||||
if (strlen(osuconf->server_uri))
|
||||
blobmsg_add_string(b, "osu_server_uri", osuconf->server_uri);
|
||||
|
||||
if (osuconf->method_list_len)
|
||||
{
|
||||
blobmsg_add_u32(b, "osu_method_list", osuconf->method_list[0]);
|
||||
}
|
||||
}
|
||||
|
||||
static void hs20_vif_config(struct blob_buf *b,
|
||||
const struct schema_Hotspot20_Config *hs2conf)
|
||||
{
|
||||
struct blob_attr *n;
|
||||
struct schema_Hotspot20_OSU_Providers osuconf;
|
||||
int i = 0;
|
||||
json_t *where;
|
||||
|
||||
if (hs2conf->enable) {
|
||||
blobmsg_add_bool(b, "interworking", 1);
|
||||
blobmsg_add_bool(b, "hs20", 1);
|
||||
}
|
||||
else {
|
||||
blobmsg_add_bool(b, "interworking", 0);
|
||||
blobmsg_add_bool(b, "hs20", 0);
|
||||
}
|
||||
|
||||
if (strlen(hs2conf->hessid))
|
||||
blobmsg_add_string(b, "hessid", hs2conf->hessid);
|
||||
|
||||
n = blobmsg_open_array(b, "roaming_consortium");
|
||||
for (i = 0; i < hs2conf->roaming_oi_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, hs2conf->roaming_oi[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
n = blobmsg_open_array(b, "venue_name");
|
||||
for (i = 0; i < hs2conf->venue_name_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, hs2conf->venue_name[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
n = blobmsg_open_array(b, "venue_url");
|
||||
for (i = 0; i < hs2conf->venue_url_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, hs2conf->venue_url[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
n = blobmsg_open_array(b, "domain_name");
|
||||
for (i = 0; i < hs2conf->domain_name_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, hs2conf->domain_name[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
n = blobmsg_open_array(b, "nai_realm");
|
||||
for (i = 0; i < hs2conf->nai_realm_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, hs2conf->nai_realm[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
if (strlen(hs2conf->network_auth_type))
|
||||
blobmsg_add_string(b, "network_auth_type", hs2conf->network_auth_type);
|
||||
|
||||
if (strlen(hs2conf->mcc_mnc))
|
||||
blobmsg_add_string(b, "anqp_3gpp_cell_net", hs2conf->mcc_mnc);
|
||||
|
||||
if (hs2conf->gas_addr3_behavior < 3)
|
||||
blobmsg_add_u32(b, "gas_address3", hs2conf->gas_addr3_behavior);
|
||||
|
||||
if (strlen(hs2conf->qos_map_set))
|
||||
blobmsg_add_string(b, "qos_map_set", hs2conf->qos_map_set);
|
||||
|
||||
if (hs2conf->osen)
|
||||
blobmsg_add_bool(b, "osen", 1);
|
||||
else
|
||||
blobmsg_add_bool(b, "osen", 0);
|
||||
|
||||
if (hs2conf->internet)
|
||||
blobmsg_add_bool(b, "internet", 1);
|
||||
else
|
||||
blobmsg_add_bool(b, "internet", 0);
|
||||
|
||||
if (hs2conf->esr)
|
||||
blobmsg_add_bool(b, "esr", 1);
|
||||
else
|
||||
blobmsg_add_bool(b, "esr", 0);
|
||||
|
||||
if (hs2conf->asra)
|
||||
blobmsg_add_bool(b, "asra", 1);
|
||||
else
|
||||
blobmsg_add_bool(b, "asra", 0);
|
||||
|
||||
if (hs2conf->uesa)
|
||||
blobmsg_add_bool(b, "uesa", 1);
|
||||
else
|
||||
blobmsg_add_bool(b, "uesa", 0);
|
||||
|
||||
if (hs2conf->disable_dgaf)
|
||||
blobmsg_add_bool(b, "disable_dgaf", 1);
|
||||
else
|
||||
blobmsg_add_bool(b, "disable_dgaf", 0);
|
||||
|
||||
if (hs2conf->anqp_domain_id > 0)
|
||||
blobmsg_add_u32(b, "anqp_domain_id", hs2conf->anqp_domain_id);
|
||||
|
||||
if (hs2conf->deauth_request_timeout > 0)
|
||||
blobmsg_add_u32(b, "hs20_deauth_req_timeout", hs2conf->deauth_request_timeout);
|
||||
|
||||
if (hs2conf->operating_class > 0)
|
||||
blobmsg_add_u32(b, "hs20_operating_class", hs2conf->operating_class);
|
||||
|
||||
if (strlen(hs2conf->wan_metrics))
|
||||
blobmsg_add_string(b, "hs20_wan_metrics", hs2conf->wan_metrics);
|
||||
|
||||
n = blobmsg_open_array(b, "hs20_oper_friendly_name");
|
||||
for (i = 0; i < hs2conf->operator_friendly_name_len; i++)
|
||||
{
|
||||
blobmsg_add_string(b, NULL, hs2conf->operator_friendly_name[i]);
|
||||
}
|
||||
blobmsg_close_array(b, n);
|
||||
|
||||
if (strlen(hs2conf->venue_group_type))
|
||||
{
|
||||
unsigned int venue_group;
|
||||
unsigned int venue_type;
|
||||
sscanf((char*)hs2conf->venue_group_type, "%d:%d", &venue_group, &venue_type);
|
||||
blobmsg_add_u32(b, "venue_group", venue_group);
|
||||
blobmsg_add_u32(b, "venue_type", venue_type);
|
||||
}
|
||||
|
||||
for (i = 0; i < hs2conf->osu_providers_len; i++) {
|
||||
if (!(where = ovsdb_where_uuid("_uuid", hs2conf->osu_providers[i].uuid)))
|
||||
continue;
|
||||
|
||||
if (ovsdb_table_select_one_where(&table_Hotspot20_OSU_Providers, where, &osuconf))
|
||||
hs20_osu_config(b, &osuconf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
bool target_vif_config_del(const struct schema_Wifi_VIF_Config *vconf)
|
||||
{
|
||||
struct uci_package *wireless;
|
||||
@@ -548,6 +793,31 @@ bool target_vif_config_del(const struct schema_Wifi_VIF_Config *vconf)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void vif_hs20_update(struct schema_Hotspot20_Config *hs2conf)
|
||||
{
|
||||
int i;
|
||||
struct schema_Wifi_VIF_Config vconf;
|
||||
|
||||
json_t *where;
|
||||
|
||||
for (i = 0; i < hs2conf->vif_config_len; i++) {
|
||||
if (!(where = ovsdb_where_uuid("_uuid", hs2conf->vif_config[i].uuid)))
|
||||
continue;
|
||||
|
||||
memset(&vconf, 0, sizeof(vconf));
|
||||
|
||||
if (ovsdb_table_select_one_where(&table_Wifi_VIF_Config, where, &vconf))
|
||||
{
|
||||
blob_buf_init(&b, 0);
|
||||
hs20_vif_config(&b, hs2conf);
|
||||
blob_to_uci_section(uci, "wireless", vconf.if_name, "wifi-iface",
|
||||
b.head, &wifi_iface_param, NULL);
|
||||
reload_config = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool target_vif_config_set2(const struct schema_Wifi_VIF_Config *vconf,
|
||||
const struct schema_Wifi_Radio_Config *rconf,
|
||||
const struct schema_Wifi_Credential_Config *cconfs,
|
||||
@@ -590,7 +860,7 @@ bool target_vif_config_set2(const struct schema_Wifi_VIF_Config *vconf,
|
||||
}
|
||||
|
||||
if (changed->ft_psk || changed->ft_mobility_domain) {
|
||||
if (vconf->ft_psk && vconf->ft_mobility_domain) {
|
||||
if (vconf->ft_psk && vconf->ft_mobility_domain) {
|
||||
blobmsg_add_bool(&b, "ieee80211r", 1);
|
||||
blobmsg_add_hex16(&b, "mobility_domain", vconf->ft_mobility_domain);
|
||||
blobmsg_add_bool(&b, "ft_psk_generate_local", vconf->ft_psk);
|
||||
|
||||
Reference in New Issue
Block a user