[LEDE-DEV] [PATCH] Adding acct_interval to wireless configuration

2017-05-29 Thread Yury Shvedov
Hi, I'm new here and I wonder why there is still no UCI option to configure 
Radius-Accounting-Interim-Interval. 
I've made a patch to fix that and like to share it to others and ask is there 
any serious reason for lack of such
option?

Make an ability to configure Accounting-Interim-Interval via UCI

Signed-off-by: Yury Shvedov 
---
 package/network/services/hostapd/files/hostapd.sh | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 6fb902e376..e6bccef39b 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -151,6 +151,7 @@ hostapd_common_add_bss_config() {
config_add_string acct_server
config_add_string acct_secret
config_add_int acct_port
+   config_add_int acct_interval
config_add_string dae_client
config_add_string dae_secret
@@ -208,7 +209,7 @@ hostapd_set_bss_options() {
wps_independent wps_device_type wps_device_name 
wps_manufacturer wps_pin \
macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
iapp_interface eapol_version acct_server acct_secret acct_port \
-   dynamic_vlan ieee80211w
+   acct_interval dynamic_vlan ieee80211w
set_default isolate 0
set_default maxassoc 0
@@ -249,6 +250,8 @@ hostapd_set_bss_options() {
append bss_conf "acct_server_port=$acct_port" "$N"
[ -n "$acct_secret" ] && \
append bss_conf 
"acct_server_shared_secret=$acct_secret" "$N"
+   [ -n "$acct_interval" ] && \
+   append bss_conf 
"radius_acct_interim_interval=$acct_interval" "$N"
}
local vlan_possible=""
-- 
2.13.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] Adding acct_interval to wireless configuration

2017-05-30 Thread Yury Shvedov

Hi, Nick!

This is good point, but radius acct could be configured without radius 
auth. Even for open, wep and wpa/psk networks. I'm using radius acct to 
collect wireless client statistic among all of my networks. So there no 
Access-Accept messages available.



On 05/30/2017 11:42 PM, Nick Lowe wrote:

Hi Yury,

Have you tried returning an Acct-Interim-Interval attribute in the
Access-Accept packets sent by your RADIUS server, which should
configure this on a per client/station basis?

Cheers,

Nick


--
Kind regards
Yury Shvedov


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] hostapd: configure NAS ID regardless of encryption

2017-06-14 Thread Yury Shvedov
RADIUS protocol could be used not only for authentication but for
accounting too. Accounting could be configured for any type of networks.
However there no way to configure NAS Identifier for non-WPA-EAP
networks without this patch.

