Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wpa_supplicant
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
wpa_supplicant
Commits
c0bdbaf9
Commit
c0bdbaf9
authored
Aug 29, 2020
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added CWMP configuration for wireless LAN
parent
850d5374
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
2 deletions
+105
-2
Makefile
Makefile
+14
-2
wlan
wlan
+91
-0
No files found.
Makefile
View file @
c0bdbaf9
all
:
wpa-config
all
:
wpa-config
wlan-config
tar
xf wpa_supplicant-2.9.tar.gz
tar
xf wpa_supplicant-2.9.tar.gz
echo
"
$$
WPA_CONFIG"
>
wpa_supplicant-2.9/wpa_supplicant/.config
echo
"
$$
WPA_CONFIG"
>
wpa_supplicant-2.9/wpa_supplicant/.config
$(MAKE)
-C
wpa_supplicant-2.9/wpa_supplicant
BINDIR
=
/sbin
LIBDIR
=
/lib
$(MAKE)
-C
wpa_supplicant-2.9/wpa_supplicant
BINDIR
=
/sbin
LIBDIR
=
/lib
...
@@ -9,8 +9,11 @@ all: wpa-config
...
@@ -9,8 +9,11 @@ all: wpa-config
install
-v
-m644
wpa_supplicant-2.9/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service /usr/share/dbus-1/system-services/
install
-v
-m644
wpa_supplicant-2.9/wpa_supplicant/dbus/fi.w1.wpa_supplicant1.service /usr/share/dbus-1/system-services/
install
-v
-d
-m755
/etc/dbus-1/system.d
install
-v
-d
-m755
/etc/dbus-1/system.d
install
-v
-m644
wpa_supplicant-2.9/wpa_supplicant/dbus/dbus-wpa_supplicant.conf /etc/dbus-1/system.d/wpa_supplicant.conf
install
-v
-m644
wpa_supplicant-2.9/wpa_supplicant/dbus/dbus-wpa_supplicant.conf /etc/dbus-1/system.d/wpa_supplicant.conf
systemctl
enable
wpa_supplicant
install
-v
-dm755
/etc/wpa_supplicant
install
-v
-dm755
/etc/wpa_supplicant
systemctl
enable
wpa_supplicant
systemctl
enable
wpa_supplicant@wlan0
@
echo
"
$$
WLAN_CONFIG"
>>
/etc/config/wlan
install
-v
-Dm755
wlan /usr/share/easycwmp/functions/wlan
rm
-rf
wpa_supplicant-2.9
rm
-rf
wpa_supplicant-2.9
wpa-config
:
wpa-config
:
...
@@ -45,3 +48,12 @@ CONFIG_CTRL_IFACE_DBUS_NEW=y
...
@@ -45,3 +48,12 @@ CONFIG_CTRL_IFACE_DBUS_NEW=y
CONFIG_CTRL_IFACE_DBUS_INTRO
=
y
CONFIG_CTRL_IFACE_DBUS_INTRO
=
y
endef
endef
export
WPA_CONFIG
export
WPA_CONFIG
wlan-config
:
define
WLAN_CONFIG
config
wlan
'client'
option
ssid
''
option
psk
''
endef
export
WLAN_CONFIG
wlan
0 → 100755
View file @
c0bdbaf9
#!/bin/sh
#common_execute_method_param "$parameter" "$permission" "$get_cmd" "$set_cmd" "xsd:$type" "$forcedinform"
# $forcedinform should be set to 1 if the parameter is included in the inform message otherwise empty
# Default of $type = string
#############################
# Entry point functuons #
#############################
prefix_list
=
"
$prefix_list
$DMROOT
.WLAN."
entry_execute_method_list
=
"
$entry_execute_method_list
entry_execute_method_root_WLAN"
entry_execute_method_list_forcedinform
=
"
$entry_execute_method_list_forcedinform
entry_execute_method_root_WLAN"
entry_execute_method_root_WLAN
()
{
case
"
$1
"
in
""
|
"
$DMROOT
."
|
"
$DMROOT
.WLAN."
*
)
common_execute_method_obj
"
$DMROOT
.WLAN."
"0"
common_execute_method_obj
"
$DMROOT
.WLAN.Client."
"0"
common_execute_method_param
"
$DMROOT
.WLAN.Client.SSID"
"1"
"wlan_get_client_ssid"
"wlan_set_client_ssid"
common_execute_method_param
"
$DMROOT
.WLAN.Client.PSK"
"1"
""
"wlan_set_client_psk"
return
0
;
;;
esac
return
$E_INVALID_PARAMETER_NAME
;
}
#######################################
# Data model parameters functions #
#######################################
wlan_get_client_ssid
()
{
echo
`
$UCI_GET
wlan.client.ssid
`
}
wlan_set_client_ssid
()
{
local
ssid
=
`
$UCI_GET
wlan.client.ssid
`
if
[
"
$ssid
"
!=
"
$1
"
]
;
then
$UCI_SET
wlan.client.ssid
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/wlan
reconfigure_wlan
fi
}
wlan_get_client_psk
()
{
echo
`
$UCI_GET
wlan.client.psk
`
}
wlan_set_client_psk
()
{
local
psk
=
`
$UCI_GET
wlan.client.psk
`
if
[
"
$psk
"
!=
"
$1
"
]
;
then
if
[
-n
"
$1
"
]
&&
[
${#
1
}
-ge
8
]
&&
[
${#
1
}
-lt
63
]
;
then
$UCI_SET
wlan.client.psk
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/wlan
reconfigure_wlan
elif
[
-z
"
$1
"
]
;
then
$UCI_SET
wlan.client.psk
=
"
$1
"
$UCI_COMMIT
chmod
a+r /etc/config/wlan
reconfigure_wlan
fi
fi
}
reconfigure_wlan
()
{
local
ssid
=
`
wlan_get_client_ssid
`
local
psk
=
`
wlan_get_client_psk
`
local
int
=
"wlan0"
if
[
"
$ssid
"
!=
""
]
&&
[
"
$psk
"
!=
""
]
;
then
wpa_passphrase
$ssid
$psk
>
/etc/wpa_supplicant/wpa_supplicant-
$int
.conf
systemctl restart wpa_supplicant@
$int
if
[
!
-f
/etc/systemd/network/
$int
.network
]
;
then
echo
"[Match]"
>
/etc/systemd/network/
$int
.network
echo
"Name=
$int
"
>>
/etc/systemd/network/
$int
.network
echo
""
>>
/etc/systemd/network/
$int
.network
echo
"[Network]"
>>
/etc/systemd/network/
$int
.network
echo
"DHCP=ipv4"
>>
/etc/systemd/network/
$int
.network
echo
""
>>
/etc/systemd/network/
$int
.network
echo
"[DHCP]"
>>
/etc/systemd/network/
$int
.network
echo
"UseDomains=true"
>>
/etc/systemd/network/
$int
.network
chmod
644 /etc/systemd/network/
$int
.network
systemctl restart systemd-networkd
fi
else
rm
/etc/wpa_supplicant/wpa_supplicant-
$int
.conf
rm
/etc/systemd/network/
$int
.network
systemctl restart wpa_supplicant@
$int
systemctl restart systemd-networkd
fi
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment