aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/services/authsae
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-07-26 10:02:59 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-07-26 10:02:59 +0000
commit2b073b7b7371ec32d0a94240158d6f15340d3bd7 (patch)
tree09a1febd958f6404cf05c416de222b3b98c947c5 /package/network/services/authsae
parenta22105f7ce571a13cdef869ff29c1df350b4780c (diff)
downloadmaster-187ad058-2b073b7b7371ec32d0a94240158d6f15340d3bd7.tar.gz
master-187ad058-2b073b7b7371ec32d0a94240158d6f15340d3bd7.tar.bz2
master-187ad058-2b073b7b7371ec32d0a94240158d6f15340d3bd7.zip
authsae: adapt uci scripts to use authsae
This patch modifies the uci scripts to be able to start meshd-nl80211 for encrypted mesh networks, therefor a new script (authsae.sh) is inserted. Signed-off-by: Emanuel Taube <emanuel.taube@gmail.com> [etienne.champetier@free.fr: just update mac80211.sh path] Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37554 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/services/authsae')
-rw-r--r--package/network/services/authsae/Makefile2
-rw-r--r--package/network/services/authsae/files/lib/wifi/authsae.sh53
2 files changed, 55 insertions, 0 deletions
diff --git a/package/network/services/authsae/Makefile b/package/network/services/authsae/Makefile
index c804803667..0e181d94c5 100644
--- a/package/network/services/authsae/Makefile
+++ b/package/network/services/authsae/Makefile
@@ -37,6 +37,8 @@ TARGET_CFLAGS += -D_GNU_SOURCE
define Package/authsae/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/lib/wifi
+ $(INSTALL_DATA) ./files/lib/wifi/authsae.sh $(1)/lib/wifi/
endef
$(eval $(call BuildPackage,authsae))
diff --git a/package/network/services/authsae/files/lib/wifi/authsae.sh b/package/network/services/authsae/files/lib/wifi/authsae.sh
new file mode 100644
index 0000000000..daa43eb22a
--- /dev/null
+++ b/package/network/services/authsae/files/lib/wifi/authsae.sh
@@ -0,0 +1,53 @@
+authsae_start_interface() {
+ local device="$1" # to use the correct channel
+ local vif="$2"
+ local band
+
+ cfgfile="/var/run/authsae-$vif.cfg"
+ config_get channel "$device" channel
+ config_get hwmode "$device" hwmode
+ config_get htmode "$device" htmode
+ config_get ifname "$vif" ifname
+ config_get key "$vif" key
+ config_get mesh_id "$vif" mesh_id
+ config_get mcast_rate "$vif" mcast_rate "12"
+
+ case "$htmode" in
+ HT20|HT40+|HT40-) htmode="$htmode";;
+ NOHT|none|*) htmode="none";;
+ esac
+
+ case "$hwmode" in
+ *g*) band=11g;;
+ *a*) band=11a;;
+ esac
+
+ cat > "$cfgfile" <<EOF
+authsae:
+{
+ sae:
+ {
+ debug = 0;
+ password = "$key";
+ group = [19, 26, 21, 25, 20];
+ blacklist = 5;
+ thresh = 5;
+ lifetime = 3600;
+ };
+ meshd:
+ {
+ meshid = "$mesh_id";
+ interface = "$ifname";
+ passive = 0;
+ debug = 0;
+ mediaopt = 1;
+ band = "$band";
+ channel = $channel;
+ htmode = "$htmode";
+ mcast-rate = $mcast_rate;
+ };
+};
+EOF
+ ifconfig "$ifname" up
+ meshd-nl80211 -i "$ifname" -s "$mesh_id" -c "$cfgfile" -B
+}