Signed-off-by: Yury Shvedov 
---
 package/network/services/hostapd/files/hostapd.sh | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 9514f919ee..8920c51eb7 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -370,11 +370,9 @@ hostapd_set_bss_options() {
network_get_device ifname "$iapp_interface" || ifname = 
"$iapp_interface"
append bss_conf "iapp_interface=$ifname" "$N"
}
-
if [ "$wpa" -ge "1" ]; then
-   json_get_vars nasid ieee80211r
+   json_get_vars ieee80211r
set_default ieee80211r 0
-   [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
if [ "$ieee80211r" -gt "0" ]; then
json_get_vars mobility_domain r0_key_lifetime 
r1_key_holder \
@@ -433,6 +431,11 @@ hostapd_set_bss_options() {
esac
fi
 +  if [ -n "$acct_server" -o "$wpa" -ge "1" ]; then
+   json_get_vars nasid
+   [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
+   fi
+
_macfile="/var/run/hostapd-$ifname.maclist"
case "$macfilter" in
allow)
-- 
2.13.0


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] Adding acct_interval to wireless configuration

2017-06-26 Thread Yury Shvedov

Like that?

Make an ability to configure Accounting-Interim-Interval via UCI

Signed-off-by: Yury Shvedov 
---
 package/network/services/hostapd/files/hostapd.sh | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh

index 86e9a32e5b..2b8023c228 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -151,6 +151,7 @@ hostapd_common_add_bss_config() {
 config_add_string acct_server
 config_add_string acct_secret
 config_add_int acct_port
+config_add_int acct_interval
  config_add_string dae_client
 config_add_string dae_secret
@@ -207,8 +208,8 @@ hostapd_set_bss_options() {
 wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 
wps_ap_setup_locked \
 wps_independent wps_device_type wps_device_name 
wps_manufacturer wps_pin \

 macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
-iapp_interface eapol_version acct_server acct_secret acct_port \
-dynamic_vlan ieee80211w
+iapp_interface eapol_version dynamic_vlan ieee80211w \
+acct_server acct_secret acct_port acct_interval \
  set_default isolate 0
 set_default maxassoc 0
@@ -249,6 +250,8 @@ hostapd_set_bss_options() {
 append bss_conf "acct_server_port=$acct_port" "$N"
 [ -n "$acct_secret" ] && \
 append bss_conf "acct_server_shared_secret=$acct_secret" "$N"
+[ -n "$acct_interval" ] && \
+append bss_conf 
"radius_acct_interim_interval=$acct_interval" "$N"

 }
  local vlan_possible=""
--
2.13.1


On 06/27/2017 07:22 AM, Stijn Tintel wrote:

On 29-05-17 14:04, Yury Shvedov wrote:

Hi, I'm new here and I wonder why there is still no UCI option to configure 
Radius-Accounting-Interim-Interval.
I've made a patch to fix that and like to share it to others and ask is there 
any serious reason for lack of such
option?

Make an ability to configure Accounting-Interim-Interval via UCI

The patch is broken. Please use git send-email or create a PR on Github.


Signed-off-by: Yury Shvedov 
---
  package/network/services/hostapd/files/hostapd.sh | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 6fb902e376..e6bccef39b 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -151,6 +151,7 @@ hostapd_common_add_bss_config() {
config_add_string acct_server
config_add_string acct_secret
config_add_int acct_port
+   config_add_int acct_interval
config_add_string dae_client
config_add_string dae_secret
@@ -208,7 +209,7 @@ hostapd_set_bss_options() {
wps_independent wps_device_type wps_device_name 
wps_manufacturer wps_pin \
macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
iapp_interface eapol_version acct_server acct_secret acct_port \
-   dynamic_vlan ieee80211w
+   acct_interval dynamic_vlan ieee80211w

Please group the 4 acct_* directives on the same line, and combine the
resulting 2 short lines.

set_default isolate 0
set_default maxassoc 0
@@ -249,6 +250,8 @@ hostapd_set_bss_options() {
append bss_conf "acct_server_port=$acct_port" "$N"
[ -n "$acct_secret" ] && \
append bss_conf "acct_server_shared_secret=$acct_secret" 
"$N"
+   [ -n "$acct_interval" ] && \
+   append bss_conf "radius_acct_interim_interval=$acct_interval" 
"$N"
}
local vlan_possible=""

Thanks,
Stijn


--
Kind Regards
Yury Shvedov
WiMark Systems


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] hostapd: configure NAS ID regardless of encryption

2017-06-27 Thread Yury Shvedov
RADIUS protocol could be used not only for authentication but for
accounting too. Accounting could be configured for any type of networks.
However there no way to configure NAS Identifier for non-WPA-EAP
networks without this patch.

Signed-off-by: Yury Shvedov 
---
 package/network/services/hostapd/files/hostapd.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 2c015f9c4b..4239676169 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -212,7 +212,7 @@ hostapd_set_bss_options() {
wps_independent wps_device_type wps_device_name 
wps_manufacturer wps_pin \
macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
iapp_interface eapol_version acct_server acct_secret acct_port \
-   dynamic_vlan ieee80211w
+   dynamic_vlan ieee80211w nasid
 
set_default isolate 0
set_default maxassoc 0
@@ -248,6 +248,7 @@ hostapd_set_bss_options() {
[ -n "$wpa_master_rekey" ] && append bss_conf 
"wpa_gmk_rekey=$wpa_master_rekey"  "$N"
}
 
+   [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
[ -n "$acct_server" ] && {
append bss_conf "acct_server_addr=$acct_server" "$N"
append bss_conf "acct_server_port=$acct_port" "$N"
@@ -373,9 +374,8 @@ hostapd_set_bss_options() {
}
 
if [ "$wpa" -ge "1" ]; then
-   json_get_vars nasid ieee80211r
+   json_get_vars ieee80211r
set_default ieee80211r 0
-   [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
 
if [ "$ieee80211r" -gt "0" ]; then
json_get_vars mobility_domain r0_key_lifetime 
r1_key_holder \
-- 
2.13.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] hostapd: configure NAS ID regardless of encryption

2017-06-27 Thread Yury Shvedov
Fixed with acct_interval patch (your changes was not appeared at github
for now).

By the way, I believe, that configuring RADIUS, (even AUTH) without
WPA-EAP will not break anything at all (that is not definitely).
But I definitely saw the piece of code in hostapd which uses RADIUS-AUTH
on the 802.11-AUTH stage before 802.11-ACCT without EAP.

RADIUS protocol could be used not only for authentication but for
accounting too. Accounting could be configured for any type of networks.
However there no way to configure NAS Identifier for non-WPA-EAP
networks without this patch.

Signed-off-by: Yury Shvedov 
---
 package/network/services/hostapd/files/hostapd.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index d94aa38807..8e3f88a115 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -212,7 +212,7 @@ hostapd_set_bss_options() {
wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 
wps_ap_setup_locked \
wps_independent wps_device_type wps_device_name 
wps_manufacturer wps_pin \
macfilter ssid wmm uapsd hidden short_preamble rsn_preauth \
-   iapp_interface eapol_version dynamic_vlan ieee80211w \
+   iapp_interface eapol_version dynamic_vlan ieee80211w nasid \
acct_server acct_secret acct_port acct_interval

set_default isolate 0
@@ -249,6 +249,7 @@ hostapd_set_bss_options() {
[ -n "$wpa_master_rekey" ] && append bss_conf 
"wpa_gmk_rekey=$wpa_master_rekey"  "$N"
}

+   [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"
[ -n "$acct_server" ] && {
append bss_conf "acct_server_addr=$acct_server" "$N"
append bss_conf "acct_server_port=$acct_port" "$N"
@@ -376,9 +377,8 @@ hostapd_set_bss_options() {
}

if [ "$wpa" -ge "1" ]; then
-   json_get_vars nasid ieee80211r
+   json_get_vars ieee80211r
set_default ieee80211r 0
-   [ -n "$nasid" ] && append bss_conf "nas_identifier=$nasid" "$N"

if [ "$ieee80211r" -gt "0" ]; then
json_get_vars mobility_domain r0_key_lifetime 
r1_key_holder \
--
2.13.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] ACS channel list support

2017-07-31 Thread Yury Shvedov
From: Vadim Balakhanov 

This patch implements channel list support in UCI. This functionality
already supported in hostapd.

Signed-off-by: Vadim Balakhanov 
---
 package/network/services/hostapd/files/hostapd.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 8e3f88a115..db22ef5f3b 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -67,6 +67,7 @@ hostapd_common_add_device_config() {
config_add_boolean legacy_rates
 
config_add_string acs_chan_bias
+   config_add_string chanlist
 
hostapd_add_log_config
 }
@@ -78,7 +79,7 @@ hostapd_prepare_device_config() {
local base="${config%%.conf}"
local base_cfg=
 
-   json_get_vars country country_ie beacon_int:100 doth require_mode 
legacy_rates acs_chan_bias
+   json_get_vars country country_ie beacon_int:100 doth require_mode 
legacy_rates acs_chan_bias chanlist
 
hostapd_set_log_options base_cfg
 
@@ -96,6 +97,7 @@ hostapd_prepare_device_config() {
}
 
[ -n "$acs_chan_bias" ] && append base_cfg 
"acs_chan_bias=$acs_chan_bias" "$N"
+   [ -n "$chanlist" ] && append base_cfg "chanlist=$chanlist" "$N"
 
local brlist= br
json_get_values basic_rate_list basic_rate
-- 
2.13.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] [PATCH] ACS channel list support

2017-07-31 Thread Yury Shvedov

Okay!

Sorry for mistake.


On 07/31/2017 03:05 PM, Stijn Tintel wrote:

On 31-07-17 13:20, Yury Shvedov wrote:

From: Vadim Balakhanov 

This patch implements channel list support in UCI. This functionality
already supported in hostapd.


NAK. This is already supported by the 'channels' option.

Stijn


--
С уважением,
Юрий Шведов
WiMark Systems


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] hostapd: remove default r1_key_holder generation

2017-10-19 Thread Yury Shvedov
By default, hostapd assumes r1_key_holder equal to bssid. If LEDE
configures the same static r1 key holder ID on two different APs (BSSes) the
RRB exchanges fails behind them.
---
 package/network/services/hostapd/files/hostapd.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 16925d58a2..f7a4183c4a 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -397,7 +397,6 @@ hostapd_set_bss_options() {
 
set_default mobility_domain "4f57"
set_default r0_key_lifetime 1
-   set_default r1_key_holder "4f577274"
set_default reassociation_deadline 1000
set_default pmk_r1_push 0
set_default ft_psk_generate_local 0
@@ -405,7 +404,7 @@ hostapd_set_bss_options() {
 
append bss_conf "mobility_domain=$mobility_domain" "$N"
append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N"
-   append bss_conf "r1_key_holder=$r1_key_holder" "$N"
+   [ -n "$r1_key_holder" ] && append bss_conf 
"r1_key_holder=$r1_key_holder" "$N"
append bss_conf 
"reassociation_deadline=$reassociation_deadline" "$N"
append bss_conf "pmk_r1_push=$pmk_r1_push" "$N"
append bss_conf 
"ft_psk_generate_local=$ft_psk_generate_local" "$N"
-- 
2.14.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH] hostapd: remove default r1_key_holder generation

2017-10-19 Thread Yury Shvedov
By default, hostapd assumes r1_key_holder equal to bssid. If LEDE
configures the same static r1 key holder ID on two different APs (BSSes) the
RRB exchanges fails behind them.

Signed-off-by: Yury Shvedov 
---
 package/network/services/hostapd/files/hostapd.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh 
b/package/network/services/hostapd/files/hostapd.sh
index 16925d58a2..f7a4183c4a 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -397,7 +397,6 @@ hostapd_set_bss_options() {
 
set_default mobility_domain "4f57"
set_default r0_key_lifetime 1
-   set_default r1_key_holder "4f577274"
set_default reassociation_deadline 1000
set_default pmk_r1_push 0
set_default ft_psk_generate_local 0
@@ -405,7 +404,7 @@ hostapd_set_bss_options() {
 
append bss_conf "mobility_domain=$mobility_domain" "$N"
append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N"
-   append bss_conf "r1_key_holder=$r1_key_holder" "$N"
+   [ -n "$r1_key_holder" ] && append bss_conf 
"r1_key_holder=$r1_key_holder" "$N"
append bss_conf 
"reassociation_deadline=$reassociation_deadline" "$N"
append bss_conf "pmk_r1_push=$pmk_r1_push" "$N"
append bss_conf 
"ft_psk_generate_local=$ft_psk_generate_local" "$N"
-- 
2.14.1


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] Predict sysupgrade file name

2018-01-31 Thread Yury Shvedov

Hi all,

I have a task to universal automatically predict sysupgrade (or factory) 
file name on the board, with already installed openwrt. The filename 
format is clear inside buildroot, but I can't find the way to learn 
CONFIG_TARGET_BOARD and CONFIG_TARGET_SUBTARGET variables values inside 
running system. I can pass them to my package, but it will not rebuilt 
when CONFIG_TARGET_SUBTARGET changed and will left invalid. I can clean 
it manually every time, but this way is unacceptable. Is there any 
common way to get that values or *sysupgrade.* filename from running 
system or make package rebuild each time?


--
Yury Shvedov,
WiMark Systems


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Predict sysupgrade file name

2018-01-31 Thread Yury Shvedov

Ok, sorry.

Finally find simple system.board method:

ubus call system board


On 01/31/2018 06:00 PM, Yury Shvedov wrote:

Hi all,

I have a task to universal automatically predict sysupgrade (or 
factory) file name on the board, with already installed openwrt. The 
filename format is clear inside buildroot, but I can't find the way to 
learn CONFIG_TARGET_BOARD and CONFIG_TARGET_SUBTARGET variables values 
inside running system. I can pass them to my package, but it will not 
rebuilt when CONFIG_TARGET_SUBTARGET changed and will left invalid. I 
can clean it manually every time, but this way is unacceptable. Is 
there any common way to get that values or *sysupgrade.* filename from 
running system or make package rebuild each time?




--
С уважением,
Юрий Шведов
WiMark Systems


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


Re: [LEDE-DEV] Predict sysupgrade file name

2018-01-31 Thread Yury Shvedov

Thank you!


On 01/31/2018 06:10 PM, John Crispin wrote:



On 31/01/18 16:00, Yury Shvedov wrote:

Hi all,

I have a task to universal automatically predict sysupgrade (or 
factory) file name on the board, with already installed openwrt. The 
filename format is clear inside buildroot, but I can't find the way 
to learn CONFIG_TARGET_BOARD and CONFIG_TARGET_SUBTARGET variables 
values inside running system. I can pass them to my package, but it 
will not rebuilt when CONFIG_TARGET_SUBTARGET changed and will left 
invalid. I can clean it manually every time, but this way is 
unacceptable. Is there any common way to get that values or 
*sysupgrade.* filename from running system or make package rebuild 
each time?



Hi

cat /etc/openwrt_release  | grep DISTRIB_TARGET
DISTRIB_TARGET='mediatek/32'

    John


--
С уважением,
Юрий Шведов
WiMark Systems


___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev