mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-24 19:14:05 +08:00
Compare commits
497 Commits
CodecsCap_
...
fe_7749
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c10e6d8076 | ||
|
|
6ea7528f55 | ||
|
|
27adda5eec | ||
|
|
dc8526c40a | ||
|
|
ceb25a46a7 | ||
|
|
d715cfff40 | ||
|
|
e417e5bd3c | ||
|
|
7a5f25c60b | ||
|
|
7f237dd5c1 | ||
|
|
0a104811cc | ||
|
|
8687492bc9 | ||
|
|
b13df199eb | ||
|
|
963fe0b277 | ||
|
|
3f9598b816 | ||
|
|
ab548fca8e | ||
|
|
6f8f7933e8 | ||
|
|
7cb2008549 | ||
|
|
58dc0045de | ||
|
|
8fd3a93874 | ||
|
|
6904c169c5 | ||
|
|
52f6c72128 | ||
|
|
d3474707e7 | ||
|
|
8a2ff8f7cf | ||
|
|
4ec57ab51a | ||
|
|
c0c180ac96 | ||
|
|
40a189ed96 | ||
|
|
953dea8b87 | ||
|
|
b7597b920d | ||
|
|
749678804a | ||
|
|
d6d623e761 | ||
|
|
2264847f69 | ||
|
|
4e773fb976 | ||
|
|
68f5ac2402 | ||
|
|
5cb9293bd9 | ||
|
|
6fb739d980 | ||
|
|
19d34e3417 | ||
|
|
2bf41d47b0 | ||
|
|
fb4abd07eb | ||
|
|
cedcb18ce9 | ||
|
|
41c4512235 | ||
|
|
fc87cf8197 | ||
|
|
9a119ba0dd | ||
|
|
5fe134d348 | ||
|
|
de057f0d58 | ||
|
|
ffc0f1cad1 | ||
|
|
379f1bc95a | ||
|
|
ec7a8d0244 | ||
|
|
ffa7f9bbc6 | ||
|
|
0d3da06f85 | ||
|
|
55cc54e7f7 | ||
|
|
b5f38bf1f5 | ||
|
|
e43631ecaa | ||
|
|
ddf478f77a | ||
|
|
38d9ef7526 | ||
|
|
6b8ee5491a | ||
|
|
38b64c584e | ||
|
|
492cc5c029 | ||
|
|
f030674f68 | ||
|
|
32a13d12f0 | ||
|
|
3dbe7f7f3e | ||
|
|
f1b3ec5a7d | ||
|
|
b839ad3a35 | ||
|
|
50d8f9536c | ||
|
|
1829f69726 | ||
|
|
d228445386 | ||
|
|
80dbe5da48 | ||
|
|
11540c919a | ||
|
|
1278e4d936 | ||
|
|
402ac6f5b2 | ||
|
|
5097780ae3 | ||
|
|
16d0184b73 | ||
|
|
282026b14d | ||
|
|
faf81bbe2b | ||
|
|
cfce60fd58 | ||
|
|
486b6c4b1f | ||
|
|
e180e17bfe | ||
|
|
14b3cf4657 | ||
|
|
77d641c688 | ||
|
|
5cfc71114c | ||
|
|
9fdc3d6126 | ||
|
|
316e6d080a | ||
|
|
652e6335e5 | ||
|
|
82a68b2f27 | ||
|
|
2d638220b2 | ||
|
|
0811488af9 | ||
|
|
18eb5d7f58 | ||
|
|
14d2d0934f | ||
|
|
3fd9ca090d | ||
|
|
8ea89f2b98 | ||
|
|
39f8886e25 | ||
|
|
22d496ac67 | ||
|
|
cc7ad3a31c | ||
|
|
29e9923bf7 | ||
|
|
9fa6c02fa7 | ||
|
|
35396ea204 | ||
|
|
7f108c27ee | ||
|
|
9d3db6e1a0 | ||
|
|
767aff87b8 | ||
|
|
65cf5ba958 | ||
|
|
c8cfbc194d | ||
|
|
364b6223fa | ||
|
|
64fb2de39a | ||
|
|
98ea0bbf05 | ||
|
|
901666827e | ||
|
|
08a9824d5e | ||
|
|
330ce960fc | ||
|
|
ea8a6fd790 | ||
|
|
531b441f80 | ||
|
|
471c8d8e5e | ||
|
|
5981e5b563 | ||
|
|
90ca84517c | ||
|
|
0fe517315e | ||
|
|
21f18cfd34 | ||
|
|
ad39e7603b | ||
|
|
be0595cb13 | ||
|
|
1b9c7328a3 | ||
|
|
3aa9e7fbe2 | ||
|
|
6c1a16b3b4 | ||
|
|
860c9ce9e9 | ||
|
|
c5de1a939f | ||
|
|
7ccd66f2e0 | ||
|
|
886bc94363 | ||
|
|
03bd91650b | ||
|
|
b6d834467d | ||
|
|
a69268966c | ||
|
|
35c02b68d3 | ||
|
|
8605c1e455 | ||
|
|
76457bc80a | ||
|
|
0a17b21d66 | ||
|
|
579e188bc8 | ||
|
|
42c3fd9ce4 | ||
|
|
d3d638dd6f | ||
|
|
3c9aabbc1b | ||
|
|
ccb83f2c91 | ||
|
|
6d9b07317b | ||
|
|
69cca97ff6 | ||
|
|
fdf4abda52 | ||
|
|
cbbdbca752 | ||
|
|
1bb1733238 | ||
|
|
6b44d95bd5 | ||
|
|
8289dce603 | ||
|
|
d0ca976d71 | ||
|
|
2bb5272e3d | ||
|
|
7bc170188b | ||
|
|
6bd264e6d5 | ||
|
|
d0e229743c | ||
|
|
79edd055bf | ||
|
|
2408f215ac | ||
|
|
d66e7fab9b | ||
|
|
b96ebeb84c | ||
|
|
2a7ba5608f | ||
|
|
ec61d302c5 | ||
|
|
186e8a960d | ||
|
|
1692ed2afe | ||
|
|
404ae888a8 | ||
|
|
bbe4473f40 | ||
|
|
51707f0272 | ||
|
|
c598a47281 | ||
|
|
63c5275f42 | ||
|
|
8875203b9b | ||
|
|
1d9e70a1d2 | ||
|
|
c8042b2b6c | ||
|
|
a316b74555 | ||
|
|
91a81169bc | ||
|
|
d12aff727c | ||
|
|
0daddcd84f | ||
|
|
7a684f0a40 | ||
|
|
bc8bc4bd48 | ||
|
|
5316eb2cca | ||
|
|
37621309e8 | ||
|
|
ac7abe0536 | ||
|
|
242fc21967 | ||
|
|
8d4453b107 | ||
|
|
5213d64579 | ||
|
|
3e872da3ce | ||
|
|
c35824f5ec | ||
|
|
bf6e0244f4 | ||
|
|
dc20fe3654 | ||
|
|
c3b0ecb042 | ||
|
|
38c0a6b60f | ||
|
|
fc475de4da | ||
|
|
74f4716ccd | ||
|
|
24f125ff94 | ||
|
|
caccbdfdf0 | ||
|
|
ce124fc5da | ||
|
|
8abc606452 | ||
|
|
6417542d62 | ||
|
|
98ef763849 | ||
|
|
e0f501a75f | ||
|
|
a9850c25cb | ||
|
|
91509243e5 | ||
|
|
3b8c236546 | ||
|
|
c2ccb89855 | ||
|
|
1994c26d23 | ||
|
|
6ece55c134 | ||
|
|
ed58db0758 | ||
|
|
d2f317c20c | ||
|
|
efb4429e76 | ||
|
|
e3836e6dff | ||
|
|
cb9ddf3b59 | ||
|
|
956ae7d35e | ||
|
|
b7767e0333 | ||
|
|
255aab4ef2 | ||
|
|
827d19e557 | ||
|
|
096310eca3 | ||
|
|
4afc0d6b10 | ||
|
|
01b12e0f59 | ||
|
|
f164d0f23f | ||
|
|
bb8e213cdd | ||
|
|
3998edded4 | ||
|
|
478e87d472 | ||
|
|
05829038fa | ||
|
|
5cffc3cae3 | ||
|
|
904f18411d | ||
|
|
f8ba7f0dcf | ||
|
|
5cb8608927 | ||
|
|
9acead4347 | ||
|
|
42bec0b4c8 | ||
|
|
f038e661b6 | ||
|
|
84f93c585d | ||
|
|
f609fe8845 | ||
|
|
f254adbfb2 | ||
|
|
a41fa2790e | ||
|
|
6c16e88598 | ||
|
|
3c581fca1a | ||
|
|
035263a450 | ||
|
|
11287b6faa | ||
|
|
b6371cba1a | ||
|
|
c5097fc375 | ||
|
|
ebaab686ed | ||
|
|
c758ec49fe | ||
|
|
84a52004bb | ||
|
|
85df013680 | ||
|
|
5c491c84dd | ||
|
|
ef34422a54 | ||
|
|
50949e63b0 | ||
|
|
38a07a87a0 | ||
|
|
eb0cf4f1fa | ||
|
|
1a15a4c42d | ||
|
|
cd262d78b6 | ||
|
|
654c047df7 | ||
|
|
28cf302e58 | ||
|
|
972eb125f0 | ||
|
|
d429fd24ee | ||
|
|
6dda009eb5 | ||
|
|
84754a2704 | ||
|
|
4a0a34cc19 | ||
|
|
4c0aac777e | ||
|
|
0c14c69c2c | ||
|
|
f44fdd8db1 | ||
|
|
1d849bd57a | ||
|
|
d906c17eb0 | ||
|
|
dffe253f12 | ||
|
|
b26ddb4edb | ||
|
|
eff6d9b96b | ||
|
|
2e852c5a99 | ||
|
|
3ee627c4ce | ||
|
|
726982c3e6 | ||
|
|
ab6c67f643 | ||
|
|
06f7f65b4d | ||
|
|
77f7315b53 | ||
|
|
47f8651078 | ||
|
|
b903a4f332 | ||
|
|
b627749ae6 | ||
|
|
62120c6769 | ||
|
|
13bf602a93 | ||
|
|
be36ca0ab0 | ||
|
|
3bf9566a62 | ||
|
|
3a6295d370 | ||
|
|
7418afc3e1 | ||
|
|
026814da18 | ||
|
|
a11c28214c | ||
|
|
9af889d28e | ||
|
|
70294978f5 | ||
|
|
be01ee85f6 | ||
|
|
72e5126a0f | ||
|
|
038f5af58f | ||
|
|
9d6d189707 | ||
|
|
3f1aae0d5a | ||
|
|
e15dd68933 | ||
|
|
5cd72947e9 | ||
|
|
24cb62f6e3 | ||
|
|
9910cde335 | ||
|
|
63cfcd9968 | ||
|
|
cf91dc7a2a | ||
|
|
122b14c8b0 | ||
|
|
7eb490ce87 | ||
|
|
38cb923a38 | ||
|
|
5b8dca53e9 | ||
|
|
4799456b48 | ||
|
|
50492f67c3 | ||
|
|
717b83f0e4 | ||
|
|
d7da9d900c | ||
|
|
ebf076b539 | ||
|
|
4a843187c8 | ||
|
|
94aa904234 | ||
|
|
ebc7ab4334 | ||
|
|
f30abfe5bd | ||
|
|
61882e980a | ||
|
|
739faa80fe | ||
|
|
3ccc122539 | ||
|
|
eac510d7ea | ||
|
|
1d34ac77e5 | ||
|
|
e79f917e7e | ||
|
|
bf59291610 | ||
|
|
17b223d35f | ||
|
|
755efd42ae | ||
|
|
46b8d717d5 | ||
|
|
9be656695c | ||
|
|
8c242bbdad | ||
|
|
d36da9d94b | ||
|
|
ec4ac5a195 | ||
|
|
238f8bf928 | ||
|
|
787abf300f | ||
|
|
a96c18eb17 | ||
|
|
f3d05939c8 | ||
|
|
d438d4d269 | ||
|
|
b4985825c6 | ||
|
|
9fa8f7c8a6 | ||
|
|
5195434ee0 | ||
|
|
1c4fee3b2d | ||
|
|
4d609b0d4c | ||
|
|
9f2e663c66 | ||
|
|
02de70ad19 | ||
|
|
15dd3f227c | ||
|
|
2dab01fcf7 | ||
|
|
f1f31b1373 | ||
|
|
c405f8d9aa | ||
|
|
2a3128f08c | ||
|
|
3d4aac4cef | ||
|
|
0f7d11e247 | ||
|
|
10407ee99a | ||
|
|
9ee39a451f | ||
|
|
141fd56567 | ||
|
|
2f91df7419 | ||
|
|
5e4a805880 | ||
|
|
11f5012b63 | ||
|
|
4776861483 | ||
|
|
40f255189f | ||
|
|
b71991ac56 | ||
|
|
5c9d1f09a6 | ||
|
|
c3ba98f2f3 | ||
|
|
307b828994 | ||
|
|
1dbacbb880 | ||
|
|
387be147e6 | ||
|
|
75988519f5 | ||
|
|
f46f994ce2 | ||
|
|
40a43b643c | ||
|
|
80fe362716 | ||
|
|
72b385e50f | ||
|
|
853f895c6d | ||
|
|
03b1576b8d | ||
|
|
6e738b7fcb | ||
|
|
5b3e5d157d | ||
|
|
018a530f35 | ||
|
|
12d3905280 | ||
|
|
47b176a94c | ||
|
|
12ff0f953d | ||
|
|
47a250754f | ||
|
|
5b0e926cd9 | ||
|
|
18453ce68e | ||
|
|
12645e7525 | ||
|
|
73e354c8cc | ||
|
|
abdd812601 | ||
|
|
e56c279786 | ||
|
|
e01fbf3fad | ||
|
|
22b37efad9 | ||
|
|
5628a1bee6 | ||
|
|
6d9c8d1090 | ||
|
|
dee5ea0da3 | ||
|
|
0c6dad2c58 | ||
|
|
f9cd9c627e | ||
|
|
31f03a7b47 | ||
|
|
50d2408ddb | ||
|
|
79f5bbd0cf | ||
|
|
58fdac62b0 | ||
|
|
32192f5423 | ||
|
|
35bb02b726 | ||
|
|
77536709f0 | ||
|
|
e67a5e505f | ||
|
|
cd7826de33 | ||
|
|
c09a4a0ca5 | ||
|
|
49e7f2e349 | ||
|
|
44e614d8e2 | ||
|
|
dba358a542 | ||
|
|
6688812576 | ||
|
|
9b14d0574f | ||
|
|
82bf3bbba4 | ||
|
|
311273865d | ||
|
|
e64714e538 | ||
|
|
f29ade1e60 | ||
|
|
ddf6d7ba32 | ||
|
|
803be5fcad | ||
|
|
08abbdfe5b | ||
|
|
3ad949442c | ||
|
|
6b37f2fccb | ||
|
|
8d3aa2aa60 | ||
|
|
9f5d5eb347 | ||
|
|
2d9a47073b | ||
|
|
dc0ab5dbd3 | ||
|
|
f513b5ba46 | ||
|
|
aa5e98a35c | ||
|
|
051c6f2cc1 | ||
|
|
aa2a78e211 | ||
|
|
063d20932a | ||
|
|
59752df3d4 | ||
|
|
66f28e376d | ||
|
|
fbb6a84da8 | ||
|
|
bcd8b4f010 | ||
|
|
e98ef22bc5 | ||
|
|
c45938f5ad | ||
|
|
05b24396af | ||
|
|
ba0e9e25ba | ||
|
|
a6005cb439 | ||
|
|
3ebb026453 | ||
|
|
921b0fc335 | ||
|
|
10eeef5a32 | ||
|
|
a55c39c32e | ||
|
|
70422f048b | ||
|
|
8670fb8e7d | ||
|
|
54ddfb5b2d | ||
|
|
e8cdea9a79 | ||
|
|
7613b55f49 | ||
|
|
ecc65760b7 | ||
|
|
053c36c1c7 | ||
|
|
7d9325abff | ||
|
|
baee22e19f | ||
|
|
cc765c2704 | ||
|
|
2ae8cd2987 | ||
|
|
1ce681afac | ||
|
|
b66629350d | ||
|
|
3a6dce64de | ||
|
|
fbf4c2d7ed | ||
|
|
57386b0e87 | ||
|
|
37505a1c24 | ||
|
|
4b28a1cd4a | ||
|
|
26fff3a9ac | ||
|
|
fe3592b382 | ||
|
|
78cc239b3d | ||
|
|
714c822e7d | ||
|
|
d5d8cbff6e | ||
|
|
66f5f5315a | ||
|
|
96a8f4f8fa | ||
|
|
80b71b4a9c | ||
|
|
cb86ec3c50 | ||
|
|
6451da621d | ||
|
|
8596640c59 | ||
|
|
e61adabad1 | ||
|
|
2e30eb75b5 | ||
|
|
b00dbbfc16 | ||
|
|
7acb31977c | ||
|
|
8f075c2dde | ||
|
|
15ab530afb | ||
|
|
d7d28d4d53 | ||
|
|
ac05fc5e09 | ||
|
|
affd3a59ee | ||
|
|
702558940f | ||
|
|
96af293828 | ||
|
|
9220eaab7f | ||
|
|
d2e6343808 | ||
|
|
8b71e43391 | ||
|
|
b12b3dcf79 | ||
|
|
2af76e93d6 | ||
|
|
8eff3b57e7 | ||
|
|
24470ed5f8 | ||
|
|
aba55434de | ||
|
|
49a4936cc0 | ||
|
|
1d63ac6583 | ||
|
|
bb9f180b77 | ||
|
|
64c624c281 | ||
|
|
d7946e13f1 | ||
|
|
baa19aad3f | ||
|
|
48c0d51e0e | ||
|
|
f0301c8a45 | ||
|
|
458a57bbb7 | ||
|
|
ebcee30bce | ||
|
|
34f90babf5 | ||
|
|
34dc1fed4b | ||
|
|
7633ca403c | ||
|
|
ec392c923c | ||
|
|
24205bf73f | ||
|
|
76b1e43b6f | ||
|
|
4672afb6de | ||
|
|
d2ff5738cd | ||
|
|
43246014e1 | ||
|
|
115b752ade | ||
|
|
26b06548f6 | ||
|
|
6c99b9fc72 | ||
|
|
135ebebd44 | ||
|
|
2d188b5c37 | ||
|
|
14ce1429a4 | ||
|
|
a6b585cccf | ||
|
|
6db304b6ff | ||
|
|
817a7e8301 | ||
|
|
e8790801d0 | ||
|
|
a6790ac523 | ||
|
|
76656bb043 |
78
ated/Makefile
Normal file
78
ated/Makefile
Normal file
@@ -0,0 +1,78 @@
|
||||
#
|
||||
# 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))
|
||||
14
bbf/Makefile
14
bbf/Makefile
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=6.9.3
|
||||
PKG_VERSION:=6.8.9.38
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_VERSION:=afec1eba79cbe70192a066f4ac007d3a071a14c9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=aa2ce1bf46bb5ff271402fccb9e73e6c63c65695
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -25,8 +25,7 @@ define Package/libbbf_api
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF datamodel library, provides API to extend datamodel using DotSO plugins
|
||||
ABI_VERSION:=1.0
|
||||
TITLE:=Library for libbbfdm API
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/default
|
||||
@@ -34,7 +33,7 @@ define Package/libbbfdm/default
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband forum data model support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libcurl +libbbf_api
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libcurl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
@@ -143,8 +142,10 @@ define Package/libbbfdm/default/install
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
|
||||
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/default/prerm
|
||||
@@ -170,6 +171,7 @@ define Build/InstallDev
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/usr/lib/
|
||||
touch $(1)/usr/lib/libbbf_api.so
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbf_api))
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.0.6
|
||||
PKG_VERSION:=2.0.3.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=b6e731bcaa7b3b41d5565c4d9c54d3ef9e315084
|
||||
PKG_SOURCE_VERSION:=33a6648de9ee0af33c44518656b56b0a30b6c1ab
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -25,6 +25,8 @@ 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)
|
||||
@@ -32,7 +34,7 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json +zlib
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -48,8 +50,8 @@ endif
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.so $(1)/usr/lib/bbfdm
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
@@ -7,12 +7,9 @@ USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
local enable=$(uci -q get bulkdata.bulkdata.enable)
|
||||
|
||||
config_load bulkdata
|
||||
config_get_bool enable bulkdata enable 1
|
||||
|
||||
[ "$enable" -ne "1" ] && {
|
||||
[ "$enable" != "1" ] && {
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -22,6 +19,10 @@ start_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
boot() {
|
||||
start
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.5.5
|
||||
PKG_VERSION:=3.5.14
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=c5695bc92f7f22089c9a85d3e1f4dac7c12ca900
|
||||
PKG_SOURCE_VERSION:=4f16755f8ac09d373234565f050832c049bdf543
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
Binary file not shown.
@@ -19,7 +19,7 @@ define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_econet)
|
||||
DEPENDS:=@TARGET_iopsys_brcm63xx_arm
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.7.3
|
||||
PKG_VERSION:=6.5.60
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4dff7b6b9f742e52ee9e4034f8da74162a02c823
|
||||
PKG_SOURCE_VERSION:=ec2e8d0341e246ff371481ae20418d8301dfcf12
|
||||
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,36 +38,26 @@ 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_WIFI_TYPE=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
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) \
|
||||
@@ -97,7 +87,6 @@ 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 +TARGET_iopsys_econet:ecnt_api
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig
|
||||
endef
|
||||
|
||||
define Package/libethernet/config
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_VERSION:=0.6
|
||||
PKG_VERSION:=0.11
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=0901382048bb7ce01fc1767fef75e54692f56743
|
||||
PKG_SOURCE_VERSION:=2d56ea0d6c45e618c92bc6d63802ffdc5c307740
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -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_504040
|
||||
export CONFIG_BRCM_SDK_VER_504021
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
106
evoice/Makefile
106
evoice/Makefile
@@ -1,106 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2022 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=evoice
|
||||
PKG_VERSION:=0.2.30
|
||||
|
||||
LOCAL_DEV=0
|
||||
LOCAL_DEV_EVOICE_DIR=~/voip/evoice
|
||||
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/evoice.git
|
||||
PKG_SOURCE_VERSION:=ee4e9e00ec1c54b41e15a3de38f6a733634622dd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
# All config variable that are passed to the make invocation, directly or
|
||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
||||
#PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Telephony
|
||||
TITLE:=Ensemble Voice
|
||||
URL:=
|
||||
DEPENDS:= +libubox +libubus +libpicoevent +libuci +libstdcpp +libopenssl +libjson-c +libblobmsg-json\
|
||||
+TARGET_iopsys_brcm63xx_arm:bcmkernel\
|
||||
+TARGET_iopsys_econet:kmod-voip_driver\
|
||||
+TARGET_iopsys_econet:voip_app +libbbf_api
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Ensemble Voice. A stand alone SIP VoIP application.
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
# If you want to build the code from your own local repositiory enable
|
||||
# LOCAL_DEV and set LOCAL_DEV_EVOICE_DIR to your own git repository.
|
||||
define Build/Prepare
|
||||
@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
|
||||
|
||||
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
|
||||
JSONFILE=codecs_brcm.json
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_econet),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TONES_INI_REQUIRED=y
|
||||
TRG=SVrgMtekOwrt
|
||||
JSONFILE=codecs_airoha.json
|
||||
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
|
||||
@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
|
||||
$(CP) $(1)/lib/voice/$(JSONFILE) $(1)/lib/voice/codecs_evoice.json
|
||||
$(RM) $(1)/lib/voice/codecs_brcm.json
|
||||
$(RM) $(1)/lib/voice/codecs_airoha.json
|
||||
$(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))
|
||||
@@ -1,327 +0,0 @@
|
||||
|
||||
config SIPClient 'Client1'
|
||||
option Enable '1'
|
||||
option RegisterMode 'RFC3261'
|
||||
option AuthUserName '51234'
|
||||
option AuthPassword '51234'
|
||||
option Network 'Network1'
|
||||
option MaxSessions '5'
|
||||
option RegisiterURI '51234@sip-proxy.iopsys.eu'
|
||||
option E164Format '1'
|
||||
|
||||
config SIPClient 'Client2'
|
||||
option Enable '1'
|
||||
option RegisterMode 'RFC3261'
|
||||
option AuthUserName '51235'
|
||||
option AuthPassword '51235'
|
||||
option Network 'Network1'
|
||||
option MaxSessions '5'
|
||||
option RegisiterURI '51235@sip-proxy.iopsys.eu'
|
||||
option E164Format '1'
|
||||
|
||||
config SIPNetwork 'Network1'
|
||||
option Enable '1'
|
||||
option ProxyServer 'sip-proxy.iopsys.eu'
|
||||
option ProxyServerPort '5060'
|
||||
option ProxyServerTransport 'UDP'
|
||||
option RegistrarServer 'sip-proxy.iopsys.eu'
|
||||
option RegistrarServerPort '5060'
|
||||
option RegistrarServerTransport 'UDP'
|
||||
option RegistrationPeriod '3240'
|
||||
option RegisterExpires '3600'
|
||||
option UserAgentDomain ' '
|
||||
option TimerRegistrationFailed '120'
|
||||
option TimerT1 '500'
|
||||
option VoIPProfile 'VoIPProfile1'
|
||||
list CodecList '1CodecProfile1'
|
||||
list CodecList '1CodecProfile2'
|
||||
list CodecList '1CodecProfile3'
|
||||
list CodecList '1CodecProfile5'
|
||||
list CodecList '1CodecProfile4'
|
||||
|
||||
config CodecProfile '1CodecProfile1'
|
||||
option Enable '1'
|
||||
option Codec 'G.711ALaw'
|
||||
option PacketizationPeriod '20'
|
||||
option SilenceSupression '1'
|
||||
|
||||
config CodecProfile '1CodecProfile2'
|
||||
option Enable '1'
|
||||
option Codec 'G.711MuLaw'
|
||||
option PacketizationPeriod '20'
|
||||
option SilenceSupression '1'
|
||||
|
||||
config CodecProfile '1CodecProfile3'
|
||||
option Enable '1'
|
||||
option Codec 'G.726'
|
||||
option PacketizationPeriod '20'
|
||||
option SilenceSupression '0'
|
||||
|
||||
config CodecProfile '1CodecProfile4'
|
||||
option Enable '1'
|
||||
option Codec 'G.722'
|
||||
option PacketizationPeriod '20'
|
||||
option SilenceSupression '0'
|
||||
|
||||
config CodecProfile '1CodecProfile5'
|
||||
option Enable '1'
|
||||
option Codec 'G.729'
|
||||
option PacketizationPeriod '20'
|
||||
option SilenceSupression '0'
|
||||
|
||||
config VoIPProfile 'VoIPProfile1'
|
||||
option Enable '1'
|
||||
option DTMFMethod 'RFC4733'
|
||||
option RTP '1RTP'
|
||||
|
||||
config RTP '1RTP'
|
||||
option LocalPortMin '10020'
|
||||
option LocalPortMax '10039'
|
||||
option JitterBufferType 'Static'
|
||||
|
||||
config FXXPorts 'POTS'
|
||||
option Region 'US'
|
||||
|
||||
config FXSPorts 'FXS1'
|
||||
option Enable '1'
|
||||
option DialType 'Tone'
|
||||
option TransmitGain '0'
|
||||
option ReceiveGain '0'
|
||||
option EchoCancellationEnable '1'
|
||||
|
||||
config FXSPorts 'FXS2'
|
||||
option Enable '1'
|
||||
option DialType 'Tone'
|
||||
option TransmitGain '0'
|
||||
option ReceiveGain '0'
|
||||
option EchoCancellationEnable '1'
|
||||
|
||||
config Extension 'Extension1'
|
||||
option Enable '1'
|
||||
option ExtensionNumber '10#'
|
||||
option Provider 'FXS1'
|
||||
option CallingFeatures 'Set1'
|
||||
option Name 'Phone 1'
|
||||
|
||||
config Extension 'Extension2'
|
||||
option Enable '1'
|
||||
option ExtensionNumber '11#'
|
||||
option Provider 'FXS2'
|
||||
option CallingFeatures 'Set1'
|
||||
option Name 'Phone 2'
|
||||
|
||||
config Line 'Line1'
|
||||
option Enable '1'
|
||||
option Provider 'Client1'
|
||||
option CallingFeatures 'Set1'
|
||||
|
||||
config Line 'Line2'
|
||||
option Enable '1'
|
||||
option Provider 'Client2'
|
||||
option CallingFeatures 'Set2'
|
||||
|
||||
config IncomingMap 'IncomingMap1'
|
||||
option Enable '1'
|
||||
option Extension 'Extension1'
|
||||
option Line 'Line1'
|
||||
|
||||
config IncomingMap 'IncomingMap2'
|
||||
option Enable '1'
|
||||
option Extension 'Extension2'
|
||||
option Line 'Line2'
|
||||
|
||||
config IncomingMap 'IncomingMap3'
|
||||
option Enable '0'
|
||||
option Extension 'Extension2'
|
||||
option Line 'Line1'
|
||||
|
||||
config OutgoingMap 'OutgoingMap1'
|
||||
option Enable '1'
|
||||
option Extension 'Extension1'
|
||||
option Line 'Line1'
|
||||
|
||||
config OutgoingMap 'OutgoingMap2'
|
||||
option Enable '1'
|
||||
option Extension 'Extension2'
|
||||
option Line 'Line2'
|
||||
|
||||
config CallingFeatures 'Set1'
|
||||
option CallerIDEnable '1'
|
||||
option CallerIDNameEnable '1'
|
||||
option CallForwardUnconditionalEnable '0'
|
||||
option CallForwardUnconditionalNumber ' '
|
||||
option CallForwardOnBusyEnable '0'
|
||||
option CallForwardOnBusyNumber ' '
|
||||
option CallForwardOnNoAnswerEnable '0'
|
||||
option CallForwardOnNoAnswerRingTimeout '24'
|
||||
option CallForwardOnNoAnswerNumber ' '
|
||||
option CallTransferEnable '1'
|
||||
option MWIEnable '1'
|
||||
option VMWIEnable '1'
|
||||
option LineMessagesWaiting '0'
|
||||
option AnonymousCallRejectionEnable '0'
|
||||
option AnonymousCallEnable '1'
|
||||
option DoNotDisturbEnable '1'
|
||||
option RepeatDialEnable '1'
|
||||
option VoiceMailEnable '1'
|
||||
option CallPickUpEnable '1'
|
||||
option CCBSEnable '1'
|
||||
option CallWaitingEnable '0'
|
||||
|
||||
config CallingFeatures 'Set2'
|
||||
option CallerIDEnable '1'
|
||||
option CallerIDNameEnable '1'
|
||||
option CallForwardUnconditionalEnable '0'
|
||||
option CallForwardUnconditionalNumber ' '
|
||||
option CallForwardOnBusyEnable '0'
|
||||
option CallForwardOnBusyNumber ' '
|
||||
option CallForwardOnNoAnswerEnable '0'
|
||||
option CallForwardOnNoAnswerRingTimeout '24'
|
||||
option CallForwardOnNoAnswerNumber ' '
|
||||
option CallTransferEnable '1'
|
||||
option MWIEnable '1'
|
||||
option VMWIEnable '1'
|
||||
option LineMessagesWaiting '0'
|
||||
option AnonymousCallRejectionEnable '0'
|
||||
option AnonymousCallEnable '1'
|
||||
option DoNotDisturbEnable '1'
|
||||
option RepeatDialEnable '1'
|
||||
option VoiceMailEnable '1'
|
||||
option CallPickUpEnable '1'
|
||||
option CCBSEnable '1'
|
||||
option CallWaitingEnable '1'
|
||||
|
||||
config NumberingPlan 'NumberingPlan1'
|
||||
option MinimumNumberOfDigits '1'
|
||||
option MaximumNumberOfDigits '15'
|
||||
option InterDigitTimerStd '2000'
|
||||
option InterDigitTimerOpen '2000'
|
||||
option TerminationDigit '#'
|
||||
|
||||
config NumberingPlan 'NumberingPlan2'
|
||||
option MinimumNumberOfDigits '5'
|
||||
option MaximumNumberOfDigits '15'
|
||||
option InterDigitTimerStd '2000'
|
||||
option InterDigitTimerOpen '2000'
|
||||
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'
|
||||
|
||||
config PrefixInfo '2PrefixInfo1'
|
||||
option Enable '1'
|
||||
option PrefixRange '*43#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
option PrefixMaxNumberOfDigits '4'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CW_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo2'
|
||||
option Enable '1'
|
||||
option PrefixRange '#43#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
option PrefixMaxNumberOfDigits '4'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CW_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo3'
|
||||
option Enable '1'
|
||||
option PrefixRange '*21*(X+)#'
|
||||
option PrefixMinNumberOfDigits '9'
|
||||
option PrefixMaxNumberOfDigits '9'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFU_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo4'
|
||||
option Enable '1'
|
||||
option PrefixRange '#21#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
option PrefixMaxNumberOfDigits '4'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFU_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo5'
|
||||
option Enable '1'
|
||||
option PrefixRange '*67*(X+)#'
|
||||
option PrefixMinNumberOfDigits '9'
|
||||
option PrefixMaxNumberOfDigits '9'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFB_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo6'
|
||||
option Enable '1'
|
||||
option PrefixRange '#67#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
option PrefixMaxNumberOfDigits '4'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFB_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo7'
|
||||
option Enable '1'
|
||||
option PrefixRange '*61*(X+(*X+)?)#'
|
||||
option PrefixMinNumberOfDigits '15'
|
||||
option PrefixMaxNumberOfDigits '15'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFNR_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo8'
|
||||
option Enable '1'
|
||||
option PrefixRange '#61#'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
option PrefixMaxNumberOfDigits '4'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CFNR_DEACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '2PrefixInfo9'
|
||||
option Enable '1'
|
||||
option PrefixRange '*31*'
|
||||
option PrefixMinNumberOfDigits '4'
|
||||
option PrefixMaxNumberOfDigits '4'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'CA_ACTIVATE'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config PrefixInfo '3PrefixInfo1'
|
||||
option Enable '1'
|
||||
option PrefixRange '110|112'
|
||||
option PrefixMinNumberOfDigits '7'
|
||||
option PrefixMaxNumberOfDigits '7'
|
||||
option NumberOfDigitsToRemove '0'
|
||||
option PosOfDigitsToRemove '0'
|
||||
option FacilityAction 'X_IOPSYS_EU_EMERGENCY'
|
||||
option FacilityActionArgument ' '
|
||||
|
||||
config DialPlan 'X_IOPSYS_EU_InternalNumber1'
|
||||
option RegExp '1X#'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,174 +0,0 @@
|
||||
# RO (Main)
|
||||
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'
|
||||
|
||||
config account 'map_pots'
|
||||
option Country 'voice.POTS.Region'
|
||||
|
||||
# Voice Service navigation paths
|
||||
# Not used to initialize internal configuration
|
||||
config navigation 'map_vs'
|
||||
option Account 'voice.Client@.'
|
||||
option Network 'voice.Client@.Network'
|
||||
option VoIPProfile 'voice.Network@.VoIPProfile'
|
||||
option CfAccount 'voice.Line@.CallingFeatures'
|
||||
option CfPhone 'voice.Extension@.CallingFeatures'
|
||||
option CodecList 'voice.Network@.CodecList'
|
||||
option Codec 'voice.Codec@.Codec'
|
||||
option OutgoingMapEnabled 'voice.OutgoingMap@.Enable'
|
||||
option From_Phone 'voice.OutgoingMap@.Extension'
|
||||
option Extension 'voice.Extension@.Provider'
|
||||
option To_Account 'voice.OutgoingMap@.Line'
|
||||
option Line 'voice.Line@.Provider'
|
||||
option LineEnable 'voice.Line@.Enable'
|
||||
option LineProvider 'voice.Line@.Provider'
|
||||
option IncomingMapEnabled 'voice.IncomingMap@.Enable'
|
||||
option From_Account 'voice.IncomingMap@.Line'
|
||||
option To_Phone 'voice.IncomingMap@.Extension'
|
||||
option ExtensionEnable 'voice.Extension@.Enable'
|
||||
option ExtensionProvider 'voice.Extension@.Provider'
|
||||
|
||||
# Registration for account A-Z is associate with SIP.Clienti.Enable
|
||||
# All parameters in this table are written to internal configuration
|
||||
config account 'map_account'
|
||||
option Registration 'voice.Client@.Enable'
|
||||
option Display_Name ''
|
||||
option PhoneNumber 'voice.Client@.RegisiterURI'
|
||||
option Username 'voice.Client@.AuthUserName'
|
||||
option Password 'voice.Client@.AuthPassword'
|
||||
option SIP_Telephone_Syntax 'voice.Client@.E164Format'
|
||||
option Device_Description 'voice.Client@.UserAgent'
|
||||
|
||||
# Network stuff associated with an account.
|
||||
# All parameters in this table are written to internal configuration
|
||||
config network 'map_net'
|
||||
option Enable 'voice.Network@.Enable'
|
||||
option Registration_Server 'voice.Network@.RegistrarServer'
|
||||
option Outbound_Proxy 'voice.Network@.ProxyServer'
|
||||
option SIP_Port 'voice.Network@.RegistrarServerPort'
|
||||
option SIP_Transport 'voice.Network@.RegistrarServerTransport'
|
||||
option RegistrationPeriod 'voice.Network@.RegistrationPeriod'
|
||||
option Registration_Interval 'voice.Network@.RegisterExpires'
|
||||
option Reg_Failure_Interval 'voice.Network@.TimerRegistrationFailed'
|
||||
option T1 'voice.Network@.TimerT1'
|
||||
option UserAgentDomain 'voice.Network@.UserAgentDomain'
|
||||
|
||||
config VoIPProfile 'map_voip'
|
||||
option Enable 'voice.VoIPProfile@.Enable'
|
||||
option DTMF_Method 'voice.VoIPProfile@.DTMFMethod'
|
||||
option RTP 'voice.VoIPProfile@.RTP'
|
||||
|
||||
config RTP 'map_rtp'
|
||||
option RTP_Port_Base 'voice.@RTP@.LocalPortMin'
|
||||
option RTP_Port_End 'voice.@RTP@.LocalPortMax'
|
||||
|
||||
config codecs 'map_codec'
|
||||
option Codec 'voice.CodecProfile@.Codec'
|
||||
option enable 'voice.CodecProfile@.Enable'
|
||||
option ptime 'voice.CodecProfile@.PacketizationPeriod'
|
||||
option dtx 'voice.CodecProfile@.SilenceSupression'
|
||||
|
||||
config fxsinfo 'map_fxs'
|
||||
option Enable 'voice.FXS@.Enable'
|
||||
option DialType 'voice.FXS@.DialType'
|
||||
option TransmitGain 'voice.FXS@.TransmitGain'
|
||||
option ReceiveGain 'voice.FXS@.ReceiveGain'
|
||||
option EchoCancellationEnable 'voice.FXS@.EchoCancellationEnable'
|
||||
|
||||
config extensioninfo 'map_ext'
|
||||
option Enable 'voice.Extension@.Enable'
|
||||
option Internal_Number_Phone 'voice.Extension@.ExtensionNumber'
|
||||
option Display_Name_Phone 'voice.Extension@.Name'
|
||||
|
||||
config capabilities 'map_capa'
|
||||
option Call_Waiting_Enable 'voice.Capabilities@FacilityActions'
|
||||
option Enable_Call_Diversion 'voice.Capabilities@FacilityActions'
|
||||
|
||||
config cs_account 'map_set'
|
||||
option BusyCallWait 'voice.Set@.CallWaitingEnable'
|
||||
option AlwaysDivert 'voice.Set@.CallForwardUnconditionalEnable'
|
||||
option CFU_Number 'voice.Set@.CallForwardUnconditionalNumber'
|
||||
option BusyDivert 'voice.Set@.CallForwardOnBusyEnable'
|
||||
option CFB_Number 'voice.Set@.CallForwardOnBusyNumber'
|
||||
option NoAnswDivert 'voice.Set@.CallForwardOnNoAnswerEnable'
|
||||
option CFNR_Number 'voice.Set@.CallForwardOnNoAnswerNumber'
|
||||
option CFNR_Timeout 'voice.Set@.CallForwardOnNoAnswerRingTimeout'
|
||||
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'
|
||||
option np_sc_actCW_output 'voice.X_IOPSYS_EU_NpSc@.CW_OUT'
|
||||
option np_sc_deactCW 'voice.X_IOPSYS_EU_NpSc@.CW_DEACT'
|
||||
option np_sc_isactCW 'voice.X_IOPSYS_EU_NpSc@.CW_ISACT'
|
||||
option np_sc_actCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_ACT'
|
||||
option np_sc_actCFU_output 'voice.X_IOPSYS_EU_NpSc@.CFU_OUT'
|
||||
option np_sc_deactCFU 'voice.X_IOPSYS_EU_NpSc@.CFU_DEACT'
|
||||
option np_sc_actCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_ACT'
|
||||
option np_sc_actCFB_output 'voice.X_IOPSYS_EU_NpSc@.CFB_OUT'
|
||||
option np_sc_deactCFB 'voice.X_IOPSYS_EU_NpSc@.CFB_DEACT'
|
||||
option np_sc_actCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_ACT'
|
||||
option np_sc_actCFNR_output 'voice.X_IOPSYS_EU_NpSc@.CFNR_OUT'
|
||||
option np_sc_deactCFNR 'voice.X_IOPSYS_EU_NpSc@.CFNR_DEACT'
|
||||
option np_sc_actRA 'voice.X_IOPSYS_EU_NpSc@.RA_ACT'
|
||||
option np_sc_deactRA 'voice.X_IOPSYS_EU_NpSc@.RA_DEACT'
|
||||
option np_sc_actAC 'voice.X_IOPSYS_EU_NpSc@.AC_ACT'
|
||||
option np_sc_deactAC 'voice.X_IOPSYS_EU_NpSc@.AC_DEACT'
|
||||
option np_sc_actAA 'voice.X_IOPSYS_EU_NpSc@.AA_ACT'
|
||||
option np_sc_deactAA 'voice.X_IOPSYS_EU_NpSc@.AA_DEACT'
|
||||
option np_sc_actAD 'voice.X_IOPSYS_EU_NpSc@.AD_ACT'
|
||||
option np_sc_actAD_output 'voice.X_IOPSYS_EU_NpSc@.AD_OUT'
|
||||
option np_sc_deactAD 'voice.X_IOPSYS_EU_NpSc@.AD_DEACT'
|
||||
option np_sc_actMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_ACT'
|
||||
option np_sc_deactMWSplash 'voice.X_IOPSYS_EU_NpSc@.MWI_SPLASH_DEACT'
|
||||
option np_sc_actMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_ACT'
|
||||
option np_sc_deactMWTone 'voice.X_IOPSYS_EU_NpSc@.MWI_TONE_DEACT'
|
||||
option np_sc_redial 'voice.X_IOPSYS_EU_NpSc@.REDIAL'
|
||||
option np_sc_setMiscConf 'voice.X_IOPSYS_EU_NpSc@.SET_MISC'
|
||||
|
||||
config cc_xvendor 'map_np_in'
|
||||
option np_in_limitExp 'voice.X_IOPSYS_EU_InternalNumber@.RegExp'
|
||||
|
||||
config cc_xvendor 'map_np_sh'
|
||||
option sh_no_str 'voice.X_IOPSYS_EU_ShortNumber@.RegExp'
|
||||
|
||||
config cc_xvendor 'map_np_eme'
|
||||
option np_eme 'voice.X_IOPSYS_EU_EmergencyNumber@.RegExp'
|
||||
option np_eme_out 'voice.X_IOPSYS_EU_EmergencyNumber@.OutStr'
|
||||
|
||||
config cc_xvendor 'map_np_rn'
|
||||
option np_rn 'voice.X_IOPSYS_EU_RegularNumber@.RegExp'
|
||||
option np_rn_out 'voice.X_IOPSYS_EU_RegularNumber@.OutStr'
|
||||
option np_rn_account 'voice.X_IOPSYS_EU_RegularNumber@.AccStr'
|
||||
|
||||
config cc_xvendor 'map_np_bn'
|
||||
option np_bn 'voice.X_IOPSYS_EU_BarredNumber@.RegExp'
|
||||
option np_bn_out 'voice.X_IOPSYS_EU_BarredNumber@.OutStr'
|
||||
|
||||
config TR104NumberingPlan 'map_np_tr'
|
||||
option min_digits 'voice.NumberingPlan@.MinimumNumberOfDigits'
|
||||
option max_digits 'voice.NumberingPlan@.MaximumNumberOfDigits'
|
||||
option tmo_std 'voice.NumberingPlan@.InterDigitTimerStd'
|
||||
option tmo_open 'voice.NumberingPlan@.InterDigitTimerOpen'
|
||||
option term_digit 'voice.NumberingPlan@.TerminationDigit'
|
||||
option prefix_list 'voice.NumberingPlan@.PrefixList'
|
||||
|
||||
config TR104NumberingPlanPrefix 'map_np_pf'
|
||||
option enable 'voice.@PrefixInfo@.Enable'
|
||||
option range 'voice.@PrefixInfo@.PrefixRange'
|
||||
option prefix_min_digits 'voice.@PrefixInfo@.PrefixMinNumberOfDigits'
|
||||
option prefix_max_digits 'voice.@PrefixInfo@.PrefixMaxNumberOfDigits'
|
||||
option remove_digits 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
|
||||
option remove_pos 'voice.@PrefixInfo@.NumberOfDigitsToRemove'
|
||||
option facility_act 'voice.@PrefixInfo@.FacilityAction'
|
||||
option facility_arg 'voice.@PrefixInfo@.FacilityActionArgument'
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
config static_prm 'defaults'
|
||||
option Print_Control '4'
|
||||
option Print_UDP_Addr '192.168.1.3'
|
||||
option Print_UDP_Port '60000'
|
||||
option Verbosity 'On'
|
||||
option Failure_Log 'On'
|
||||
option Message_Log 'On'
|
||||
option Method_Trace 'Off'
|
||||
option Dial_Cache_Size '0'
|
||||
option Reverse_Fax_Detection '0'
|
||||
option DSP_24 '0'
|
||||
option DSP_36 '0'
|
||||
option DSP_43 '0'
|
||||
option Swap_Name_Nr_CID '0'
|
||||
option R_Button_Lower_Lim '100'
|
||||
option R_Button_Upper_Lim '800'
|
||||
option HookOn_Delay '0'
|
||||
option SupportLDD '0'
|
||||
option LDD_Min_Break_Time '41'
|
||||
option LDD_Max_Break_Time '94'
|
||||
option LDD_Percent_Break '55'
|
||||
option Tone_On_Hangup '1'
|
||||
option BusyTone_On_Hangup '1'
|
||||
option Enable_Analouge_Conf '0'
|
||||
option SIP_SessTmrEnable '0'
|
||||
option PrackUsage '1'
|
||||
option SIP_SupportedPath '0'
|
||||
option IMS_Access_Network_Info ' '
|
||||
option SIP_Reason_Protocol '0'
|
||||
option SIP_Body_QOST '0'
|
||||
option SIP_HistoryInfo '0'
|
||||
option Customer_Spec2 '1'
|
||||
option UTF8_Enable '0'
|
||||
option RFC3325 '0'
|
||||
option Accept_From_Registered '0'
|
||||
option Polarity_Reversal '0'
|
||||
option Closed_Dial_Plan '0'
|
||||
option Netw_Dial '0'
|
||||
option No_Answer_Tmo '180'
|
||||
option UPnP_Enabled '0'
|
||||
option NAT_Address ' '
|
||||
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 ' '
|
||||
option Login_Description ' '
|
||||
option Logout_Note ' '
|
||||
option Logout_Description ' '
|
||||
option Resolve_Every_Transaction '2'
|
||||
option Translate_Plus '1'
|
||||
option Mid_Call_Services '0'
|
||||
option Account_Restriction '0'
|
||||
option Answering_Machine_Enable '0'
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"G.711ALaw": [
|
||||
{
|
||||
"BitRate": 64000,
|
||||
"PacketizationPeriod": "20",
|
||||
"SilenceSuppression": false
|
||||
}
|
||||
],
|
||||
"G.711MuLaw": [
|
||||
{
|
||||
"BitRate": 64000,
|
||||
"PacketizationPeriod": "20",
|
||||
"SilenceSuppression": false
|
||||
}
|
||||
],
|
||||
"G.722": [
|
||||
{
|
||||
"BitRate": 64000,
|
||||
"PacketizationPeriod": "20",
|
||||
"SilenceSuppression": false
|
||||
}
|
||||
],
|
||||
"G.726": [
|
||||
{
|
||||
"BitRate": 32000,
|
||||
"PacketizationPeriod": "20",
|
||||
"SilenceSuppression": false
|
||||
},
|
||||
{
|
||||
"BitRate": 24000,
|
||||
"PacketizationPeriod": "20",
|
||||
"SilenceSuppression": false
|
||||
}
|
||||
],
|
||||
"G.729": [
|
||||
{
|
||||
"BitRate": 8000,
|
||||
"PacketizationPeriod": "20",
|
||||
"SilenceSuppression": false
|
||||
}
|
||||
],
|
||||
"AMR": [
|
||||
{
|
||||
"BitRate": 7400,
|
||||
"PacketizationPeriod": "20",
|
||||
"SilenceSuppression": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,140 +0,0 @@
|
||||
{
|
||||
"G.711Mulaw": [
|
||||
{
|
||||
"BitRate": 64000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"G.711alaw": [
|
||||
{
|
||||
"BitRate": 64000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"G.726": [
|
||||
{
|
||||
"BitRate": 16000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 24000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 32000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 40000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"G.723.1": [
|
||||
{
|
||||
"BitRate": 5300,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 6300,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"G.729": [
|
||||
{
|
||||
"BitRate": 8000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"iLBC": [
|
||||
{
|
||||
"BitRate": 15200,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 13300,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"G.722": [
|
||||
{
|
||||
"BitRate": 64000,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"AMR": [
|
||||
{
|
||||
"BitRate": 12200,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 10200,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 7950,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 7400,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 6700,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 5900,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 5150,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
},
|
||||
{
|
||||
"BitRate": 4750,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"GSM-EFR": [
|
||||
{
|
||||
"BitRate": 12200,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"GSM-FR": [
|
||||
{
|
||||
"BitRate": 13200,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
],
|
||||
"GSM-HR": [
|
||||
{
|
||||
"BitRate": 5600,
|
||||
"PacketizationPeriod": "10-30",
|
||||
"SilenceSuppression": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@ PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e3cefda3b26c9aea3021b20725ce7b31b33eebc4
|
||||
PKG_SOURCE_VERSION:=0ebaf1e7d1f09318ae75d0f475a25280742b790e
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
|
||||
@@ -44,25 +44,13 @@ MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
|
||||
# This assumes that the MODULES_SUBDIR set by OpenWrt is of the form
|
||||
# lib/modules/4.19.235-abcdef where 4.19.235 is the version of our fake bcmlinux kernel
|
||||
# and abcdef the git-commit.
|
||||
# The kernel compiled by the Broadcom SDK has a uname -r of 4.19.235, i.e. without the git-commit.
|
||||
# The assignment below removes the part after the - which puts modules in the right directory as
|
||||
# long as the bcmlinux version matches the kernel version in the BCM SDK.
|
||||
# So, this will only stop working in the time window where the BCM SDK has been updated
|
||||
# but bcmlinux has not yet been updated.
|
||||
MODULES_SUBDIR:=$(firstword $(subst -, ,$(MODULES_SUBDIR)))
|
||||
MODULES_SUBDIR:=lib/modules/4.19.183
|
||||
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"
|
||||
|
||||
14
icwmp/Config_cwmp.in
Normal file
14
icwmp/Config_cwmp.in
Normal file
@@ -0,0 +1,14 @@
|
||||
choice
|
||||
prompt "Select ACS sever"
|
||||
default CWMP_ACS_MULTI
|
||||
depends on PACKAGE_icwmp || \
|
||||
PACKAGE_icwmp-openssl || \
|
||||
PACKAGE_icwmp-wolfssl || \
|
||||
PACKAGE_icwmp-mbedtls
|
||||
|
||||
config CWMP_ACS_MULTI
|
||||
bool "No specific ACS, follow standard"
|
||||
|
||||
config CWMP_ACS_HDM
|
||||
bool "Select HDM as ACS server"
|
||||
endchoice
|
||||
@@ -1,28 +1,29 @@
|
||||
#
|
||||
# Copyright (C) 2020-2022 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the BSD-3-Clause
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.0.5
|
||||
PKG_VERSION:=8.4.26.10
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_VERSION:=f590a3f64d9c0b80c3a41336e6fabbbff48868e5
|
||||
PKG_SOURCE_VERSION:=ac7410a726a7269dcaef4c80061cab7a4447f6d1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/icwmp/default
|
||||
SECTION:=utils
|
||||
@@ -32,6 +33,10 @@ define Package/icwmp/default
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -g \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
|
||||
define Package/icwmp-openssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (openssl)
|
||||
@@ -57,15 +62,15 @@ define Package/icwmp-mbedtls
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
CONFIGURE_ARGS += --enable-libopenssl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
|
||||
CONFIGURE_ARGS += --enable-libwolfssl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
CONFIGURE_ARGS += --enable-libmbedtls
|
||||
endif
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
@@ -83,6 +88,7 @@ define Package/icwmp/default/install
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(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
|
||||
@@ -92,6 +98,8 @@ define Package/icwmp/default/install
|
||||
$(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/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
|
||||
endef
|
||||
|
||||
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
|
||||
|
||||
@@ -32,7 +32,7 @@ config cpe 'cpe'
|
||||
option amd_version '5'
|
||||
# compression possible configs: InstanceNumber, InstanceAlias
|
||||
option instance_mode 'InstanceNumber'
|
||||
option session_timeout '300'
|
||||
option session_timeout '60'
|
||||
option notification '1'
|
||||
option exec_download '0'
|
||||
option periodic_notify_enable '1'
|
||||
|
||||
@@ -64,7 +64,7 @@ enable_dhcp_option43() {
|
||||
fi
|
||||
|
||||
newreqopts="$reqopts 43"
|
||||
if [ "${proto}" == "dhcp" ]; then
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
@@ -77,7 +77,7 @@ convert_to_hex() {
|
||||
OPTIND=1
|
||||
while getopts ":" opt "-$optval"
|
||||
do
|
||||
temp=$(printf "%X" "'${OPTARG:-:}")
|
||||
temp=$(printf "%02X" "'${OPTARG:-:}")
|
||||
val="${val}:${temp}"
|
||||
done
|
||||
|
||||
@@ -133,14 +133,14 @@ configure_send_op125() {
|
||||
opt125_len=$((opt125_len + 4))
|
||||
fi
|
||||
|
||||
hex_opt125_len=$(printf "%X" "${opt125_len}")
|
||||
hex_opt125_len=$(printf "%02X" "${opt125_len}")
|
||||
opt125="${opt125}:${hex_opt125_len}"
|
||||
hex_oui=$(convert_to_hex "${oui}")
|
||||
if [ -z "${hex_oui}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_oui_len=$(printf "%X" "${oui_len}")
|
||||
hex_oui_len=$(printf "%02X" "${oui_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:01:${hex_oui_len}${hex_oui}"
|
||||
else
|
||||
@@ -152,7 +152,7 @@ configure_send_op125() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_serial_len=$(printf "%X" "${serial_len}")
|
||||
hex_serial_len=$(printf "%02X" "${serial_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:02:${hex_serial_len}${hex_serial}"
|
||||
else
|
||||
@@ -165,7 +165,7 @@ configure_send_op125() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_class_len=$(printf "%X" "${class_len}")
|
||||
hex_class_len=$(printf "%02X" "${class_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:03:${hex_class_len}${hex_class}"
|
||||
else
|
||||
@@ -205,10 +205,8 @@ enable_dnsmasq_option125() {
|
||||
fi
|
||||
}
|
||||
|
||||
enable_disable_dhcp_option125() {
|
||||
enable_dhcp_option125() {
|
||||
local wan="${1}"
|
||||
local action="${2}"
|
||||
|
||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||
local sendopts="$(uci -q get network.$wan.sendopts)"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
@@ -233,35 +231,16 @@ enable_disable_dhcp_option125() {
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" == "dhcp" ]; then
|
||||
if [ "${action}" == "enable" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${wan}".reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
configure_send_op125 "${sendopts}" "${wan}" "network"
|
||||
network_uci_update=1
|
||||
fi
|
||||
else
|
||||
if [ ${req125_present} -eq 1 ]; then
|
||||
newreqopts=$(echo ${reqopts/125/})
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send125_present} -eq 1 ]; then
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
newsendopts=$(echo ${sendopts/"${sopt}"/})
|
||||
uci -q set network.$wan.sendopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
configure_send_op125 "${sendopts}" "${wan}" "network"
|
||||
network_uci_update=1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -288,12 +267,6 @@ wait_for_resolvfile() {
|
||||
copy_cwmp_etc_files_to_varstate() {
|
||||
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
|
||||
|
||||
if [ -f /etc/icwmpd/icwmpd_backup_session.xml ]; then
|
||||
cp -f /etc/icwmpd/icwmpd_backup_session.xml /var/run/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
@@ -301,6 +274,7 @@ copy_cwmp_etc_files_to_varstate() {
|
||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]; then
|
||||
cp -f /etc/icwmpd/dm_enabled_notify /var/run/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
touch /var/run/icwmpd/cwmp
|
||||
}
|
||||
|
||||
copy_cwmp_varstate_files_to_etc() {
|
||||
@@ -312,10 +286,6 @@ copy_cwmp_varstate_files_to_etc() {
|
||||
cp -f /var/run/icwmpd/dm_enabled_notify /etc/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
|
||||
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/
|
||||
@@ -391,26 +361,51 @@ validate_defaults() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
set_vendor_id() {
|
||||
local wan="${1}"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
|
||||
if [ "${proto}" == "dhcp" ]; then
|
||||
vendorid="$(uci -q get network.$wan.vendorid)"
|
||||
if [ -z "${vendorid}" ]; then
|
||||
uci -q set network.$wan.vendorid="dslforum.org"
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
elif [[ $vendorid != *"dslforum.org"* ]]; then
|
||||
uci -q set network.$wan.vendorid="${vendorid},dslforum.org"
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
local enable_cwmp="0"
|
||||
|
||||
local dhcp_discovery="0"
|
||||
|
||||
config_load cwmp
|
||||
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
|
||||
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
if [ "${dhcp_discovery}" == "enable" ] || [ "${dhcp_discovery}" == "1" ]; then
|
||||
# Set dhcp option 43 if not already configured
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
# Set dhcp option 60
|
||||
set_vendor_id "${wan_interface}"
|
||||
fi
|
||||
|
||||
config_get lan_interface cpe default_lan_interface ""
|
||||
if [ -n "${lan_interface}" ]; then
|
||||
# Set dhcp_option 125 if not already configured
|
||||
enable_disable_dhcp_option125 "${wan_interface}" "enable"
|
||||
enable_dhcp_option125 "${wan_interface}"
|
||||
enable_dnsmasq_option125 "${lan_interface}"
|
||||
else
|
||||
# Remove dhcp option 125 if exists
|
||||
enable_disable_dhcp_option125 "${wan_interface}" "disable"
|
||||
fi
|
||||
|
||||
config_get ssl_capath acs ssl_capath
|
||||
@@ -419,6 +414,10 @@ boot() {
|
||||
regenerate_ssl_link "${ssl_capath}"
|
||||
fi
|
||||
|
||||
# Copy backup data so that if it restart latter on it gets the info
|
||||
copy_cwmp_etc_files_to_varstate
|
||||
touch /etc/icwmpd/cwmp_notifications
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
@@ -441,9 +440,6 @@ start_service() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Copy backup data so that if it restart latter on it gets the info
|
||||
copy_cwmp_etc_files_to_varstate
|
||||
|
||||
procd_open_instance icwmp
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
@@ -455,7 +451,7 @@ start_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_stopped()
|
||||
stop_service()
|
||||
{
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
/var/run/icwmpd/icwmpd_backup_session.xml
|
||||
/etc/icwmpd/cwmp
|
||||
/etc/icwmpd/cwmp_notifications
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
# Copyright (C) 2021-2022 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=4.10.7
|
||||
PKG_VERSION:=4.10.41
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b50f79061a95840d89a6129aa0a95aff82b5a1b7
|
||||
PKG_SOURCE_VERSION:=5c36293244d40c6a71f451db4acd8fa5656cdfbb
|
||||
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,7 +70,6 @@ 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
|
||||
|
||||
@@ -2,7 +2,7 @@ config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
option registrar '2 5 6'
|
||||
option registrar '2 5'
|
||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config al-iface
|
||||
@@ -24,9 +24,3 @@ config ap
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
option ssid 'IOWRT-6GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
|
||||
@@ -42,9 +42,10 @@ validate_ap_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section ieee1905 $section "${1}" \
|
||||
'band:or("2", "5", "60", "6")' \
|
||||
'band:or("2", "5", "60")' \
|
||||
'ssid:string' \
|
||||
'encryption:or("psk2", "sae-mixed", "sae", string)' \
|
||||
'encryption:or("psk2", "sae-mixed", "sae",
|
||||
"psk", "psk-mixed", "none", string)' \
|
||||
'key:string' \
|
||||
'uuid:string' \
|
||||
'manufacturer:string' \
|
||||
|
||||
17
ieee1905/files/etc/uci-defaults/31-ifname-list-to-option
Normal file
17
ieee1905/files/etc/uci-defaults/31-ifname-list-to-option
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_load ieee1905
|
||||
|
||||
list_to_ifname() {
|
||||
local section=$1
|
||||
|
||||
config_get ifname $section ifname # get list as space separated values
|
||||
|
||||
uci del ieee1905.${section}.ifname # delete entry
|
||||
uci set ieee1905.${section}.ifname="$ifname" # writeback entry as option
|
||||
}
|
||||
|
||||
config_foreach list_to_ifname al-iface
|
||||
|
||||
15
iop/config
15
iop/config
@@ -50,8 +50,6 @@ CONFIG_PACKAGE_wifimngr=y
|
||||
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-agent=m
|
||||
CONFIG_PACKAGE_map-controller=m
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_wfadatad-collector=y
|
||||
|
||||
@@ -117,8 +115,7 @@ CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
CONFIG_PACKAGE_miniupnpd-iptables=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
@@ -140,7 +137,7 @@ CONFIG_PACKAGE_ip-bridge=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_iptables-legacy=y
|
||||
CONFIG_PACKAGE_iptables=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
@@ -165,7 +162,6 @@ 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
|
||||
@@ -289,10 +285,3 @@ 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,65 +2,57 @@
|
||||
|
||||
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
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
#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
|
||||
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
|
||||
./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
|
||||
|
||||
# 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
|
||||
# install all packages
|
||||
./scripts/feeds install -a
|
||||
|
||||
# install all packages
|
||||
./scripts/feeds install -a
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete
|
||||
|
||||
# remove broken symlinks ( for packages that are no longer in the feed )
|
||||
find -L package/feeds -maxdepth 2 -type l -delete
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig
|
||||
|
||||
cp .genconfig_config_bak .config
|
||||
make defconfig
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap
|
||||
|
||||
# record when we last run this script
|
||||
touch tmp/.iop_bootstrap
|
||||
|
||||
# always return true
|
||||
exit 0
|
||||
# always return true
|
||||
exit 0
|
||||
}
|
||||
|
||||
register_command "feeds_update" "Update feeds to point to commit hashes from feeds.conf"
|
||||
|
||||
|
||||
@@ -13,12 +13,11 @@ function genconfig {
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
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"
|
||||
mediatek="target/linux/feeds/iopsys-mediatek"
|
||||
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"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
@@ -84,8 +83,8 @@ function genconfig {
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/feeds/$TARGET" ]; then
|
||||
local targetpath="./target/linux/feeds/$TARGET"
|
||||
if [ -n "$TARGET" -a -d "./target/linux/$TARGET" ]; then
|
||||
local targetpath="./target/linux/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
@@ -118,11 +117,9 @@ function genconfig {
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $mediatek/genconfig ] &&
|
||||
iopsys_mediatek=$(cd $mediatek; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt iopsys_mediatek; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -170,14 +167,6 @@ function genconfig {
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_mediatek"
|
||||
target_config_path="$mediatek/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
@@ -265,11 +254,22 @@ function genconfig {
|
||||
setup_dirs()
|
||||
{
|
||||
git remote -v | grep -q http || {
|
||||
CUSTBRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
||||
if git ls-remote $CUSTREPO -q 2>/dev/null; then
|
||||
if [ ! -d "$CUSTPATH" ]; then
|
||||
git clone "$CUSTREPO" "$CUSTPATH"
|
||||
echo "Cloning $CUSTBRANCH branch of $CUSTREPO"
|
||||
git clone -b "$CUSTBRANCH" "$CUSTREPO" "$CUSTPATH" 2>/dev/null || {
|
||||
DEFBRANCH="$(git remote show $CUSTREPO | grep 'HEAD branch' | cut -d' ' -f5)"
|
||||
echo "$CUSTBRANCH branch is not found, cloning $DEFBRANCH branch of $CUSTREPO"
|
||||
git clone "$CUSTREPO" "$CUSTPATH"
|
||||
}
|
||||
elif [ $IMPORT -eq 1 ]; then
|
||||
cd $CUSTPATH
|
||||
echo "Checking out $CUSTBRANCH branch in $CUSTPATH"
|
||||
git checkout "$CUSTBRANCH" 2>/dev/null || {
|
||||
DEFBRANCH="$(git symbolic-ref refs/remotes/origin/HEAD | cut -d '/' -f4)"
|
||||
echo "Checking out $CUSTBRANCH branch has failed, using $DEFBRANCH branch in $CUSTPATH"
|
||||
}
|
||||
v "git pull"
|
||||
git pull
|
||||
cd - >/dev/null #go back
|
||||
@@ -330,25 +330,19 @@ function genconfig {
|
||||
fi
|
||||
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
case "$target" in
|
||||
iopsys_ramips | iopsys_econet | iopsys_mediatek | iopsys_brcm63xx_arm)
|
||||
# This assumes the device name to be unique within one target,
|
||||
# which is a fair assumption to make.
|
||||
local mk_file="$(grep -Fx --files-with-matches "define Device/${BOARDTYPE}" "$target_config_path/../image/"*.mk)"
|
||||
if [ -z "$mk_file" ]; then
|
||||
echo "Error determining subtarget for $target / ${BOARDTYPE}"
|
||||
return 1
|
||||
fi
|
||||
local subtarget="$(basename "${mk_file%.mk}")"
|
||||
if [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
;;
|
||||
*)
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
|
||||
@@ -12,12 +12,11 @@ function genconfig_min {
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
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"
|
||||
mediatek="target/linux/feeds/iopsys-mediatek"
|
||||
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"
|
||||
|
||||
Red='\033[0;31m' # Red
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
@@ -83,8 +82,8 @@ function genconfig_min {
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
if [ -n "$TARGET" -a -d "./target/linux/feeds/$TARGET" ]; then
|
||||
local targetpath="./target/linux/feeds/$TARGET"
|
||||
if [ -n "$TARGET" -a -d "./target/linux/$TARGET" ]; then
|
||||
local targetpath="./target/linux/$TARGET"
|
||||
local profiles=
|
||||
local pfound=0
|
||||
|
||||
@@ -117,11 +116,9 @@ function genconfig_min {
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $mediatek/genconfig ] &&
|
||||
iopsys_mediatek=$(cd $mediatek; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt iopsys_mediatek; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -169,24 +166,10 @@ function genconfig_min {
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_mediatek"
|
||||
target_config_path="$mediatek/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
endptAllowed=0
|
||||
|
||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||
}
|
||||
|
||||
v() {
|
||||
@@ -321,25 +304,19 @@ function genconfig_min {
|
||||
fi
|
||||
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
case "$target" in
|
||||
iopsys_ramips | iopsys_econet | iopsys_mediatek | iopsys_brcm63xx_arm)
|
||||
# This assumes the device name to be unique within one target,
|
||||
# which is a fair assumption to make.
|
||||
local mk_file="$(grep -Fx --files-with-matches "define Device/${BOARDTYPE}" "$target_config_path/../image/"*.mk)"
|
||||
if [ -z "$mk_file" ]; then
|
||||
echo "Error determining subtarget for $target / ${BOARDTYPE}"
|
||||
return 1
|
||||
fi
|
||||
local subtarget="$(basename "${mk_file%.mk}")"
|
||||
if [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
;;
|
||||
*)
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo "$CUSTOMERS $BOARDTYPE" > $CURRENT_CONFIG_FILE
|
||||
|
||||
|
||||
@@ -1,282 +1,344 @@
|
||||
# this is a developer helper script to install firmware on a remote host with SSH
|
||||
|
||||
function upd_usage {
|
||||
echo "usage: $0 ssh_upgrade [-t <host>] [-f <file>] [opts] "
|
||||
echo ""
|
||||
echo " Default host is 192.168.1.1"
|
||||
echo " Default firmware file is the latest one (last.{itb,pkgtb})"
|
||||
echo " Default is to not keep configuration"
|
||||
echo "opts:"
|
||||
echo ""
|
||||
echo " -i Interactive use, allows to select firmware file"
|
||||
echo " -n Do not do the final reboot of the target board"
|
||||
echo " -c Keep configuration"
|
||||
echo " -x Force install even if firmware is not for this board"
|
||||
echo " -b Force install of bootloader regardless of version installed"
|
||||
echo "usage: $0 iopupgrade -t <host> -f <file> [opts] "
|
||||
echo ""
|
||||
echo " Default host is 192.168.1.1"
|
||||
echo " Default firmware file is the newest one found"
|
||||
echo " Default is to not keep configuration"
|
||||
echo "opts:"
|
||||
echo ""
|
||||
echo " -i Interactive use, Allows to select firmware file"
|
||||
echo " -n Do not do the final reboot of the target board"
|
||||
echo " -c Keep configuration"
|
||||
echo " -x Force install even if firmware is not for this board"
|
||||
echo " -b Force install of bootloader regardless of version installed"
|
||||
echo " -s Use sysupgade. old upgrade method, needed for old releases that do not have iopu"
|
||||
}
|
||||
|
||||
function set_config_string {
|
||||
eval $(grep $1 .config)
|
||||
eval `grep $1 .config`
|
||||
}
|
||||
|
||||
function upd_ask_ok {
|
||||
echo "Will continue with the following settings:"
|
||||
echo "-----------------------------------------"
|
||||
printf "%20s: %s\n" "Firmware file" "$upd_fw_base"
|
||||
printf "%20s: %s\n" "Host IP" "$upd_host"
|
||||
printf "%20s: " "Reboot"
|
||||
if [ "$upd_noreboot" == "0" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
printf "%20s: " "Keep config"
|
||||
if [ "$upd_keepconf" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
printf "%20s: " "Force bootloader"
|
||||
if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
printf "%20s: " "Force image upgrade"
|
||||
if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi
|
||||
echo "-----------------------------------------"
|
||||
echo "Will Continue with the following settings"
|
||||
echo "-----------------------------------------"
|
||||
printf "%20s: %s\n" "Firmare file" "$upd_fw_base"
|
||||
printf "%20s: %s\n" "Host ip" "$upd_host"
|
||||
printf "%20s: " "Reboot"; if [ "$upd_noreboot" == "0" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Keep config"; if [ "$upd_keepconf" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Force bootloader"; if [ "$upd_forceboot" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Force image upgrade"; if [ "$upd_forceimage" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
printf "%20s: " "Use sysupgrade"; if [ "$upd_sysupgrade" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi
|
||||
echo "-----------------------------------------"
|
||||
|
||||
echo -n "Continue? [Y/n/q]:"
|
||||
read answer
|
||||
if [ "$upd_sysupgrade" == "0" ]
|
||||
then
|
||||
if [ "$upd_keepconf" == "1" ] ;then echo "keeping config is just a fantasy it's not yet implemented, try sysupgrade";fi
|
||||
fi
|
||||
|
||||
case $answer in
|
||||
n | N)
|
||||
return 1
|
||||
;;
|
||||
q | Q)
|
||||
exit 1
|
||||
;;
|
||||
y | Y | *)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
echo -n "Continue? [Y/n/q]:"
|
||||
read answer
|
||||
|
||||
case $answer in
|
||||
n|N)
|
||||
return 1;;
|
||||
q|Q)
|
||||
exit 1;;
|
||||
y|Y|*)
|
||||
return 0;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_file {
|
||||
dialog --keep-tite --title "To select a file, use TAB/ARROW to highlight then press SPACEBAR -> RETURN" \
|
||||
--fselect "${upd_fw:-bin/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/}" \
|
||||
$((lines - 10)) $((cols - 5)) \
|
||||
2>$tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]; then
|
||||
upd_fw="$new_file"
|
||||
upd_fw_base=$(basename $upd_fw)
|
||||
fi
|
||||
dialog --keep-tite --title "To select file use TAB/ARROW to hilight then press SPACEBAR -> RETURN" \
|
||||
--fselect "bin/targets/$CONFIG_TARGET_BOARD/generic/" \
|
||||
$((lines -10)) $((cols -5)) \
|
||||
2> $tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]
|
||||
then
|
||||
upd_fw="$new_file"
|
||||
upd_fw_base=$(basename $upd_fw);
|
||||
fi
|
||||
}
|
||||
|
||||
function upd_select_target {
|
||||
dialog --keep-tite --title "Input the hostname/IP of the target board" \
|
||||
--inputbox "Name/IP" \
|
||||
$((lines - 10)) $((cols - 5)) \
|
||||
"$upd_host" \
|
||||
2>$tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]; then
|
||||
upd_host="$new_file"
|
||||
fi
|
||||
dialog --keep-tite --title "Input the name/ip number of target board" \
|
||||
--inputbox "Name/IP" \
|
||||
$((lines -10)) $((cols -5)) \
|
||||
"$upd_host" \
|
||||
2> $tempfile
|
||||
|
||||
new_file=$(cat $tempfile)
|
||||
if [ -n "$new_file" ]
|
||||
then
|
||||
upd_host="$new_file"
|
||||
fi
|
||||
}
|
||||
|
||||
function upd_select_reboot {
|
||||
dialog --keep-tite --radiolist "Should the board reboot after download finished" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Reboot" "Restart board after done" $(if [ "$upd_noreboot" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"No reboot" "Continue running old system" $(if [ "$upd_noreboot" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
function upd_select_reboot {
|
||||
dialog --keep-tite --radiolist "Should the board reboot after download finished" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Reboot" "Restart board after done" `if [ "$upd_noreboot" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"No reboot" "Continue running old system" `if [ "$upd_noreboot" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"No reboot")
|
||||
upd_noreboot=1
|
||||
;;
|
||||
upd_noreboot=1
|
||||
;;
|
||||
"Reboot")
|
||||
upd_noreboot=0
|
||||
;;
|
||||
esac
|
||||
upd_noreboot=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_config {
|
||||
dialog --keep-tite --radiolist "Should the configuration be kept" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Keep" "Keep the config from old system" $(if [ "$upd_keepconf" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"Default" "Use default config for new system" $(if [ "$upd_keepconf" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
dialog --keep-tite --radiolist "Should the configuration be keept" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Keep" "Keep the config from old system" `if [ "$upd_keepconf" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"Default" "Use default config for new system" `if [ "$upd_keepconf" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Keep")
|
||||
upd_keepconf=1
|
||||
;;
|
||||
upd_keepconf=1
|
||||
;;
|
||||
"Default")
|
||||
upd_keepconf=0
|
||||
;;
|
||||
esac
|
||||
upd_keepconf=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_forceboot {
|
||||
dialog --keep-tite --radiolist "Should the boot loader be updated regardless of the version installed" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Force" "Always update boot loader" $(if [ "$upd_forceboot" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"Version check" "Only upgrade if version is newer" $(if [ "$upd_forceboot" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
dialog --keep-tite --radiolist "Should the boot loader be updated reagardless of version installed" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Force" "Alwasy update boot loader" `if [ "$upd_forceboot" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"Version check" "Only upgrade if version is newer" `if [ "$upd_forceboot" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Force")
|
||||
upd_forceboot=1
|
||||
;;
|
||||
upd_forceboot=1
|
||||
;;
|
||||
"Version check")
|
||||
upd_forceboot=0
|
||||
;;
|
||||
esac
|
||||
upd_forceboot=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_forceimage {
|
||||
dialog --keep-tite --radiolist "Should the image be stored in flash even if sanity checks would reject it" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Force" "Disable sanity check and force use of image (dangerous)" $(if [ "$upd_forceimage" == "1" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
"Only compatible" "Normal checks apply" $(if [ "$upd_forceimage" == "0" ]; then echo "ON"; else echo "OFF"; fi) \
|
||||
2>$tempfile
|
||||
dialog --keep-tite --radiolist "Should the image be stored in flash even if sanity checks would reject it" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Force" "Dissable sanity check and force use of image (dangerous)" `if [ "$upd_forceimage" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"Only compatible" "Normal checks apply" `if [ "$upd_forceimage" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"Force")
|
||||
upd_forceimage=1
|
||||
;;
|
||||
upd_forceimage=1
|
||||
;;
|
||||
"Only compatible")
|
||||
upd_forceimage=0
|
||||
;;
|
||||
esac
|
||||
upd_forceimage=0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select_sysupgrade {
|
||||
dialog --keep-tite --radiolist "Use the old way to upgrade a board" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"iopu" "Use the iop upgrade methode" `if [ "$upd_sysupgrade" == "0" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
"sysupgrade" "Use the old sysupgrade methode" `if [ "$upd_sysupgrade" == "1" ] ;then echo "ON" ;else echo "OFF";fi` \
|
||||
2> $tempfile
|
||||
|
||||
res=$(cat $tempfile)
|
||||
case $res in
|
||||
"iopu")
|
||||
upd_sysupgrade=0
|
||||
;;
|
||||
"sysupgrade")
|
||||
upd_sysupgrade=1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function upd_select {
|
||||
dialog --keep-tite --ok-label "Select" --cancel-label "Done" --menu "Select item to change" \
|
||||
$((lines - 5)) $((cols - 5)) $((lines - 5 - 5)) \
|
||||
"Firmware file" "$upd_fw_base" \
|
||||
"Host IP" "$upd_host" \
|
||||
"Reboot" $(if [ "$upd_noreboot" == "0" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
"Keep config" $(if [ "$upd_keepconf" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
"Force bootloader" $(if [ "$upd_forceboot" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
"Force image upgrade" $(if [ "$upd_forceimage" == "1" ]; then printf "Yes\n"; else printf "No\n"; fi) \
|
||||
2>$tempfile
|
||||
|
||||
case $(cat $tempfile) in
|
||||
"Firmware file")
|
||||
upd_select_file
|
||||
;;
|
||||
"Host IP")
|
||||
upd_select_target
|
||||
;;
|
||||
dialog --keep-tite --ok-label "Select" --cancel-label "Done" --menu "Select Item to change" \
|
||||
$((lines -5)) $((cols -5)) $((lines -5 -5)) \
|
||||
"Firmare file" "$upd_fw_base"\
|
||||
"Host ip" "$upd_host" \
|
||||
"Reboot" `if [ "$upd_noreboot" == "0" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"Keep config" `if [ "$upd_keepconf" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"Force bootloader" `if [ "$upd_forceboot" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"Force image upgrade" `if [ "$upd_forceimage" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
"sysupgrade" `if [ "$upd_sysupgrade" == "1" ] ;then printf "Yes\n" ;else printf "No\n";fi` \
|
||||
2> $tempfile
|
||||
|
||||
|
||||
case $(cat $tempfile) in
|
||||
"Firmare file")
|
||||
upd_select_file
|
||||
;;
|
||||
"Host ip")
|
||||
upd_select_target
|
||||
;;
|
||||
"Reboot")
|
||||
upd_select_reboot
|
||||
;;
|
||||
upd_select_reboot
|
||||
;;
|
||||
"Keep config")
|
||||
upd_select_config
|
||||
;;
|
||||
upd_select_config
|
||||
;;
|
||||
"Force bootloader")
|
||||
upd_select_forceboot
|
||||
;;
|
||||
upd_select_forceboot
|
||||
;;
|
||||
"Force image upgrade")
|
||||
upd_select_forceimage
|
||||
;;
|
||||
upd_select_forceimage
|
||||
;;
|
||||
"sysupgrade")
|
||||
upd_select_sysupgrade
|
||||
;;
|
||||
*)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
upd_select
|
||||
return
|
||||
;;
|
||||
esac
|
||||
upd_select
|
||||
}
|
||||
function upd_select_start {
|
||||
lines=$(tput lines)
|
||||
cols=$(tput cols)
|
||||
tempfile="$(mktemp)"
|
||||
trap "rm -f $tempfile" 0 1 2 5 15
|
||||
upd_select
|
||||
lines=$(tput lines)
|
||||
cols=$(tput cols)
|
||||
tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
|
||||
trap "rm -f $tempfile" 0 1 2 5 15
|
||||
upd_select
|
||||
|
||||
}
|
||||
|
||||
function ssh_upgrade {
|
||||
upd_noreboot=0
|
||||
upd_forceboot=0
|
||||
upd_keepconf=0
|
||||
upd_forceimage=0
|
||||
upd_fw_base=""
|
||||
upd_fw=""
|
||||
upd_host="192.168.1.1"
|
||||
do_dialog=0
|
||||
upd_noreboot=0
|
||||
upd_forceboot=0
|
||||
upd_keepconf=0
|
||||
upd_forceimage=0
|
||||
upd_fw_base=""
|
||||
upd_fw=""
|
||||
upd_host="192.168.1.1"
|
||||
upd_sysupgrade=1
|
||||
do_dialog=0
|
||||
|
||||
while getopts "f:hnxt:icb" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
upd_noreboot=1
|
||||
;;
|
||||
x)
|
||||
upd_forceimage=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
c)
|
||||
upd_keepconf=1
|
||||
;;
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
f)
|
||||
upd_fw=$OPTARG
|
||||
;;
|
||||
t)
|
||||
upd_host=$OPTARG
|
||||
;;
|
||||
i)
|
||||
do_dialog=1
|
||||
;;
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$upd_fw" ]; then
|
||||
set_config_string CONFIG_TARGET_BOARD
|
||||
set_config_string CONFIG_TARGET_SUBTARGET
|
||||
upd_fw="$(realpath -q --canonicalize-existing --relative-to=. "bin/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/"last.{pkgtb,itb})"
|
||||
if [ -z "$upd_fw" ] && [ $do_dialog -eq 0 ]; then
|
||||
echo "Could not find image. Check that last.{itb,pkgtb} exists or specify an image using -f <image> or -i (interactive)." >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
upd_fw_base="$(basename "$upd_fw")"
|
||||
|
||||
[ $do_dialog -eq 1 ] && upd_select_start
|
||||
|
||||
if ! upd_ask_ok; then
|
||||
upd_select_start
|
||||
if ! upd_ask_ok; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f $upd_fw ]; then
|
||||
echo "Firmware file $firmware does not exist."
|
||||
while getopts "f:hnxt:iscb" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
upd_noreboot=1
|
||||
;;
|
||||
x)
|
||||
upd_forceimage=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
c)
|
||||
upd_keepconf=1
|
||||
;;
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
;;
|
||||
f)
|
||||
upd_fw=$OPTARG
|
||||
;;
|
||||
t)
|
||||
upd_host=$OPTARG
|
||||
;;
|
||||
i)
|
||||
do_dialog=1
|
||||
;;
|
||||
s)
|
||||
upd_sysupgrade=1
|
||||
;;
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$upd_fw" ]
|
||||
then
|
||||
upd_fw_base=$(basename $upd_fw);
|
||||
else
|
||||
set_config_string CONFIG_TARGET_BOARD
|
||||
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t *[0-9].y[3])
|
||||
|
||||
# if target uses pkgtb
|
||||
if [ -z "$firmwares"]
|
||||
then
|
||||
# pkgtb files can not be streamed so copy over the file witch scp
|
||||
use_scp=1
|
||||
firmwares=$(cd bin/targets/$CONFIG_TARGET_BOARD/generic/; ls -t last.pkgtb)
|
||||
fi
|
||||
|
||||
extra_args=""
|
||||
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args --no-reboot"
|
||||
[ $upd_forceimage -eq 1 ] && extra_args="$extra_args --force"
|
||||
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
|
||||
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args --force-loader-upgrade"
|
||||
for upd_fw_base in $firmwares
|
||||
do
|
||||
#echo "firmware $upd_fw"
|
||||
break
|
||||
done
|
||||
upd_fw="bin/targets/$CONFIG_TARGET_BOARD/generic/$upd_fw_base"
|
||||
fi
|
||||
|
||||
pv "$upd_fw" |
|
||||
ssh \
|
||||
-o ConnectTimeout=60 \
|
||||
root@"$upd_host" \
|
||||
sh -c "cat > '/tmp/$upd_fw_base' && (set -x && sysupgrade -v $extra_args /tmp/$upd_fw_base)" ||
|
||||
echo "Sysupgrade failed" >&2 && return 1
|
||||
[ $do_dialog -eq 1 ] && upd_select_start
|
||||
|
||||
if ! upd_ask_ok
|
||||
then
|
||||
upd_select_start
|
||||
if ! upd_ask_ok
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f $upd_fw ]
|
||||
then
|
||||
echo "firmware file $firmware do not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $upd_sysupgrade -eq 0 ]
|
||||
then
|
||||
extra_args=""
|
||||
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -n"
|
||||
[ $upd_forceimage -eq 1 ] && extra_args="$extra_args -x"
|
||||
[ $upd_forceboot -eq 1 ] && extra_args="$extra_args -b"
|
||||
|
||||
file_size_kb=`du -k "$upd_fw" | cut -f1`
|
||||
if [ "$use_scp" == "1" ]
|
||||
then
|
||||
scp $upd_fw root@$upd_host:/tmp/ &&
|
||||
ssh -o ConnectTimeout=60 root@$upd_host "iopu $extra_arg -f /tmp/$upd_fw_base"
|
||||
else
|
||||
cat $upd_fw | pv -s ${file_size_kb}k | ssh root@$upd_host "iopu $extra_args"
|
||||
fi
|
||||
else
|
||||
extra_args=""
|
||||
[ $upd_noreboot -eq 1 ] && extra_args="$extra_args -d"
|
||||
[ $upd_keepconf -eq 0 ] && extra_args="$extra_args -n"
|
||||
|
||||
scp $upd_fw root@$upd_host:/tmp/ &&
|
||||
ssh -o ConnectTimeout=60 root@$upd_host "sysupgrade -v $extra_args /tmp/$upd_fw_base" &&
|
||||
echo "sysupgrade done!"
|
||||
fi
|
||||
}
|
||||
|
||||
register_command "ssh_upgrade" "-h <host> -f <file> [opts] Install firmware on remote host with SSH"
|
||||
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=2.10.3.16
|
||||
PKG_VERSION:=2.10.4.6
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=298b7ceef779a658b88f78e15f65883e5012273c
|
||||
PKG_SOURCE_VERSION:=e1978e7b7be0b1f3f4e2b9539d1edfd1898b8083
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -28,7 +28,7 @@ define Package/map-agent
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin
|
||||
+map-plugin +ip-bridge
|
||||
endef
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ 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)
|
||||
@@ -73,6 +72,7 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
|
||||
@@ -83,8 +83,6 @@ define Package/map-agent/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/lib/wifi
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/script/* $(1)/lib/wifi/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ config agent 'agent'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
option eth_onboards_wifi_bhs '0'
|
||||
option ap_follow_sta_dfs '0'
|
||||
option guest_isolation '0'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config dynamic_backhaul
|
||||
|
||||
@@ -10,54 +10,6 @@ IS_CFG_VALID=1
|
||||
MAP_DEV="map_dev"
|
||||
MAP_IF="map"
|
||||
|
||||
create_map() {
|
||||
ip link add lei type veth peer name lei_map 2>/dev/null
|
||||
ip link add link lei name lei_lan type vlan id 1 2>/dev/null
|
||||
|
||||
uci -q set network.${MAP_DEV}=device
|
||||
uci -q set network.${MAP_DEV}.name=br-map
|
||||
uci -q set network.${MAP_DEV}.type=bridge
|
||||
|
||||
uci -q show network.${MAP_DEV}.ports | grep -q lei_map || {
|
||||
uci -q add_list network.${MAP_DEV}.ports='lei_map'
|
||||
}
|
||||
|
||||
uci -q set network.${MAP_IF}=interface
|
||||
uci -q set network.${MAP_IF}.device=br-map
|
||||
uci -q set network.${MAP_IF}.is_lan=1
|
||||
|
||||
uci -q show network.br_lan.ports | grep -q lei_lan || {
|
||||
uci -q add_list network.br_lan.ports="lei_lan"
|
||||
}
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-map
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.interface.map
|
||||
|
||||
brctl addif br-map lei_map 2>/dev/null
|
||||
brctl addif br-lan lei_lan 2>/dev/null
|
||||
|
||||
ip link set lei up 2>/dev/null
|
||||
ip link set lei_map up 2>/dev/null
|
||||
ip link set lei_lan up 2>/dev/null
|
||||
}
|
||||
|
||||
remove_map() {
|
||||
ip link delete ${MAP_VETH} &>/dev/null
|
||||
|
||||
uci -q delete network.${MAP_DEV}
|
||||
uci -q delete network.${MAP_IF}
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-lan
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
}
|
||||
|
||||
start_dynbhd_service() {
|
||||
rm -f /tmp/multiap.backhaul
|
||||
procd_open_instance
|
||||
@@ -116,7 +68,7 @@ validate_ap_section() {
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'ifname:string' \
|
||||
'device:string' \
|
||||
'band:or("2", "5", "6")' \
|
||||
'band:or("2", "5")' \
|
||||
'enabled:bool:true' \
|
||||
'onboarded:bool:false' \
|
||||
'ssid:string' \
|
||||
@@ -150,7 +102,11 @@ validate_radio_section() {
|
||||
'include_sta_metric:bool:false' \
|
||||
'rcpi_hysteresis_margin:range(0,255)' \
|
||||
'report_util_threshold:range(0,255)' \
|
||||
'encryption:or("sae", "psk2", "sae-mixed")'
|
||||
'encryption:or("sae", "sae+aes", "psk2",
|
||||
"psk2+aes", "sae-mixed", "sae-mixed+aes",
|
||||
"none", "psk-mixed", "psk-mixed+aes",
|
||||
"wpa", "wpa+aes", "wpa2", "wpa2+aes",
|
||||
"psk", "psk+aes")' \
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of radio section failed"
|
||||
@@ -215,10 +171,6 @@ validate_agent_config() {
|
||||
return 0
|
||||
}
|
||||
|
||||
create_dir() {
|
||||
mkdir -p /var/run/multiap
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -f /usr/sbin/dynbhd ] && start_dynbhd_service
|
||||
|
||||
@@ -233,12 +185,7 @@ start_service() {
|
||||
config_get_bool enabled agent enabled 1
|
||||
[ "$enabled" -eq 0 ] && return 1
|
||||
|
||||
local ts
|
||||
config_get_bool ts agent vlan_segregation 0
|
||||
[ "$ts" -eq 1 ] && create_map #|| remove_map
|
||||
|
||||
procd_open_instance
|
||||
create_dir
|
||||
procd_set_param command "/usr/sbin/mapagent" "-d"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
@@ -246,10 +193,6 @@ start_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
#stop_service() {
|
||||
# remove_map
|
||||
#}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "mapagent"
|
||||
|
||||
996
map-agent/files/lib/wifi/multiap
Executable file
996
map-agent/files/lib/wifi/multiap
Executable file
@@ -0,0 +1,996 @@
|
||||
#!/bin/sh
|
||||
|
||||
# functions
|
||||
# wireless_teardown - tear down ifaces based on mapagent config
|
||||
# setup_network - prepare /etc/config/network if necessary
|
||||
# setup_wireless - prepare /etc/config/wireless based on mapagent config
|
||||
# write_credentials - write bBSS credentials to fBSS
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/wifi/traffic_separation
|
||||
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
|
||||
diff=0
|
||||
onbrd_bssid=0
|
||||
onbrd_band=0
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [wireless_teardown|setup_network|setup_wireless|write_credentials]
|
||||
Platform specific Multi-AP script to prepare network and wifi subsystem based on
|
||||
mapagent configuration.
|
||||
wireless_teardown - tear down ifaces in /etc/config/wireless
|
||||
setup_network - prepare /etc/config/network
|
||||
setup_wireless - prepare /etc/config/wireless
|
||||
write_credentials - write bBSS credentials to fBSS
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
type_to_multi_ap () {
|
||||
type="$1"
|
||||
|
||||
if [ "$type" = "backhaul" ]; then
|
||||
echo "1"
|
||||
return
|
||||
elif [ "$type" = "fronthaul" ]; then
|
||||
echo "2"
|
||||
return
|
||||
elif [ "$type" = "combined" ]; then
|
||||
echo "3"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "0"
|
||||
}
|
||||
|
||||
get_type_by_section() {
|
||||
section="$1"
|
||||
|
||||
config_get type $section type "0"
|
||||
|
||||
echo "$(type_to_multi_ap $type)"
|
||||
}
|
||||
|
||||
sync_credentials() {
|
||||
bands=""
|
||||
json_init
|
||||
mapagent_process_fh() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
|
||||
[ "$dev" != "$device" ] && return
|
||||
|
||||
config_get band $section band
|
||||
config_get ssid $section ssid
|
||||
config_get encryption $section encryption
|
||||
config_get key $section key
|
||||
|
||||
section=$(uci add ieee1905 ap)
|
||||
[ "$section" == "" ] && return
|
||||
|
||||
uci -q set ieee1905.${section}.band=$band
|
||||
uci -q set ieee1905.${section}.ssid="$ssid"
|
||||
uci -q set ieee1905.${section}.encryption=$encryption
|
||||
uci -q set ieee1905.${section}.key="$key"
|
||||
json_select "$band" > /dev/null
|
||||
if [ "$?" = "0" ]; then
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_get_var val "$key"
|
||||
uci -q set ieee1905.${section}.$key="$val"
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
local section=$1
|
||||
|
||||
config_get device $section device
|
||||
config_get band $section band
|
||||
config_get dedicated_backhaul $section dedicated_backhaul 0
|
||||
|
||||
[ "$dedicated_backhaul" != "0" ] && return
|
||||
|
||||
for b in $bands; do
|
||||
if [ "$b" == "$band" ]; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
config_foreach mapagent_process_fh ap $device
|
||||
bands="$bands $band"
|
||||
}
|
||||
|
||||
ieee1905_del_ap() {
|
||||
append_value() {
|
||||
local section=$1
|
||||
local key=$2
|
||||
shift
|
||||
shift
|
||||
|
||||
while [ "$key" != "" ]; do
|
||||
val=$(uci -q get ieee1905.$section.$key)
|
||||
[ "$val" = "" ] && {
|
||||
key=$1
|
||||
shift
|
||||
continue
|
||||
}
|
||||
json_add_string "$key" ${val}
|
||||
key=$1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
local section=$1
|
||||
local band
|
||||
|
||||
config_get band $section band
|
||||
json_select "$band" > /dev/null
|
||||
rc=$?
|
||||
[ "$rc" != "0" ] && json_add_object "$band"
|
||||
append_value $section "manufacturer" "model_name" "device_name" "model_number" "serial_number" "device_type" "os_version"
|
||||
if [ "$rc" != "0" ]; then
|
||||
json_close_object
|
||||
else
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
uci -q delete ieee1905.${section}
|
||||
}
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach ieee1905_del_ap ap
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_process_radio radio
|
||||
|
||||
uci commit ieee1905
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
write_credentials() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wireless() {
|
||||
write_wireless() {
|
||||
local section=$1
|
||||
local map_ifname=$2
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
#echo found device=$device map=$multi_ap ifname=$ifname mapifname=$map_ifname
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_ssid="$bk_ssid"
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_key="$bk_key"
|
||||
}
|
||||
config_load wireless
|
||||
|
||||
config_foreach write_wireless wifi-iface "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
mapagent_find_fbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
|
||||
[ "$device" != "$dev" ] && return
|
||||
[ "$multi_ap" != "2" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key")
|
||||
}
|
||||
|
||||
mapagent_find_bbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
config_get enabled $section enabled "1"
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
|
||||
[ "$enabled" == "0" ] && return
|
||||
[ "$device" != "$dev" ] && return
|
||||
[ "$multi_ap" != "1" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
|
||||
#echo found ssid="$ssid" key="$key"
|
||||
|
||||
config_foreach mapagent_find_fbss ap $dev "$ssid" "$key"
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
local section=$1
|
||||
|
||||
config_get device $section device
|
||||
|
||||
#echo found dev=$dev
|
||||
|
||||
config_foreach mapagent_find_bbss ap $device
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_process_radio radio
|
||||
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
set_network() {
|
||||
local ifname=$1
|
||||
local num=$2
|
||||
local bssid=$3
|
||||
|
||||
wpa_cli -i $ifname set_n $num bssid $bssid
|
||||
}
|
||||
|
||||
bsta_steer() {
|
||||
local ifname=$1
|
||||
local bssid=$2
|
||||
|
||||
rc=$(wpa_cli -i $ifname set_n 0 bssid $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
|
||||
rc=$(wpa_cli -i $ifname roam $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
write_bsta_config() {
|
||||
local ifname=$1
|
||||
|
||||
#echo diff = $diff > /dev/console
|
||||
|
||||
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
local bssid=$3
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
#echo setting diff = $diff > /dev/console
|
||||
old_bssid="$(uci -q get wireless.${section}.bssid)"
|
||||
|
||||
[ "$old_bssid" == "$bssid" ] && break
|
||||
|
||||
uci -q set wireless.${section}.bssid=$bssid
|
||||
wpa_cli -i "$bsta" set_n 0 bssid $bssid
|
||||
wpa_cli -i "$bsta" save_config
|
||||
echo 1
|
||||
}
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $1 $2
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
mapagent_process_bk() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
|
||||
|
||||
config_get ifname $section ifname
|
||||
#echo bsta = $bsta > /dev/console
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
#echo found ifname=$ifname > /dev/console
|
||||
|
||||
config_get bssid $section bssid
|
||||
config_get band $section band
|
||||
ret=$(mapagent_apply_wl_bsta $ifname $bssid)
|
||||
[ "$ret" == "1" ] && {
|
||||
diff=1
|
||||
onbrd_bssid=$bssid
|
||||
onbrd_band=$band
|
||||
}
|
||||
}
|
||||
|
||||
mapagent_apply_bssid_same_band() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
uci -q set wireless.${section}.bssid=$bssid
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onbrd_band" != "$band" -o "$onboarded" = "1" ] && return
|
||||
|
||||
config_get ifname $1 ifname
|
||||
|
||||
config_load wireless
|
||||
config_foreach apply_config wifi-iface $ifname $onbrd_bssid
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
config_foreach mapagent_process_bk bsta $ifname
|
||||
|
||||
#echo result diff = $diff > /dev/console
|
||||
[ "$diff" == "1" ] && {
|
||||
(config_foreach mapagent_apply_bssid_same_band bsta)
|
||||
#ubus call uci commit '{"config":"wireless"}'
|
||||
#echo reloading wireless > /dev/console
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
teardown_iface() {
|
||||
config_load mapagent
|
||||
|
||||
local iface=$1
|
||||
|
||||
mapagent_teardown_wireless() {
|
||||
write_wireless() {
|
||||
local section=$1
|
||||
local map_ifname=$2
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
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
|
||||
uci -q delete wireless.${section}.multi_ap_backhaul_key
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach write_wireless wifi-iface $1
|
||||
}
|
||||
|
||||
mapagent_teardown_bss() {
|
||||
local section=$1
|
||||
local iface=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$iface" != "$ifname" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
uci -q set mapagent.${section}.enabled="0"
|
||||
uci -q set mapagent.${section}.ssid="DISABLED-SSID"
|
||||
uci -q set mapagent.${section}.key="DISABLED-KEY"
|
||||
#uci -q del mapagent.${section}.vid
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
(mapagent_teardown_wireless $ifname)
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_teardown_bss ap $iface
|
||||
|
||||
uci commit wireless
|
||||
uci commit mapagent
|
||||
}
|
||||
|
||||
bsta_to_wireless() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_find_lowest_prio_onboarded() {
|
||||
mapagent_process_bk() {
|
||||
config_get priority $1 priority "2"
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onboarded" = "0" ] && return
|
||||
|
||||
if [ -z "$sec" -o "$prio" = "-1" -o "$priority" -lt "$prio" ]; then
|
||||
sec=$1
|
||||
prio=$priority
|
||||
fi
|
||||
}
|
||||
|
||||
local sec=""
|
||||
local prio="-1"
|
||||
|
||||
config_foreach mapagent_process_bk bsta
|
||||
echo $sec
|
||||
}
|
||||
|
||||
mapagent_enable_best() {
|
||||
#echo 1=$1 best=$best > /dev/console
|
||||
if [ "$1" = "$best" ]; then
|
||||
uci -q set mapagent.$1.enabled='1'
|
||||
else
|
||||
uci -q set mapagent.$1.enabled='0'
|
||||
fi
|
||||
}
|
||||
|
||||
mapagent_bsta_to_wireless() {
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
local ssid="$3"
|
||||
local key="$4"
|
||||
local encryption=$5
|
||||
local enabled=$6
|
||||
local bssid=$7
|
||||
local disabled="0"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ -z "$enabled" -o "$enabled" = "0" ] && disabled="1"
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
|
||||
uci -q set wireless.${section}.ssid="$ssid"
|
||||
uci -q set wireless.${section}.key="$key"
|
||||
uci -q set wireless.${section}.encryption=$encryption
|
||||
uci -q set wireless.${section}.bssid="$bssid"
|
||||
uci -q set wireless.${section}.default_disabled='0'
|
||||
|
||||
[ "$disabled" != "1" ] && return
|
||||
wpa_cli -i "$bsta" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$bsta" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$bsta" save_config > /dev/null 2>&1
|
||||
|
||||
echo 1
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $@
|
||||
uci commit 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"
|
||||
|
||||
[ "$4" != "$band" -o "$onboarded" = "0" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
config_get enabled $1 enabled "0"
|
||||
config_get bssid $1 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
|
||||
config_get ifname $1 ifname
|
||||
config_get onboarded $1 onboarded "0"
|
||||
config_get enabled $1 enabled "0"
|
||||
|
||||
if [ "$onboarded" = "0" ]; then
|
||||
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
|
||||
|
||||
(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled "$bssid")
|
||||
fi
|
||||
}
|
||||
|
||||
# best=$(mapagent_find_lowest_prio_onboarded)
|
||||
#
|
||||
# [ -z "$best" ] && return
|
||||
#
|
||||
# band=$1
|
||||
# sec=""
|
||||
# prio=""
|
||||
#
|
||||
# config_foreach mapagent_enable_best bsta $best
|
||||
# uci commit mapagent
|
||||
config_load mapagent
|
||||
|
||||
diff=$(config_foreach mapagent_bsta_to_wireless bsta)
|
||||
|
||||
# [ "$diff" != "" ] && {
|
||||
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
sync_mapcontroller_from_wireless() {
|
||||
ubus -t 5 wait_for wifi
|
||||
[ "$?" != "0" ] && return
|
||||
|
||||
[ ! -f "/etc/config/wireless" ] && return
|
||||
|
||||
status=$(ubus -S call wifi status)
|
||||
|
||||
device_to_band() {
|
||||
local ifname=$1
|
||||
json_load "$status"
|
||||
json_select "radios"
|
||||
json_get_keys keys
|
||||
|
||||
for key in $keys; do
|
||||
json_select $key
|
||||
json_get_var name name
|
||||
|
||||
if [ "$name" != "$ifname" ]; then
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
|
||||
json_get_var band band
|
||||
|
||||
if [ "$band" == "5GHz" ]; then
|
||||
echo "5"
|
||||
elif [ "$band" == "2.4GHz" ]; then
|
||||
echo "2"
|
||||
fi
|
||||
|
||||
break
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
wireless_process_iface() {
|
||||
local section=$1
|
||||
local type="ap"
|
||||
local enabled="1"
|
||||
|
||||
config_get multi_ap $section multi_ap 0
|
||||
[ "$multi_ap" != "1" ] && [ "$multi_ap" != "2" ] && return
|
||||
|
||||
config_get mode $section mode "ap"
|
||||
[ "$mode" != "ap" ] && return
|
||||
|
||||
config_get device $section device
|
||||
band=$(device_to_band $device)
|
||||
[ "$band" == "" ] && return
|
||||
|
||||
config_get ssid $section ssid
|
||||
config_get key $section key
|
||||
config_get encryption $section encryption
|
||||
config_get start_disabled $section start_disabled "0"
|
||||
config_get network $section network
|
||||
|
||||
|
||||
cntlr_section=$(uci add mapcontroller ${type})
|
||||
uci -q set mapcontroller.${cntlr_section}.ssid="$ssid"
|
||||
uci -q set mapcontroller.${cntlr_section}.key="$key"
|
||||
uci -q set mapcontroller.${cntlr_section}.encryption="$encryption"
|
||||
uci -q set mapcontroller.${cntlr_section}.band="$band"
|
||||
uci -q set mapcontroller.${cntlr_section}.vid="1"
|
||||
uci -q set mapcontroller.${cntlr_section}.network="$network"
|
||||
|
||||
[ "$multi_ap" == "1" ] && map_type="backhaul" || map_type="fronthaul"
|
||||
uci -q set mapcontroller.${cntlr_section}.type="$map_type"
|
||||
|
||||
[ "$start_disabled" == "1" ] && enabled="0"
|
||||
uci -q set mapcontroller.${cntlr_section}.enabled="$enabled"
|
||||
}
|
||||
|
||||
mapcontroller_teardown() {
|
||||
local section=$1
|
||||
|
||||
uci delete mapcontroller.$1
|
||||
}
|
||||
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_teardown ap
|
||||
|
||||
config_load wireless
|
||||
config_foreach wireless_process_iface wifi-iface
|
||||
uci commit mapcontroller
|
||||
}
|
||||
|
||||
bsta_scan_on_enabled() {
|
||||
local onboarded_bands=""
|
||||
|
||||
mapagent_onboarded_bands() {
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onboarded" = "0" ] && return
|
||||
|
||||
onboarded_bands="$onboarded_bands $band"
|
||||
}
|
||||
|
||||
mapagent_enable_bk() {
|
||||
config_get ifname $1 ifname
|
||||
config_get band $1 band
|
||||
config_get enabled $1 enabled
|
||||
|
||||
[ "$enabled" = "0" ] && return
|
||||
|
||||
for onboarded_band in $onboarded_bands
|
||||
do
|
||||
[ "$onboarded_band" != "$band" ] && continue
|
||||
|
||||
logger -t multiap "bsta_scan_on_enabled $ifname $band"
|
||||
wpa_cli -i "$ifname" enable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" reconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
done
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_onboarded_bands bsta
|
||||
config_foreach mapagent_enable_bk bsta
|
||||
}
|
||||
|
||||
bsta_enable_all() {
|
||||
mapagent_enable_bk() {
|
||||
config_get ifname $1 ifname
|
||||
uci -q set mapagent.$1.enabled="1"
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
|
||||
config_foreach mapagent_enable_bk bsta
|
||||
uci commit mapagent
|
||||
bsta_scan_on_enabled
|
||||
}
|
||||
|
||||
# arg = one interface to clear
|
||||
# no arg = clear all interfaces
|
||||
bsta_clear_bssid() {
|
||||
local iface=$1
|
||||
|
||||
mapagent_remove_bssid() {
|
||||
local iface=$2
|
||||
|
||||
config_get ifname $1 ifname
|
||||
|
||||
[ -n "$iface" -a "$iface" != "$ifname" ] && return
|
||||
|
||||
uci -q set mapagent.$1.enabled="1"
|
||||
uci -q del mapagent.$1.bssid
|
||||
}
|
||||
|
||||
wireless_remove_bssid() {
|
||||
local iface=$2
|
||||
|
||||
config_get mode $1 mode
|
||||
config_get ifname $1 ifname
|
||||
|
||||
[ "$mode" != "sta" ] && return
|
||||
|
||||
[ -n "$iface" -a "$iface" != "$ifname" ] && 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 $iface
|
||||
uci commit mapagent
|
||||
|
||||
config_load wireless
|
||||
config_foreach wireless_remove_bssid wifi-iface $iface
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
# arg1 = ifname arg2 = bssid
|
||||
bsta_blacklist_bssid_set() {
|
||||
local ifname="$1"
|
||||
shift
|
||||
local bssid="$@"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_blacklist_by_band bsta
|
||||
}
|
||||
|
||||
bsta_disable_lower_priority() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_get_priority() {
|
||||
config_get ifname $1 ifname
|
||||
|
||||
[ "$ifname" != "$2" ] && return
|
||||
|
||||
config_get priority $1 priority "2"
|
||||
|
||||
echo "$priority"
|
||||
}
|
||||
|
||||
mapagent_disable_lower_bk() {
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section="$1"
|
||||
local bsta="$2"
|
||||
local enabled="$3"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
|
||||
[ "$enabled" != "0" ] && return
|
||||
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
local ifname="$1"
|
||||
local enabled="$2"
|
||||
|
||||
[ "$enabled" != "0" ] && return
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $ifname $enabled
|
||||
}
|
||||
|
||||
local enabled="1"
|
||||
|
||||
config_get ifname $1 ifname
|
||||
config_get priority $1 priority
|
||||
|
||||
[ "$ifname" != "$2" -a "$priority" -gt "$3" ] && enabled="0"
|
||||
|
||||
# enable passed ifname explicitly
|
||||
# don't explicitly enable other higher prio interfaces
|
||||
[ "$ifname" != "$2" -a "$enabled" = "1" ] && return
|
||||
|
||||
uci -q set mapagent.$1.enabled="$enabled"
|
||||
|
||||
(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
|
||||
prio=$(config_foreach mapagent_get_priority bsta $bsta)
|
||||
#echo bsta $bsta has prio $prio > /dev/console
|
||||
|
||||
config_foreach mapagent_disable_lower_bk bsta $bsta $prio
|
||||
uci commit mapagent
|
||||
|
||||
# ubus call uci commit '{"config":"wireless"}'
|
||||
}
|
||||
|
||||
|
||||
bsta_use_link() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_disable_bk() {
|
||||
local bsta="$2"
|
||||
|
||||
config_get ifname $1 ifname
|
||||
config_get enabled $1 enabled
|
||||
|
||||
[ "$bsta" = "$ifname" ] && return
|
||||
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
|
||||
config_foreach mapagent_disable_bk bsta $bsta
|
||||
|
||||
noht=$(iw $bsta info | grep "no HT")
|
||||
[ -n "$noht" ] && {
|
||||
logger -t multiap "no HT hit, issue reassoc $bsta"
|
||||
wpa_cli -i $bsta reassoc
|
||||
}
|
||||
}
|
||||
|
||||
bsta_swap_to_link() {
|
||||
bsta_disable_lower_priority $1
|
||||
bsta_use_link $1
|
||||
|
||||
wpa_cli -i "$1" enable_network 0 > /dev/null
|
||||
wpa_cli -i "$1" reconnect > /dev/null
|
||||
wpa_cli -i "$1" save_config > /dev/null
|
||||
}
|
||||
|
||||
set_uplink_backhaul_info() {
|
||||
local ul_1905id=$1
|
||||
local ul_mac=$2
|
||||
|
||||
(
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
|
||||
update_isolate_ebtables() {
|
||||
parse_fh() {
|
||||
local brcm_setup="$(uci -q get mapagent.agent.brcm_setup)"
|
||||
local guest_isolate="$(uci -q get mapagent.agent.guest_isolation)"
|
||||
local pvid="$(uci -q get mapagent.@policy[0].pvid)"
|
||||
local section=$1
|
||||
local prefix="TODO"
|
||||
local action="del"
|
||||
|
||||
config_get vid $section vid
|
||||
config_get band $section band
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ $vid -gt 4094 -o $vid -lt 1 ] && vid=$pvid
|
||||
[ "$guest_isolate" = "1" -a "$vid" != "$pvid" ] && action="add"
|
||||
if [ "$brcm_setup" = "1" ]; then
|
||||
prefix="wds"
|
||||
else
|
||||
#todo
|
||||
break;
|
||||
fi
|
||||
|
||||
ts_sub "isolate" "$action" "$pvid" "$vid" "$band" "$ifname" "$prefix"
|
||||
|
||||
}
|
||||
config_load mapagent
|
||||
|
||||
|
||||
config_foreach parse_fh ap
|
||||
|
||||
}
|
||||
|
||||
set_uplink() {
|
||||
local type=$1
|
||||
local ifname=$2
|
||||
local hwaddr
|
||||
|
||||
hwaddr="$(ifconfig $ifname | grep -i hwaddr | awk '{print $5}' | awk '{print tolower($0)}')"
|
||||
|
||||
json_init
|
||||
json_add_string "type" "$type"
|
||||
json_add_string "ifname" "$ifname"
|
||||
json_add_string "macaddr" "$hwaddr"
|
||||
(
|
||||
flock -x 200
|
||||
json_dump > "$MAPFILE"
|
||||
) 200>/var/lock/map.backhaul.lock
|
||||
json_cleanup
|
||||
|
||||
update_isolate_ebtables
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
disable_acsd() {
|
||||
|
||||
killall -9 acs_cli2
|
||||
killall -9 acsd2.brcm
|
||||
|
||||
config_load mapagent
|
||||
get_devices() {
|
||||
local section=$1
|
||||
local device
|
||||
config_get device $section device
|
||||
#echo "device $device"
|
||||
acs_ifmode="$(echo -n "$device"'_acs_mode' | xargs)"
|
||||
#echo "acs_mode" $acs_ifmode
|
||||
nvram set $acs_ifmode=0
|
||||
}
|
||||
|
||||
config_foreach get_devices radio
|
||||
}
|
||||
|
||||
unset_uplink() {
|
||||
local type=${1:-wifi}
|
||||
|
||||
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) wireless_teardown;;
|
||||
setup_network) setup_network;;
|
||||
setup_wireless) setup_wireless;;
|
||||
write_credentials) write_credentials;;
|
||||
sync_credentials) sync_credentials;;
|
||||
bsta_steer) bsta_steer $@;;
|
||||
set_network) set_network $@;;
|
||||
write_bsta_config) write_bsta_config $@;;
|
||||
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_bssid) bsta_clear_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 $@;;
|
||||
bsta_swap_to_link) bsta_swap_to_link $@;;
|
||||
set_uplink) set_uplink $@;;
|
||||
disable_acsd) disable_acsd;;
|
||||
set_uplink_backhaul_info) set_uplink_backhaul_info $@;;
|
||||
unset_uplink) unset_uplink $@;;
|
||||
--help|help) usage;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
|
||||
590
map-agent/files/lib/wifi/traffic_separation
Executable file
590
map-agent/files/lib/wifi/traffic_separation
Executable file
@@ -0,0 +1,590 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
AL_BRIDGE=${AL_BRIDGE-"br-lan"}
|
||||
PRIMARY_VID=${PRIMARY_VID-1}
|
||||
MAP_BH_FILE="/tmp/multiap.backhaul"
|
||||
|
||||
### Traffic Separation ###
|
||||
|
||||
ts_dbg() {
|
||||
logger -t traffic_separation $@
|
||||
}
|
||||
|
||||
ts_sub() {
|
||||
ts_usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [create|reload]
|
||||
Traffic Separation related functions.
|
||||
create vid - create vlan configuration with vlan_id
|
||||
reload - reload network with new configuration
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_dhcp_cleanup() {
|
||||
vid=$1
|
||||
|
||||
[ -n "$(uci -q get dhcp.guest${vid})" ] && {
|
||||
uci -q delete dhcp.guest${vid}
|
||||
uci commit dhcp
|
||||
/etc/init.d/dnsmasq reload
|
||||
}
|
||||
}
|
||||
|
||||
_firewall_cleanup() {
|
||||
vid=$1
|
||||
|
||||
guest_teardown() {
|
||||
local section=$1
|
||||
local config=$2
|
||||
local val=$3
|
||||
local option=$4
|
||||
|
||||
config_get name "$section" "$option"
|
||||
|
||||
[ "$val" != "$name" ] && continue
|
||||
|
||||
uci delete ${config}.${section}
|
||||
uci commit ${config}
|
||||
}
|
||||
|
||||
[ -n "$(uci -q get firewall.guest${vid}_dns)" ] && {
|
||||
uci -q delete firewall.guest${vid}_dns
|
||||
uci commit firewall
|
||||
}
|
||||
|
||||
[ -n "$(uci -q get firewall.guest${vid}_dhcp)" ] && {
|
||||
uci -q delete firewall.guest${vid}_dhcp
|
||||
uci commit firewall
|
||||
}
|
||||
|
||||
[ -n "$(uci -q get firewall.guest${vid}_ping)" ] && {
|
||||
uci -q delete firewall.guest${vid}_ping
|
||||
uci commit firewall
|
||||
}
|
||||
|
||||
config_load firewall
|
||||
config_foreach guest_teardown forwarding "firewall" guest${vid} "src" #delete firewall section with name = guest${vid}
|
||||
config_load firewall
|
||||
config_foreach guest_teardown zone "firewall" guest${vid} "name" #delete firewall section with name = guest${vid}
|
||||
}
|
||||
|
||||
_network_cleanup() {
|
||||
vid=$1
|
||||
|
||||
[ -n "$(uci -q get network.vlan${vid})" ] && {
|
||||
uci -q delete network.vlan${vid}
|
||||
uci commit network
|
||||
}
|
||||
|
||||
[ -n "$(uci -q get network.guest${vid})" ] && {
|
||||
uci -q delete network.guest${vid}
|
||||
uci commit network
|
||||
}
|
||||
|
||||
[ -n "$(uci -q get network.guest${vid}_8021q)" ] && {
|
||||
uci -q delete network.guest${vid}_8021q
|
||||
uci commit network
|
||||
}
|
||||
}
|
||||
|
||||
_guest_cleanup() {
|
||||
vid=$1
|
||||
_dhcp_cleanup $vid
|
||||
_firewall_cleanup $vid
|
||||
_network_cleanup $vid
|
||||
}
|
||||
|
||||
net_get_albridge_ip() {
|
||||
local section=$1
|
||||
|
||||
config_get device "$section" device
|
||||
|
||||
[ "${AL_BRIDGE}" = "$device" -o "${AL_BRIDGE}.${PRIMARY_VID}" = "$device" ] && {
|
||||
ipaddr="$(uci -q get network.${section}.ipaddr)"
|
||||
netmask="$(uci -q get network.${section}.netmask)"
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
map_get_ports() {
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local all_ports=$(uci -q get network.${br_dev}.ports)
|
||||
|
||||
echo "$all_ports"
|
||||
}
|
||||
|
||||
ts_create() {
|
||||
_dhcp_setup() {
|
||||
local name=$1
|
||||
|
||||
[ -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
|
||||
}
|
||||
|
||||
|
||||
_firewall_setup() {
|
||||
local name=$1
|
||||
local network=$1
|
||||
local vid=$2
|
||||
local exists=0
|
||||
local diff=0
|
||||
local subnet=$(($vid % 256))
|
||||
local ipaddr="192.168.${subnet}.1"
|
||||
|
||||
config_foreach net_get_albridge_ip interface $PRIMARY_VID
|
||||
|
||||
# replace third octet of the ip with $subnet
|
||||
ipaddr=$(echo $ipaddr | sed "s/\(\([0-9]\{1,3\}\.\)\{2\}\)[0-9]\{1,3\}/\1${subnet}/")
|
||||
|
||||
config_load firewall
|
||||
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local new_name=$2
|
||||
local val=$3
|
||||
local name
|
||||
|
||||
config_get name $section $val
|
||||
|
||||
[ "$name" == "$new_name" ] && exists=1
|
||||
}
|
||||
|
||||
config_foreach _process_zone zone $name "name"
|
||||
[ "$exists" == "0" ] && {
|
||||
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='DROP'
|
||||
uci -q set firewall.@zone[-1].output='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].forward='DROP'
|
||||
diff=1
|
||||
}
|
||||
|
||||
exists=0
|
||||
config_foreach _process_zone forwarding $name "src"
|
||||
[ "$exists" == "0" ] && {
|
||||
uci -q add firewall forwarding
|
||||
uci -q set firewall.@forwarding[-1].src="$name"
|
||||
uci -q set firewall.@forwarding[-1].dest="wan"
|
||||
diff=1
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get firewall.${name}_dns)" ] && {
|
||||
uci set firewall.${name}_dns=rule
|
||||
uci set firewall.${name}_dns.name="Allow-DNS-${name}"
|
||||
uci set firewall.${name}_dns.src="${name}"
|
||||
uci set firewall.${name}_dns.dest_port="53"
|
||||
uci set firewall.${name}_dns.proto="tcp udp"
|
||||
uci set firewall.${name}_dns.target="ACCEPT"
|
||||
diff=1
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get firewall.${name}_dhcp)" ] && {
|
||||
uci set firewall.${name}_dhcp=rule
|
||||
uci set firewall.${name}_dhcp.name="Allow-DHCP-${name}"
|
||||
uci set firewall.${name}_dhcp.src="${name}"
|
||||
uci set firewall.${name}_dhcp.src_port="68"
|
||||
uci set firewall.${name}_dhcp.dest_port="67"
|
||||
uci set firewall.${name}_dhcp.proto="udp"
|
||||
uci set firewall.${name}_dhcp.family="ipv4"
|
||||
uci set firewall.${name}_dhcp.target="ACCEPT"
|
||||
diff=1
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get firewall.${name}_ping)" ] && {
|
||||
uci set firewall.${name}_ping=rule
|
||||
uci set firewall.${name}_ping.name="Allow-Ping-${name}"
|
||||
uci set firewall.${name}_ping.src="${name}"
|
||||
uci set firewall.${name}_ping.dest_ip="${ipaddr}"
|
||||
uci set firewall.${name}_ping.proto="icmp"
|
||||
uci set firewall.${name}_ping.icmp_type="echo-request"
|
||||
uci set firewall.${name}_ping.family="ipv4"
|
||||
uci set firewall.${name}_ping.target="ACCEPT"
|
||||
diff=1
|
||||
}
|
||||
|
||||
[ $diff -eq 1 ] && uci -q commit firewall
|
||||
}
|
||||
|
||||
_net_setup() {
|
||||
net_check_for_vlan() {
|
||||
local section=$1
|
||||
local vid=$2
|
||||
|
||||
config_get vlan "$section" vlan
|
||||
|
||||
[ "$vid" = "$vlan" ] && {
|
||||
echo "1"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
net_check_for_network() {
|
||||
local section=$1
|
||||
local vid=$2
|
||||
|
||||
config_get device "$section" device
|
||||
|
||||
[ "${AL_BRIDGE}.$vid" = "$device" ] && {
|
||||
echo "1"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
local vid=$1
|
||||
diff=""
|
||||
|
||||
config_load network
|
||||
|
||||
local name="vlan${vid}"
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local tag=":t"
|
||||
local self_flags="untagged"
|
||||
local map_ports="$(map_get_ports)"
|
||||
|
||||
# add bridge-vlan section for $vid if doesnt exist
|
||||
exists=$(config_foreach net_check_for_vlan bridge-vlan $vid)
|
||||
[ -z "$exists" ] && {
|
||||
uci -q set network.${name}="bridge-vlan"
|
||||
uci -q set network.${name}.name="${name}"
|
||||
uci -q set network.${name}.device="$AL_BRIDGE"
|
||||
uci -q set network.${name}.vlan="$vid"
|
||||
}
|
||||
|
||||
# guest vids are trunked
|
||||
[ "${vid}" = "${PRIMARY_VID}" ] && {
|
||||
# self_flags="untagged pvid"
|
||||
uci -q set network.${name}.flags="untagged pvid"
|
||||
tag=":*"
|
||||
}
|
||||
uci -q set network.${name}.local='1'
|
||||
|
||||
|
||||
uci -q delete network.${name}.ports
|
||||
# support tagging for all map_port
|
||||
for port in $map_ports ; do
|
||||
uci -q get network.${name}.ports | grep -q "${port}" && {
|
||||
uci -q del_list network.${name}.ports="${port}"
|
||||
}
|
||||
uci -q add_list network.${name}.ports="${port}${tag}"
|
||||
done
|
||||
|
||||
# non-map ports add PVID egress untagged
|
||||
[ "${vid}" = "${PRIMARY_VID}" ] && {
|
||||
for port in $(uci -q get network.${br_dev}.ports) ; do
|
||||
uci -q get network.${name}.ports | grep -q "${port}" && continue
|
||||
uci -q add_list network.${name}.ports="${port}"
|
||||
done
|
||||
}
|
||||
|
||||
uci -q commit network
|
||||
diff="1"
|
||||
|
||||
# add interface sections for subinterface if doesnt exist
|
||||
exists=$(config_foreach net_check_for_network interface $vid)
|
||||
[ -z "$exists" -a "$PRIMARY_VID" != "$vid" -a -x "/usr/sbin/mapcontroller" ] && {
|
||||
local name="guest${vid}"
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local tag=":t"
|
||||
local self_flags="untagged"
|
||||
local subnet=$(($vid % 256))
|
||||
|
||||
netmask="255.255.255.0"
|
||||
ipaddr="192.168.1.1"
|
||||
|
||||
config_load network
|
||||
config_foreach net_get_albridge_ip interface $PRIMARY_VID
|
||||
|
||||
# replace third octet of the ip with $subnet
|
||||
ipaddr=$(echo $ipaddr | sed "s/\(\([0-9]\{1,3\}\.\)\{2\}\)[0-9]\{1,3\}/\1${subnet}/")
|
||||
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="${AL_BRIDGE}.$vid"
|
||||
uci -q set network.${name}.ipaddr="$ipaddr"
|
||||
uci -q set network.${name}.netmask="$netmask"
|
||||
uci -q set network.${name}.proto="static"
|
||||
|
||||
uci -q commit network
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get network.guest${vid}_8021q)" -a $PRIMARY_VID != $vid ] && {
|
||||
uci -q set network.guest${vid}_8021q="device"
|
||||
uci -q set network.guest${vid}_8021q.ifname="${AL_BRIDGE}"
|
||||
uci -q set network.guest${vid}_8021q.name="${AL_BRIDGE}.$vid"
|
||||
uci -q set network.guest${vid}_8021q.type="8021q"
|
||||
uci -q set network.guest${vid}_8021q.vid="$vid"
|
||||
uci -q set network.guest${vid}_8021q.native="1"
|
||||
}
|
||||
}
|
||||
|
||||
vid=$1
|
||||
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
VID required to configure.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
logger -t vlan "setup ts vid $vid"
|
||||
_net_setup ${vid}
|
||||
|
||||
[ -x "/usr/sbin/mapcontroller" -a "$PRIMARY_VID" != "$vid" ] && {
|
||||
_dhcp_setup guest${vid}
|
||||
_firewall_setup guest${vid} $vid
|
||||
}
|
||||
|
||||
# Disable pktfwd here and flush FlowCache rules
|
||||
echo 0 > /proc/pktfwd_dhd/enable
|
||||
echo 0 > /proc/pktfwd_wl/enable
|
||||
fcctl flush
|
||||
}
|
||||
|
||||
ts_reload() {
|
||||
# TODO check it again
|
||||
local dhcp_reload=$1
|
||||
restart=""
|
||||
|
||||
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_load network
|
||||
config_foreach bridge_verify_vid_mapping bridge-vlan
|
||||
|
||||
|
||||
[ -n "dhcp_reload" ] && /etc/init.d/dnsmasq reload
|
||||
if [ "$restart" = "1" ]; then
|
||||
ts_dbg "trigger network restart"
|
||||
/etc/init.d/network restart
|
||||
else
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
fi
|
||||
/etc/init.d/firewall reload
|
||||
|
||||
#for sink in $(ubus list network.interface.sink*) ; do
|
||||
# local sink_vlan=${sink/network.interface./}_vlan
|
||||
#done
|
||||
}
|
||||
|
||||
# maintain VIDs passed as args in network config, remove rest
|
||||
ts_keep() {
|
||||
local al_bridge=$(uci -q get mapagent.agent.al_bridge)
|
||||
restart=""
|
||||
|
||||
[ "$al_bridge" = "" ] && al_bridge="br-lan"
|
||||
|
||||
bridge_vlan_teardown() {
|
||||
local section=$1
|
||||
shift
|
||||
local bridge=$1
|
||||
shift
|
||||
local keep="$@"
|
||||
|
||||
config_get device "$section" device
|
||||
|
||||
[ "$bridge" != "$device" ] && continue
|
||||
|
||||
config_get vlan "$section" vlan
|
||||
|
||||
for i in $@; do
|
||||
if [ "$i" -eq "$vlan" ] ; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
restart="1"
|
||||
_guest_cleanup $vlan
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach bridge_vlan_teardown bridge-vlan $al_bridge $@
|
||||
|
||||
if [ "$restart" = "1" ]; then
|
||||
uci commit network
|
||||
ts_dbg "trigger network restart"
|
||||
/etc/init.d/network restart
|
||||
fi
|
||||
}
|
||||
|
||||
ts_cleanup() {
|
||||
guest_teardown() {
|
||||
local section=$1
|
||||
local config=$2
|
||||
local val=$3
|
||||
local option=$4
|
||||
|
||||
config_get name "$section" "$option"
|
||||
|
||||
[ "$val" != "$name" ] && continue
|
||||
|
||||
uci delete ${config}.${section}
|
||||
uci commit ${config}
|
||||
restart="1"
|
||||
}
|
||||
local vid=$1
|
||||
restart=""
|
||||
|
||||
_guest_cleanup $vid
|
||||
|
||||
# enable pktfwd again and flush FlowCache rules
|
||||
echo 1 > /proc/pktfwd_dhd/enable
|
||||
echo 1 > /proc/pktfwd_wl/enable
|
||||
echo 0 > /proc/pktfwd_dhd/enable
|
||||
echo 0 > /proc/pktfwd_wl/enable
|
||||
echo 1 > /proc/pktfwd_dhd/enable
|
||||
echo 1 > /proc/pktfwd_wl/enable
|
||||
fcctl flush
|
||||
}
|
||||
|
||||
ts_isolate_wds() {
|
||||
local action=$1 # add/del
|
||||
local ifname=$2 # guest fbss name
|
||||
local wds=$3 # 4addr interface name or prefix+
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local map_ports="$(map_get_ports)"
|
||||
local all_ports=$(uci -q get network.${br_dev}.ports)
|
||||
|
||||
[ -z "$wds" -o -z "$ifname" ] && return
|
||||
|
||||
ebtables -D FORWARD -i $ifname -o $wds -j DROP > /dev/null 2>&1
|
||||
ebtables -D FORWARD -i $wds -o $ifname -j DROP > /dev/null 2>&1
|
||||
ebtables -D FORWARD -i $wds -o $wds -p 802_1Q --vlan-id ! $PRIMARY_VID -j DROP > /dev/null 2>&1
|
||||
|
||||
# must not drop traffic to upstream
|
||||
json_load "$(cat $MAP_BH_FILE)"
|
||||
json_get_var bk_ifname ifname
|
||||
json_cleanup
|
||||
|
||||
# isolate eth map ports
|
||||
for port in $all_ports ; do
|
||||
ebtables -D FORWARD -i $wds -o $port -j DROP > /dev/null 2>&1
|
||||
ebtables -D FORWARD -i $port -o $wds -j DROP > /dev/null 2>&1
|
||||
done
|
||||
|
||||
[ "$action" != "add" ] && return
|
||||
|
||||
for port in $map_ports ; do
|
||||
[ "$port" = "$bk_ifname" ] && continue
|
||||
ebtables -A FORWARD -i $wds -o $port -j DROP > /dev/null 2>&1
|
||||
ebtables -A FORWARD -i $port -o $wds -j DROP > /dev/null 2>&1
|
||||
done
|
||||
|
||||
ebtables -A FORWARD -i $ifname -o $wds -j DROP > /dev/null 2>&1
|
||||
ebtables -A FORWARD -i $wds -o $ifname -j DROP > /dev/null 2>&1
|
||||
ebtables -A FORWARD -i $wds -o $wds -p 802_1Q --vlan-id ! $PRIMARY_VID -j DROP > /dev/null 2>&1
|
||||
}
|
||||
|
||||
ts_isolate_ap() {
|
||||
ts_isolate_radio() {
|
||||
local section=$1
|
||||
local action=$2
|
||||
local band=$3
|
||||
local vid=$4
|
||||
local ifname=$5
|
||||
|
||||
config_get apband "$section" band
|
||||
[ "$band" = "$apband" ] && continue
|
||||
|
||||
config_get apvid "$section" vid
|
||||
[ "$vid" != "$apvid" ] && continue
|
||||
|
||||
config_get apifname "$section" ifname
|
||||
[ "$ifname" = "$apifname" ] && continue # this should never happen
|
||||
|
||||
ebtables -D FORWARD -i $ifname -o $apifname -j DROP > /dev/null 2>&1
|
||||
|
||||
[ "$action" != "add" ] && continue
|
||||
|
||||
ebtables -A FORWARD -i $ifname -o $apifname -j DROP > /dev/null 2>&1
|
||||
}
|
||||
local action=$1
|
||||
shift
|
||||
local pvid=$1 # pvid
|
||||
shift
|
||||
local vid=$1 # vid
|
||||
shift
|
||||
local band=$1 # band
|
||||
shift
|
||||
local ifname=$1 # guest fbss name
|
||||
shift
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local map_ports="$(map_get_ports)"
|
||||
local all_ports=$(uci -q get network.${br_dev}.ports)
|
||||
|
||||
[ -z "$pvid" -o -z "$ifname" ] && return
|
||||
|
||||
config_load mapagent
|
||||
config_foreach ts_isolate_radio ap $action $band $vid $ifname
|
||||
|
||||
# must not drop traffic to upstream
|
||||
json_load "$(cat $MAP_BH_FILE)"
|
||||
json_get_var bk_ifname ifname
|
||||
json_cleanup
|
||||
|
||||
# isolate eth map ports
|
||||
for port in $all_ports ; do
|
||||
ebtables -D FORWARD -i $ifname -o $port -j DROP > /dev/null 2>&1
|
||||
ebtables -D FORWARD -i $port -o $ifname -j DROP > /dev/null 2>&1
|
||||
done
|
||||
|
||||
[ "$action" != "add" ] && return
|
||||
|
||||
for port in $map_ports ; do
|
||||
[ "$port" = "$bk_ifname" ] && continue
|
||||
ebtables -A FORWARD -i $ifname -o $port -j DROP > /dev/null 2>&1
|
||||
ebtables -A FORWARD -i $port -o $ifname -j DROP > /dev/null 2>&1
|
||||
done
|
||||
}
|
||||
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
create) ts_dbg "create $@"; ts_create $@;;
|
||||
keep) ts_dbg "keep $@"; ts_keep $@;;
|
||||
reload) ts_dbg "reload $@"; ts_reload $@;;
|
||||
cleanup) ts_dbg "cleanup $@"; ts_cleanup $@;;
|
||||
isolate_ap) ts_dbg "isolate_ap $@"; ts_isolate_ap $@;;
|
||||
isolate_wds) ts_dbg "isolate_wds $@"; ts_isolate_wds $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=2.11.0.5
|
||||
PKG_VERSION:=2.8.0.26
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=74c86c5468a5f42421e382eb90a53a643a2e6655
|
||||
PKG_SOURCE_VERSION:=c9661b55bd77de4769dabc8167530a9b4f8b1dd2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -38,7 +38,6 @@ 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
|
||||
@@ -51,6 +50,7 @@ endif
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
define Package/map-controller/install
|
||||
|
||||
@@ -6,8 +6,9 @@ config controller 'controller'
|
||||
option enable_bsta_steer '0'
|
||||
option use_bcn_metrics '0'
|
||||
option use_usta_metrics '0'
|
||||
option primary_vid '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
option enable_ts '0'
|
||||
option allow_bgdfs '0'
|
||||
option channel_plan '0'
|
||||
|
||||
|
||||
@@ -26,7 +26,11 @@ validate_controller_section() {
|
||||
'use_usta_metrics:bool:false' \
|
||||
'allow_bgdfs:range(0,2629744)' \
|
||||
'channel_plan:range(0,2629744)' \
|
||||
'enable_ts:bool:false'
|
||||
'enable_ts:bool:false' \
|
||||
'rcpi_threshold_2g:range(0,220)' \
|
||||
'rcpi_threshold_5g:range(0,220)' \
|
||||
'report_rcpi_threshold_2g:range(0,220)' \
|
||||
'report_rcpi_threshold_5g:range(0,220)'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapcontroller" "Validation of controller section failed"
|
||||
@@ -40,10 +44,13 @@ validate_ap_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapcontroller $section "${1}" \
|
||||
'band:or("2", "5", "6")' \
|
||||
'band:or("2", "5")' \
|
||||
'ssid:string' \
|
||||
'encryption:or("sae", "sae+aes", "psk2",
|
||||
"psk2+aes", "sae-mixed", "sae-mixed+aes")' \
|
||||
"psk2+aes", "sae-mixed", "sae-mixed+aes",
|
||||
"none", "psk-mixed", "psk-mixed+aes",
|
||||
"wpa", "wpa+aes", "wpa2", "wpa2+aes",
|
||||
"psk", "psk+aes")' \
|
||||
'key:string' \
|
||||
'vid:range(1,65535):1' \
|
||||
'type:or("backhaul", "fronthaul", "combined")' \
|
||||
|
||||
@@ -18,5 +18,9 @@ config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI
|
||||
enabled through TOPOLOGYD_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
config TOPOLOGYD_ACTIVE_CONN_LIBCONNTRACK
|
||||
bool "Support active connection fetch using netlink"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=2.5.1.4
|
||||
PKG_VERSION:=2.5.0.19
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=488ce1ce576b57c9b3c4d7c034969bf65e66216f
|
||||
PKG_SOURCE_VERSION:=369df96b1abab0be5019e164cf63f00f7153730c
|
||||
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
|
||||
@@ -36,7 +36,6 @@ define Package/map-topology/config
|
||||
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 \
|
||||
@@ -48,6 +47,10 @@ endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_ACTIVE_CONN_LIBCONNTRACK),y)
|
||||
TARGET_CFLAGS += -DACTIVE_CONN_LIBCONNTRACK
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
endif
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
config global 'global'
|
||||
option ageing_timer '1440'
|
||||
option reboot_persistent '0'
|
||||
list ifname 'br-lan'
|
||||
option ifname 'br-lan'
|
||||
|
||||
@@ -24,7 +24,8 @@ validate_topology_config() {
|
||||
validate_global_section() {
|
||||
uci_validate_section hosts global "global" \
|
||||
'ageing_timer:uinteger' \
|
||||
'reboot_persistent:bool'
|
||||
'reboot_persistent:bool' \
|
||||
'ifname:string'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "hosts" "Validation of global section failed"
|
||||
@@ -71,6 +72,9 @@ start_service() {
|
||||
config_load "hosts"
|
||||
validate_hosts_config || return 1;
|
||||
|
||||
if [ -f "/proc/sys/net/netfilter/nf_conntrack_timestamp" ]; then
|
||||
echo 1 >/proc/sys/net/netfilter/nf_conntrack_timestamp
|
||||
fi
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/topologyd"
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=6.0.0.1
|
||||
PKG_VERSION:=5.0.0.16.7
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=6477337ec0d5dd6fa5586b42ba6423a892643106
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_SOURCE_VERSION:=6372841ada18a4f577799fedb19f489ec1f28255
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -91,6 +91,7 @@ endif
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
|
||||
$(Build/Patch)
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -100,7 +101,6 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(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/
|
||||
@@ -108,7 +108,6 @@ define Package/obuspa/install
|
||||
$(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
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
@@ -1,17 +1,30 @@
|
||||
config obuspa 'global'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option interface 'loopback'
|
||||
#option ifname 'lo'
|
||||
option debug '0'
|
||||
option log_level '1'
|
||||
option prototrace '1'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
option prototrace '0'
|
||||
#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 'agent_mtp'
|
||||
config mtp
|
||||
option Protocol 'MQTT'
|
||||
option ResponseTopicConfigured '/usp/endpoint'
|
||||
option mqtt 'localmqtt'
|
||||
@@ -22,30 +35,13 @@ 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 'sub_event'
|
||||
# option ID 'uci-sub-events'
|
||||
# option NotifType 'Event'
|
||||
# list ReferenceList 'Device.Boot!'
|
||||
# list ReferenceList 'Device.LocalAgent.TransferComplete!'
|
||||
# option Persistent 'true'
|
||||
# option controller 'localcontroller'
|
||||
|
||||
#config subscription 'sub_op_comp'
|
||||
# option ID 'uci-sub-op_complete'
|
||||
# option NotifType 'OperationComplete'
|
||||
# list ReferenceList 'Device.DeviceInfo.FirmwareImage.*.Download()'
|
||||
# list ReferenceList 'Device.DeviceInfo.FirmwareImage.*.Activate()'
|
||||
# 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,7 +1,8 @@
|
||||
{
|
||||
"dmcaching_exclude": [
|
||||
"Device.DeviceInfo.ProcessStatus.Process.",
|
||||
"Device.InterfaceStack.",
|
||||
"Device.Hosts.Host.",
|
||||
"Device.IEEE1905.",
|
||||
"Device.WiFi.DataElements."
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
fix_stomp_section() {
|
||||
local encryption
|
||||
|
||||
config_get_bool encryption $1 encryption ""
|
||||
if [ -n "${encryption}" ]; then
|
||||
uci_set obuspa $1 encryption ""
|
||||
uci_set obuspa $1 EnableEncryption "$encryption"
|
||||
fi
|
||||
}
|
||||
|
||||
# fix the stomp encryption parameter
|
||||
config_load obuspa
|
||||
config_foreach fix_stomp_section stomp
|
||||
uci_commit
|
||||
@@ -1,140 +0,0 @@
|
||||
diff --git a/src/core/device.h b/src/core/device.h
|
||||
index adf8fa6..072f953 100644
|
||||
--- a/src/core/device.h
|
||||
+++ b/src/core/device.h
|
||||
@@ -111,6 +111,7 @@ typedef struct
|
||||
// Following member variables only set if USP message was received over MQTT
|
||||
int mqtt_instance;
|
||||
char *mqtt_topic; // only set if reply_to was specified in the received MQTT packet
|
||||
+ char *mqtt_topic_recv;
|
||||
|
||||
|
||||
// Following member variables only set if USP message was received over CoAP
|
||||
@@ -252,7 +253,7 @@ void DEVICE_MTP_NotifyMqttConnDeleted(int mqtt_instance);
|
||||
int DEVICE_MTP_ValidateMqttReference(dm_req_t *req, char *value);
|
||||
void DEVICE_CONTROLLER_SetRolesFromMqtt(int mqtt_instance, ctrust_role_t role);
|
||||
char *DEVICE_CONTROLLER_GetControllerTopic(int mqtt_instance);
|
||||
-
|
||||
+int validate_controller_topic_by_endpointid(char *endpointid, mtp_protocol_t proto, char *recv_topic);
|
||||
//------------------------------------------------------------------------------
|
||||
// Tables used to convert to/from an enumeration to/from a string
|
||||
extern const enum_entry_t mtp_protocols[kMtpProtocol_Max];
|
||||
diff --git a/src/core/device_controller.c b/src/core/device_controller.c
|
||||
index 62c803f..103388d 100755
|
||||
--- a/src/core/device_controller.c
|
||||
+++ b/src/core/device_controller.c
|
||||
@@ -239,6 +239,41 @@ int Async_E2ESessionReset(dm_req_t *req, kv_vector_t *input_args, int request);
|
||||
extern const enum_entry_t e2e_session_modes[kE2EMode_Max];
|
||||
#endif
|
||||
|
||||
+
|
||||
+int validate_controller_topic_by_endpointid(char *endpointid, mtp_protocol_t proto, char *recv_topic)
|
||||
+{
|
||||
+ controller_t *cont = FindEnabledControllerByEndpointId(endpointid);
|
||||
+ if (cont == NULL)
|
||||
+ {
|
||||
+ USP_LOG_Error("not able to find the controller from endpointid [%s]", endpointid);
|
||||
+ return USP_ERR_PERMISSION_DENIED;
|
||||
+ }
|
||||
+#ifdef ENABLE_MQTT
|
||||
+ if (proto == kMtpProtocol_MQTT)
|
||||
+ {
|
||||
+ controller_mtp_t *mtp = FindFirstEnabledMtp(cont, proto);
|
||||
+
|
||||
+ if (mtp == NULL) {
|
||||
+ USP_LOG_Error("Not able to find mtp[%d] for endpointid [%s]", proto, endpointid);
|
||||
+ return USP_ERR_REQUEST_DENIED;
|
||||
+ }
|
||||
+
|
||||
+ if (mtp->protocol != proto) {
|
||||
+ USP_LOG_Error("No matching mtp[%d] for endpointid [%s]", proto, endpointid);
|
||||
+ return USP_ERR_REQUEST_DENIED;
|
||||
+ }
|
||||
+
|
||||
+ char *response_topic = DEVICE_MTP_GetAgentMqttResponseTopic(mtp->mqtt_connection_instance);
|
||||
+ if (response_topic && strcmp(response_topic, recv_topic) != 0 ) {
|
||||
+ USP_LOG_Error("Controller response topic[%s] and recv topic[%s] mismatch, probably a spoof message", response_topic, recv_topic);
|
||||
+ return USP_ERR_PERMISSION_DENIED;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ return USP_ERR_OK;
|
||||
+}
|
||||
+
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DEVICE_CONTROLLER_Init
|
||||
diff --git a/src/core/dm_exec.c b/src/core/dm_exec.c
|
||||
index c0b95d8..6eb51e2 100755
|
||||
--- a/src/core/dm_exec.c
|
||||
+++ b/src/core/dm_exec.c
|
||||
@@ -624,6 +624,7 @@ void DM_EXEC_PostUspRecord(unsigned char *pbuf, int pbuf_len, ctrust_role_t role
|
||||
pur->mtp_reply_to.coap_encryption = mrt->coap_encryption;
|
||||
pur->mtp_reply_to.coap_reset_session_hint = mrt->coap_reset_session_hint;
|
||||
pur->mtp_reply_to.mqtt_topic = USP_STRDUP(mrt->mqtt_topic);
|
||||
+ pur->mtp_reply_to.mqtt_topic_recv = USP_STRDUP(mrt->mqtt_topic_recv);
|
||||
pur->mtp_reply_to.mqtt_instance = mrt->mqtt_instance;
|
||||
pur->mtp_reply_to.wsclient_cont_instance = mrt->wsclient_cont_instance;
|
||||
pur->mtp_reply_to.wsclient_mtp_instance = mrt->wsclient_mtp_instance;
|
||||
@@ -1144,6 +1145,7 @@ void ProcessMessageQueueSocketActivity(socket_set_t *set)
|
||||
USP_SAFE_FREE(mrt->coap_resource);
|
||||
USP_SAFE_FREE(mrt->mqtt_topic);
|
||||
USP_SAFE_FREE(mrt->cont_endpoint_id);
|
||||
+ USP_SAFE_FREE(mrt->mqtt_topic_recv);
|
||||
break;
|
||||
|
||||
#ifndef DISABLE_STOMP
|
||||
diff --git a/src/core/mqtt.c b/src/core/mqtt.c
|
||||
index 7dba9f4..3ee9c97 100644
|
||||
--- a/src/core/mqtt.c
|
||||
+++ b/src/core/mqtt.c
|
||||
@@ -3141,6 +3141,7 @@ void ReceiveMqttMessage(mqtt_client_t *client, const struct mosquitto_message *m
|
||||
mrt.mqtt_topic = response_topic;
|
||||
}
|
||||
|
||||
+ mrt.mqtt_topic_recv = message->topic;
|
||||
// Message may not be valid USP
|
||||
DM_EXEC_PostUspRecord(message->payload, message->payloadlen, client->role, &mrt);
|
||||
}
|
||||
diff --git a/src/core/msg_handler.c b/src/core/msg_handler.c
|
||||
index ce67626..4af9ade 100644
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -118,7 +118,7 @@ static enum_entry_t mtp_content_types[] = {
|
||||
//------------------------------------------------------------------------------
|
||||
// Forward declarations. Note these are not static, because we need them in the symbol table for USP_LOG_Callstack() to show them
|
||||
int HandleUspMessage(Usp__Msg *usp, char *controller_endpoint, mtp_reply_to_t *mrt);
|
||||
-int ValidateUspRecord(UspRecord__Record *rec);
|
||||
+int ValidateUspRecord(UspRecord__Record *rec, mtp_reply_to_t *mrt);
|
||||
char *MtpSendItemToString(mtp_send_item_t *msi);
|
||||
void CacheControllerRoleForCurMsg(char *endpoint_id, ctrust_role_t role, mtp_protocol_t protocol);
|
||||
int QueueUspNoSessionRecord(usp_send_item_t *usi, char *endpoint_id, char *usp_msg_id, mtp_reply_to_t *mrt, time_t expiry_time);
|
||||
@@ -172,7 +172,7 @@ int MSG_HANDLER_HandleBinaryRecord(unsigned char *pbuf, int pbuf_len, ctrust_rol
|
||||
#endif
|
||||
|
||||
// Exit if USP record failed validation
|
||||
- err = ValidateUspRecord(rec);
|
||||
+ err = ValidateUspRecord(rec, mrt);
|
||||
if (err != USP_ERR_OK)
|
||||
{
|
||||
goto exit;
|
||||
@@ -725,7 +725,7 @@ exit:
|
||||
** \return USP_ERR_OK if record is valid
|
||||
**
|
||||
**************************************************************************/
|
||||
-int ValidateUspRecord(UspRecord__Record *rec)
|
||||
+int ValidateUspRecord(UspRecord__Record *rec, mtp_reply_to_t *mrt)
|
||||
{
|
||||
char *endpoint_id;
|
||||
|
||||
@@ -806,6 +806,9 @@ int ValidateUspRecord(UspRecord__Record *rec)
|
||||
return USP_ERR_REQUEST_DENIED;
|
||||
}
|
||||
|
||||
+#if OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
+ return validate_controller_topic_by_endpointid(rec->from_id, mrt->protocol, mrt->mqtt_topic_recv);
|
||||
+#endif
|
||||
// If the code gets here, then the USP record passed validation, and the encapsulated USP message may be processed
|
||||
return USP_ERR_OK;
|
||||
}
|
||||
42
obuspa/patches/0002-supress-group-get-error.patch
Normal file
42
obuspa/patches/0002-supress-group-get-error.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
--- a/src/core/cli_server.c
|
||||
+++ b/src/core/cli_server.c
|
||||
@@ -733,10 +733,6 @@ int ExecuteCli_Get(char *arg1, char *arg
|
||||
USP_ASSERT(gge->value != NULL);
|
||||
SendCliResponse("%s => %s\n", gge->path, gge->value);
|
||||
}
|
||||
- else
|
||||
- {
|
||||
- SendCliResponse("ERROR: %d retrieving %s (%s)\n", gge->err_code, gge->path, gge->err_msg);
|
||||
- }
|
||||
}
|
||||
|
||||
GROUP_GET_VECTOR_Destroy(&ggv);
|
||||
--- a/src/core/handle_get.c
|
||||
+++ b/src/core/handle_get.c
|
||||
@@ -252,24 +252,14 @@ void FormPathExprResponse(int get_expr_i
|
||||
return;
|
||||
}
|
||||
|
||||
- // If there was an error in getting any of the parameters associated with the path expression,
|
||||
- // then just add the first error, without any of the parameter values, for this path expression result
|
||||
- for (i=0; i < gi->num_entries; i++)
|
||||
- {
|
||||
- gge = &ggv->vector[gi->index + i];
|
||||
- if (gge->err_code != USP_ERR_OK)
|
||||
- {
|
||||
- (void)AddGetResp_ReqPathRes(resp, path_expr, gge->err_code, gge->err_msg);
|
||||
- return;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
// If the code gets here, then the value of all parameters were retrieved successfully, so add their values to the result_params
|
||||
req_path_result = AddGetResp_ReqPathRes(resp, path_expr, USP_ERR_OK, "");
|
||||
for (i=0; i < gi->num_entries; i++)
|
||||
{
|
||||
gge = &ggv->vector[gi->index + i];
|
||||
|
||||
+ if (gge->err_code != USP_ERR_OK)
|
||||
+ continue;
|
||||
#ifdef GET_RESPONSE_SIMPLE_FORMAT
|
||||
// Simple format contains a resolved_path_result for every object (and sub object)
|
||||
AddResolvedPathResult(req_path_result, gge->path, gge->value, 0);
|
||||
20
obuspa/patches/0004-suppress-notification-logs.patch
Normal file
20
obuspa/patches/0004-suppress-notification-logs.patch
Normal file
@@ -0,0 +1,20 @@
|
||||
--- a/src/core/data_model.c
|
||||
+++ b/src/core/data_model.c
|
||||
@@ -1239,7 +1239,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
// Exit if instance already exists - nothing to do
|
||||
if (exists)
|
||||
{
|
||||
- USP_ERR_SetMessage("%s: Object (%s) already exists in the data model", __FUNCTION__, path);
|
||||
+ // USP_ERR_SetMessage("%s: Object (%s) already exists in the data model", __FUNCTION__, path);
|
||||
return USP_ERR_CREATION_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1324,7 +1324,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
// Exit if instance does not exist - nothing to do
|
||||
if (exists == false)
|
||||
{
|
||||
- USP_ERR_SetMessage("%s: Object (%s) does not exist in the data model", __FUNCTION__, path);
|
||||
+ // USP_ERR_SetMessage("%s: Object (%s) does not exist in the data model", __FUNCTION__, path);
|
||||
return USP_ERR_OBJECT_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.2.1
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -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
|
||||
|
||||
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ponmngr
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
@@ -17,12 +17,11 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ponmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=PON Manager
|
||||
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_econet)
|
||||
TITLE:=ponmngr packets manager daemon
|
||||
endef
|
||||
|
||||
define Package/ponmngr/description
|
||||
Configures PON
|
||||
Configures pon
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
@@ -33,12 +32,7 @@ define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/ponmngr/install
|
||||
$(CP) ./files/common/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),)
|
||||
$(CP) ./files/broadcom/* $(1)/
|
||||
else ifneq ($(CONFIG_TARGET_iopsys_econet),)
|
||||
$(CP) ./files/airoha/* $(1)/
|
||||
endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ponmngr))
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_serial_number() {
|
||||
vendor_id=$1
|
||||
vssn=$2
|
||||
|
||||
/userfs/bin/omcicfgCmd set sn ${vendor_id}${vssn}
|
||||
}
|
||||
|
||||
init_xpon() {
|
||||
procd_open_instance ponmgr_cfg
|
||||
procd_set_param command /userfs/bin/ponmgr_cfg
|
||||
procd_close_instance
|
||||
procd_open_instance omci
|
||||
procd_set_param command /userfs/bin/omci
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
deinit_xpon() {
|
||||
killall -9 omci 2>/dev/null
|
||||
killall -9 ponmgr_cfg 2>/dev/null
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/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
|
||||
@@ -9,14 +9,16 @@ USE_PROCD=1
|
||||
include /lib/xpon
|
||||
|
||||
configure_serial_number() {
|
||||
# serial number generation is taken care in the uci defaults, so if
|
||||
# serial number is not found here its a misconfig
|
||||
serial_number="$(uci -q get xpon.ani.serial_number)"
|
||||
if [ ${#serial_number} -eq 12 ]; then
|
||||
vendor_id="${serial_number:0:4}"
|
||||
vssn="${serial_number:4:8}"
|
||||
else
|
||||
macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
vendor_id="IOPS"
|
||||
vssn="${macaddr:4:8}"
|
||||
logger -s -t "xpon" "Serial number not found in uci, ont will probably not be registered at the olt"
|
||||
logger -s -t "xpon" "Please configure a valid serial number"
|
||||
return
|
||||
fi
|
||||
|
||||
set_serial_number $vendor_id $vssn
|
||||
34
ponmngr/files/etc/uci-defaults/60-xpon-generate
Executable file
34
ponmngr/files/etc/uci-defaults/60-xpon-generate
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
configure_serial_number() {
|
||||
# check if serial number is present in the production data
|
||||
production_sn="$(fw_printenv -n gponsn)"
|
||||
if [ ${#production_sn} -eq 12 ]; then
|
||||
uci set xpon.ani.serial_number=$production_sn
|
||||
else
|
||||
macaddr="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
vendor_id="IOPS"
|
||||
vssn="${macaddr:4:8}"
|
||||
uci set xpon.ani.serial_number=$vendor_id$vssn
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/xpon" ]; then
|
||||
if uci -q get xpon.ani >/dev/null; then
|
||||
# generate serial number in case its not present and return
|
||||
serial_number="$(uci -q get xpon.ani.serial_number)"
|
||||
if [ ${#serial_number} -ne 12 ]; then
|
||||
configure_serial_number
|
||||
fi
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/xpon
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/xpon
|
||||
|
||||
uci set xpon.ani=ani
|
||||
uci set xpon.ani.enable="1"
|
||||
configure_serial_number
|
||||
|
||||
@@ -30,25 +30,17 @@ populate_config_from_db() {
|
||||
}
|
||||
|
||||
populate_config_from_device_tree() {
|
||||
for path in $(find /proc/device-tree/ -name "port@*"); do
|
||||
port="$(cat $path/label)"
|
||||
for port in $(find /proc/device-tree/ -name "port@*"); do
|
||||
port="$(cat $port/label)"
|
||||
[ -n "$port" ] || continue
|
||||
[ "$port" = "cpu" ] && continue
|
||||
speed=1000
|
||||
if [ -e "$path/phy-mode" ]; then
|
||||
phymode="$(cat $path/phy-mode)"
|
||||
case "$phymode" in
|
||||
10000*) speed=10000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
esac
|
||||
fi
|
||||
PORT="$(echo $port | tr '[a-z]' '[A-Z]')"
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$PORT"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$PORT"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].speed=1000
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
@@ -73,7 +65,7 @@ fi
|
||||
|
||||
touch /etc/config/ports
|
||||
|
||||
if [ -f /sbin/db -a -n "$(db get hw.board.ethernetPortOrder 2>/dev/null)" ]; then
|
||||
if [ -f /sbin/db ] && [ -f /etc/board-db/config/hw ]; then
|
||||
populate_config_from_db
|
||||
elif [ -d /proc/device-tree/ ]; then
|
||||
populate_config_from_device_tree
|
||||
|
||||
@@ -27,7 +27,7 @@ define Package/qosmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=QoS Manager
|
||||
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm||TARGET_iopsys_econet) +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos
|
||||
DEPENDS:=@(TARGET_iopsys_brcm63xx_arm) +libuci +libubox +libubus +libblobmsg-json +libjson-c +libqos
|
||||
endef
|
||||
|
||||
define Package/qosmngr/description
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=skopeo
|
||||
PKG_VERSION:=1.9.2
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/containers/skopeo/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=9a321ba75f213e5c46cba7f92073c2437137a56d3140c9ab6e723fb92890f9d0
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
HOST_BUILD_DEPENDS:=golang/host
|
||||
HOST_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/containers/skopeo
|
||||
GO_PKG_BUILD_PKG:=github.com/containers/skopeo/cmd/skopeo
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
GOLANG_PACKAGE_MK:=$(wildcard $(TOPDIR)/feeds/*/lang/golang/golang-package.mk)
|
||||
GOLANG_HOST_PACKAGE_MK:=$(wildcard $(TOPDIR)/feeds/*/lang/golang/golang-host-build.mk)
|
||||
|
||||
# verify that there is only one single file returned
|
||||
ifneq (1,$(words $(GOLANG_PACKAGE_MK)))
|
||||
ifeq (0,$(words $(GOLANG_PACKAGE_MK)))
|
||||
$(error did not find golang-package.mk in any feed)
|
||||
else
|
||||
$(error found multiple golang-package.mk files in the feeds)
|
||||
endif
|
||||
else
|
||||
$(info found golang-package.mk at $(GOLANG_PACKAGE_MK))
|
||||
endif
|
||||
|
||||
include $(GOLANG_PACKAGE_MK)
|
||||
include $(GOLANG_HOST_PACKAGE_MK)
|
||||
|
||||
define Package/skopeo
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Command line utility for container image management
|
||||
URL:=https://github.com/containers/skopeo
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/skopeo/description
|
||||
skopeo is a command line utility that performs various operations on container images and image repositories.
|
||||
endef
|
||||
|
||||
define Package/skopeo/conffiles
|
||||
/etc/containers/policy.json
|
||||
endef
|
||||
|
||||
GO_PKG_TAGS=exclude_graphdriver_devicemapper,exclude_graphdriver_btrfs,containers_image_openpgp
|
||||
GO_PKG_BUILD_VARS += GO111MODULE=auto
|
||||
|
||||
define Build/Compile
|
||||
$(call GoPackage/Build/Compile)
|
||||
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
|
||||
endef
|
||||
|
||||
define Package/skopeo/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
$(INSTALL_DIR) $(1)/etc/containers
|
||||
$(INSTALL_DATA) ./files/etc/containers/policy.json $(1)/etc/containers/policy.json
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinHostBuild))
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call GoBinPackage,skopeo))
|
||||
$(eval $(call BuildPackage,skopeo))
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"default": [
|
||||
{
|
||||
"type": "insecureAcceptAnything"
|
||||
}
|
||||
],
|
||||
"transports":
|
||||
{
|
||||
"docker-daemon":
|
||||
{
|
||||
"": [{"type":"insecureAcceptAnything"}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
56
ssdpd/Makefile
Normal file
56
ssdpd/Makefile
Normal file
@@ -0,0 +1,56 @@
|
||||
#
|
||||
# Copyright (C) 2022 OpenWrt.org
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ssdpd
|
||||
PKG_VERSION:=1.0.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/miniupnp/miniupnp.git
|
||||
PKG_SOURCE_VERSION:=207cf440a22c075cb55fb067a850be4f9c204e6e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ssdpd
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=+libnfnetlink +libpthread +libubox +libubus +libblobmsg-json +libcurl +mxml
|
||||
TITLE:=MiniSSDPd - SSDP daemon
|
||||
URL:=https://miniupnp.tuxfamily.org/minissdpd.html
|
||||
endef
|
||||
|
||||
MAKE_PATH:=minissdpd
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Wextra -Werror
|
||||
|
||||
TARGET_LDFLAGS += \
|
||||
-lpthread -lubox -lubus -lblobmsg_json -lcurl -lmxml
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/sspd/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ssdpd/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_CONF) ./files/etc/config/ssdpd $(1)/etc/config/ssdpd
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ssdpd $(1)/etc/init.d/ssdpd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/minissdpd/minissdpd $(1)/usr/sbin/ssdpd
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ssdpd))
|
||||
9
ssdpd/files/etc/config/ssdpd
Normal file
9
ssdpd/files/etc/config/ssdpd
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
config ssdpd 'ssdp'
|
||||
option enabled '1'
|
||||
option ipv6_enabled '0'
|
||||
option socket_path '/var/run/minissdpd.sock'
|
||||
option ttl '2'
|
||||
option interface 'br-lan'
|
||||
option debug '0'
|
||||
|
||||
76
ssdpd/files/etc/init.d/ssdpd
Executable file
76
ssdpd/files/etc/init.d/ssdpd
Executable file
@@ -0,0 +1,76 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=02
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ssdpd
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t ssdpd.init -p info
|
||||
}
|
||||
|
||||
validate_ssdpd_ssdp_section()
|
||||
{
|
||||
uci_validate_section ssdpd ssdpd "ssdp" \
|
||||
'enabled:bool:true' \
|
||||
'debug:bool:false' \
|
||||
'ipv6_enabled:bool:false' \
|
||||
'socket_path:string' \
|
||||
'ttl:uinteger' \
|
||||
'interface:string'
|
||||
}
|
||||
|
||||
configure_ssdp()
|
||||
{
|
||||
local enabled ipv6_enabled socket_path ttl interface
|
||||
|
||||
config_load ssdpd
|
||||
|
||||
validate_ssdpd_ssdp_section || {
|
||||
log "Validation of ssdp section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ ${enabled} -eq 0 ] && return 0
|
||||
|
||||
mkdir -p /tmp/ssdp/description/
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
|
||||
if [ ${ipv6_enabled} -eq 1 ]; then
|
||||
procd_append_param command -6
|
||||
fi
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
procd_append_param command -d
|
||||
fi
|
||||
|
||||
if [ -n "${socket_path}" ]; then
|
||||
procd_append_param command -s ${socket_path}
|
||||
fi
|
||||
|
||||
if [ -n "${ttl}" ]; then
|
||||
procd_append_param command -t ${ttl}
|
||||
fi
|
||||
|
||||
# If no interface is given defaults for br-lan
|
||||
procd_append_param command -i ${interface:-br-lan}
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance ssdp
|
||||
configure_ssdp
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "ssdpd"
|
||||
}
|
||||
20
ssdpd/patches/001-fix-gcc-warnings
Normal file
20
ssdpd/patches/001-fix-gcc-warnings
Normal file
@@ -0,0 +1,20 @@
|
||||
--- a/minissdpd/openssdpsocket.c
|
||||
+++ b/minissdpd/openssdpsocket.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
+#include <sys/time.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
--- a/minissdpd/ifacewatch.c
|
||||
+++ b/minissdpd/ifacewatch.c
|
||||
@@ -130,6 +130,7 @@ ProcessInterfaceWatch(int s, int s_ssdp,
|
||||
/* case RTM_DELLINK: */
|
||||
case RTM_DELADDR:
|
||||
is_del = 1;
|
||||
+ // fall through
|
||||
case RTM_NEWADDR:
|
||||
/* http://linux-hacks.blogspot.fr/2009/01/sample-code-to-learn-netlink.html */
|
||||
ifa = (struct ifaddrmsg *)NLMSG_DATA(nlhdr);
|
||||
11
ssdpd/patches/010-add-test-object
Normal file
11
ssdpd/patches/010-add-test-object
Normal file
@@ -0,0 +1,11 @@
|
||||
--- a/minissdpd/Makefile
|
||||
+++ b/minissdpd/Makefile
|
||||
@@ -41,7 +41,7 @@ endif
|
||||
EXECUTABLES = minissdpd testminissdpd testcodelength \
|
||||
showminissdpdnotif
|
||||
MINISSDPDOBJS = minissdpd.o openssdpsocket.o daemonize.o upnputils.o \
|
||||
- ifacewatch.o getroute.o getifaddr.o asyncsendto.o
|
||||
+ ifacewatch.o getroute.o getifaddr.o asyncsendto.o ssdpd.o
|
||||
TESTMINISSDPDOBJS = testminissdpd.o printresponse.o
|
||||
SHOWMINISSDPDNOTIFOBJS = showminissdpdnotif.o printresponse.o
|
||||
|
||||
629
ssdpd/patches/011-add-ubus-object
Normal file
629
ssdpd/patches/011-add-ubus-object
Normal file
@@ -0,0 +1,629 @@
|
||||
--- /dev/null
|
||||
+++ b/minissdpd/ssdpd.c
|
||||
@@ -0,0 +1,626 @@
|
||||
+/*
|
||||
+ * Copyright (C) 2022 iopsys Software Solutions AB
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or modify
|
||||
+ * it under the terms of the GNU Lesser General Public License version 2.1
|
||||
+ * as published by the Free Software Foundation
|
||||
+ *
|
||||
+ * Author: Amin Ben Romdhane <amin.benromdhane@iopsys.eu>
|
||||
+ */
|
||||
+
|
||||
+#include <unistd.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <stdbool.h>
|
||||
+#include <string.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/socket.h>
|
||||
+#include <sys/un.h>
|
||||
+#include <net/if.h>
|
||||
+#include <syslog.h>
|
||||
+
|
||||
+#include <curl/curl.h>
|
||||
+#include <libubox/uloop.h>
|
||||
+#include <libubox/blobmsg_json.h>
|
||||
+#include <libubox/list.h>
|
||||
+#include <libubus.h>
|
||||
+#include <mxml.h>
|
||||
+
|
||||
+#include "codelength.h"
|
||||
+
|
||||
+struct UPNPDev {
|
||||
+ struct list_head list;
|
||||
+ char *descURL;
|
||||
+ char *st;
|
||||
+ char *usn;
|
||||
+};
|
||||
+
|
||||
+struct desc_list_elt {
|
||||
+ struct list_head list;
|
||||
+ char *url;
|
||||
+ char *desc_path;
|
||||
+ bool is_device_desc;
|
||||
+};
|
||||
+
|
||||
+#define UPNP_DESC_PATH "/etc/upnp/description"
|
||||
+#define UPNP_DISCOVER_TIMEOUT (30 * 1000)
|
||||
+
|
||||
+#ifndef MIN
|
||||
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
+#endif /* MIN */
|
||||
+
|
||||
+/* macros used to read from unix socket */
|
||||
+#define READ_BYTE_BUFFER(c) \
|
||||
+ if ((int)bufferindex >= n) { \
|
||||
+ n = read(s, buffer, sizeof(buffer)); \
|
||||
+ if (n <= 0) break; \
|
||||
+ bufferindex = 0; \
|
||||
+ } \
|
||||
+ c = buffer[bufferindex++];
|
||||
+
|
||||
+#define READ_COPY_BUFFER(dst, len) \
|
||||
+ for (l = len, p = (unsigned char *)dst; l > 0; ) { \
|
||||
+ unsigned int lcopy; \
|
||||
+ if ((int)bufferindex >= n) { \
|
||||
+ n = read(s, buffer, sizeof(buffer)); \
|
||||
+ if ( n<= 0) break; \
|
||||
+ bufferindex = 0; \
|
||||
+ } \
|
||||
+ lcopy = MIN(l, (n - bufferindex)); \
|
||||
+ memcpy(p, buffer + bufferindex, lcopy); \
|
||||
+ l -= lcopy; \
|
||||
+ p += lcopy; \
|
||||
+ bufferindex += lcopy; \
|
||||
+ }
|
||||
+
|
||||
+LIST_HEAD(dev_list);
|
||||
+LIST_HEAD(desc_list);
|
||||
+
|
||||
+char *ssdp_sockpath = NULL;
|
||||
+
|
||||
+static void upnp_discover_devices(struct uloop_timeout *timeout);
|
||||
+static struct uloop_timeout upnpdiscover_timer = { .cb = upnp_discover_devices };
|
||||
+
|
||||
+static void add_dev_to_dev_list(char *descURL, char *st, char *usn)
|
||||
+{
|
||||
+ struct UPNPDev *dev = NULL;
|
||||
+
|
||||
+ dev = calloc(1, sizeof(struct UPNPDev));
|
||||
+ list_add_tail(&dev->list, &dev_list);
|
||||
+
|
||||
+ dev->descURL = descURL;
|
||||
+ dev->st = st;
|
||||
+ dev->usn = usn;
|
||||
+}
|
||||
+
|
||||
+void free_all_dev_list(void)
|
||||
+{
|
||||
+ struct UPNPDev *dev = NULL;
|
||||
+
|
||||
+ while (dev_list.next != &dev_list) {
|
||||
+ dev = list_entry(dev_list.next, struct UPNPDev, list);
|
||||
+ free(dev->descURL);
|
||||
+ free(dev->st);
|
||||
+ free(dev->usn);
|
||||
+ free(dev);
|
||||
+ list_del(&dev->list);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int connectToMiniSSDPD(void)
|
||||
+{
|
||||
+ int s = 0;
|
||||
+ struct sockaddr_un addr;
|
||||
+
|
||||
+ s = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||
+ if(s < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ char *ssdp_s = ssdp_sockpath ? ssdp_sockpath : "/var/run/minissdpd.sock";
|
||||
+
|
||||
+ memset(&addr, 0, sizeof(addr));
|
||||
+ addr.sun_family = AF_UNIX;
|
||||
+
|
||||
+ strncpy(addr.sun_path, ssdp_s, sizeof(addr.sun_path));
|
||||
+
|
||||
+ if(connect(s, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0) {
|
||||
+ close(s);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return s;
|
||||
+}
|
||||
+
|
||||
+static int disconnectFromMiniSSDPD(int s)
|
||||
+{
|
||||
+ if (close(s) < 0)
|
||||
+ return -1;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int requestDevicesFromMiniSSDPD(int s)
|
||||
+{
|
||||
+ unsigned char buffer[256];
|
||||
+ unsigned char *p = NULL;
|
||||
+ unsigned int stsize = 0, l = 0;
|
||||
+ char *devtype = "ssdp:all";
|
||||
+
|
||||
+ buffer[0] = 3; /* request type 3 : everything */
|
||||
+ stsize = strlen(devtype);
|
||||
+
|
||||
+ p = buffer + 1;
|
||||
+ l = stsize; CODELENGTH(l, p);
|
||||
+ if (p + stsize > buffer + sizeof(buffer))
|
||||
+ return -1;
|
||||
+
|
||||
+ memcpy(p, devtype, stsize);
|
||||
+ p += stsize;
|
||||
+ if (write(s, buffer, p - buffer) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int receiveDevicesFromMiniSSDPD(int s)
|
||||
+{
|
||||
+ unsigned char buffer[256];
|
||||
+ ssize_t n;
|
||||
+ unsigned char *p;
|
||||
+ unsigned int bufferindex;
|
||||
+ unsigned int i, ndev;
|
||||
+ unsigned int urlsize, stsize, usnsize, l;
|
||||
+ char *url, *st, *usn;
|
||||
+
|
||||
+ n = read(s, buffer, sizeof(buffer));
|
||||
+ if (n <= 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ ndev = buffer[0];
|
||||
+ bufferindex = 1;
|
||||
+ for (i = 0; i < ndev; i++) {
|
||||
+ DECODELENGTH_READ(urlsize, READ_BYTE_BUFFER);
|
||||
+ if (n <= 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ url = (char *)malloc(urlsize);
|
||||
+ if (url == NULL)
|
||||
+ return -1;
|
||||
+
|
||||
+ READ_COPY_BUFFER(url, urlsize);
|
||||
+ if (n <= 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ DECODELENGTH_READ(stsize, READ_BYTE_BUFFER);
|
||||
+ if (n <= 0)
|
||||
+ goto free_url_and_return;
|
||||
+
|
||||
+ st = (char *)malloc(stsize);
|
||||
+ if (st == NULL)
|
||||
+ goto free_url_and_return;
|
||||
+
|
||||
+ READ_COPY_BUFFER(st, stsize);
|
||||
+ if (n <= 0)
|
||||
+ goto free_url_and_st_and_return;
|
||||
+
|
||||
+ DECODELENGTH_READ(usnsize, READ_BYTE_BUFFER);
|
||||
+ if (n <= 0)
|
||||
+ goto free_url_and_st_and_return;
|
||||
+
|
||||
+ usn = (char *)malloc(usnsize);
|
||||
+ if (usn == NULL)
|
||||
+ goto free_url_and_st_and_return;
|
||||
+
|
||||
+ READ_COPY_BUFFER(usn, usnsize);
|
||||
+ if (n <= 0)
|
||||
+ goto free_url_and_st_and_usn_and_return;
|
||||
+
|
||||
+ add_dev_to_dev_list(url, st, usn);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+
|
||||
+free_url_and_st_and_usn_and_return:
|
||||
+ free(usn);
|
||||
+free_url_and_st_and_return:
|
||||
+ free(st);
|
||||
+free_url_and_return:
|
||||
+ free(url);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+static int getDevicesFromMiniSSDPD(void)
|
||||
+{
|
||||
+ int s = 0;
|
||||
+ int res = 0;
|
||||
+
|
||||
+ s = connectToMiniSSDPD();
|
||||
+ if (s < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ res = requestDevicesFromMiniSSDPD(s);
|
||||
+ if (res < 0)
|
||||
+ goto close_socket_and_return;
|
||||
+
|
||||
+ res = receiveDevicesFromMiniSSDPD(s);
|
||||
+
|
||||
+close_socket_and_return:
|
||||
+ disconnectFromMiniSSDPD(s);
|
||||
+
|
||||
+ return res;
|
||||
+}
|
||||
+
|
||||
+static void download_file(char *file_path, const char *url)
|
||||
+{
|
||||
+ CURL *curl = curl_easy_init();
|
||||
+ if (curl) {
|
||||
+ curl_easy_setopt(curl, CURLOPT_URL, url);
|
||||
+ curl_easy_setopt(curl, CURLOPT_TIMEOUT, 500);
|
||||
+
|
||||
+ FILE *fp = fopen(file_path, "wb");
|
||||
+ if (fp) {
|
||||
+ curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp);
|
||||
+ curl_easy_perform(curl);
|
||||
+ fclose(fp);
|
||||
+ }
|
||||
+
|
||||
+ curl_easy_cleanup(curl);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static bool is_desc_exist(const char *desc_url)
|
||||
+{
|
||||
+ struct desc_list_elt *desc_elt = NULL;
|
||||
+
|
||||
+ if (!desc_url)
|
||||
+ return false;
|
||||
+
|
||||
+ list_for_each_entry(desc_elt, &desc_list, list) {
|
||||
+ if (strcmp(desc_elt->url, desc_url) == 0)
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+static void get_desc_name(const char *desc_url, char *str, size_t len)
|
||||
+{
|
||||
+ if (!desc_url || !str || len == 0)
|
||||
+ return;
|
||||
+
|
||||
+ char *p = strstr(desc_url, "://");
|
||||
+
|
||||
+ snprintf(str, len, "%s", p ? p + 3 : desc_url);
|
||||
+
|
||||
+ for (int i = 0; str[i]; i++) {
|
||||
+ if (str[i] == '/')
|
||||
+ str[i] = '_';
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void add_desc_to_desc_list(const char *desc_path, const char *url, int is_device_desc)
|
||||
+{
|
||||
+ struct desc_list_elt *desc_elt;
|
||||
+
|
||||
+ desc_elt = calloc(1, sizeof(struct desc_list_elt));
|
||||
+ list_add_tail(&desc_elt->list, &desc_list);
|
||||
+
|
||||
+ desc_elt->desc_path = strdup(desc_path);
|
||||
+ desc_elt->url = strdup(url);
|
||||
+ desc_elt->is_device_desc = is_device_desc;
|
||||
+}
|
||||
+
|
||||
+static void free_all_desc_list(void)
|
||||
+{
|
||||
+ struct desc_list_elt *desc_elt = NULL;
|
||||
+
|
||||
+ while (desc_list.next != &desc_list) {
|
||||
+ desc_elt = list_entry(desc_list.next, struct desc_list_elt, list);
|
||||
+ free(desc_elt->desc_path);
|
||||
+ free(desc_elt->url);
|
||||
+ free(desc_elt);
|
||||
+ list_del(&desc_elt->list);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void __upnp_discover_devices(void)
|
||||
+{
|
||||
+ struct UPNPDev *dev = NULL;
|
||||
+ char desc_name[128] = {0};
|
||||
+ char file_path[256] = {0};
|
||||
+ int res = 0, is_device_desc = 0;
|
||||
+
|
||||
+ /*
|
||||
+ * Discover devices
|
||||
+ */
|
||||
+ if (!list_empty(&dev_list))
|
||||
+ free_all_dev_list();
|
||||
+
|
||||
+ res = getDevicesFromMiniSSDPD();
|
||||
+ if (res)
|
||||
+ goto end;
|
||||
+
|
||||
+ /*
|
||||
+ * Download description files
|
||||
+ */
|
||||
+ list_for_each_entry_reverse(dev, &dev_list, list) {
|
||||
+
|
||||
+ if (is_desc_exist(dev->descURL))
|
||||
+ continue;
|
||||
+
|
||||
+ get_desc_name(dev->descURL, desc_name, sizeof(desc_name));
|
||||
+ snprintf(file_path, sizeof(file_path), "%s/%s", UPNP_DESC_PATH, desc_name);
|
||||
+ is_device_desc = (dev->usn && strstr(dev->usn, ":service:")) ? 0 : 1;
|
||||
+
|
||||
+ // Download Description
|
||||
+ download_file(file_path, dev->descURL);
|
||||
+
|
||||
+ // Add description to descriptions list
|
||||
+ add_desc_to_desc_list(file_path, dev->descURL, is_device_desc);
|
||||
+ }
|
||||
+
|
||||
+end:
|
||||
+ uloop_timeout_set(&upnpdiscover_timer, UPNP_DISCOVER_TIMEOUT);
|
||||
+}
|
||||
+
|
||||
+static int upnp_discovery_res(struct ubus_context *ctx, struct ubus_object *obj __attribute__((unused)),
|
||||
+ struct ubus_request_data *req, const char *method __attribute__((unused)), struct blob_attr *msg __attribute__((unused)))
|
||||
+{
|
||||
+ struct blob_buf bb = {0};
|
||||
+ struct UPNPDev *dev = NULL;
|
||||
+
|
||||
+ memset(&bb,0,sizeof(struct blob_buf));
|
||||
+ blob_buf_init(&bb, 0);
|
||||
+
|
||||
+ void *devices_array = blobmsg_open_array(&bb, "devices");
|
||||
+ list_for_each_entry_reverse(dev, &dev_list, list) {
|
||||
+ // Parse Root device and devices
|
||||
+ if ((dev->st && strstr(dev->st, ":rootdevice") != NULL) || (dev->usn && strstr(dev->usn, ":device:") != NULL)) {
|
||||
+ void *device_obj = blobmsg_open_table(&bb, NULL);
|
||||
+ blobmsg_add_string(&bb, "descurl", dev->descURL);
|
||||
+ blobmsg_add_string(&bb, "st", dev->st);
|
||||
+ blobmsg_add_string(&bb, "usn", dev->usn);
|
||||
+ blobmsg_add_string(&bb, "is_root_device", dev->st && strstr(dev->st, ":rootdevice") ? "1" : "0");
|
||||
+ blobmsg_close_table(&bb, device_obj);
|
||||
+ }
|
||||
+ }
|
||||
+ blobmsg_close_array(&bb, devices_array);
|
||||
+
|
||||
+ void *services_array = blobmsg_open_array(&bb, "services");
|
||||
+ list_for_each_entry_reverse(dev, &dev_list, list) {
|
||||
+ // Parse Services
|
||||
+ if (dev->usn && strstr(dev->usn, ":service:") != NULL) {
|
||||
+ void *service_obj = blobmsg_open_table(&bb, NULL);
|
||||
+ blobmsg_add_string(&bb, "descurl", dev->descURL);
|
||||
+ blobmsg_add_string(&bb, "st", dev->st);
|
||||
+ blobmsg_add_string(&bb, "usn", dev->usn);
|
||||
+ blobmsg_close_table(&bb, service_obj);
|
||||
+ }
|
||||
+ }
|
||||
+ blobmsg_close_array(&bb, services_array);
|
||||
+
|
||||
+ ubus_send_reply(ctx, req, bb.head);
|
||||
+ blob_buf_free(&bb);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void fill_device_instances(struct blob_buf *bb, mxml_node_t *device)
|
||||
+{
|
||||
+ void *device_obj = NULL;
|
||||
+ mxml_node_t *b = device;
|
||||
+ char buf[64] = {0};
|
||||
+ bool new_device_discovery = false;
|
||||
+
|
||||
+ while (b) {
|
||||
+
|
||||
+ if (mxmlGetType(b) != MXML_ELEMENT) {
|
||||
+ b = mxmlWalkNext(b, device, MXML_DESCEND);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ const char *elm_name = mxmlGetElement(b);
|
||||
+ const char *elm_val = mxmlGetOpaque(b);
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "device") == 0) {
|
||||
+
|
||||
+ if (new_device_discovery && device_obj)
|
||||
+ blobmsg_close_table(bb, device_obj);
|
||||
+
|
||||
+ device_obj = blobmsg_open_table(bb, NULL);
|
||||
+ blobmsg_add_string(bb, "parent_dev", buf);
|
||||
+ new_device_discovery = true;
|
||||
+ }
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "deviceType") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "deviceType", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "friendlyName") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "friendlyName", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "manufacturer") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "manufacturer", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "manufacturerURL") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "manufacturerURL", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "modelDescription") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "modelDescription", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "modelName") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "modelName", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "modelNumber") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "modelNumber", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "modelURL") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "modelURL", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "serialNumber") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "serialNumber", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "UDN") == 0 && new_device_discovery) {
|
||||
+ snprintf(buf, sizeof(buf), "%s", elm_val ? elm_val : "");
|
||||
+ blobmsg_add_string(bb, "UDN", buf);
|
||||
+ }
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "UPC") == 0 && new_device_discovery)
|
||||
+ blobmsg_add_string(bb, "UPC", elm_val ? elm_val : "");
|
||||
+
|
||||
+ b = mxmlWalkNext(b, device, MXML_DESCEND);
|
||||
+ }
|
||||
+
|
||||
+ if (new_device_discovery && device_obj)
|
||||
+ blobmsg_close_table(bb, device_obj);
|
||||
+}
|
||||
+
|
||||
+static void fill_service_element(struct blob_buf *bb, mxml_node_t *service)
|
||||
+{
|
||||
+ mxml_node_t *b = service;
|
||||
+ void *service_obj = NULL;
|
||||
+ char buf[64] = {0};
|
||||
+ bool new_srv_discovery = false;
|
||||
+
|
||||
+ while (b) {
|
||||
+
|
||||
+ if (mxmlGetType(b) != MXML_ELEMENT) {
|
||||
+ b = mxmlWalkNext(b, service, MXML_DESCEND);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ const char *elm_name = mxmlGetElement(b);
|
||||
+ const char *elm_val = mxmlGetOpaque(b);
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "UDN") == 0)
|
||||
+ snprintf(buf, sizeof(buf), "%s", elm_val ? elm_val : "");
|
||||
+
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "service") == 0) {
|
||||
+
|
||||
+ if (new_srv_discovery && service_obj)
|
||||
+ blobmsg_close_table(bb, service_obj);
|
||||
+
|
||||
+ service_obj = blobmsg_open_table(bb, NULL);
|
||||
+ blobmsg_add_string(bb, "parent_dev", buf);
|
||||
+ new_srv_discovery = true;
|
||||
+ }
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "serviceType") == 0 && new_srv_discovery)
|
||||
+ blobmsg_add_string(bb, "serviceType", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "serviceId") == 0 && new_srv_discovery)
|
||||
+ blobmsg_add_string(bb, "serviceId", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "SCPDURL") == 0 && new_srv_discovery)
|
||||
+ blobmsg_add_string(bb, "SCPDURL", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "controlURL") == 0 && new_srv_discovery)
|
||||
+ blobmsg_add_string(bb, "controlURL", elm_val ? elm_val : "");
|
||||
+
|
||||
+ if (elm_name && strcmp(elm_name, "eventSubURL") == 0 && new_srv_discovery)
|
||||
+ blobmsg_add_string(bb, "eventSubURL", elm_val ? elm_val : "");
|
||||
+
|
||||
+ b = mxmlWalkNext(b, service, MXML_DESCEND);
|
||||
+ }
|
||||
+
|
||||
+ if (new_srv_discovery && service_obj)
|
||||
+ blobmsg_close_table(bb, service_obj);
|
||||
+}
|
||||
+
|
||||
+static int upnp_description_res(struct ubus_context *ctx, struct ubus_object *obj __attribute__((unused)),
|
||||
+ struct ubus_request_data *req, const char *method __attribute__((unused)), struct blob_attr *msg __attribute__((unused)))
|
||||
+{
|
||||
+ struct desc_list_elt *desc_elt = NULL;
|
||||
+ struct blob_buf bb = {0};
|
||||
+
|
||||
+ memset(&bb,0,sizeof(struct blob_buf));
|
||||
+ blob_buf_init(&bb, 0);
|
||||
+
|
||||
+ void *desc_array = blobmsg_open_array(&bb, "descriptions");
|
||||
+ list_for_each_entry(desc_elt, &desc_list, list) {
|
||||
+ void *device_obj = blobmsg_open_table(&bb, NULL);
|
||||
+ blobmsg_add_string(&bb, "desc_url", desc_elt->url);
|
||||
+ blobmsg_add_u32(&bb, "is_device_desc", desc_elt->is_device_desc);
|
||||
+ blobmsg_close_table(&bb, device_obj);
|
||||
+
|
||||
+ }
|
||||
+ blobmsg_close_array(&bb, desc_array);
|
||||
+
|
||||
+ list_for_each_entry(desc_elt, &desc_list, list) {
|
||||
+
|
||||
+ FILE *fp = fopen(desc_elt->desc_path, "r");
|
||||
+ if (!fp)
|
||||
+ continue;
|
||||
+
|
||||
+ mxml_node_t *tree = mxmlLoadFile(NULL, fp, MXML_OPAQUE_CALLBACK);
|
||||
+ fclose(fp);
|
||||
+
|
||||
+ if (tree) {
|
||||
+ void *devices_array = blobmsg_open_array(&bb, "devices");
|
||||
+ mxml_node_t *device = mxmlFindElement(tree, tree, "device", NULL, NULL, MXML_DESCEND);
|
||||
+ fill_device_instances(&bb, device);
|
||||
+ blobmsg_close_array(&bb, devices_array);
|
||||
+
|
||||
+ void *services_array = blobmsg_open_array(&bb, "services");
|
||||
+ mxml_node_t *service = mxmlFindElement(tree, tree, "device", NULL, NULL, MXML_DESCEND);
|
||||
+ fill_service_element(&bb, service);
|
||||
+ blobmsg_close_array(&bb, services_array);
|
||||
+
|
||||
+ mxmlDelete(tree);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ubus_send_reply(ctx, req, bb.head);
|
||||
+ blob_buf_free(&bb);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static struct ubus_method upnp_methods[] = {
|
||||
+ UBUS_METHOD_NOARG("discovery", upnp_discovery_res),
|
||||
+ UBUS_METHOD_NOARG("description", upnp_description_res),
|
||||
+};
|
||||
+
|
||||
+static struct ubus_object_type upnp_type = UBUS_OBJECT_TYPE("upnp", upnp_methods);
|
||||
+
|
||||
+static void upnp_discover_devices(struct uloop_timeout *timeout __attribute__((unused)))
|
||||
+{
|
||||
+ __upnp_discover_devices();
|
||||
+}
|
||||
+
|
||||
+static struct ubus_object upnp_object = {
|
||||
+ .name = "upnp",
|
||||
+ .type = &upnp_type,
|
||||
+ .methods = upnp_methods,
|
||||
+ .n_methods = ARRAY_SIZE(upnp_methods),
|
||||
+};
|
||||
+
|
||||
+void upnp_thread_discover_devices(void)
|
||||
+{
|
||||
+ struct ubus_context *ctx = NULL;
|
||||
+ const char *ubus_socket = NULL;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ uloop_init();
|
||||
+
|
||||
+ ctx = ubus_connect(ubus_socket);
|
||||
+ if (!ctx) {
|
||||
+ syslog(LOG_ERR, "Failed to connect to ubus\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ubus_add_uloop(ctx);
|
||||
+
|
||||
+ __upnp_discover_devices();
|
||||
+
|
||||
+ ret = ubus_add_object(ctx, &upnp_object);
|
||||
+ if (ret) {
|
||||
+ syslog(LOG_ERR, "Failed to add 'upnp' ubus object: %s\n", ubus_strerror(ret));
|
||||
+ goto end;
|
||||
+ }
|
||||
+
|
||||
+ uloop_run();
|
||||
+
|
||||
+end:
|
||||
+ free_all_desc_list();
|
||||
+ free_all_dev_list();
|
||||
+ uloop_done();
|
||||
+ ubus_free(ctx);
|
||||
+}
|
||||
420
ssdpd/patches/012-ubus-runner-thread-hook
Normal file
420
ssdpd/patches/012-ubus-runner-thread-hook
Normal file
@@ -0,0 +1,420 @@
|
||||
--- a/minissdpd/minissdpd.c
|
||||
+++ b/minissdpd/minissdpd.c
|
||||
@@ -32,6 +32,8 @@
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#endif
|
||||
+/* for uloop thread */
|
||||
+#include <pthread.h>
|
||||
|
||||
/* LOG_PERROR does not exist on Solaris */
|
||||
#ifndef LOG_PERROR
|
||||
@@ -52,6 +54,10 @@
|
||||
#define MIN(x,y) (((x)<(y))?(x):(y))
|
||||
#endif
|
||||
|
||||
+extern char *ssdp_sockpath;
|
||||
+void upnp_thread_discover_devices(void);
|
||||
+void ssdpd_ubus_stop(void);
|
||||
+
|
||||
/* current request management structure */
|
||||
struct reqelem {
|
||||
int socket;
|
||||
@@ -1220,6 +1226,12 @@ static void ssdpDiscover(int s, int ipv6
|
||||
}
|
||||
}
|
||||
|
||||
+static void *thread_discover_devices(void *args __attribute__((unused)))
|
||||
+{
|
||||
+ upnp_thread_discover_devices();
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
/* main(): program entry point */
|
||||
int main(int argc, char * * argv)
|
||||
{
|
||||
@@ -1264,6 +1276,7 @@ int main(int argc, char * * argv)
|
||||
unsigned char ttl = 2; /* UDA says it should default to 2 */
|
||||
const char * searched_device = NULL; /* if not NULL, search/filter a specific device type */
|
||||
int opt;
|
||||
+ pthread_t upnp_thread;
|
||||
|
||||
LIST_INIT(&reqlisthead);
|
||||
LIST_INIT(&servicelisthead);
|
||||
@@ -1309,6 +1322,7 @@ int main(int argc, char * * argv)
|
||||
break;
|
||||
case 's':
|
||||
sockpath = optarg;
|
||||
+ ssdp_sockpath = optarg;
|
||||
break;
|
||||
#ifndef NO_BACKGROUND_NO_PIDFILE
|
||||
case 'p':
|
||||
@@ -1496,6 +1510,11 @@ int main(int argc, char * * argv)
|
||||
if(s_ssdp6 >= 0)
|
||||
ssdpDiscover(s_ssdp6, 1, searched_device);
|
||||
|
||||
+ int err = pthread_create(&upnp_thread, NULL, &thread_discover_devices, NULL);
|
||||
+ if (err < 0) {
|
||||
+ syslog(LOG_ERR, "Error when creating upnp thread");
|
||||
+ }
|
||||
+
|
||||
/* Main loop */
|
||||
while(!quitting) {
|
||||
/* fill readfds fd_set */
|
||||
@@ -1704,6 +1723,8 @@ quit:
|
||||
if(unlink(pidfilename) < 0)
|
||||
syslog(LOG_ERR, "unlink(%s): %m", pidfilename);
|
||||
#endif
|
||||
+ ssdpd_ubus_stop();
|
||||
+ pthread_join(upnp_thread, NULL);
|
||||
closelog();
|
||||
return ret;
|
||||
}
|
||||
--- a/minissdpd/ssdpd.c
|
||||
+++ b/minissdpd/ssdpd.c
|
||||
@@ -39,10 +39,9 @@ struct desc_list_elt {
|
||||
struct list_head list;
|
||||
char *url;
|
||||
char *desc_path;
|
||||
- bool is_device_desc;
|
||||
};
|
||||
|
||||
-#define UPNP_DESC_PATH "/etc/upnp/description"
|
||||
+#define UPNP_DESC_PATH "/tmp/ssdp/description"
|
||||
#define UPNP_DISCOVER_TIMEOUT (30 * 1000)
|
||||
|
||||
#ifndef MIN
|
||||
@@ -93,17 +92,41 @@ static void add_dev_to_dev_list(char *de
|
||||
dev->usn = usn;
|
||||
}
|
||||
|
||||
-void free_all_dev_list(void)
|
||||
+static void free_all_dev_list(void)
|
||||
{
|
||||
struct UPNPDev *dev = NULL;
|
||||
+ struct UPNPDev *dev_tmp = NULL;
|
||||
|
||||
- while (dev_list.next != &dev_list) {
|
||||
- dev = list_entry(dev_list.next, struct UPNPDev, list);
|
||||
+ list_for_each_entry_safe(dev, dev_tmp, &dev_list, list) {
|
||||
+ list_del(&dev->list);
|
||||
free(dev->descURL);
|
||||
free(dev->st);
|
||||
free(dev->usn);
|
||||
free(dev);
|
||||
- list_del(&dev->list);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void add_desc_to_desc_list(const char *desc_path, const char *url)
|
||||
+{
|
||||
+ struct desc_list_elt *desc_elt;
|
||||
+
|
||||
+ desc_elt = calloc(1, sizeof(struct desc_list_elt));
|
||||
+ list_add_tail(&desc_elt->list, &desc_list);
|
||||
+
|
||||
+ desc_elt->desc_path = strdup(desc_path);
|
||||
+ desc_elt->url = strdup(url);
|
||||
+}
|
||||
+
|
||||
+static void free_all_desc_list(void)
|
||||
+{
|
||||
+ struct desc_list_elt *desc_elt = NULL;
|
||||
+ struct desc_list_elt *desc_elt_tmp = NULL;
|
||||
+
|
||||
+ list_for_each_entry_safe(desc_elt, desc_elt_tmp, &desc_list, list) {
|
||||
+ list_del(&desc_elt->list);
|
||||
+ free(desc_elt->desc_path);
|
||||
+ free(desc_elt->url);
|
||||
+ free(desc_elt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,8 +190,8 @@ static int receiveDevicesFromMiniSSDPD(i
|
||||
ssize_t n;
|
||||
unsigned char *p;
|
||||
unsigned int bufferindex;
|
||||
- unsigned int i, ndev;
|
||||
- unsigned int urlsize, stsize, usnsize, l;
|
||||
+ unsigned int i = 0, ndev = 0;
|
||||
+ unsigned int urlsize = 0, stsize = 0, usnsize = 0, l = 0;
|
||||
char *url, *st, *usn;
|
||||
|
||||
n = read(s, buffer, sizeof(buffer));
|
||||
@@ -182,11 +205,12 @@ static int receiveDevicesFromMiniSSDPD(i
|
||||
if (n <= 0)
|
||||
return -1;
|
||||
|
||||
- url = (char *)malloc(urlsize);
|
||||
+ url = (char *)calloc(urlsize + 1, sizeof(char));
|
||||
if (url == NULL)
|
||||
return -1;
|
||||
|
||||
READ_COPY_BUFFER(url, urlsize);
|
||||
+ url[urlsize] = 0;
|
||||
if (n <= 0)
|
||||
return -1;
|
||||
|
||||
@@ -194,11 +218,12 @@ static int receiveDevicesFromMiniSSDPD(i
|
||||
if (n <= 0)
|
||||
goto free_url_and_return;
|
||||
|
||||
- st = (char *)malloc(stsize);
|
||||
+ st = (char *)calloc(stsize + 1, sizeof(char));
|
||||
if (st == NULL)
|
||||
goto free_url_and_return;
|
||||
|
||||
READ_COPY_BUFFER(st, stsize);
|
||||
+ st[stsize] = 0;
|
||||
if (n <= 0)
|
||||
goto free_url_and_st_and_return;
|
||||
|
||||
@@ -206,11 +231,12 @@ static int receiveDevicesFromMiniSSDPD(i
|
||||
if (n <= 0)
|
||||
goto free_url_and_st_and_return;
|
||||
|
||||
- usn = (char *)malloc(usnsize);
|
||||
+ usn = (char *)calloc(usnsize + 1, sizeof(char));
|
||||
if (usn == NULL)
|
||||
goto free_url_and_st_and_return;
|
||||
|
||||
READ_COPY_BUFFER(usn, usnsize);
|
||||
+ usn[usnsize] = 0;
|
||||
if (n <= 0)
|
||||
goto free_url_and_st_and_usn_and_return;
|
||||
|
||||
@@ -282,6 +308,21 @@ static bool is_desc_exist(const char *de
|
||||
return false;
|
||||
}
|
||||
|
||||
+static bool is_device_exist(const char *dev_url)
|
||||
+{
|
||||
+ struct UPNPDev *dev = NULL;
|
||||
+
|
||||
+ if (!dev_url)
|
||||
+ return false;
|
||||
+
|
||||
+ list_for_each_entry(dev, &dev_list, list) {
|
||||
+ if (strcmp(dev->descURL, dev_url) == 0)
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static void get_desc_name(const char *desc_url, char *str, size_t len)
|
||||
{
|
||||
if (!desc_url || !str || len == 0)
|
||||
@@ -297,37 +338,14 @@ static void get_desc_name(const char *de
|
||||
}
|
||||
}
|
||||
|
||||
-static void add_desc_to_desc_list(const char *desc_path, const char *url, int is_device_desc)
|
||||
-{
|
||||
- struct desc_list_elt *desc_elt;
|
||||
-
|
||||
- desc_elt = calloc(1, sizeof(struct desc_list_elt));
|
||||
- list_add_tail(&desc_elt->list, &desc_list);
|
||||
-
|
||||
- desc_elt->desc_path = strdup(desc_path);
|
||||
- desc_elt->url = strdup(url);
|
||||
- desc_elt->is_device_desc = is_device_desc;
|
||||
-}
|
||||
-
|
||||
-static void free_all_desc_list(void)
|
||||
-{
|
||||
- struct desc_list_elt *desc_elt = NULL;
|
||||
-
|
||||
- while (desc_list.next != &desc_list) {
|
||||
- desc_elt = list_entry(desc_list.next, struct desc_list_elt, list);
|
||||
- free(desc_elt->desc_path);
|
||||
- free(desc_elt->url);
|
||||
- free(desc_elt);
|
||||
- list_del(&desc_elt->list);
|
||||
- }
|
||||
-}
|
||||
-
|
||||
static void __upnp_discover_devices(void)
|
||||
{
|
||||
+ struct desc_list_elt *desc_elt = NULL;
|
||||
+ struct desc_list_elt *desc_elt_tmp = NULL;
|
||||
struct UPNPDev *dev = NULL;
|
||||
char desc_name[128] = {0};
|
||||
char file_path[256] = {0};
|
||||
- int res = 0, is_device_desc = 0;
|
||||
+ int res = 0;
|
||||
|
||||
/*
|
||||
* Discover devices
|
||||
@@ -349,13 +367,26 @@ static void __upnp_discover_devices(void
|
||||
|
||||
get_desc_name(dev->descURL, desc_name, sizeof(desc_name));
|
||||
snprintf(file_path, sizeof(file_path), "%s/%s", UPNP_DESC_PATH, desc_name);
|
||||
- is_device_desc = (dev->usn && strstr(dev->usn, ":service:")) ? 0 : 1;
|
||||
|
||||
// Download Description
|
||||
download_file(file_path, dev->descURL);
|
||||
|
||||
// Add description to descriptions list
|
||||
- add_desc_to_desc_list(file_path, dev->descURL, is_device_desc);
|
||||
+ add_desc_to_desc_list(file_path, dev->descURL);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Remove unused descriptions
|
||||
+ */
|
||||
+ list_for_each_entry_safe(desc_elt, desc_elt_tmp, &desc_list, list) {
|
||||
+
|
||||
+ if (is_device_exist(desc_elt->url))
|
||||
+ continue;
|
||||
+
|
||||
+ list_del(&desc_elt->list);
|
||||
+ free(desc_elt->desc_path);
|
||||
+ free(desc_elt->url);
|
||||
+ free(desc_elt);
|
||||
}
|
||||
|
||||
end:
|
||||
@@ -371,15 +402,27 @@ static int upnp_discovery_res(struct ubu
|
||||
memset(&bb,0,sizeof(struct blob_buf));
|
||||
blob_buf_init(&bb, 0);
|
||||
|
||||
+ void *root_devices_array = blobmsg_open_array(&bb, "root_devices");
|
||||
+ list_for_each_entry_reverse(dev, &dev_list, list) {
|
||||
+ // Parse root device
|
||||
+ if (dev->st && strstr(dev->st, ":rootdevice") != NULL) {
|
||||
+ void *device_obj = blobmsg_open_table(&bb, NULL);
|
||||
+ blobmsg_add_string(&bb, "descurl", dev->descURL);
|
||||
+ blobmsg_add_string(&bb, "st", dev->st);
|
||||
+ blobmsg_add_string(&bb, "usn", dev->usn);
|
||||
+ blobmsg_close_table(&bb, device_obj);
|
||||
+ }
|
||||
+ }
|
||||
+ blobmsg_close_array(&bb, root_devices_array);
|
||||
+
|
||||
void *devices_array = blobmsg_open_array(&bb, "devices");
|
||||
list_for_each_entry_reverse(dev, &dev_list, list) {
|
||||
- // Parse Root device and devices
|
||||
- if ((dev->st && strstr(dev->st, ":rootdevice") != NULL) || (dev->usn && strstr(dev->usn, ":device:") != NULL)) {
|
||||
+ // Parse devices
|
||||
+ if (dev->usn && strstr(dev->usn, ":device:") != NULL) {
|
||||
void *device_obj = blobmsg_open_table(&bb, NULL);
|
||||
blobmsg_add_string(&bb, "descurl", dev->descURL);
|
||||
blobmsg_add_string(&bb, "st", dev->st);
|
||||
blobmsg_add_string(&bb, "usn", dev->usn);
|
||||
- blobmsg_add_string(&bb, "is_root_device", dev->st && strstr(dev->st, ":rootdevice") ? "1" : "0");
|
||||
blobmsg_close_table(&bb, device_obj);
|
||||
}
|
||||
}
|
||||
@@ -472,7 +515,7 @@ static void fill_device_instances(struct
|
||||
blobmsg_close_table(bb, device_obj);
|
||||
}
|
||||
|
||||
-static void fill_service_element(struct blob_buf *bb, mxml_node_t *service)
|
||||
+static void fill_service_instances(struct blob_buf *bb, mxml_node_t *service)
|
||||
{
|
||||
mxml_node_t *b = service;
|
||||
void *service_obj = NULL;
|
||||
@@ -525,6 +568,32 @@ static void fill_service_element(struct
|
||||
blobmsg_close_table(bb, service_obj);
|
||||
}
|
||||
|
||||
+static void fill_device_service_instances(struct blob_buf *bb, bool is_device)
|
||||
+{
|
||||
+ struct desc_list_elt *desc_elt = NULL;
|
||||
+
|
||||
+ list_for_each_entry(desc_elt, &desc_list, list) {
|
||||
+
|
||||
+ FILE *fp = fopen(desc_elt->desc_path, "r");
|
||||
+ if (!fp)
|
||||
+ continue;
|
||||
+
|
||||
+ mxml_node_t *tree = mxmlLoadFile(NULL, fp, MXML_OPAQUE_CALLBACK);
|
||||
+ fclose(fp);
|
||||
+
|
||||
+ if (tree) {
|
||||
+ mxml_node_t *node = mxmlFindElement(tree, tree, "device", NULL, NULL, MXML_DESCEND);
|
||||
+
|
||||
+ if (is_device)
|
||||
+ fill_device_instances(bb, node);
|
||||
+ else
|
||||
+ fill_service_instances(bb, node);
|
||||
+
|
||||
+ mxmlDelete(tree);
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int upnp_description_res(struct ubus_context *ctx, struct ubus_object *obj __attribute__((unused)),
|
||||
struct ubus_request_data *req, const char *method __attribute__((unused)), struct blob_attr *msg __attribute__((unused)))
|
||||
{
|
||||
@@ -534,39 +603,25 @@ static int upnp_description_res(struct u
|
||||
memset(&bb,0,sizeof(struct blob_buf));
|
||||
blob_buf_init(&bb, 0);
|
||||
|
||||
+ // Descriptions Array
|
||||
void *desc_array = blobmsg_open_array(&bb, "descriptions");
|
||||
list_for_each_entry(desc_elt, &desc_list, list) {
|
||||
void *device_obj = blobmsg_open_table(&bb, NULL);
|
||||
blobmsg_add_string(&bb, "desc_url", desc_elt->url);
|
||||
- blobmsg_add_u32(&bb, "is_device_desc", desc_elt->is_device_desc);
|
||||
blobmsg_close_table(&bb, device_obj);
|
||||
|
||||
}
|
||||
blobmsg_close_array(&bb, desc_array);
|
||||
|
||||
- list_for_each_entry(desc_elt, &desc_list, list) {
|
||||
-
|
||||
- FILE *fp = fopen(desc_elt->desc_path, "r");
|
||||
- if (!fp)
|
||||
- continue;
|
||||
-
|
||||
- mxml_node_t *tree = mxmlLoadFile(NULL, fp, MXML_OPAQUE_CALLBACK);
|
||||
- fclose(fp);
|
||||
-
|
||||
- if (tree) {
|
||||
- void *devices_array = blobmsg_open_array(&bb, "devices");
|
||||
- mxml_node_t *device = mxmlFindElement(tree, tree, "device", NULL, NULL, MXML_DESCEND);
|
||||
- fill_device_instances(&bb, device);
|
||||
- blobmsg_close_array(&bb, devices_array);
|
||||
-
|
||||
- void *services_array = blobmsg_open_array(&bb, "services");
|
||||
- mxml_node_t *service = mxmlFindElement(tree, tree, "device", NULL, NULL, MXML_DESCEND);
|
||||
- fill_service_element(&bb, service);
|
||||
- blobmsg_close_array(&bb, services_array);
|
||||
+ // Devices Array
|
||||
+ void *devices_array = blobmsg_open_array(&bb, "devices");
|
||||
+ fill_device_service_instances(&bb, true);
|
||||
+ blobmsg_close_array(&bb, devices_array);
|
||||
|
||||
- mxmlDelete(tree);
|
||||
- }
|
||||
- }
|
||||
+ // Services Array
|
||||
+ void *services_array = blobmsg_open_array(&bb, "services");
|
||||
+ fill_device_service_instances(&bb, false);
|
||||
+ blobmsg_close_array(&bb, services_array);
|
||||
|
||||
ubus_send_reply(ctx, req, bb.head);
|
||||
blob_buf_free(&bb);
|
||||
@@ -624,3 +679,9 @@ end:
|
||||
uloop_done();
|
||||
ubus_free(ctx);
|
||||
}
|
||||
+
|
||||
+void ssdpd_ubus_stop(void)
|
||||
+{
|
||||
+ uloop_end();
|
||||
+}
|
||||
+
|
||||
--- a/minissdpd/config.h
|
||||
+++ b/minissdpd/config.h
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
/* When NO_BACKGROUND_NO_PIDFILE is defined, minissdpd does not go to
|
||||
* background and does not create any pidfile */
|
||||
-/*#define NO_BACKGROUND_NO_PIDFILE*/
|
||||
+#define NO_BACKGROUND_NO_PIDFILE
|
||||
|
||||
/* define HAVE_IP_MREQN to use struct ip_mreqn instead of struct ip_mreq
|
||||
* for setsockopt(IP_MULTICAST_IF). Available with Linux 2.4+,
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=stunc
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.1.13
|
||||
PKG_VERSION:=1.1.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -23,6 +23,8 @@ endif
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/stunc/default
|
||||
@@ -30,7 +32,7 @@ define Package/stunc/default
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF STUN Client
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json +libbbf_api
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/stunc-mbedtls
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
menu "Configuration"
|
||||
depends on PACKAGE_sulu-builder
|
||||
|
||||
menu "SULU_CORE"
|
||||
depends on PACKAGE_sulu-builder
|
||||
config SULU_CORE_ENABLE
|
||||
bool "Enable this plugin"
|
||||
default y
|
||||
|
||||
config SULU_CORE_URL
|
||||
string "SULU url"
|
||||
default "https://dev.iopsys.eu/websdk/sulu.git"
|
||||
|
||||
config SULU_CORE_VERSION
|
||||
string "SULU repo version"
|
||||
default "09f38d92c0690f4d101d7914948226299fafe066"
|
||||
endmenu
|
||||
|
||||
menu "SULU_PLUGIN_LCM"
|
||||
depends on PACKAGE_sulu-builder
|
||||
config SULU_PLUGIN_LCM_ENABLE
|
||||
bool "Enable this plugin"
|
||||
default y
|
||||
|
||||
config SULU_PLUGIN_LCM_NAME
|
||||
depends on SULU_PLUGIN_LCM_ENABLE
|
||||
string "Plugin_name"
|
||||
default "sulu-lcm"
|
||||
|
||||
config SULU_PLUGIN_LCM_URL
|
||||
depends on SULU_PLUGIN_LCM_ENABLE
|
||||
string "URL"
|
||||
default "https://dev.iopsys.eu/websdk/sulu-lcm.git"
|
||||
|
||||
config SULU_PLUGIN_LCM_VERSION
|
||||
depends on SULU_PLUGIN_LCM_ENABLE
|
||||
string "Version"
|
||||
default "40da874871120e4a042ec5ac814e3c96e22d8c24"
|
||||
endmenu
|
||||
|
||||
menu "SULU_PLUGIN_MULTIAP"
|
||||
depends on PACKAGE_sulu-builder
|
||||
config SULU_PLUGIN_MULTIAP_ENABLE
|
||||
bool "Enable this plugin"
|
||||
default y
|
||||
|
||||
config SULU_PLUGIN_MULTIAP_NAME
|
||||
depends on SULU_PLUGIN_MULTIAP_ENABLE
|
||||
string "Plugin_name"
|
||||
default "sulu-multi-ap"
|
||||
|
||||
config SULU_PLUGIN_MULTIAP_URL
|
||||
depends on SULU_PLUGIN_MULTIAP_ENABLE
|
||||
string "URL"
|
||||
default "https://dev.iopsys.eu/websdk/sulu-multi-ap.git"
|
||||
|
||||
config SULU_PLUGIN_MULTIAP_VERSION
|
||||
depends on SULU_PLUGIN_MULTIAP_ENABLE
|
||||
string "Version"
|
||||
default "68d4919a7a40b3029ab56b47fc97bfa28619639b"
|
||||
endmenu
|
||||
|
||||
menu "SULU_THEME_IOPSYS"
|
||||
depends on PACKAGE_sulu-builder
|
||||
config SULU_THEME_IOPSYS_ENABLE
|
||||
bool "Enable this plugin"
|
||||
default y
|
||||
|
||||
config SULU_THEME_IOPSYS_NAME
|
||||
depends on SULU_THEME_IOPSYS_ENABLE
|
||||
string "Plugin_name"
|
||||
default "sulu-theme-iopsys"
|
||||
|
||||
config SULU_THEME_IOPSYS_URL
|
||||
depends on SULU_THEME_IOPSYS_ENABLE
|
||||
string "URL"
|
||||
default "https://dev.iopsys.eu/websdk/sulu-theme-iopsys.git"
|
||||
|
||||
config SULU_THEME_IOPSYS_VERSION
|
||||
depends on SULU_THEME_IOPSYS_ENABLE
|
||||
string "Version"
|
||||
default "e80fea80cdf8d49db0ae70b5c26a5dab49b8a20d"
|
||||
endmenu
|
||||
|
||||
menu "SULU_PLUGIN_CUSTOM"
|
||||
depends on PACKAGE_sulu-builder
|
||||
config SULU_PLUGIN_CUSTOM_ENABLE
|
||||
bool "Enable this plugin"
|
||||
default n
|
||||
|
||||
config SULU_PLUGIN_CUSTOM_NAME
|
||||
depends on SULU_PLUGIN_CUSTOM_ENABLE
|
||||
string "Plugin_name"
|
||||
default "custom_app"
|
||||
|
||||
config SULU_PLUGIN_CUSTOM_URL
|
||||
depends on SULU_PLUGIN_CUSTOM_ENABLE
|
||||
string "URL"
|
||||
default ""
|
||||
|
||||
config SULU_PLUGIN_CUSTOM_VERSION
|
||||
depends on SULU_PLUGIN_CUSTOM_ENABLE
|
||||
string "Version"
|
||||
endmenu
|
||||
|
||||
menu "SULU_THEME_CUSTOM"
|
||||
depends on PACKAGE_sulu-builder
|
||||
config SULU_THEME_CUSTOM_ENABLE
|
||||
bool "Enable this plugin"
|
||||
default n
|
||||
|
||||
config SULU_THEME_CUSTOM_NAME
|
||||
depends on SULU_THEME_CUSTOM_ENABLE
|
||||
string "Plugin_name"
|
||||
default "plugin_theme_custom"
|
||||
|
||||
config SULU_THEME_CUSTOM_URL
|
||||
depends on SULU_THEME_CUSTOM_ENABLE
|
||||
string "URL"
|
||||
default ""
|
||||
|
||||
config SULU_THEME_CUSTOM_VERSION
|
||||
depends on SULU_THEME_CUSTOM_ENABLE
|
||||
string "Version"
|
||||
endmenu
|
||||
endmenu
|
||||
@@ -1,158 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2021-2022 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu-builder
|
||||
PKG_VERSION:=1.2.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu-builder.git
|
||||
PKG_SOURCE_VERSION:=16bbf7e5a28a79c47a63bf454fc2f525d667c73d
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/${PKG_NAME}
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Build sulu from source
|
||||
DEPENDS:=+nginx +mosquitto-auth-shadow
|
||||
CONFLICTS:=sulu
|
||||
endef
|
||||
|
||||
define Package/${PKG_NAME}/description
|
||||
SULU-CE ReactJS based Web UI builder.
|
||||
endef
|
||||
|
||||
define Package/${PKG_NAME}/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
# Sulu core and other dependent needs to be updated in Config.in
|
||||
SULU_DL_FILE:=sulu_core-${CONFIG_SULU_CORE_VERSION}.tar.gz
|
||||
define Download/sulu_core
|
||||
FILE:=$(SULU_DL_FILE)
|
||||
URL:=$(CONFIG_SULU_CORE_URL)
|
||||
PROTO:=git
|
||||
SUBDIR:=core
|
||||
VERSION:=${CONFIG_SULU_CORE_VERSION}
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_SULU_CORE_ENABLE),y)
|
||||
$(eval $(call Download,sulu_core))
|
||||
endif
|
||||
|
||||
SULU_PLUGIN_LCM_DL:=${CONFIG_SULU_PLUGIN_LCM_NAME}_plugin-${CONFIG_SULU_PLUGIN_LCM_VERSION}.tar.gz
|
||||
define Download/sulu_plugin_lcm
|
||||
FILE:=${SULU_PLUGIN_LCM_DL}
|
||||
URL:=${CONFIG_SULU_PLUGIN_LCM_URL}
|
||||
PROTO:=git
|
||||
SUBDIR:=plugins/${CONFIG_SULU_PLUGIN_LCM_NAME}
|
||||
VERSION:=${CONFIG_SULU_PLUGIN_LCM_VERSION}
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_SULU_PLUGIN_LCM_ENABLE),y)
|
||||
$(eval $(call Download,sulu_plugin_lcm))
|
||||
endif
|
||||
|
||||
SULU_PLUGIN_MULTIAP_DL:=${CONFIG_SULU_PLUGIN_MULTIAP_NAME}_plugin-${CONFIG_SULU_PLUGIN_MULTIAP_VERSION}.tar.gz
|
||||
define Download/sulu_plugin_multiap
|
||||
FILE:=${SULU_PLUGIN_MULTIAP_DL}
|
||||
URL:=${CONFIG_SULU_PLUGIN_MULTIAP_URL}
|
||||
PROTO:=git
|
||||
SUBDIR:=plugins/${CONFIG_SULU_PLUGIN_MULTIAP_NAME}
|
||||
VERSION:=${CONFIG_SULU_PLUGIN_MULTIAP_VERSION}
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_SULU_PLUGIN_MULTIAP_ENABLE),y)
|
||||
$(eval $(call Download,sulu_plugin_multiap))
|
||||
endif
|
||||
|
||||
SULU_THEME_IOPSYS_DL:=${CONFIG_SULU_THEME_IOPSYS_NAME}_plugin-${CONFIG_SULU_THEME_IOPSYS_VERSION}.tar.gz
|
||||
define Download/sulu_theme_iopsys
|
||||
FILE:=${SULU_THEME_IOPSYS_DL}
|
||||
URL:=${CONFIG_SULU_THEME_IOPSYS_URL}
|
||||
PROTO:=git
|
||||
SUBDIR:=plugins/${CONFIG_SULU_THEME_IOPSYS_NAME}
|
||||
VERSION:=${CONFIG_SULU_THEME_IOPSYS_VERSION}
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_SULU_THEME_IOPSYS_ENABLE),y)
|
||||
$(eval $(call Download,sulu_theme_iopsys))
|
||||
endif
|
||||
|
||||
SULU_PLUGIN_CUSTOM_DL:=${CONFIG_SULU_PLUGIN_CUSTOM_NAME}_plugin-${CONFIG_SULU_PLUGIN_CUSTOM_VERSION}.tar.gz
|
||||
define Download/sulu_plugin_custom
|
||||
FILE:=${SULU_PLUGIN_CUSTOM_DL}
|
||||
URL:=${CONFIG_SULU_PLUGIN_CUSTOM_URL}
|
||||
PROTO:=git
|
||||
SUBDIR:=plugins/${CONFIG_SULU_PLUGIN_CUSTOM_NAME}
|
||||
VERSION:=${CONFIG_SULU_PLUGIN_CUSTOM_VERSION}
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_SULU_PLUGIN_CUSTOM_ENABLE),y)
|
||||
$(eval $(call Download,sulu_plugin_custom))
|
||||
endif
|
||||
|
||||
SULU_THEME_CUSTOM_DL:=${CONFIG_SULU_THEME_CUSTOM_NAME}_plugin-${CONFIG_SULU_THEME_CUSTOM_VERSION}.tar.gz
|
||||
define Download/sulu_theme_custom
|
||||
FILE:=${SULU_THEME_CUSTOM_DL}
|
||||
URL:=${CONFIG_SULU_THEME_CUSTOM_URL}
|
||||
PROTO:=git
|
||||
SUBDIR:=plugins/${CONFIG_SULU_THEME_CUSTOM_NAME}
|
||||
VERSION:=${CONFIG_SULU_THEME_CUSTOM_VERSION}
|
||||
HASH:=skip
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_SULU_THEME_CUSTOM_ENABLE),y)
|
||||
$(eval $(call Download,sulu_theme_custom))
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
$(Build/Prepare/Default)
|
||||
tar xzf $(DL_DIR)/${SULU_DL_FILE} -C $(PKG_BUILD_DIR)
|
||||
ifeq ($(CONFIG_SULU_PLUGIN_LCM_ENABLE),y)
|
||||
tar xzf $(DL_DIR)/${SULU_PLUGIN_LCM_DL} -C $(PKG_BUILD_DIR)
|
||||
endif
|
||||
ifeq ($(CONFIG_SULU_PLUGIN_MULTIAP_ENABLE),y)
|
||||
tar xzf $(DL_DIR)/${SULU_PLUGIN_MULTIAP_DL} -C $(PKG_BUILD_DIR)
|
||||
endif
|
||||
ifeq ($(CONFIG_SULU_THEME_IOPSYS_ENABLE),y)
|
||||
tar xzf $(DL_DIR)/${SULU_THEME_IOPSYS_DL} -C $(PKG_BUILD_DIR)
|
||||
endif
|
||||
ifeq ($(CONFIG_SULU_PLUGIN_CUSTOM_ENABLE),y)
|
||||
tar xzf $(DL_DIR)/${SULU_PLUGIN_CUSTOM_DL} -C $(PKG_BUILD_DIR)
|
||||
endif
|
||||
ifeq ($(CONFIG_SULU_THEME_CUSTOM_ENABLE),y)
|
||||
tar xzf $(DL_DIR)/${SULU_THEME_CUSTOM_DL} -C $(PKG_BUILD_DIR)
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/${PKG_NAME}/install
|
||||
$(INSTALL_DIR) $(1)/sulu
|
||||
$(INSTALL_DIR) $(1)/sulu/config
|
||||
$(INSTALL_DIR) $(1)/sulu/config/widgets
|
||||
$(INSTALL_DIR) $(1)/etc/nginx/
|
||||
$(INSTALL_DIR) $(1)/etc/mosquitto/conf.d/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/dist/* $(1)/sulu
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/*.json $(1)/sulu/config/
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
|
||||
ifeq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(CP) $(PKG_BUILD_DIR)/build/src/config/widgets/lcm-store.json $(1)/sulu/config/widgets/
|
||||
endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,${PKG_NAME}))
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t sulu.init -p debug
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance sulu
|
||||
# append sulu connection injection
|
||||
procd_close_instance
|
||||
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_config_trigger "config.change" "obuspa" /etc/init.d/sulu reload
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
listener 1883 127.0.0.1
|
||||
allow_anonymous true
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
listener 9001
|
||||
protocol websockets
|
||||
plugin /usr/lib/mosquitto_auth_shadow.so
|
||||
require_certificate false
|
||||
allow_anonymous false
|
||||
@@ -1,18 +0,0 @@
|
||||
location /config/ {
|
||||
autoindex on;
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
if ($request_method = 'GET') {
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
|
||||
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
mkdir -p /tmp/sulu
|
||||
|
||||
uci -q get nginx._sulu && exit 0
|
||||
|
||||
uci -q set nginx._sulu=server
|
||||
uci -q add_list nginx._sulu.listen='8080'
|
||||
uci -q add_list nginx._sulu.listen='[::]:8080'
|
||||
uci -q set nginx._sulu.root='/sulu'
|
||||
uci -q set nginx._sulu.server_name='_sulu'
|
||||
uci -q add_list nginx._sulu.include='conf.d/sulu.locations'
|
||||
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=sulu
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.3.26
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/sulu.git
|
||||
PKG_SOURCE_VERSION:=16bbf7e5a28a79c47a63bf454fc2f525d667c73d
|
||||
PKG_SOURCE_VERSION:=6d6848119bffdbe0ec9b8116caf6375749299dc0
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
@@ -43,6 +43,7 @@ define Package/sulu/install
|
||||
$(CP) $(PKG_BUILD_DIR)/dist/* $(1)/sulu
|
||||
$(CP) $(PKG_BUILD_DIR)/config/*.json $(1)/sulu/config
|
||||
$(CP) $(PKG_BUILD_DIR)/config/widgets/diagnostics.json $(1)/sulu/config/widgets/
|
||||
$(CP) $(PKG_BUILD_DIR)/config/widgets/wan.json $(1)/sulu/config/widgets/
|
||||
ifeq ($(CONFIG_PACKAGE_skopeo)$(CONFIG_PACKAGE_umoci),yy)
|
||||
$(CP) $(PKG_BUILD_DIR)/config/widgets/lcm-store.json $(1)/sulu/config/widgets/
|
||||
endif
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
if PACKAGE_swmodd
|
||||
|
||||
menu "Configuration"
|
||||
depends on PACKAGE_swmodd
|
||||
|
||||
config SWMODD_LXC_SUPPORT
|
||||
bool "Handles LXC based containers"
|
||||
default n
|
||||
depends on PACKAGE_swmodd
|
||||
select PACKAGE_liblxc
|
||||
|
||||
config SWMODD_OCI_SUPPORT
|
||||
bool "Handles OCI containers"
|
||||
default y
|
||||
depends on PACKAGE_swmodd
|
||||
select PACKAGE_crun
|
||||
|
||||
config SWMODD_REGISTRY_PULL_SUPPORT
|
||||
bool "Add support to pull images from container image registries (i.e: docker.io, quay.io)"
|
||||
default n
|
||||
depends on PACKAGE_swmodd
|
||||
select PACKAGE_skopeo
|
||||
select PACKAGE_umoci
|
||||
config SWMOD_HOST_IS_EXECENV
|
||||
bool "Enable host system as execution environment"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
#
|
||||
# Copyright (C) 2022 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020 IOPSYS
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.1.17
|
||||
PKG_VERSION:=2.1.5.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5124ea8051c06e8c3563b384660b08db199c93eb
|
||||
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
|
||||
@@ -31,7 +33,7 @@ define Package/swmodd
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
|
||||
+PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
|
||||
+@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT +@BUSYBOX_CONFIG_SCRIPT \
|
||||
+swmodd-cgroup +jq +libbbf_api
|
||||
+swmodd-cgroup
|
||||
endef
|
||||
|
||||
define Package/swmodd/description
|
||||
@@ -51,19 +53,20 @@ define Package/swmodd-cgroup
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_crun),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_CRUN="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_LXC="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SWMOD_HOST_IS_EXECENV),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_HOST_IS_EXECENV="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/swmodd/* $(PKG_BUILD_DIR)/
|
||||
@@ -74,6 +77,7 @@ define Package/swmodd/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/swmod
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/swmodd $(1)/etc/init.d/swmodd
|
||||
$(INSTALL_BIN) ./files/etc/config/swmodd $(1)/etc/config/swmodd
|
||||
@@ -85,15 +89,6 @@ ifeq ($(CONFIG_PACKAGE_liblxc),y)
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/templates/lxc-iopsys $(1)/usr/share/lxc/templates/lxc-iopsys
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/opkg_offline.sh $(1)/usr/share/swmodd/opkg_offline
|
||||
endif
|
||||
ifeq ($(CONFIG_PACKAGE_crun),y)
|
||||
$(INSTALL_DIR) $(1)/etc/swmodd
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/swmodd/run.sh $(1)/etc/swmodd/run.sh
|
||||
$(INSTALL_BIN) ./files/etc/init.d/crun $(1)/etc/init.d/crun
|
||||
$(INSTALL_BIN) ./files/etc/config/crun $(1)/etc/config/crun
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/crun_create $(1)/usr/sbin/crun_create
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-bundle-path $(1)/etc/uci-defaults/01-fix-bundle-path
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/swmodd-cgroup/install
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
config global global
|
||||
option enable '1'
|
||||
@@ -1,5 +1,4 @@
|
||||
config globals 'globals'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option log_level '3'
|
||||
option lan_bridge 'br-lan'
|
||||
option enabled '1'
|
||||
option debug '1'
|
||||
option log_level '3'
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t crun.init -p info
|
||||
}
|
||||
|
||||
is_container_running() {
|
||||
crun list |tail -n +2|grep -wq "^${1}"
|
||||
return $?
|
||||
}
|
||||
|
||||
configure_crun_container() {
|
||||
local name type autostart du_status requested_state url username password
|
||||
local BRIDGE BUNDLE
|
||||
local RUNNER="/etc/swmodd/run.sh"
|
||||
|
||||
BUNDLE="${2}"
|
||||
BRIDGE="${3}"
|
||||
|
||||
config_get name ${1} name ""
|
||||
config_get type ${1} type ""
|
||||
config_get_bool autostart ${1} autostart 1
|
||||
config_get du_status ${1} du_status ""
|
||||
config_get requested_state ${1} requested_state ""
|
||||
config_get url ${1} url ""
|
||||
config_get username ${1} username ""
|
||||
config_get password ${1} password ""
|
||||
|
||||
if [ -z "${name}" ] || [ -z "${type}" ] || [ -z "${du_status}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${type}" != "crun" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${du_status}" == "Installing" ]; then
|
||||
local result
|
||||
log "Pull image from registry"
|
||||
uci_set ocicontainer ${1} du_status Installing_start
|
||||
uci_set ocicontainer ${1} username ""
|
||||
uci_set ocicontainer ${1} password ""
|
||||
result=$(${RUNNER} -b "${BUNDLE}" -n "${name}" -r "${url}" -l "${username}:${password}")
|
||||
if [ "$?" -eq 0 ]; then
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_description")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer ${1} description "${result}"
|
||||
fi
|
||||
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_vendor")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer ${1} vendor "${result}"
|
||||
fi
|
||||
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_version")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer ${1} version "${result}"
|
||||
fi
|
||||
|
||||
uci_set ocicontainer ${1} du_status Installing_success
|
||||
du_status="Installed"
|
||||
else
|
||||
uci_set ocicontainer ${1} du_status Installing_failed
|
||||
uci_set ocicontainer ${1} fault_string "${result}"
|
||||
return 0;
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${du_status}" == "Uninstalling" ]; then
|
||||
ubus call service delete "{\"name\":\"crun\",\"instance\":\"${name}\"}"
|
||||
if is_container_running "${name}"; then
|
||||
crun kill --all "${name}" 9
|
||||
fi
|
||||
${RUNNER} -c -n "${name}"
|
||||
if [ -d "${BUNDLE:?}/${name:?}" ]; then
|
||||
rm -rf "${BUNDLE:?}/${name:?}"
|
||||
fi
|
||||
|
||||
# If directory still exists then uninstall failed
|
||||
if [ -d "${BUNDLE}/${name}" ]; then
|
||||
uci_set ocicontainer ${1} du_status Uninstalling_failed
|
||||
uci_set ocicontainer ${1} fault_string "Failed to remove ${BUNDLE}/${name}"
|
||||
else
|
||||
uci_set ocicontainer ${1} du_status Uninstalling_success
|
||||
fi
|
||||
# Delete the uci config section after uninstall
|
||||
log "CRUN container ${name} removed"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ ! -d "${BUNDLE:?}/${name:?}" ]; then
|
||||
log "Crun container {${BUNDLE:?}/${name:?}} not available"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${du_status}" != "Installed" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${autostart}" -eq 0 ]; then
|
||||
ubus call service delete "{\"name\":\"crun\",\"instance\":\"${name}\"}"
|
||||
# stop the container if not enabled
|
||||
crun kill --all "${name}" 9
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if is_container_running "${name}"; then
|
||||
log "Container [$name] req_status [${requested_state}]"
|
||||
if [ "${requested_state}" == "Idle" ]; then
|
||||
crun pause "${name}"
|
||||
elif [ "${requested_state}" == "Active" ]; then
|
||||
${RUNNER} -u -n "${name}" -i "${BRIDGE}"
|
||||
crun resume "${name}"
|
||||
fi
|
||||
else
|
||||
${RUNNER} -U -b "${BUNDLE}" -n "${name}"
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_description")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer ${1} description "${result}"
|
||||
fi
|
||||
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_vendor")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer ${1} vendor "${result}"
|
||||
fi
|
||||
|
||||
result=$(cat ${BUNDLE}/${name}/config.json |jq ".annotations.org_opencontainers_image_version")
|
||||
if [ "${result}" != "null" ]; then
|
||||
uci_set ocicontainer ${1} version "${result}"
|
||||
fi
|
||||
fi
|
||||
|
||||
procd_open_instance "${name}"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param command "${RUNNER}"
|
||||
procd_append_param command -b "${BUNDLE}" -n "${name}" -i "${BRIDGE}"
|
||||
procd_set_param respawn
|
||||
procd_close_instance "${name}"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local bundle bridge
|
||||
|
||||
# Check if crun present
|
||||
if ! command -v crun >/dev/null 2>&1; then
|
||||
log "CRUN binary not found"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
config_load swmodd
|
||||
config_get bundle globals oci_bundle_root ""
|
||||
config_get bridge globals lan_bridge "br-lan"
|
||||
|
||||
if [ -z "${bundle}" ] || [ -z "${bridge}" ]; then
|
||||
log "Empty bundle path or bridge"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -f "${bundle}/ocicontainer" ]; then
|
||||
UCI_CONFIG_DIR="${bundle}"
|
||||
config_load ocicontainer
|
||||
config_foreach configure_crun_container du_eu_assoc "${bundle}" "${bridge}"
|
||||
uci_commit
|
||||
# Add a timer for DuStateChange!
|
||||
(sleep 5 && ubus -t 5 call swmodules reload) &
|
||||
fi
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
local cid
|
||||
|
||||
cid="$(crun list|tail -n +2 |awk '{printf $1 " "}')"
|
||||
for f in $cid; do
|
||||
crun kill --all "${f}" 9
|
||||
done
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "crun" "network"
|
||||
}
|
||||
@@ -12,97 +12,46 @@ validate_globals_section()
|
||||
'enabled:bool:1' \
|
||||
'debug:bool:false' \
|
||||
'log_level:uinteger:1' \
|
||||
'lxc_bundle_root:string' \
|
||||
'oci_bundle_root:string' \
|
||||
'sock:string'
|
||||
}
|
||||
|
||||
start_lxc_container() {
|
||||
config_get name "${1}" name ""
|
||||
config_get type "${1}" type ""
|
||||
config_get autostart "${1}" autostart "0"
|
||||
config_get timeout "${1}" timeout "300"
|
||||
|
||||
if [ -z "${name}" ] || [ -z "${type}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${type}" != "lxc" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
state=$(lxc-ls -f | tail -n +2 | grep -w "${name}" | cut -d " " -f 2)
|
||||
if [ -z "${state}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${autostart}" == "0" ]; then
|
||||
if [ "${state}" == "RUNNING" ]; then
|
||||
# stop the container if running
|
||||
lxc-stop -n "${name}" -t "${timeout}" &
|
||||
return 0;
|
||||
elif [ "${state}" == "FROZEN" ]; then
|
||||
# first unfreeze then stop
|
||||
lxc-unfreeze -n "${name}"
|
||||
lxc-stop -n "${name}" -t "${timeout}" &
|
||||
return 0;
|
||||
fi
|
||||
else
|
||||
if [ "${state}" == "FROZEN" ]; then
|
||||
# unfreeze the container
|
||||
lxc-unfreeze -n "${name}"
|
||||
elif [ "${state}" == "STOPPED" ]; then
|
||||
# start the container
|
||||
lxc-start -n "${name}"
|
||||
return 0;
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled debug log_level sock lxc_bundle_root oci_bundle_root
|
||||
local enabled debug log_level sock
|
||||
|
||||
# creating fallback shared mount-point
|
||||
mkdir -p /tmp/swmodd_dw
|
||||
|
||||
config_load swmodd
|
||||
|
||||
validate_globals_section || {
|
||||
log "Validation of uci globals failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
# Create the bundle paths if not present
|
||||
[ -n "${lxc_bundle_root}" ] && mkdir -p "${lxc_bundle_root}"
|
||||
[ -n "${oci_bundle_root}" ] && mkdir -p "${oci_bundle_root}"
|
||||
|
||||
procd_open_instance swmodd
|
||||
procd_set_param command ${PROG}
|
||||
|
||||
if [ "${debug}" -eq 1 ]; then
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_append_param command -l "${log_level}"
|
||||
procd_append_param command -l ${log_level}
|
||||
fi
|
||||
|
||||
if [ -f "${sock}" ]; then
|
||||
procd_append_param command -s "${sock}"
|
||||
procd_append_param command -s ${sock}
|
||||
fi
|
||||
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
# Auto-start the lxc containers
|
||||
if [ -f "${lxc_bundle_root}/lxccontainer" ]; then
|
||||
UCI_CONFIG_DIR="${lxc_bundle_root}"
|
||||
config_load lxccontainer
|
||||
config_foreach start_lxc_container container
|
||||
fi
|
||||
stop_service() {
|
||||
service_stop ${PROG}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "swmodd"
|
||||
}
|
||||
|
||||
@@ -1,262 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
VETHNAME=""
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t crun.runner -p info
|
||||
echo "${@}"
|
||||
}
|
||||
|
||||
check_binary() {
|
||||
if [ -z "${1}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if ! command -v "${1}" >/dev/null 2>&1;then
|
||||
log "${1} not present in system"
|
||||
exit 1
|
||||
fi
|
||||
return 0;
|
||||
}
|
||||
|
||||
check_binary crun
|
||||
check_binary script
|
||||
|
||||
get_veth_name() {
|
||||
local name
|
||||
|
||||
name="cr$1"
|
||||
VETHNAME="${name:0:15}"
|
||||
}
|
||||
|
||||
clean_container_network() {
|
||||
local name
|
||||
|
||||
name="${1}"
|
||||
# clean up
|
||||
if ip netns list|grep -qw "${name}"; then
|
||||
get_veth_name "${name}"
|
||||
ip netns del "${name}"
|
||||
ip link delete "${VETHNAME}" type veth peer name eth0
|
||||
fi
|
||||
}
|
||||
|
||||
setup_container_network() {
|
||||
local name bridge_name
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
name="${1}"
|
||||
bridge_name="${2}"
|
||||
|
||||
clean_container_network "${name}"
|
||||
get_veth_name "${name}"
|
||||
# Add a namespace
|
||||
ip netns add "${name}"
|
||||
# Add a veth pair
|
||||
ip link add "${VETHNAME}" type veth peer name eth0 netns "$name"
|
||||
# Make veth on network side up
|
||||
ip netns exec "$name" ip link set dev eth0 up
|
||||
# Create loopback interface
|
||||
ip netns exec "$name" ip link set lo up
|
||||
# Make veth on host side up
|
||||
ip link set dev "${VETHNAME}" up
|
||||
# Link with host bridge
|
||||
brctl addif "${bridge_name}" "${VETHNAME}"
|
||||
# Get Ip from bridge and make the link ready
|
||||
ip netns exec "$name" udhcpc -i eth0 -x hostname:"CRUN-${name}"
|
||||
if [ "${du_status}" != "Installed" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
run_container() {
|
||||
local bundle name bridge
|
||||
|
||||
bundle="${1}"
|
||||
name="${2}"
|
||||
bridge="${3}"
|
||||
|
||||
if [ ! -d "${bundle:?}/${name:?}" ]; then
|
||||
log "Bundle does not exists"
|
||||
return 1
|
||||
fi
|
||||
|
||||
setup_container_network "${name}" "${bridge}"
|
||||
|
||||
script -q -c "crun run -b ${bundle}/${name} ${name}" /dev/null
|
||||
}
|
||||
|
||||
update_network_ns() {
|
||||
local type
|
||||
json_select $2
|
||||
json_get_var type type
|
||||
if [ "${type}" == "network" ]; then
|
||||
json_add_string path "/var/run/netns/${NAME}"
|
||||
break;
|
||||
fi
|
||||
json_select ..
|
||||
}
|
||||
|
||||
nginx_hack() {
|
||||
# replace nginx user to root user
|
||||
if [ -f "${BUNDLE:?}/${NAME:?}/rootfs/etc/nginx/nginx.conf" ]; then
|
||||
sed -i 's/^user .*;$/user root;/' "${BUNDLE}/${NAME}/rootfs/etc/nginx/nginx.conf"
|
||||
fi
|
||||
}
|
||||
|
||||
update_config_json() {
|
||||
|
||||
if [ ! -f "${BUNDLE:?}/${NAME:?}/config.json" ]; then
|
||||
log "config.json not found or bundle missing"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
if [ -f "/usr/share/libubox/jshn.sh" ]; then
|
||||
. /usr/share/libubox/jshn.sh
|
||||
else
|
||||
log "jshn.sh missing in the system"
|
||||
exit 1;
|
||||
fi
|
||||
cd "${BUNDLE}/${NAME}"
|
||||
if cat config.json |jq '.linux.namespaces[] |select (.type == "network") |.path' |grep -q ${NAME}; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
mv config.json config_orig.json
|
||||
json_init
|
||||
json_load_file "config_orig.json"
|
||||
json_select linux
|
||||
json_for_each_item update_network_ns namespaces
|
||||
json_dump >config.json
|
||||
|
||||
nginx_hack
|
||||
}
|
||||
|
||||
pull_image_from_registry() {
|
||||
local temp disksize exsize
|
||||
|
||||
if [ -z "${BUNDLE}" -o -z "${NAME}" -o -z "${REGURL}" ]; then
|
||||
log "Information missing for installation"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -d "${BUNDLE}/${NAME}" ]; then
|
||||
log "Container with same name already present"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_binary skopeo
|
||||
check_binary umoci
|
||||
temp="$(mktemp -d)"
|
||||
if [ ! -d "${temp}" ]; then
|
||||
log "Failed to create temp directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "${temp}"
|
||||
OPTS=""
|
||||
INSPECT_OPT=""
|
||||
if [ "${#LOGIN}" -gt 3 ]; then
|
||||
OPTS="--src-creds ${LOGIN}"
|
||||
INSPECT_OPT="--creds ${LOGIN}"
|
||||
fi
|
||||
if ! skopeo --command-timeout 4m copy ${OPTS} ${REGURL} oci:${NAME}_tmp:latest >/dev/null 2>&1; then
|
||||
log "Failed to download image"
|
||||
cd -
|
||||
rm -rf "${temp}"
|
||||
exit 1
|
||||
fi
|
||||
if ! umoci unpack --image ${NAME}_tmp:latest ${NAME} >/dev/null 2>&1; then
|
||||
log "Failed to unpack image"
|
||||
cd -
|
||||
rm -rf "${temp}"
|
||||
exit 1
|
||||
fi
|
||||
rm -rf "${NAME}_tmp"
|
||||
if [ ! -f "${NAME}/config.json" ]; then
|
||||
log "Failed to pull the image config missing"
|
||||
cd -
|
||||
rm -rf "${temp}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check disk available space before copy
|
||||
disksize=$(df -P -k ${BUNDLE} |tail -n +2 |awk '{print $4}')
|
||||
exsize=$(du -s ${temp} |awk '{print $1}')
|
||||
if [ "${disksize}" -lt "${exsize}" ]; then
|
||||
log "Disk space ${disksize} less that required ${exists}"
|
||||
cd -
|
||||
rm -rf "${temp}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mv ${NAME} ${BUNDLE}/
|
||||
if [ "$?" -ne 0 ]; then
|
||||
log "Failed ${name} move in ${BUNDLE}"
|
||||
cd -
|
||||
rm -rf "${temp}"
|
||||
rm -rf ${BUNDLE}/${NAME}
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd -
|
||||
rm -rf "${temp}"
|
||||
update_config_json
|
||||
}
|
||||
|
||||
clean=0
|
||||
net_update=0
|
||||
update_json=0
|
||||
while getopts b:n:i:r:l:cuU options
|
||||
do
|
||||
case "${options}" in
|
||||
b) BUNDLE=${OPTARG};;
|
||||
n) NAME=${OPTARG};;
|
||||
i) BRIDGE=${OPTARG};;
|
||||
r) REGURL=${OPTARG};;
|
||||
l) LOGIN=${OPTARG};;
|
||||
c) clean=1;;
|
||||
u) net_update=1;;
|
||||
U) update_json=1;;
|
||||
*) log "Invalid options";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "${NAME}" ]; then
|
||||
log "Emtpy container name"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${update_json}" -eq 1 ]; then
|
||||
update_config_json
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -n "${REGURL}" ]; then
|
||||
pull_image_from_registry
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "$clean" -eq 1 ]; then
|
||||
clean_container_network "${NAME}"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -z "${BRIDGE}" ]; then
|
||||
log "Empty bridge name"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ "${net_update}" -eq 1 ]; then
|
||||
get_veth_name "${NAME}"
|
||||
brctl addif "${BRIDGE}" "${VETHNAME}"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if [ -n "${BUNDLE}" ] ; then
|
||||
run_container "${BUNDLE}" "${NAME}" "${BRIDGE}"
|
||||
fi
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
lxc=""
|
||||
lxc_bundle=""
|
||||
oci_bundle=""
|
||||
|
||||
if [ -f "/etc/lxc/lxc.conf" ]; then
|
||||
lxc=$(cat /etc/lxc/lxc.conf |grep "lxc.lxcpath"| cut -d "=" -f 2)
|
||||
fi
|
||||
|
||||
config_load swmodd
|
||||
config_get lxc_bundle globals lxc_bundle_root ""
|
||||
config_get oci_bundle globals oci_bundle_root ""
|
||||
|
||||
if [ -n "${lxc_bundle}" ]; then
|
||||
# if lxc_bundle_root define in swmodd, update it in lxc path
|
||||
mkdir -p /etc/lxc
|
||||
echo "lxc.lxcpath = ${lxc_bundle}" > /etc/lxc/lxc.conf
|
||||
elif [ -n "${lxc}" ]; then
|
||||
# if lxc_bundle_root not define in swmodd, update it with lxc path
|
||||
uci_set swmodd globals lxc_bundle_root ${lxc}
|
||||
uci_commit
|
||||
else
|
||||
mkdir -p /etc/lxc
|
||||
echo "lxc.lxcpath = /srv/" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals lxc_bundle_root "/srv/"
|
||||
uci_commit
|
||||
fi
|
||||
|
||||
if [ -z "${oci_bundle}" ] && [ -n "${lxc_bundle}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc_bundle_root if defined
|
||||
uci_set swmodd globals oci_bundle_root ${lxc_bundle}
|
||||
uci_commit
|
||||
elif [ -z "${oci_bundle}" ] && [ -n "${lxc}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc path
|
||||
uci_set swmodd globals oci_bundle_root ${lxc}
|
||||
uci_commit
|
||||
elif [ -z "${oci_bundle}" ]; then
|
||||
uci_set swmodd globals oci_bundle_root "/srv/"
|
||||
uci_commit
|
||||
fi
|
||||
@@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=twamp
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_VERSION:=1.2.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -19,6 +19,7 @@ endif
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -27,7 +28,7 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=TWAMP Light Client(TR-390)
|
||||
DEPENDS:=+libuci +ubox +libubus +libbbf_api
|
||||
DEPENDS:=+libuci +ubox +libubus
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=udpecho
|
||||
PKG_VERSION:=2.0.2
|
||||
PKG_VERSION:=2.0.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -24,6 +24,7 @@ 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
|
||||
|
||||
@@ -34,7 +35,7 @@ define Package/$(PKG_NAME)-server
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF UDP Echo Server
|
||||
DEPENDS:=+libuci +libbbf_api
|
||||
DEPENDS:=+libuci
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)-client
|
||||
|
||||
@@ -1,27 +1,28 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=umoci
|
||||
PKG_VERSION:=0.4.7
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_VERSION:=0.0.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_NAME:=umoci
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/opencontainers/umoci/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=c01b36de6fdc513eb65add57bc882d72f94fc3b4b65a8f9ef59826fb754af93e
|
||||
PKG_SOURCE_URL:=https://github.com/opencontainers/umoci.git
|
||||
PKG_SOURCE_VERSION:=2cec49f54b72684ef170f11c708c56140f298bf7
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
GO_PKG:=github.com/opencontainers/umoci/
|
||||
GO_PKG_LDFLAGS_X:=main.gitCommit=$(PKG_SOURCE_VERSION) main.version=$(PKG_SOURCE_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
GOLANG_PACKAGE_MK:=$(wildcard $(TOPDIR)/feeds/*/lang/golang/golang-package.mk)
|
||||
GOLANG_HOST_PACKAGE_MK:=$(wildcard $(TOPDIR)/feeds/*/lang/golang/golang-host-build.mk)
|
||||
|
||||
# verify that there is only one single file returned
|
||||
ifneq (1,$(words $(GOLANG_PACKAGE_MK)))
|
||||
@@ -35,7 +36,6 @@ $(info found golang-package.mk at $(GOLANG_PACKAGE_MK))
|
||||
endif
|
||||
|
||||
include $(GOLANG_PACKAGE_MK)
|
||||
include $(GOLANG_HOST_PACKAGE_MK)
|
||||
|
||||
define Package/umoci
|
||||
SECTION:=utils
|
||||
@@ -61,7 +61,5 @@ define Package/umoci/install
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/umoci $(1)/usr/bin
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinHostBuild))
|
||||
$(eval $(call HostBuild))
|
||||
$(eval $(call GoBinPackage,umoci))
|
||||
$(eval $(call BuildPackage,umoci))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=usp-js
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=0.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/websdk/usp-js.git
|
||||
@@ -17,55 +17,26 @@ PKG_MIRROR_HASH:=skip
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=node-yarn/host
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/usp-js/default
|
||||
define Package/usp-js
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=A JS library for USP(TR369) protocol
|
||||
DEPENDS:=+quickjs +quickjs-websocket
|
||||
endef
|
||||
|
||||
define Package/usp-js/description
|
||||
A JS library to provide USP(TR369) protocol functionality for an usp controller.
|
||||
endef
|
||||
|
||||
define Package/usp-js-quickjs
|
||||
$(Package/usp-js/default)
|
||||
TITLE += (QuickJS)
|
||||
DEPENDS:=+quickjs +quickjs-websocket
|
||||
VARIANT:=quickjs
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/usp-js-nodejs
|
||||
$(Package/usp-js/default)
|
||||
TITLE += (NodeJS)
|
||||
DEPENDS:=+node
|
||||
VARIANT:=nodejs
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),nodejs)
|
||||
define Build/Compile
|
||||
cd $(PKG_BUILD_DIR) && yarn install && yarn build
|
||||
cd $(PKG_BUILD_DIR) && npm install @types/node --save-dev && yarn qjs
|
||||
endef
|
||||
else
|
||||
define Build/Compile
|
||||
cd $(PKG_BUILD_DIR) && yarn install && yarn qjs
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/usp-js-quickjs/install
|
||||
define Package/usp-js/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/usp-js
|
||||
$(CP) $(PKG_BUILD_DIR)/qjs/* $(1)/usr/lib/usp-js/
|
||||
endef
|
||||
|
||||
define Package/usp-js-nodejs/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/node_modules/usp-js
|
||||
$(INSTALL_DIR) $(1)/usr/lib/node_modules/usp-js/node_modules
|
||||
$(CP) $(PKG_BUILD_DIR)/node/* $(1)/usr/lib/node_modules/usp-js/
|
||||
$(CP) $(PKG_BUILD_DIR)/node_modules/* $(1)/usr/lib/node_modules/usp-js/node_modules/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,usp-js-nodejs))
|
||||
$(eval $(call BuildPackage,usp-js-quickjs))
|
||||
$(eval $(call BuildPackage,usp-js))
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uspd
|
||||
PKG_VERSION:=2.2.14
|
||||
PKG_VERSION:=2.2.14.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/uspd.git
|
||||
PKG_SOURCE_VERSION:=1c3b886bb5e654049ae81cda726dffae950369c7
|
||||
PKG_SOURCE_VERSION:=e7d95cb3cb4d28b7fe0df678a9d27c3ab173f5bd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
70
voicemngr/Makefile
Normal file
70
voicemngr/Makefile
Normal file
@@ -0,0 +1,70 @@
|
||||
#
|
||||
# Copyright (C) 2022 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=voicemngr
|
||||
PKG_VERSION:=0.1
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_SRC_DIR:=~/git/voip/voicemngr
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/voicemngr.git
|
||||
PKG_SOURCE_VERSION:=13a14593daa610a87c363a1a0acd19f31f405a71
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
# All config variable that are passed to the make invocation, directly or
|
||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
||||
|
||||
TARGET_PLATFORM:=
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM:=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_qualcomm),y)
|
||||
TARGET_PLATFORM:=QUALCOMM
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
export CONFIG_BRCM_SDK_VER_504021
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
TARGET_CFLAGS += -Wall -Werror
|
||||
|
||||
define Package/voicemngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IOPSYS Voice Manager
|
||||
URL:=
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +uci +TARGET_iopsys_brcm63xx_arm:bcmkernel +TARGET_iopsys_qualcomm:vtsp
|
||||
endef
|
||||
|
||||
define Package/voicemngr/description
|
||||
Voice manager is a daemon that bridges Asterisk and platform specific DSP/SLIC APIs
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@echo "Building from the local source. TARGET_PLATFORM=$(TARGET_PLATFORM)"
|
||||
rsync -av --exclude=.* $(LOCAL_SRC_DIR)/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/voicemngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/voicemngr $(1)/usr/sbin/
|
||||
$(CP) $(PKG_BUILD_DIR)/libvoice/libvoice.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,voicemngr))
|
||||
|
||||
@@ -4,21 +4,16 @@ START=68
|
||||
STOP=12
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=evoice
|
||||
VOICE_UCI_CONFIG=voice
|
||||
NAME=voicemngr
|
||||
|
||||
start_service() {
|
||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
||||
|
||||
|
||||
which endptmngr >/dev/null 2>&1 && {
|
||||
echo "evoice can't be started since endptmngr is installed. Please remove endptmngr and retry"
|
||||
return
|
||||
}
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param env hw_board_hasDect=$(db get hw.board.hasDect)
|
||||
procd_set_param command $NAME
|
||||
procd_set_param respawn "5" "0" "3"
|
||||
procd_set_param nice -12
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
@@ -28,5 +23,5 @@ reload_service() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger $VOICE_UCI_CONFIG
|
||||
procd_add_reload_trigger asterisk
|
||||
}
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wfadatad
|
||||
PKG_VERSION:=2.10.0.0
|
||||
PKG_VERSION:=2.10.1.3
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b75a1271c718e4fb2a45b5ac4fe73d192c864713
|
||||
PKG_SOURCE_VERSION:=9a76703df8faf4165dce70a6e0c9f69bead91d7e
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wfadatad.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -60,7 +60,6 @@ MAKE_FLAGS += DEBUG=1
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-Wno-error=deprecated-declarations \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user