Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds a new driver (AP only) that utilizes the linux bridge to manage access on a per-port-basis.
- Loading branch information
1 parent
c340486
commit 95dc96f
Showing
12 changed files
with
951 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
LOG_FILE=/tmp/hostapd_auth_deauth.log | ||
|
||
operation="$1" | ||
mac="$2" | ||
port="$3" | ||
vlan=$(bridge vlan show dev "$port" | tail -1 |tr -s ' ' | cut -d' ' -f2) | ||
vlan=$(bridge vlan show dev "$port" | tail -1 | tr -s "\t" " " | cut -d" " -f2 | grep -Eo '[0-9]{1,4}') | ||
|
||
if [ -z "$vlan" ] ; then | ||
cmd="bridge fdb ""$operation"" ""$mac"" dev ""$port"" master dynamic" | ||
else | ||
cmd="bridge fdb ""$operation"" ""$mac"" dev ""$port"" vlan ""$vlan"" master dynamic" | ||
fi | ||
|
||
{ | ||
printf "Date is %s\n" "$(date)" | ||
printf "Operastion is %s\n" "$operation" | ||
printf "MAC is %s\n" "$mac" | ||
printf "Port is %s\n" "$port" | ||
if [ -z "$vlan" ] ; then | ||
printf "VLAN is empty\n" | ||
else | ||
printf "VLAN is %s\n" "$vlan" | ||
fi | ||
printf "\n" | ||
printf "Cmd is %s\n" "$cmd" | ||
} > "$LOG_FILE" | ||
|
||
if ! $cmd >> "$LOG_FILE" 2>&1 ; then | ||
printf "HOSTAPD AUTH SCRIPT: Command %s failed!\n" "$cmd" | ||
cat "$LOG_FILE" | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.