mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-26 20:14:11 +08:00
Compare commits
1 Commits
cr
...
philippe-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8990c2ce0 |
@@ -13,7 +13,7 @@ PKG_VERSION:=1.0.0
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7522faab4142fe2c0ac8cbf71bb0cc5bd49f0750
|
||||
PKG_SOURCE_VERSION:=be5b0d0c0a1c2abd335aaf19f01f63284d8cc285
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions/iopsys-repeated-macs.sh
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -89,6 +91,31 @@ create_rule() {
|
||||
exec_log ebtables -t broute -A BROUTING ${cmd}
|
||||
}
|
||||
|
||||
create_rules() {
|
||||
protocol=$1; shift
|
||||
macaddr=$1; shift
|
||||
prio_num=$1; shift
|
||||
port=$1
|
||||
|
||||
for p in $port; do
|
||||
if [ "$protocol" == "none" ]; then
|
||||
create_rule tcp $macaddr $prio_num $p
|
||||
create_rule udp $macaddr $prio_num $p
|
||||
else
|
||||
create_rule $protocol $macaddr $prio_num $p
|
||||
fi
|
||||
done
|
||||
# Create rule for all ports if port is not mentioned in uci
|
||||
if [ -z "$port" ]; then
|
||||
if [ "$protocol" == "none" ]; then
|
||||
create_rule tcp $macaddr $prio_num
|
||||
create_rule udp $macaddr $prio_num
|
||||
else
|
||||
create_rule $protocol $macaddr $prio_num
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num protocol
|
||||
@@ -100,25 +127,15 @@ manage_rule() {
|
||||
|
||||
protocol=$(echo ${proto}|tr [A-Z] [a-z])
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
if [ "${protocol}" == "none" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${p}
|
||||
create_rule udp ${macaddr} ${prio_num} ${p}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num} ${p}
|
||||
fi
|
||||
done
|
||||
# Create rule for all ports if port is not mentioned in uci
|
||||
if [ -z "${port}" ]; then
|
||||
if [ "${protocol}" == "none" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num}
|
||||
create_rule udp ${macaddr} ${prio_num}
|
||||
else
|
||||
create_rule ${protocol} ${macaddr} ${prio_num}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
[ -n "${macaddr}" -a -n "${prio_num}" ] || return
|
||||
|
||||
create_rules ${protocol} ${macaddr} ${prio_num} ${port}
|
||||
repeated_macs=$(mac_to_repeated ${macaddr})
|
||||
for mac in $repeated_macs; do
|
||||
[ "$mac" = "${macaddr}" ] && continue
|
||||
create_rules ${protocol} $mac ${prio_num} ${port}
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -85,7 +85,7 @@ get_ipaddress() {
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_select "${1//:/_}"
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
|
||||
@@ -11,7 +11,7 @@ PKG_RELEASE:=1
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9b7accf0ac4f7c8010fb06ba83df9e53264b429a
|
||||
PKG_SOURCE_VERSION:=f6deba973cba01d630fdc40c6e97c384b07e3df5
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@inteno.se>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.2
|
||||
PKG_SOURCE_VERSION:=631e61b7ab5d86f2f4c86756a117badff9fb0f2c
|
||||
PKG_SOURCE_VERSION:=bafc4f9e81de567965a0d8f2897d390cfb14636b
|
||||
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <linux/types.h>
|
||||
|
||||
#define SK9822_DEFAULT_NUM_LEDS 32 // U16, used if DT param fails
|
||||
#define SK9822_DEFAULT_BRIGHTNESS 1 // 5-bit brightness, 0-31
|
||||
#define SK9822_DEFAULT_BRIGHTNESS 15 // 5-bit brightness, 0-31
|
||||
|
||||
typedef struct {
|
||||
uint8_t b;
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=4.0-2019-05-21
|
||||
PKG_VERSION:=4.0-2019-05-08
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3ae6954f55e90a339561719a0328c0cf3a4b018c
|
||||
PKG_SOURCE_VERSION:=da50b98f5b0a9539edf97b3ffda4bf5a030dfa18
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
- libz.so
|
||||
- libcrypto.so
|
||||
the librairies should be present in the "staging_dir/target-i386_uClibc-0.9.30.1/usr/lib/" or "staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib"
|
||||
|
||||
|
||||
header files and folders:
|
||||
- expat.h
|
||||
- expat_external.h
|
||||
@@ -33,7 +33,7 @@ this software is composed of 3 packages:
|
||||
- cwmp kernel package: contains cwmp kernel module. This module could be used by other kernel modules to notify the icwmpd daemon when kernel parameter changes
|
||||
|
||||
The three packages should be selected in the make menu config in order to get the three packages compiled.
|
||||
To compile the three packages: $ make package/cwmpd/compile
|
||||
To compile the three packages: $ make package/cwmpd/compile
|
||||
|
||||
3) OpenWRT settings
|
||||
in the OpenWRT, Add the following lines in the /usr/share/udhcpc/default.script file:
|
||||
@@ -49,7 +49,7 @@ in the OpenWRT, Add the following lines in the /usr/share/udhcpc/default.script
|
||||
- libopenssl package should be installed
|
||||
- libz package should be installed
|
||||
- libcrypto package should be installed
|
||||
|
||||
|
||||
Configure the acs url in the /etc/config/icwmp
|
||||
and then start the cwmpd service: /etc/init.d/icwmpd start
|
||||
for the help: /etc/init.d/icwmpd
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
"CG300",
|
||||
"CG301",
|
||||
"EX400",
|
||||
"SDX810-AP",
|
||||
"NORRLAND"
|
||||
"SDX810-AP"
|
||||
],
|
||||
"acl" : [
|
||||
"admin",
|
||||
|
||||
@@ -48,7 +48,7 @@ config wifi-iface
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wps_pushbutton '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl0'
|
||||
@@ -88,7 +88,7 @@ config wifi-iface
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wps_pushbutton '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
"F*"
|
||||
],
|
||||
"uplink_band" : 'a',
|
||||
"downlink_band" : 'a b',
|
||||
|
||||
@@ -27,7 +27,7 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option ifname ra0
|
||||
option wps 1
|
||||
option wps_pushbutton 1
|
||||
|
||||
config wifi-device rai0
|
||||
option band a
|
||||
@@ -46,7 +46,7 @@ config wifi-iface
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option ifname rai0
|
||||
option wps 1
|
||||
option wps_pushbutton 1
|
||||
|
||||
config wifi-iface
|
||||
option device rai0
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"EX4*",
|
||||
"SDX810-AP",
|
||||
"NORRLAND"
|
||||
"SDX810-AP"
|
||||
],
|
||||
"credentials" : 0
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ config wifi-iface
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wps_pushbutton '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl0'
|
||||
@@ -88,7 +88,7 @@ config wifi-iface
|
||||
option key '$WPAKEY'
|
||||
option gtk_rekey '3600'
|
||||
option macfilter 'disable'
|
||||
option wps '1'
|
||||
option wps_pushbutton '1'
|
||||
option wmf_bss_enable '1'
|
||||
option maxassoc '32'
|
||||
option ifname 'wl1'
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
],
|
||||
"excluded_boards" : [
|
||||
"*G*",
|
||||
"F*",
|
||||
"NORRLAND"
|
||||
"F*"
|
||||
],
|
||||
"reboot" : 0,
|
||||
"credentials" : 0
|
||||
|
||||
@@ -27,7 +27,7 @@ config wifi-iface
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps 1
|
||||
option wps_pushbutton 1
|
||||
option ifname ra0
|
||||
|
||||
config wifi-device rai0
|
||||
@@ -47,6 +47,6 @@ config wifi-iface
|
||||
option ssid iopsys-$BSSID4
|
||||
option encryption psk2
|
||||
option key $WPAKEY
|
||||
option wps 1
|
||||
option wps_pushbutton 1
|
||||
option ifname rai0
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
NMTMPDIR=/var/netmodes
|
||||
OLD_MODE_FILE=/var/netmodes/old_mode
|
||||
CONF_BACKUP_DIR=/var/netmodes/backup/
|
||||
SWITCHMODELOCK="/tmp/switching_mode"
|
||||
MODEDIR=$(uci -q get netmode.setup.dir)
|
||||
MTK=0
|
||||
@@ -180,11 +179,6 @@ switch_netmode() {
|
||||
|
||||
run_netmode_scripts $curmode "pre"
|
||||
|
||||
# make backup of current config before switching
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
mkdir -p $CONF_BACKUP_DIR
|
||||
cp -af /etc/config/* $CONF_BACKUP_DIR
|
||||
|
||||
logger -s -p user.info -t $0 "[netmode] Copying /etc/netmodes/$curmode in /etc/config" >/dev/console
|
||||
|
||||
for file in $(ls /etc/netmodes/$curmode/); do
|
||||
@@ -232,28 +226,6 @@ switch_netmode() {
|
||||
run_netmode_scripts $curmode "post"
|
||||
}
|
||||
|
||||
revert_netmode() {
|
||||
local from="$1"
|
||||
local to="$2"
|
||||
local rready="$3"
|
||||
|
||||
ubus call leds set '{"state" : "allflash"}'
|
||||
echo "Could not switch to '$from' mode; going back to '$to' mode" > /dev/console
|
||||
uci -q set netmode.setup.curmode="$to"
|
||||
uci -q set netmode.setup.repeaterready="$rready"
|
||||
uci commit netmode
|
||||
cp -af $CONF_BACKUP_DIR/* /etc/config/
|
||||
sync
|
||||
rm -rf $CONF_BACKUP_DIR
|
||||
rm -rf $OLD_MODE_FILE
|
||||
|
||||
echo "Restarting network services" > /dev/console
|
||||
ubus call network reload
|
||||
wifi reload
|
||||
ubus call router.network reload
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
}
|
||||
|
||||
wificontrol_takes_over() {
|
||||
local ret
|
||||
[ -f /sbin/wificontrol ] || return
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
WIFISTA=0
|
||||
STACONF="/etc/Wireless/iNIC/iNIC_ap.dat"
|
||||
[ -f $STACONF ] && WIFISTA=1
|
||||
|
||||
get_if_creds() {
|
||||
local section=$1
|
||||
local network=$2
|
||||
@@ -88,22 +84,9 @@ duplicate_if_single_radio() {
|
||||
done
|
||||
}
|
||||
|
||||
get_wifi_iface_cfgstr() {
|
||||
get_cfgno() {
|
||||
config_get ifname "$1" ifname
|
||||
[ "$ifname" == "$2" ] && echo "wireless.$1"
|
||||
}
|
||||
config_load wireless
|
||||
config_foreach get_cfgno wifi-iface $1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
if [ $WIFISTA -eq 1 ]; then
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" }, "connect": { "ssid": "str", "key": "str" }, "forget_network": {} }'
|
||||
else
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
fi
|
||||
echo '{ "get_creds": { "network": "str", "file": "str" }, "set_creds": { "file": "str", "from_gui": "str" } }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
@@ -153,64 +136,6 @@ case "$1" in
|
||||
json_dump
|
||||
|
||||
;;
|
||||
connect)
|
||||
local ssid key enc auth wetif wetcfg wetssid wetkey code
|
||||
read input
|
||||
json_load "$input"
|
||||
json_get_var ssid ssid
|
||||
json_get_var key key
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
wetssid="$(uci -q get $wetcfg.ssid)"
|
||||
wetkey="$(uci -q get $wetcfg.key)"
|
||||
ssid="${ssid:-$wetssid}"
|
||||
key="${key:-$wetkey}"
|
||||
if [ -n "$key" ]; then
|
||||
auth="WPA2PSK"
|
||||
enc="AES"
|
||||
else
|
||||
auth="OPEN"
|
||||
enc="NONE"
|
||||
fi
|
||||
iwpriv $wetif set ApCliEnable=0
|
||||
iwpriv $wetif set ApCliSsid="$ssid"
|
||||
iwpriv $wetif set ApCliAuthMode="$auth"
|
||||
iwpriv $wetif set ApCliEncrypType="$enc"
|
||||
iwpriv $wetif set ApCliWPAPSK="$key"
|
||||
iwpriv $wetif set ApCliEnable=1
|
||||
iwpriv $wetif set ApCliAutoConnect=1
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
forget_network)
|
||||
local wetif wetcfg code
|
||||
code=1
|
||||
[ $WIFISTA -eq 1 ] && wetif="$(uci -q get wireless.$(uci show wireless | grep 'mode=.*wet.*' | cut -d'.' -f2 | head -1).ifname)"
|
||||
if [ -s /sys/class/net/$wetif/operstate ]; then
|
||||
wetcfg="$(get_wifi_iface_cfgstr $wetif)"
|
||||
uci -q set $wetcfg.ssid=""
|
||||
uci -q set $wetcfg.key=""
|
||||
uci -q commit wireless
|
||||
|
||||
sed -i "s/ApCliSsid=.*/ApCliSsid=/g" $STACONF
|
||||
sed -i "s/ApCliAuthMode=.*/ApCliAuthMode=/g" $STACONF
|
||||
sed -i "s/ApCliEncrypType=.*/ApCliEncrypType=/g" $STACONF
|
||||
sed -i "s/ApCliWPAPSK=.*/ApCliWPAPSK=/g" $STACONF
|
||||
|
||||
ifconfig $wetif down
|
||||
ifconfig $wetif up
|
||||
|
||||
code=0
|
||||
fi
|
||||
json_init
|
||||
json_add_int "code" $code
|
||||
json_dump
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
choice
|
||||
prompt "Select IPC Bus"
|
||||
prompt "Select Bus"
|
||||
default OWSD_USE_UBUS
|
||||
depends on PACKAGE_owsd
|
||||
help
|
||||
Select which IPC bus to compile owsd for
|
||||
Select which bus to compile owsd for
|
||||
|
||||
config OWSD_USE_DBUS
|
||||
bool "Use DBUS"
|
||||
@@ -15,11 +15,3 @@ config OWSD_USE_DBUS_UBUS
|
||||
bool "Use UBUS and DBUS"
|
||||
|
||||
endchoice
|
||||
|
||||
config OWSD_UPROXYD
|
||||
bool "Enable UBUS Proxy Daemon"
|
||||
default y if OWSD_USE_UBUS || OWSD_USE_DBUS_UBUS
|
||||
help
|
||||
Enabling uproxyd automates detection of other
|
||||
UBUS-X enabled devices in the network
|
||||
|
||||
|
||||
@@ -5,27 +5,25 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=owsd
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_VERSION:=1.1.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=930db7f4af821e91f46107c8a76b60f943ec7c3b
|
||||
PKG_SOURCE_VERSION:=f0eedeb6fd061edf3784d6bf86fa60b176bf3fe7
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS CONFIG_OWSD_UPROXYD
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_OWSD_USE_DBUS CONFIG_OWSD_USE_UBUS CONFIG_OWSD_USE_DBUS_UBUS
|
||||
|
||||
USE_UBUS-y:=-DWSD_HAVE_UBUS=ON
|
||||
USE_DBUS-y:=-DWSD_HAVE_DBUS=ON
|
||||
USE_BOTH-y:=${USE_UBUS-y} ${USE_DBUS-y}
|
||||
USE_UPROXYD-y:=-DOWSD_UPROXYD=ON
|
||||
|
||||
CMAKE_OPTIONS:=${USE_UBUS-${CONFIG_OWSD_USE_UBUS}} \
|
||||
${USE_DBUS-${CONFIG_OWSD_USE_DBUS}} \
|
||||
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}} \
|
||||
${USE_UPROXYD-${CONFIG_OWSD_UPROXYD}}
|
||||
${USE_BOTH-${CONFIG_OWSD_USE_DBUS_UBUS}}
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
@@ -53,8 +51,6 @@ endef
|
||||
define Package/owsd/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owsd $(1)/usr/bin/owsd
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uproxyd $(1)/sbin/uproxyd
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/owsd.init $(1)/etc/init.d/owsd
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
|
||||
@@ -301,15 +301,11 @@ start_service() {
|
||||
procd_set_param respawn
|
||||
|
||||
procd_close_instance
|
||||
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
# Start uproxyd
|
||||
procd_open_instance
|
||||
procd_set_param command $UPROXYD
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
|
||||
# Start uproxyd
|
||||
procd_open_instance
|
||||
procd_set_param command $UPROXYD
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
#stop_service()
|
||||
|
||||
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=4.1.0
|
||||
PKG_VERSION:=4.0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=fdd80766b50fce51f68ff675b0e5398e0d31d3bb
|
||||
PKG_SOURCE_VERSION:=d19501b6f80ef649b2ffd2f87132df885ce4581f
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
|
||||
|
||||
@@ -59,6 +59,7 @@ define Package/questd/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/questd $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wificontrol $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/graphd $(1)/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/uproxyd $(1)/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netcheck $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_INSTALL:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
|
||||
PKG_SOURCE_VERSION:=ad94ccdd82b22527ab32937ca1a2682030319ed3
|
||||
PKG_SOURCE_VERSION:=63569245b62d90d3106cc826f2d2b18f51c0b885
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
config rule
|
||||
option event 'test.event'
|
||||
list event_data "{'test': 1, 'reason': 1}"
|
||||
list event_data "{'tests': [1, 2, 3]}"
|
||||
option method 'file->write'
|
||||
list method_data "{'path': '/tmp/test_event.txt'}"
|
||||
list method_data "{'data': 'test event received!'}"
|
||||
|
||||
@@ -14,7 +14,7 @@ PKG_SOURCE_PROTO:=git
|
||||
|
||||
ifdef CONFIG_TARGET_intel_mips
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:intel/uboot.git
|
||||
PKG_SOURCE_VERSION:=c77089efc41ea3292125330221bd5016796631b9
|
||||
PKG_SOURCE_VERSION:=15e223e20e5680bc446e84b4d8b5bce06b45fb1b
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/uboot.git
|
||||
PKG_SOURCE_VERSION:=3ef2ba866a99205496e0ce01935c89a1778d9b85
|
||||
@@ -74,7 +74,7 @@ define uboot/grx500_norrland
|
||||
TITLE:=U-Boot for Norrland Board
|
||||
UBOOT_IMG:=u-boot-nand.bin
|
||||
DEPENDS:=@TARGET_intel_mips
|
||||
PKG_RELEASE:=14
|
||||
PKG_RELEASE:=11
|
||||
endef
|
||||
|
||||
UBOOTS := \
|
||||
|
||||
@@ -8,7 +8,7 @@ PKG_NAME:=uspd
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e8ee6a35751e661dd621b8b5c4cb788fe2081f58
|
||||
PKG_SOURCE_VERSION:=a5fba2890d05e868605431dacd32ffda4bdc232d
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
|
||||
@@ -1917,11 +1917,9 @@ configure_tel_line()
|
||||
config_get clir $1 clir
|
||||
|
||||
#If line is configured with no sip_provider, or sip_provider is disabled, use local_extensions context
|
||||
[ -n "$sip_provider" ] && {
|
||||
config_get sip_provider_user $sip_provider user
|
||||
config_get sip_provider_enabled $sip_provider enabled
|
||||
}
|
||||
if [ -z "$sip_provider" -o "$sip_provider" == "-" -o -z "$sip_provider_enabled" -o "$sip_provider_enabled" == "0" -o -z "$sip_provider_user" ] ; then
|
||||
config_get sip_provider_user $sip_provider user
|
||||
config_get sip_provider_enabled $sip_provider enabled
|
||||
if [ "$sip_provider" == "-" -o -z "$sip_provider_enabled" -o "$sip_provider_enabled" == "0" -o -z "$sip_provider_user" ] ; then
|
||||
sip_provider="local_extensions"
|
||||
fi
|
||||
|
||||
@@ -2064,48 +2062,6 @@ pbx_fix_ownership()
|
||||
chown $ASTUSER:$ASTGROUP -R $ASTDIRSRECURSIVE
|
||||
}
|
||||
|
||||
# Set voice_client.LINE_x.sip_account correctly as per "voice_client.sipX.call_lines"
|
||||
set_line_sip_account()
|
||||
{
|
||||
local tel_line=$1
|
||||
local old_sip_account=
|
||||
local new_sip_account=
|
||||
local line_name=$(getLineName)
|
||||
local line_name_len=${#line_name}
|
||||
local lnum=${tel_line:${line_name_len}}
|
||||
local chan_name=$(getChannelName)
|
||||
local ___type="sip_service_provider"
|
||||
local section cfgtype call_lines chan_num
|
||||
|
||||
config_get old_sip_account $tel_line sip_account
|
||||
|
||||
# Note: On Intel platform, tel_line's section name starts with 0, e.g. tapi0.
|
||||
# But channel index in voice_client.sipX.call_lines starts with 1, e.g. TAPI/1
|
||||
if [ "$line_name" == "tapi" ]; then
|
||||
chan_num=$((lnum+1))
|
||||
else
|
||||
chan_num=$lnum
|
||||
fi
|
||||
|
||||
for section in ${CONFIG_SECTIONS}; do
|
||||
config_get cfgtype "$section" TYPE
|
||||
[ -n "$___type" -a "x$cfgtype" != "x$___type" ] && continue
|
||||
config_get call_lines "$section" call_lines
|
||||
# Note: tel_line's section name starts with 0, e.g. tapi0 or brcm0.
|
||||
# But channel index in voice_client.sipX.call_lines starts with 1, e.g. TAPI/1
|
||||
[ -n "$call_lines" ] && echo "$call_lines" | grep -q "$chan_name/$chan_num" && {
|
||||
# Append this sip_acount to the tel line
|
||||
if [ -z "$new_sip_account" ]; then
|
||||
new_sip_account="$section"
|
||||
else
|
||||
new_sip_account="$new_sip_account $section"
|
||||
fi
|
||||
}
|
||||
done
|
||||
|
||||
[ "$old_sip_account" != "$new_sip_account" ] && uci_set voice_client $tel_line sip_account "$new_sip_account"
|
||||
}
|
||||
|
||||
#
|
||||
# Calculate a name for each $(getLineName) line, depending on port type
|
||||
# and number. The name is used to make UI look better.
|
||||
@@ -2202,12 +2158,6 @@ start_service() {
|
||||
# Load config file
|
||||
config_load voice_client
|
||||
|
||||
########################################################
|
||||
# Set line sip_account according to sip accounts'
|
||||
# settings
|
||||
########################################################
|
||||
config_foreach set_line_sip_account tel_line
|
||||
|
||||
########################################################
|
||||
# Set line names according to board parameters
|
||||
# and delete non-existing lines from voice_client config
|
||||
@@ -2216,9 +2166,6 @@ start_service() {
|
||||
config_foreach set_line_name tel_line $maxlinenum
|
||||
uci_commit voice_client
|
||||
|
||||
# Reload the config since it has changed
|
||||
config_load voice_client
|
||||
|
||||
#######################################
|
||||
# Create temporary files from templates
|
||||
#######################################
|
||||
@@ -2344,17 +2291,16 @@ stop_service() {
|
||||
|
||||
reload_service() {
|
||||
start
|
||||
# turn off voice led; asterisk will turn it on if there is a registered account
|
||||
#stop
|
||||
# turn off voice led; asterisk will turn it on
|
||||
# if there is a registered account
|
||||
ubus call led.voice1 set '{"state":"off"}'
|
||||
|
||||
# FXS channel module must be reloaded before sip module. Otherwise some attributes like
|
||||
# line's registration state which is updated by SIP module through callback might be
|
||||
# reset.
|
||||
asterisk -rx "$(getChipVendor) reload"
|
||||
asterisk -rx "config reload $ASTERISKDIR/sip.conf"
|
||||
sleep 1
|
||||
asterisk -rx "core reload"
|
||||
asterisk -rx "dialplan reload"
|
||||
asterisk -rx "$(getChipVendor) reload"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=wifilife
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=fe0e8fd3832ef3a70ac3938f9b458d05a349b0be
|
||||
PKG_SOURCE_VERSION:=837631d44eafa3827a1c1c1603540658744f4a9a
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
ifeq ($(CONFIG_WIFILIFE_OPEN),y)
|
||||
@@ -52,8 +52,10 @@ TARGET_CFLAGS += \
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/wifilife/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) -r ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/wifilife.init $(1)/etc/init.d/wifilife
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wifiagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/mbid.sh
|
||||
|
||||
remove_mbid_rules() {
|
||||
old_rules="$(cat "/tmp/mbid_rules" 2>/dev/null)"
|
||||
IFS=$'\n'
|
||||
for old_rule in $old_rules; do
|
||||
old_rule=${old_rule/-A /-D }
|
||||
eval $old_rule 2>/dev/null
|
||||
done
|
||||
rm /tmp/mbid_rules
|
||||
}
|
||||
|
||||
# read firewall parental rules and add repeated addresses
|
||||
append_mbid_rules() {
|
||||
[ "$(uci -q get owsd.ubusproxy.enable)" == "1" ] || return
|
||||
|
||||
octets=$(get_octets)
|
||||
mobid=$(get_mobid)
|
||||
[ -z "$mobid" -o -z "$octets" ] && return
|
||||
|
||||
rule=""
|
||||
oct2="$(echo $mobid | awk '{print $1}')"
|
||||
oct3="$(echo $mobid | awk '{print $2}')"
|
||||
rules="$(cat /tmp/fw3.rules.ipv4 | grep -i forward | grep -i "\-\-mac\-source")"
|
||||
[ -z "$rules" ] && return
|
||||
|
||||
IFS=$'\n'
|
||||
for rule in $rules; do
|
||||
chain="$(echo $rule | awk '{print tolower($5)}')"
|
||||
[ -z "$chain" -o "$chain" != "forward" ] && continue
|
||||
|
||||
# delete rule, replace --append with --delete
|
||||
del_rule=${rule/-A /-D }
|
||||
while [ -z "$(eval "$del_rule" 2>&1)" ]; do
|
||||
:
|
||||
done
|
||||
|
||||
mac=$(echo $rule | awk '{print $9}')
|
||||
|
||||
# re-append rule
|
||||
eval $rule
|
||||
|
||||
rpt_macs=$(repeated_macs $octets $oct2 $oct3 $mac | awk '{print toupper($0)}')
|
||||
> /tmp/mbid_rules
|
||||
for rpt_mac in $rpt_macs; do
|
||||
[ -z "$rpt_mac" ] && continue
|
||||
rpt_rule=${rule/$mac/$rpt_mac}
|
||||
del_rule=${rpt_rule/-A /-D }
|
||||
while [ -z "$(eval "$del_rule" 2>&1)" ]; do
|
||||
:
|
||||
done
|
||||
|
||||
eval $rpt_rule
|
||||
echo $rpt_rule >> /tmp/mbid_rules
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
while [ -f /tmp/mbid.lock ]; do
|
||||
sleep 2
|
||||
done
|
||||
touch /tmp/mbid.lock
|
||||
remove_mbid_rules
|
||||
append_mbid_rules
|
||||
rm /tmp/mbid.lock
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"if" : [
|
||||
{
|
||||
"event": "ubus.object.add",
|
||||
"regex": true,
|
||||
"match": {
|
||||
"path":".*\/wifi\\.agent"
|
||||
}
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"object": "file",
|
||||
"method":"exec",
|
||||
"args": {
|
||||
"command": "sh",
|
||||
"params": ["/etc/firewall.mbid"]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -18,27 +18,5 @@ add_dnsmasq_lease_hwmask() {
|
||||
fi
|
||||
}
|
||||
|
||||
add_firewall_mbid() {
|
||||
local ubusx="$(uci -q get owsd.ubusproxy.enable)"
|
||||
if [ -f /etc/firewall.mbid ]; then
|
||||
uci -q get firewall.mbid || {
|
||||
uci -q set firewall.mbid=include
|
||||
uci -q set firewall.mbid.path="/etc/firewall.mbid"
|
||||
uci -q set firewall.mbid.reload=1
|
||||
uci del_list firewall.mbid._access_w=root
|
||||
uci add_list firewall.mbid._access_w=root
|
||||
uci commit firewall
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
add_ruleng_section() {
|
||||
uci -q add ruleng rule
|
||||
uci -q set ruleng.@rule[-1].recipe='/etc/ruleng/mbid.json'
|
||||
uci commit ruleng
|
||||
}
|
||||
|
||||
add_owsd_object_wifi
|
||||
add_dnsmasq_lease_hwmask
|
||||
add_firewall_mbid
|
||||
add_ruleng_section
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
mobid_cb() {
|
||||
local device mobility_domain
|
||||
|
||||
config_get device $1 device
|
||||
[ "$device" != "$2" ] && return;
|
||||
|
||||
config_get mobility_domain $1 mobility_domain
|
||||
echo "$mobility_domain"
|
||||
}
|
||||
|
||||
_get_mobid() {
|
||||
vif=$1
|
||||
config_load wireless
|
||||
mobid="$(config_foreach mobid_cb wifi-iface $vif)"
|
||||
echo $mobid
|
||||
}
|
||||
|
||||
repeated_macs() {
|
||||
octets=$1
|
||||
oct2=$2
|
||||
oct3=$3
|
||||
mac=$4
|
||||
macs=""
|
||||
oct456=${mac:9}
|
||||
|
||||
[ -z "$octets" -o -z "$oct2" -o -z "$oct3" -o -z "$mac" -o -z "$oct456" ] && return
|
||||
|
||||
IFS=$' '
|
||||
for oct1 in $octets; do
|
||||
macs="$oct1:$oct2:$oct3:$oct456 $macs"
|
||||
done
|
||||
|
||||
echo "$macs"
|
||||
}
|
||||
|
||||
# transform a mac address to all possibly repeated - recommended when parsing one or few MACs
|
||||
mac_to_repeated() {
|
||||
mac=$1
|
||||
octets=""
|
||||
oct2=""
|
||||
oct3=""
|
||||
|
||||
octets=$(get_octets)
|
||||
mobid=$(get_mobid)
|
||||
[ -z "$mobid" -o -z "$octets" ] && return
|
||||
|
||||
oct2="$(echo $mobid | awk '{print $1}')"
|
||||
oct3="$(echo $mobid | awk '{print $2}')"
|
||||
|
||||
echo "$(repeated_macs $octets $oct2 $oct3 $mac)"
|
||||
}
|
||||
|
||||
assocl_match_mac() {
|
||||
mac=$1
|
||||
|
||||
res="$(ubus call wifix assoclist 2>/dev/null)"
|
||||
|
||||
json_load "$res"
|
||||
json_select assoclist 2>/dev/null
|
||||
json_get_keys keys
|
||||
|
||||
IFS=$' '
|
||||
for key in $keys; do
|
||||
json_select $key 2>/dev/null
|
||||
json_get_var macaddr macaddr
|
||||
json_select ..
|
||||
|
||||
[ "$macaddr" = "$mac" ] || continue
|
||||
|
||||
octet=$(echo $macaddr | cut -c1-2)
|
||||
echo "$octet"
|
||||
done
|
||||
}
|
||||
|
||||
get_octet() {
|
||||
ip=$1
|
||||
|
||||
res="$(ubus call router.net arp 2>/dev/null)"
|
||||
|
||||
json_load "$res"
|
||||
json_select table 2>/dev/null
|
||||
json_get_keys keys
|
||||
IFS=$' '
|
||||
for key in $keys; do
|
||||
json_select $key 2>/dev/null
|
||||
json_get_var ipaddr ipaddr
|
||||
json_get_var macaddr macaddr
|
||||
json_select ..
|
||||
|
||||
[ "$ipaddr" = "$ip" ] || continue
|
||||
|
||||
echo "$(assocl_match_mac $macaddr)"
|
||||
done
|
||||
}
|
||||
|
||||
# only get all first octets - use when parsing several MACS
|
||||
get_octets() {
|
||||
octets=""
|
||||
assoclist=""
|
||||
neighbors=""
|
||||
|
||||
objects=$(ubus list | grep -E '.*\/wifix$')
|
||||
[ -z "$objects" ] && return
|
||||
|
||||
for obj in $objects; do
|
||||
ip=$(echo $obj | cut -d'/' -f1)
|
||||
octet="$(get_octet $ip)"
|
||||
[ "$octets" != "${octets/$octet/}" ] && continue
|
||||
octets="$octet $octets"
|
||||
done
|
||||
|
||||
echo "$octets"
|
||||
}
|
||||
|
||||
# get only mobid - use when parsing several MACS
|
||||
get_mobid() {
|
||||
mobid="500"
|
||||
|
||||
radios="$(ubus -t1 call wifix radios 2>/dev/null)"
|
||||
[ -z "$radios" ] && return
|
||||
|
||||
json_load "$radios"
|
||||
json_get_keys keys
|
||||
IFS=$' '
|
||||
for key in $keys; do
|
||||
val="$(_get_mobid $key)"
|
||||
[ -n "$val" ] && mobid=$val;
|
||||
done
|
||||
|
||||
mobid=$(printf "%04x" $mobid)
|
||||
|
||||
# if little endian
|
||||
if [ "$(echo -n I | hexdump -o | awk '{ print substr($2,6,1); exit}')" = "1" ]; then
|
||||
oct2=${mobid:2}
|
||||
oct3=${mobid%??}
|
||||
else
|
||||
oct2=${mobid%??}
|
||||
oct3=${mobid:2}
|
||||
fi
|
||||
|
||||
echo "$oct2 $oct3"
|
||||
}
|
||||
0
wifilife/files/etc/init.d/wifilife → wifilife/files/wifilife.init
Executable file → Normal file
0
wifilife/files/etc/init.d/wifilife → wifilife/files/wifilife.init
Executable file → Normal file
@@ -8,7 +8,7 @@ PKG_NAME:=wifimngr
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8fe360e39fa71dbf5f7618afaba4b05da804981e
|
||||
PKG_SOURCE_VERSION:=659602bc62a244d5b53e452b7ee10ff846f03d01
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifimngr.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user