[PATCH v16 2/6] Reconfigure fff-wireless for keyxchangev2

mail at adrianschmutzler.de mail at adrianschmutzler.de
So Okt 8 11:44:15 CEST 2017


Hallo Tim,

MAC rausfinden übersteigt meine Kompetenz. Da muss jemand anderes helfen.

Grüße

Adrian

> -----Original Message-----
> From: Tim Niemeyer [mailto:tim at tn-x.org]
> Sent: Sonntag, 8. Oktober 2017 11:42
> To: mail at adrianschmutzler.de; franken-dev at freifunk.net
> Subject: Re: [PATCH v16 2/6] Reconfigure fff-wireless for keyxchangev2
> 
> Am Sonntag, den 08.10.2017, 11:36 +0200 schrieb
> mail at adrianschmutzler.de:
> > Spricht was dagegen, das einfach wieder reinzuschreiben?
> >
> > Es reicht ja jeweils wifiAddPhy?
> Nein, weil wir im configurenetwork auf die wXmesh/wXap Interfaces
> zugreifen wollen.
> 
> > Im configurehood löschen wir dann ja eh alles wieder ...
> Dann sollte^{TM} das gehen. Aber bevor wir da jetzt nen Schnellschuss
> machen: Gibt es keine bessere Möglichkeit die MAC von den Geräten
> rauszufinden?
> 
> Tim
> 
> >
> > > -----Original Message-----
> > > From: Tim Niemeyer [mailto:tim at tn-x.org]
> > > Sent: Sonntag, 8. Oktober 2017 11:28
> > > To: Adrian Schmutzler <freifunk at adrianschmutzler.de>; franken-
> > > dev at freifunk.net
> > > Subject: Re: [PATCH v16 2/6] Reconfigure fff-wireless for
> > > keyxchangev2
> > >
> > > Hi
> > >
> > > Am Donnerstag, den 05.10.2017, 15:37 +0200 schrieb Adrian
> > > Schmutzler:
> > > > From: Christian Dresel <fff at chrisi01.de>
> > > >
> > > > Need more parameters in wifiAddAP to add hidden AP Need new
> > > > function wifiAddSta to add a station and download hoodfile
> > > >
> > > > Signed-off-by: Christian Dresel <fff at chrisi01.de>
> > > > Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
> > > >
> > > > Update in v5:
> > > >  - wXSta to wXsta
> > > >
> > > > Update in v6:
> > > >  - nothing
> > > >
> > > > Update in v7:
> > > >  - nothing
> > > >
> > > > Update in v8/v9:
> > > >  - rebase onto 20170918-beta
> > > >
> > > > Changes in v14:
> > > >  - Removed single quotes in iface
> > > >
> > > > Changes in v15/v16:
> > > >  - nothing
> > > > ---
> > > >  .../files/etc/uci-defaults/60-fff-wireless         | 43 --------
> > > > ----
> > > > ---------
> > > >  .../fff-wireless/files/lib/functions/fff/wireless  | 44
> > > > +++++++++++++++++++---
> > > >  2 files changed, 39 insertions(+), 48 deletions(-)
> > > >  delete mode 100644 src/packages/fff/fff-wireless/files/etc/uci-
> > > > defaults/60-fff-wireless
> > > >
> > > > diff --git a/src/packages/fff/fff-wireless/files/etc/uci-
> > > > defaults/60-
> > > > fff-wireless b/src/packages/fff/fff-wireless/files/etc/uci-
> > > > defaults/60-fff-wireless
> > > > deleted file mode 100644
> > > > index 8e207a4..0000000
> > > > --- a/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-
> > > > fff-
> > > > wireless
> > > > +++ /dev/null
> > > > @@ -1,43 +0,0 @@
> > > > -#!/bin/sh
> > > > -# Copyright 2016 Tim Niemeyer
> > > > -# License GPLv3
> > > > -
> > > > -. /lib/functions/fff/wireless
> > > > -
> > > > -. /etc/community.cfg
> > > > -
> > > > -if ! wifiDelAll; then
> > > > -	echo "Can't delete current wifi setup"
> > > > -	exit 1
> > > > -fi
> > > > -
> > > > -for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do
> > >
> > > Das der folgende Kram beim ersten Booten nicht mehr gemacht wird hat
> > > folgen für configurenetwork, wo die Routermac gesetzt wird.
> > > Zumindest
> > > dann, wenn der Knoten die MAC vom WiFi Interface beziehen möchte.
> > >
> > > Da brauchen wir ne Lösung. :(
> > >
> > > Tim
> > >
> > > > -	if iw phy "$phy" info | grep -q -m1 "2... MHz"; then
> > > > -		echo "$phy is 2.4 GHz"
> > > > -		radio=$(wifiAddPhy "$phy" "$BATMAN_CHANNEL")
> > > > -		if [ -z "$radio" ]; then
> > > > -			echo "Can't create radio for $phy"
> > > > -			exit 1
> > > > -		fi
> > > > -	fi
> > > > -	if iw phy "$phy" info | grep -q -m1 "5... MHz"; then
> > > > -		echo "$phy is 5 GHz"
> > > > -		radio=$(wifiAddPhy "$phy"
> > > > "$BATMAN_CHANNEL_5GHZ")
> > > > -		if [ -z "$radio" ]; then
> > > > -			echo "Can't create radio for $phy"
> > > > -			exit 1
> > > > -		fi
> > > > -	fi
> > > > -
> > > > -	if ! wifiAddAP "$radio" "$ESSID_AP"; then
> > > > -		echo "Can't add AP interface on $radio."
> > > > -		exit 1
> > > > -	fi
> > > > -
> > > > -	if ! wifiAddAdHocMesh "$radio" "$ESSID_MESH"
> > > > "$BSSID_MESH";
> > > > then
> > > > -		echo "Can't add AdHocMesh interface on $radio."
> > > > -		exit 1
> > > > -	fi
> > > > -done
> > > > -
> > > > -# vim: set noexpandtab:tabstop=4
> > > > diff --git a/src/packages/fff/fff-
> > > > wireless/files/lib/functions/fff/wireless b/src/packages/fff/fff-
> > > > wireless/files/lib/functions/fff/wireless
> > > > index 76424be..8ba9463 100644
> > > > --- a/src/packages/fff/fff-
> > > > wireless/files/lib/functions/fff/wireless
> > > > +++ b/src/packages/fff/fff-
> > > > wireless/files/lib/functions/fff/wireless
> > > > @@ -91,28 +91,32 @@ wifiAddAdHocMesh() {
> > > >  }
> > > >
> > > >  wifiAddAP() {
> > > > -	if [ $# -ne "2" ]
> > > > +	if [ $# -ne "5" ]
> > > >  	then
> > > > -		echo "Usage: wifiAddAP <radio> <essid>"
> > > > +		echo "Usage: wifiAddAP <radio> <essid> <network>
> > > > <iface> <hidden>"
> > > >  		return 1
> > > >  	fi
> > > >
> > > >  	local radio=$1
> > > >  	local essid=$2
> > > > +	local network=$3
> > > > +	local inface=$4
> > > > +	local hidden=$5
> > > >
> > > >  	local channel=$(uci get "wireless.${radio}.channel")
> > > > -	local iface="w2ap"
> > > > +	local iface="w2${inface}"
> > > >  	if [ "$channel" -gt "14" ]; then
> > > > -		iface="w5ap"
> > > > +		iface="w5${inface}"
> > > >  	fi
> > > >  	uci batch <<-__EOF__
> > > >  		set wireless.${iface}='wifi-iface'
> > > >  		set wireless.${iface}.device='${radio}'
> > > > -		set wireless.${iface}.network='mesh'
> > > > +		set wireless.${iface}.network='${network}'
> > > >  		set wireless.${iface}.ifname='${iface}'
> > > >  		set wireless.${iface}.mode='ap'
> > > >  		set wireless.${iface}.ssid='${essid}'
> > > >  		set wireless.${iface}.encryption='none'
> > > > +		set wireless.${iface}.hidden='${hidden}'
> > > >
> > > >  		commit wireless
> > > >  	__EOF__
> > > > @@ -120,4 +124,34 @@ wifiAddAP() {
> > > >  	echo "${iface}"
> > > >  }
> > > >
> > > > +wifiAddSta() {
> > > > +	if [ $# -ne "3" ]
> > > > +	then
> > > > +		echo "Usage: wifiAddSta <radio> <essid>
> > > > <network>"
> > > > +		return 1
> > > > +	fi
> > > > +
> > > > +	local radio=$1
> > > > +	local essid=$2
> > > > +	local network=$3
> > > > +
> > > > +	local channel=$(uci get "wireless.${radio}.channel")
> > > > +	local iface="w2sta"
> > > > +	if [ "$channel" -gt "14" ]; then
> > > > +		iface="w5sta"
> > > > +	fi
> > > > +	uci batch <<-__EOF__
> > > > +		set wireless.${iface}='wifi-iface'
> > > > +		set wireless.${iface}.device='${radio}'
> > > > +		set wireless.${iface}.network='${network}'
> > > > +		set wireless.${iface}.ifname='${iface}'
> > > > +		set wireless.${iface}.mode='sta'
> > > > +		set wireless.${iface}.ssid='${essid}'
> > > > +
> > > > +		commit wireless
> > > > +	__EOF__
> > > > +
> > > > +	echo "${iface}"
> > > > +}
> > > > +
> > > >  # vim: set noexpandtab:tabstop=4
> > > > --
> > > > 2.7.4
> > > >
> >
> >



Mehr Informationen über die Mailingliste franken-dev