mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
466 Commits
mapbrcmpre
...
sulu_serve
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9700880d79 | ||
|
|
18a28dbec3 | ||
|
|
12254b050b | ||
|
|
5db896e32a | ||
|
|
6e23e2cde5 | ||
|
|
11d02e4dc6 | ||
|
|
3a8e56603c | ||
|
|
558f56017e | ||
|
|
17e325ff16 | ||
|
|
abf7e7a8e1 | ||
|
|
e2377d482c | ||
|
|
cd9891b0ba | ||
|
|
05938b6ddd | ||
|
|
fbeaed38a1 | ||
|
|
f470be09ff | ||
|
|
e306650990 | ||
|
|
ffca576b3a | ||
|
|
de19106bb7 | ||
|
|
fd9193056a | ||
|
|
ec884b9adf | ||
|
|
9aed3b5e63 | ||
|
|
a231c9f993 | ||
|
|
bee450ea77 | ||
|
|
977d6f51f1 | ||
|
|
73c40d2b96 | ||
|
|
77d75b2256 | ||
|
|
5ef3575e54 | ||
|
|
1c873d34ea | ||
|
|
ba961a1407 | ||
|
|
d36930c8ce | ||
|
|
6d6f61ee80 | ||
|
|
9a84f43534 | ||
|
|
76070242ff | ||
|
|
8c876537e3 | ||
|
|
34edbde3e1 | ||
|
|
f24366bdf3 | ||
|
|
6840ad8afb | ||
|
|
d923e8bd28 | ||
|
|
3728f3a143 | ||
|
|
c00c03f28f | ||
|
|
3c3469efbe | ||
|
|
88f1ec5788 | ||
|
|
7a1ff2b8d1 | ||
|
|
4b0b880102 | ||
|
|
8654d2ad4b | ||
|
|
050a5d4853 | ||
|
|
07693e7c1b | ||
|
|
60c29e3107 | ||
|
|
615a104b7b | ||
|
|
ab75188733 | ||
|
|
c76daa8c81 | ||
|
|
796e985d05 | ||
|
|
9bc985e87f | ||
|
|
e85e676c65 | ||
|
|
55aa77e670 | ||
|
|
d81b7bd07b | ||
|
|
6add41b654 | ||
|
|
e5933d2938 | ||
|
|
8b4e7586ad | ||
|
|
d70c637aa4 | ||
|
|
c296cc2963 | ||
|
|
721fcb8b38 | ||
|
|
e26a9affbd | ||
|
|
f009a030a8 | ||
|
|
17ba40e8f6 | ||
|
|
495df7354d | ||
|
|
f012724dc5 | ||
|
|
ee77040781 | ||
|
|
e04a463e62 | ||
|
|
180d8d1168 | ||
|
|
2af7a8d044 | ||
|
|
5a6126270e | ||
|
|
488c89a6d1 | ||
|
|
ca5d16257a | ||
|
|
07b1902fe2 | ||
|
|
bcfe608301 | ||
|
|
63f448f4a8 | ||
|
|
5438c3c5da | ||
|
|
111ff9835a | ||
|
|
7cc4c33911 | ||
|
|
c61723b711 | ||
|
|
c065b8e819 | ||
|
|
885b7ff1eb | ||
|
|
ffd9ad17e2 | ||
|
|
051da80708 | ||
|
|
56aff208ba | ||
|
|
1c65f4f321 | ||
|
|
b2755d8586 | ||
|
|
9618a41d25 | ||
|
|
61eaa026a2 | ||
|
|
9ec67031b3 | ||
|
|
acc9158c33 | ||
|
|
827f47e4db | ||
|
|
e3eacc0ba8 | ||
|
|
ed9437058e | ||
|
|
191c284d97 | ||
|
|
dba98d50f7 | ||
|
|
7cf6c6f068 | ||
|
|
f6f20450a6 | ||
|
|
a003467b00 | ||
|
|
26b3432f9a | ||
|
|
f20c7ffb24 | ||
|
|
9a16c6d418 | ||
|
|
3033462d89 | ||
|
|
fe126b0de0 | ||
|
|
c64586ead5 | ||
|
|
63f1addeea | ||
|
|
1bbd034a73 | ||
|
|
8dd1190033 | ||
|
|
f3443ca88a | ||
|
|
ff0a886664 | ||
|
|
8ab7956b95 | ||
|
|
e261a216b3 | ||
|
|
8b6fb31b63 | ||
|
|
465b8e36fc | ||
|
|
af9f09493d | ||
|
|
127f9e867d | ||
|
|
8b493581e1 | ||
|
|
65edb4ab06 | ||
|
|
6ce65b0160 | ||
|
|
4e5eaad00d | ||
|
|
a11151fdd9 | ||
|
|
bd4bfd211b | ||
|
|
8d624c4951 | ||
|
|
f5dd4c185f | ||
|
|
8e1fc7dcb0 | ||
|
|
f8a0d6e54b | ||
|
|
2fd02bac1d | ||
|
|
8ccf13aca4 | ||
|
|
b21bc6c919 | ||
|
|
ba537e82cc | ||
|
|
0c8654a3b9 | ||
|
|
ac019660bd | ||
|
|
a3ccf301ca | ||
|
|
a4f8dfe53e | ||
|
|
853ba5bb3e | ||
|
|
a06fe38ed8 | ||
|
|
223461213e | ||
|
|
f5526d0a25 | ||
|
|
d551173c68 | ||
|
|
26a3790bbd | ||
|
|
755442556d | ||
|
|
164e9f21c9 | ||
|
|
9a5643cf43 | ||
|
|
671e8189c0 | ||
|
|
c31158a7ad | ||
|
|
9e46a57443 | ||
|
|
161cd71da8 | ||
|
|
1b6126456b | ||
|
|
f69864554a | ||
|
|
61a5751e0b | ||
|
|
78d3dfec15 | ||
|
|
f5ed3a7ff1 | ||
|
|
681041b7c3 | ||
|
|
264e1daf5c | ||
|
|
c19ee4f050 | ||
|
|
d225c215ee | ||
|
|
adcba33657 | ||
|
|
29ec062b90 | ||
|
|
4feecbd438 | ||
|
|
525f5c11b0 | ||
|
|
d9800428c0 | ||
|
|
339ff22025 | ||
|
|
4d94374162 | ||
|
|
4b1cc22250 | ||
|
|
fcdd71177b | ||
|
|
d100832548 | ||
|
|
3eb4b07880 | ||
|
|
6214cbb4e7 | ||
|
|
e183005a9f | ||
|
|
960d44942c | ||
|
|
d2aca948fb | ||
|
|
bf9b057ef3 | ||
|
|
703105b4cf | ||
|
|
99dd785dfd | ||
|
|
9f02022353 | ||
|
|
6bcd934ab3 | ||
|
|
1888c1ead8 | ||
|
|
6557ba4cd6 | ||
|
|
db998e69e3 | ||
|
|
e9d563ce03 | ||
|
|
b33a390839 | ||
|
|
53f80fbf10 | ||
|
|
96fc14c22f | ||
|
|
476a593656 | ||
|
|
dd9b7a8774 | ||
|
|
3f214bb959 | ||
|
|
f02b097ba3 | ||
|
|
431d29733d | ||
|
|
352f1d0cbc | ||
|
|
4fde49b43a | ||
|
|
a4576e43e9 | ||
|
|
6d7a8e5417 | ||
|
|
d05c0fa6e3 | ||
|
|
02b3f1d091 | ||
|
|
759a12b759 | ||
|
|
4f7c30f13a | ||
|
|
902b3bb8bc | ||
|
|
ece17326c8 | ||
|
|
497d17dafc | ||
|
|
36ef73caaa | ||
|
|
6142d82806 | ||
|
|
adf314079b | ||
|
|
036e57ac4e | ||
|
|
f2393cd8f1 | ||
|
|
ae91e016f5 | ||
|
|
1adfc0815f | ||
|
|
acdf50d88d | ||
|
|
30804d3556 | ||
|
|
5307d393f6 | ||
|
|
75a6c7479c | ||
|
|
8c20ef4ec7 | ||
|
|
98bebf3da1 | ||
|
|
4d8d09523e | ||
|
|
0b5a69bc31 | ||
|
|
641f9eaad2 | ||
|
|
269b13e868 | ||
|
|
b96a5d307f | ||
|
|
cb25e6708d | ||
|
|
60e3c70e57 | ||
|
|
e0ba2b94dd | ||
|
|
559c1996b9 | ||
|
|
33d951b0ec | ||
|
|
c270d3cf09 | ||
|
|
00a687cd4a | ||
|
|
24ecfe7f34 | ||
|
|
b5ff544f79 | ||
|
|
d3153244e4 | ||
|
|
2227c01289 | ||
|
|
f0407b8a37 | ||
|
|
62935f5016 | ||
|
|
3b7b6fd627 | ||
|
|
d68a6add62 | ||
|
|
12b6a72a48 | ||
|
|
812fad8c5b | ||
|
|
0a4f296858 | ||
|
|
62d3efd67e | ||
|
|
e6780b20fb | ||
|
|
84af7641ec | ||
|
|
a0195bf457 | ||
|
|
17ba9d0d6f | ||
|
|
71963c914f | ||
|
|
374892c869 | ||
|
|
af5a788d3e | ||
|
|
36f4a69b2e | ||
|
|
214bb6939f | ||
|
|
abd741b9e6 | ||
|
|
c33fd589fb | ||
|
|
b1750ac6ba | ||
|
|
de51136608 | ||
|
|
3da3e6b86d | ||
|
|
fdba0d497a | ||
|
|
4092c0e43f | ||
|
|
4b06b07acf | ||
|
|
6636e7ff47 | ||
|
|
ec8a7cffa2 | ||
|
|
41cdc9672c | ||
|
|
6fdf37e179 | ||
|
|
60c198e2e2 | ||
|
|
154b8465a6 | ||
|
|
d352796d46 | ||
|
|
562aefcab2 | ||
|
|
a4c6aec761 | ||
|
|
0e1894e5ff | ||
|
|
ca89315960 | ||
|
|
5764f7dd1d | ||
|
|
3d2b69bd33 | ||
|
|
56bfdfaf57 | ||
|
|
28835fc0ea | ||
|
|
0f7d057261 | ||
|
|
9aaef85895 | ||
|
|
50e1be5214 | ||
|
|
13f1dcfdc3 | ||
|
|
545f41ab6a | ||
|
|
a5306cb837 | ||
|
|
415768dd71 | ||
|
|
744bd43658 | ||
|
|
f6cdb4c55d | ||
|
|
01d009734c | ||
|
|
120e333a67 | ||
|
|
caf1367dd2 | ||
|
|
82d3171604 | ||
|
|
68b8051fb2 | ||
|
|
9fc87d618b | ||
|
|
013a2f2b19 | ||
|
|
b4d831147e | ||
|
|
2816342a69 | ||
|
|
68bb2d48d5 | ||
|
|
4333127c74 | ||
|
|
d03fa0c5e3 | ||
|
|
584e3db8f0 | ||
|
|
4e365be18e | ||
|
|
e722665f2f | ||
|
|
7566301349 | ||
|
|
213f840309 | ||
|
|
35c58d63d7 | ||
|
|
8382bcc0ac | ||
|
|
ac32ff013e | ||
|
|
3d077f2a18 | ||
|
|
1d6c3b5466 | ||
|
|
47130407a5 | ||
|
|
9f7db62c89 | ||
|
|
8d1d4b5590 | ||
|
|
889524d9a7 | ||
|
|
f293fa36a7 | ||
|
|
ab144f4af9 | ||
|
|
621010e16b | ||
|
|
3f2b130848 | ||
|
|
504c78965d | ||
|
|
c625d8dc29 | ||
|
|
9234254f76 | ||
|
|
436751ce8f | ||
|
|
30bf53c79c | ||
|
|
775b71b6f1 | ||
|
|
cf08d70000 | ||
|
|
48727867eb | ||
|
|
e82294aa2f | ||
|
|
768304c5a1 | ||
|
|
00c6557d0a | ||
|
|
1c22d7a19d | ||
|
|
1eb12b7923 | ||
|
|
1661322307 | ||
|
|
a408642afa | ||
|
|
62b1d840dc | ||
|
|
55afadf895 | ||
|
|
4c4e12a8ff | ||
|
|
73c5d2c481 | ||
|
|
7c041f933d | ||
|
|
fddb7e3ba7 | ||
|
|
bf82f6966d | ||
|
|
81a348efee | ||
|
|
f24602d8d4 | ||
|
|
0f5677e544 | ||
|
|
02d52bd9e1 | ||
|
|
acb2f35982 | ||
|
|
c1ef23456b | ||
|
|
00fd54ba1b | ||
|
|
3406185b1c | ||
|
|
6f233e19bf | ||
|
|
9227f52a16 | ||
|
|
70889fd1ae | ||
|
|
c09267da8f | ||
|
|
d4a9cde562 | ||
|
|
1824013aeb | ||
|
|
13c858421c | ||
|
|
a917d47854 | ||
|
|
4c11a12d11 | ||
|
|
73a7d9cc42 | ||
|
|
68a51047e9 | ||
|
|
42db3eaf5d | ||
|
|
8c867fc829 | ||
|
|
c9bc7a3dea | ||
|
|
7c05f41418 | ||
|
|
47fe3342d3 | ||
|
|
135b15c101 | ||
|
|
26a75d11f0 | ||
|
|
85a20c9485 | ||
|
|
e239e77fdd | ||
|
|
4824b441b6 | ||
|
|
3bb9298485 | ||
|
|
557ed06daa | ||
|
|
1f0e4a191c | ||
|
|
03e29020e2 | ||
|
|
f314c20b8a | ||
|
|
5f2e737e7c | ||
|
|
0e32d885b0 | ||
|
|
363ae3044e | ||
|
|
2f5d167976 | ||
|
|
558936d23d | ||
|
|
b946784deb | ||
|
|
7adf27bcaf | ||
|
|
85d804d575 | ||
|
|
4a756c84c7 | ||
|
|
db91f3809a | ||
|
|
55ba075a82 | ||
|
|
98403702fe | ||
|
|
f50af42366 | ||
|
|
9ea69b1c07 | ||
|
|
338856f15d | ||
|
|
a5459d4ee6 | ||
|
|
d143e9af96 | ||
|
|
bf7e5fca47 | ||
|
|
eb1224022e | ||
|
|
55835b3af0 | ||
|
|
e0eec6c755 | ||
|
|
c8e1e6538a | ||
|
|
3e60ebb118 | ||
|
|
42bd799915 | ||
|
|
64369a08f4 | ||
|
|
3dd570990e | ||
|
|
7e8f51d15b | ||
|
|
2faada9f0b | ||
|
|
1d88107cc6 | ||
|
|
65ecbbde31 | ||
|
|
0c8b29d7d5 | ||
|
|
45f0f50740 | ||
|
|
6ecc48540f | ||
|
|
a027edeca2 | ||
|
|
dd25486412 | ||
|
|
d345eefd86 | ||
|
|
4b272be181 | ||
|
|
09d49cb77d | ||
|
|
0e8b8eb69d | ||
|
|
a2610d371d | ||
|
|
e1886e61bc | ||
|
|
c1f4056723 | ||
|
|
1a404e9be5 | ||
|
|
6899e35524 | ||
|
|
17c9858783 | ||
|
|
eb4e698b90 | ||
|
|
c30b8937a0 | ||
|
|
491098c51f | ||
|
|
f190fd9085 | ||
|
|
96b7aad9f2 | ||
|
|
0166ee6540 | ||
|
|
bcd9d70c52 | ||
|
|
6ce86e0a68 | ||
|
|
b206df8ad9 | ||
|
|
4a09f80d40 | ||
|
|
32fbe3288f | ||
|
|
9d099ff1ce | ||
|
|
c03c76c74f | ||
|
|
000da5e808 | ||
|
|
2343ace07c | ||
|
|
a45cef5c05 | ||
|
|
af6ca71559 | ||
|
|
0418327c52 | ||
|
|
cca1c6e81d | ||
|
|
4cc8c9a21c | ||
|
|
bc73e56726 | ||
|
|
eb2d8c8f27 | ||
|
|
49ccbe6155 | ||
|
|
89c58e227c | ||
|
|
e706738f96 | ||
|
|
55a1541818 | ||
|
|
10e62c21f4 | ||
|
|
b37aa436ec | ||
|
|
5fff1f2033 | ||
|
|
7affe60a46 | ||
|
|
5a3d08ba6d | ||
|
|
82cbab5ab1 | ||
|
|
2e04d78a14 | ||
|
|
fc2f823119 | ||
|
|
cbf545ac16 | ||
|
|
ce077af70f | ||
|
|
fac288f20b | ||
|
|
b0828849bd | ||
|
|
39855bba25 | ||
|
|
bf4bc1a299 | ||
|
|
bf6a343b97 | ||
|
|
3d592d1dad | ||
|
|
d56da82dc9 | ||
|
|
1510578835 | ||
|
|
a1170e71a7 | ||
|
|
6eee7361c2 | ||
|
|
a294c93902 | ||
|
|
9f9626afb0 | ||
|
|
36ce5e1576 | ||
|
|
3d545d9945 | ||
|
|
d756a2035d | ||
|
|
175d381fb9 | ||
|
|
6e4c42caaa | ||
|
|
f43f8fd966 | ||
|
|
f1f75c0b6b | ||
|
|
f9917d4ab7 | ||
|
|
3bc4565eb8 |
@@ -1,78 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB. All rights reserved.
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# version 2 as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ated
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=f614cba983d827d5185c60a6a5a35530621d44d2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/mediatek/ated.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
# support parallel build
|
||||
#PKG_BUILD_PARALLEL:=1
|
||||
|
||||
#re create configure scripts if not present.
|
||||
#PKG_FIXUP:=autoreconf
|
||||
|
||||
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
|
||||
# this way we don't need to pick out the resulting files from the build dir.
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ated
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Daemon for handling wifi calibration
|
||||
URL:=
|
||||
DEPENDS:= libc
|
||||
endef
|
||||
|
||||
define Package/ated/description
|
||||
Daemon for handling wifi calibration
|
||||
endef
|
||||
|
||||
#TARGET_CFLAGS += -I$(LINUX_DIR)/include -I$(LINUX_DIR)/arch/mips/include
|
||||
|
||||
MAKE_FLAGS += \
|
||||
v=2 \
|
||||
m=3
|
||||
|
||||
|
||||
#TARGET_CPPFLAGS := \
|
||||
# -I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
|
||||
# -I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
# $(TARGET_CPPFLAGS)
|
||||
|
||||
# we donot wwant to have any install.
|
||||
define Build/Install/Default
|
||||
endef
|
||||
|
||||
define Package/ated/install
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ated $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ated))
|
||||
@@ -1,5 +1,3 @@
|
||||
if PACKAGE_libbbfdm
|
||||
|
||||
config BBF_VENDOR_EXTENSION
|
||||
bool "Enable Vendor Extension"
|
||||
default y
|
||||
@@ -12,10 +10,6 @@ config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config BBF_TR181
|
||||
bool "Enable TR-181 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR104
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
default y
|
||||
@@ -26,24 +20,12 @@ config BBF_TR143
|
||||
|
||||
config BBFDM_ENABLE_JSON_PLUGIN
|
||||
bool "Enable json plugin to extend datamodel"
|
||||
default n
|
||||
default y
|
||||
|
||||
config BBFDM_ENABLE_DOTSO_PLUGIN
|
||||
bool "Enable shared library plugin to extend datamodel"
|
||||
default n
|
||||
default y
|
||||
|
||||
choice
|
||||
prompt "Select SSL utility"
|
||||
default BBF_USE_WOLFSSL
|
||||
|
||||
config BBF_USE_WOLFSSL
|
||||
bool "Use WolfSSL for ssl utilities"
|
||||
select CONFIG_PACKAGE_libwolfssl
|
||||
|
||||
config BBF_USE_OPENSSL
|
||||
bool "Use OpenSSL for ssl utilities"
|
||||
select CONFIG_PACKAGE_libopenssl
|
||||
|
||||
endchoice
|
||||
|
||||
endif
|
||||
config BBF_MAX_OBJECT_INSTANCES
|
||||
int "Maximum number of instances per object"
|
||||
default 255
|
||||
|
||||
128
bbf/Makefile
128
bbf/Makefile
@@ -1,42 +1,69 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
# Copyright (C) 2022 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=6.6.10
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_VERSION:=6.8.10
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=3efc5ce5e6f639e50894e7b9e69b6e2408875db6
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_VERSION:=7ca14a3fcd848ec9d21878fe80aa567f149cf25b
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/libbbf_api
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for libbbfdm API
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libopenssl +libwolfssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
define Package/libbbfdm/default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband-forum data model
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libcurl +libopenssl +libwolfssl
|
||||
MENU:=1
|
||||
TITLE:=Library for broadband forum data model support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libcurl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (internal)
|
||||
VARIANT:=internal
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-mbedtls
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-openssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
|
||||
CONFLICTS := libbbfdm-mbedtls
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-wolfssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
|
||||
CONFLICTS := libbbfdm-mbedtls libbbfdm-openssl
|
||||
VARIANT:=wolfssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -58,79 +85,81 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror \
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR181),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr181
|
||||
endif
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR104),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr104
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR104=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr143
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR143=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-vendor-extension
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_EXTENSION=ON
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
BBF_VENDOR_PREFIX="$(CONFIG_BBF_VENDOR_PREFIX)"
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-json-plugin
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_JSON_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared-library
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_DOTSO_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_USE_WOLFSSL), y)
|
||||
CONFIGURE_ARGS += --enable-libwolfssl
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/wolfssl
|
||||
TARGET_LDFLAGS += "-lwolfssl"
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_USE_OPENSSL), y)
|
||||
CONFIGURE_ARGS += --enable-libopenssl
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/
|
||||
TARGET_LDFLAGS += "-lssl"
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
endif
|
||||
|
||||
define Package/libbbf_api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
define Package/libbbfdm/default/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
define Package/libbbfdm/default/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
|
||||
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
|
||||
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
|
||||
|
||||
Package/libbbfdm-openssl/install = $(Package/libbbfdm/default/install)
|
||||
Package/libbbfdm-wolfssl/install = $(Package/libbbfdm/default/install)
|
||||
Package/libbbfdm-mbedtls/install = $(Package/libbbfdm/default/install)
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
@@ -139,9 +168,12 @@ define Build/InstallDev
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/usr/lib/
|
||||
touch $(1)/usr/lib/libbbf_api.so
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbf_api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
$(eval $(call BuildPackage,libbbfdm-openssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-wolfssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-mbedtls))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Copyright (C) 2022 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,22 +8,25 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_VERSION:=2.0.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=b35e7862bc17fc11dc1f757c7b93900995a28633
|
||||
PKG_SOURCE_VERSION:=85d7486a21a9eb0e0f345b587b3ac506edcb72fe
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
@@ -31,11 +34,7 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +curl +libblobmsg-json +libbbfdm +libbbf_api
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
BBF BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -52,7 +51,7 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.so $(1)/usr/lib/bbfdm
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,43 +1,6 @@
|
||||
|
||||
config bulkdata 'bulkdata'
|
||||
option enable '0'
|
||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
||||
#Log levels: Error=1, Warning=2, Info=3, Debug=4
|
||||
option log_level '3'
|
||||
|
||||
config profile
|
||||
option profile_id '1'
|
||||
option enable '0'
|
||||
option name ''
|
||||
option nbre_of_retained_failed_reports '0'
|
||||
option protocol 'http'
|
||||
option encoding_type ''
|
||||
option reporting_interval '86400'
|
||||
option time_reference '0'
|
||||
option csv_encoding_field_separator ','
|
||||
option csv_encoding_row_separator ' '
|
||||
option csv_encoding_escape_character '"'
|
||||
option csv_encoding_report_format 'column'
|
||||
option csv_encoding_row_time_stamp 'unix'
|
||||
option json_encoding_report_format 'objecthierarchy'
|
||||
option json_encoding_report_time_stamp 'unix'
|
||||
option http_url ''
|
||||
option http_username ''
|
||||
option http_password ''
|
||||
option http_compression 'none'
|
||||
option http_method 'post'
|
||||
option http_use_date_header '1'
|
||||
option http_retry_enable '0'
|
||||
option http_retry_minimum_wait_interval '5'
|
||||
option http_retry_interval_multiplier '2000'
|
||||
option http_persist_across_reboot '0'
|
||||
|
||||
config profile_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
|
||||
config profile_http_request_uri_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Bulkdata Software
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
@@ -10,13 +7,16 @@ USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
|
||||
start_service() {
|
||||
local bulkdata_enable=`uci -q get bulkdata.bulkdata.enable`
|
||||
if [ "$bulkdata_enable" = "1" ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_close_instance
|
||||
fi
|
||||
local enable=$(uci -q get bulkdata.bulkdata.enable)
|
||||
|
||||
[ "$enable" != "1" ] && {
|
||||
return 0
|
||||
}
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
boot() {
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
PROFILE_COUNT=1
|
||||
|
||||
get_next_count()
|
||||
{
|
||||
local config="$1"
|
||||
local default_name="${2}"
|
||||
local count=${3}
|
||||
local found=0
|
||||
|
||||
if [ -z "$count" ]; then
|
||||
count=1
|
||||
fi
|
||||
|
||||
while [ "${found}" -ne 1 ]; do
|
||||
uci -q get ${config}.${default_name}_${count} >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
count=$((count + 1))
|
||||
else
|
||||
found=1;
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${default_name}_${count}"
|
||||
}
|
||||
|
||||
translate_profile_id_to_profile_name() {
|
||||
local section="${1}"
|
||||
local profile_id="${2}"
|
||||
local profile_name="${3}"
|
||||
local curr_profile_id
|
||||
|
||||
config_get curr_profile_id "${section}" profile_id
|
||||
|
||||
[ -n "${curr_profile_id}" ] || return
|
||||
|
||||
[ "${curr_profile_id}" != "${profile_id}" ] && return
|
||||
|
||||
uci -q set bulkdata.${section}.profile_name="${profile_name}"
|
||||
uci -q set bulkdata.${section}.profile_id=""
|
||||
}
|
||||
|
||||
update_profile_sections() {
|
||||
local section="${1}"
|
||||
local default="${2}"
|
||||
local profile_name
|
||||
|
||||
config_get profile_id "${section}" profile_id
|
||||
|
||||
[ -n "${profile_id}" ] || return
|
||||
|
||||
case "${section}" in
|
||||
"cfg"*)
|
||||
profile_name="$(get_next_count bulkdata ${default} ${PROFILE_COUNT})"
|
||||
uci_rename bulkdata "${section}" "${profile_name}"
|
||||
;;
|
||||
esac
|
||||
PROFILE_COUNT=$((PROFILE_COUNT + 1))
|
||||
|
||||
[ -n "$profile_name" ] && section="${profile_name}"
|
||||
|
||||
uci -q set bulkdata.${section}.profile_id=""
|
||||
|
||||
config_foreach translate_profile_id_to_profile_name profile_parameter "${profile_id}" "${profile_name}"
|
||||
config_foreach translate_profile_id_to_profile_name profile_http_request_uri_parameter "${profile_id}" "${profile_name}"
|
||||
}
|
||||
|
||||
config_load bulkdata
|
||||
config_foreach update_profile_sections profile profile
|
||||
uci commit bulkdata
|
||||
|
||||
exit 0
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.5.1
|
||||
PKG_VERSION:=3.5.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e609d736f572d3ff5e33aa6b585d6ccb7c8e14cf
|
||||
PKG_SOURCE_VERSION:=54ebb54162fae9fdd6e327e430cf57aa217c176d
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -34,7 +34,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=DECT Manager
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
|
||||
Binary file not shown.
@@ -11,6 +11,8 @@ PROG=/usr/sbin/dectmngr
|
||||
LOG_PATH=/var/log/dectmngr
|
||||
DB_PATH=/etc/dect
|
||||
|
||||
DECT_GPIO=$(db -q get hw.board.dect_gpio)
|
||||
|
||||
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
|
||||
stop_and_wait_dectmngr() {
|
||||
pidof $NAME && killall -q $NAME
|
||||
@@ -30,7 +32,7 @@ start_service() {
|
||||
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
echo 1 > /sys/class/gpio/gpio14/value
|
||||
[ -n "$DECT_GPIO" ] && echo 1 > /sys/class/gpio/gpio${DECT_GPIO}/value
|
||||
|
||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
||||
@@ -71,7 +73,7 @@ start_service() {
|
||||
stop_service() {
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
echo 0 > /sys/class/gpio/gpio14/value
|
||||
[ -n "$DECT_GPIO" ] && echo 0 > /sys/class/gpio/gpio${DECT_GPIO}/value
|
||||
stop_and_wait_dectmngr
|
||||
}
|
||||
|
||||
@@ -86,8 +88,10 @@ service_triggers()
|
||||
}
|
||||
|
||||
boot() {
|
||||
echo 14 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio14/direction
|
||||
[ -n "$DECT_GPIO" ] && {
|
||||
echo ${DECT_GPIO} > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${DECT_GPIO}/direction
|
||||
}
|
||||
|
||||
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
|
||||
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.4.39
|
||||
PKG_VERSION:=6.5.5
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4d1c28405981cd803396afd0d1612df23baa135d
|
||||
PKG_SOURCE_VERSION:=ce37bf403ab6d15b84fe2078b77fa3a2aad4973a
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -38,26 +38,36 @@ endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_WIFI_TYPE=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
|
||||
TARGET_PLATFORM=TEST
|
||||
TARGET_WIFI_TYPE=TEST
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
|
||||
TARGET_PLATFORM=TEST
|
||||
TARGET_WIFI_TYPE=TEST
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_econet),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
||||
TARGET_PLATFORM=MAC80211
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
export TARGET_WIFI_TYPE
|
||||
|
||||
subdirs := \
|
||||
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
|
||||
@@ -87,6 +97,7 @@ MAKE_FLAGS += \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)" \
|
||||
PLATFORM="$(TARGET_PLATFORM)" \
|
||||
WIFI_TYPE="$(TARGET_WIFI_TYPE)" \
|
||||
subdirs="$(subdirs)"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
define Package/libethernet
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Ethernet library (libethernet)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig +TARGET_iopsys_econet:ecnt_api
|
||||
endef
|
||||
|
||||
define Package/libethernet/config
|
||||
|
||||
@@ -13,12 +13,12 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=2390a3503990e04e33e8e448ad9dccc00f206908
|
||||
PKG_SOURCE_VERSION:=7d43e471f0ffc4a54eb2ac35eced4b72fca4dafb
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
export BUILD_DIR
|
||||
@@ -30,7 +30,7 @@ PKG_BUILD_PARALLEL:=1
|
||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
||||
|
||||
export CONFIG_BRCM_SDK_VER_504021
|
||||
export CONFIG_BRCM_SDK_VER_504040
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -5,20 +5,23 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=evoice
|
||||
PKG_VERSION:=0.1
|
||||
PKG_VERSION:=0.2.14
|
||||
|
||||
LOCAL_DEV=0
|
||||
LOCAL_DEV_EVOICE_DIR=~/voip/evoice
|
||||
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/ensemble/evoice.git
|
||||
PKG_SOURCE_VERSION:=1f790ba0cbc1b62c4bff9fd09a20cb0c299422da
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/evoice.git
|
||||
PKG_SOURCE_VERSION:=cd21c95c150a841e441472b2623fbf8aabe74996
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
# All config variable that are passed to the make invocation, directly or
|
||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
||||
@@ -31,7 +34,10 @@ define Package/$(PKG_NAME)
|
||||
SUBMENU:=Telephony
|
||||
TITLE:=Ensemble Voice
|
||||
URL:=
|
||||
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp
|
||||
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp +libopenssl\
|
||||
+TARGET_iopsys_brcm63xx_arm:bcmkernel\
|
||||
+TARGET_iopsys_econet:kmod-voip_driver\
|
||||
+TARGET_iopsys_econet:voip_app
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@@ -40,23 +46,58 @@ endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
# If you want to build the code from your own local repositiory enable
|
||||
# LOCAL_DEV and change the path below to your own git repository.
|
||||
# LOCAL_DEV and set LOCAL_DEV_EVOICE_DIR to your own git repository.
|
||||
define Build/Prepare
|
||||
rsync -av /swdev/bide/evoice_clean/* $(PKG_BUILD_DIR)/
|
||||
@echo "======================================================="
|
||||
@echo "DEVELOPMENT BUILD! rsync $(LOCAL_DEV_EVOICE_DIR) to $(PKG_BUILD_DIR)"
|
||||
@echo "======================================================="
|
||||
rsync -a $(LOCAL_DEV_EVOICE_DIR)/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
export IDIR = $(STAGING_DIR)/usr/include
|
||||
export BDIR = bcm963xx/userspace/private/apps/voice
|
||||
export _XFLAGS = -I$(IDIR) -I$(IDIR)/$(BDIR)/inc -I$(IDIR)/bcm963xx/xchg/bos/publicInc -I$(IDIR)/bcm963xx/bcmdrivers/broadcom/include/bcm963xx
|
||||
|
||||
IDIR = $(STAGING_DIR)/usr/include
|
||||
TONES_INI_REQUIRED=
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
BDIR = bcm963xx/userspace/private/apps/voice
|
||||
CC_FLAGS = -I$(IDIR) -I$(IDIR)/$(BDIR)/inc\
|
||||
-I$(IDIR)/bcm963xx/xchg/bos/publicInc\
|
||||
-I$(IDIR)/bcm963xx/bcmdrivers/broadcom/include/bcm963xx
|
||||
TRG=SVrgBcmFxs
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_econet),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TONES_INI_REQUIRED=y
|
||||
TRG=SVrgMtekOwrt
|
||||
endif
|
||||
|
||||
# disable temporarily some not important warnings, force PIC
|
||||
CC_FLAGS_VS=$(CC_FLAGS) -Wno-unused-parameter -Wno-unused-function -fPIC
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
#used and altered by BIDE makefiles
|
||||
export _XFLAGS
|
||||
|
||||
BIDE_MAKE_OPTS = -r -R -C $(PKG_BUILD_DIR) -f _bld/src/cdabs.mk\
|
||||
SWB=b_gxxqca6 HWA=a_openwrt HWC=c_hosted OSP=p_posix LIF=cerder DBG=dbg
|
||||
|
||||
define Build/Compile
|
||||
+$(MAKE) -r -R -C $(PKG_BUILD_DIR) -f _bld/src/cdabs.mk SWB=b_gxxqca6 HWA=a_openwrt HWC=c_hosted OSP=p_posix TRG=SVrgBcmFxs LIF=cerder DBG=dbg
|
||||
@echo "TARGET_PLATFORM=${TARGET_PLATFORM}"
|
||||
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS)" TRG=$(TRG)
|
||||
|
||||
@echo "clean libvoiceservice before building shared lib!"
|
||||
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS_VS)" TRG=libvoiceservice cleanall
|
||||
+$(MAKE) $(BIDE_MAKE_OPTS) CC_FLAGS="$(CC_FLAGS_VS)" TRG=libvoiceservice
|
||||
endef
|
||||
|
||||
define Package/evoice/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(if $(TONES_INI_REQUIRED),,$(RM) $(1)/etc/evoice/tones.ini)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/evoice $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/_bin/a_openwrt/libvoiceservice.so $(1)/usr/lib/bbfdm/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,evoice))
|
||||
|
||||
@@ -6,7 +6,7 @@ config SIPClient 'Client1'
|
||||
option AuthPassword '51234'
|
||||
option Network 'Network1'
|
||||
option MaxSessions '5'
|
||||
option RegisiterURI '51234@192.164.4.210'
|
||||
option RegisiterURI '51234@sip-proxy.iopsys.eu'
|
||||
option E164Format '1'
|
||||
|
||||
config SIPClient 'Client2'
|
||||
@@ -16,22 +16,22 @@ config SIPClient 'Client2'
|
||||
option AuthPassword '51235'
|
||||
option Network 'Network1'
|
||||
option MaxSessions '5'
|
||||
option RegisiterURI '51235@192.164.4.210'
|
||||
option RegisiterURI '51235@sip-proxy.iopsys.eu'
|
||||
option E164Format '1'
|
||||
|
||||
config SIPNetwork 'Network1'
|
||||
option Enable '1'
|
||||
option ProxyServer '192.168.4.210'
|
||||
option ProxyServer 'sip-proxy.iopsys.eu'
|
||||
option ProxyServerPort '5060'
|
||||
option ProxyServerTransport 'UDP'
|
||||
option RegistrarServer '192.168.4.210'
|
||||
option RegistrarServer 'sip-proxy.iopsys.eu'
|
||||
option RegistrarServerPort '5060'
|
||||
option RegistrarServerTransport 'UDP'
|
||||
option RegistrationPeriod '3240'
|
||||
option RegisterExpires '3600'
|
||||
option UserAgentDomain ' '
|
||||
option UserAgentDomain ' '
|
||||
option TimerRegistrationFailed '120'
|
||||
option TimerT1 '500'
|
||||
option TimerT1 '500'
|
||||
option VoIPProfile 'VoIPProfile1'
|
||||
list CodecList '1CodecProfile1'
|
||||
list CodecList '1CodecProfile2'
|
||||
@@ -50,10 +50,10 @@ config CapabilitiesCodec 'Codec2'
|
||||
|
||||
config CapabilitiesCodec 'Codec3'
|
||||
option Codec 'G.726'
|
||||
|
||||
|
||||
config CapabilitiesCodec 'Codec4'
|
||||
option Codec 'G.722'
|
||||
|
||||
|
||||
config CapabilitiesCodec 'Codec5'
|
||||
option Codec 'G.729'
|
||||
|
||||
@@ -98,20 +98,20 @@ config RTP '1RTP'
|
||||
option JitterBufferType 'Static'
|
||||
|
||||
config FXXPorts 'POTS'
|
||||
option Region 'SE'
|
||||
option Region 'US'
|
||||
|
||||
config FXSPorts 'FXS1'
|
||||
option Enable '1'
|
||||
option DialType 'Tone'
|
||||
option TransmitGain '4'
|
||||
option ReceiveGain '4'
|
||||
option TransmitGain '0'
|
||||
option ReceiveGain '0'
|
||||
option EchoCancellationEnable '1'
|
||||
|
||||
config FXSPorts 'FXS2'
|
||||
option Enable '1'
|
||||
option DialType 'Tone'
|
||||
option TransmitGain '4'
|
||||
option ReceiveGain '4'
|
||||
option TransmitGain '0'
|
||||
option ReceiveGain '0'
|
||||
option EchoCancellationEnable '1'
|
||||
|
||||
config Extension 'Extension1'
|
||||
@@ -210,44 +210,37 @@ config CallingFeatures 'Set2'
|
||||
option CallWaitingEnable '1'
|
||||
|
||||
config NumberingPlan 'NumberingPlan1'
|
||||
option MinimumNumberOfDigits '5'
|
||||
option MinimumNumberOfDigits '1'
|
||||
option MaximumNumberOfDigits '15'
|
||||
option InterDigitTimerStd '2000'
|
||||
option InterDigitTimerOpen '2000'
|
||||
option TerminationDigit ' '
|
||||
option TerminationDigit '#'
|
||||
|
||||
config NumberingPlan 'NumberingPlan2'
|
||||
option MinimumNumberOfDigits '5'
|
||||
option MaximumNumberOfDigits '15'
|
||||
option InterDigitTimerStd '2000'
|
||||
option InterDigitTimerOpen '2000'
|
||||
option TerminationDigit '#'
|
||||
option TerminationDigit ' '
|
||||
list PrefixList '2PrefixInfo1'
|
||||
list PrefixList '2PrefixInfo2'
|
||||
list PrefixList '2PrefixInfo3'
|
||||
list PrefixList '2PrefixInfo4'
|
||||
list PrefixList '2PrefixInfo5'
|
||||
list PrefixList '2PrefixInfo6'
|
||||
list PrefixList '2PrefixInfo7'
|
||||
list PrefixList '2PrefixInfo8'
|
||||
list PrefixList '2PrefixInfo9'
|
||||
|
||||
config NumberingPlan 'NumberingPlan3'
|
||||
option MinimumNumberOfDigits '5'
|
||||
option MaximumNumberOfDigits '15'
|
||||
option InterDigitTimerStd '2000'
|
||||
option InterDigitTimerOpen '2000'
|
||||
option TerminationDigit ' '
|
||||
list PrefixList '3PrefixInfo1'
|
||||
list PrefixList '3PrefixInfo2'
|
||||
list PrefixList '3PrefixInfo3'
|
||||
list PrefixList '3PrefixInfo4'
|
||||
list PrefixList '3PrefixInfo5'
|
||||
list PrefixList '3PrefixInfo6'
|
||||
list PrefixList '3PrefixInfo7'
|
||||
list PrefixList '3PrefixInfo8'
|
||||
list PrefixList '3PrefixInfo9'
|
||||
|
||||
config NumberingPlan 'NumberingPlan4'
|
||||
option MinimumNumberOfDigits '5'
|
||||
option MaximumNumberOfDigits '15'
|
||||
option InterDigitTimerStd '2000'
|
||||
option InterDigitTimerOpen '2000'
|
||||
option TerminationDigit '#'
|
||||
list PrefixList '4PrefixInfo1'
|
||||
list PrefixList '3PrefixInfo1'
|
||||
|
||||
config PrefixInfo '3PrefixInfo1'
|
||||
config PrefixInfo '2PrefixInfo1'
|
||||
option Enable '1'
|
||||
option PrefixRange '*43#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
@@ -255,9 +248,9 @@ config PrefixInfo '3PrefixInfo1'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CW_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo2'
|
||||
config PrefixInfo '2PrefixInfo2'
|
||||
option Enable '1'
|
||||
option PrefixRange '#43#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
@@ -265,9 +258,9 @@ config PrefixInfo '3PrefixInfo2'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CW_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo3'
|
||||
config PrefixInfo '2PrefixInfo3'
|
||||
option Enable '1'
|
||||
option PrefixRange '*21*(X+)#'
|
||||
option PrefixMinNumberOfDigits '9'
|
||||
@@ -275,9 +268,9 @@ config PrefixInfo '3PrefixInfo3'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFU_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo4'
|
||||
config PrefixInfo '2PrefixInfo4'
|
||||
option Enable '1'
|
||||
option PrefixRange '#21#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
@@ -285,9 +278,9 @@ config PrefixInfo '3PrefixInfo4'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFU_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo5'
|
||||
config PrefixInfo '2PrefixInfo5'
|
||||
option Enable '1'
|
||||
option PrefixRange '*67*(X+)#'
|
||||
option PrefixMinNumberOfDigits '9'
|
||||
@@ -295,9 +288,9 @@ config PrefixInfo '3PrefixInfo5'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFB_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo6'
|
||||
config PrefixInfo '2PrefixInfo6'
|
||||
option Enable '1'
|
||||
option PrefixRange '#67#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
@@ -305,9 +298,9 @@ config PrefixInfo '3PrefixInfo6'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFB_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo7'
|
||||
config PrefixInfo '2PrefixInfo7'
|
||||
option Enable '1'
|
||||
option PrefixRange '*61*(X+(*X+)?)#'
|
||||
option PrefixMinNumberOfDigits '15'
|
||||
@@ -315,9 +308,9 @@ config PrefixInfo '3PrefixInfo7'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFNR_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo8'
|
||||
config PrefixInfo '2PrefixInfo8'
|
||||
option Enable '1'
|
||||
option PrefixRange '#61#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
@@ -325,9 +318,9 @@ config PrefixInfo '3PrefixInfo8'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFNR_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo9'
|
||||
config PrefixInfo '2PrefixInfo9'
|
||||
option Enable '1'
|
||||
option PrefixRange '*31*'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
@@ -335,9 +328,9 @@ config PrefixInfo '3PrefixInfo9'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CA_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '4PrefixInfo1'
|
||||
config PrefixInfo '3PrefixInfo1'
|
||||
option Enable '1'
|
||||
option PrefixRange '110|112'
|
||||
option PrefixMinNumberOfDigits '7'
|
||||
@@ -345,7 +338,7 @@ config PrefixInfo '4PrefixInfo1'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'X_IOPSYS_EU_EMERGENCY'
|
||||
option FacilityActionArgument ' '
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config DialPlan 'X_IOPSYS_EU_InternalNumber1'
|
||||
option RegExp '1X#'
|
||||
|
||||
1564
evoice/files/etc/evoice/tones.ini
Normal file
1564
evoice/files/etc/evoice/tones.ini
Normal file
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@ config account 'map_board'
|
||||
option HW_Has_Voice 'hw.board.hasVoice'
|
||||
option HW_Has_DECT 'hw.board.hasDect'
|
||||
option HW_Nr_Of_POTS_Ports 'hw.board.VoicePorts'
|
||||
option HW_VoiceDSP 'hw.board.VoiceDSP'
|
||||
option ProductID 'device.deviceinfo.ModelName'
|
||||
option I3_VERSION 'device.deviceinfo.SoftwareVersion'
|
||||
option SerialNumber 'device.deviceinfo.SerialNumber'
|
||||
@@ -94,6 +95,7 @@ config cs_account 'map_set'
|
||||
option Enable_Call_Transfer 'voice.Set@.CallTransferEnable'
|
||||
option AnonymousReject 'voice.Set@.AnonymousCallRejectionEnable'
|
||||
option AllowAnonymousConf 'voice.Set@.AnonymousCallEnable'
|
||||
option CallerIDEnable 'voice.Set@.CallerIDEnable'
|
||||
|
||||
config cs_xvendor 'map_np_cs'
|
||||
option np_sc_actCW 'voice.X_IOPSYS_EU_NpSc@.CW_ACT'
|
||||
|
||||
@@ -2,9 +2,9 @@ config static_prm 'defaults'
|
||||
option Print_Control '4'
|
||||
option Print_UDP_Addr '192.168.1.3'
|
||||
option Print_UDP_Port '60000'
|
||||
option Verbosity 'Off'
|
||||
option Verbosity 'On'
|
||||
option Failure_Log 'On'
|
||||
option Message_Log 'Off'
|
||||
option Message_Log 'On'
|
||||
option Method_Trace 'Off'
|
||||
option Dial_Cache_Size '0'
|
||||
option Reverse_Fax_Detection '0'
|
||||
@@ -42,6 +42,7 @@ config static_prm 'defaults'
|
||||
option NAT_Address_From_SIP '0'
|
||||
option HookOn_Transfer '0'
|
||||
option Enable_Call_Transfer '1'
|
||||
option CallerIDEnable '1'
|
||||
option Multiparty_Transp '0'
|
||||
option Presence_Indication '0'
|
||||
option Login_Note ' '
|
||||
|
||||
@@ -5,6 +5,7 @@ STOP=12
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=evoice
|
||||
VOICE_UCI_CONFIG=voice
|
||||
|
||||
start_service() {
|
||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
||||
@@ -20,3 +21,6 @@ reload_service() {
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger $VOICE_UCI_CONFIG
|
||||
}
|
||||
|
||||
@@ -44,13 +44,17 @@ MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
|
||||
MODULES_SUBDIR:=lib/modules/4.19.183
|
||||
MODULES_SUBDIR:=lib/modules/4.19.225
|
||||
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_ARM_TOOLCHAIN_PREFIX)-
|
||||
|
||||
ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"63158" "6856" "6858"))
|
||||
# These targets use a 64-bit kernel
|
||||
LINUX_KARCH:=arm64
|
||||
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_PREFIX)-
|
||||
else ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"6855" "6756" "47622" "63148" "63178"))
|
||||
# These targets use a 32-bit arm-sfp kernel
|
||||
LINUX_KARCH:=arm
|
||||
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_ARMSFP_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_ARMSFP_TOOLCHAIN_PREFIX)-
|
||||
endif
|
||||
# For some reason, Broadcom's kernel does not set the include paths correctly when compiling out-of-tree modules
|
||||
EXTRA_KCPPFLAGS:="-I $(LINUX_DIR)/../bcmkernel/include -I $(LINUX_DIR)/arch/arm/mach-bcm963xx/include"
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
if PACKAGE_icwmp
|
||||
|
||||
choice
|
||||
prompt "Select ACS sever"
|
||||
default CWMP_ACS_MULTI
|
||||
|
||||
config CWMP_ACS_MULTI
|
||||
bool "No specific ACS, follow standard"
|
||||
|
||||
config CWMP_ACS_HDM
|
||||
bool "HDM"
|
||||
endchoice
|
||||
|
||||
config CWMP_DEBUG
|
||||
bool "Compile with debug options"
|
||||
default y
|
||||
|
||||
config CWMP_DEVEL_DEBUG
|
||||
bool "Compile with development debug options"
|
||||
default n
|
||||
|
||||
choice
|
||||
prompt "Select SSL utility"
|
||||
default CWMP_USE_WOLFSSL
|
||||
|
||||
config CWMP_USE_WOLFSSL
|
||||
bool "Use WolfSSL for ssl utilities"
|
||||
select CONFIG_PACKAGE_libwolfssl
|
||||
|
||||
config CWMP_USE_OPENSSL
|
||||
bool "Use OpenSSL for ssl utilities"
|
||||
select CONFIG_PACKAGE_libopenssl
|
||||
|
||||
endchoice
|
||||
endif
|
||||
|
||||
117
icwmp/Makefile
117
icwmp/Makefile
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Copyright (C) 2020-2022 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,46 +8,66 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=8.3.5
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_VERSION:=8.5.4
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4dd933047dcce4d297b17cafcb0ee2ad39004c15
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_VERSION:=58a32f910bc4043454880177621f8eddfc1f93f7
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_CWMP_ACS_MULTI \
|
||||
CONFIG_CWMP_ACS_HDM \
|
||||
CONFIG_CWMP_DEBUG \
|
||||
CONFIG_CWMP_DEVEL_DEBUG
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
define Package/icwmp/default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libwolfssl +curl +libcurl +libopenssl
|
||||
MENU := 1
|
||||
TITLE:=TR069 CWMP client
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
A free client implementation of CWMP (TR-069) protocol
|
||||
define Package/icwmp-openssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config_cwmp.in"
|
||||
define Package/icwmp-wolfssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_icwmp-wolfssl:libwolfssl
|
||||
CONFLICTS := icwmp-openssl
|
||||
VARIANT:=wolfssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-mbedtls
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_icwmp-mbedtls:libmbedtls
|
||||
CONFLICTS := icwmp-openssl icwmp-wolfssl
|
||||
VARIANT:=mbedtls
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
endif
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
define Build/Prepare
|
||||
@@ -55,58 +75,29 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-acs=multi
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_HDM),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-acs=hdm
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_DEBUG),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-debug
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_DEVEL_DEBUG),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-devel
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_USE_WOLFSSL), y)
|
||||
CONFIGURE_ARGS += --enable-libwolfssl
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/wolfssl
|
||||
TARGET_LDFLAGS += "-lwolfssl"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_USE_OPENSSL), y)
|
||||
CONFIGURE_ARGS += --enable-libopenssl
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/
|
||||
TARGET_LDFLAGS += "-lssl"
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
define Package/icwmp/default/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-icwmp-generate-ssl $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)/etc/bbfdm/json/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-wolfssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-mbedtls/install = $(Package/icwmp/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,icwmp-openssl))
|
||||
$(eval $(call BuildPackage,icwmp-wolfssl))
|
||||
$(eval $(call BuildPackage,icwmp-mbedtls))
|
||||
|
||||
36
icwmp/files/etc/bbfdm/json/CWMPManagementServer.json
Normal file
36
icwmp/files/etc/bbfdm/json/CWMPManagementServer.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"json_plugin_version": 1,
|
||||
"Device.CWMPManagementServer.": {
|
||||
"type": "object",
|
||||
"version": "2.15",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"dependency": "file:/etc/config/cwmp",
|
||||
"EnableCWMP": {
|
||||
"type": "boolean",
|
||||
"version": "2.15",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "cwmp",
|
||||
"section": {
|
||||
"name": "cpe"
|
||||
},
|
||||
"option": {
|
||||
"name": "enable"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,11 +11,11 @@ config acs 'acs'
|
||||
option retry_min_wait_interval '5'
|
||||
# possible configs interval :[1000:65535]
|
||||
option retry_interval_multiplier '2000'
|
||||
option https_ssl_capath ''
|
||||
option ipv6_enable '0'
|
||||
option ip_version '4'
|
||||
|
||||
config cpe 'cpe'
|
||||
option enable '1'
|
||||
option default_wan_interface 'wan'
|
||||
option log_to_console 'disable'
|
||||
option log_to_file 'disable'
|
||||
|
||||
@@ -6,7 +6,6 @@ log() {
|
||||
}
|
||||
|
||||
if [ ! -f "/var/state/cwmp" ]; then
|
||||
touch "/var/state/cwmp"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,93 +1,29 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "$@" |logger -t cwmp.update -p info
|
||||
}
|
||||
|
||||
handle_icwmp_update() {
|
||||
local defwan vendorspecinf update
|
||||
local cwmp_enable
|
||||
config_load cwmp
|
||||
|
||||
update="0"
|
||||
defwan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
||||
vendorspecinf="$(ifstatus "${defwan}" | jsonfilter -e "@.data.vendorspecinf")"
|
||||
config_get_bool cwmp_enable cpe enable 1
|
||||
if [ "$cwmp_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log "Handling dhcp option value [${vendorspecinf}]"
|
||||
[ -n "$vendorspecinf" ] && {
|
||||
local url old_url
|
||||
local prov_code old_prov_code
|
||||
local min_wait_interval old_min_wait_interval
|
||||
local retry_interval_multiplier old_retry_interval_multiplier
|
||||
|
||||
old_url="$(uci -q get cwmp.acs.dhcp_url)"
|
||||
old_prov_code="$(uci -q get cwmp.cpe.dhcp_provisioning_code)"
|
||||
old_min_wait_interval="$(uci -q get cwmp.acs.dhcp_retry_min_wait_interval)"
|
||||
old_retry_interval_multiplier="$(uci -q get cwmp.acs.dhcp_retry_interval_multiplier)"
|
||||
|
||||
case $vendorspecinf in
|
||||
http://*|https://*)
|
||||
url="${vendorspecinf}"
|
||||
;;
|
||||
*)
|
||||
for optval in $vendorspecinf; do
|
||||
case $optval in
|
||||
1=*)
|
||||
url="$(echo "$optval" | cut -d"=" -f2-)"
|
||||
;;
|
||||
2=*)
|
||||
prov_code="$(echo "$optval" | cut -d"=" -f2-)"
|
||||
;;
|
||||
3=*)
|
||||
min_wait_interval="$(echo "$optval" | cut -d"=" -f2-)"
|
||||
;;
|
||||
4=*)
|
||||
retry_interval_multiplier="$(echo "$optval" | cut -d"=" -f2-)"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$url" ]; then
|
||||
if [ "${url}" != "${old_url}" ]; then
|
||||
log "## icwmp url[${old_url}] changed to [${url}]"
|
||||
uci -q set cwmp.acs.dhcp_url="$url"
|
||||
update=1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$prov_code" ]; then
|
||||
if [ "${prov_code}" != "${old_prov_code}" ]; then
|
||||
log "## icwmp prov_code[${old_prov_code}] changed to [${prov_code}]"
|
||||
uci -q set cwmp.cpe.dhcp_provisioning_code="$prov_code"
|
||||
update=1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$min_wait_interval" ]; then
|
||||
if [ "${min_wait_interval}" != "${old_min_wait_interval}" ]; then
|
||||
log "## icwmp min_wait_interval[${old_min_wait_interval}] changed to [${min_wait_interval}]"
|
||||
uci -q set cwmp.acs.dhcp_retry_min_wait_interval="$min_wait_interval"
|
||||
update=1
|
||||
fi
|
||||
fi
|
||||
if [ -n "$retry_interval_multiplier" ]; then
|
||||
if [ "${retry_interval_multiplier}" != "${old_retry_interval_multiplier}" ]; then
|
||||
log "## icwmp retry_interval_multiplier[${old_retry_interval_multiplier}] changed to [${retry_interval_multiplier}]"
|
||||
uci -q set cwmp.acs.dhcp_retry_interval_multiplier="$retry_interval_multiplier"
|
||||
update=1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
if [ "${update}" -eq "1" ]; then
|
||||
log "CWMP uci changes, reload cwmp with uci commit"
|
||||
ubus call uci commit '{"config":"cwmp"}'
|
||||
else
|
||||
if ubus list tr069 >/dev/null 2>&1 ; then
|
||||
log "Trigger out of bound inform"
|
||||
ubus call tr069 inform
|
||||
else
|
||||
log "Restarting icwmp tr069 object not found"
|
||||
status="$(ubus call tr069 status |jsonfilter -qe '@.last_session.status')"
|
||||
if [ "$status" != "running" ]; then
|
||||
log "Trigger out of bound inform, since last inform status was failure"
|
||||
ubus -t 10 call tr069 inform >/dev/null 2>&1
|
||||
# Handle timeout or tr069 object not found
|
||||
if [ "$?" -eq 7 ] || [ "$?" -eq 4 ]; then
|
||||
log "Restarting icwmp tr069 object"
|
||||
/etc/init.d/icwmpd restart
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
handle_icwmp_update
|
||||
handle_icwmp_update $@
|
||||
|
||||
@@ -1,20 +1,48 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2015-2019 iopsys Software Solutions AB
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
STOP=2
|
||||
STOP=00
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/icwmpd"
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
include /lib/network
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
regenerate_ssl_link()
|
||||
{
|
||||
local cert_dir all_file rehash
|
||||
|
||||
cert_dir="${1}"
|
||||
[ ! -d "${cert_dir}" ] && return 0;
|
||||
|
||||
### Generate all ssl link for pem certicates ###
|
||||
all_file=$(ls $cert_dir/*.pem 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in $cfile)"
|
||||
[ -f ${cert_dir}/${rehash}.0 ] || \
|
||||
ln -s $cfile $cert_dir/${rehash}.0
|
||||
done
|
||||
fi
|
||||
|
||||
### Generate all ssl link for crt certicates ###
|
||||
all_file=$(ls $cert_dir/*.crt 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in $cfile)"
|
||||
[ -f ${cert_dir}/${rehash}.0 ] || \
|
||||
ln -s $cfile $cert_dir/${rehash}.0
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
local wan="${1}"
|
||||
|
||||
@@ -58,41 +86,39 @@ wait_for_resolvfile() {
|
||||
}
|
||||
|
||||
copy_cwmp_etc_files_to_varstate() {
|
||||
if [ ! -f /var/state/cwmp ]
|
||||
then
|
||||
if [ -f /etc/icwmpd/cwmp ]
|
||||
then
|
||||
uci -q -c /etc/icwmpd delete cwmp.acs
|
||||
uci -q -c /etc/icwmpd commit cwmp
|
||||
cp /etc/icwmpd/cwmp /var/state/cwmp
|
||||
else
|
||||
touch /var/state/cwmp
|
||||
fi
|
||||
mkdir -p /var/run/icwmpd
|
||||
|
||||
if [ -f /etc/icwmpd/cwmp ]; then
|
||||
uci -q -c /etc/icwmpd delete cwmp.acs
|
||||
uci -q -c /etc/icwmpd commit cwmp
|
||||
cp -f /etc/icwmpd/cwmp /var/state/cwmp
|
||||
fi
|
||||
|
||||
mkdir -p /var/run/icwmpd
|
||||
if [ -f /etc/icwmpd/icwmpd_backup_session.xml ]
|
||||
then
|
||||
mv /etc/icwmpd/icwmpd_backup_session.xml /var/run/icwmpd 2>/dev/null
|
||||
if [ -f /etc/icwmpd/icwmpd_backup_session.xml ]; then
|
||||
cp -f /etc/icwmpd/icwmpd_backup_session.xml /var/run/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]
|
||||
then
|
||||
mv /etc/icwmpd/dm_enabled_notify /var/run/icwmpd 2>/dev/null
|
||||
|
||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]; then
|
||||
cp -f /etc/icwmpd/dm_enabled_notify /var/run/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
copy_cwmp_varstate_files_to_etc() {
|
||||
if [ -f /var/state/cwmp ]
|
||||
then
|
||||
cp /var/state/cwmp /etc/icwmpd 2>/dev/null
|
||||
if [ -f /var/run/icwmpd/icwmpd_backup_session.xml ]; then
|
||||
cp -f /var/run/icwmpd/icwmpd_backup_session.xml /etc/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
if [ -f /var/run/icwmpd/icwmpd_backup_session.xml ]
|
||||
then
|
||||
cp /var/run/icwmpd/icwmpd_backup_session.xml /etc/icwmpd 2>/dev/null
|
||||
|
||||
if [ -f /var/run/icwmpd/dm_enabled_notify.xml ]; then
|
||||
cp -f /var/run/icwmpd/dm_enabled_notify /etc/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
if [ -f /var/run/icwmpd/dm_enabled_notify.xml ]
|
||||
then
|
||||
cp /var/run/icwmpd/dm_enabled_notify /etc/icwmpd 2>/dev/null
|
||||
|
||||
if [ -f /var/state/cwmp ]; then
|
||||
cp -f /var/state/cwmp /etc/icwmpd/
|
||||
fi
|
||||
|
||||
# move the successful custom notify import marker to persistent storage
|
||||
if [ -f /var/run/icwmpd/icwmpd_notify_import_marker ]; then
|
||||
cp -f /var/run/icwmpd/icwmpd_notify_import_marker /etc/icwmpd/
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -104,12 +130,13 @@ validate_acs_section()
|
||||
'periodic_inform_interval:uinteger' \
|
||||
'periodic_inform_time:string' \
|
||||
'url:string' \
|
||||
'dhcp_discovery:string' \
|
||||
'dhcp_url:string' \
|
||||
'compression:or("GZIP","Deflate","Disabled")' \
|
||||
'retry_min_wait_interval:range(1, 65535)' \
|
||||
'retry_interval_multiplier:range(1000, 65535)' \
|
||||
'https_ssl_capath:file' \
|
||||
'ipv6_enable:bool'
|
||||
'ipv6_enable:bool' \
|
||||
'ssl_capath:string'
|
||||
|
||||
}
|
||||
|
||||
@@ -138,6 +165,7 @@ validate_cpe_section()
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
local ssl_capath
|
||||
config_load cwmp
|
||||
|
||||
validate_acs_section || {
|
||||
@@ -145,10 +173,15 @@ validate_defaults() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ -z "${url}" ] && [ -z "${dhcp_url}" ] && {
|
||||
log "ACS url is empty can't start"
|
||||
return 1;
|
||||
}
|
||||
ssl_capath="${ssl_capath%/}"
|
||||
# Put the cert pem file in keep list
|
||||
if [ -d "${ssl_capath}" ]; then
|
||||
if ! grep "*.pem\|*.crt" /lib/upgrade/keep.d/icwmp; then
|
||||
echo "${ssl_capath}"'/*.pem' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.crt' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.0' >> /lib/upgrade/keep.d/icwmp
|
||||
fi
|
||||
fi
|
||||
|
||||
validate_cpe_section || {
|
||||
log "Validation of cpe section failed"
|
||||
@@ -159,41 +192,36 @@ validate_defaults() {
|
||||
}
|
||||
|
||||
boot() {
|
||||
local dhcp_url dhcp_discovery
|
||||
local dhcp_discovery="0"
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool dhcp_discovery acs dhcp_discovery 1
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
|
||||
if [ "${dhcp_discovery}" == "enable" ] || [ "${dhcp_discovery}" == "1" ]; then
|
||||
if [ -z "${dhcp_url}" ]; then
|
||||
log "dhcp discovery enabled but no dhcp url, trigger update"
|
||||
/etc/icwmpd/update.sh
|
||||
fi
|
||||
# Set dhcp option 43 if not already configured
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
fi
|
||||
|
||||
config_get ssl_capath acs ssl_capath
|
||||
|
||||
if [ -n "${ssl_capath}" ]; then
|
||||
regenerate_ssl_link "${ssl_capath}"
|
||||
fi
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable_cwmp
|
||||
local wan_interface
|
||||
local dhcp_discovery
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get dhcp_discovery acs dhcp_discovery
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
if [ "$enable_cwmp" = "0" ] || [ "$enable_cwmp" = "false" ]; then
|
||||
log "CWMP is not enabled"
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Set dhcp option 43 if dhcp discovery enabled
|
||||
if [ "${dhcp_discovery}" == "enable" ] || [ "${dhcp_discovery}" == "1" ]; then
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
fi
|
||||
|
||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
@@ -217,15 +245,35 @@ start_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
service_stopped()
|
||||
{
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
log "Restarting CWMP client"
|
||||
stop
|
||||
start
|
||||
local ret
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
|
||||
ret="0"
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
stop
|
||||
return 0
|
||||
fi
|
||||
|
||||
status="$(ubus -t 1 call tr069 status |jsonfilter -qe '@.cwmp.status')"
|
||||
ret="$?"
|
||||
if [ "$status" = "up" ]; then
|
||||
ubus -t 1 call tr069 command '{"command":"reload"}'
|
||||
ret="$?"
|
||||
fi
|
||||
|
||||
if [ "$status" = "init" ] || [ "$ret" -ne "0" ]; then
|
||||
log "Restarting CWMP client"
|
||||
stop
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
config_load cwmp
|
||||
|
||||
# Get Manufacturer OUI.
|
||||
oui=$(uci -q get cwmp.cpe.manufacturer_oui)
|
||||
config_get oui cpe manufacturer_oui ""
|
||||
if [ -z "${oui}" ]; then
|
||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
||||
fi
|
||||
@@ -9,24 +13,29 @@ fi
|
||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
||||
|
||||
# Get system serial number.
|
||||
serial=$(uci -q get cwmp.cpe.serial_number)
|
||||
config_get serial cpe serial_number ""
|
||||
if [ -z "${serial}" ]; then
|
||||
serial=$(db -q get device.deviceinfo.SerialNumber)
|
||||
fi
|
||||
|
||||
# Get userid values
|
||||
acs_userid=$(uci -q get cwmp.acs.userid)
|
||||
cpe_userid=$(uci -q get cwmp.cpe.userid)
|
||||
config_get acs_userid acs userid ""
|
||||
config_get cpe_userid cpe userid ""
|
||||
|
||||
# Only set if they are empty
|
||||
if [ -z "$acs_userid" ]
|
||||
then
|
||||
if [ -z "${acs_userid}" ]; then
|
||||
uci -q set cwmp.acs.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
if [ -z "$cpe_userid" ]
|
||||
then
|
||||
if [ -z "${cpe_userid}" ]; then
|
||||
uci -q set cwmp.cpe.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
# Fix the cwmp.cpe.enable parameter
|
||||
# set default to 1 if not defined
|
||||
config_get enable_cwmp cpe enable ""
|
||||
if [ -z "${enable_cwmp}" ]; then
|
||||
uci -q set cwmp.cpe.enable="1"
|
||||
fi
|
||||
|
||||
# No need for commit here, it is done by uci_apply_defaults().
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
regenerate_ssl_link(){
|
||||
[ ! -d "/etc/ssl/certs" ] && return 0;
|
||||
[ ! -f "/etc/ssl/certs/*.pem" ] && return 0;
|
||||
|
||||
local cert_dir="/etc/ssl/certs"
|
||||
local all_file=$(ls $cert_dir/*.pem)
|
||||
|
||||
for cfile in $all_file
|
||||
do
|
||||
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
|
||||
done
|
||||
}
|
||||
|
||||
regenerate_ssl_link
|
||||
@@ -1 +1,2 @@
|
||||
/var/run/icwmpd/icwmpd_backup_session.xml
|
||||
/etc/icwmpd/cwmp
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=4.6.22
|
||||
PKG_VERSION:=4.10.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b5b5379bb7f8ec0c351bfa34385b74b21306d107
|
||||
PKG_SOURCE_VERSION:=287aeb7120b9904d4c481ceb6ba2fa6c73d4f8a2
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -70,6 +70,7 @@ define Package/libieee1905/description
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-Wno-error=deprecated-declarations \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
@@ -3,20 +3,24 @@ config ieee1905 'ieee1905'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
option registrar '2 5'
|
||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config al-iface
|
||||
option enabled '1'
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
|
||||
# ap sections are auto-generated/overwritten during onboarding
|
||||
#
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'TestSSID.2'
|
||||
option encryption 'psk2'
|
||||
option key '5555500000'
|
||||
option ssid 'IOWRT-2.4GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'TestSSID.5'
|
||||
option encryption 'psk2'
|
||||
option key '2222200000'
|
||||
option ssid 'IOWRT-5GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config al-iface
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
22
ieee1905/files/etc/uci-defaults/30-set-ieee1905-al-macaddr
Normal file
22
ieee1905/files/etc/uci-defaults/30-set-ieee1905-al-macaddr
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
BMAC=$(db -q get hw.board.basemac)
|
||||
BMAC=${BMAC//:/}
|
||||
BMAC=${BMAC// /}
|
||||
BMAC=$(printf "%12.12X" $((0x$BMAC)))
|
||||
|
||||
[ "$BMAC" == "" ] && exit 1
|
||||
|
||||
LMAC=$((0x$BMAC & 0xfeffffffffff))
|
||||
LMAC=$(($LMAC | 0x020000000000))
|
||||
LMAC=$(printf "%12.12X" $LMAC)
|
||||
LMAC=$(echo $LMAC | sed -e 's/[0-9A-F]\{2\}/&:/g' -e 's/:$//')
|
||||
|
||||
mac=$(uci -q get ieee1905.ieee1905.macaddress)
|
||||
|
||||
[ "$mac" != "" ] && exit 0
|
||||
|
||||
uci set ieee1905.ieee1905.macaddress="$LMAC"
|
||||
uci commit ieee1905
|
||||
|
||||
@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=inbd
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=10f765f3d0fcc226b6ecf0c481598c9e7f76315e
|
||||
PKG_SOURCE_VERSION:=d4e910a31039e0c0b7a539311eafcd716c36be77
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
26
iop/config
26
iop/config
@@ -50,8 +50,9 @@ CONFIG_PACKAGE_wifimngr=y
|
||||
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-agent=y
|
||||
CONFIG_PACKAGE_map-controller=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_wfadatad=y
|
||||
CONFIG_PACKAGE_wfadatad-collector=y
|
||||
|
||||
# Network #
|
||||
@@ -65,15 +66,16 @@ CONFIG_PACKAGE_questd=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
|
||||
# TR-x69 #
|
||||
CONFIG_PACKAGE_uspd=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_uspd-mbedtls=y
|
||||
CONFIG_PACKAGE_icwmp-mbedtls=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_stunc=m
|
||||
CONFIG_PACKAGE_stunc-mbedtls=m
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_twamp=m
|
||||
CONFIG_PACKAGE_udpechoserver=m
|
||||
CONFIG_PACKAGE_udpecho-client=m
|
||||
CONFIG_PACKAGE_udpecho-server=m
|
||||
CONFIG_PACKAGE_xmppc=m
|
||||
|
||||
# WebGUI #
|
||||
@@ -115,7 +117,8 @@ CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
CONFIG_PACKAGE_miniupnpd-iptables=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
@@ -133,10 +136,11 @@ CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_ip-bridge=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_iptables=y
|
||||
CONFIG_PACKAGE_iptables-legacy=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
@@ -161,6 +165,7 @@ CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_procd-ujail=m
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rrdns=y
|
||||
@@ -284,3 +289,10 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_NOHUP=y
|
||||
|
||||
# Use fw3 iptables-based instead of newer nftables-based fw4
|
||||
# TODO: for now we cannot build an image with fw3 and luci-app-firewall (i.e. fw3)
|
||||
# Enabling luci-app-firewall enables fw4
|
||||
# CONFIG_PACKAGE_luci-app-firewall is not set
|
||||
CONFIG_PACKAGE_firewall=y
|
||||
# CONFIG_PACKAGE_firewall4 is not set
|
||||
|
||||
@@ -2,57 +2,65 @@
|
||||
|
||||
function feeds_update {
|
||||
|
||||
developer=0
|
||||
override=1
|
||||
start=$(date -u +'%s');
|
||||
while getopts "n" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
developer=0
|
||||
override=1
|
||||
start=$(date -u +'%s')
|
||||
while getopts "n" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
#if -d argument is passed, clone feeds with ssh instead of http
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g
|
||||
else
|
||||
./scripts/feeds update
|
||||
fi
|
||||
#if -d argument is passed, clone feeds with ssh instead of http
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g
|
||||
else
|
||||
./scripts/feeds update
|
||||
fi
|
||||
./scripts/feeds update -ai
|
||||
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a
|
||||
fi
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
for target in $(ls ./feeds/targets)
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
./scripts/feeds install -p targets $target
|
||||
done
|
||||
# targets need to be installed explicitly
|
||||
for target in $(ls ./feeds/targets); do
|
||||
rm -f target/linux/$target
|
||||
./scripts/feeds install -p targets $target
|
||||
done
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a
|
||||
# Workaround for bug in 22.03.0-rc4 where installed target path has been
|
||||
# moved to target/linux/feeds but Config.in and Makefile from installed
|
||||
# targets are not properly included from the new location.
|
||||
# This hack is to be removed once the issues are fixed.
|
||||
# Note that the above block of code might no longer necessary because
|
||||
# targets no longer need to be installed explicitly.
|
||||
echo "Working around installed-target-bug"
|
||||
for f in target/linux/feeds/*; do
|
||||
ln -vsf "feeds/$(basename "$f")" "target/linux/$(basename "$f")"
|
||||
done
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete
|
||||
# install all packages
|
||||
./scripts/feeds install -a
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ function genconfig {
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
econet="target/linux/iopsys-econet"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
brcm63xx_arm="target/linux/feeds/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/feeds/iopsys-ramips"
|
||||
econet="target/linux/feeds/iopsys-econet"
|
||||
x86="target/linux/feeds/iopsys-x86"
|
||||
armvirt="target/linux/feeds/iopsys-armvirt"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
@@ -83,8 +83,8 @@ function genconfig {
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/$TARGET" ]; then
|
||||
local targetpath="./target/linux/$TARGET"
|
||||
if [ -n "$TARGET" -a -d "./target/linux/feeds/$TARGET" ]; then
|
||||
local targetpath="./target/linux/feeds/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
@@ -328,6 +328,7 @@ function genconfig {
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
|
||||
@@ -12,11 +12,11 @@ function genconfig_min {
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
econet="target/linux/iopsys-econet"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
brcm63xx_arm="target/linux/feeds/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/feeds/iopsys-ramips"
|
||||
econet="target/linux/feeds/iopsys-econet"
|
||||
x86="target/linux/feeds/iopsys-x86"
|
||||
armvirt="target/linux/feeds/iopsys-armvirt"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
@@ -82,8 +82,8 @@ function genconfig_min {
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/$TARGET" ]; then
|
||||
local targetpath="./target/linux/$TARGET"
|
||||
if [ -n "$TARGET" -a -d "./target/linux/feeds/$TARGET" ]; then
|
||||
local targetpath="./target/linux/feeds/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
@@ -319,6 +319,7 @@ function genconfig_min {
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2012-2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libmicroxml
|
||||
PKG_VERSION:=2012-06-11
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/mirror/microxml.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_LICENSE:=LGPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libmicroxml
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=XML library
|
||||
MAINTAINER:=Luka Perkov <luka@openwrt.org>
|
||||
endef
|
||||
|
||||
define Package/libmicroxml/description
|
||||
A micro sized XML library
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-threads \
|
||||
--enable-static \
|
||||
--enable-shared
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/microxml.h $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_BUILD_DIR)/microxml.pc $(1)/usr/lib/pkgconfig
|
||||
endef
|
||||
|
||||
define Package/libmicroxml/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmicroxml))
|
||||
@@ -1,130 +0,0 @@
|
||||
diff --git a/mxml-file.c b/mxml-file.c
|
||||
index 02eca9d..f10d202 100644
|
||||
--- a/mxml-file.c
|
||||
+++ b/mxml-file.c
|
||||
@@ -363,9 +363,12 @@ mxmlSaveFile(mxml_node_t *node, /* I - Node to write */
|
||||
* Write the node...
|
||||
*/
|
||||
|
||||
- if ((col = mxml_write_node(node, fp, cb, 0, mxml_file_putc, global)) < 0)
|
||||
+ if ((col = mxml_write_node(node, fp, cb, 0, mxml_file_putc, global)) < 0){
|
||||
+ global_free(global);
|
||||
return (-1);
|
||||
-
|
||||
+ }
|
||||
+
|
||||
+ global_free(global);
|
||||
if (col > 0)
|
||||
if (putc('\n', fp) < 0)
|
||||
return (-1);
|
||||
@@ -1448,6 +1451,7 @@ mxml_load_data(
|
||||
if ((buffer = malloc(64)) == NULL)
|
||||
{
|
||||
mxml_error("Unable to allocate string buffer!");
|
||||
+ global_free(global);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -2083,11 +2087,12 @@ mxml_load_data(
|
||||
node->parent ? node->parent->value.element.name : "(null)");
|
||||
|
||||
mxmlDelete(first);
|
||||
-
|
||||
+ global_free(global);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
+ global_free(global);
|
||||
if (parent)
|
||||
return (parent);
|
||||
else
|
||||
@@ -2102,7 +2107,7 @@ error:
|
||||
mxmlDelete(first);
|
||||
|
||||
free(buffer);
|
||||
-
|
||||
+ global_free(global);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
diff --git a/mxml-private.c b/mxml-private.c
|
||||
index 4378ca3..ea6e452 100644
|
||||
--- a/mxml-private.c
|
||||
+++ b/mxml-private.c
|
||||
@@ -41,6 +41,32 @@
|
||||
* This code currently supports AIX, HP-UX, Linux, Mac OS X, Solaris, and
|
||||
* Windows. It might work on the BSDs and IRIX, but I haven't tested that.
|
||||
*/
|
||||
+void *global_mem[16] = {0};
|
||||
+
|
||||
+static void *global_calloc(int x, int size)
|
||||
+{
|
||||
+ int i;
|
||||
+ void *m = calloc(x, size);
|
||||
+ for (i = ((sizeof(global_mem)/sizeof(global_mem[0])) - 1); i > 0; i--) {
|
||||
+ global_mem[i] = global_mem[i-1];
|
||||
+ }
|
||||
+ global_mem[0] = m;
|
||||
+ return m;
|
||||
+}
|
||||
+
|
||||
+void global_free(void *m)
|
||||
+{
|
||||
+ int i;
|
||||
+ if (m == NULL)
|
||||
+ return;
|
||||
+ for (i = ((sizeof(global_mem)/sizeof(global_mem[0])) - 1); i >= 0; i--) {
|
||||
+ if (global_mem[i] == m) {
|
||||
+ global_mem[i] = NULL;
|
||||
+ free(m);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
||||
#if defined(__sun) || defined(_AIX)
|
||||
# pragma fini(_mxml_fini)
|
||||
@@ -148,7 +174,6 @@ mxml_real_cb(mxml_node_t *node) /* I - Current node */
|
||||
return (MXML_REAL);
|
||||
}
|
||||
|
||||
-
|
||||
#ifdef HAVE_PTHREAD_H /**** POSIX threading ****/
|
||||
# include <pthread.h>
|
||||
|
||||
@@ -190,7 +215,6 @@ _MXML_FINI(void)
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
/*
|
||||
* '_mxml_global()' - Get global data.
|
||||
*/
|
||||
@@ -205,7 +229,7 @@ _mxml_global(void)
|
||||
|
||||
if ((global = (_mxml_global_t *)pthread_getspecific(_mxml_key)) == NULL)
|
||||
{
|
||||
- global = (_mxml_global_t *)calloc(1, sizeof(_mxml_global_t));
|
||||
+ global = (_mxml_global_t *)global_calloc(1, sizeof(_mxml_global_t));
|
||||
pthread_setspecific(_mxml_key, global);
|
||||
|
||||
global->num_entity_cbs = 1;
|
||||
@@ -288,7 +312,7 @@ _mxml_global(void)
|
||||
|
||||
if ((global = (_mxml_global_t *)TlsGetValue(_mxml_tls_index)) == NULL)
|
||||
{
|
||||
- global = (_mxml_global_t *)calloc(1, sizeof(_mxml_global_t));
|
||||
+ global = (_mxml_global_t *)global_calloc(1, sizeof(_mxml_global_t));
|
||||
|
||||
global->num_entity_cbs = 1;
|
||||
global->entity_cbs[0] = _mxml_entity_cb;
|
||||
diff --git a/mxml-private.h b/mxml-private.h
|
||||
index c591208..72ed338 100644
|
||||
--- a/mxml-private.h
|
||||
+++ b/mxml-private.h
|
||||
@@ -43,3 +43,4 @@ typedef struct _mxml_global_s
|
||||
extern _mxml_global_t *_mxml_global(void);
|
||||
extern int _mxml_entity_cb(const char *name);
|
||||
|
||||
+extern void global_free(void *m);
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libtrace
|
||||
PKG_VERSION:=3.0.22
|
||||
PKG_VERSION:=3.0.23
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
@@ -72,11 +72,11 @@ endef
|
||||
|
||||
define Package/libtrace/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libtrace.so.* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libwandio.so.* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtrace.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwandio.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.so.* $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/libpacketdump
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump/*.so* $(1)/usr/lib/libpacketdump/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump/*.so* $(1)/usr/lib/libpacketdump/
|
||||
endef
|
||||
|
||||
define Package/libtrace-tools/install
|
||||
|
||||
@@ -6,5 +6,12 @@ config AGENT_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
bool "Support Dynamic Controller configuration sync"
|
||||
default y if MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
|
||||
config AGENT_ISLAND_PREVENTION
|
||||
bool "Support Island Prevention"
|
||||
default y if MULTIAP_AGENT_ISLAND_PREVENTION
|
||||
|
||||
config AGENT_EASYMESH_R2_CERT
|
||||
bool "Compile for WFA test bed"
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2020-21 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=7.1.22
|
||||
PKG_VERSION:=2.10.0.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=c3cf2f442ce79ffafe2e4e66e4120587f98b4da8
|
||||
PKG_SOURCE_VERSION:=78face98267fc46d7d227979b35fcb39a2e175c9
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -56,12 +56,21 @@ endef
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-Wno-error=deprecated-declarations \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_AGENT_SYNC_DYNAMIC_CNTLR_CONFIG),y)
|
||||
TARGET_CFLAGS += -DAGENT_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_ISLAND_PREVENTION),y)
|
||||
TARGET_CFLAGS += -DAGENT_ISLAND_PREVENTION
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_EASYMESH_R2_CERT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_R2_CERT
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
|
||||
@@ -1,34 +1,132 @@
|
||||
config agent 'agent'
|
||||
option enabled '1'
|
||||
option debug '6'
|
||||
option debug '0'
|
||||
option profile '2'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
option eth_onboards_wifi_bhs '0'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config dynamic_backhaul
|
||||
option missing_bh_timer '60'
|
||||
option missing_bh_reconfig_timer '1800'
|
||||
|
||||
config controller_select
|
||||
option id 'auto'
|
||||
option probe_int '20'
|
||||
option retry_int '9'
|
||||
option autostart '1'
|
||||
option local '0'
|
||||
|
||||
config radio
|
||||
option device 'phy0'
|
||||
option band '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '70'
|
||||
# option report_rcpi_threshold '80'
|
||||
# option rcpi_hysteresis_margin '0'
|
||||
# option report_util_threshold '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config radio
|
||||
option device 'phy1'
|
||||
option band '5'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '86'
|
||||
# option report_rcpi_threshold '96'
|
||||
# option rcpi_hysteresis_margin '0'
|
||||
# option report_util_threshold '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan0'
|
||||
option band '2'
|
||||
option device 'phy0'
|
||||
option priority '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option onboarded '1'
|
||||
# option bssid '0a:1b:2c:3d:4e:53'
|
||||
# option vid '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan1'
|
||||
option band '5'
|
||||
option device 'phy1'
|
||||
option priority '0'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option onboarded '1'
|
||||
# option bssid '0a:1b:2c:3d:4e:54'
|
||||
# option vid '1'
|
||||
|
||||
# ap sections and policy section are
|
||||
# auto-generated during onboarding
|
||||
#
|
||||
#config ap
|
||||
# option ifname 'wl0'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# list assoc_ctrl '00:10:20:30:40:50'
|
||||
# option btm_retry '3'
|
||||
# option btm_retry_secs '180'
|
||||
# option fallback_legacy '1'
|
||||
# option steer_legacy_reassoc_secs '30'
|
||||
# option steer_legacy_retry_secs '3600'
|
||||
# option assoc_ctrl_secs '30'
|
||||
# option band '2'
|
||||
# option type 'fronthaul'
|
||||
|
||||
#config ap
|
||||
# option ifname 'wl1'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# option band '5'
|
||||
# option type 'fronthaul'
|
||||
|
||||
#config bsta
|
||||
# option ifname 'apclii0'
|
||||
# option enabled '1'
|
||||
# option onboarded '0'
|
||||
# option disallow_bsta '1 # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
# option ifname 'wlan0-1'
|
||||
# option band '2'
|
||||
# option device 'phy0'
|
||||
# option type 'fronthaul'
|
||||
# option ssid 'IOWRT-2.4GHz'
|
||||
# option encryption 'sae-mixed+aes'
|
||||
# option key '1234567890'
|
||||
# option vid '1'
|
||||
|
||||
#config ap
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan0-2'
|
||||
# option band '2'
|
||||
# option device 'phy0'
|
||||
# option type 'backhaul'
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae+aes'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option disallow_bsta '0'
|
||||
# option vid '1'
|
||||
|
||||
#config ap
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan1-1'
|
||||
# option band '5'
|
||||
# option device 'phy1'
|
||||
# option type 'fronthaul'
|
||||
# option ssid 'IOWRT-5GHz'
|
||||
# option encryption 'sae-mixed+aes'
|
||||
# option key '1234567890'
|
||||
# option vid '1'
|
||||
|
||||
#config ap
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan1-2'
|
||||
# option band '5'
|
||||
# option device 'phy1'
|
||||
# option type 'backhaul'
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae+aes'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option disallow_bsta '0'
|
||||
# option vid '1'
|
||||
|
||||
#config policy
|
||||
# option report_interval '0'
|
||||
# option pvid '1'
|
||||
# option pcp_default '0'
|
||||
# option report_scan '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
|
||||
|
||||
@@ -97,7 +97,9 @@ if [ "$LINK" = "up" ]; then
|
||||
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT"
|
||||
else
|
||||
rm -f "$map_bh_file"
|
||||
/lib/wifi/multiap unset_uplink "eth"
|
||||
#rm -f "$map_bh_file"
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bsta up
|
||||
|
||||
fi
|
||||
|
||||
@@ -59,7 +59,7 @@ remove_map() {
|
||||
}
|
||||
|
||||
start_dynbhd_service() {
|
||||
rm -f /tmp/map.agent.bsta_global_disable
|
||||
rm -f /tmp/multiap.backhaul
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/dynbhd"
|
||||
procd_set_param respawn
|
||||
@@ -79,7 +79,10 @@ validate_agent_section() {
|
||||
'netdev:string' \
|
||||
'vlan_segregation:bool:false' \
|
||||
'resend_num:uinteger:0' \
|
||||
'dyn_cntlr_sync:bool:true'
|
||||
'dyn_cntlr_sync:bool:true' \
|
||||
'island_prevention:bool:false' \
|
||||
'eth_onboards_wifi_bhs:bool:false'
|
||||
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of agent section failed"
|
||||
@@ -113,7 +116,7 @@ validate_ap_section() {
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'ifname:string' \
|
||||
'device:string' \
|
||||
'band:or("2", "5")' \
|
||||
'band:or("2", "5", "6")' \
|
||||
'enabled:bool:true' \
|
||||
'onboarded:bool:false' \
|
||||
'ssid:string' \
|
||||
@@ -139,14 +142,15 @@ validate_radio_section() {
|
||||
'configured:bool:false' \
|
||||
'onboarded:bool:false' \
|
||||
'dedicated_backhaul:bool:false' \
|
||||
'steer_policy:range(0,255)' \
|
||||
'steer_policy:range(0,255)' \
|
||||
'util_threshold:range(0,255)' \
|
||||
'rcpi_threshold:range(0,255)' \
|
||||
'report_rcpi_threshold:range(0,255)' \
|
||||
'include_sta_stats:bool:false' \
|
||||
'include_sta_metric:bool:false' \
|
||||
'rcpi_hysteresis_margin:range(0,255)' \
|
||||
'report_util_threshold:range(0,255)'
|
||||
'report_util_threshold:range(0,255)' \
|
||||
'encryption:or("sae", "psk2", "sae-mixed")'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of radio section failed"
|
||||
@@ -178,14 +182,31 @@ validate_policy_section() {
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_dyn_bh_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'missing_bh_timer:range(1,255)'
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'missing_bh_reconfig_timer:range(0,65535)'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of dynamic backhaul section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_agent_config() {
|
||||
IS_CFG_VALID=1
|
||||
|
||||
validate_agent_section &&
|
||||
config_foreach validate_cs_section controller_select &&
|
||||
config_foreach validate_ap_section ap &&
|
||||
config_foreach validate_radio_section radio &&
|
||||
config_foreach validate_policy_section policy
|
||||
config_foreach validate_radio_section radio &&
|
||||
config_foreach validate_policy_section policy &&
|
||||
config_foreach validate_dyn_bh_section dynamic_backhaul
|
||||
|
||||
[ "$IS_CFG_VALID" -ne 1 ] && {
|
||||
logger -s -t "mapagent" "Validation of mapagent UCI file failed"
|
||||
@@ -213,7 +234,7 @@ start_service() {
|
||||
[ "$ts" -eq 1 ] && create_map #|| remove_map
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/mapagent" "-d"
|
||||
procd_set_param command "/usr/sbin/mapagent" "-d"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
|
||||
13
map-agent/files/etc/uci-defaults/991-map-agent-unset-pvid
Executable file
13
map-agent/files/etc/uci-defaults/991-map-agent-unset-pvid
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
unset_pvid() {
|
||||
local section=$1
|
||||
|
||||
uci -q set mapagent.${section}.pvid="0"
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
|
||||
config_foreach unset_pvid policy
|
||||
@@ -55,7 +55,7 @@ get_type_by_section() {
|
||||
echo "$(type_to_multi_ap $type)"
|
||||
}
|
||||
|
||||
brcm_sync_credentials() {
|
||||
sync_credentials() {
|
||||
bands=""
|
||||
json_init
|
||||
mapagent_process_fh() {
|
||||
@@ -160,7 +160,7 @@ brcm_sync_credentials() {
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
brcm_write_credentials() {
|
||||
write_credentials() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wireless() {
|
||||
@@ -207,7 +207,7 @@ brcm_write_credentials() {
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
echo $(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key") 2> /dev/null
|
||||
(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key")
|
||||
}
|
||||
|
||||
mapagent_find_bbss() {
|
||||
@@ -250,7 +250,7 @@ brcm_write_credentials() {
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
brcm_set_network() {
|
||||
set_network() {
|
||||
local ifname=$1
|
||||
local num=$2
|
||||
local bssid=$3
|
||||
@@ -356,14 +356,14 @@ write_bsta_config() {
|
||||
|
||||
#echo result diff = $diff > /dev/console
|
||||
[ "$diff" == "1" ] && {
|
||||
config_foreach mapagent_apply_bssid_same_band bsta
|
||||
(config_foreach mapagent_apply_bssid_same_band bsta)
|
||||
#ubus call uci commit '{"config":"wireless"}'
|
||||
#echo reloading wireless > /dev/console
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
brcm_teardown_iface() {
|
||||
teardown_iface() {
|
||||
config_load mapagent
|
||||
|
||||
local iface=$1
|
||||
@@ -377,7 +377,7 @@ brcm_teardown_iface() {
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
uci -q set wireless.${section}.start_disabled="1"
|
||||
uci -q set wireless.${section}.disabled="1"
|
||||
uci -q set wireless.${section}.ssid="DISABLED-SSID"
|
||||
uci -q set wireless.${section}.key="DISABLED-KEY"
|
||||
uci -q delete wireless.${section}.multi_ap_backhaul_ssid
|
||||
@@ -406,7 +406,7 @@ brcm_teardown_iface() {
|
||||
uci -q set mapagent.${section}.key="DISABLED-KEY"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
$(mapagent_teardown_wireless $ifname)
|
||||
(mapagent_teardown_wireless $ifname)
|
||||
}
|
||||
|
||||
|
||||
@@ -416,7 +416,7 @@ brcm_teardown_iface() {
|
||||
uci commit mapagent
|
||||
}
|
||||
|
||||
brcm_bsta_to_wireless() {
|
||||
bsta_to_wireless() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_find_lowest_prio_onboarded() {
|
||||
@@ -488,10 +488,12 @@ brcm_bsta_to_wireless() {
|
||||
|
||||
mapagent_find_other_creds() {
|
||||
#echo "trying to find other creds for $2" > /dev/console
|
||||
local other_section="$2"
|
||||
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$3" != "$band" -o "$onboarded" = "0" ] && return
|
||||
[ "$4" != "$band" -o "$onboarded" = "0" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
@@ -499,7 +501,12 @@ brcm_bsta_to_wireless() {
|
||||
config_get enabled $1 enabled "0"
|
||||
config_get bssid $1 bssid
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $2 "$ssid" "$key" $encryption $4 "$bssid")
|
||||
uci -q set mapagent.${other_section}.ssid="$ssid"
|
||||
uci -q set mapagent.${other_section}.key="$key"
|
||||
uci -q set mapagent.${other_section}.encryption=$encryption
|
||||
uci -q set mapagent.${other_section}.bssid="$bssid"
|
||||
uci commit mapagent
|
||||
(mapagent_apply_wl_bsta "$3" "$ssid" "$key" $encryption "$5" "$bssid")
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
@@ -508,14 +515,14 @@ brcm_bsta_to_wireless() {
|
||||
config_get enabled $1 enabled "0"
|
||||
|
||||
if [ "$onboarded" = "0" ]; then
|
||||
config_foreach mapagent_find_other_creds bsta $ifname $band $enabled
|
||||
config_foreach mapagent_find_other_creds bsta $1 $ifname $band $enabled
|
||||
else
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
config_get bssid $1 bssid
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled "$bssid")
|
||||
(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled "$bssid")
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -665,7 +672,7 @@ bsta_scan_on_enabled() {
|
||||
|
||||
bsta_enable_all() {
|
||||
mapagent_enable_bk() {
|
||||
config_get ifname $1 ifname "2"
|
||||
config_get ifname $1 ifname
|
||||
uci -q set mapagent.$1.enabled="1"
|
||||
}
|
||||
|
||||
@@ -676,6 +683,58 @@ bsta_enable_all() {
|
||||
bsta_scan_on_enabled
|
||||
}
|
||||
|
||||
bsta_clear_all_bssid() {
|
||||
mapagent_remove_bssid() {
|
||||
uci -q set mapagent.$1.enabled="1"
|
||||
uci -q del mapagent.$1.bssid
|
||||
}
|
||||
|
||||
wireless_remove_bssid() {
|
||||
config_get mode $1 mode
|
||||
config_get ifname $1 ifname
|
||||
|
||||
[ "$mode" != "sta" ] && return
|
||||
|
||||
uci -q del wireless.$1.bssid
|
||||
wpa_cli -i "$ifname" bssid 0 00:00:00:00:00:00 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_remove_bssid bsta
|
||||
uci commit mapagent
|
||||
|
||||
config_load wireless
|
||||
config_foreach wireless_remove_bssid wifi-iface
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
# arg1 = ifname arg2 = bssid
|
||||
bsta_blacklist_bssid_set() {
|
||||
local ifname="$1"
|
||||
shift
|
||||
local bssid="$@"
|
||||
|
||||
return
|
||||
|
||||
wpa_cli -i "$ifname" set_network 0 bssid_ignore "$bssid" > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
|
||||
bsta_blacklist_bssid_clear() {
|
||||
mapagent_blacklist_by_band() {
|
||||
config_get ifname $1 ifname
|
||||
|
||||
wpa_cli -i "$ifname" set_network 0 bssid_ignore "" > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
|
||||
return
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_blacklist_by_band bsta
|
||||
}
|
||||
|
||||
bsta_disable_lower_priority() {
|
||||
config_load mapagent
|
||||
|
||||
@@ -725,7 +784,7 @@ bsta_disable_lower_priority() {
|
||||
|
||||
uci -q set mapagent.$1.enabled="$enabled"
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
|
||||
(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
@@ -774,11 +833,14 @@ set_uplink_backhaul_info() {
|
||||
local ul_1905id=$1
|
||||
local ul_mac=$2
|
||||
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_add_string "backhaul_device_id" "$ul_1905id"
|
||||
json_add_string "backhaul_macddr" "$ul_mac"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
(
|
||||
flock -x 200
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_add_string "backhaul_device_id" "$ul_1905id"
|
||||
json_add_string "backhaul_macddr" "$ul_mac"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
) 200>/var/lock/map.backhaul.lock
|
||||
}
|
||||
|
||||
set_uplink() {
|
||||
@@ -792,31 +854,63 @@ set_uplink() {
|
||||
json_add_string "type" "$type"
|
||||
json_add_string "ifname" "$ifname"
|
||||
json_add_string "macaddr" "$hwaddr"
|
||||
json_dump > "$MAPFILE"
|
||||
(
|
||||
flock -x 200
|
||||
json_dump > "$MAPFILE"
|
||||
) 200>/var/lock/map.backhaul.lock
|
||||
json_cleanup
|
||||
|
||||
config_load mapagent
|
||||
|
||||
island_prevention="$(uci -q get mapagent.agent.island_prevention)"
|
||||
|
||||
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
|
||||
ubus call map.agent toggle_fh '{"enable":true, "prevent_island":true, "ifname":"all"}'
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
unset_uplink() {
|
||||
rm "$MAPFILE" > /dev/null 2>&1
|
||||
local type=${1:-wifi}
|
||||
|
||||
config_load mapagent
|
||||
|
||||
island_prevention="$(uci -q get mapagent.agent.island_prevention)"
|
||||
|
||||
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
|
||||
ubus call map.agent toggle_fh '{"enable":false, "prevent_island":true, "ifname":"all"}'
|
||||
fi
|
||||
|
||||
(
|
||||
flock -x 200
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_get_var bk_type type
|
||||
json_cleanup
|
||||
|
||||
[ "$type" = "$bk_type" ] && rm -f "$MAPFILE" > /dev/null 2>&1
|
||||
) 200>/var/lock/map.backhaul.lock
|
||||
}
|
||||
|
||||
func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
wireless_teardown) brcm_wireless_teardown;;
|
||||
setup_network) brcm_setup_network;;
|
||||
setup_wireless) brcm_setup_wireless;;
|
||||
write_credentials) brcm_write_credentials;;
|
||||
sync_credentials) brcm_sync_credentials;;
|
||||
wireless_teardown) wireless_teardown;;
|
||||
setup_network) setup_network;;
|
||||
setup_wireless) setup_wireless;;
|
||||
write_credentials) write_credentials;;
|
||||
sync_credentials) sync_credentials;;
|
||||
bsta_steer) bsta_steer $@;;
|
||||
set_network) brcm_set_network $@;;
|
||||
set_network) set_network $@;;
|
||||
write_bsta_config) write_bsta_config $@;;
|
||||
teardown_iface) brcm_teardown_iface $@;;
|
||||
bsta_to_wireless) brcm_bsta_to_wireless $@;;
|
||||
teardown_iface) teardown_iface $@;;
|
||||
bsta_to_wireless) bsta_to_wireless $@;;
|
||||
sync_mapcontroller_from_wireless) sync_mapcontroller_from_wireless $@;;
|
||||
ts) ts_sub $@;;
|
||||
bsta_enable_all) bsta_enable_all $@;;
|
||||
bsta_clear_all_bssid) bsta_clear_all_bssid $@;;
|
||||
bsta_blacklist_bssid_set) bsta_blacklist_bssid_set $@;;
|
||||
bsta_blacklist_bssid_clear) bsta_blacklist_bssid_clear $@;;
|
||||
bsta_disable_lower_priority) bsta_disable_lower_priority $@;;
|
||||
bsta_scan_on_enabled) bsta_scan_on_enabled $@;;
|
||||
bsta_use_link) bsta_use_link $@;;
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
AL_BRIDGE=${AL_BRIDGE-"br-lan"}
|
||||
PRIMARY_VID=${PRIMARY_VID-1}
|
||||
|
||||
### Traffic Separation ###
|
||||
|
||||
dbg() {
|
||||
@@ -9,489 +12,223 @@ dbg() {
|
||||
}
|
||||
|
||||
ts_sub() {
|
||||
|
||||
ts_usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [create|delete|populate|primary|reload]
|
||||
Usage: $0 [create|reload]
|
||||
Traffic Separation related functions.
|
||||
create fh <iface> <vid> - create vlan device and rules for wifi fronthaul
|
||||
create bh <iface> <vid> <profile> - create vlan device and rules for wifi backhaul
|
||||
create eth <iface> <vid> <pbits> - create vlan device and rules for logical ethernet interface
|
||||
delete <iface> - delete vlan device
|
||||
populate eth <iface> <vid> - add secondary network rules for logical ethernet interface
|
||||
primary get <iface> - read primary VID for interface from driver (from Association Response frame IE)
|
||||
reload - reload network with new configuration
|
||||
create vid - create vlan configuration with vlan_id
|
||||
reload - reload network with new configuration
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_get_bridge() {
|
||||
local bridge=$(ip link show $1 | grep -o "master [^\s]*" | cut -d ' ' -f 2)
|
||||
echo $bridge
|
||||
}
|
||||
ts_create() {
|
||||
_net_setup() {
|
||||
local name=$1
|
||||
local vid=$2
|
||||
local proto=$3
|
||||
local dev=$4
|
||||
local port_dev=$5
|
||||
|
||||
set_wireless_bridge() {
|
||||
config_load wireless
|
||||
[ -z "$(uci -q get network.${name})" ] || return
|
||||
|
||||
_set_network() {
|
||||
local sec=$1
|
||||
local iface=$2
|
||||
local bridge=$3
|
||||
local ip_addr="192.168.${vid}.1"
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local tag=":t"
|
||||
|
||||
config_get ifname $sec ifname
|
||||
[ "$iface" != "$ifname" ] && continue
|
||||
[ "${vid}" = "${PRIMARY_VID}" ] && {
|
||||
tag=""
|
||||
|
||||
config_get mode $sec mode
|
||||
config_get multi_ap $sec multi_ap "0"
|
||||
[ "$mode" = "sta" -a "$multi_ap" = "1" ] && continue
|
||||
# Global options
|
||||
[ -z "$(uci -q get network.${br_dev}.vlan_filtering)" ] && {
|
||||
uci -q set network.${br_dev}.vlan_filtering=1;
|
||||
}
|
||||
|
||||
config_get network $sec network
|
||||
local new_network=${bridge##br-}
|
||||
if [ "$new_network" != "$network" ] ; then
|
||||
uci -q set wireless.${sec}.network=${new_network}
|
||||
uci commit wireless
|
||||
uci -q delete network.lan.proto
|
||||
uci -q delete network.lan.ipaddr
|
||||
uci -q delete network.lan.netmask
|
||||
uci -q delete network.lan.ip6assign
|
||||
}
|
||||
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="$dev"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
|
||||
if [ "$proto" = "static" ] ; then
|
||||
uci -q set network.${name}.proto="static"
|
||||
# TODO vid > 255
|
||||
uci -q set network.${name}.ipaddr="${ip_addr}"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
uci -q set network.${name}.ip6assign '60'
|
||||
else
|
||||
uci -q set network.${name}.proto="dhcp"
|
||||
fi
|
||||
|
||||
brctl addif $bridge $iface &> /dev/null
|
||||
}
|
||||
uci -q add network bridge-vlan
|
||||
uci -q set network.@bridge-vlan[-1].device="$AL_BRIDGE"
|
||||
uci -q set network.@bridge-vlan[-1].vlan="$vid"
|
||||
|
||||
config_foreach _set_network wifi-iface ${1} ${2}
|
||||
}
|
||||
|
||||
ts_create() {
|
||||
|
||||
_create_vlan_dev() {
|
||||
iface=$1 # real iface
|
||||
vid=$2 # Vlan ID
|
||||
bridge=$3 # bridge iface should be connected
|
||||
vlan_dev=$4
|
||||
|
||||
old_bridge="$(_get_bridge $iface)" # bridge iface is connected to
|
||||
|
||||
# remove interface from bridge if it is in one
|
||||
[ -n "$old_bridge" ] && brctl delif $old_bridge $iface &> /dev/null
|
||||
|
||||
# (re)create vlan device
|
||||
ip link show $vlan_dev && vlanctl --if-delete $vlan_dev
|
||||
vlanctl --mcast --if-create-name $iface $vlan_dev --if $iface --set-if-mode-rg
|
||||
|
||||
vlanctl --if $iface --tx --tags 0 --default-miss-drop
|
||||
vlanctl --if $iface --tx --tags 1 --default-miss-drop
|
||||
vlanctl --if $iface --tx --tags 2 --default-miss-drop
|
||||
vlanctl --if $iface --rx --tags 0 --default-miss-drop
|
||||
vlanctl --if $iface --rx --tags 1 --default-miss-drop
|
||||
vlanctl --if $iface --rx --tags 2 --default-miss-drop
|
||||
|
||||
# bring the vlan device up and add back to bridge if it was in one
|
||||
brctl addif $bridge $vlan_dev &> /dev/null
|
||||
}
|
||||
|
||||
ts_create_fh() {
|
||||
iface=$1 # fh iface
|
||||
vid=$2 # SSID specific (secondary) or primary vid
|
||||
bridge=$3
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding FH device requires IFACE, VID and bridge
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
#set_wireless_bridge $iface $bridge
|
||||
|
||||
vlan_dev=${iface}_vlan${vid}
|
||||
ip link set $vlan_dev down
|
||||
_create_vlan_dev $iface $vid $bridge $vlan_dev
|
||||
|
||||
# add rules
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x886c --set-rxif $vlan_dev --rule-append # incoming brcm
|
||||
|
||||
# EAPOL frames
|
||||
vlanctl --if $iface --rx --tags 0 --filter-ethertype 34958 --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --rx --tags 1 --filter-ethertype 34958 --pop-tag --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --tx --tags 0 --filter-txif $vlan_dev --filter-ethertype 34958 --rule-append
|
||||
|
||||
# 8021q vlan id TAG/UNTAG
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --filter-vid $vid 0 --pop-tag --dscp2pbits 0 --rule-append
|
||||
|
||||
ip link set $iface up
|
||||
ip link set $vlan_dev up
|
||||
}
|
||||
|
||||
ts_create_bh() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
bridge=$4 # bridge interface should be connected to
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
#[ -n "$bridge" ] && set_wireless_bridge $iface $bridge
|
||||
|
||||
old_vid=$(wl -i $1 map_8021q_settings)
|
||||
old_vid=${old_vid##* }
|
||||
old_profile=$(wl -i $1 map_profile | cut -d ' ' -f 3)
|
||||
|
||||
[ "$old_vid" = "$vid" -a "$old_profile" = "$profile" ] && return
|
||||
|
||||
wl vlan_mode 0 &> /dev/null # make sure this is OFF, else driver won't handle vlan
|
||||
wl -i $iface down &> /dev/null
|
||||
wl -i $iface map_profile $profile &> /dev/null # only has effect on profile 2
|
||||
wl -i $iface map_8021q_settings $vid &> /dev/null # can only be set on bBSS (read-only on bSTA)
|
||||
wl -i $iface up &> /dev/null
|
||||
}
|
||||
|
||||
ts_create_lei() {
|
||||
vid=$1 # primary vid
|
||||
pbits=$2 # default pbits to apply
|
||||
vlan_bridge=$3 # name of ts subsystem bridge
|
||||
lan_bridge=$4 # name of node local bridge
|
||||
|
||||
[ -n "$vid" ] && [ -n "$pbits" ] && [ -n "$vlan_bridge" ] && [ -n "$lan_bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
ip link show lei &> /dev/null || {
|
||||
ip link add link lei name lei_lan type vlan id 1 2>/dev/null
|
||||
}
|
||||
|
||||
old_vid=$(ip -d link show lei_lan | sed -n 's/vlan.*id \([0-9][0-9]*\) .*/\1/p')
|
||||
|
||||
[ "$old_vid" != "$vid" ] && {
|
||||
ip link del lei_lan
|
||||
ip link add link lei name lei_lan type vlan id ${vid}
|
||||
}
|
||||
|
||||
brctl addif ${lan_bridge} lei_lan &>/dev/null
|
||||
brctl addif ${vlan_bridge} lei_map &>/dev/null
|
||||
|
||||
ip link set lei up
|
||||
ip link set lei_map up
|
||||
ip link set lei_lan up
|
||||
}
|
||||
|
||||
_create_eth() {
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # primary vid
|
||||
bridge=$3 # name of ts subsystem bridge
|
||||
pbits=0
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
dbg create $@
|
||||
|
||||
ip link set $iface down
|
||||
|
||||
vlan_dev=${iface}_vlan${vid}
|
||||
ip link set $vlan_dev down
|
||||
_create_vlan_dev $iface $vid $bridge $vlan_dev
|
||||
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --set-pbits $pbits 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
|
||||
[ $# -le 3 ] && exit 0
|
||||
shift 3
|
||||
|
||||
while [ -n "$1" ] ; do
|
||||
vid=$1
|
||||
vlanctl --if $iface --rx --tags 1 --filter-vid $vid 0 --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --rule-append
|
||||
shift
|
||||
for port in $(uci -q get network.${br_dev}.ports) ; do
|
||||
echo $port | grep -q eth || continue
|
||||
uci -q add_list network.@bridge-vlan[-1].ports="${port}${tag}"
|
||||
done
|
||||
|
||||
ip link set $iface up
|
||||
ip link set $vlan_dev up
|
||||
uci -q add_list network.${br_dev}.ports="$port_dev"
|
||||
uci -q add_list network.@bridge-vlan[-1].ports="$port_dev"
|
||||
|
||||
uci -q commit network
|
||||
}
|
||||
|
||||
ts_create_eths() {
|
||||
pvid=$1 # primary vid
|
||||
bridge=$2 # name of ts subsystem bridge
|
||||
_dhcp_setup() {
|
||||
local name=$1
|
||||
|
||||
shift 2
|
||||
# TODO use ieee1905 bridge
|
||||
for iface in $(uci get network.br_lan.ports) ; do
|
||||
[ "$iface" = "lei_lan" ] && continue
|
||||
_create_eth $iface $pvid $bridge $@
|
||||
ubus call ieee1905 del_interface "{\"ifname\":\"$iface\"}"
|
||||
done
|
||||
[ -n "$(uci -q get dhcp.${name})" ] && return
|
||||
|
||||
uci -q set dhcp.${name}=dhcp
|
||||
uci -q set dhcp.${name}.interface="${name}"
|
||||
uci -q set dhcp.${name}.start="100"
|
||||
uci -q set dhcp.${name}.limit="150"
|
||||
uci -q set dhcp.${name}.leasetime="1h"
|
||||
uci -q set dhcp.${name}.dhcpv4="server"
|
||||
uci -q set dhcp.${name}.dhcpv6="server"
|
||||
uci -q set dhcp.${name}.ra="server"
|
||||
uci -q set dhcp.${name}.ra_slaac="1"
|
||||
uci -q add_list dhcp.${name}.ra_flags="managed-config"
|
||||
uci -q add_list dhcp.${name}.ra_flags="other-config"
|
||||
|
||||
uci -q commit dhcp
|
||||
}
|
||||
|
||||
ts_create_dhcp() {
|
||||
local diff=""
|
||||
_firewall_setup() {
|
||||
local name=$1
|
||||
local network=$1
|
||||
local vid=$2
|
||||
local zone_exist=0
|
||||
|
||||
_net_setup() {
|
||||
local name=$1
|
||||
local devname=$2
|
||||
local vid=$3
|
||||
config_load firewall
|
||||
|
||||
[ -z "$(uci -q get network.${name})" ] && {
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="$devname"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
uci -q set network.${name}.proto="static"
|
||||
# TODO vid > 255
|
||||
local ip_addr="192.168.${vid}.1"
|
||||
[ "${vid}" = "1" ] && ip_addr="192.168.${vid}.2"
|
||||
uci -q set network.${name}.ipaddr="${ip_addr}"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local new_name=$2
|
||||
local name
|
||||
|
||||
diff="1"
|
||||
}
|
||||
config_get name $section name
|
||||
|
||||
[ "$diff" = "1" ] && uci -q commit network
|
||||
[ "$name" == "$new_name" ] && zone_exist=1
|
||||
}
|
||||
|
||||
_br_setup() {
|
||||
local name=$1
|
||||
local sinkname=$2
|
||||
local vid=$3
|
||||
config_foreach _process_zone zone $name
|
||||
|
||||
[ -z "$(uci -q get network.${name}_dev)" ] && {
|
||||
uci -q set network.${name}_dev="device"
|
||||
uci -q set network.${name}_dev.name="br-${name}"
|
||||
uci -q set network.${name}_dev.type="bridge"
|
||||
uci -q set network.${name}_dev.bridge_empty="1"
|
||||
uci -q add_list network.${name}_dev.ports="${sinkname}"
|
||||
[ "$zone_exist" != "0" ] && return
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get network.${name})" ] && {
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="br-${name}"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
uci -q set network.${name}.proto="static"
|
||||
uci -q set network.${name}.ipaddr="192.168.${vid}.1"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ "$diff" = "1" ] && uci -q commit network
|
||||
[ "${vid}" = "${PRIMARY_VID}" ] && {
|
||||
uci -q delete firewall.lan
|
||||
}
|
||||
|
||||
_dhcp_setup() {
|
||||
local name=$1
|
||||
uci -q add firewall zone
|
||||
uci -q set firewall.@zone[-1].name="$name"
|
||||
uci -q add_list firewall.@zone[-1].network="$network"
|
||||
uci -q set firewall.@zone[-1].input='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].output='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].forward='ACCEPT'
|
||||
|
||||
[ -n "$(uci -q get dhcp.${name})" ] && return
|
||||
uci -q add firewall forwarding
|
||||
uci -q set firewall.@forwarding[-1].src="$name"
|
||||
uci -q set firewall.@forwarding[-1].dest="wan"
|
||||
|
||||
uci -q set dhcp.${name}=dhcp
|
||||
uci -q set dhcp.${name}.interface="${name}"
|
||||
uci -q set dhcp.${name}.start="100"
|
||||
uci -q set dhcp.${name}.limit="150"
|
||||
uci -q set dhcp.${name}.leasetime="1h"
|
||||
uci -q set dhcp.${name}.dhcpv4="server"
|
||||
uci -q set dhcp.${name}.dhcpv6="server"
|
||||
uci -q set dhcp.${name}.ra="server"
|
||||
uci -q set dhcp.${name}.ra_slaac="1"
|
||||
uci -q add_list dhcp.${name}.ra_flags="managed-config"
|
||||
uci -q add_list dhcp.${name}.ra_flags="other-config"
|
||||
|
||||
diff="1"
|
||||
uci -q commit dhcp
|
||||
}
|
||||
|
||||
_firewall_setup() {
|
||||
local name=$1
|
||||
local network=$2
|
||||
local zone_exist=0
|
||||
|
||||
config_load firewall
|
||||
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local new_name=$2
|
||||
local name
|
||||
|
||||
config_get name $section name
|
||||
|
||||
[ "$name" == "$new_name" ] && zone_exist=1
|
||||
}
|
||||
|
||||
config_foreach _process_zone zone $name
|
||||
|
||||
[ "$zone_exist" != "0" ] && return
|
||||
|
||||
uci -q add firewall zone
|
||||
uci -q set firewall.@zone[-1].name="$name"
|
||||
uci -q add_list firewall.@zone[-1].network="$network"
|
||||
uci -q set firewall.@zone[-1].input='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].output='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].forward='ACCEPT'
|
||||
|
||||
uci -q add firewall forwarding
|
||||
uci -q set firewall.@forwarding[-1].src="$name"
|
||||
uci -q set firewall.@forwarding[-1].dest="wan"
|
||||
|
||||
diff="1"
|
||||
uci -q commit firewall
|
||||
}
|
||||
|
||||
vid=$1 # primary vid
|
||||
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
VID required to configure DHCP.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
ip link show sink${vid} || {
|
||||
ip link add sink${vid} type veth peer name sink${vid}_vlan
|
||||
ip link add link sink${vid} name sink${vid}_peer type vlan id ${vid}
|
||||
}
|
||||
|
||||
ip link set sink${vid} up
|
||||
ip link set sink${vid}_peer up
|
||||
ip link set sink${vid}_vlan up
|
||||
|
||||
diff=""
|
||||
_net_setup sink${vid} sink${vid}_peer ${vid}
|
||||
_dhcp_setup sink${vid}
|
||||
_firewall_setup lan${vid} sink${vid}
|
||||
|
||||
[ "$diff" = "1" ] && {
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.interface.sink${vid}
|
||||
}
|
||||
|
||||
brctl addif br-map sink${vid}_vlan &> /dev/null
|
||||
uci -q commit firewall
|
||||
}
|
||||
|
||||
local type=$1
|
||||
shift
|
||||
vid=$1
|
||||
|
||||
case "$type" in
|
||||
fh) ts_create_fh $@;;
|
||||
bh) ts_create_bh $@;;
|
||||
lei) ts_create_lei $@;;
|
||||
eths) ts_create_eths $@;;
|
||||
dhcp) ts_create_dhcp $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_delete() {
|
||||
iface=$1
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 0
|
||||
|
||||
vlan_dev=${path##*upper_}
|
||||
bridge="$(_get_bridge $vlan_dev)"
|
||||
|
||||
[ -n "$bridge" ] && {
|
||||
vlanctl --if-delete $vlan_dev # note: also removes rules and removes from bridge
|
||||
brctl addif $bridge $iface &> /dev/null # needed to add again
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ts_populate() {
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
[ "$type" == "eth" ] || {
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
Populating ETH rules requires IFACE and VID.
|
||||
VID required to configure.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # secondary vid
|
||||
ip link show sink${vid} 2> /dev/null || {
|
||||
ip link add sink${vid} type veth peer name sink_peer${vid}
|
||||
}
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 1
|
||||
vlan_dev=${path##*upper_}
|
||||
ip link set sink${vid} up
|
||||
ip link set sink_peer${vid} up
|
||||
|
||||
# add rules
|
||||
#vlanctl --if $iface --rx --tags 1 --filter-vid $vid 0 --set-rxif $vlan_dev --rule-append # note: retain secondary vids
|
||||
#vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --rule-append # note: already default
|
||||
}
|
||||
proto="dhcp"
|
||||
[ -x "/usr/sbin/mapcontroller" ] && proto="static" ;
|
||||
_net_setup "vlan${vid}" ${vid} ${proto} "sink${vid}" "sink_peer${vid}"
|
||||
|
||||
ts_primary() {
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
get) vid=$(wl -i $1 map_8021q_settings); echo ${vid##* };;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_unicast() {
|
||||
local mac=$1
|
||||
local iface=$2
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "$mac" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d "$mac" -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d "$mac" -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
ts_multicast() {
|
||||
local iface=$1
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "1:80:C2:00:00:13" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -D BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
[ -x "/usr/sbin/mapcontroller" ] && {
|
||||
_dhcp_setup vlan${vid}
|
||||
_firewall_setup vlan${vid} ${vid}
|
||||
}
|
||||
}
|
||||
|
||||
ts_reload() {
|
||||
local dhcp_reload=$1
|
||||
|
||||
restart=""
|
||||
# workaround for missing backhaul wifi.ap.* ubus obj's:
|
||||
# iterate in config and setup bh
|
||||
config_load wireless
|
||||
# config_load wireless
|
||||
|
||||
_setup_bh_iface() {
|
||||
local sec=$1
|
||||
local iface=$2
|
||||
local bridge=$3
|
||||
# _setup_bh_iface() {
|
||||
# local sec=$1
|
||||
# local iface=$2
|
||||
# local bridge=$3
|
||||
|
||||
config_get ifname $sec ifname
|
||||
# config_get ifname $sec ifname
|
||||
|
||||
config_get mode $sec mode
|
||||
config_get multi_ap $sec multi_ap "0"
|
||||
[ "$mode" = "ap" -a "$multi_ap" = "1" ] && {
|
||||
ts_create bh $ifname 1 2 br-map
|
||||
# config_get mode $sec mode
|
||||
# config_get multi_ap $sec multi_ap "0"
|
||||
# [ "$mode" = "ap" -a "$multi_ap" = "1" ] && {
|
||||
# ts_create bh $ifname 1 2 br-map
|
||||
# }
|
||||
#}
|
||||
|
||||
# config_foreach _setup_bh_iface wifi-iface
|
||||
|
||||
bridge_verify_vid_mapping() {
|
||||
local section=$1
|
||||
|
||||
check__port_vid() {
|
||||
local port="$1"
|
||||
local vlan="$2"
|
||||
|
||||
added=$(bridge vlan show dev $port | grep -w "$vlan")
|
||||
if [ "$added" = "" ]; then
|
||||
restart="1"
|
||||
break
|
||||
fi
|
||||
}
|
||||
|
||||
config_get vlan "$section" vlan "0"
|
||||
|
||||
[ "$vlan" = "0" ] && continue
|
||||
|
||||
config_list_foreach "$section" "ports" check_port_vid "$vlan"
|
||||
[ "$restart" = "1" ] && break
|
||||
}
|
||||
|
||||
config_foreach _setup_bh_iface wifi-iface
|
||||
|
||||
|
||||
config_load network
|
||||
config_foreach bridge_verify_vid_mapping bridge-vlan
|
||||
|
||||
|
||||
[ -n "dhcp_reload" ] && /etc/init.d/dnsmasq reload
|
||||
if [ "$restart" = "1" ]; then
|
||||
dbg "trigger network restart"
|
||||
/etc/init.d/network restart
|
||||
else
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
fi
|
||||
/etc/init.d/firewall reload
|
||||
|
||||
# another workaround for netif? removed
|
||||
# sink devices for br-map bridge
|
||||
for sink in $(ubus list network.interface.sink*) ; do
|
||||
local sink_vlan=${sink/network.interface./}_vlan
|
||||
brctl addif br-map $sink_vlan &> /dev/null
|
||||
done
|
||||
|
||||
#for sink in $(ubus list network.interface.sink*) ; do
|
||||
# local sink_vlan=${sink/network.interface./}_vlan
|
||||
#done
|
||||
}
|
||||
|
||||
local func=$1
|
||||
@@ -499,11 +236,6 @@ EOF
|
||||
|
||||
case "$func" in
|
||||
create) dbg "create $@"; ts_create $@;;
|
||||
delete) dbg "delete $@"; ts_delete $@;;
|
||||
populate) dbg "populate $@"; ts_populate $@;;
|
||||
primary) dbg "primary $@"; ts_primary $@;;
|
||||
unicast) dbg "unicast $@"; ts_unicast $@;;
|
||||
multicast) dbg "multicast $@"; ts_multicast $@;;
|
||||
reload) dbg "reload $@"; ts_reload $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=6.0.11
|
||||
PKG_VERSION:=2.11.0.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=ec686a5e8e667925dc69ac53554709e40c0c81fd
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_SOURCE_VERSION:=f74c6625967c6ab7f413a70fe72a876e5757ac22
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -20,6 +17,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-controller
|
||||
@@ -38,6 +38,7 @@ define Package/map-controller/config
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-Wno-error=deprecated-declarations \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
@@ -1,67 +1,143 @@
|
||||
config controller 'controller'
|
||||
option enabled '1'
|
||||
option registrar '5 2' #bands on which wps registrar supported
|
||||
option debug '6'
|
||||
option registrar '2 5'
|
||||
option debug '0'
|
||||
option enable_sta_steer '0'
|
||||
option enable_bsta_steer '0'
|
||||
option primary_vid '1'
|
||||
option use_bcn_metrics '0'
|
||||
option use_usta_metrics '0'
|
||||
option primary_vid '0'
|
||||
option primary_pcp '0'
|
||||
|
||||
config interface 'lan'
|
||||
option 'dhcp'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net5'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
option allow_bgdfs '0'
|
||||
option channel_plan '0'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net2'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
option ssid 'IOWRT-2.4GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'sae'
|
||||
option key '5555555555'
|
||||
option ssid 'map-bkhaul-5'
|
||||
option type 'backhaul'
|
||||
option disallow_bsta '1' # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
option type 'fronthaul'
|
||||
option vid '1'
|
||||
option network 'lan'
|
||||
option ssid 'IOWRT-5GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'sae'
|
||||
option key '2222222222'
|
||||
option ssid 'map-bkhaul-2'
|
||||
list disallow_bsta '0' # 0 or 1 profile-1 bSTA
|
||||
option vid '1'
|
||||
option type 'backhaul'
|
||||
option network 'lan'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
config policy 'policy'
|
||||
list steer_exclude '00:11:22:33:44:55'
|
||||
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
|
||||
option util_threshold '200' # channel-util as in BSS load
|
||||
option rcpi_threshold '30' # 0 - 220 valid range
|
||||
option report_scan '0' # 0 or 1 for independent scans
|
||||
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
|
||||
option report_sta_assocfails_rate '2' # reporting rate for STA assoc fails (attempts per minute)
|
||||
option report_metric_periodic '0' # 0, or 1 - 255 in secs
|
||||
option report_rcpi_threshold '0' # 0, or 1 - 220
|
||||
option report_util_threshold '0' # 0, or channel-util value
|
||||
option rcpi_hysteresis_margin '0' # 0, or > 0 - hysteresis margin
|
||||
option include_sta_stats '0' # sta stats in AP metric resp
|
||||
option include_sta_metric '0' # sta metric in AP metric resp
|
||||
option disallow_bsta_p1 '0' # 0 or 1 profile-1 bSTA
|
||||
option disallow_bsta_p2 '0' # 0 or 1 profile-2 bSTA
|
||||
config ap
|
||||
option band '5'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-5GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
# node and radio sections (per node) are auto
|
||||
# generated per Multi-AP Agent in the network
|
||||
#
|
||||
#config node 'node_0a1b2c3d4e50'
|
||||
# option agent_id '0a:1b:2c:3d:4e:50'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option backhaul_ul_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_dl_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_type 'none'
|
||||
# option primary_vid '1'
|
||||
# option primary_pcp '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
# option report_metric_periodic '0'
|
||||
# option report_scan '0'
|
||||
# option steer_exclude '0'
|
||||
# option steer_exclude_btm '0'
|
||||
# option steer_disallow '0'
|
||||
# option coordinated_cac '0'
|
||||
# option traffic_separation '0'
|
||||
# option sta_steer '0'
|
||||
|
||||
#config radio 'radio_0a1b2c3d4e53'
|
||||
# option agent_id '0a:1b:2c:3d:4e:50'
|
||||
# option macaddr '0a:1b:2c:3d:4e:53'
|
||||
# option band '2'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '70'
|
||||
# option report_rcpi_threshold '80'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config radio 'radio_0a1b2c3d4e54'
|
||||
# option agent_id '0a:1b:2c:3d:4e:50'
|
||||
# option macaddr '0a:1b:2c:3d:4e:54'
|
||||
# option band '5'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '86'
|
||||
# option report_rcpi_threshold '96'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config node 'node_3fb1c2d3e460'
|
||||
# option agent_id '3f:b1:c2:d3:e4:60'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option backhaul_ul_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_dl_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_type 'none'
|
||||
# option primary_vid '1'
|
||||
# option primary_pcp '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
# option report_metric_periodic '0'
|
||||
# option report_scan '0'
|
||||
# option steer_exclude '0'
|
||||
# option steer_exclude_btm '0'
|
||||
# option steer_disallow '0'
|
||||
# option coordinated_cac '0'
|
||||
# option traffic_separation '0'
|
||||
# option sta_steer '0'
|
||||
|
||||
#config radio 'radio_3fb1c2d3e463'
|
||||
# option agent_id '3f:b1:c2:d3:e4:60'
|
||||
# option macaddr '3f:b1:c2:d3:e4:63'
|
||||
# option band '2'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '70'
|
||||
# option report_rcpi_threshold '80'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config radio 'radio_3fb1c2d3e464'
|
||||
# option agent_id '3f:b1:c2:d3:e4:60'
|
||||
# option macaddr '3f:b1:c2:d3:e4:64'
|
||||
# option band '5'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '86'
|
||||
# option report_rcpi_threshold '96'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
@@ -23,7 +23,10 @@ validate_controller_section() {
|
||||
'enable_sta_steer:bool:false' \
|
||||
'enable_bsta_steer:bool:false' \
|
||||
'use_bcn_metrics:bool:false' \
|
||||
'use_usta_metrics:bool:false'
|
||||
'use_usta_metrics:bool:false' \
|
||||
'allow_bgdfs:range(0,2629744)' \
|
||||
'channel_plan:range(0,2629744)' \
|
||||
'enable_ts:bool:false'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapcontroller" "Validation of controller section failed"
|
||||
@@ -37,7 +40,7 @@ validate_ap_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapcontroller $section "${1}" \
|
||||
'band:or("2", "5")' \
|
||||
'band:or("2", "5", "6")' \
|
||||
'ssid:string' \
|
||||
'encryption:or("sae", "sae+aes", "psk2",
|
||||
"psk2+aes", "sae-mixed", "sae-mixed+aes")' \
|
||||
|
||||
@@ -1,37 +1,41 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys
|
||||
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=3.2.9
|
||||
PKG_VERSION:=2.5.1.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=5d9b0bc94f8d01ecc7a2026ca1d6faf19ca0ede2
|
||||
PKG_SOURCE_VERSION:=58a75b5847ef807063b62cadef7048ecbdb44288
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_BUILD_DEPENDS:=ieee1905
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-topology
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libubox +ubus +libpthread +libuci +libeasy \
|
||||
+libieee1905 +map-plugin +libavahi-nodbus-support
|
||||
+libavahi-nodbus-support +libnetfilter-conntrack +libnfnetlink +libmnl
|
||||
TITLE:=Utility to build topology of a multi-AP network
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-Wno-error=deprecated-declarations \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-I$(STAGING_DIR)/usr/include/libnetfilter_conntrack \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Package/map-topology/description
|
||||
|
||||
45
mosquitto-auth-shadow/Makefile
Normal file
45
mosquitto-auth-shadow/Makefile
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# Copyright (c) 2022 Genexis B.V.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Eclipse Public License 2.0 which is available at
|
||||
# https://www.eclipse.org/legal/epl-2.0/
|
||||
#
|
||||
# SPDX-License-Identifier: EPL-2.0
|
||||
#
|
||||
# Contributors:
|
||||
# Erik Karlsson - initial implementation
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mosquitto-auth-shadow
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
|
||||
PKG_LICENSE:=EPL-2.0
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mosquitto-auth-shadow
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=mosquitto - /etc/shadow authentication plugin
|
||||
DEPENDS:=mosquitto
|
||||
USERID:=mosquitto=200:mosquitto=200 mosquitto=200:shadow=11
|
||||
endef
|
||||
|
||||
define Package/mosquitto-auth-shadow/description
|
||||
Plugin for the mosquitto MQTT message broker that authenticates
|
||||
users using /etc/shadow
|
||||
endef
|
||||
|
||||
define Package/mosquitto-auth-shadow/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto_auth_shadow.so $(1)/usr/lib/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mosquitto-auth-shadow))
|
||||
@@ -0,0 +1 @@
|
||||
chown root:shadow /etc/shadow && chmod 0640 /etc/shadow
|
||||
25
mosquitto-auth-shadow/src/Makefile
Normal file
25
mosquitto-auth-shadow/src/Makefile
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# Copyright (c) 2022 Genexis B.V.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Eclipse Public License 2.0 which is available at
|
||||
# https://www.eclipse.org/legal/epl-2.0/
|
||||
#
|
||||
# SPDX-License-Identifier: EPL-2.0
|
||||
#
|
||||
# Contributors:
|
||||
# Erik Karlsson - initial implementation
|
||||
#
|
||||
|
||||
TARGETS = mosquitto_auth_shadow.so
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
%.pic.o: %.c
|
||||
$(CC) $(CFLAGS) -Wall -Werror -fPIC -c -o $@ $<
|
||||
|
||||
mosquitto_auth_shadow.so: mosquitto_auth_shadow.pic.o
|
||||
$(CC) $(LDFLAGS) -shared -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f *.o $(TARGETS)
|
||||
80
mosquitto-auth-shadow/src/mosquitto_auth_shadow.c
Normal file
80
mosquitto-auth-shadow/src/mosquitto_auth_shadow.c
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Genexis B.V.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Erik Karlsson - initial implementation
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <shadow.h>
|
||||
#include <crypt.h>
|
||||
#include <mosquitto.h>
|
||||
#include <mosquitto_broker.h>
|
||||
#include <mosquitto_plugin.h>
|
||||
|
||||
static int basic_auth_callback(int event, void *event_data, void *userdata)
|
||||
{
|
||||
struct mosquitto_evt_basic_auth *ed = event_data;
|
||||
struct spwd spbuf, *sp = NULL;
|
||||
char buf[256];
|
||||
struct crypt_data data;
|
||||
char *hash;
|
||||
|
||||
/* Let other plugins or broker decide about anonymous login */
|
||||
if (ed->username == NULL)
|
||||
return MOSQ_ERR_PLUGIN_DEFER;
|
||||
|
||||
getspnam_r(ed->username, &spbuf, buf, sizeof(buf), &sp);
|
||||
|
||||
if (sp == NULL || sp->sp_pwdp == NULL)
|
||||
return MOSQ_ERR_AUTH;
|
||||
|
||||
/* Empty string as hash means password is not required */
|
||||
if (sp->sp_pwdp[0] == 0)
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
|
||||
if (ed->password == NULL)
|
||||
return MOSQ_ERR_AUTH;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
hash = crypt_r(ed->password, sp->sp_pwdp, &data);
|
||||
|
||||
if (hash == NULL)
|
||||
return MOSQ_ERR_AUTH;
|
||||
|
||||
if (strcmp(hash, sp->sp_pwdp) == 0)
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
|
||||
return MOSQ_ERR_AUTH;
|
||||
}
|
||||
|
||||
int mosquitto_plugin_version(int supported_version_count,
|
||||
const int *supported_versions)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
int mosquitto_plugin_init(mosquitto_plugin_id_t *identifier,
|
||||
void **user_data,
|
||||
struct mosquitto_opt *opts, int opt_count)
|
||||
{
|
||||
*user_data = identifier;
|
||||
|
||||
return mosquitto_callback_register(identifier, MOSQ_EVT_BASIC_AUTH,
|
||||
basic_auth_callback, NULL, NULL);
|
||||
}
|
||||
|
||||
int mosquitto_plugin_cleanup(void *user_data,
|
||||
struct mosquitto_opt *opts, int opt_count)
|
||||
{
|
||||
mosquitto_plugin_id_t *identifier = user_data;
|
||||
|
||||
return mosquitto_callback_unregister(identifier, MOSQ_EVT_BASIC_AUTH,
|
||||
basic_auth_callback, NULL);
|
||||
}
|
||||
@@ -34,12 +34,13 @@ start_service() {
|
||||
[ -n "$mode" ] || return
|
||||
|
||||
# Get the last saved mode
|
||||
lastmode="$(cat /etc/netmodes/.last_mode 2>/dev/null)"
|
||||
lastmode="$(cat $MODEDIR/.last_mode 2>/dev/null)"
|
||||
# Return if desired mode is same as last saved mode
|
||||
[ "$mode" == "$lastmode" ] && return
|
||||
|
||||
# Save mode as last mode
|
||||
echo "$mode" > /etc/netmodes/.last_mode
|
||||
[ -d $MODEDIR ] || mkdir -p $MODEDIR
|
||||
echo "$mode" > $MODEDIR/.last_mode
|
||||
|
||||
logger -s -p user.info -t "netmode" "Switching to $mode Mode" >/dev/console
|
||||
|
||||
|
||||
@@ -21,5 +21,9 @@ config OBUSPA_MTP_ENABLE_STOMP
|
||||
config OBUSPA_MTP_ENABLE_COAP
|
||||
bool "Enable CoAP as mtp protocol"
|
||||
default n
|
||||
|
||||
config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
bool "Enable verification of MQTT response topic before processing the message"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=5.0.0.3
|
||||
PKG_VERSION:=5.0.0.17
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=9d957848b9ac1d381149ce43b59775c21b1e24e0
|
||||
PKG_SOURCE_VERSION:=cd47bcaf1cc82dfd5c10ea76491fd0dae4436cc6
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
@@ -31,7 +31,7 @@ define Package/obuspa
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
DEPENDS:=+libopenssl +libcurl +libsqlite3 +libubox +libubus +uspd +libmosquitto-ssl +libwebsockets-openssl
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -43,11 +43,14 @@ define Package/obuspa/config
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall \
|
||||
-Werror
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_CONTROLLER_MTP_VERIFY),)
|
||||
TARGET_CFLAGS += -DOBUSPA_CONTROLLER_MTP_VERIFY
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_DB_PATH),)
|
||||
CONFIGURE_ARGS += \
|
||||
--localstatedir="$(CONFIG_OBUSPA_DB_PATH)"
|
||||
@@ -96,11 +99,14 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/USPAgent.json $(1)/etc/bbfdm/json/USPAgent.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/TransferComplete.json $(1)/etc/bbfdm/json/TransferComplete.json
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
1063
obuspa/files/etc/bbfdm/json/USPAgent.json
Normal file
1063
obuspa/files/etc/bbfdm/json/USPAgent.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,28 +1,15 @@
|
||||
config obuspa 'global'
|
||||
option enabled '1'
|
||||
option interface 'loopback'
|
||||
#option ifname 'lo'
|
||||
option debug '1'
|
||||
option log_level '1'
|
||||
option prototrace '0'
|
||||
#option db_file '/etc/obuspa/usp.db'
|
||||
option prototrace '1'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
#option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
#option trust_cert '/etc/obuspa/rootCA.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/var/log/obuspa'
|
||||
|
||||
config localagent 'localagent'
|
||||
option Enable '1'
|
||||
|
||||
# Adds Device.LocalAgent.Controller.
|
||||
config controller 'localcontroller'
|
||||
option EndpointID 'proto::interop-usp-controller'
|
||||
option Protocol 'MQTT'
|
||||
option Topic '/usp/controller'
|
||||
option mqtt 'localmqtt'
|
||||
option assigned_role_name 'full_access'
|
||||
|
||||
# Adds Device.LocalAgent.MTP.
|
||||
config mtp
|
||||
option Protocol 'MQTT'
|
||||
@@ -35,13 +22,21 @@ config mqtt 'localmqtt'
|
||||
option BrokerPort '1883'
|
||||
option TransportProtocol 'TCP/IP'
|
||||
|
||||
# Adds Device.LocalAgent.Controller.
|
||||
config controller 'localcontroller'
|
||||
option EndpointID 'proto::interop-usp-controller'
|
||||
option Protocol 'MQTT'
|
||||
option Topic '/usp/controller'
|
||||
option mqtt 'localmqtt'
|
||||
option assigned_role_name 'full_access'
|
||||
|
||||
# Add Device.LocalAgent.Subscription.
|
||||
config subscription
|
||||
option ID 'default-boot-event-ACS'
|
||||
option NotifType 'Event'
|
||||
option ReferenceList 'Device.Boot!'
|
||||
option Persistent 'true'
|
||||
option controller 'localcontroller'
|
||||
#config subscription
|
||||
# option ID 'default-boot-event-ACS'
|
||||
# option NotifType 'Event'
|
||||
# option ReferenceList 'Device.Boot!'
|
||||
# option Persistent 'true'
|
||||
# option controller 'localcontroller'
|
||||
|
||||
#config challenge 'admin'
|
||||
# option Description 'Request to get Administrative access'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"dmcaching_exclude": [
|
||||
"Device.DeviceInfo.ProcessStatus.Process.",
|
||||
"Device.Hosts.Host."
|
||||
"Device.Hosts.Host.",
|
||||
"Device.WiFi.DataElements."
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7426c7458f792cc66920c206d62869c5620f1400
|
||||
PKG_SOURCE_VERSION:=6c68428405bc88a9990e855f911aecc86f07f4a8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/periodicstats.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -20,13 +20,15 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/periodicstats
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Periodic Statistics Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbf_api
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/periodicstats/description
|
||||
@@ -35,7 +37,7 @@ endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./periodicstats/* $(PKG_BUILD_DIR)/
|
||||
$(CP) -rf ~/git/periodicstats/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
@@ -11,9 +11,12 @@ service_running() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
enable=$(uci -q get periodicstats.globals.enable)
|
||||
local enable
|
||||
|
||||
if [ "$(enable)" != "1" ]; then
|
||||
config_load periodicstats
|
||||
config_get_bool enable globals enable 1
|
||||
|
||||
if [ "${enable}" -ne "1" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
@@ -24,7 +27,7 @@ start_service() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger periodicstats uspd
|
||||
procd_add_reload_trigger periodicstats
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
62
peripheral_manager/files/etc/init.d/ledmngr
Executable file
62
peripheral_manager/files/etc/init.d/ledmngr
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=20
|
||||
USE_PROCD=1
|
||||
|
||||
setled() {
|
||||
local enable
|
||||
local brightness
|
||||
|
||||
config_get_bool enable $1 enable 1
|
||||
config_get brightness $1 brightness 100
|
||||
ubus call led.$1 set "{\"enable\":$enable,\"brightness\":$brightness}"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
|
||||
config_load leds
|
||||
config_foreach setled led
|
||||
config_get_bool enable leds enable 1
|
||||
|
||||
if [ "$enable" == "0" ]; then
|
||||
ubus call leds set '{"state" : "alloff"}'
|
||||
else
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
local led ledname
|
||||
|
||||
ubus list led* >/dev/null || sleep 1
|
||||
ubus list led* >/dev/null || sleep 1
|
||||
|
||||
[ -f /etc/config/leds ] || touch /etc/config/leds
|
||||
|
||||
if ! uci -q get leds.leds >/dev/null; then
|
||||
uci set leds.leds=leds
|
||||
uci set leds.leds.enable=1
|
||||
fi
|
||||
|
||||
for led in $(ubus list led.*); do
|
||||
ledname=${led:4}
|
||||
case $ledname in
|
||||
*phy*) continue ;;
|
||||
esac
|
||||
if ! uci -q get leds.$ledname >/dev/null; then
|
||||
uci set leds.$ledname=led
|
||||
uci set leds.$ledname.enable=1
|
||||
fi
|
||||
done
|
||||
|
||||
uci commit leds
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "leds"
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=ponmngr
|
||||
PROG="/usr/sbin/omcid start"
|
||||
|
||||
include /lib/pon
|
||||
|
||||
|
||||
start_service() {
|
||||
if [ -f "/etc/config/pon" ]; then
|
||||
procd_open_instance $NAME
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
start_gpon
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
start
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
service_stop ${PROG}
|
||||
stop_gpon
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
25
ponmngr/files/etc/init.d/xpon
Executable file
25
ponmngr/files/etc/init.d/xpon
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=19
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/xpon
|
||||
|
||||
start_service() {
|
||||
if [ "$(uci -q get xpon.ani.enable)" == "1" ]; then
|
||||
init_xpon
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
# stopping omcid does not bring down the pon link, which should happen
|
||||
# if ANI is disabled or stopped (go to O1)
|
||||
deinit_xpon
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "xpon"
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
basemac="$(db -q get hw.board.basemac | tr -d ':')"
|
||||
|
||||
if [ -s "/etc/config/pon" ]; then
|
||||
if uci -q get pon.globals >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/pon
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/pon
|
||||
|
||||
mac=''
|
||||
if [ -z "$basemac" ]; then
|
||||
mac="12345678"
|
||||
else
|
||||
# read last 8 characters of basemac without :
|
||||
mac=${basemac: -8}
|
||||
fi
|
||||
|
||||
uci set pon.globals=globals
|
||||
uci set pon.globals.enabled="1"
|
||||
uci set pon.globals.serial_number="BRCM$mac"
|
||||
|
||||
uci commit pon
|
||||
17
ponmngr/files/etc/uci-defaults/60-xpon-generate
Executable file
17
ponmngr/files/etc/uci-defaults/60-xpon-generate
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -s "/etc/config/xpon" ]; then
|
||||
if uci -q get xpon.ani >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/xpon
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/xpon
|
||||
|
||||
|
||||
uci set xpon.ani=ani
|
||||
uci set xpon.ani.enable="1"
|
||||
|
||||
uci commit xpon
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
configure_snpwd() {
|
||||
local serial_no password
|
||||
serial_no="$1"
|
||||
password="$2"
|
||||
|
||||
# serial number comprises of 2 parts, vendor id and vendor specific, the vendor id is
|
||||
# a string while the vendor specific is a hex, so split the 2 and set accordingly
|
||||
local vendor_id vendor_specific
|
||||
vendor_id=${serial_no:0:4}
|
||||
vendor_specific=${serial_no: -8}
|
||||
|
||||
# attempt to conver vendor_id from string to hex
|
||||
vendor_id=$(echo $vendor_id | hexdump -e '4/1 "%02X" "\n"')
|
||||
vendor_id=${vendor_id:0:8}
|
||||
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vendor_specific}
|
||||
if [ -n "$password" ]; then
|
||||
password=$(echo $password | hexdump -n ${#password} -e '16/1 "%02X""\n"')
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure gpon password=$password
|
||||
fi
|
||||
}
|
||||
|
||||
configure_gpon() {
|
||||
local enabled serial_no password
|
||||
config_load pon
|
||||
config_get enabled globals "enabled"
|
||||
|
||||
if [ "$enabled" == "0" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
config_get serial_no globals "serial_number"
|
||||
config_get password globals "password"
|
||||
|
||||
configure_snpwd $serial_no $password
|
||||
}
|
||||
|
||||
start_gpon() {
|
||||
if [ -n "$(which gponctl)" ]; then
|
||||
configure_gpon
|
||||
gponctl start
|
||||
fi
|
||||
}
|
||||
|
||||
stop_gpon() {
|
||||
if [ -n "$(which gponctl)" ]; then
|
||||
gponctl stop
|
||||
fi
|
||||
}
|
||||
|
||||
get_gpon_status() {
|
||||
json_init
|
||||
status="$(gponctl getstate)"
|
||||
admin_status="$(echo $status | head -n1 | awk '{print $8;}')"
|
||||
json_add_string "admin_status" "$admin_status"
|
||||
op_status="$(echo $status | head -n1 | awk '{print $12;}')"
|
||||
case $op_status in
|
||||
NUMBER)
|
||||
op_status="$(echo $status | head -n1 | awk '{print $13;}')"
|
||||
;;
|
||||
esac
|
||||
|
||||
op_status=${op_status:1:2}
|
||||
json_add_string "operational_status" "$op_status"
|
||||
json_dump
|
||||
}
|
||||
20
ponmngr/files/lib/xpon/broadcom.sh
Normal file
20
ponmngr/files/lib/xpon/broadcom.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
init_xpon() {
|
||||
procd_open_instance pon_msgd
|
||||
procd_set_param command bcm_msgd -c gpon
|
||||
procd_close_instance
|
||||
procd_open_instance pon_daemon
|
||||
procd_set_param command omcid start -n
|
||||
procd_close_instance
|
||||
|
||||
}
|
||||
|
||||
deinit_xpon() {
|
||||
gponctl stop
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
include /lib/pon
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "status": {} }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
status)
|
||||
get_gpon_status
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
populate_config_from_db() {
|
||||
. /lib/network/utils.sh
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
|
||||
portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
for port in $portorder; do
|
||||
speed="$(get_max_port_speed $port 2>/dev/null)"
|
||||
speed="${speed:-1000}"
|
||||
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed=1000
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
IP_RULE=""
|
||||
BR_RULE=""
|
||||
BR6_RULE=""
|
||||
|
||||
POLICER_SKIP=0
|
||||
POLICER_COUNT=0
|
||||
INTF_NAME=""
|
||||
Q_COUNT=0
|
||||
@@ -292,6 +292,7 @@ flush_chains() {
|
||||
|
||||
init_broute_rule() {
|
||||
BR_RULE=""
|
||||
BR6_RULE=""
|
||||
}
|
||||
|
||||
broute_filter_on_src_if() {
|
||||
@@ -327,6 +328,82 @@ broute_filter_on_ether_type() {
|
||||
BR_RULE="$BR_RULE --proto $1"
|
||||
}
|
||||
|
||||
broute_filter_on_ether_type6() {
|
||||
BR6_RULE="$BR6_RULE --proto IPv6"
|
||||
}
|
||||
|
||||
ebt_match_src_ip() {
|
||||
BR_RULE="$BR_RULE --ip-src $1"
|
||||
}
|
||||
|
||||
ebt_match_dst_ip() {
|
||||
BR_RULE="$BR_RULE --ip-dst $1"
|
||||
}
|
||||
|
||||
ebt_match_ipv6_src_ip() {
|
||||
BR_RULE="$BR_RULE --ip6-src $1"
|
||||
}
|
||||
|
||||
ebt_match_ipv6_dst_ip() {
|
||||
BR_RULE="$BR_RULE --ip6-dst $1"
|
||||
}
|
||||
|
||||
ebt_match_ip_src_port() {
|
||||
BR_RULE="$BR_RULE --ip-source-port $1"
|
||||
}
|
||||
|
||||
ebt_match_ip_dst_port() {
|
||||
BR_RULE="$BR_RULE --ip-destination-port $1"
|
||||
}
|
||||
|
||||
ebt_match_ipv6_src_port() {
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||
#update BR_RULE only for installation of ipv6 proto rule only.
|
||||
if [ ! -z "$BR6_RULE" ]; then
|
||||
BR6_RULE="$BR6_RULE --ip6-source-port $1"
|
||||
else
|
||||
BR_RULE="$BR_RULE --ip6-source-port $1"
|
||||
fi
|
||||
}
|
||||
|
||||
ebt_match_ipv6_dst_port() {
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||
#update BR_RULE only for installation of ipv6 proto rule only.
|
||||
if [ ! -z "$BR6_RULE" ]; then
|
||||
BR6_RULE="$BR6_RULE --ip6-destination-port $1"
|
||||
else
|
||||
BR_RULE="$BR_RULE --ip6-destination-port $1"
|
||||
fi
|
||||
}
|
||||
|
||||
ebt_match_ip_protocol() {
|
||||
BR_RULE="$BR_RULE --ip-proto $1"
|
||||
}
|
||||
|
||||
ebt_match_ipv6_protocol() {
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||
#update BR_RULE only for installation of ipv6 proto rule only.
|
||||
if [ ! -z "$BR6_RULE" ]; then
|
||||
BR6_RULE="$BR6_RULE --ip6-proto $1"
|
||||
else
|
||||
BR_RULE="$BR_RULE --ip6-proto $1"
|
||||
fi
|
||||
}
|
||||
|
||||
ebt_match_ipv6_dscp() {
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||
#update BR_RULE only for installation of ipv6 proto rule only.
|
||||
if [ ! -z "$BR6_RULE" ]; then
|
||||
BR6_RULE="$BR6_RULE --ip6-tclass $1"
|
||||
else
|
||||
BR_RULE="$BR_RULE --ip6-tclass $1"
|
||||
fi
|
||||
}
|
||||
|
||||
broute_filter_on_dscp() {
|
||||
# The broadcom option --ip-dscp-extend actually accepts tos
|
||||
# and not dscp and that too in hex, hence, perform the conversion
|
||||
@@ -337,6 +414,11 @@ broute_filter_on_dscp() {
|
||||
}
|
||||
|
||||
broute_filter_on_vid() {
|
||||
|
||||
if [ $1 -lt 0 ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
case "$BR_RULE" in
|
||||
*proto*)
|
||||
BR_RULE="$BR_RULE --vlan-id $1"
|
||||
@@ -348,11 +430,145 @@ broute_filter_on_vid() {
|
||||
}
|
||||
|
||||
broute_rule_set_traffic_class() {
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed so update BR6_RULE string as well otherwise
|
||||
#update BR_RULE only for installation of ipv6 proto rule only.
|
||||
BR_RULE="$BR_RULE -j mark --mark-or 0x$1 --mark-target ACCEPT"
|
||||
if [ ! -z "$BR6_RULE" ]; then
|
||||
BR6_RULE="$BR6_RULE -j mark --mark-or 0x$1 --mark-target ACCEPT"
|
||||
fi
|
||||
}
|
||||
|
||||
broute_append_rule() {
|
||||
#when ethertype is not configured by user then both proto rules of ipv4
|
||||
#and ipv6 to be installed otherwise install ipv6 proto rule only.
|
||||
echo "ebtables -t broute -A qos $BR_RULE" >> /tmp/qos/classify.ebtables
|
||||
if [ -n "$BR6_RULE" ]; then
|
||||
echo "ebtables -t broute -A qos $BR6_RULE" >> /tmp/qos/classify.ebtables
|
||||
fi
|
||||
}
|
||||
|
||||
set_ip_addr()
|
||||
{
|
||||
local cid=$1
|
||||
local match_src_ip_func=$2
|
||||
local match_dst_ip_func=$3
|
||||
|
||||
config_get src_ip "$cid" "src_ip"
|
||||
config_get dst_ip "$cid" "dest_ip"
|
||||
|
||||
if [ ! -z "$src_ip" ]; then
|
||||
$match_src_ip_func "$src_ip"
|
||||
fi
|
||||
|
||||
if [ ! -z "$dst_ip" ]; then
|
||||
$match_dst_ip_func "$dst_ip"
|
||||
fi
|
||||
}
|
||||
|
||||
set_ports()
|
||||
{
|
||||
local cid=$1
|
||||
local match_src_port_func=$2
|
||||
local match_dst_port_func=$3
|
||||
local src_port=""
|
||||
local dst_port=""
|
||||
local src_port_range=""
|
||||
local dst_port_range=""
|
||||
|
||||
config_get src_port "$cid" "src_port"
|
||||
config_get dst_port "$cid" "dest_port"
|
||||
config_get src_port_range "$cid" "src_port_range"
|
||||
config_get dst_port_range "$cid" "dest_port_range"
|
||||
|
||||
if ! [ -z $src_port ] && ! [ -z $src_port_range ]; then
|
||||
$match_src_port_func "$src_port:$src_port_range"
|
||||
elif [ ! -z $src_port ]; then
|
||||
$match_src_port_func $src_port
|
||||
fi
|
||||
|
||||
if ! [ -z $dst_port ] && ! [ -z $dst_port_range ]; then
|
||||
$match_dst_port_func "$dst_port:$dst_port_range"
|
||||
elif [ ! -z $dst_port ]; then
|
||||
$match_dst_port_func $dst_port
|
||||
fi
|
||||
}
|
||||
|
||||
protocol_string_to_num()
|
||||
{
|
||||
local value=-1
|
||||
|
||||
case "$1" in
|
||||
*[0-9]*) value="$1"
|
||||
;;
|
||||
TCP|tcp) value=6
|
||||
;;
|
||||
UDP|udp) value=17
|
||||
;;
|
||||
ICMP|icmp) value=1
|
||||
;;
|
||||
ICMPv6|icmpv6) value=58
|
||||
;;
|
||||
IGMP|igmp) value=2
|
||||
;;
|
||||
SCTP|sctp) value=132
|
||||
;;
|
||||
*) value=-1
|
||||
;;
|
||||
esac
|
||||
echo $value
|
||||
}
|
||||
|
||||
broute_ipv4_rule_options()
|
||||
{
|
||||
local cid=$1
|
||||
config_get protocol "$cid" "proto"
|
||||
config_get dscp_filter "$cid" "dscp_filter"
|
||||
|
||||
set_ip_addr $cid ebt_match_src_ip ebt_match_dst_ip
|
||||
|
||||
if [ ! -z $dscp_filter ]; then
|
||||
broute_filter_on_dscp "$dscp_filter"
|
||||
fi
|
||||
|
||||
if [ ! -z $protocol ]; then
|
||||
local proto_num=$(protocol_string_to_num "$protocol")
|
||||
ebt_match_ip_protocol "$proto_num"
|
||||
|
||||
#port installation for protol tcp/udp/sctp
|
||||
if [ $proto_num = "6" ] || [ $proto_num = "17" ] || [ $proto_num = "132" ] ; then
|
||||
set_ports "$cid" ebt_match_ip_src_port ebt_match_ip_dst_port
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
broute_ipv6_rule_options()
|
||||
{
|
||||
local cid=$1
|
||||
|
||||
config_get protocol "$cid" "proto"
|
||||
config_get dscp_filter "$cid" "dscp_filter"
|
||||
|
||||
set_ip_addr $cid ebt_match_ipv6_src_ip ebt_match_ipv6_dst_ip
|
||||
|
||||
if [ ! -z $dscp_filter ]; then
|
||||
local tos_val
|
||||
local tos_hex
|
||||
|
||||
tos_val=$(($dscp_filter<<2))
|
||||
tos_hex=$(printf "%x" $tos_val)
|
||||
ebt_match_ipv6_dscp "$tos_hex"
|
||||
fi
|
||||
|
||||
if [ ! -z $protocol ]; then
|
||||
local proto_num=$(protocol_string_to_num "$protocol")
|
||||
ebt_match_ipv6_protocol "$proto_num"
|
||||
|
||||
#port installation for protol tcp/udp/sctp
|
||||
if [ $proto_num = "6" ] || [ $proto_num = "17" ] || [ $proto_num = "132" ]; then
|
||||
set_ports "$cid" ebt_match_ipv6_src_port ebt_match_ipv6_dst_port
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
handle_ebtables_rules() {
|
||||
@@ -360,6 +576,8 @@ handle_ebtables_rules() {
|
||||
local is_l2_rule=0
|
||||
local src_dhcp_options=""
|
||||
local dst_dhcp_options=""
|
||||
local protocol=""
|
||||
local ip_version=""
|
||||
|
||||
init_broute_rule
|
||||
|
||||
@@ -377,8 +595,9 @@ handle_ebtables_rules() {
|
||||
config_get dst_clid "$sid" "dst_client_id" # dhcp option 61
|
||||
config_get src_ucid "$sid" "src_user_class_id" # dhcp option 77
|
||||
config_get dst_ucid "$sid" "dst_user_class_id" # dhcp option 77
|
||||
|
||||
config_get traffic_class "$sid" "traffic_class"
|
||||
config_get protocol "$sid" "proto"
|
||||
|
||||
|
||||
if [ -n "$src_if" ]; then
|
||||
for interf in $(db -q get hw.board.ethernetPortOrder); do
|
||||
@@ -405,13 +624,6 @@ handle_ebtables_rules() {
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
if [ -n "$dscp_filter" ]; then
|
||||
# filter on ethertype and proto is same thing
|
||||
broute_filter_on_ether_type IPv4
|
||||
broute_filter_on_dscp $dscp_filter
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
if [ -n "$eth_type" ]; then
|
||||
broute_filter_on_ether_type $eth_type
|
||||
is_l2_rule=1
|
||||
@@ -422,6 +634,47 @@ handle_ebtables_rules() {
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
case $eth_type in
|
||||
IPv4|IPV4|0800)
|
||||
ip_version=4
|
||||
;;
|
||||
IPv6|IPV6|86DD)
|
||||
ip_version=6
|
||||
;;
|
||||
*)
|
||||
if [ -z "$eth_type" ]; then
|
||||
case $src_ip$dest_ip in
|
||||
*.*)
|
||||
ip_version=4
|
||||
broute_filter_on_ether_type "IPv4"
|
||||
;;
|
||||
*:*)
|
||||
ip_version=6
|
||||
broute_filter_on_ether_type "IPv6"
|
||||
;;
|
||||
*)
|
||||
if [ -n "$protocol" ] || [ -n "$dscp_filter" ]; then
|
||||
ip_version=1 #neither ether_type nor ip address used
|
||||
#ethertype is not configured by user so install
|
||||
#both proto ipv4 and ipv6 rule
|
||||
BR6_RULE="$BR_RULE"
|
||||
broute_filter_on_ether_type "IPv4"
|
||||
broute_filter_on_ether_type6 "IPv6"
|
||||
fi
|
||||
esac
|
||||
fi
|
||||
esac
|
||||
|
||||
if [ $ip_version = "4" ] || [ $ip_version = "1" ]; then
|
||||
broute_ipv4_rule_options "$sid"
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
if [ $ip_version = "6" ] || [ $ip_version = "1" ]; then
|
||||
broute_ipv6_rule_options "$sid"
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
# first process options that will help figure our source mac address
|
||||
# dhcp option for "vendor class id"
|
||||
if [ -n "$src_vcid" ]; then
|
||||
@@ -752,12 +1005,7 @@ handle_policer_rules() {
|
||||
return
|
||||
fi
|
||||
|
||||
# The policer object is not available on non BCM968* chips
|
||||
if [ $POLICER_SKIP -eq 1 ]; then
|
||||
assign_policer_to_port $ifname $pindex
|
||||
else
|
||||
config_ingress_rate_limit $ifname $ingress_rate $in_burst_size
|
||||
fi
|
||||
config_ingress_rate_limit $ifname $ingress_rate $in_burst_size
|
||||
|
||||
}
|
||||
|
||||
@@ -852,11 +1100,16 @@ pre_configure_queue() {
|
||||
mkdir -p /tmp/qos/queue_stats/$intf
|
||||
touch /tmp/qos/queue_stats/$intf/q_idx
|
||||
echo 0 > /tmp/qos/queue_stats/$intf/q_idx
|
||||
|
||||
# tm initialization pushing ahead of delcfg as
|
||||
# porttminit bydefault configures all queue as SP configuration.
|
||||
# that was causing WRR queue configuration failure.
|
||||
tmctl porttminit --devtype 0 --if $intf --flag 0 --numqueues 8
|
||||
|
||||
i=0
|
||||
for i in 0 1 2 3 4 5 6 7; do
|
||||
tmctl delqcfg --devtype 0 --if $intf --qid $i &>/dev/null
|
||||
done
|
||||
tmctl porttminit --devtype 0 --if $intf --flag 0 --numqueues 8
|
||||
|
||||
mkdir -p /tmp/qos/$intf
|
||||
touch /tmp/qos/$intf/q_order
|
||||
@@ -875,17 +1128,15 @@ configure_queue() {
|
||||
configure_policer() {
|
||||
# The policer object is not available on non BCM968* chips, just clean up
|
||||
# the old config if any and return
|
||||
if [ $POLICER_SKIP -eq 0 ]; then
|
||||
for intf in $(db get hw.board.ethernetPortOrder); do
|
||||
local unitport="$(get_port_number $intf)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
# setting rate and burst size to 0 disables rate limiting
|
||||
if [ $port != "" -a $unit != "" ]; then
|
||||
ethswctl -c rxratectrl -n $unit -p $port -x 0 -y 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
for intf in $(db get hw.board.ethernetPortOrder); do
|
||||
local unitport="$(get_port_number $intf)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
# setting rate and burst size to 0 disables rate limiting
|
||||
if [ $port != "" -a $unit != "" ]; then
|
||||
ethswctl -c rxratectrl -n $unit -p $port -x 0 -y 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Delete policer
|
||||
local i=0
|
||||
@@ -926,10 +1177,6 @@ reload_qos() {
|
||||
local service_name="$1"
|
||||
local cpu_model="$(cat /proc/socinfo | grep 'SoC Name' | cut -d':' -f2)"
|
||||
|
||||
case $cpu_model in
|
||||
BCM68*|BCM6755) POLICER_SKIP=1 ;;
|
||||
esac
|
||||
|
||||
if [ -z "$service_name" ]; then
|
||||
configure_qos
|
||||
elif [ "$service_name" == "shaper" ]; then
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
#
|
||||
# Copyright (C) 2013-2020 iopsys
|
||||
# Copyright (C) 2013-2022 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=5.2.3
|
||||
PKG_VERSION:=5.2.4
|
||||
|
||||
PKG_SOURCE_VERSION:=cf54bd65ec821ac67f3aa1caeebcd3ea9aae07ad
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
|
||||
|
||||
PKG_SOURCE_VERSION:=2ca3ae0c29dcbbf01282f6118eb8d5e5bc9a1c45
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -23,8 +22,6 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
PKG_INSTALL:=
|
||||
|
||||
define Package/questd
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libuci +libubox +ubus +libpthread
|
||||
@@ -36,6 +33,13 @@ define Package/questd/description
|
||||
this information via ubus
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
CMAKE_OPTIONS:=-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/code/questd/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/questd/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
#
|
||||
# Copyright (C) 2018 iopsys
|
||||
# Copyright (C) 2018-2022 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=rulengd
|
||||
PKG_VERSION:=1.2.6
|
||||
PKG_VERSION:=1.2.7
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/rulengd.git
|
||||
PKG_SOURCE_VERSION:=e323bebe85cd7fb4eeb6cee535188227bc9b81e3
|
||||
PKG_SOURCE_VERSION:=1f247e1afc845f47348febffa55fe40d8b552737
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -35,6 +34,14 @@ define Package/rulengd/description
|
||||
rulengd listens for events and executes speficied methods if the incoming event arguments contain speficied ones.
|
||||
endef
|
||||
|
||||
#CMAKE_OPTIONS:=-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/code/rulengd/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/rulengd/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2012-2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=shflags
|
||||
PKG_VERSION:=2012-06-11
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/kward/shflags.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=c12b30cebb92b49c5edb6df255c0952c65b4ddc6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/shflags
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=shflags
|
||||
DEPENDS:=+getopt
|
||||
URL:=http://code.google.com/p/shflags/
|
||||
MAINTAINER:=Luka Perkov <luka@openwrt.org>
|
||||
endef
|
||||
|
||||
define Package/shflags/description
|
||||
command-line flags module for Unix shell scripts
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Build/Install
|
||||
endef
|
||||
|
||||
define Package/shflags/install
|
||||
$(INSTALL_DIR) $(1)/usr/share/shflags
|
||||
$(CP) $(PKG_BUILD_DIR)/source/1.0/src/shflags $(1)/usr/share/shflags/shflags.sh
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,shflags))
|
||||
@@ -1,763 +0,0 @@
|
||||
--- a/source/1.0/src/shflags
|
||||
+++ b/source/1.0/src/shflags
|
||||
@@ -1,91 +1,10 @@
|
||||
-# $Id$
|
||||
-# vim:et:ft=sh:sts=2:sw=2
|
||||
-#
|
||||
-# Copyright 2008 Kate Ward. All Rights Reserved.
|
||||
-# Released under the LGPL (GNU Lesser General Public License)
|
||||
-#
|
||||
-# shFlags -- Advanced command-line flag library for Unix shell scripts.
|
||||
-# http://code.google.com/p/shflags/
|
||||
-#
|
||||
-# Author: kate.ward@forestent.com (Kate Ward)
|
||||
-#
|
||||
-# This module implements something like the google-gflags library available
|
||||
-# from http://code.google.com/p/google-gflags/.
|
||||
-#
|
||||
-# FLAG TYPES: This is a list of the DEFINE_*'s that you can do. All flags take
|
||||
-# a name, default value, help-string, and optional 'short' name (one-letter
|
||||
-# name). Some flags have other arguments, which are described with the flag.
|
||||
-#
|
||||
-# DEFINE_string: takes any input, and intreprets it as a string.
|
||||
-#
|
||||
-# DEFINE_boolean: typically does not take any argument: say --myflag to set
|
||||
-# FLAGS_myflag to true, or --nomyflag to set FLAGS_myflag to false.
|
||||
-# Alternately, you can say
|
||||
-# --myflag=true or --myflag=t or --myflag=0 or
|
||||
-# --myflag=false or --myflag=f or --myflag=1
|
||||
-# Passing an option has the same affect as passing the option once.
|
||||
-#
|
||||
-# DEFINE_float: takes an input and intreprets it as a floating point number. As
|
||||
-# shell does not support floats per-se, the input is merely validated as
|
||||
-# being a valid floating point value.
|
||||
-#
|
||||
-# DEFINE_integer: takes an input and intreprets it as an integer.
|
||||
-#
|
||||
-# SPECIAL FLAGS: There are a few flags that have special meaning:
|
||||
-# --help (or -?) prints a list of all the flags in a human-readable fashion
|
||||
-# --flagfile=foo read flags from foo. (not implemented yet)
|
||||
-# -- as in getopt(), terminates flag-processing
|
||||
-#
|
||||
-# EXAMPLE USAGE:
|
||||
-#
|
||||
-# -- begin hello.sh --
|
||||
-# #! /bin/sh
|
||||
-# . ./shflags
|
||||
-# DEFINE_string name 'world' "somebody's name" n
|
||||
-# FLAGS "$@" || exit $?
|
||||
-# eval set -- "${FLAGS_ARGV}"
|
||||
-# echo "Hello, ${FLAGS_name}."
|
||||
-# -- end hello.sh --
|
||||
-#
|
||||
-# $ ./hello.sh -n Kate
|
||||
-# Hello, Kate.
|
||||
-#
|
||||
-# NOTE: Not all systems include a getopt version that supports long flags. On
|
||||
-# these systems, only short flags are recognized.
|
||||
-
|
||||
-#==============================================================================
|
||||
-# shFlags
|
||||
-#
|
||||
-# Shared attributes:
|
||||
-# flags_error: last error message
|
||||
-# flags_return: last return value
|
||||
-#
|
||||
-# __flags_longNames: list of long names for all flags
|
||||
-# __flags_shortNames: list of short names for all flags
|
||||
-# __flags_boolNames: list of boolean flag names
|
||||
-#
|
||||
-# __flags_opts: options parsed by getopt
|
||||
-#
|
||||
-# Per-flag attributes:
|
||||
-# FLAGS_<flag_name>: contains value of flag named 'flag_name'
|
||||
-# __flags_<flag_name>_default: the default flag value
|
||||
-# __flags_<flag_name>_help: the flag help string
|
||||
-# __flags_<flag_name>_short: the flag short name
|
||||
-# __flags_<flag_name>_type: the flag type
|
||||
-#
|
||||
-# Notes:
|
||||
-# - lists of strings are space separated, and a null value is the '~' char.
|
||||
-
|
||||
-# return if FLAGS already loaded
|
||||
[ -n "${FLAGS_VERSION:-}" ] && return 0
|
||||
FLAGS_VERSION='1.0.3'
|
||||
|
||||
-# return values
|
||||
FLAGS_TRUE=0
|
||||
FLAGS_FALSE=1
|
||||
FLAGS_ERROR=2
|
||||
|
||||
-# reserved flag names
|
||||
FLAGS_RESERVED='ARGC ARGV ERROR FALSE HELP PARENT RESERVED TRUE VERSION'
|
||||
|
||||
_flags_debug() { echo "flags:DEBUG $@" >&2; }
|
||||
@@ -93,7 +12,6 @@ _flags_warn() { echo "flags:WARN $@" >&2
|
||||
_flags_error() { echo "flags:ERROR $@" >&2; }
|
||||
_flags_fatal() { echo "flags:FATAL $@" >&2; }
|
||||
|
||||
-# specific shell checks
|
||||
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||
setopt |grep "^shwordsplit$" >/dev/null
|
||||
if [ $? -ne ${FLAGS_TRUE} ]; then
|
||||
@@ -107,20 +25,15 @@ if [ -n "${ZSH_VERSION:-}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
-#
|
||||
-# constants
|
||||
-#
|
||||
|
||||
-# getopt version
|
||||
__FLAGS_GETOPT_VERS_STD=0
|
||||
__FLAGS_GETOPT_VERS_ENH=1
|
||||
__FLAGS_GETOPT_VERS_BSD=2
|
||||
|
||||
getopt >/dev/null 2>&1
|
||||
case $? in
|
||||
- 0) __FLAGS_GETOPT_VERS=${__FLAGS_GETOPT_VERS_STD} ;; # bsd getopt
|
||||
+ 0) __FLAGS_GETOPT_VERS=${__FLAGS_GETOPT_VERS_STD} ;;
|
||||
2)
|
||||
- # TODO(kward): look into '-T' option to test the internal getopt() version
|
||||
if [ "`getopt --version`" = '-- ' ]; then
|
||||
__FLAGS_GETOPT_VERS=${__FLAGS_GETOPT_VERS_STD}
|
||||
else
|
||||
@@ -133,82 +46,49 @@ case $? in
|
||||
;;
|
||||
esac
|
||||
|
||||
-# getopt optstring lengths
|
||||
__FLAGS_OPTSTR_SHORT=0
|
||||
__FLAGS_OPTSTR_LONG=1
|
||||
|
||||
__FLAGS_NULL='~'
|
||||
|
||||
-# flag info strings
|
||||
__FLAGS_INFO_DEFAULT='default'
|
||||
__FLAGS_INFO_HELP='help'
|
||||
__FLAGS_INFO_SHORT='short'
|
||||
__FLAGS_INFO_TYPE='type'
|
||||
|
||||
-# flag lengths
|
||||
__FLAGS_LEN_SHORT=0
|
||||
__FLAGS_LEN_LONG=1
|
||||
|
||||
-# flag types
|
||||
__FLAGS_TYPE_NONE=0
|
||||
__FLAGS_TYPE_BOOLEAN=1
|
||||
__FLAGS_TYPE_FLOAT=2
|
||||
__FLAGS_TYPE_INTEGER=3
|
||||
__FLAGS_TYPE_STRING=4
|
||||
|
||||
-# set the constants readonly
|
||||
__flags_constants=`set |awk -F= '/^FLAGS_/ || /^__FLAGS_/ {print $1}'`
|
||||
for __flags_const in ${__flags_constants}; do
|
||||
- # skip certain flags
|
||||
case ${__flags_const} in
|
||||
FLAGS_HELP) continue ;;
|
||||
FLAGS_PARENT) continue ;;
|
||||
esac
|
||||
- # set flag readonly
|
||||
if [ -z "${ZSH_VERSION:-}" ]; then
|
||||
readonly ${__flags_const}
|
||||
- else # handle zsh
|
||||
+ else
|
||||
case ${ZSH_VERSION} in
|
||||
[123].*) readonly ${__flags_const} ;;
|
||||
- *) readonly -g ${__flags_const} ;; # declare readonly constants globally
|
||||
+ *) readonly -g ${__flags_const} ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
unset __flags_const __flags_constants
|
||||
|
||||
-#
|
||||
-# internal variables
|
||||
-#
|
||||
-
|
||||
-__flags_boolNames=' ' # space separated list of boolean flag names
|
||||
-__flags_longNames=' ' # space separated list of long flag names
|
||||
-__flags_shortNames=' ' # space separated list of short flag names
|
||||
-
|
||||
-__flags_columns='' # screen width in columns
|
||||
-__flags_opts='' # temporary storage for parsed getopt flags
|
||||
-
|
||||
-#------------------------------------------------------------------------------
|
||||
-# private functions
|
||||
-#
|
||||
-
|
||||
-# Define a flag.
|
||||
-#
|
||||
-# Calling this function will define the following info variables for the
|
||||
-# specified flag:
|
||||
-# FLAGS_flagname - the name for this flag (based upon the long flag name)
|
||||
-# __flags_<flag_name>_default - the default value
|
||||
-# __flags_flagname_help - the help string
|
||||
-# __flags_flagname_short - the single letter alias
|
||||
-# __flags_flagname_type - the type of flag (one of __FLAGS_TYPE_*)
|
||||
-#
|
||||
-# Args:
|
||||
-# _flags__type: integer: internal type of flag (__FLAGS_TYPE_*)
|
||||
-# _flags__name: string: long flag name
|
||||
-# _flags__default: default flag value
|
||||
-# _flags__help: string: help string
|
||||
-# _flags__short: string: (optional) short flag name
|
||||
-# Returns:
|
||||
-# integer: success of operation, or error
|
||||
+
|
||||
+__flags_boolNames=' '
|
||||
+__flags_longNames=' '
|
||||
+__flags_shortNames=' '
|
||||
+__flags_columns=''
|
||||
+__flags_opts=''
|
||||
+
|
||||
_flags_define()
|
||||
{
|
||||
if [ $# -lt 4 ]; then
|
||||
@@ -226,16 +106,13 @@ _flags_define()
|
||||
|
||||
_flags_return_=${FLAGS_TRUE}
|
||||
|
||||
- # TODO(kward): check for validity of the flag name (e.g. dashes)
|
||||
|
||||
- # check whether the flag name is reserved
|
||||
echo " ${FLAGS_RESERVED} " |grep " ${_flags_name_} " >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
flags_error="flag name (${_flags_name_}) is reserved"
|
||||
_flags_return_=${FLAGS_ERROR}
|
||||
fi
|
||||
|
||||
- # require short option for getopt that don't support long options
|
||||
if [ ${_flags_return_} -eq ${FLAGS_TRUE} \
|
||||
-a ${__FLAGS_GETOPT_VERS} -ne ${__FLAGS_GETOPT_VERS_ENH} \
|
||||
-a "${_flags_short_}" = "${__FLAGS_NULL}" ]
|
||||
@@ -244,7 +121,6 @@ _flags_define()
|
||||
_flags_return_=${FLAGS_ERROR}
|
||||
fi
|
||||
|
||||
- # check for existing long name definition
|
||||
if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then
|
||||
if _flags_itemInList "${_flags_name_}" \
|
||||
${__flags_longNames} ${__flags_boolNames}
|
||||
@@ -255,7 +131,6 @@ _flags_define()
|
||||
fi
|
||||
fi
|
||||
|
||||
- # check for existing short name definition
|
||||
if [ ${_flags_return_} -eq ${FLAGS_TRUE} \
|
||||
-a "${_flags_short_}" != "${__FLAGS_NULL}" ]
|
||||
then
|
||||
@@ -266,9 +141,6 @@ _flags_define()
|
||||
fi
|
||||
fi
|
||||
|
||||
- # handle default value. note, on several occasions the 'if' portion of an
|
||||
- # if/then/else contains just a ':' which does nothing. a binary reversal via
|
||||
- # '!' is not done because it does not work on all shells.
|
||||
if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then
|
||||
case ${_flags_type_} in
|
||||
${__FLAGS_TYPE_BOOLEAN})
|
||||
@@ -301,7 +173,7 @@ _flags_define()
|
||||
fi
|
||||
;;
|
||||
|
||||
- ${__FLAGS_TYPE_STRING}) ;; # everything in shell is a valid string
|
||||
+ ${__FLAGS_TYPE_STRING}) ;;
|
||||
|
||||
*)
|
||||
flags_error="unrecognized flag type '${_flags_type_}'"
|
||||
@@ -311,7 +183,6 @@ _flags_define()
|
||||
fi
|
||||
|
||||
if [ ${_flags_return_} -eq ${FLAGS_TRUE} ]; then
|
||||
- # store flag information
|
||||
eval "FLAGS_${_flags_name_}='${_flags_default_}'"
|
||||
eval "__flags_${_flags_name_}_${__FLAGS_INFO_TYPE}=${_flags_type_}"
|
||||
eval "__flags_${_flags_name_}_${__FLAGS_INFO_DEFAULT}=\
|
||||
@@ -319,7 +190,6 @@ _flags_define()
|
||||
eval "__flags_${_flags_name_}_${__FLAGS_INFO_HELP}=\"${_flags_help_}\""
|
||||
eval "__flags_${_flags_name_}_${__FLAGS_INFO_SHORT}='${_flags_short_}'"
|
||||
|
||||
- # append flag name(s) to list of names
|
||||
__flags_longNames="${__flags_longNames}${_flags_name_} "
|
||||
__flags_shortNames="${__flags_shortNames}${_flags_short_} "
|
||||
[ ${_flags_type_} -eq ${__FLAGS_TYPE_BOOLEAN} ] && \
|
||||
@@ -333,17 +203,6 @@ _flags_define()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# Return valid getopt options using currently defined list of long options.
|
||||
-#
|
||||
-# This function builds a proper getopt option string for short (and long)
|
||||
-# options, using the current list of long options for reference.
|
||||
-#
|
||||
-# Args:
|
||||
-# _flags_optStr: integer: option string type (__FLAGS_OPTSTR_*)
|
||||
-# Output:
|
||||
-# string: generated option string for getopt
|
||||
-# Returns:
|
||||
-# boolean: success of operation (always returns True)
|
||||
_flags_genOptStr()
|
||||
{
|
||||
_flags_optStrType_=$1
|
||||
@@ -358,7 +217,6 @@ _flags_genOptStr()
|
||||
${_flags_flag_} ${__FLAGS_INFO_SHORT}`
|
||||
if [ "${_flags_shortName_}" != "${__FLAGS_NULL}" ]; then
|
||||
_flags_opts_="${_flags_opts_}${_flags_shortName_}"
|
||||
- # getopt needs a trailing ':' to indicate a required argument
|
||||
[ ${_flags_type_} -ne ${__FLAGS_TYPE_BOOLEAN} ] && \
|
||||
_flags_opts_="${_flags_opts_}:"
|
||||
fi
|
||||
@@ -366,7 +224,6 @@ _flags_genOptStr()
|
||||
|
||||
${__FLAGS_OPTSTR_LONG})
|
||||
_flags_opts_="${_flags_opts_:+${_flags_opts_},}${_flags_flag_}"
|
||||
- # getopt needs a trailing ':' to indicate a required argument
|
||||
[ ${_flags_type_} -ne ${__FLAGS_TYPE_BOOLEAN} ] && \
|
||||
_flags_opts_="${_flags_opts_}:"
|
||||
;;
|
||||
@@ -379,15 +236,6 @@ _flags_genOptStr()
|
||||
return ${FLAGS_TRUE}
|
||||
}
|
||||
|
||||
-# Returns flag details based on a flag name and flag info.
|
||||
-#
|
||||
-# Args:
|
||||
-# string: long flag name
|
||||
-# string: flag info (see the _flags_define function for valid info types)
|
||||
-# Output:
|
||||
-# string: value of dereferenced flag variable
|
||||
-# Returns:
|
||||
-# integer: one of FLAGS_{TRUE|FALSE|ERROR}
|
||||
_flags_getFlagInfo()
|
||||
{
|
||||
_flags_name_=$1
|
||||
@@ -399,13 +247,6 @@ _flags_getFlagInfo()
|
||||
if [ -n "${_flags_value_}" ]; then
|
||||
flags_return=${FLAGS_TRUE}
|
||||
else
|
||||
- # see if the _flags_name_ variable is a string as strings can be empty...
|
||||
- # note: the DRY principle would say to have this function call itself for
|
||||
- # the next three lines, but doing so results in an infinite loop as an
|
||||
- # invalid _flags_name_ will also not have the associated _type variable.
|
||||
- # Because it doesn't (it will evaluate to an empty string) the logic will
|
||||
- # try to find the _type variable of the _type variable, and so on. Not so
|
||||
- # good ;-)
|
||||
_flags_typeVar_="__flags_${_flags_name_}_${__FLAGS_INFO_TYPE}"
|
||||
_flags_strToEval_="_flags_type_=\"\${${_flags_typeVar_}:-}\""
|
||||
eval "${_flags_strToEval_}"
|
||||
@@ -424,15 +265,6 @@ _flags_getFlagInfo()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# check for presense of item in a list. passed a string (e.g. 'abc'), this
|
||||
-# function will determine if the string is present in the list of strings (e.g.
|
||||
-# ' foo bar abc ').
|
||||
-#
|
||||
-# Args:
|
||||
-# _flags__str: string: string to search for in a list of strings
|
||||
-# unnamed: list: list of strings
|
||||
-# Returns:
|
||||
-# boolean: true if item is in the list
|
||||
_flags_itemInList()
|
||||
{
|
||||
_flags_str_=$1
|
||||
@@ -449,34 +281,22 @@ _flags_itemInList()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# Returns the width of the current screen.
|
||||
-#
|
||||
-# Output:
|
||||
-# integer: width in columns of the current screen.
|
||||
_flags_columns()
|
||||
{
|
||||
if [ -z "${__flags_columns}" ]; then
|
||||
- # determine the value and store it
|
||||
if eval stty size >/dev/null 2>&1; then
|
||||
- # stty size worked :-)
|
||||
set -- `stty size`
|
||||
__flags_columns=$2
|
||||
elif eval tput cols >/dev/null 2>&1; then
|
||||
set -- `tput cols`
|
||||
__flags_columns=$1
|
||||
else
|
||||
- __flags_columns=80 # default terminal width
|
||||
+ __flags_columns=80
|
||||
fi
|
||||
fi
|
||||
echo ${__flags_columns}
|
||||
}
|
||||
|
||||
-# Validate a boolean.
|
||||
-#
|
||||
-# Args:
|
||||
-# _flags__bool: boolean: value to validate
|
||||
-# Returns:
|
||||
-# bool: true if the value is a valid boolean
|
||||
_flags_validateBoolean()
|
||||
{
|
||||
_flags_bool_=$1
|
||||
@@ -492,12 +312,6 @@ _flags_validateBoolean()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# Validate a float.
|
||||
-#
|
||||
-# Args:
|
||||
-# _flags__float: float: value to validate
|
||||
-# Returns:
|
||||
-# bool: true if the value is a valid float
|
||||
_flags_validateFloat()
|
||||
{
|
||||
_flags_float_=$1
|
||||
@@ -507,10 +321,10 @@ _flags_validateFloat()
|
||||
else
|
||||
flags_return=${FLAGS_TRUE}
|
||||
case ${_flags_float_} in
|
||||
- -*) # negative floats
|
||||
+ -*)
|
||||
_flags_test_=`expr "${_flags_float_}" : '\(-[0-9][0-9]*\.[0-9][0-9]*\)'`
|
||||
;;
|
||||
- *) # positive floats
|
||||
+ *)
|
||||
_flags_test_=`expr "${_flags_float_}" : '\([0-9][0-9]*\.[0-9][0-9]*\)'`
|
||||
;;
|
||||
esac
|
||||
@@ -521,22 +335,16 @@ _flags_validateFloat()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# Validate an integer.
|
||||
-#
|
||||
-# Args:
|
||||
-# _flags__integer: interger: value to validate
|
||||
-# Returns:
|
||||
-# bool: true if the value is a valid integer
|
||||
_flags_validateInteger()
|
||||
{
|
||||
_flags_int_=$1
|
||||
|
||||
flags_return=${FLAGS_TRUE}
|
||||
case ${_flags_int_} in
|
||||
- -*) # negative ints
|
||||
+ -*)
|
||||
_flags_test_=`expr "${_flags_int_}" : '\(-[0-9][0-9]*\)'`
|
||||
;;
|
||||
- *) # positive ints
|
||||
+ *)
|
||||
_flags_test_=`expr "${_flags_int_}" : '\([0-9][0-9]*\)'`
|
||||
;;
|
||||
esac
|
||||
@@ -546,23 +354,12 @@ _flags_validateInteger()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# Parse command-line options using the standard getopt.
|
||||
-#
|
||||
-# Note: the flag options are passed around in the global __flags_opts so that
|
||||
-# the formatting is not lost due to shell parsing and such.
|
||||
-#
|
||||
-# Args:
|
||||
-# @: varies: command-line options to parse
|
||||
-# Returns:
|
||||
-# integer: a FLAGS success condition
|
||||
_flags_getoptStandard()
|
||||
{
|
||||
flags_return=${FLAGS_TRUE}
|
||||
_flags_shortOpts_=`_flags_genOptStr ${__FLAGS_OPTSTR_SHORT}`
|
||||
|
||||
- # check for spaces in passed options
|
||||
for _flags_opt_ in "$@"; do
|
||||
- # note: the silliness with the x's is purely for ksh93 on Ubuntu 6.06
|
||||
_flags_match_=`echo "x${_flags_opt_}x" |sed 's/ //g'`
|
||||
if [ "${_flags_match_}" != "x${_flags_opt_}x" ]; then
|
||||
flags_error='the available getopt does not support spaces in options'
|
||||
@@ -585,15 +382,6 @@ _flags_getoptStandard()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# Parse command-line options using the enhanced getopt.
|
||||
-#
|
||||
-# Note: the flag options are passed around in the global __flags_opts so that
|
||||
-# the formatting is not lost due to shell parsing and such.
|
||||
-#
|
||||
-# Args:
|
||||
-# @: varies: command-line options to parse
|
||||
-# Returns:
|
||||
-# integer: a FLAGS success condition
|
||||
_flags_getoptEnhanced()
|
||||
{
|
||||
flags_return=${FLAGS_TRUE}
|
||||
@@ -617,17 +405,6 @@ _flags_getoptEnhanced()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# Dynamically parse a getopt result and set appropriate variables.
|
||||
-#
|
||||
-# This function does the actual conversion of getopt output and runs it through
|
||||
-# the standard case structure for parsing. The case structure is actually quite
|
||||
-# dynamic to support any number of flags.
|
||||
-#
|
||||
-# Args:
|
||||
-# argc: int: original command-line argument count
|
||||
-# @: varies: output from getopt parsing
|
||||
-# Returns:
|
||||
-# integer: a FLAGS success condition
|
||||
_flags_parseGetopt()
|
||||
{
|
||||
_flags_argc_=$1
|
||||
@@ -638,35 +415,26 @@ _flags_parseGetopt()
|
||||
if [ ${__FLAGS_GETOPT_VERS} -ne ${__FLAGS_GETOPT_VERS_ENH} ]; then
|
||||
set -- $@
|
||||
else
|
||||
- # note the quotes around the `$@' -- they are essential!
|
||||
eval set -- "$@"
|
||||
fi
|
||||
|
||||
- # provide user with number of arguments to shift by later
|
||||
- # NOTE: the FLAGS_ARGC variable is obsolete as of 1.0.3 because it does not
|
||||
- # properly give user access to non-flag arguments mixed in between flag
|
||||
- # arguments. Its usage was replaced by FLAGS_ARGV, and it is being kept only
|
||||
- # for backwards compatibility reasons.
|
||||
FLAGS_ARGC=`expr $# - 1 - ${_flags_argc_}`
|
||||
|
||||
- # handle options. note options with values must do an additional shift
|
||||
while true; do
|
||||
_flags_opt_=$1
|
||||
_flags_arg_=${2:-}
|
||||
_flags_type_=${__FLAGS_TYPE_NONE}
|
||||
_flags_name_=''
|
||||
|
||||
- # determine long flag name
|
||||
case "${_flags_opt_}" in
|
||||
- --) shift; break ;; # discontinue option parsing
|
||||
+ --) shift; break ;;
|
||||
|
||||
- --*) # long option
|
||||
+ --*)
|
||||
_flags_opt_=`expr "${_flags_opt_}" : '--\(.*\)'`
|
||||
_flags_len_=${__FLAGS_LEN_LONG}
|
||||
if _flags_itemInList "${_flags_opt_}" ${__flags_longNames}; then
|
||||
_flags_name_=${_flags_opt_}
|
||||
else
|
||||
- # check for negated long boolean version
|
||||
if _flags_itemInList "${_flags_opt_}" ${__flags_boolNames}; then
|
||||
_flags_name_=`expr "${_flags_opt_}" : 'no\(.*\)'`
|
||||
_flags_type_=${__FLAGS_TYPE_BOOLEAN}
|
||||
@@ -675,12 +443,10 @@ _flags_parseGetopt()
|
||||
fi
|
||||
;;
|
||||
|
||||
- -*) # short option
|
||||
+ -*)
|
||||
_flags_opt_=`expr "${_flags_opt_}" : '-\(.*\)'`
|
||||
_flags_len_=${__FLAGS_LEN_SHORT}
|
||||
if _flags_itemInList "${_flags_opt_}" ${__flags_shortNames}; then
|
||||
- # yes. match short name to long name. note purposeful off-by-one
|
||||
- # (too high) with awk calculations.
|
||||
_flags_pos_=`echo "${__flags_shortNames}" \
|
||||
|awk 'BEGIN{RS=" ";rn=0}$0==e{rn=NR}END{print rn}' \
|
||||
e=${_flags_opt_}`
|
||||
@@ -690,14 +456,12 @@ _flags_parseGetopt()
|
||||
;;
|
||||
esac
|
||||
|
||||
- # die if the flag was unrecognized
|
||||
if [ -z "${_flags_name_}" ]; then
|
||||
flags_error="unrecognized option (${_flags_opt_})"
|
||||
flags_return=${FLAGS_ERROR}
|
||||
break
|
||||
fi
|
||||
|
||||
- # set new flag value
|
||||
[ ${_flags_type_} -eq ${__FLAGS_TYPE_NONE} ] && \
|
||||
_flags_type_=`_flags_getFlagInfo \
|
||||
"${_flags_name_}" ${__FLAGS_INFO_TYPE}`
|
||||
@@ -746,7 +510,6 @@ _flags_parseGetopt()
|
||||
;;
|
||||
esac
|
||||
|
||||
- # handle special case help flag
|
||||
if [ "${_flags_name_}" = 'help' ]; then
|
||||
if [ ${FLAGS_help} -eq ${FLAGS_TRUE} ]; then
|
||||
flags_help
|
||||
@@ -756,12 +519,10 @@ _flags_parseGetopt()
|
||||
fi
|
||||
fi
|
||||
|
||||
- # shift the option and non-boolean arguements out.
|
||||
shift
|
||||
[ ${_flags_type_} != ${__FLAGS_TYPE_BOOLEAN} ] && shift
|
||||
done
|
||||
|
||||
- # give user back non-flag arguments
|
||||
FLAGS_ARGV=''
|
||||
while [ $# -gt 0 ]; do
|
||||
FLAGS_ARGV="${FLAGS_ARGV:+${FLAGS_ARGV} }'$1'"
|
||||
@@ -773,43 +534,18 @@ _flags_parseGetopt()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-#------------------------------------------------------------------------------
|
||||
-# public functions
|
||||
-#
|
||||
-
|
||||
-# A basic boolean flag. Boolean flags do not take any arguments, and their
|
||||
-# value is either 1 (false) or 0 (true). For long flags, the false value is
|
||||
-# specified on the command line by prepending the word 'no'. With short flags,
|
||||
-# the presense of the flag toggles the current value between true and false.
|
||||
-# Specifying a short boolean flag twice on the command results in returning the
|
||||
-# value back to the default value.
|
||||
-#
|
||||
-# A default value is required for boolean flags.
|
||||
-#
|
||||
-# For example, lets say a Boolean flag was created whose long name was 'update'
|
||||
-# and whose short name was 'x', and the default value was 'false'. This flag
|
||||
-# could be explicitly set to 'true' with '--update' or by '-x', and it could be
|
||||
-# explicitly set to 'false' with '--noupdate'.
|
||||
+
|
||||
DEFINE_boolean() { _flags_define ${__FLAGS_TYPE_BOOLEAN} "$@"; }
|
||||
|
||||
-# Other basic flags.
|
||||
DEFINE_float() { _flags_define ${__FLAGS_TYPE_FLOAT} "$@"; }
|
||||
DEFINE_integer() { _flags_define ${__FLAGS_TYPE_INTEGER} "$@"; }
|
||||
DEFINE_string() { _flags_define ${__FLAGS_TYPE_STRING} "$@"; }
|
||||
|
||||
-# Parse the flags.
|
||||
-#
|
||||
-# Args:
|
||||
-# unnamed: list: command-line flags to parse
|
||||
-# Returns:
|
||||
-# integer: success of operation, or error
|
||||
FLAGS()
|
||||
{
|
||||
- # define a standard 'help' flag if one isn't already defined
|
||||
[ -z "${__flags_help_type:-}" ] && \
|
||||
DEFINE_boolean 'help' false 'show this help' 'h'
|
||||
|
||||
- # parse options
|
||||
if [ $# -gt 0 ]; then
|
||||
if [ ${__FLAGS_GETOPT_VERS} -ne ${__FLAGS_GETOPT_VERS_ENH} ]; then
|
||||
_flags_getoptStandard "$@"
|
||||
@@ -818,7 +554,6 @@ FLAGS()
|
||||
fi
|
||||
flags_return=$?
|
||||
else
|
||||
- # nothing passed; won't bother running getopt
|
||||
__flags_opts='--'
|
||||
flags_return=${FLAGS_TRUE}
|
||||
fi
|
||||
@@ -832,23 +567,11 @@ FLAGS()
|
||||
return ${flags_return}
|
||||
}
|
||||
|
||||
-# This is a helper function for determining the `getopt` version for platforms
|
||||
-# where the detection isn't working. It simply outputs debug information that
|
||||
-# can be included in a bug report.
|
||||
-#
|
||||
-# Args:
|
||||
-# none
|
||||
-# Output:
|
||||
-# debug info that can be included in a bug report
|
||||
-# Returns:
|
||||
-# nothing
|
||||
flags_getoptInfo()
|
||||
{
|
||||
- # platform info
|
||||
_flags_debug "uname -a: `uname -a`"
|
||||
_flags_debug "PATH: ${PATH}"
|
||||
|
||||
- # shell info
|
||||
if [ -n "${BASH_VERSION:-}" ]; then
|
||||
_flags_debug 'shell: bash'
|
||||
_flags_debug "BASH_VERSION: ${BASH_VERSION}"
|
||||
@@ -857,7 +580,6 @@ flags_getoptInfo()
|
||||
_flags_debug "ZSH_VERSION: ${ZSH_VERSION}"
|
||||
fi
|
||||
|
||||
- # getopt info
|
||||
getopt >/dev/null
|
||||
_flags_getoptReturn=$?
|
||||
_flags_debug "getopt return: ${_flags_getoptReturn}"
|
||||
@@ -866,39 +588,16 @@ flags_getoptInfo()
|
||||
unset _flags_getoptReturn
|
||||
}
|
||||
|
||||
-# Returns whether the detected getopt version is the enhanced version.
|
||||
-#
|
||||
-# Args:
|
||||
-# none
|
||||
-# Output:
|
||||
-# none
|
||||
-# Returns:
|
||||
-# bool: true if getopt is the enhanced version
|
||||
flags_getoptIsEnh()
|
||||
{
|
||||
test ${__FLAGS_GETOPT_VERS} -eq ${__FLAGS_GETOPT_VERS_ENH}
|
||||
}
|
||||
|
||||
-# Returns whether the detected getopt version is the standard version.
|
||||
-#
|
||||
-# Args:
|
||||
-# none
|
||||
-# Returns:
|
||||
-# bool: true if getopt is the standard version
|
||||
flags_getoptIsStd()
|
||||
{
|
||||
test ${__FLAGS_GETOPT_VERS} -eq ${__FLAGS_GETOPT_VERS_STD}
|
||||
}
|
||||
|
||||
-# This is effectively a 'usage()' function. It prints usage information and
|
||||
-# exits the program with ${FLAGS_FALSE} if it is ever found in the command line
|
||||
-# arguments. Note this function can be overridden so other apps can define
|
||||
-# their own --help flag, replacing this one, if they want.
|
||||
-#
|
||||
-# Args:
|
||||
-# none
|
||||
-# Returns:
|
||||
-# integer: success of operation (always returns true)
|
||||
flags_help()
|
||||
{
|
||||
if [ -n "${FLAGS_HELP:-}" ]; then
|
||||
@@ -953,19 +652,14 @@ flags_help()
|
||||
echo "${flags_helpStr_}" >&2
|
||||
else
|
||||
echo " ${flags_flagStr_} ${flags_help_}" >&2
|
||||
- # note: the silliness with the x's is purely for ksh93 on Ubuntu 6.06
|
||||
- # because it doesn't like empty strings when used in this manner.
|
||||
flags_emptyStr_="`echo \"x${flags_flagStr_}x\" \
|
||||
|awk '{printf "%"length($0)-2"s", ""}'`"
|
||||
flags_helpStr_=" ${flags_emptyStr_} ${flags_defaultStr_}"
|
||||
flags_helpStrLen_=`expr "${flags_helpStr_}" : '.*'`
|
||||
if [ ${__FLAGS_GETOPT_VERS} -eq ${__FLAGS_GETOPT_VERS_STD} \
|
||||
-o ${flags_helpStrLen_} -lt ${flags_columns_} ]; then
|
||||
- # indented to match help string
|
||||
echo "${flags_helpStr_}" >&2
|
||||
else
|
||||
- # indented four from left to allow for longer defaults as long flag
|
||||
- # names might be used too, making things too long
|
||||
echo " ${flags_defaultStr_}" >&2
|
||||
fi
|
||||
fi
|
||||
@@ -978,12 +672,6 @@ flags_help()
|
||||
return ${FLAGS_TRUE}
|
||||
}
|
||||
|
||||
-# Reset shflags back to an uninitialized state.
|
||||
-#
|
||||
-# Args:
|
||||
-# none
|
||||
-# Returns:
|
||||
-# nothing
|
||||
flags_reset()
|
||||
{
|
||||
for flags_name_ in ${__flags_longNames}; do
|
||||
@@ -1000,7 +688,6 @@ flags_reset()
|
||||
eval ${flags_strToEval_}
|
||||
done
|
||||
|
||||
- # reset internal variables
|
||||
__flags_boolNames=' '
|
||||
__flags_longNames=' '
|
||||
__flags_shortNames=' '
|
||||
@@ -1,16 +0,0 @@
|
||||
if PACKAGE_stunc
|
||||
|
||||
choice
|
||||
prompt "Select SSL utility"
|
||||
default STUNC_USE_WOLFSSL
|
||||
|
||||
config STUNC_USE_WOLFSSL
|
||||
bool "Use WolfSSL for ssl utilities"
|
||||
select CONFIG_PACKAGE_libwolfssl
|
||||
|
||||
config STUNC_USE_OPENSSL
|
||||
bool "Use OpenSSL for ssl utilities"
|
||||
select CONFIG_PACKAGE_libopenssl
|
||||
|
||||
endchoice
|
||||
endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Copyright (C) 2020-2022 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,49 +8,74 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunc
|
||||
PKG_VERSION:=1.1.2
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fbd3cb0f101d115744ecf927516c2268c10cf3a0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/stunc.git
|
||||
PKG_SOURCE_VERSION:=5b65364709a921db0956bf74a4f126217cfb1775
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
define Package/stunc/default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF STUN Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libwolfssl +libblobmsg-json +libbbf_api +libopenssl
|
||||
MENU := 1
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
BBF STUN Client
|
||||
define Package/stunc-mbedtls
|
||||
$(Package/stunc/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_stunc-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
define Package/stunc-openssl
|
||||
$(Package/stunc/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_stunc-openssl:libopenssl
|
||||
CONFLICTS := stunc-mbedtls
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/stunc-wolfssl
|
||||
$(Package/stunc/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_stunc-wolfssl:libwolfssl
|
||||
CONFLICTS := stunc-mbedtls stunc-openssl
|
||||
VARIANT:=wolfssl
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
ifeq ($(CONFIG_STUNC_USE_WOLFSSL), y)
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/wolfssl
|
||||
TARGET_LDFLAGS += -lwolfssl
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
MAKE_FLAGS += \
|
||||
USE_WOLFSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
MAKE_FLAGS += \
|
||||
USE_MBEDTLS="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
MAKE_FLAGS += \
|
||||
USE_OPENSSL="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
@@ -59,7 +84,7 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
define Package/stunc/default/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
@@ -70,4 +95,10 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DATA) ./files/etc/config/stunc $(1)/etc/config/stunc
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
Package/stunc-openssl/install = $(Package/stunc/default/install)
|
||||
Package/stunc-wolfssl/install = $(Package/stunc/default/install)
|
||||
Package/stunc-mbedtls/install = $(Package/stunc/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,stunc-openssl))
|
||||
$(eval $(call BuildPackage,stunc-wolfssl))
|
||||
$(eval $(call BuildPackage,stunc-mbedtls))
|
||||
|
||||
@@ -8,5 +8,5 @@ config stunc 'stunc'
|
||||
option min_keepalive '30'
|
||||
option max_keepalive '3600'
|
||||
# option client_port 7547
|
||||
option log_level '0'
|
||||
option log_level '1'
|
||||
|
||||
|
||||
@@ -36,11 +36,6 @@ start_service() {
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -z "${server_address}" ]; then
|
||||
log "Stun server address not defined or invalid"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
procd_open_instance stunc
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
|
||||
59
sulu-server/Makefile
Normal file
59
sulu-server/Makefile
Normal file
@@ -0,0 +1,59 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-server
|
||||
PKG_VERSION:=0.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-server.git
|
||||
PKG_SOURCE_VERSION:=a93a29eab7d018ca24cd32fb8b183c5c62c11a78
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=node-yarn/host
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/sulu-server
|
||||
SECTION:=sulu
|
||||
CATEGORY:=Utilities
|
||||
MENU=1
|
||||
TITLE:=Express based SULU-server
|
||||
DEPENDS:=+nginx +node
|
||||
endef
|
||||
|
||||
define Package/sulu-server/description
|
||||
Express based web server for SULU.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
echo "PORT=7071" >>$(PKG_BUILD_DIR)/.env
|
||||
echo "JWT_SECRET=d10365eff77ca1aebd6421b3a8c742c7881959283198ddd764c7c685ba6b70124e09633e05e57640c030c192c5bea4293f5f968538d6c636e4e6b0ff0d0e4ecc" >>$(PKG_BUILD_DIR)/.env
|
||||
echo "RESOURCES_PATH=/sulu-server" >>$(PKG_BUILD_DIR)/.env
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
cd $(PKG_BUILD_DIR) && yarn install && yarn build:dev-clean
|
||||
endef
|
||||
|
||||
define Package/sulu-server/install
|
||||
$(INSTALL_DIR) $(1)/sulu-server
|
||||
$(INSTALL_DIR) $(1)/etc/nginx/conf.d
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/sbin/
|
||||
$(INSTALL_DIR) $(1)/sulu-server/secret
|
||||
$(INSTALL_DIR) $(1)/sulu-server/private
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu-server/
|
||||
$(CP) $(PKG_BUILD_DIR)/.env $(1)/sulu-server/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,sulu-server))
|
||||
|
||||
29
sulu-server/files/etc/init.d/sulu-server
Executable file
29
sulu-server/files/etc/init.d/sulu-server
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t sulu-server.init -p debug
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance sulu-server
|
||||
procd_set_param limits cpu="1"
|
||||
procd_set_param command /sbin/sulu-server
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "obuspa" "mosquitto"
|
||||
}
|
||||
8
sulu-server/files/etc/nginx/conf.d/sulu_server.locations
Normal file
8
sulu-server/files/etc/nginx/conf.d/sulu_server.locations
Normal file
@@ -0,0 +1,8 @@
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $host;
|
||||
proxy_pass http://127.0.0.1:7071;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
16
sulu-server/files/etc/uci-defaults/91-sulu-server-nginx-conf
Normal file
16
sulu-server/files/etc/uci-defaults/91-sulu-server-nginx-conf
Normal file
@@ -0,0 +1,16 @@
|
||||
mkdir -p /tmp/sulu-server
|
||||
|
||||
uci -q get nginx._sulu && exit 0
|
||||
|
||||
uci -q set nginx._sulu_server=server
|
||||
uci -q add_list nginx._sulu_server.listen='7070 ssl'
|
||||
uci -q add_list nginx._sulu_server.listen='[::]:7070 ssl'
|
||||
uci -q set nginx._sulu_server.root='/sulu-server'
|
||||
uci -q set nginx._sulu_server.server_name='_sulu_server'
|
||||
uci -q add_list nginx._sulu_server.include='conf.d/sulu_server.locations'
|
||||
uci -q set nginx._sulu_server.uci_manage_ssl='self-signed'
|
||||
uci -q set nginx._sulu_server.ssl_certificate='/etc/nginx/conf.d/_lan.crt'
|
||||
uci -q set nginx._sulu_server.ssl_certificate_key='/etc/nginx/conf.d/_lan.key'
|
||||
uci -q set nginx._sulu_server.ssl_session_cache='shared:SSL:32k'
|
||||
uci -q set nginx._sulu_server.ssl_session_timeout='64m'
|
||||
|
||||
3
sulu-server/files/sbin/sulu-server
Executable file
3
sulu-server/files/sbin/sulu-server
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /sulu-server/ && node /sulu-server/index.js
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu
|
||||
PKG_VERSION:=0.2.31
|
||||
PKG_VERSION:=1.0.12
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/sulu.git
|
||||
PKG_SOURCE_VERSION:=0c51dc71506d8e67fe8c924e2a8009b969ef8cf9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=fc82a32ab3cdcb18dc3aa7b907c62d8bed29b4ff
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
@@ -1,23 +1,26 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS
|
||||
# Copyright (C) 2022 IOPSYS Software Solutions AB
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.1.2
|
||||
PKG_VERSION:=2.1.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e484557ea7ede6d8ff439081deebd763d4952851
|
||||
PKG_SOURCE_VERSION:=2f953ea76b5779a73a540777dfb450982802e4f8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/swmodd.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -26,7 +29,7 @@ define Package/swmodd
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:= Software Modules Daemon
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +libbbf_api +opkg +libcurl \
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
|
||||
+PACKAGE_liblxc:liblxc +PACKAGE_liblxc:cgroupfs-mount \
|
||||
+@BUSYBOX_CONFIG_BUSYBOX +@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT
|
||||
endef
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=94
|
||||
STOP=10
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/swmodd
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
# Copyright (C) 2020-2022 iopsys Software Solutions AB
|
||||
#
|
||||
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.1.1
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp.git
|
||||
PKG_SOURCE_VERSION:=a0f7355afea41dbafd443d119cb394e038e70dc6
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/twamp-light.git
|
||||
PKG_SOURCE_VERSION:=4dfc8609fb0cefaaf9e86b559b1e10488117cf07
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -30,12 +27,12 @@ define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF TWAMP/TWAMP Light feature
|
||||
DEPENDS:=+libuci +libbbf_api +ubox +libubus
|
||||
TITLE:=TWAMP Light Client(TR-390)
|
||||
DEPENDS:=+libuci +ubox +libubus
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
BBF TWAMP/TWAMP Light feature
|
||||
TWAMP Client for Performance Measurement from IP Edge to Customer Equipment using TWAMP Light Protocol
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
|
||||
config twamp 'twamp'
|
||||
option enable '1'
|
||||
option twamp_light '1'
|
||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
||||
option log_level '3'
|
||||
option enable '0'
|
||||
#Log levels: Critical=0, Error=1, Warning=2, Notice=3, Info=4, Debug=5
|
||||
option log_level '4'
|
||||
|
||||
config twamp_reflector 'reflector_1'
|
||||
option enable '0'
|
||||
option interface 'wan'
|
||||
option port '862'
|
||||
option max_ttl '1'
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ function configure_firewall()
|
||||
{
|
||||
local enable port interface
|
||||
|
||||
config_get enable ${1} enable "0"
|
||||
config_get enable ${1} enable "1"
|
||||
config_get port ${1} port
|
||||
config_get interface ${1} interface
|
||||
if [ "$enable" -eq 0 -o -z "${port}" -o -z "${interface}" ]; then
|
||||
@@ -27,5 +27,21 @@ function configure_firewall()
|
||||
fi
|
||||
}
|
||||
|
||||
function delete_rule()
|
||||
{
|
||||
while iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" > /dev/null; do
|
||||
iptables -w 1 -D zone_${1}_input $(iptables -w 1 -L zone_${1}_input --line-numbers | grep "TWAMP reflector port" | head -1|awk '{print $1}');
|
||||
done
|
||||
}
|
||||
|
||||
# Loop through all interfaces and delete the twamp reflector rule from interface's input chain
|
||||
config_load network
|
||||
config_foreach delete_rule interface
|
||||
|
||||
config_load twamp
|
||||
config_get twamp_enable twamp enable "0"
|
||||
if [ "${twamp_enable}" -eq "0" ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
config_foreach configure_firewall twamp_reflector
|
||||
|
||||
@@ -22,6 +22,9 @@ start_service() {
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
[ -f /etc/firewall.twamp ] && {
|
||||
sh /etc/firewall.twamp
|
||||
}
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -17,7 +17,7 @@ PKG_SOURCE_URL:=https://dev.iopsys.eu/ensemble/u-boot.git
|
||||
PKG_SOURCE_VERSION:=1b320f0656bfc8504fa4f771dd77d8e403ed00e0
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/uboot.git
|
||||
PKG_SOURCE_VERSION:=826af23a7723ee05dc9bc023d12a83f44aa649f4
|
||||
PKG_SOURCE_VERSION:=4cd73fe5db0ebfc1242ca9c85c14d7f0718eaf73
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -7,42 +7,63 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=udpechoserver
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_NAME:=udpecho
|
||||
PKG_VERSION:=2.0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=4e80bbec15b284080798b5ffbe8655febaa239aa
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/udpechoserver.git
|
||||
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/udpecho.git
|
||||
PKG_SOURCE_VERSION:=19a555c2d460db6bdfcfa53742011fbb6a4ca6af
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
define Package/$(PKG_NAME)-server
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF UDP Echo Server
|
||||
DEPENDS:=+libuci +libbbf_api
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
define Package/$(PKG_NAME)-client
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF UDP Echo Client
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-server/description
|
||||
BBF UDP Echo Server
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-client/description
|
||||
BBF UDP Echo Client
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/udpecho/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)-server/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
@@ -53,4 +74,10 @@ define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_BIN) ./files/etc/init.d/udpechoserverd $(1)/etc/init.d/udpechoserverd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
define Package/$(PKG_NAME)-client/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/udpechoclientd $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)-server))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)-client))
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user