mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
1 Commits
owsd_vhost
...
philippe-d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8990c2ce0 |
@@ -11,7 +11,7 @@ PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5a5c94b289c79bc3a635b8d742dd9b73dcc0615f
|
||||
PKG_SOURCE_VERSION:=637aa9ef231f81d195f7a1b67c70af445ade7fee
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c656cd47a9f911cfe3946e3d4a374b4ae9e5d801
|
||||
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:=da5bcdbaa96d01e878d921c90c34a04bbdfca973
|
||||
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,14 +51,14 @@ 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
|
||||
$(INSTALL_CONF) ./files/owsd.config $(1)/etc/config/owsd
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(INSTALL_BIN) ./files/owsd.hotplug $(1)/etc/hotplug.d/iface/55-owsd
|
||||
# $(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
# $(INSTALL_BIN) ./files/owsd.uci_default $(1)/etc/uci-defaults/55-owsd-interfaces
|
||||
endef
|
||||
|
||||
define Package/owsd-testdata
|
||||
|
||||
@@ -126,8 +126,8 @@ validate_owsd_global() {
|
||||
|
||||
}
|
||||
|
||||
append_str() {
|
||||
json_add_string "" "$1"
|
||||
append_origin() {
|
||||
procd_append_param command -o"$1"
|
||||
}
|
||||
|
||||
append_origin_parts() {
|
||||
@@ -137,9 +137,9 @@ append_origin_parts() {
|
||||
port="$3"
|
||||
|
||||
if [ "${proto}" = "https" -a "${port}" -eq 443 -o "${proto}" = "http" -a "${port}" -eq 80 ]; then
|
||||
append_str "${proto}://${host}"
|
||||
append_origin "${proto}://${host}"
|
||||
else
|
||||
append_str "${proto}://${host}:${port}"
|
||||
append_origin "${proto}://${host}:${port}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -150,7 +150,6 @@ validate_owsd_iface() {
|
||||
'origin:list(string)' \
|
||||
'whitelist_interface_as_origin:bool:0' \
|
||||
'whitelist_dhcp_domains:bool:0' \
|
||||
'whitelist_all_origins:bool:0' \
|
||||
'ipv6:bool:1' \
|
||||
'ipv6only:bool:0' \
|
||||
'linklocal:bool:0' \
|
||||
@@ -164,7 +163,7 @@ validate_owsd_iface() {
|
||||
}
|
||||
|
||||
parse_owsd_iface() {
|
||||
local port interface whitelist_interface_as_origin whitelist_dhcp_domains whitelist_all_origins ipv6 ipv6only linklocal
|
||||
local port interface whitelist_interface_as_origin whitelist_dhcp_domains ipv6 ipv6only linklocal
|
||||
local cert key ca
|
||||
local restrict_to_user
|
||||
local ubusx_acl
|
||||
@@ -176,46 +175,32 @@ parse_owsd_iface() {
|
||||
|
||||
# utility function
|
||||
new_listen_socket() {
|
||||
json_add_int "port" ${port}
|
||||
procd_append_param command -p "${port}"
|
||||
|
||||
[ -n "${cert}" ] && json_add_string "cert" "${cert}"
|
||||
[ -n "${key}" ] && json_add_string "key" "${key}"
|
||||
[ -n "${ca}" ] && json_add_string "ca" "${ca}"
|
||||
procd_append_param command -L"$1"
|
||||
|
||||
[ -n "${restrict_to_user}" ] && {
|
||||
json_add_array "restrict_to_user"
|
||||
config_list_foreach "$1" "restrict_to_user" append_str
|
||||
json_close_array
|
||||
}
|
||||
[ -n "$2" ] && json_add_string "interface" "$2"
|
||||
[ -n "${cert}" ] && procd_append_param command -c"${cert}"
|
||||
[ -n "${key}" ] && procd_append_param command -k"${key}"
|
||||
[ -n "${ca}" ] && procd_append_param command -a"${ca}"
|
||||
|
||||
[ -n "${ubusx_acl}" ] && json_add_string "ubusx_acl" "$ubusx_acl"
|
||||
[ -n "${restrict_to_user}" ] && procd_append_param command -u"${restrict_to_user}"
|
||||
|
||||
[ -n "$2" ] && procd_append_param command -i"$2"
|
||||
|
||||
[ -n "${ubusx_acl}" ] && procd_append_param command -X"${ubusx_acl}"
|
||||
|
||||
}
|
||||
|
||||
origin_whitelist_all() {
|
||||
[ "$1" = "*" ] && echo "true"
|
||||
}
|
||||
|
||||
append_whitelists() {
|
||||
config_list_foreach "$1" "origin" append_str
|
||||
|
||||
[ -n "$2" ] && whitelist_all_origins=1
|
||||
|
||||
if [ "$whitelist_all_origins" -eq 1 ]; then
|
||||
whitelist_dhcp_domains=1
|
||||
whitelist_interface_as_origin=1
|
||||
fi
|
||||
append_whitelists () {
|
||||
config_list_foreach "$1" "origin" append_origin
|
||||
|
||||
if [ "$whitelist_dhcp_domains" -eq 1 ]; then
|
||||
echo $1 domains = $DHCP_DOMAINS > /dev/console
|
||||
for domain in $DHCP_DOMAINS; do
|
||||
append_origin_parts "${http}" "${domain}" "${port}"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "${interface}" -a -n "${addr}" -a "${whitelist_interface_as_origin}" -eq 1 ]; then
|
||||
echo $1 whitelisting interface $http $addr $port > /dev/console
|
||||
append_origin_parts "${http}" "${addr}" "${port}"
|
||||
fi
|
||||
}
|
||||
@@ -227,22 +212,13 @@ parse_owsd_iface() {
|
||||
if [ -n "${interface}" ]; then
|
||||
# 1 listen-socket (vhost) for each IP address on that network's iface
|
||||
|
||||
whitelist=$(config_list_foreach "$1" "origin" origin_whitelist_all)
|
||||
|
||||
# ipv4 addresses
|
||||
if [ "${ipv6only}" -eq 0 ]; then
|
||||
network_get_ipaddrs ip4addrs "${interface}";
|
||||
fi
|
||||
|
||||
json_add_array "$1"
|
||||
for addr in ${ip4addrs}; do
|
||||
json_add_object "${1}"
|
||||
new_listen_socket "$1" "${addr}"
|
||||
[ -n "$whitelist" -o "$whitelist_all_origins" -eq 1 ] && json_add_boolean "origin_check" false
|
||||
json_add_array "origin"
|
||||
append_whitelists "$1" "$whitelist"
|
||||
json_close_array
|
||||
json_close_object
|
||||
append_whitelists "$1"
|
||||
done
|
||||
|
||||
# ipv6 addresses
|
||||
@@ -254,24 +230,16 @@ parse_owsd_iface() {
|
||||
ip6addrs="${ip6addrs} ${linklocaladdrs}"
|
||||
fi
|
||||
fi
|
||||
|
||||
for addr in ${ip6addrs}; do
|
||||
json_add_object "${1}6"
|
||||
new_listen_socket "$1" "${addr}"
|
||||
addr="\\[${addr}]"
|
||||
[ -n "$whitelist" ] && json_add_boolean "origin_check" false
|
||||
json_add_array "origin"
|
||||
append_whitelists "$1" "$whitelist"
|
||||
json_close_array
|
||||
json_add_boolean "ipv6" 1
|
||||
json_close_object
|
||||
append_whitelists "$1"
|
||||
procd_append_param command -66
|
||||
done
|
||||
json_close_array
|
||||
|
||||
else
|
||||
new_listen_socket "$1"
|
||||
if [ "${ipv6}" -eq 1 ]; then json_add_boolean "ipv6only" 1; fi
|
||||
if [ "${ipv6}" -eq 1 -a "${ipv6only}" -eq 1 ]; then json_add_boolean "ipv6only" 1; fi
|
||||
if [ "${ipv6}" -eq 1 ]; then procd_append_param command -6; fi
|
||||
if [ "${ipv6}" -eq 1 -a "${ipv6only}" -eq 1 ]; then procd_append_param command -6; fi
|
||||
|
||||
append_whitelists "$1"
|
||||
fi
|
||||
@@ -295,15 +263,11 @@ start_service() {
|
||||
echo "Global validation failed"
|
||||
return 1
|
||||
}
|
||||
json_init
|
||||
json_add_object "global"
|
||||
[ -n "${sock}" ] && json_add_string "socket" "$sock"
|
||||
[ -n "${www}" ] && json_add_string "www" "$www"
|
||||
[ -n "${redirect}" ] && json_add_string "redirect" "$redirect"
|
||||
[ -n "${www_maxage}" ] && json_add_int "www_maxage" "$www_maxage"
|
||||
json_close_object
|
||||
|
||||
procd_append_param command -f "/tmp/owsd/owsd_cfg.json"
|
||||
[ -n "${sock}" ] && procd_append_param command -s"${sock}"
|
||||
[ -n "${www}" ] && procd_append_param command -w"${www}"
|
||||
[ -n "${redirect}" ] && procd_append_param command -r"${redirect}"
|
||||
[ -n "${www_maxage}" ] && procd_append_param command -t"${www_maxage}"
|
||||
|
||||
validate_owsd_ubusproxy || {
|
||||
echo "Ubusproxy validation failed"
|
||||
@@ -311,51 +275,37 @@ start_service() {
|
||||
}
|
||||
|
||||
if [ "${enable}" -eq 1 ]; then
|
||||
json_add_object "ubusproxy"
|
||||
procd_append_param command -U
|
||||
|
||||
[ -n "${peer_cert}" ] && json_add_string "peer_cert" "${peer_cert}"
|
||||
[ -n "${peer_key}" ] && json_add_string "peer_key" "${peer_key}"
|
||||
[ -n "${peer_ca}" ] && json_add_string "peer_ca" "${peer_ca}"
|
||||
[ -n "${peer_cert}" ] && procd_append_param command -C"${peer_cert}"
|
||||
[ -n "${peer_key}" ] && procd_append_param command -K"${peer_key}"
|
||||
[ -n "${peer_ca}" ] && procd_append_param command -A"${peer_ca}"
|
||||
|
||||
append_peer () {
|
||||
[ -n "$1" ] && json_add_string "peer" "$1"
|
||||
[ -n "$1" ] && procd_append_param command -P"$1"
|
||||
}
|
||||
|
||||
append_object () {
|
||||
[ -n "$1" ] && json_add_string "object" "$1"
|
||||
[ -n "$1" ] && procd_append_param command -U"$1"
|
||||
}
|
||||
|
||||
json_add_array "peer"
|
||||
config_list_foreach "ubusproxy" "peer" append_peer
|
||||
json_close_array
|
||||
json_add_array "object"
|
||||
config_list_foreach "ubusproxy" "object" append_object
|
||||
json_close_array
|
||||
|
||||
[ "${prefix}" == "mac" ] && json_add_string "prefix" "mac"
|
||||
json_close_object
|
||||
[ "${prefix}" == "mac" ] && procd_append_param command -F"mac"
|
||||
fi
|
||||
|
||||
json_add_object "owsd-listen"
|
||||
config_foreach parse_owsd_iface "owsd-listen"
|
||||
json_close_object
|
||||
json_dump > /dev/console
|
||||
|
||||
[ ! -d "/tmp/owsd" ] && mkdir /tmp/owsd
|
||||
json_dump > /tmp/owsd/owsd_cfg.json
|
||||
# procd_set_param stderr 1
|
||||
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()
|
||||
|
||||
87
owsd/files/owsd.uci_default
Normal file
87
owsd/files/owsd.uci_default
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
MGMT_INTERFACES=""
|
||||
OWSD_INTERFACES=""
|
||||
NOT_DEFAULT=0
|
||||
|
||||
mgmt_interfaces() {
|
||||
local interface=$1
|
||||
[ "$interface" == "loopback" ] && return
|
||||
[ "$interface" == "lan" ] && return
|
||||
[ "$interface" == "wan" ] && return
|
||||
[ "$interface" == "wan6" ] && return
|
||||
|
||||
local type proto
|
||||
config_get type $interface type
|
||||
config_get proto $interface proto "none"
|
||||
[ "$type" == "bridge" -a "$proto" == "none" ] && return
|
||||
|
||||
local is_lan
|
||||
config_get is_lan $interface is_lan
|
||||
[ "$is_lan" == "1" ] && return
|
||||
|
||||
local ifname
|
||||
config_get ifname $interface ifname
|
||||
[ "${ifname:0:1}" == "@" ] && return
|
||||
|
||||
MGMT_INTERFACES="$MGMT_INTERFACES $interface"
|
||||
}
|
||||
|
||||
owsd_interfaces() {
|
||||
local config=$1
|
||||
local interface
|
||||
config_get interface $config interface
|
||||
[ "$interface" == "loopback" ] && return
|
||||
[ "$interface" == "lan" ] && return
|
||||
[ "$interface" == "wan" ] && return
|
||||
[ "$interface" == "wan6" ] && return
|
||||
|
||||
OWSD_INTERFACES="$OWSD_INTERFACES $interface"
|
||||
|
||||
NOT_DEFAULT=1
|
||||
}
|
||||
|
||||
not_owsd() {
|
||||
local interface=$1
|
||||
local there=0
|
||||
for owsd in $OWSD_INTERFACES; do
|
||||
if [ "$interface" == "$owsd" ]; then
|
||||
there=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
return $there
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach mgmt_interfaces interface
|
||||
|
||||
config_load owsd
|
||||
config_foreach owsd_interfaces owsd-listen
|
||||
|
||||
if [ $NOT_DEFAULT -eq 0 ]; then
|
||||
for mgmt in $MGMT_INTERFACES; do
|
||||
if $(not_owsd $mgmt); then
|
||||
uci -q set owsd.$mgmt=owsd-listen
|
||||
uci -q set owsd.$mgmt.port=80
|
||||
uci -q set owsd.$mgmt.interface="$mgmt"
|
||||
uci -q set owsd.$mgmt.ipv6="on"
|
||||
uci -q set owsd.$mgmt.whitelist_interface_as_origin="1"
|
||||
uci -q set owsd.$mgmt.origin="*"
|
||||
|
||||
uci -q set owsd.$mgmt"_8080"=owsd-listen
|
||||
uci -q set owsd.$mgmt"_8080".port=8080
|
||||
uci -q set owsd.$mgmt"_8080".interface="$mgmt"
|
||||
uci -q set owsd.$mgmt"_8080".ipv6="on"
|
||||
uci -q set owsd.$mgmt"_8080".whitelist_interface_as_origin="1"
|
||||
uci -q set owsd.$mgmt"_8080".origin="*"
|
||||
|
||||
uci commit owsd
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -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:=3c7c4da8cdf14e4abb75a41e3ef9f2eddc9d75ae
|
||||
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 := \
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=50a4346d518fd80d22cd9694ee3c1dba336bd072
|
||||
PKG_SOURCE_VERSION:=a5fba2890d05e868605431dacd32ffda4bdc232d
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ START=60
|
||||
USE_PROCD=1
|
||||
|
||||
# Some global variables
|
||||
SERIAL="$(getSerial)"
|
||||
BASEMAC="$(getBaseMAC)"
|
||||
SERIAL=$(getSerial)
|
||||
BASEMAC=$(getBaseMAC)
|
||||
MODULENAME=voice
|
||||
USERAGENT="Inteno_${SERIAL}_${BASEMAC}"
|
||||
|
||||
@@ -32,10 +32,7 @@ ASTERISKDIR=/etc/asterisk
|
||||
WORKDIR=/tmp/$MODULENAME.$$
|
||||
MD5SUMSFILE=/tmp/$MODULENAME-sums.$$
|
||||
|
||||
LINENAME="$(getLineName)"
|
||||
CHANNELNAME="$(getChannelName)"
|
||||
|
||||
# Whitespace separated list of $CHANNELNAME feature access codes
|
||||
# Whitespace separated list of $(getChannelName) feature access codes
|
||||
CHANNEL_FAC=
|
||||
|
||||
#TODO: go through templates, check usage
|
||||
@@ -85,7 +82,7 @@ TMPL_ACL=$TEMPLATEDIR/acl.conf.TEMPLATE
|
||||
TMPL_CONFBRIDGE=$TEMPLATEDIR/confbridge.conf.TEMPLATE
|
||||
TMPL_UDPTL=$TEMPLATEDIR/udptl.conf.TEMPLATE
|
||||
|
||||
TMPL_CHANNEL=$TEMPLATEDIR/$LINENAME.conf.TEMPLATE
|
||||
TMPL_CHANNEL=$TEMPLATEDIR/$(getLineName).conf.TEMPLATE
|
||||
TMPL_CHANNEL_LINE=$TEMPLATEDIR/tel_line.TEMPLATE
|
||||
|
||||
TMPL_MEETME=$TEMPLATEDIR/meetme.conf.TEMPLATE
|
||||
@@ -185,7 +182,7 @@ assemble_and_copy_config()
|
||||
mv $WORKDIR/sip_registrations.tmp $WORKDIR/sip_registrations.conf
|
||||
mv $WORKDIR/sip_providers.tmp $WORKDIR/sip_providers.conf
|
||||
mv $WORKDIR/sip_users.tmp $WORKDIR/sip_users.conf
|
||||
mv $WORKDIR/$LINENAME.tmp $WORKDIR/$LINENAME.conf
|
||||
mv $WORKDIR/$(getLineName).tmp $WORKDIR/$(getLineName).conf
|
||||
mv $WORKDIR/extensions.tmp $WORKDIR/extensions.conf
|
||||
mv $WORKDIR/codecs.tmp $WORKDIR/codecs.conf
|
||||
mv $WORKDIR/rtp.tmp $WORKDIR/rtp.conf
|
||||
@@ -340,7 +337,7 @@ read_lines()
|
||||
for i in $call_lines ; do
|
||||
case $i in
|
||||
''|*[!0-9]*) lines=$lines"$i&" ;;
|
||||
*) lines=$lines"$CHANNELNAME/$i&" ;;
|
||||
*) lines=$lines"$(getChannelName)/$i&" ;;
|
||||
esac
|
||||
|
||||
done
|
||||
@@ -1035,9 +1032,9 @@ configure_queue()
|
||||
do
|
||||
local out=""
|
||||
re='^[0-9]+$'
|
||||
num=${member#$LINENAME}
|
||||
num=${member#$(getLineName)}
|
||||
if [ -z "${num##[0-9]*}" ] ; then
|
||||
out="$CHANNELNAME/$num"
|
||||
out="$(getChannelName)/$num"
|
||||
else
|
||||
local sip_user
|
||||
config_get sip_user $member user
|
||||
@@ -1481,7 +1478,6 @@ configure_extensions()
|
||||
#
|
||||
configure_extensions_provider()
|
||||
{
|
||||
echo COMES HERE
|
||||
local enabled
|
||||
local displayname
|
||||
local user
|
||||
@@ -1692,7 +1688,7 @@ configure_extensions_provider()
|
||||
echo "exten => $user,n(norewrite),NoOp()">> $tmp
|
||||
|
||||
# read a list of lines that should be dialled on incoming calls
|
||||
incoming_lines="$(read_lines $1)"
|
||||
incoming_lines=$(read_lines $1)
|
||||
config_get call_queue $1 call_queue
|
||||
config_get call_ivr $1 call_ivr
|
||||
if [ -n "$incoming_lines" ]; then
|
||||
@@ -1741,7 +1737,7 @@ configure_tel_line_extension()
|
||||
local cbbs_retrytime
|
||||
local cbbs_waittime
|
||||
local mailbox
|
||||
local line_name=$LINENAME
|
||||
local line_name=$(getLineName)
|
||||
|
||||
line=${1:${#line_name}}
|
||||
config_get extension $1 extension
|
||||
@@ -1846,11 +1842,11 @@ configure_codecs()
|
||||
}
|
||||
|
||||
#
|
||||
# Configure default settings for $LINENAME.conf
|
||||
# Configure default settings for $(getLineName).conf
|
||||
#
|
||||
configure_tel()
|
||||
{
|
||||
echo "Configuring $CHANNELNAME"
|
||||
echo "Configuring $(getChannelName)"
|
||||
local jbenable
|
||||
local jbforce
|
||||
local jbmaxsize
|
||||
@@ -1877,29 +1873,29 @@ configure_tel()
|
||||
dialoutmsec=4000
|
||||
fi
|
||||
|
||||
sed -i "s/|JBENABLE|/$jbenable/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBFORCE|/$jbforce/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBMAXSIZE|/$jbmaxsize/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBIMPL|/$jbimpl/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|DIALOUTMSEC|/$dialoutmsec/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|FAC|/$CHANNEL_FAC/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|CHANNELS|/$(db get hw.board.VoicePorts)/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|ECHOCANCEL|/$(getEchoCancellingValue $echocancel)/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|JBENABLE|/$jbenable/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|JBFORCE|/$jbforce/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|JBMAXSIZE|/$jbmaxsize/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|JBIMPL|/$jbimpl/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|DIALOUTMSEC|/$dialoutmsec/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|FAC|/$CHANNEL_FAC/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|CHANNELS|/$(db get hw.board.VoicePorts)/" $WORKDIR/$(getLineName).tmp
|
||||
sed -i "s/|ECHOCANCEL|/$(getEchoCancellingValue $echocancel)/" $WORKDIR/$(getLineName).tmp
|
||||
|
||||
if [ "$dtmfmode" == "compatibility" ] ; then
|
||||
dtmfcompatibility="1"
|
||||
else
|
||||
dtmfcompatibility="0"
|
||||
fi
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/$LINENAME.tmp
|
||||
sed -i "s/|DTMFCOMPATIBILITY|/$dtmfcompatibility/" $WORKDIR/$(getLineName).tmp
|
||||
}
|
||||
|
||||
#
|
||||
# Configure settings for individual line in $LINENAME.conf
|
||||
# Configure settings for individual line in $(getLineName).conf
|
||||
#
|
||||
configure_tel_line()
|
||||
{
|
||||
echo "Configuring $CHANNELNAME line $1"
|
||||
echo "Configuring $(getChannelName) line $1"
|
||||
local extension
|
||||
local sip_provider
|
||||
local codecs
|
||||
@@ -1956,7 +1952,7 @@ configure_tel_line()
|
||||
sed -i "s/|DTMFRELAY|/$dtmfmode/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CALLWAITING|/$callwaiting/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|CLIR|/$clir/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|LINE_NAME|/$LINENAME/" $WORKDIR/tel_line.tmp
|
||||
sed -i "s/|LINE_NAME|/$(getLineName)/" $WORKDIR/tel_line.tmp
|
||||
|
||||
#Configure CHANNEL line with codecs according to the SIP line settings
|
||||
# local is_fax
|
||||
@@ -1967,7 +1963,7 @@ configure_tel_line()
|
||||
# sed -i "s/|ALLOW|/$(read_codecs $sip_provider)/" $WORKDIR/tel_line.tmp
|
||||
# fi
|
||||
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$LINENAME.tmp
|
||||
cat $WORKDIR/tel_line.tmp >> $WORKDIR/$(getLineName).tmp
|
||||
rm -f $WORKDIR/tel_line.tmp
|
||||
}
|
||||
|
||||
@@ -2067,14 +2063,14 @@ pbx_fix_ownership()
|
||||
}
|
||||
|
||||
#
|
||||
# Calculate a name for each $LINENAME line, depending on port type
|
||||
# Calculate a name for each $(getLineName) line, depending on port type
|
||||
# and number. The name is used to make UI look better.
|
||||
#
|
||||
set_line_name()
|
||||
{
|
||||
local maxlinenum=$2
|
||||
local curname name_ix ix item lnum
|
||||
local line_name=$LINENAME
|
||||
local line_name=$(getLineName)
|
||||
local line_name_len=${#line_name}
|
||||
local tel_line=$1
|
||||
|
||||
@@ -2180,7 +2176,7 @@ start_service() {
|
||||
cp $TMPL_SIP $WORKDIR/sip.tmp
|
||||
cp $TMPL_RTP $WORKDIR/rtp.tmp
|
||||
cp $TMPL_STUN $WORKDIR/res_stun_monitor.tmp
|
||||
cp $TMPL_CHANNEL $WORKDIR/$LINENAME.tmp
|
||||
cp $TMPL_CHANNEL $WORKDIR/$(getLineName).tmp
|
||||
cp $TMPL_CODECS $WORKDIR/codecs.tmp
|
||||
cp $TMPL_VOICEMAIL $WORKDIR/voicemail.tmp
|
||||
cp $TMPL_DNSMGR $WORKDIR/dnsmgr.tmp
|
||||
|
||||
@@ -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:=5ab0a61b2d8dc34be0e0053670a13876e648f94b
|
||||
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