mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-20 01:20:35 +08:00
Compare commits
764 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fefbcdf9b3 | ||
|
|
d2ac9d5684 | ||
|
|
8d4293b22d | ||
|
|
2c05fcc08a | ||
|
|
14344b452c | ||
|
|
c3ac2d0b04 | ||
|
|
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 | ||
|
|
abd741b9e6 | ||
|
|
c33fd589fb | ||
|
|
b1750ac6ba | ||
|
|
de51136608 | ||
|
|
3da3e6b86d | ||
|
|
fdba0d497a | ||
|
|
4092c0e43f | ||
|
|
4b06b07acf | ||
|
|
6636e7ff47 | ||
|
|
ec8a7cffa2 | ||
|
|
41cdc9672c | ||
|
|
6fdf37e179 | ||
|
|
60c198e2e2 | ||
|
|
154b8465a6 | ||
|
|
d352796d46 | ||
|
|
562aefcab2 | ||
|
|
a4c6aec761 | ||
|
|
0e1894e5ff | ||
|
|
ca89315960 | ||
|
|
5764f7dd1d | ||
|
|
3d2b69bd33 | ||
|
|
56bfdfaf57 | ||
|
|
28835fc0ea | ||
|
|
0f7d057261 | ||
|
|
9aaef85895 | ||
|
|
50e1be5214 | ||
|
|
13f1dcfdc3 | ||
|
|
545f41ab6a | ||
|
|
a5306cb837 | ||
|
|
415768dd71 | ||
|
|
744bd43658 | ||
|
|
f6cdb4c55d | ||
|
|
01d009734c | ||
|
|
120e333a67 | ||
|
|
caf1367dd2 | ||
|
|
82d3171604 | ||
|
|
68b8051fb2 | ||
|
|
9fc87d618b | ||
|
|
013a2f2b19 | ||
|
|
b4d831147e | ||
|
|
2816342a69 | ||
|
|
68bb2d48d5 | ||
|
|
4333127c74 | ||
|
|
d03fa0c5e3 | ||
|
|
584e3db8f0 | ||
|
|
4e365be18e | ||
|
|
e722665f2f | ||
|
|
7566301349 | ||
|
|
213f840309 | ||
|
|
35c58d63d7 | ||
|
|
8382bcc0ac | ||
|
|
ac32ff013e | ||
|
|
3d077f2a18 | ||
|
|
1d6c3b5466 | ||
|
|
47130407a5 | ||
|
|
9f7db62c89 | ||
|
|
8d1d4b5590 | ||
|
|
889524d9a7 | ||
|
|
f293fa36a7 | ||
|
|
ab144f4af9 | ||
|
|
621010e16b | ||
|
|
3f2b130848 | ||
|
|
504c78965d | ||
|
|
c625d8dc29 | ||
|
|
9234254f76 | ||
|
|
436751ce8f | ||
|
|
30bf53c79c | ||
|
|
775b71b6f1 | ||
|
|
cf08d70000 | ||
|
|
48727867eb | ||
|
|
e82294aa2f | ||
|
|
768304c5a1 | ||
|
|
00c6557d0a | ||
|
|
1c22d7a19d | ||
|
|
1eb12b7923 | ||
|
|
1661322307 | ||
|
|
a408642afa | ||
|
|
62b1d840dc | ||
|
|
55afadf895 | ||
|
|
4c4e12a8ff | ||
|
|
73c5d2c481 | ||
|
|
7c041f933d | ||
|
|
fddb7e3ba7 | ||
|
|
bf82f6966d | ||
|
|
81a348efee | ||
|
|
f24602d8d4 | ||
|
|
0f5677e544 | ||
|
|
02d52bd9e1 | ||
|
|
acb2f35982 | ||
|
|
c1ef23456b | ||
|
|
00fd54ba1b | ||
|
|
3406185b1c | ||
|
|
6f233e19bf | ||
|
|
9227f52a16 | ||
|
|
70889fd1ae | ||
|
|
c09267da8f | ||
|
|
d4a9cde562 | ||
|
|
1824013aeb | ||
|
|
13c858421c | ||
|
|
a917d47854 | ||
|
|
4c11a12d11 | ||
|
|
73a7d9cc42 | ||
|
|
68a51047e9 | ||
|
|
42db3eaf5d | ||
|
|
8c867fc829 | ||
|
|
c9bc7a3dea | ||
|
|
7c05f41418 | ||
|
|
47fe3342d3 | ||
|
|
135b15c101 | ||
|
|
26a75d11f0 | ||
|
|
85a20c9485 | ||
|
|
e239e77fdd | ||
|
|
4824b441b6 | ||
|
|
3bb9298485 | ||
|
|
557ed06daa | ||
|
|
1f0e4a191c | ||
|
|
03e29020e2 | ||
|
|
f314c20b8a | ||
|
|
5f2e737e7c | ||
|
|
0e32d885b0 | ||
|
|
363ae3044e | ||
|
|
2f5d167976 | ||
|
|
558936d23d | ||
|
|
b946784deb | ||
|
|
7adf27bcaf | ||
|
|
85d804d575 | ||
|
|
4a756c84c7 | ||
|
|
db91f3809a | ||
|
|
55ba075a82 | ||
|
|
98403702fe | ||
|
|
f50af42366 | ||
|
|
9ea69b1c07 | ||
|
|
338856f15d | ||
|
|
a5459d4ee6 | ||
|
|
d143e9af96 | ||
|
|
bf7e5fca47 | ||
|
|
eb1224022e | ||
|
|
55835b3af0 | ||
|
|
e0eec6c755 | ||
|
|
c8e1e6538a | ||
|
|
3e60ebb118 | ||
|
|
42bd799915 | ||
|
|
64369a08f4 | ||
|
|
3dd570990e | ||
|
|
7e8f51d15b | ||
|
|
2faada9f0b | ||
|
|
1d88107cc6 | ||
|
|
65ecbbde31 | ||
|
|
0c8b29d7d5 | ||
|
|
45f0f50740 | ||
|
|
6ecc48540f | ||
|
|
a027edeca2 | ||
|
|
dd25486412 | ||
|
|
d345eefd86 | ||
|
|
4b272be181 | ||
|
|
09d49cb77d | ||
|
|
0e8b8eb69d | ||
|
|
a2610d371d | ||
|
|
e1886e61bc | ||
|
|
c1f4056723 | ||
|
|
1a404e9be5 | ||
|
|
6899e35524 | ||
|
|
17c9858783 | ||
|
|
eb4e698b90 | ||
|
|
c30b8937a0 | ||
|
|
491098c51f | ||
|
|
f190fd9085 | ||
|
|
96b7aad9f2 | ||
|
|
0166ee6540 | ||
|
|
bcd9d70c52 | ||
|
|
6ce86e0a68 | ||
|
|
b206df8ad9 | ||
|
|
4a09f80d40 | ||
|
|
32fbe3288f | ||
|
|
9d099ff1ce | ||
|
|
c03c76c74f | ||
|
|
000da5e808 | ||
|
|
2343ace07c | ||
|
|
a45cef5c05 | ||
|
|
af6ca71559 | ||
|
|
0418327c52 | ||
|
|
cca1c6e81d | ||
|
|
4cc8c9a21c | ||
|
|
bc73e56726 | ||
|
|
eb2d8c8f27 | ||
|
|
49ccbe6155 | ||
|
|
89c58e227c | ||
|
|
e706738f96 | ||
|
|
55a1541818 | ||
|
|
10e62c21f4 | ||
|
|
b37aa436ec | ||
|
|
5fff1f2033 | ||
|
|
7affe60a46 | ||
|
|
5a3d08ba6d | ||
|
|
82cbab5ab1 | ||
|
|
2e04d78a14 | ||
|
|
fc2f823119 | ||
|
|
cbf545ac16 | ||
|
|
ce077af70f | ||
|
|
fac288f20b | ||
|
|
b0828849bd | ||
|
|
39855bba25 | ||
|
|
bf4bc1a299 | ||
|
|
bf6a343b97 | ||
|
|
3d592d1dad | ||
|
|
d56da82dc9 | ||
|
|
1510578835 | ||
|
|
a1170e71a7 | ||
|
|
6eee7361c2 | ||
|
|
a294c93902 | ||
|
|
9f9626afb0 | ||
|
|
36ce5e1576 | ||
|
|
3d545d9945 | ||
|
|
d756a2035d | ||
|
|
175d381fb9 | ||
|
|
6e4c42caaa | ||
|
|
f43f8fd966 | ||
|
|
f1f75c0b6b | ||
|
|
f9917d4ab7 | ||
|
|
3bc4565eb8 | ||
|
|
de3f8bc4a4 | ||
|
|
27446d78f9 | ||
|
|
cfe4dda3fc | ||
|
|
a6910c046d | ||
|
|
997d2d2ff5 | ||
|
|
507a565080 | ||
|
|
10c4073908 | ||
|
|
5d1bbf98e1 | ||
|
|
0f5e784719 | ||
|
|
c270557622 | ||
|
|
a84277895e | ||
|
|
8c86c9092b | ||
|
|
fad159b675 | ||
|
|
4f8f1d9088 | ||
|
|
0270bff547 | ||
|
|
6aad51cb76 | ||
|
|
53d7e61083 | ||
|
|
7b75bc85f3 | ||
|
|
cac2ba3726 | ||
|
|
7dccc922e1 | ||
|
|
0dc0da4c83 | ||
|
|
3554edcff0 | ||
|
|
603ecff2a2 | ||
|
|
969e757401 | ||
|
|
fee4015a35 | ||
|
|
a5493549de | ||
|
|
ee4c55b8cc | ||
|
|
951ffbc2f6 | ||
|
|
bce1cf35f1 | ||
|
|
f1d07dcbb9 | ||
|
|
2c277a0d9f | ||
|
|
690415ef8d | ||
|
|
a3f93465e4 | ||
|
|
8a181eac45 | ||
|
|
dcebd73bdf | ||
|
|
71f1eee194 | ||
|
|
88cb305259 | ||
|
|
9d4d59be76 | ||
|
|
b2416bc33a | ||
|
|
a0fc9fe1d9 | ||
|
|
cb056f5898 | ||
|
|
e4d957cb0c | ||
|
|
b3c5219772 | ||
|
|
ca1e74696e | ||
|
|
f4daa579da | ||
|
|
5eb40eb826 | ||
|
|
2948de9994 | ||
|
|
bd3e0e31be | ||
|
|
f1d113e5a3 | ||
|
|
9b6b591a0f | ||
|
|
9df30a95aa | ||
|
|
b5ae08af16 | ||
|
|
085459fa1e | ||
|
|
099f0ef7c7 | ||
|
|
f899371737 | ||
|
|
e64bde330e | ||
|
|
db5dc9913c | ||
|
|
54772028eb | ||
|
|
2260ef219e | ||
|
|
b5fc63a737 | ||
|
|
9588485c82 | ||
|
|
97f0608370 | ||
|
|
4ea4755257 | ||
|
|
b0a3a373af | ||
|
|
a3ec91cc9e | ||
|
|
4e51aff215 | ||
|
|
b0900b2b00 | ||
|
|
a9dd5fc34a | ||
|
|
bfc334346a | ||
|
|
4b0534dac7 | ||
|
|
cc5972c7c7 | ||
|
|
8138e789ca | ||
|
|
afb6bb9ea6 | ||
|
|
8dd0fe1c76 | ||
|
|
6a23c72c1f | ||
|
|
5760e1cda2 | ||
|
|
4baed7b0a1 | ||
|
|
f189c7a9bb | ||
|
|
466424036b | ||
|
|
b49987d183 | ||
|
|
c198c8a4ff | ||
|
|
7ceeac6e61 | ||
|
|
3dfcaf1457 | ||
|
|
d614a075d9 | ||
|
|
0182049eee | ||
|
|
dc9d51e67e | ||
|
|
ee4d70ba6d | ||
|
|
77c7475cc7 | ||
|
|
3fbdece036 | ||
|
|
1a471f4dac | ||
|
|
3dc5165e79 | ||
|
|
e764096bc6 | ||
|
|
a7f983aaa1 | ||
|
|
160165e80f | ||
|
|
996cb66482 | ||
|
|
0b7cd0e437 | ||
|
|
53e48827f3 | ||
|
|
a4e2799b90 | ||
|
|
a5a05dffa8 | ||
|
|
9c9ab20ce8 | ||
|
|
a225352493 | ||
|
|
0d9b296de6 | ||
|
|
95a5b5ee10 | ||
|
|
128264643c | ||
|
|
0f4cde377e | ||
|
|
c8614876b6 | ||
|
|
4a58161994 | ||
|
|
b9fd030365 | ||
|
|
631617c16c | ||
|
|
54010769ed | ||
|
|
f126ed414a | ||
|
|
de0f3cca89 | ||
|
|
534c63780d | ||
|
|
b6ab2574be | ||
|
|
8bf3db77cc | ||
|
|
7507170ff0 | ||
|
|
0c04002028 | ||
|
|
f3bb3ef39b | ||
|
|
99d12f7829 | ||
|
|
97906205ff | ||
|
|
8cc7e5c2ba | ||
|
|
24fdb79b7c | ||
|
|
b07664f7d5 | ||
|
|
c54e44a820 | ||
|
|
cf44c1a030 | ||
|
|
18c4ab8c9e | ||
|
|
f27619294e | ||
|
|
619b267dac | ||
|
|
04ab56415a | ||
|
|
bea0c35f8c | ||
|
|
8946aa5dee | ||
|
|
e390ee36bf | ||
|
|
09011fdbcc | ||
|
|
d15b40339d | ||
|
|
e0a8c705af | ||
|
|
ff83d37e78 | ||
|
|
88b0cf56a9 | ||
|
|
dba3993ff6 | ||
|
|
2b3c5fa177 | ||
|
|
e4bdbba9b6 | ||
|
|
7f808cf58d | ||
|
|
135cdad388 | ||
|
|
d656e27020 | ||
|
|
fbc58f5635 | ||
|
|
e940d301c3 | ||
|
|
d7ae81bcc8 | ||
|
|
f003c8a2b7 | ||
|
|
153c11902a | ||
|
|
f5017094a8 | ||
|
|
e94d2fd218 | ||
|
|
22790f81ed | ||
|
|
d1d9794962 | ||
|
|
ef4d9334cf | ||
|
|
f75a9f9d8d | ||
|
|
55ab8c9104 | ||
|
|
0c6c6f6cc4 | ||
|
|
0317645cd1 | ||
|
|
e12cf6ffa2 | ||
|
|
1bf745f679 | ||
|
|
53c2e2f0a2 | ||
|
|
0173920c83 | ||
|
|
2bc7ff558e | ||
|
|
df0b0ec7ea | ||
|
|
e2a98f6cf1 | ||
|
|
a169a13b47 | ||
|
|
1fbbaa8c59 | ||
|
|
b214f5213b | ||
|
|
367a2e6084 | ||
|
|
1e0f65be66 | ||
|
|
6d941d04b9 | ||
|
|
e3eb968b05 | ||
|
|
f67eca787f | ||
|
|
dace8147de | ||
|
|
5812d812b1 | ||
|
|
69678f1dbc | ||
|
|
e2d4b3a6f5 | ||
|
|
2ea1145f43 | ||
|
|
dcbd27282d | ||
|
|
f11c6bdbb9 | ||
|
|
70db2e6c67 | ||
|
|
28f1297db7 | ||
|
|
6e314334d8 | ||
|
|
b2562f6fc1 | ||
|
|
58a26135c5 | ||
|
|
a035fb4d6e | ||
|
|
da7df410a8 | ||
|
|
0415ed55c4 | ||
|
|
2e7219ba46 | ||
|
|
0d198eca97 | ||
|
|
f5575df624 | ||
|
|
ad7067e57b | ||
|
|
266b0029b4 | ||
|
|
473c387777 | ||
|
|
44fd9e6ed1 |
@@ -1,7 +1,3 @@
|
||||
if PACKAGE_libbbfdm
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config BBF_VENDOR_EXTENSION
|
||||
bool "Enable Vendor Extension"
|
||||
default y
|
||||
@@ -14,10 +10,6 @@ config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config BBF_TR181
|
||||
bool "Enable TR-181 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR104
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
default y
|
||||
@@ -28,10 +20,12 @@ config BBF_TR143
|
||||
|
||||
config BBFDM_ENABLE_JSON_PLUGIN
|
||||
bool "Enable json plugin to extend datamodel"
|
||||
default n
|
||||
default y
|
||||
|
||||
config BBFDM_ENABLE_DOTSO_PLUGIN
|
||||
bool "Enable shared library plugin to extend datamodel"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
default y
|
||||
|
||||
config BBF_MAX_OBJECT_INSTANCES
|
||||
int "Maximum number of instances per object"
|
||||
default 255
|
||||
|
||||
130
bbf/Makefile
130
bbf/Makefile
@@ -1,41 +1,69 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
# Copyright (C) 2022 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=6.4.18
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_VERSION:=6.8.9.25
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=2758c0380e9dbec87b119df239aee29c7ed1ec48
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_VERSION:=e87b25b08294c608aef1e73d1268b35073097592
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=LGPL-2.1
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/libbbf_api
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for libbbfdm API
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
define Package/libbbfdm/default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband-forum data model
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libcurl
|
||||
TITLE:=Library for broadband forum data model support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libcurl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (internal)
|
||||
VARIANT:=internal
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-mbedtls
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_libbbfdm-mbedtls:libmbedtls
|
||||
VARIANT:=mbedtls
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-openssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-openssl:libopenssl
|
||||
CONFLICTS := libbbfdm-mbedtls
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-wolfssl
|
||||
$(Package/libbbfdm/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_libbbfdm-wolfssl:libwolfssl
|
||||
CONFLICTS := libbbfdm-mbedtls libbbfdm-openssl
|
||||
VARIANT:=wolfssl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -57,72 +85,83 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror \
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR181),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr181
|
||||
endif
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR104),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr104
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR104=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr143
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libopenssl),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libopenssl
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR143=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-vendor-extension
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_EXTENSION=ON
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
BBF_VENDOR_PREFIX="$(CONFIG_BBF_VENDOR_PREFIX)"
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_LIST:String="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES)
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-json-plugin
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_JSON_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared-library
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_DOTSO_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
CMAKE_OPTIONS += -DWITH_WOLFSSL=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
endif
|
||||
|
||||
define Package/libbbf_api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
define Package/libbbfdm/default/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||
$(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/prerm
|
||||
define Package/libbbfdm/default/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
Package/libbbfdm-openssl/prerm = $(Package/libbbfdm/default/prerm)
|
||||
Package/libbbfdm-wolfssl/prerm = $(Package/libbbfdm/default/prerm)
|
||||
Package/libbbfdm-mbedtls/prerm = $(Package/libbbfdm/default/prerm)
|
||||
|
||||
Package/libbbfdm-openssl/install = $(Package/libbbfdm/default/install)
|
||||
Package/libbbfdm-wolfssl/install = $(Package/libbbfdm/default/install)
|
||||
Package/libbbfdm-mbedtls/install = $(Package/libbbfdm/default/install)
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
@@ -131,9 +170,12 @@ define Build/InstallDev
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm.so $(1)/usr/lib/
|
||||
touch $(1)/usr/lib/libbbf_api.so
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbf_api))
|
||||
$(eval $(call BuildPackage,libbbfdm))
|
||||
$(eval $(call BuildPackage,libbbfdm-openssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-wolfssl))
|
||||
$(eval $(call BuildPackage,libbbfdm-mbedtls))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Copyright (C) 2022 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,20 +8,25 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=2.0.3.1
|
||||
|
||||
PKG_SOURCE_VERSION:=b35e7862bc17fc11dc1f757c7b93900995a28633
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
||||
|
||||
PKG_SOURCE_VERSION:=33a6648de9ee0af33c44518656b56b0a30b6c1ab
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
@@ -29,21 +34,24 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=BBF BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +curl +libblobmsg-json +libbbfdm +libbbf_api
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
BBF BulkData Collection
|
||||
DEPENDS:=+libubus +libuci +libubox +libjson-c +libcurl +libblobmsg-json
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/bulkdata/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/*.so $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.so $(1)/usr/lib/bbfdm
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,43 +1,6 @@
|
||||
|
||||
config bulkdata 'bulkdata'
|
||||
option enable '0'
|
||||
#Log levels: Critical=0, Warning=1, Notice=2, Info=3, Debug=4
|
||||
#Log levels: Error=1, Warning=2, Info=3, Debug=4
|
||||
option log_level '3'
|
||||
|
||||
config profile
|
||||
option profile_id '1'
|
||||
option enable '0'
|
||||
option name ''
|
||||
option nbre_of_retained_failed_reports '0'
|
||||
option protocol 'http'
|
||||
option encoding_type ''
|
||||
option reporting_interval '86400'
|
||||
option time_reference '0'
|
||||
option csv_encoding_field_separator ','
|
||||
option csv_encoding_row_separator ' '
|
||||
option csv_encoding_escape_character '"'
|
||||
option csv_encoding_report_format 'column'
|
||||
option csv_encoding_row_time_stamp 'unix'
|
||||
option json_encoding_report_format 'objecthierarchy'
|
||||
option json_encoding_report_time_stamp 'unix'
|
||||
option http_url ''
|
||||
option http_username ''
|
||||
option http_password ''
|
||||
option http_compression 'none'
|
||||
option http_method 'post'
|
||||
option http_use_date_header '1'
|
||||
option http_retry_enable '0'
|
||||
option http_retry_minimum_wait_interval '5'
|
||||
option http_retry_interval_multiplier '2000'
|
||||
option http_persist_across_reboot '0'
|
||||
|
||||
config profile_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
|
||||
config profile_http_request_uri_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Bulkdata Software
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
@@ -10,13 +7,16 @@ USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
|
||||
start_service() {
|
||||
local bulkdata_enable=`uci -q get bulkdata.bulkdata.enable`
|
||||
if [ "$bulkdata_enable" = "1" ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_close_instance
|
||||
fi
|
||||
local enable=$(uci -q get bulkdata.bulkdata.enable)
|
||||
|
||||
[ "$enable" != "1" ] && {
|
||||
return 0
|
||||
}
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
boot() {
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
PROFILE_COUNT=1
|
||||
|
||||
get_next_count()
|
||||
{
|
||||
local config="$1"
|
||||
local default_name="${2}"
|
||||
local count=${3}
|
||||
local found=0
|
||||
|
||||
if [ -z "$count" ]; then
|
||||
count=1
|
||||
fi
|
||||
|
||||
while [ "${found}" -ne 1 ]; do
|
||||
uci -q get ${config}.${default_name}_${count} >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
count=$((count + 1))
|
||||
else
|
||||
found=1;
|
||||
fi
|
||||
done
|
||||
|
||||
echo "${default_name}_${count}"
|
||||
}
|
||||
|
||||
translate_profile_id_to_profile_name() {
|
||||
local section="${1}"
|
||||
local profile_id="${2}"
|
||||
local profile_name="${3}"
|
||||
local curr_profile_id
|
||||
|
||||
config_get curr_profile_id "${section}" profile_id
|
||||
|
||||
[ -n "${curr_profile_id}" ] || return
|
||||
|
||||
[ "${curr_profile_id}" != "${profile_id}" ] && return
|
||||
|
||||
uci -q set bulkdata.${section}.profile_name="${profile_name}"
|
||||
uci -q set bulkdata.${section}.profile_id=""
|
||||
}
|
||||
|
||||
update_profile_sections() {
|
||||
local section="${1}"
|
||||
local default="${2}"
|
||||
local profile_name
|
||||
|
||||
config_get profile_id "${section}" profile_id
|
||||
|
||||
[ -n "${profile_id}" ] || return
|
||||
|
||||
case "${section}" in
|
||||
"cfg"*)
|
||||
profile_name="$(get_next_count bulkdata ${default} ${PROFILE_COUNT})"
|
||||
uci_rename bulkdata "${section}" "${profile_name}"
|
||||
;;
|
||||
esac
|
||||
PROFILE_COUNT=$((PROFILE_COUNT + 1))
|
||||
|
||||
[ -n "$profile_name" ] && section="${profile_name}"
|
||||
|
||||
uci -q set bulkdata.${section}.profile_id=""
|
||||
|
||||
config_foreach translate_profile_id_to_profile_name profile_parameter "${profile_id}" "${profile_name}"
|
||||
config_foreach translate_profile_id_to_profile_name profile_http_request_uri_parameter "${profile_id}" "${profile_name}"
|
||||
}
|
||||
|
||||
config_load bulkdata
|
||||
config_foreach update_profile_sections profile profile
|
||||
uci commit bulkdata
|
||||
|
||||
exit 0
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 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:=crashlog
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=none
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/crashlog
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Handling kernel crash logs
|
||||
endef
|
||||
|
||||
define Package/crashlog/description
|
||||
Handling kernel crash logs.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(CP) ./files/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/crashlog/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,crashlog))
|
||||
Binary file not shown.
@@ -1,11 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=01
|
||||
|
||||
start()
|
||||
{
|
||||
if [ -e /proc/sys/kernel/core_pattern ]
|
||||
then
|
||||
echo "|/sbin/logcore %e %s" > /proc/sys/kernel/core_pattern
|
||||
fi
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
|
||||
send_log()
|
||||
{
|
||||
nr=$(db get hw.board.serial_number)
|
||||
hw=$(db get hw.board.model_name)
|
||||
fam=$(db get hw.board.iopVerFam)
|
||||
sw=$(db get hw.board.iopVersion)
|
||||
server=$(/sbin/uci get system.crashlog.server)
|
||||
|
||||
while true
|
||||
do
|
||||
scp -S /usr/sbin/logssh /proc/last_kmsg log@${server}:log/${fam}_${hw}_${sw}_${nr}
|
||||
if [ $? == 0 ]
|
||||
then
|
||||
break;
|
||||
fi
|
||||
# wait for another minute then try again
|
||||
sleep 60
|
||||
done
|
||||
}
|
||||
|
||||
fill_in_default()
|
||||
{
|
||||
/sbin/uci add system log
|
||||
/sbin/uci rename system.@log[-1]=crashlog
|
||||
/sbin/uci set system.crashlog.enable=no
|
||||
/sbin/uci set system.crashlog.server="crashlog.iopsys.eu"
|
||||
/sbin/uci commit
|
||||
}
|
||||
|
||||
boot()
|
||||
{
|
||||
# is crashlog enabled ?
|
||||
enable=$(/sbin/uci get system.crashlog.enable)
|
||||
case $enable in
|
||||
0|no|NO|false|FALSE)
|
||||
exit 0
|
||||
;;
|
||||
"")
|
||||
fill_in_default
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# is this boot a result from a crash ?
|
||||
reason=$(cat /etc/boot_reason)
|
||||
case $reason in
|
||||
HW|WD)
|
||||
send_log&
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
TMP_CORE=/tmp/new_core
|
||||
# first test if we can contact the log server.
|
||||
# if not abort directly the core file takes up memory
|
||||
alive()
|
||||
{
|
||||
ping -c1 $server
|
||||
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
# drain core file from kernel
|
||||
cat >/dev/null
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
fill_in_default()
|
||||
{
|
||||
/sbin/uci add system log
|
||||
/sbin/uci rename system.@log[-1]=corelog
|
||||
/sbin/uci set system.corelog.enable=no
|
||||
/sbin/uci set system.corelog.server="corelog.iopsys.eu"
|
||||
/sbin/uci commit
|
||||
}
|
||||
|
||||
# is corelog enabled ?
|
||||
enable=$(/sbin/uci get system.corelog.enable)
|
||||
case $enable in
|
||||
0|no|NO|false|FALSE)
|
||||
# drain core file from kernel
|
||||
cat >/dev/null
|
||||
exit 0
|
||||
;;
|
||||
"")
|
||||
fill_in_default
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
server=$(/sbin/uci get system.corelog.server)
|
||||
|
||||
alive
|
||||
|
||||
# dump out the core to disk we need this as scp needs a size before we send data
|
||||
# and this is the only way to know how much data there is
|
||||
cat >$TMP_CORE
|
||||
|
||||
# in case filesystem/memory is full at least kill the core in the kernel memory should give us some
|
||||
# more memory to work with. normally this would do nothing.
|
||||
cat >/dev/null
|
||||
|
||||
nr=$(db get hw.board.serial_number)
|
||||
hw=$(db get hw.board.model_name)
|
||||
fam=$(hw.board.iopVerFam)
|
||||
sw=$(db get hw.board.iopVersion)
|
||||
|
||||
scp -S /usr/sbin/logssh $TMP_CORE log@${server}:log/core_${1}_${2}_${fam}_${hw}_${sw}_${nr}
|
||||
rm $TMP_CORE
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
# we need to have the -y option to dropbear to not halt the scp when
|
||||
# transfering the log file to a new server for the first time.
|
||||
# since we already need this also put in the keyfile
|
||||
|
||||
ssh -y -i /etc/dropbear/logid $@
|
||||
@@ -1,42 +0,0 @@
|
||||
Install scp server.
|
||||
|
||||
Create a user account on a server and make sure it's possible to login to it
|
||||
using ssh.
|
||||
|
||||
For now the user has to be called "log"
|
||||
|
||||
USER is the user name of the account
|
||||
HOME is the user home directory.
|
||||
Both should be changed to the correct value in all following example commands.
|
||||
|
||||
create HOME/bin
|
||||
Put scp_upload in HOME/bin
|
||||
make it executable "chmod a+x HOME/bin/scp_upload"
|
||||
|
||||
create home/.ssh (observer the dot .shh)
|
||||
|
||||
create an empty file HOME/.ssh/authorized_keys
|
||||
|
||||
-------------------------------
|
||||
Now everyhting is setup for use but we have not added any clients.
|
||||
What we need is the public key for the clients.
|
||||
|
||||
For dropbear "dropbearkey -y -f files/etc/dropbear/logid" will generate the public key.
|
||||
|
||||
----------
|
||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwn9RaDAzxW1dTmIhXgFBnpi1lhj8xhYpCVQiPxxdk9IEmH8zjo4y9j3sPkqKOlRnkwjpZIpLEKBnpQTwVIMCU/AG7nDJX3OH9RfS9mLJQLfFL8HyGCyqDezFWldbyovhJZvdUeK4tAXJWv2W3OVHiz2L8IlncBgP/E9DJElsyhhQHsM96UE6tBkXsvXkoDbMSYXFcLbgiUwBKfmM2BF/aPDL45iznGur7/2j9v95PwJ0gtMu9jjNRq+pXCXhTh3bsnczm0MpZC1aiRc9nJAeGIMmhrf15E4jBKgTnrstzJxGVAdajKeR954KcNsS33cS2Wmui2YjmPbBXjqf1frzJ log@iopsys
|
||||
----------
|
||||
|
||||
The public key should be just one line. Add that line to the
|
||||
HOME/.ssh/authorized_keys file on the scp server. Then add the follwoing as
|
||||
the first text on the same line. that is insert before the key data.
|
||||
|
||||
command="HOME/bin/scp_upload",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
|
||||
|
||||
Do not forget to change HOME to the correct value for the server and there
|
||||
should be one space separating the key data and the above text.
|
||||
---------------------------------
|
||||
Now test to make sure that you can upload new files, not download files
|
||||
and not overwrite files from the client.
|
||||
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#! /bin/bash
|
||||
# authorized_keys command="/home/boxi/my_scp",no-port-forwarding,no-agent-forwarding,no-X11-forwarding
|
||||
|
||||
val=`expr match "$SSH_ORIGINAL_COMMAND" "scp"`
|
||||
if [ $val != 3 ]
|
||||
then
|
||||
echo "only scp is allowed for this rsa key"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#strip out "scp" as getopts barf on anything not an option
|
||||
|
||||
args=${SSH_ORIGINAL_COMMAND:3}
|
||||
|
||||
# we must set args to positional paramters otherwise it's next to impossible
|
||||
# to get to the rest of the line that is not arguments.
|
||||
|
||||
set -- $args
|
||||
while getopts "rftdvpq" Option
|
||||
do
|
||||
case $Option in
|
||||
r ) echo "recursive not allowed";exit 1;;
|
||||
f ) echo "reading files not allowed";exit 1;;
|
||||
t ) ;;
|
||||
d ) ;;
|
||||
v ) ;;
|
||||
p ) ;;
|
||||
q ) ;;
|
||||
* ) ;; # Default.
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
file="$*"
|
||||
dir=$(dirname "$file")
|
||||
|
||||
if [ "$dir" != "log" ]
|
||||
then
|
||||
echo "only allowed to write to log/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# try to create uniq files
|
||||
EXTRA=$((0))
|
||||
while [ -e "${file}_${EXTRA}" ]
|
||||
do
|
||||
EXTRA=$((EXTRA +1))
|
||||
done
|
||||
|
||||
logger -t scp_upload "${SSH_ORIGINAL_COMMAND}_${EXTRA}"
|
||||
|
||||
exec ${SSH_ORIGINAL_COMMAND}_${EXTRA}
|
||||
@@ -1,81 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=crun
|
||||
PKG_VERSION:=0.20
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/containers/crun.git
|
||||
PKG_SOURCE_DATE:=2021-06-07
|
||||
PKG_SOURCE_VERSION:=8d6a8b5ab80461cfed19f020a36584af13c32038
|
||||
PKG_MIRROR_HASH:=9ca1f0e530b33ce8820bd03329eb6731c5050d6e7f35bd2463d9a81cc00382e0
|
||||
|
||||
PKG_BUILD_DEPENDS:=argp-standalone
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_MAINTAINER:=Oskari Rauta <oskari.rauta@gmail.com>
|
||||
PKG_LICENSE:=GPL-2.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/crun
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=crun
|
||||
URL:=https://github.com/containers/crun
|
||||
DEPENDS:=@!arc +libseccomp +libcap
|
||||
endef
|
||||
|
||||
define Package/crun/description
|
||||
A fast and low-memory footprint OCI Container Runtime fully written in C.
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS+= \
|
||||
--disable-systemd \
|
||||
--enable-embedded-yajl \
|
||||
--enable-caps \
|
||||
--enable-dl \
|
||||
--enable-seccomp \
|
||||
--enable-bpf
|
||||
|
||||
define Build/Prepare
|
||||
$(call Build/Prepare/Default)
|
||||
$(SED) '/#include <git-version.h>/d' $(PKG_BUILD_DIR)/src/crun.c
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
$(call Build/Configure/Default)
|
||||
|
||||
$(SED) '/#define PACKAGE \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define VERSION \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define GIT_VERSION \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_BUGREPORT \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_NAME \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_STRING \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_TARNAME \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
$(SED) '/#define PACKAGE_VERSION \"/d' $(PKG_BUILD_DIR)/config.h
|
||||
|
||||
echo "#define PACKAGE \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define VERSION \"$(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_NAME \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_VERSION \"$(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_STRING \"$(PKG_NAME) $(PKG_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_TARNAME \"$(PKG_NAME)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define PACKAGE_BUGREPORT \"bugs@openwrt.org\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
echo "#define GIT_VERSION \"$(PKG_SOURCE_VERSION)\"" >> $(PKG_BUILD_DIR)/config.h
|
||||
endef
|
||||
|
||||
define Package/crun/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/crun $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcrun.* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,crun))
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.4.7
|
||||
PKG_VERSION:=3.5.5
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=237bb7280029924e80373ea090e51434def89048
|
||||
PKG_SOURCE_VERSION:=cf4e91ffe0a1d83140fef5b41d16e581e5341cec
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -34,7 +34,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=DECT Manager
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2 +libjson-c
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@@ -53,6 +53,7 @@ endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-Wall \
|
||||
-Werror \
|
||||
-I$(STAGING_DIR)/usr/include/libxml2
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_LINE_SETTINGS_EXTENSION),y)
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
config dect 'global'
|
||||
option log_dect_cmbs 'syslog'
|
||||
option log_dect_cmbs 'syslog'
|
||||
option log_level 'realtime,warning,error'
|
||||
|
||||
BIN
dectmngr/files/etc/dspg/04130011.bin
Normal file
BIN
dectmngr/files/etc/dspg/04130011.bin
Normal file
Binary file not shown.
Binary file not shown.
@@ -11,6 +11,8 @@ PROG=/usr/sbin/dectmngr
|
||||
LOG_PATH=/var/log/dectmngr
|
||||
DB_PATH=/etc/dect
|
||||
|
||||
DECT_GPIO=$(db -q get hw.board.dect_gpio)
|
||||
|
||||
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
|
||||
stop_and_wait_dectmngr() {
|
||||
pidof $NAME && killall -q $NAME
|
||||
@@ -30,7 +32,7 @@ start_service() {
|
||||
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
echo 1 > /sys/class/gpio/gpio14/value
|
||||
[ -n "$DECT_GPIO" ] && echo 1 > /sys/class/gpio/gpio${DECT_GPIO}/value
|
||||
|
||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
||||
@@ -71,7 +73,7 @@ start_service() {
|
||||
stop_service() {
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
echo 0 > /sys/class/gpio/gpio14/value
|
||||
[ -n "$DECT_GPIO" ] && echo 0 > /sys/class/gpio/gpio${DECT_GPIO}/value
|
||||
stop_and_wait_dectmngr
|
||||
}
|
||||
|
||||
@@ -86,8 +88,10 @@ service_triggers()
|
||||
}
|
||||
|
||||
boot() {
|
||||
echo 14 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio14/direction
|
||||
[ -n "$DECT_GPIO" ] && {
|
||||
echo ${DECT_GPIO} > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio${DECT_GPIO}/direction
|
||||
}
|
||||
|
||||
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
|
||||
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
|
||||
|
||||
@@ -28,12 +28,6 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM=MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM=INTEL
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
endif
|
||||
|
||||
@@ -19,7 +19,7 @@ define Package/easy-qos
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Easy QoS
|
||||
DEPENDS:=@(TARGET_intel_mips||TARGET_iopsys_brcm63xx_arm)
|
||||
DEPENDS:=@TARGET_iopsys_brcm63xx_arm
|
||||
endef
|
||||
|
||||
define Package/easy-qos/description
|
||||
@@ -39,11 +39,7 @@ define Package/easy-qos/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(CP) ./files/etc/config/easy_qos $(1)/etc/config/
|
||||
ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
$(CP) ./files/etc/init.d/easy_qos.classcfg $(1)/etc/init.d/easy_qos
|
||||
else
|
||||
$(CP) ./files/etc/init.d/easy_qos.iptables $(1)/etc/init.d/easy_qos
|
||||
endif
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
$(CP) ./files/etc/firewall.easyqos $(1)/etc/firewall.easyqos
|
||||
endef
|
||||
|
||||
@@ -1,301 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
RULE_LIST="/tmp/easy_qos_rule.list"
|
||||
CLIENT_LIST="/tmp/easy_qos_class_client.list"
|
||||
BRIDGE_INTF=""
|
||||
|
||||
[ -f /etc/profile.d/intel.sh ] && {
|
||||
. /etc/profile.d/intel.sh
|
||||
sh /etc/profile.d/intel.sh
|
||||
}
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t easy_qos_class -p debug
|
||||
}
|
||||
|
||||
exec_log() {
|
||||
${@}
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
fi
|
||||
}
|
||||
|
||||
exec_class_log() {
|
||||
${@} |grep -i successful
|
||||
if [ "${?}" -ne 0 ]; then
|
||||
log "Failed to create ${@}";
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 8;;
|
||||
"low")
|
||||
echo 7;;
|
||||
"besteffort")
|
||||
echo 6;;
|
||||
"normal")
|
||||
echo 5;;
|
||||
"video")
|
||||
echo 4;;
|
||||
"medium")
|
||||
echo 3;;
|
||||
"high")
|
||||
echo 2;;
|
||||
"highest")
|
||||
echo 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_mark() {
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo "0x41/0x3df";;
|
||||
"low")
|
||||
echo "0x82/0x3df";;
|
||||
"besteffort")
|
||||
echo "0xc3/0x3df";;
|
||||
"normal")
|
||||
echo "0x104/0x3df";;
|
||||
"video")
|
||||
echo "0x145/0x3df";;
|
||||
"medium")
|
||||
echo "0x186/0x3df";;
|
||||
"high")
|
||||
echo "0x1c7/0x3df";;
|
||||
"highest")
|
||||
echo "0x208/0x3df";;
|
||||
esac
|
||||
}
|
||||
|
||||
clean_client_entries() {
|
||||
[ -f ${CLIENT_LIST} ] && rm ${CLIENT_LIST}
|
||||
}
|
||||
|
||||
map_client_entries() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(ubus call router.network 'clients')"
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_select ${key}
|
||||
json_get_vars ipaddr macaddr hostname
|
||||
clients="${macaddr} ${ipaddr} ${hostname};${clients}"
|
||||
json_select ..
|
||||
done
|
||||
|
||||
json_init
|
||||
|
||||
IFS=";"
|
||||
for client in ${clients};
|
||||
do
|
||||
macaddr=$(echo ${client} | cut -d" " -f1)
|
||||
json_add_object "${macaddr//:/_}"
|
||||
json_add_string "ip" "$(echo ${client} | cut -d" " -f2)"
|
||||
json_add_string "macaddr" "$(echo ${client} | cut -d" " -f1)"
|
||||
json_add_string "host" "$(echo ${client} | cut -d" " -f3)"
|
||||
json_close_object
|
||||
done
|
||||
|
||||
IFS=' '
|
||||
echo `json_dump` > ${CLIENT_LIST}
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# Find the IP of a corresponding mac from arp table
|
||||
get_ipaddress() {
|
||||
local clients ip mac host
|
||||
|
||||
json_load "$(cat ${CLIENT_LIST})"
|
||||
json_get_keys keys
|
||||
|
||||
# jshn seems a bit iffy on having : in key, replace by _
|
||||
json_select "${1//:/_}" 2 > /dev/null
|
||||
json_get_var ip ip
|
||||
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
check_and_create() {
|
||||
iptables -t mangle -C PREROUTING ${@} 2>/dev/null
|
||||
# Create rule if not exists
|
||||
if [ ${?} -ne 0 ]; then
|
||||
exec_log iptables -t mangle -A PREROUTING ${@}
|
||||
else
|
||||
log "Rule exists for ${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_ip_rule() {
|
||||
local proto=$1; shift
|
||||
local src_ip=$1; shift
|
||||
local mark=$1; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
|
||||
cmd="-j EXTMARK --set-mark ${mark}";
|
||||
if [ "${proto}" != "icmp" ]; then
|
||||
if [ -n "${ports}" ]; then
|
||||
cmd="--match multiport --dports ${ports} ${cmd}";
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${proto}" == "icmp" ]; then
|
||||
cmd="-p icmp -m icmp --icmp-type 8 $cmd"
|
||||
elif [ "${proto}" == "all" ]; then
|
||||
cmd="-p all $cmd"
|
||||
else
|
||||
cmd="-p ${proto} -m ${proto} $cmd"
|
||||
fi
|
||||
cmd="-s ${src_ip} $cmd"
|
||||
|
||||
check_and_create ${cmd}
|
||||
}
|
||||
|
||||
is_lan_bridge() {
|
||||
local _section=$1
|
||||
local _type
|
||||
local _is_lan
|
||||
|
||||
config_get _type "$section" "type"
|
||||
config_get _is_lan "$section" "is_lan"
|
||||
|
||||
if [ "${_type}" == "bridge" -a "${_is_lan}" == "1" ]; then
|
||||
BRIDGE_INTF="br-${_section}"
|
||||
fi
|
||||
}
|
||||
|
||||
get_bridge_interface() {
|
||||
config_load network
|
||||
config_foreach is_lan_bridge interface
|
||||
}
|
||||
|
||||
validate_rule_section()
|
||||
{
|
||||
uci_validate_section easy_qos rule "${1}" \
|
||||
'priority:string' \
|
||||
'macaddr:string' \
|
||||
'proto:string:none' \
|
||||
'port:list(uinteger)' \
|
||||
'comment:string:none'
|
||||
}
|
||||
|
||||
# Clear existing rules before applying new rules
|
||||
clear_existing_rules() {
|
||||
# execute the delete rules written onto a file then delete the file
|
||||
[ -f ${RULE_LIST} ] || return 0
|
||||
|
||||
while read line
|
||||
do
|
||||
log "Deleting old classification rules"
|
||||
exec_class_log classcfg -D ${line} -i ${BRIDGE_INTF}
|
||||
done <${RULE_LIST}
|
||||
|
||||
local rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||
while [ -n "${rule}" ]; do
|
||||
exec_log iptables -t mangle ${rule}
|
||||
rule=$(iptables -t mangle -S PREROUTING|grep -m 1 EXTMARK |sed 's/-A/-D/1')
|
||||
done
|
||||
sync
|
||||
|
||||
[ -f ${RULE_LIST} ] && rm ${RULE_LIST}
|
||||
}
|
||||
|
||||
# classcfg -M local_dhcp -i lo -p udp --dport 67:67 --dport 68:68 -j mark --mark 1
|
||||
create_rule() {
|
||||
local proto=$1; shift
|
||||
local mac_addr=$1; shift
|
||||
local mark=$1; shift
|
||||
local ports=$1;
|
||||
local cmd="";
|
||||
# Rule name is uniqe, so we take hash of all the input as rule_name
|
||||
local rule_name="$(echo ${mac_addr}${proto}${mark}${ports} |md5sum |head -c 30)"
|
||||
|
||||
cmd="-j mark --mark ${mark}";
|
||||
|
||||
if [ "${mac_addr}" != "none" ]; then
|
||||
cmd="--smac ${mac_addr} ${cmd}";
|
||||
fi
|
||||
|
||||
if [ "${proto}" != "icmp" ]; then
|
||||
if [ "${ports}" != "none" ]; then
|
||||
IFS=","
|
||||
for port in ${ports};
|
||||
do
|
||||
cmd="--dport ${port}:${port} ${cmd}";
|
||||
done
|
||||
IFS=' '
|
||||
fi
|
||||
fi
|
||||
if [ "${proto}" != "none" ]; then
|
||||
cmd="-p ${proto} $cmd"
|
||||
fi
|
||||
cmd="-i ${BRIDGE_INTF} $cmd"
|
||||
cmd="-A ${rule_name} $cmd"
|
||||
|
||||
# Store the rule_names for cleanup on reload
|
||||
exec_class_log classcfg ${cmd}
|
||||
[ $? -eq 0 ] && \
|
||||
echo ${rule_name} >> ${RULE_LIST}
|
||||
}
|
||||
|
||||
manage_rule() {
|
||||
local cfg="$1"
|
||||
local priority macaddr proto port comment prio_num port_list ip ipmark
|
||||
|
||||
validate_rule_section "${1}" || {
|
||||
log "Validation of section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
prio_num=$(get_priority ${priority})
|
||||
port_list=$(echo ${port}|sed 's/ /,/g')
|
||||
ipmark=$(get_mark ${priority})
|
||||
ip=$(get_ipaddress ${macaddr})
|
||||
|
||||
if [ -n "${prio_num}" ]; then
|
||||
if [ "${proto}" == "none" -o "${proto}" == "tcpudp" ]; then
|
||||
create_rule tcp ${macaddr} ${prio_num} ${port_list}
|
||||
create_rule udp ${macaddr} ${prio_num} ${port_list}
|
||||
if [ -n "${ip}" ]; then
|
||||
create_ip_rule tcp ${ip} ${ipmark} ${port_list}
|
||||
create_ip_rule udp ${ip} ${ipmark} ${port_list}
|
||||
fi
|
||||
else
|
||||
create_rule ${proto} ${macaddr} ${prio_num} ${port_list}
|
||||
if [ -n "${ip}" ]; then
|
||||
create_ip_rule ${proto} ${ip} ${ipmark} ${port_list}
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
get_bridge_interface
|
||||
map_client_entries
|
||||
clear_existing_rules
|
||||
config_load easy_qos
|
||||
config_foreach manage_rule rule
|
||||
clean_client_entries
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -x /opt/intel/usr/sbin/classcfg ] || exit 0
|
||||
reload_service
|
||||
log "Easy QoS class installed"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "easy_qos" "network"
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.4.34
|
||||
PKG_VERSION:=6.4.52
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=dd2ab2e5b83d585849aae3d539c1a8cd6dcb7146
|
||||
PKG_SOURCE_VERSION:=822e9a50790970d14db254ffe3d7464709bcd3ca
|
||||
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
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_VERSION:=0.6
|
||||
PKG_VERSION:=0.7
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=548fa04d2714feeadb500192905fa6fb8172e6dd
|
||||
PKG_SOURCE_VERSION:=dc12712af8c4088f7873502ca845e51c68a1ada9
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
export BUILD_DIR
|
||||
@@ -56,6 +56,10 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-Wall \
|
||||
-Werror
|
||||
|
||||
define Package/endptmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
@@ -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:=7e013f0afa68378d38a6bdc9b0c5a342bd3dd0a5
|
||||
PKG_SOURCE_VERSION:=0ebaf1e7d1f09318ae75d0f475a25280742b790e
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
@@ -38,9 +38,6 @@ define Package/$(PKG_NAME)/description
|
||||
Command to extract sub images from FIT images.
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS+="-Wall"
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
|
||||
@@ -45,12 +45,12 @@ MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
|
||||
MODULES_SUBDIR:=lib/modules/4.19.183
|
||||
TARGET_CROSS:=$(CONFIG_BCM_TOOLCHAIN)/bin/$(CONFIG_BCM_TOOLTUPLE)
|
||||
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:=/opt/toolchains/crosstools-aarch64-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/bin/aarch64-buildroot-linux-gnu-
|
||||
TARGET_CROSS:=$(CONFIG_BRCM_ALT_TOOLCHAIN_BASE)/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_TOPDIR)/bin/$(CONFIG_BRCM_ALT_AARCH64_TOOLCHAIN_PREFIX)-
|
||||
endif
|
||||
# For some reason, Broadcom's kernel does not set the include paths correctly when compiling out-of-tree modules
|
||||
EXTRA_KCPPFLAGS:="-I $(LINUX_DIR)/../bcmkernel/include -I $(LINUX_DIR)/arch/arm/mach-bcm963xx/include"
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
if PACKAGE_icwmp
|
||||
|
||||
menu "Configuration"
|
||||
choice
|
||||
prompt "Select ACS sever"
|
||||
default CWMP_ACS_MULTI
|
||||
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 "HDM"
|
||||
bool "Select HDM as ACS server"
|
||||
endchoice
|
||||
|
||||
config CWMP_DEBUG
|
||||
bool "Compile with debug options"
|
||||
default y
|
||||
|
||||
config CWMP_DEVEL_DEBUG
|
||||
bool "Compile with development debug options"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
|
||||
109
icwmp/Makefile
109
icwmp/Makefile
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys Software Solutions AB
|
||||
# Copyright (C) 2020-2022 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,45 +8,71 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=8.2.25
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_VERSION:=8.4.25.10
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=22a1606d972d2dd05b23abe94323f72232727b37
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_VERSION:=cb601366e6a91db532ba7d577f653a2b86c4a479
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_CWMP_ACS_MULTI \
|
||||
CONFIG_CWMP_ACS_HDM \
|
||||
CONFIG_CWMP_DEBUG \
|
||||
CONFIG_CWMP_DEVEL_DEBUG
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
define Package/icwmp/default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl
|
||||
TITLE:=TR069 CWMP client
|
||||
DEPENDS:=+libuci +libubox +libblobmsg-json +libubus +libjson-c +libcurl +mxml
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
A free client implementation of CWMP (TR-069) protocol
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
|
||||
define Package/icwmp-openssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS += +PACKAGE_icwmp-openssl:libopenssl
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config_cwmp.in"
|
||||
define Package/icwmp-wolfssl
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (wolfssl)
|
||||
DEPENDS += +PACKAGE_icwmp-wolfssl:libwolfssl
|
||||
CONFLICTS := icwmp-openssl
|
||||
VARIANT:=wolfssl
|
||||
endef
|
||||
|
||||
define Package/icwmp-mbedtls
|
||||
$(Package/icwmp/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS += +PACKAGE_icwmp-mbedtls:libmbedtls
|
||||
CONFLICTS := icwmp-openssl icwmp-wolfssl
|
||||
VARIANT:=mbedtls
|
||||
DEFAULT_VARIANT:=1
|
||||
endef
|
||||
|
||||
ifeq ($(BUILD_VARIANT),openssl)
|
||||
CONFIGURE_ARGS += --enable-libopenssl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),wolfssl)
|
||||
CONFIGURE_ARGS += --enable-libwolfssl
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CONFIGURE_ARGS += --enable-libmbedtls
|
||||
endif
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
define Build/Prepare
|
||||
@@ -54,46 +80,29 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-acs=multi
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_HDM),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-acs=hdm
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_DEBUG),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-debug
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CWMP_DEVEL_DEBUG),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-devel
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
define Package/icwmp/default/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-icwmp-generate-ssl $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)/etc/bbfdm/json/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
Package/icwmp-openssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-wolfssl/install = $(Package/icwmp/default/install)
|
||||
Package/icwmp-mbedtls/install = $(Package/icwmp/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,icwmp-openssl))
|
||||
$(eval $(call BuildPackage,icwmp-wolfssl))
|
||||
$(eval $(call BuildPackage,icwmp-mbedtls))
|
||||
|
||||
36
icwmp/files/etc/bbfdm/json/CWMPManagementServer.json
Normal file
36
icwmp/files/etc/bbfdm/json/CWMPManagementServer.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"json_plugin_version": 1,
|
||||
"Device.CWMPManagementServer.": {
|
||||
"type": "object",
|
||||
"version": "2.15",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"dependency": "file:/etc/config/cwmp",
|
||||
"EnableCWMP": {
|
||||
"type": "boolean",
|
||||
"version": "2.15",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"mapping": [
|
||||
{
|
||||
"type": "uci",
|
||||
"uci": {
|
||||
"file": "cwmp",
|
||||
"section": {
|
||||
"name": "cpe"
|
||||
},
|
||||
"option": {
|
||||
"name": "enable"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,15 +11,15 @@ config acs 'acs'
|
||||
option retry_min_wait_interval '5'
|
||||
# possible configs interval :[1000:65535]
|
||||
option retry_interval_multiplier '2000'
|
||||
option https_ssl_capath ''
|
||||
option ipv6_enable '0'
|
||||
option ip_version '4'
|
||||
|
||||
config cpe 'cpe'
|
||||
option interface 'eth0.1'
|
||||
option enable '1'
|
||||
option default_wan_interface 'wan'
|
||||
option default_lan_interface 'lan'
|
||||
option log_to_console 'disable'
|
||||
option log_to_file 'enable'
|
||||
option log_to_file 'disable'
|
||||
# log_severity: INFO (Default)
|
||||
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
|
||||
option log_severity 'INFO'
|
||||
|
||||
@@ -6,7 +6,6 @@ log() {
|
||||
}
|
||||
|
||||
if [ ! -f "/var/state/cwmp" ]; then
|
||||
touch "/var/state/cwmp"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,43 +1,29 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo $@ |logger -t cwmp.update -p info
|
||||
echo "$@" |logger -t cwmp.update -p info
|
||||
}
|
||||
|
||||
handle_icwmp_update() {
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
local vendorspecinf=`ifstatus ${defwan} | jsonfilter -e "@.data.vendorspecinf"`
|
||||
local cwmp_enable
|
||||
config_load cwmp
|
||||
|
||||
log "Handling dhcp option value ${vendorspecinf}"
|
||||
[ -n "$vendorspecinf" ] && {
|
||||
local url=""
|
||||
local old_url="$(uci -q get cwmp.acs.dhcp_url)"
|
||||
config_get_bool cwmp_enable cpe enable 1
|
||||
if [ "$cwmp_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
case $vendorspecinf in
|
||||
http://*|https://*)
|
||||
url="${vendorspecinf}"
|
||||
;;
|
||||
*)
|
||||
for optval in $vendorspecinf; do
|
||||
case $optval in
|
||||
1=*)
|
||||
url="$(echo $optval | cut -d"=" -f2-)"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$url" ]; then
|
||||
log "## icwmp url[${old_url}] changed to [${url}]"
|
||||
if [ "${url}" != "${old_url}" ]; then
|
||||
log "Restarting icwmp url[${old_url}] changed to [${url}]"
|
||||
uci -q set cwmp.acs.dhcp_url="$url"
|
||||
uci commit cwmp
|
||||
ubus call uci commit '{"config":"cwmp"}'
|
||||
fi
|
||||
status="$(ubus call tr069 status |jsonfilter -qe '@.last_session.status')"
|
||||
if [ "$status" != "running" ]; then
|
||||
log "Trigger out of bound inform, since last inform status was failure"
|
||||
ubus -t 10 call tr069 inform >/dev/null 2>&1
|
||||
# Handle timeout or tr069 object not found
|
||||
if [ "$?" -eq 7 ] || [ "$?" -eq 4 ]; then
|
||||
log "Restarting icwmp tr069 object"
|
||||
/etc/init.d/icwmpd restart
|
||||
fi
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
handle_icwmp_update
|
||||
handle_icwmp_update $@
|
||||
|
||||
@@ -1,20 +1,48 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2015-2019 iopsys Software Solutions AB
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/network
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
STOP=2
|
||||
STOP=00
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/icwmpd"
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
include /lib/network
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
regenerate_ssl_link()
|
||||
{
|
||||
local cert_dir all_file rehash
|
||||
|
||||
cert_dir="${1}"
|
||||
[ ! -d "${cert_dir}" ] && return 0;
|
||||
|
||||
### Generate all ssl link for pem certicates ###
|
||||
all_file=$(ls $cert_dir/*.pem 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in $cfile)"
|
||||
[ -f ${cert_dir}/${rehash}.0 ] || \
|
||||
ln -s $cfile $cert_dir/${rehash}.0
|
||||
done
|
||||
fi
|
||||
|
||||
### Generate all ssl link for crt certicates ###
|
||||
all_file=$(ls $cert_dir/*.crt 2>/dev/null)
|
||||
if [ -n "${all_file}" ]; then
|
||||
for cfile in $all_file; do
|
||||
rehash="$(openssl x509 -hash -noout -in $cfile)"
|
||||
[ -f ${cert_dir}/${rehash}.0 ] || \
|
||||
ln -s $cfile $cert_dir/${rehash}.0
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
local wan="${1}"
|
||||
|
||||
@@ -36,13 +64,213 @@ 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
|
||||
fi
|
||||
}
|
||||
|
||||
convert_to_hex() {
|
||||
local val=""
|
||||
local optval="${1}"
|
||||
OPTIND=1
|
||||
while getopts ":" opt "-$optval"
|
||||
do
|
||||
temp=$(printf "%02X" "'${OPTARG:-:}")
|
||||
val="${val}:${temp}"
|
||||
done
|
||||
|
||||
echo "${val}"
|
||||
}
|
||||
|
||||
configure_send_op125() {
|
||||
local sendopt="${1}"
|
||||
local intf="${2}"
|
||||
local uci="${3}"
|
||||
local hex_oui=""
|
||||
local hex_serial=""
|
||||
local hex_class=""
|
||||
local oui_len=0
|
||||
local serial_len=0
|
||||
local class_len=0
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
local opt125="125:00:00:0D:E9"
|
||||
else
|
||||
local opt125="125,00:00:0D:E9"
|
||||
fi
|
||||
|
||||
config_get oui cpe manufacturer_oui ""
|
||||
if [ -z "${oui}" ]; then
|
||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
||||
fi
|
||||
|
||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
||||
|
||||
config_get serial cpe serial_number ""
|
||||
if [ -z "${serial}" ]; then
|
||||
serial=$(db -q get device.deviceinfo.SerialNumber)
|
||||
fi
|
||||
|
||||
config_get class cpe product_class ""
|
||||
if [ -z "${class}" ]; then
|
||||
class=$(db -q get device.deviceinfo.ProductClass)
|
||||
fi
|
||||
|
||||
oui_len=$(echo -n "${oui}" | wc -m)
|
||||
serial_len=$(echo -n "${serial}" | wc -m)
|
||||
class_len=$(echo -n "${class}" | wc -m)
|
||||
|
||||
if [ ${oui_len} -eq 0 ] || [ ${serial_len} -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
opt125_len=$((oui_len + serial_len + class_len))
|
||||
if [ ${class_len} -gt 0 ]; then
|
||||
opt125_len=$((opt125_len + 6))
|
||||
else
|
||||
opt125_len=$((opt125_len + 4))
|
||||
fi
|
||||
|
||||
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 "%02X" "${oui_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:01:${hex_oui_len}${hex_oui}"
|
||||
else
|
||||
opt125="${opt125}:04:${hex_oui_len}${hex_oui}"
|
||||
fi
|
||||
|
||||
hex_serial=$(convert_to_hex "${serial}")
|
||||
if [ -z "${hex_serial}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_serial_len=$(printf "%02X" "${serial_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:02:${hex_serial_len}${hex_serial}"
|
||||
else
|
||||
opt125="${opt125}:05:${hex_serial_len}${hex_serial}"
|
||||
fi
|
||||
|
||||
if [ ${class_len} -gt 0 ]; then
|
||||
hex_class=$(convert_to_hex "${class}")
|
||||
if [ -z "${hex_class}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_class_len=$(printf "%02X" "${class_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:03:${hex_class_len}${hex_class}"
|
||||
else
|
||||
opt125="${opt125}:06:${hex_class_len}${hex_class}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
new_send_opt="$sendopt $opt125"
|
||||
uci -q set network.$intf.sendopts="$new_send_opt"
|
||||
else
|
||||
uci -q add_list dhcp.$intf.dhcp_option="$opt125"
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dnsmasq_option125() {
|
||||
local lan="${1}"
|
||||
local send125_present=0
|
||||
local opt125="125,"
|
||||
|
||||
local proto="$(uci -q get dhcp.$lan.dhcpv4)"
|
||||
if [ "${proto}" = "server" ]; then
|
||||
opt_list="$(uci -q get dhcp.$lan.dhcp_option)"
|
||||
|
||||
for sopt in $opt_list; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
configure_send_op125 "" "${lan}" "dhcp"
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
enable_disable_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)"
|
||||
local newreqopts=""
|
||||
local newsendopts=""
|
||||
local req125_present=0
|
||||
local send125_present=0
|
||||
local network_uci_update=0
|
||||
local opt125="125:"
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=1
|
||||
break
|
||||
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 [ ${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
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${network_uci_update} -eq 1 ]; then
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
fi
|
||||
}
|
||||
|
||||
wait_for_resolvfile() {
|
||||
local time=$1
|
||||
local tm=1
|
||||
@@ -50,65 +278,49 @@ wait_for_resolvfile() {
|
||||
local resolvfile="$(uci -q get dhcp.@dnsmasq[0].resolvfile)"
|
||||
[ -n "$resolvfile" ] || return
|
||||
|
||||
while [ ! -f $resolvfile ]; do
|
||||
while [ ! -f "$resolvfile" ]; do
|
||||
sleep 1
|
||||
[ $tm -ge $time ] && break
|
||||
[ "$tm" -ge "$time" ] && break
|
||||
tm=$((tm+1))
|
||||
done
|
||||
}
|
||||
|
||||
set_wan_interface() {
|
||||
local wan_interface="${1}"
|
||||
local l3_device=""
|
||||
|
||||
if [ -z "${wan_interface}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
json_load "$(ifstatus ${wan_interface})"
|
||||
json_get_var l3_device l3_device
|
||||
if [ -n "$l3_device" ]; then
|
||||
uci -q set cwmp.cpe.interface="${l3_device}"
|
||||
uci -q commit cwmp
|
||||
fi
|
||||
}
|
||||
|
||||
copy_cwmp_etc_files_to_varstate() {
|
||||
if [ ! -f /var/state/cwmp ]
|
||||
then
|
||||
if [ -f /etc/icwmpd/cwmp ]
|
||||
then
|
||||
uci -q -c /etc/icwmpd delete cwmp.acs
|
||||
uci -q -c /etc/icwmpd commit cwmp
|
||||
cp /etc/icwmpd/cwmp /var/state/cwmp
|
||||
else
|
||||
touch /var/state/cwmp
|
||||
fi
|
||||
mkdir -p /var/run/icwmpd
|
||||
|
||||
if [ -f /etc/icwmpd/cwmp ]; then
|
||||
uci -q -c /etc/icwmpd delete cwmp.acs
|
||||
uci -q -c /etc/icwmpd commit cwmp
|
||||
cp -f /etc/icwmpd/cwmp /var/state/cwmp
|
||||
fi
|
||||
|
||||
mkdir -p /var/run/icwmpd
|
||||
if [ -f /etc/icwmpd/icwmpd_backup_session.xml ]
|
||||
then
|
||||
mv /etc/icwmpd/icwmpd_backup_session.xml /var/run/icwmpd 2>/dev/null
|
||||
if [ -f /etc/icwmpd/icwmpd_backup_session.xml ]; then
|
||||
cp -f /etc/icwmpd/icwmpd_backup_session.xml /var/run/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]
|
||||
then
|
||||
mv /etc/icwmpd/dm_enabled_notify /var/run/icwmpd 2>/dev/null
|
||||
|
||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]; then
|
||||
cp -f /etc/icwmpd/dm_enabled_notify /var/run/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
copy_cwmp_varstate_files_to_etc() {
|
||||
if [ -f /var/state/cwmp ]
|
||||
then
|
||||
cp /var/state/cwmp /etc/icwmpd 2>/dev/null
|
||||
if [ -f /var/run/icwmpd/icwmpd_backup_session.xml ]; then
|
||||
cp -f /var/run/icwmpd/icwmpd_backup_session.xml /etc/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
if [ -f /var/run/icwmpd/icwmpd_backup_session.xml ]
|
||||
then
|
||||
cp /var/run/icwmpd/icwmpd_backup_session.xml /etc/icwmpd 2>/dev/null
|
||||
|
||||
if [ -f /var/run/icwmpd/dm_enabled_notify.xml ]; then
|
||||
cp -f /var/run/icwmpd/dm_enabled_notify /etc/icwmpd/ 2>/dev/null
|
||||
fi
|
||||
if [ -f /var/run/icwmpd/dm_enabled_notify.xml ]
|
||||
then
|
||||
cp /var/run/icwmpd/dm_enabled_notify /etc/icwmpd 2>/dev/null
|
||||
|
||||
if [ -f /var/state/cwmp ]; then
|
||||
uci -q -c /var/state delete cwmp.sess_status
|
||||
uci -q -c /var/state commit cwmp
|
||||
cp -f /var/state/cwmp /etc/icwmpd/
|
||||
fi
|
||||
|
||||
# move the successful custom notify import marker to persistent storage
|
||||
if [ -f /var/run/icwmpd/icwmpd_notify_import_marker ]; then
|
||||
cp -f /var/run/icwmpd/icwmpd_notify_import_marker /etc/icwmpd/
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -120,12 +332,13 @@ validate_acs_section()
|
||||
'periodic_inform_interval:uinteger' \
|
||||
'periodic_inform_time:string' \
|
||||
'url:string' \
|
||||
'dhcp_discovery:string' \
|
||||
'dhcp_url:string' \
|
||||
'compression:or("GZIP","Deflate","Disabled")' \
|
||||
'retry_min_wait_interval:range(1, 65535)' \
|
||||
'retry_interval_multiplier:range(1000, 65535)' \
|
||||
'https_ssl_capath:file' \
|
||||
'ipv6_enable:bool'
|
||||
'ipv6_enable:bool' \
|
||||
'ssl_capath:string'
|
||||
|
||||
}
|
||||
|
||||
@@ -154,6 +367,7 @@ validate_cpe_section()
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
local ssl_capath
|
||||
config_load cwmp
|
||||
|
||||
validate_acs_section || {
|
||||
@@ -161,96 +375,123 @@ validate_defaults() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ -z "${url}" -a -z "${dhcp_url}" ] && {
|
||||
log "ACS url is empty can't start"
|
||||
return 1;
|
||||
}
|
||||
ssl_capath="${ssl_capath%/}"
|
||||
# Put the cert pem file in keep list
|
||||
if [ -d "${ssl_capath}" ]; then
|
||||
if ! grep "*.pem\|*.crt" /lib/upgrade/keep.d/icwmp; then
|
||||
echo "${ssl_capath}"'/*.pem' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.crt' >> /lib/upgrade/keep.d/icwmp
|
||||
echo "${ssl_capath}"'/*.0' >> /lib/upgrade/keep.d/icwmp
|
||||
fi
|
||||
fi
|
||||
|
||||
validate_cpe_section || {
|
||||
log "Validation of cpe section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ -z "${default_wan_interface}" ] && {
|
||||
log "Wan interface is empty"
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
boot() {
|
||||
local dhcp_url=""
|
||||
local discovery="1"
|
||||
local dhcp_discovery="0"
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool dhcp_discovery acs dhcp_discovery 1
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
|
||||
if [ "${dhcp_discovery}" == "enable" -o "${dhcp_discovery}" == "1" ]; then
|
||||
if [ -z "${dhcp_url}" ]; then
|
||||
log "dhcp discovery enabled but no dhcp url, trigger update"
|
||||
/etc/icwmpd/update.sh
|
||||
fi
|
||||
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}"
|
||||
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_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
|
||||
|
||||
if [ -n "${ssl_capath}" ]; then
|
||||
regenerate_ssl_link "${ssl_capath}"
|
||||
fi
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable_cwmp
|
||||
local wan_interface
|
||||
local dhcp_discovery
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get dhcp_discovery acs dhcp_discovery
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
if [ "$enable_cwmp" = "0" -o "$enable_cwmp" = "false" ]; then
|
||||
log "CWMP is not enabled"
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Set wan interface if not configured
|
||||
set_wan_interface "${wan_interface}"
|
||||
|
||||
# Set dhcp option 43 if dhcp discovery enabled
|
||||
if [ "${dhcp_discovery}" == "enable" -o "${dhcp_discovery}" == "1" ]; then
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
fi
|
||||
|
||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
|
||||
# Copy backup data so that if it restart latter on it gets the info
|
||||
copy_cwmp_etc_files_to_varstate
|
||||
|
||||
validate_defaults || {
|
||||
log "Validation of defaults failed"
|
||||
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
|
||||
procd_set_param respawn \
|
||||
${respawn_threshold:-5} \
|
||||
${respawn_timeout:-10} ${respawn_retry:-3}
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
|
||||
procd_set_param watch network.interface
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_stopped()
|
||||
{
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
log "Restarting CWMP client"
|
||||
stop
|
||||
start
|
||||
local ret
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
|
||||
ret="0"
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
stop
|
||||
start
|
||||
return 0
|
||||
fi
|
||||
|
||||
status="$(ubus -t 1 call tr069 status |jsonfilter -qe '@.cwmp.status')"
|
||||
ret="$?"
|
||||
if [ "$status" = "up" ]; then
|
||||
ubus -t 1 call tr069 command '{"command":"reload"}'
|
||||
ret="$?"
|
||||
fi
|
||||
|
||||
if [ "$status" = "init" ] || [ "$ret" -ne "0" ]; then
|
||||
log "Restarting CWMP client"
|
||||
stop
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
config_load cwmp
|
||||
|
||||
# Get Manufacturer OUI.
|
||||
oui=$(uci -q get cwmp.cpe.manufacturer_oui)
|
||||
config_get oui cpe manufacturer_oui ""
|
||||
if [ -z "${oui}" ]; then
|
||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
||||
fi
|
||||
@@ -9,24 +13,29 @@ fi
|
||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
||||
|
||||
# Get system serial number.
|
||||
serial=$(uci -q get cwmp.cpe.serial_number)
|
||||
config_get serial cpe serial_number ""
|
||||
if [ -z "${serial}" ]; then
|
||||
serial=$(db -q get device.deviceinfo.SerialNumber)
|
||||
fi
|
||||
|
||||
# Get userid values
|
||||
acs_userid=$(uci -q get cwmp.acs.userid)
|
||||
cpe_userid=$(uci -q get cwmp.cpe.userid)
|
||||
config_get acs_userid acs userid ""
|
||||
config_get cpe_userid cpe userid ""
|
||||
|
||||
# Only set if they are empty
|
||||
if [ -z "$acs_userid" ]
|
||||
then
|
||||
if [ -z "${acs_userid}" ]; then
|
||||
uci -q set cwmp.acs.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
if [ -z "$cpe_userid" ]
|
||||
then
|
||||
if [ -z "${cpe_userid}" ]; then
|
||||
uci -q set cwmp.cpe.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
# Fix the cwmp.cpe.enable parameter
|
||||
# set default to 1 if not defined
|
||||
config_get enable_cwmp cpe enable ""
|
||||
if [ -z "${enable_cwmp}" ]; then
|
||||
uci -q set cwmp.cpe.enable="1"
|
||||
fi
|
||||
|
||||
# No need for commit here, it is done by uci_apply_defaults().
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
regenerate_ssl_link(){
|
||||
[ ! -d "/etc/ssl/certs" ] && return 0;
|
||||
[ ! -f "/etc/ssl/certs/*.pem" ] && return 0;
|
||||
|
||||
local cert_dir="/etc/ssl/certs"
|
||||
local all_file=$(ls $cert_dir/*.pem)
|
||||
|
||||
for cfile in $all_file
|
||||
do
|
||||
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
|
||||
done
|
||||
}
|
||||
|
||||
regenerate_ssl_link
|
||||
@@ -1 +1,2 @@
|
||||
/var/run/icwmpd/icwmpd_backup_session.xml
|
||||
/etc/icwmpd/cwmp
|
||||
|
||||
14
ieee1905/Config.map-plugin.in
Normal file
14
ieee1905/Config.map-plugin.in
Normal file
@@ -0,0 +1,14 @@
|
||||
if (PACKAGE_map-plugin)
|
||||
|
||||
menu "Configurations"
|
||||
|
||||
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
bool "Sync configuration between dynamic controllers in the network"
|
||||
default n
|
||||
|
||||
config MULTIAP_FUZZ_1905_CMDUS
|
||||
bool "Include support to fuzz 1905 CMDUs for testing purpose"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
endif
|
||||
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
# Copyright (C) 2021-2022 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=4.6.0
|
||||
PKG_VERSION:=4.10.28
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=373602c3644ead5c61aece58e1f88f52838bb38b
|
||||
PKG_SOURCE_VERSION:=e10385f117bc20a8d16f1b57ad4f86d4a98552c0
|
||||
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
|
||||
@@ -57,6 +57,10 @@ $(call Package/ieee1905/Default,$(1))
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
define Package/map-plugin/config
|
||||
source "$(SOURCE)/Config.map-plugin.in"
|
||||
endef
|
||||
|
||||
define Package/ieee1905/description
|
||||
This package provides IEEE Std 1905.1 stack.
|
||||
endef
|
||||
@@ -74,6 +78,11 @@ ifeq ($(CONFIG_IEEE1905_PLATFORM_HAS_WIFI),y)
|
||||
TARGET_CFLAGS += -DHAS_WIFI
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG),y)
|
||||
TARGET_CFLAGS += -DDYNAMIC_CNTLR_SYNC_CONFIG
|
||||
endif
|
||||
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
|
||||
@@ -120,6 +129,7 @@ define Build/InstallDev/libieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/timer_impl.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_extension.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
@@ -3,20 +3,24 @@ config ieee1905 'ieee1905'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
option registrar '2 5'
|
||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config al-iface
|
||||
option enabled '1'
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
|
||||
# ap sections are auto-generated/overwritten during onboarding
|
||||
#
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'TestSSID.2'
|
||||
option encryption 'psk2'
|
||||
option key '5555500000'
|
||||
option ssid 'IOWRT-2.4GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'TestSSID.5'
|
||||
option encryption 'psk2'
|
||||
option key '2222200000'
|
||||
option ssid 'IOWRT-5GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config al-iface
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
@@ -5,7 +5,82 @@ STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
|
||||
validate_ieee1905_section() {
|
||||
uci_validate_section ieee1905 ieee1905 "ieee1905" \
|
||||
'enabled:bool:true' \
|
||||
'macaddress:or("auto",macaddr)' \
|
||||
'registrar:string' \
|
||||
'extension:bool:false' \
|
||||
'extmodule:list(string)' \
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "ieee1905" "Validation of ieee1905 section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_ali_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section ieee1905 $section "${1}" \
|
||||
'ifname:string' \
|
||||
'type:or("bridge",string)'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "ieee1905" "Validation of al-iface section $section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_ap_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section ieee1905 $section "${1}" \
|
||||
'band:or("2", "5", "60")' \
|
||||
'ssid:string' \
|
||||
'encryption:or("psk2", "sae-mixed", "sae", string)' \
|
||||
'key:string' \
|
||||
'uuid:string' \
|
||||
'manufacturer:string' \
|
||||
'model_name:string' \
|
||||
'device_name:string' \
|
||||
'model_number:string' \
|
||||
'serial_number:string' \
|
||||
'device_type:string' \
|
||||
'os_version:uinteger'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "ieee1905" "Validation of ap section $section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_ieee1905_config() {
|
||||
IS_CFG_VALID=1
|
||||
|
||||
validate_ieee1905_section &&
|
||||
config_foreach validate_ali_section "al-iface" &&
|
||||
config_foreach validate_ap_section ap
|
||||
|
||||
[ "$IS_CFG_VALID" -ne 1 ] && {
|
||||
logger -s -t "ieee1905" "Validation of ieee1905 UCI file failed"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "ieee1905"
|
||||
validate_ieee1905_config || return 1;
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/ieee1905d"
|
||||
procd_set_param respawn
|
||||
|
||||
22
ieee1905/files/etc/uci-defaults/30-set-ieee1905-al-macaddr
Normal file
22
ieee1905/files/etc/uci-defaults/30-set-ieee1905-al-macaddr
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
BMAC=$(db -q get hw.board.basemac)
|
||||
BMAC=${BMAC//:/}
|
||||
BMAC=${BMAC// /}
|
||||
BMAC=$(printf "%12.12X" $((0x$BMAC)))
|
||||
|
||||
[ "$BMAC" == "" ] && exit 1
|
||||
|
||||
LMAC=$((0x$BMAC & 0xfeffffffffff))
|
||||
LMAC=$(($LMAC | 0x020000000000))
|
||||
LMAC=$(printf "%12.12X" $LMAC)
|
||||
LMAC=$(echo $LMAC | sed -e 's/[0-9A-F]\{2\}/&:/g' -e 's/:$//')
|
||||
|
||||
mac=$(uci -q get ieee1905.ieee1905.macaddress)
|
||||
|
||||
[ "$mac" != "" ] && exit 0
|
||||
|
||||
uci set ieee1905.ieee1905.macaddress="$LMAC"
|
||||
uci commit ieee1905
|
||||
|
||||
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
|
||||
|
||||
@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=inbd
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_VERSION:=1.2.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=10f765f3d0fcc226b6ecf0c481598c9e7f76315e
|
||||
PKG_SOURCE_VERSION:=d4e910a31039e0c0b7a539311eafcd716c36be77
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
|
||||
7
iop/Config.in
Normal file
7
iop/Config.in
Normal file
@@ -0,0 +1,7 @@
|
||||
config TARGET_VERSION
|
||||
string
|
||||
prompt "Software Version"
|
||||
|
||||
config TARGET_CUSTOMER
|
||||
string
|
||||
prompt "Customer ID"
|
||||
@@ -24,6 +24,10 @@ define Package/iop/description
|
||||
This package contains iopsysWrt SDK utilities
|
||||
endef
|
||||
|
||||
define Package/iop/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
true
|
||||
endef
|
||||
|
||||
289
iop/config
289
iop/config
@@ -1,32 +1,139 @@
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
############
|
||||
# Generic #
|
||||
##########
|
||||
|
||||
# Build #
|
||||
CONFIG_BUILD_LOG=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
CONFIG_DEVEL=y
|
||||
# CONFIG_USE_SSTRIP is not set
|
||||
CONFIG_USE_STRIP=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
|
||||
# Image #
|
||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
|
||||
# /etc/banner and /etc/device_info #
|
||||
CONFIG_IMAGEOPT=y
|
||||
CONFIG_VERSIONOPT=y
|
||||
CONFIG_VERSION_MANUFACTURER="iopsysWrt"
|
||||
CONFIG_VERSION_MANUFACTURER_URL="https://iopsys.eu/"
|
||||
|
||||
# /lib/preinit #
|
||||
CONFIG_PREINITOPT=y
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_STDERR is not set
|
||||
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
||||
CONFIG_TARGET_PREINIT_TIMEOUT=1
|
||||
# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set
|
||||
CONFIG_TARGET_PREINIT_IFNAME=""
|
||||
CONFIG_TARGET_PREINIT_IP=""
|
||||
CONFIG_TARGET_PREINIT_NETMASK=""
|
||||
CONFIG_TARGET_PREINIT_BROADCAST=""
|
||||
|
||||
# Mirror #
|
||||
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
|
||||
##################
|
||||
# IOWRT Add-ons #
|
||||
################
|
||||
|
||||
# EasySoC HAL #
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_wfadatad-collector=y
|
||||
|
||||
# Network #
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_owsd=m
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
|
||||
# System #
|
||||
CONFIG_PACKAGE_imonitor=m
|
||||
CONFIG_PACKAGE_questd=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
|
||||
# TR-x69 #
|
||||
CONFIG_PACKAGE_uspd-mbedtls=y
|
||||
CONFIG_PACKAGE_icwmp-mbedtls=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_stunc-mbedtls=m
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_twamp=m
|
||||
CONFIG_PACKAGE_udpecho-client=m
|
||||
CONFIG_PACKAGE_udpecho-server=m
|
||||
CONFIG_PACKAGE_xmppc=m
|
||||
|
||||
# WebGUI #
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
|
||||
|
||||
############
|
||||
# Network #
|
||||
##########
|
||||
|
||||
# Protocols #
|
||||
CONFIG_PACKAGE_6in4=y
|
||||
CONFIG_PACKAGE_6rd=y
|
||||
CONFIG_PACKAGE_6to4=y
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_chat=y
|
||||
CONFIG_PACKAGE_comgt=y
|
||||
CONFIG_PACKAGE_comgt-directip=y
|
||||
CONFIG_PACKAGE_comgt-ncm=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_gre=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_map=y
|
||||
CONFIG_PACKAGE_ntfs-3g=y
|
||||
CONFIG_PACKAGE_ntpd=y
|
||||
CONFIG_PACKAGE_odhcp6c=y
|
||||
CONFIG_PACKAGE_odhcpd=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoe=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
CONFIG_PACKAGE_ppp-mod-pptp=y
|
||||
CONFIG_PACKAGE_ppp-multilink=y
|
||||
# CONFIG_PACKAGE_ppp is not set
|
||||
CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
|
||||
# Services #
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_wfadatad=y
|
||||
CONFIG_PACKAGE_wfadatad-collector=y
|
||||
CONFIG_PACKAGE_imonitor=m
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
|
||||
# Tools and Utilities #
|
||||
CONFIG_PACKAGE_curl=y
|
||||
CONFIG_PACKAGE_libcurl=y
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_ip-bridge=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
@@ -34,73 +141,67 @@ CONFIG_PACKAGE_iptables=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
|
||||
|
||||
############
|
||||
# System #
|
||||
##########
|
||||
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libreswan=m
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_luci-nginx=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rrdns=y
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_uledd=y
|
||||
# The urandom-seed package is very strange. It seeds urandom with urandom...
|
||||
# Disable it. Most SoCs nowadays has HW random generators anyway.
|
||||
# CONFIG_PACKAGE_urandom-seed is not set
|
||||
# CONFIG_PACKAGE_urngd is not set
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_uuidgen=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
|
||||
|
||||
################
|
||||
# LuCI WebGUI #
|
||||
##############
|
||||
|
||||
# BEGIN: luci-nginx metapackage with some changes
|
||||
# We do not want libiwinfo-lua on non-WiFi targets, but it is already
|
||||
# depended on by other luci-packages, so no need to take it in explicitly
|
||||
CONFIG_PACKAGE_luci-mod-admin-full=y
|
||||
CONFIG_PACKAGE_luci-app-firewall=y
|
||||
CONFIG_PACKAGE_luci-app-opkg=y
|
||||
CONFIG_PACKAGE_luci-proto-ppp=y
|
||||
CONFIG_PACKAGE_luci-proto-ipv6=y
|
||||
# CONFIG_LUCI_JSMIN is not set
|
||||
# CONFIG_LUCI_CSSTIDY is not set
|
||||
CONFIG_PACKAGE_luci-mod-dashboard=y
|
||||
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
|
||||
CONFIG_PACKAGE_map=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mwan3=y
|
||||
CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_ntfs-3g=y
|
||||
CONFIG_PACKAGE_ntpd=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_odhcp6c=y
|
||||
CONFIG_PACKAGE_odhcpd=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_PACKAGE_owsd=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoe=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppol2tp=y
|
||||
CONFIG_PACKAGE_ppp-mod-pptp=y
|
||||
CONFIG_PACKAGE_ppp-multilink=y
|
||||
# CONFIG_PACKAGE_ppp is not set
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_questd=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
CONFIG_PACKAGE_uledd=y
|
||||
CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_uspd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
CONFIG_PACKAGE_uuidgen=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||
# CONFIG_USE_SSTRIP is not set
|
||||
CONFIG_USE_STRIP=y
|
||||
CONFIG_BUILD_LOG=y
|
||||
CONFIG_PACKAGE_nginx-mod-luci=y
|
||||
|
||||
|
||||
############
|
||||
# BusyBox #
|
||||
##########
|
||||
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_BUSYBOX_CONFIG_ADDUSER=y
|
||||
CONFIG_BUSYBOX_CONFIG_ARPING=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT=y
|
||||
@@ -120,6 +221,7 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS=y
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
|
||||
CONFIG_BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
CONFIG_BUSYBOX_CONFIG_LAST_SYSTEM_ID=999
|
||||
CONFIG_BUSYBOX_CONFIG_LOGIN=y
|
||||
# CONFIG_BUSYBOX_CONFIG_LSMOD is not set
|
||||
@@ -183,40 +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
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
# Generation of /etc/banner.
|
||||
CONFIG_IMAGEOPT=y
|
||||
CONFIG_VERSIONOPT=y
|
||||
CONFIG_VERSION_MANUFACTURER="iopsysWrt"
|
||||
CONFIG_VERSION_MANUFACTURER_URL="https://iopsys.eu/"
|
||||
|
||||
# Disable as much as possible of OpenWrt messy "pre-init" stuff.
|
||||
CONFIG_PREINITOPT=y
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_STDERR is not set
|
||||
CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE=y
|
||||
CONFIG_TARGET_PREINIT_TIMEOUT=1
|
||||
# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set
|
||||
# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set
|
||||
CONFIG_TARGET_PREINIT_IFNAME=""
|
||||
CONFIG_TARGET_PREINIT_IP=""
|
||||
CONFIG_TARGET_PREINIT_NETMASK=""
|
||||
CONFIG_TARGET_PREINIT_BROADCAST=""
|
||||
|
||||
# Generate rootfs tar file
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
|
||||
# The urandom-seed package is very strange. It seeds urandom with urandom...
|
||||
# Disable it. Most SoCs nowadays has HW random generators anyway.
|
||||
# CONFIG_PACKAGE_urandom-seed is not set
|
||||
# CONFIG_PACKAGE_urngd is not set
|
||||
|
||||
# We use OpenSSL, no need to ship multiple TLS libraries
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
|
||||
@@ -32,8 +32,7 @@ function feeds_update {
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx iopsys-mediatek iopsys-econet"
|
||||
for target in $targets
|
||||
for target in $(ls ./feeds/targets)
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
./scripts/feeds install -p targets $target
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
|
||||
# Copyright (C) 2018 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libjwt
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=866607c7741421c8ac99876e7201eb32d9af1b92
|
||||
PKG_SOURCE_URL:=https://github.com/benmcollins/libjwt.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_LICENSE:=LGPLv3
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libjwt
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libopenssl +jansson
|
||||
TITLE:= libjwt
|
||||
endef
|
||||
|
||||
|
||||
#TARGET_CFLAGS += \
|
||||
# -I$(STAGING_DIR)/usr/include
|
||||
# -I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
#MAKE_FLAGS += \
|
||||
# CFLAGS="$(TARGET_CFLAGS)" \
|
||||
# LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
# FPIC="$(FPIC)" \
|
||||
# PLATFORM="$(TARGET_PLATFORM)" \
|
||||
# subdirs="$(subdirs)"
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/include/jwt.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libjwt/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libjwt/.libs/libjwt.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libjwt))
|
||||
@@ -1,57 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2012-2014 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libmicroxml
|
||||
PKG_VERSION:=2012-06-11
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/mirror/microxml.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_LICENSE:=LGPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libmicroxml
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=XML library
|
||||
MAINTAINER:=Luka Perkov <luka@openwrt.org>
|
||||
endef
|
||||
|
||||
define Package/libmicroxml/description
|
||||
A micro sized XML library
|
||||
endef
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-threads \
|
||||
--enable-static \
|
||||
--enable-shared
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(CP) $(PKG_BUILD_DIR)/microxml.h $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_BUILD_DIR)/microxml.pc $(1)/usr/lib/pkgconfig
|
||||
endef
|
||||
|
||||
define Package/libmicroxml/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmicroxml.so* $(1)/usr/lib
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmicroxml))
|
||||
@@ -1,130 +0,0 @@
|
||||
diff --git a/mxml-file.c b/mxml-file.c
|
||||
index 02eca9d..f10d202 100644
|
||||
--- a/mxml-file.c
|
||||
+++ b/mxml-file.c
|
||||
@@ -363,9 +363,12 @@ mxmlSaveFile(mxml_node_t *node, /* I - Node to write */
|
||||
* Write the node...
|
||||
*/
|
||||
|
||||
- if ((col = mxml_write_node(node, fp, cb, 0, mxml_file_putc, global)) < 0)
|
||||
+ if ((col = mxml_write_node(node, fp, cb, 0, mxml_file_putc, global)) < 0){
|
||||
+ global_free(global);
|
||||
return (-1);
|
||||
-
|
||||
+ }
|
||||
+
|
||||
+ global_free(global);
|
||||
if (col > 0)
|
||||
if (putc('\n', fp) < 0)
|
||||
return (-1);
|
||||
@@ -1448,6 +1451,7 @@ mxml_load_data(
|
||||
if ((buffer = malloc(64)) == NULL)
|
||||
{
|
||||
mxml_error("Unable to allocate string buffer!");
|
||||
+ global_free(global);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -2083,11 +2087,12 @@ mxml_load_data(
|
||||
node->parent ? node->parent->value.element.name : "(null)");
|
||||
|
||||
mxmlDelete(first);
|
||||
-
|
||||
+ global_free(global);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
+ global_free(global);
|
||||
if (parent)
|
||||
return (parent);
|
||||
else
|
||||
@@ -2102,7 +2107,7 @@ error:
|
||||
mxmlDelete(first);
|
||||
|
||||
free(buffer);
|
||||
-
|
||||
+ global_free(global);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
diff --git a/mxml-private.c b/mxml-private.c
|
||||
index 4378ca3..ea6e452 100644
|
||||
--- a/mxml-private.c
|
||||
+++ b/mxml-private.c
|
||||
@@ -41,6 +41,32 @@
|
||||
* This code currently supports AIX, HP-UX, Linux, Mac OS X, Solaris, and
|
||||
* Windows. It might work on the BSDs and IRIX, but I haven't tested that.
|
||||
*/
|
||||
+void *global_mem[16] = {0};
|
||||
+
|
||||
+static void *global_calloc(int x, int size)
|
||||
+{
|
||||
+ int i;
|
||||
+ void *m = calloc(x, size);
|
||||
+ for (i = ((sizeof(global_mem)/sizeof(global_mem[0])) - 1); i > 0; i--) {
|
||||
+ global_mem[i] = global_mem[i-1];
|
||||
+ }
|
||||
+ global_mem[0] = m;
|
||||
+ return m;
|
||||
+}
|
||||
+
|
||||
+void global_free(void *m)
|
||||
+{
|
||||
+ int i;
|
||||
+ if (m == NULL)
|
||||
+ return;
|
||||
+ for (i = ((sizeof(global_mem)/sizeof(global_mem[0])) - 1); i >= 0; i--) {
|
||||
+ if (global_mem[i] == m) {
|
||||
+ global_mem[i] = NULL;
|
||||
+ free(m);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
||||
#if defined(__sun) || defined(_AIX)
|
||||
# pragma fini(_mxml_fini)
|
||||
@@ -148,7 +174,6 @@ mxml_real_cb(mxml_node_t *node) /* I - Current node */
|
||||
return (MXML_REAL);
|
||||
}
|
||||
|
||||
-
|
||||
#ifdef HAVE_PTHREAD_H /**** POSIX threading ****/
|
||||
# include <pthread.h>
|
||||
|
||||
@@ -190,7 +215,6 @@ _MXML_FINI(void)
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
/*
|
||||
* '_mxml_global()' - Get global data.
|
||||
*/
|
||||
@@ -205,7 +229,7 @@ _mxml_global(void)
|
||||
|
||||
if ((global = (_mxml_global_t *)pthread_getspecific(_mxml_key)) == NULL)
|
||||
{
|
||||
- global = (_mxml_global_t *)calloc(1, sizeof(_mxml_global_t));
|
||||
+ global = (_mxml_global_t *)global_calloc(1, sizeof(_mxml_global_t));
|
||||
pthread_setspecific(_mxml_key, global);
|
||||
|
||||
global->num_entity_cbs = 1;
|
||||
@@ -288,7 +312,7 @@ _mxml_global(void)
|
||||
|
||||
if ((global = (_mxml_global_t *)TlsGetValue(_mxml_tls_index)) == NULL)
|
||||
{
|
||||
- global = (_mxml_global_t *)calloc(1, sizeof(_mxml_global_t));
|
||||
+ global = (_mxml_global_t *)global_calloc(1, sizeof(_mxml_global_t));
|
||||
|
||||
global->num_entity_cbs = 1;
|
||||
global->entity_cbs[0] = _mxml_entity_cb;
|
||||
diff --git a/mxml-private.h b/mxml-private.h
|
||||
index c591208..72ed338 100644
|
||||
--- a/mxml-private.h
|
||||
+++ b/mxml-private.h
|
||||
@@ -43,3 +43,4 @@ typedef struct _mxml_global_s
|
||||
extern _mxml_global_t *_mxml_global(void);
|
||||
extern int _mxml_entity_cb(const char *name);
|
||||
|
||||
+extern void global_free(void *m);
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libtrace
|
||||
PKG_VERSION:=3.0.22
|
||||
PKG_VERSION:=3.0.23
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
@@ -72,11 +72,11 @@ endef
|
||||
|
||||
define Package/libtrace/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libtrace.so.* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libwandio.so.* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtrace.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwandio.so.* $(1)/usr/lib/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump.so.* $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/libpacketdump
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump/*.so* $(1)/usr/lib/libpacketdump/
|
||||
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpacketdump/*.so* $(1)/usr/lib/libpacketdump/
|
||||
endef
|
||||
|
||||
define Package/libtrace-tools/install
|
||||
|
||||
34
map-agent/Config.in
Normal file
34
map-agent/Config.in
Normal file
@@ -0,0 +1,34 @@
|
||||
if (PACKAGE_map-agent)
|
||||
|
||||
menu "Configurations"
|
||||
|
||||
config AGENT_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
bool "Support Dynamic Controller configuration sync"
|
||||
default y if MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
|
||||
config AGENT_ISLAND_PREVENTION
|
||||
bool "Support Island Prevention"
|
||||
default y if MULTIAP_AGENT_ISLAND_PREVENTION
|
||||
|
||||
config AGENT_EASYMESH_R2_CERT
|
||||
bool "Compile for WFA test bed"
|
||||
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT
|
||||
bool "Enable extra features through Easymesh vendor extension"
|
||||
default y
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
default AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
enabled through AGENT_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
endmenu
|
||||
endif
|
||||
@@ -1,16 +1,16 @@
|
||||
#
|
||||
# Copyright (C) 2020-21 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=6.6.0
|
||||
PKG_VERSION:=2.10.2.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=69219d6752dacd86040eb529af42d474f37a4f0b
|
||||
PKG_SOURCE_VERSION:=4ed3f9bf0743086a85e1b7cf49c47eb49ab05015
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_DEV=0
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ define Package/dynbhd/description
|
||||
endef
|
||||
|
||||
define Package/map-agent/config
|
||||
#source "$(SOURCE)/Config.in"
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -58,6 +58,24 @@ TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_AGENT_SYNC_DYNAMIC_CNTLR_CONFIG),y)
|
||||
TARGET_CFLAGS += -DAGENT_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_ISLAND_PREVENTION),y)
|
||||
TARGET_CFLAGS += -DAGENT_ISLAND_PREVENTION
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_EASYMESH_R2_CERT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_R2_CERT
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
|
||||
@@ -1,34 +1,134 @@
|
||||
config agent 'agent'
|
||||
option enabled '1'
|
||||
option debug '6'
|
||||
option debug '0'
|
||||
option profile '2'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
option eth_onboards_wifi_bhs '0'
|
||||
option ap_follow_sta_dfs '0'
|
||||
option guest_isolation '0'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config dynamic_backhaul
|
||||
option missing_bh_timer '60'
|
||||
option missing_bh_reconfig_timer '1800'
|
||||
|
||||
config controller_select
|
||||
option id 'auto'
|
||||
option probe_int '20'
|
||||
option retry_int '9'
|
||||
option autostart '1'
|
||||
option local '0'
|
||||
|
||||
config radio
|
||||
option device 'phy0'
|
||||
option band '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '70'
|
||||
# option report_rcpi_threshold '80'
|
||||
# option rcpi_hysteresis_margin '0'
|
||||
# option report_util_threshold '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config radio
|
||||
option device 'phy1'
|
||||
option band '5'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '86'
|
||||
# option report_rcpi_threshold '96'
|
||||
# option rcpi_hysteresis_margin '0'
|
||||
# option report_util_threshold '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan0'
|
||||
option band '2'
|
||||
option device 'phy0'
|
||||
option priority '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option onboarded '1'
|
||||
# option bssid '0a:1b:2c:3d:4e:53'
|
||||
# option vid '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan1'
|
||||
option band '5'
|
||||
option device 'phy1'
|
||||
option priority '0'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option onboarded '1'
|
||||
# option bssid '0a:1b:2c:3d:4e:54'
|
||||
# option vid '1'
|
||||
|
||||
# ap sections and policy section are
|
||||
# auto-generated during onboarding
|
||||
#
|
||||
#config ap
|
||||
# option ifname 'wl0'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# list assoc_ctrl '00:10:20:30:40:50'
|
||||
# option btm_retry '3'
|
||||
# option btm_retry_secs '180'
|
||||
# option fallback_legacy '1'
|
||||
# option steer_legacy_reassoc_secs '30'
|
||||
# option steer_legacy_retry_secs '3600'
|
||||
# option assoc_ctrl_secs '30'
|
||||
# option band '2'
|
||||
# option type 'fronthaul'
|
||||
|
||||
#config ap
|
||||
# option ifname 'wl1'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# option band '5'
|
||||
# option type 'fronthaul'
|
||||
|
||||
#config bsta
|
||||
# option ifname 'apclii0'
|
||||
# option enabled '1'
|
||||
# option onboarded '0'
|
||||
# option disallow_bsta '1 # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
# option ifname 'wlan0-1'
|
||||
# option band '2'
|
||||
# option device 'phy0'
|
||||
# option type 'fronthaul'
|
||||
# option ssid 'IOWRT-2.4GHz'
|
||||
# option encryption 'sae-mixed+aes'
|
||||
# option key '1234567890'
|
||||
# option vid '1'
|
||||
|
||||
#config ap
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan0-2'
|
||||
# option band '2'
|
||||
# option device 'phy0'
|
||||
# option type 'backhaul'
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae+aes'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option disallow_bsta '0'
|
||||
# option vid '1'
|
||||
|
||||
#config ap
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan1-1'
|
||||
# option band '5'
|
||||
# option device 'phy1'
|
||||
# option type 'fronthaul'
|
||||
# option ssid 'IOWRT-5GHz'
|
||||
# option encryption 'sae-mixed+aes'
|
||||
# option key '1234567890'
|
||||
# option vid '1'
|
||||
|
||||
#config ap
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan1-2'
|
||||
# option band '5'
|
||||
# option device 'phy1'
|
||||
# option type 'backhaul'
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae+aes'
|
||||
# option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
# option disallow_bsta '0'
|
||||
# option vid '1'
|
||||
|
||||
#config policy
|
||||
# option report_interval '0'
|
||||
# option pvid '1'
|
||||
# option pcp_default '0'
|
||||
# option report_scan '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
|
||||
|
||||
@@ -1,22 +1,78 @@
|
||||
#!/bin/sh
|
||||
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
. /lib/network/utils.sh
|
||||
|
||||
conn_ports_file="/tmp/map.connected.ports"
|
||||
map_bh_file="/tmp/multiap.backhaul"
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
[ "${al_bridge:0:3}" = "br-" ] || exit 0
|
||||
al_brnet="${al_bridge:3}"
|
||||
|
||||
[ -z "$wan" ] && exit 1 # no configuration
|
||||
[ "$PORT" != "$wan" ] && exit 0
|
||||
# Exit if the PORT is not member of the AL Bridge
|
||||
[ "$(get_network_of $PORT)" = "$al_brnet" ] || exit 0
|
||||
|
||||
############## Dynamic Backhaul Daemon ##############
|
||||
if [ -n "$(which dynbhd)" ]; then
|
||||
pidof dynbhd >/dev/null && exit 0 # dynbhd is managing the links
|
||||
|
||||
if [ ! -f $conn_ports_file ]; then
|
||||
touch $conn_ports_file
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch $conn_ports_file
|
||||
echo "$PORT" > $conn_ports_file
|
||||
brctl delif $al_bridge $PORT
|
||||
#ubus call network.interface.lan remove_device "{\"name\":\"$PORT\"}"
|
||||
fi
|
||||
else
|
||||
if [ "$LINK" = "up" ]; then
|
||||
brctl delif $al_bridge $PORT
|
||||
echo "$PORT" >> $conn_ports_file
|
||||
#ubus call network.interface.lan remove_device "{\"name\":\"$PORT\"}"
|
||||
else
|
||||
sed -i -E "/(^|:)${PORT}(:|$)/d" $conn_ports_file
|
||||
#ubus call network.interface.lan add_device "{\"name\":\"$PORT\"}"
|
||||
brctl addif $al_bridge $PORT
|
||||
[ "$(cat $conn_ports_file | wc -c)" = "0" ] && rm -f $conn_ports_file
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
########################################################
|
||||
|
||||
################ Dedicated ETH WAN Port ################
|
||||
wanport="$(db -q get hw.board.ethernetWanPort)"
|
||||
if [ -n "$wanport" ]; then
|
||||
[ "$wanport" = "$PORT" ] || exit 0
|
||||
########################################################
|
||||
else
|
||||
#################### DHCP Discovery ####################
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
brctl delif $al_bridge $PORT
|
||||
|
||||
udhcpc -qnRoC -i $PORT >/dev/null 2>&1 && dhcp=1
|
||||
|
||||
brctl addif $al_bridge $PORT
|
||||
|
||||
[ $dhcp -eq 1 ] || exit 0
|
||||
else
|
||||
[ -f $map_bh_file ] || exit 0
|
||||
cur_bh="$(cat $map_bh_file | jsonfilter -e @.ifname)"
|
||||
[ "$cur_bh" = "$PORT" ] || exit 0
|
||||
fi
|
||||
########################################################
|
||||
fi
|
||||
|
||||
remove_from_bridge() {
|
||||
config_get ifname "$section" ifname
|
||||
|
||||
ubus call network.interface.$bridge remove_device '{"name":"$ifname"}'
|
||||
[ -n "$ifname" ] && ubus call network.interface.${al_brnet} remove_device '{"name":"$ifname"}'
|
||||
}
|
||||
|
||||
update_bstas() {
|
||||
local section="$1"
|
||||
local action="$2"
|
||||
local ifname onboarded
|
||||
section="$1"
|
||||
action="$2"
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get_bool enabled "$section" enabled 0
|
||||
@@ -34,16 +90,16 @@ update_bstas() {
|
||||
}
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
#touch "$MAPFILE"
|
||||
|
||||
#touch "$map_bh_file"
|
||||
config_load "mapagent"
|
||||
bridge=$(uci get mapagent.agent.al_bridge | cut -d '-' -f2)
|
||||
config_foreach remove_from_bridge bsta $bridge
|
||||
config_foreach remove_from_bridge bsta
|
||||
config_foreach update_bstas bsta down
|
||||
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT"
|
||||
else
|
||||
rm -f "$MAPFILE"
|
||||
/lib/wifi/multiap unset_uplink "eth"
|
||||
#rm -f "$map_bh_file"
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bsta up
|
||||
|
||||
fi
|
||||
|
||||
@@ -5,49 +5,14 @@ STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
|
||||
MAP_DEV="map_dev"
|
||||
MAP_IF="map"
|
||||
MAP_VETH="lei"
|
||||
|
||||
create_map() {
|
||||
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 set network.${MAP_DEV}.bridge_empty=1
|
||||
|
||||
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 set mapagent.agent.al_bridge=br-map
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.device
|
||||
|
||||
ip link add ${MAP_VETH} type veth peer name ${MAP_VETH}_lan 2>/dev/null
|
||||
brctl addif br-map ${MAP_VETH} 2>/dev/null
|
||||
brctl addif br-lan ${MAP_VETH}_lan 2>/dev/null
|
||||
ip link set ${MAP_VETH} up 2>/dev/null
|
||||
ip link set ${MAP_VETH}_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/map.agent.bsta_global_disable
|
||||
rm -f /tmp/multiap.backhaul
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/dynbhd"
|
||||
procd_set_param respawn
|
||||
@@ -56,10 +21,158 @@ start_dynbhd_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
validate_agent_section() {
|
||||
uci_validate_section mapagent agent "agent" \
|
||||
'enabled:bool:true' \
|
||||
'debug:range(0,16)' \
|
||||
'profile:range(1,2):2' \
|
||||
'brcm_setup:bool:false' \
|
||||
'controller_macaddr:macaddr' \
|
||||
'al_bridge:string' \
|
||||
'netdev:string' \
|
||||
'vlan_segregation:bool:false' \
|
||||
'resend_num:uinteger:0' \
|
||||
'dyn_cntlr_sync:bool:true' \
|
||||
'island_prevention:bool:false' \
|
||||
'eth_onboards_wifi_bhs:bool:false'
|
||||
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of agent section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_cs_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapagent $section "${section}" \
|
||||
'local:bool:false' \
|
||||
'id:string' \
|
||||
'probe_int:range(0,1000):20' \
|
||||
'retry_int:range(0,255):3' \
|
||||
'autostart:bool:false'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of controller_select section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_ap_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'ifname:string' \
|
||||
'device:string' \
|
||||
'band:or("2", "5")' \
|
||||
'enabled:bool:true' \
|
||||
'onboarded:bool:false' \
|
||||
'ssid:string' \
|
||||
'key:string' \
|
||||
'encryption:string' \
|
||||
'disallow_bsta_p1:bool:false' \
|
||||
'disallow_bsta_p2:bool:false'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of ap section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_radio_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'device:string' \
|
||||
'band:or("2", "5")' \
|
||||
'configured:bool:false' \
|
||||
'onboarded:bool:false' \
|
||||
'dedicated_backhaul:bool:false' \
|
||||
'steer_policy:range(0,255)' \
|
||||
'util_threshold:range(0,255)' \
|
||||
'rcpi_threshold:range(0,255)' \
|
||||
'report_rcpi_threshold:range(0,255)' \
|
||||
'include_sta_stats:bool:false' \
|
||||
'include_sta_metric:bool:false' \
|
||||
'rcpi_hysteresis_margin:range(0,255)' \
|
||||
'report_util_threshold:range(0,255)' \
|
||||
'encryption:or("sae", "psk2", "sae-mixed")'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of radio section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_policy_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'report_interval:range(0,255)' \
|
||||
'pvid:uinteger' \
|
||||
'report_interval:range(0,255)' \
|
||||
'pcp_default:range(0,255)' \
|
||||
'report_scan:bool' \
|
||||
'report_sta_assocfails:bool' \
|
||||
'report_sta_assocfails_rate:uinteger' \
|
||||
'steer_exclude:list(macaddr)' \
|
||||
'steer_exclude_btm:list(macaddr)' \
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of policy section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_dyn_bh_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'missing_bh_timer:range(1,255)'
|
||||
uci_validate_section mapagent $section "${1}" \
|
||||
'missing_bh_reconfig_timer:range(0,65535)'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapagent" "Validation of dynamic backhaul section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_agent_config() {
|
||||
IS_CFG_VALID=1
|
||||
|
||||
validate_agent_section &&
|
||||
config_foreach validate_cs_section controller_select &&
|
||||
config_foreach validate_ap_section ap &&
|
||||
config_foreach validate_radio_section radio &&
|
||||
config_foreach validate_policy_section policy &&
|
||||
config_foreach validate_dyn_bh_section dynamic_backhaul
|
||||
|
||||
[ "$IS_CFG_VALID" -ne 1 ] && {
|
||||
logger -s -t "mapagent" "Validation of mapagent UCI file failed"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -f /usr/sbin/dynbhd ] && start_dynbhd_service
|
||||
|
||||
config_load "mapagent"
|
||||
validate_agent_config || return 1;
|
||||
|
||||
ubus -t 5 wait_for wifi
|
||||
|
||||
@@ -69,22 +182,14 @@ 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
|
||||
procd_set_param command "/usr/sbin/mapagent" "-d"
|
||||
procd_set_param command "/usr/sbin/mapagent" "-d"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
#stop_service() {
|
||||
# remove_map
|
||||
#}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "mapagent"
|
||||
|
||||
13
map-agent/files/etc/uci-defaults/991-map-agent-unset-pvid
Executable file
13
map-agent/files/etc/uci-defaults/991-map-agent-unset-pvid
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
unset_pvid() {
|
||||
local section=$1
|
||||
|
||||
uci -q set mapagent.${section}.pvid="0"
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
|
||||
config_foreach unset_pvid policy
|
||||
@@ -55,8 +55,9 @@ get_type_by_section() {
|
||||
echo "$(type_to_multi_ap $type)"
|
||||
}
|
||||
|
||||
brcm_sync_credentials() {
|
||||
sync_credentials() {
|
||||
bands=""
|
||||
json_init
|
||||
mapagent_process_fh() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
@@ -80,6 +81,17 @@ brcm_sync_credentials() {
|
||||
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() {
|
||||
@@ -102,7 +114,38 @@ brcm_sync_credentials() {
|
||||
}
|
||||
|
||||
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}
|
||||
}
|
||||
@@ -114,10 +157,10 @@ brcm_sync_credentials() {
|
||||
config_foreach mapagent_process_radio radio
|
||||
|
||||
uci commit ieee1905
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
|
||||
brcm_write_credentials() {
|
||||
write_credentials() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wireless() {
|
||||
@@ -164,7 +207,7 @@ brcm_write_credentials() {
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
echo $(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key") 2> /dev/null
|
||||
(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key")
|
||||
}
|
||||
|
||||
mapagent_find_bbss() {
|
||||
@@ -207,7 +250,7 @@ brcm_write_credentials() {
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
brcm_set_network() {
|
||||
set_network() {
|
||||
local ifname=$1
|
||||
local num=$2
|
||||
local bssid=$3
|
||||
@@ -250,7 +293,13 @@ write_bsta_config() {
|
||||
|
||||
[ "$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
|
||||
@@ -307,14 +356,14 @@ write_bsta_config() {
|
||||
|
||||
#echo result diff = $diff > /dev/console
|
||||
[ "$diff" == "1" ] && {
|
||||
config_foreach mapagent_apply_bssid_same_band bsta
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
(config_foreach mapagent_apply_bssid_same_band bsta)
|
||||
#ubus call uci commit '{"config":"wireless"}'
|
||||
#echo reloading wireless > /dev/console
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
brcm_teardown_iface() {
|
||||
teardown_iface() {
|
||||
config_load mapagent
|
||||
|
||||
local iface=$1
|
||||
@@ -328,7 +377,7 @@ brcm_teardown_iface() {
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
uci -q set wireless.${section}.start_disabled="1"
|
||||
uci -q set wireless.${section}.disabled="1"
|
||||
uci -q set wireless.${section}.ssid="DISABLED-SSID"
|
||||
uci -q set wireless.${section}.key="DISABLED-KEY"
|
||||
uci -q delete wireless.${section}.multi_ap_backhaul_ssid
|
||||
@@ -355,9 +404,10 @@ brcm_teardown_iface() {
|
||||
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)
|
||||
(mapagent_teardown_wireless $ifname)
|
||||
}
|
||||
|
||||
|
||||
@@ -367,7 +417,7 @@ brcm_teardown_iface() {
|
||||
uci commit mapagent
|
||||
}
|
||||
|
||||
brcm_bsta_to_wireless() {
|
||||
bsta_to_wireless() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_find_lowest_prio_onboarded() {
|
||||
@@ -421,7 +471,7 @@ brcm_bsta_to_wireless() {
|
||||
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}.disabled=$disabled
|
||||
uci -q set wireless.${section}.default_disabled='0'
|
||||
|
||||
[ "$disabled" != "1" ] && return
|
||||
wpa_cli -i "$bsta" disconnect > /dev/null 2>&1
|
||||
@@ -439,10 +489,12 @@ brcm_bsta_to_wireless() {
|
||||
|
||||
mapagent_find_other_creds() {
|
||||
#echo "trying to find other creds for $2" > /dev/console
|
||||
local other_section="$2"
|
||||
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$3" != "$band" -o "$onboarded" = "0" ] && return
|
||||
[ "$4" != "$band" -o "$onboarded" = "0" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
@@ -450,7 +502,12 @@ brcm_bsta_to_wireless() {
|
||||
config_get enabled $1 enabled "0"
|
||||
config_get bssid $1 bssid
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $2 "$ssid" "$key" $encryption $4 "$bssid")
|
||||
uci -q set mapagent.${other_section}.ssid="$ssid"
|
||||
uci -q set mapagent.${other_section}.key="$key"
|
||||
uci -q set mapagent.${other_section}.encryption=$encryption
|
||||
uci -q set mapagent.${other_section}.bssid="$bssid"
|
||||
uci commit mapagent
|
||||
(mapagent_apply_wl_bsta "$3" "$ssid" "$key" $encryption "$5" "$bssid")
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
@@ -459,14 +516,14 @@ brcm_bsta_to_wireless() {
|
||||
config_get enabled $1 enabled "0"
|
||||
|
||||
if [ "$onboarded" = "0" ]; then
|
||||
config_foreach mapagent_find_other_creds bsta $ifname $band $enabled
|
||||
config_foreach mapagent_find_other_creds bsta $1 $ifname $band $enabled
|
||||
else
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
config_get bssid $1 bssid
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled "$bssid")
|
||||
(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled "$bssid")
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -485,6 +542,7 @@ brcm_bsta_to_wireless() {
|
||||
diff=$(config_foreach mapagent_bsta_to_wireless bsta)
|
||||
|
||||
# [ "$diff" != "" ] && {
|
||||
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
# }
|
||||
}
|
||||
@@ -579,27 +637,43 @@ sync_mapcontroller_from_wireless() {
|
||||
}
|
||||
|
||||
bsta_scan_on_enabled() {
|
||||
config_load mapagent
|
||||
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
|
||||
|
||||
echo ifname $ifname enabled $enabled
|
||||
|
||||
[ "$enabled" = "0" ] && return
|
||||
|
||||
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
|
||||
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 "2"
|
||||
config_get ifname $1 ifname
|
||||
uci -q set mapagent.$1.enabled="1"
|
||||
}
|
||||
|
||||
@@ -610,6 +684,68 @@ bsta_enable_all() {
|
||||
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
|
||||
|
||||
@@ -657,9 +793,13 @@ bsta_disable_lower_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"
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
|
||||
(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
@@ -693,6 +833,12 @@ bsta_use_link() {
|
||||
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() {
|
||||
@@ -708,11 +854,14 @@ set_uplink_backhaul_info() {
|
||||
local ul_1905id=$1
|
||||
local ul_mac=$2
|
||||
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_add_string "backhaul_device_id" "$ul_1905id"
|
||||
json_add_string "backhaul_macddr" "$ul_mac"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
(
|
||||
flock -x 200
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_add_string "backhaul_device_id" "$ul_1905id"
|
||||
json_add_string "backhaul_macddr" "$ul_mac"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
) 200>/var/lock/map.backhaul.lock
|
||||
}
|
||||
|
||||
set_uplink() {
|
||||
@@ -726,31 +875,63 @@ set_uplink() {
|
||||
json_add_string "type" "$type"
|
||||
json_add_string "ifname" "$ifname"
|
||||
json_add_string "macaddr" "$hwaddr"
|
||||
json_dump > "$MAPFILE"
|
||||
(
|
||||
flock -x 200
|
||||
json_dump > "$MAPFILE"
|
||||
) 200>/var/lock/map.backhaul.lock
|
||||
json_cleanup
|
||||
|
||||
config_load mapagent
|
||||
|
||||
island_prevention="$(uci -q get mapagent.agent.island_prevention)"
|
||||
|
||||
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
|
||||
ubus call map.agent toggle_fh '{"enable":true, "prevent_island":true, "ifname":"all"}'
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
unset_uplink() {
|
||||
rm "$MAPFILE" > /dev/null 2>&1
|
||||
local type=${1:-wifi}
|
||||
|
||||
config_load mapagent
|
||||
|
||||
island_prevention="$(uci -q get mapagent.agent.island_prevention)"
|
||||
|
||||
if [ "$island_prevention" = "1" -a "$type" = "eth" ]; then
|
||||
ubus call map.agent toggle_fh '{"enable":false, "prevent_island":true, "ifname":"all"}'
|
||||
fi
|
||||
|
||||
(
|
||||
flock -x 200
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_get_var bk_type type
|
||||
json_cleanup
|
||||
|
||||
[ "$type" = "$bk_type" ] && rm -f "$MAPFILE" > /dev/null 2>&1
|
||||
) 200>/var/lock/map.backhaul.lock
|
||||
}
|
||||
|
||||
func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
wireless_teardown) brcm_wireless_teardown;;
|
||||
setup_network) brcm_setup_network;;
|
||||
setup_wireless) brcm_setup_wireless;;
|
||||
write_credentials) brcm_write_credentials;;
|
||||
sync_credentials) brcm_sync_credentials;;
|
||||
wireless_teardown) wireless_teardown;;
|
||||
setup_network) setup_network;;
|
||||
setup_wireless) setup_wireless;;
|
||||
write_credentials) write_credentials;;
|
||||
sync_credentials) sync_credentials;;
|
||||
bsta_steer) bsta_steer $@;;
|
||||
set_network) brcm_set_network $@;;
|
||||
set_network) set_network $@;;
|
||||
write_bsta_config) write_bsta_config $@;;
|
||||
teardown_iface) brcm_teardown_iface $@;;
|
||||
bsta_to_wireless) brcm_bsta_to_wireless $@;;
|
||||
teardown_iface) teardown_iface $@;;
|
||||
bsta_to_wireless) bsta_to_wireless $@;;
|
||||
sync_mapcontroller_from_wireless) sync_mapcontroller_from_wireless $@;;
|
||||
ts) ts_sub $@;;
|
||||
bsta_enable_all) bsta_enable_all $@;;
|
||||
bsta_clear_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 $@;;
|
||||
|
||||
@@ -2,379 +2,458 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
AL_BRIDGE=${AL_BRIDGE-"br-lan"}
|
||||
PRIMARY_VID=${PRIMARY_VID-1}
|
||||
|
||||
### Traffic Separation ###
|
||||
|
||||
ts_sub() {
|
||||
dbg() {
|
||||
logger -t traffic_separation $@
|
||||
}
|
||||
|
||||
ts_sub() {
|
||||
ts_usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [create|delete|populate]
|
||||
Usage: $0 [create|reload]
|
||||
Traffic Separation related functions.
|
||||
create fh <iface> <vid> - create vlan device and rules for wifi fronthaul
|
||||
create bh <iface> <vid> <profile> - create vlan device and rules for wifi backhaul
|
||||
create eth <iface> <vid> <pbits> - create vlan device and rules for logical ethernet interface
|
||||
delete <iface> - delete vlan device
|
||||
populate eth <iface> <vid> - add secondary network rules for logical ethernet interface
|
||||
primary get <iface> - read primary VID for interface from driver (from Association Response frame IE)
|
||||
|
||||
create vid - create vlan configuration with vlan_id
|
||||
reload - reload network with new configuration
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_get_bridge() {
|
||||
local bridge=$(ip link show $1 | grep -o "master [^\s]*" | cut -d ' ' -f 2)
|
||||
echo $bridge
|
||||
}
|
||||
|
||||
ts_create() {
|
||||
_dhcp_setup() {
|
||||
local name=$1
|
||||
|
||||
_create_vlan_dev() {
|
||||
iface=$1 # real iface
|
||||
vid=$2 # Vlan ID
|
||||
bridge="$(_get_bridge $iface)" # bridge iface is connected to
|
||||
vlan_dev=${iface}_vlan${vid} # name of vlan device to create
|
||||
[ -n "$(uci -q get dhcp.${name})" ] && return
|
||||
|
||||
# remove interface from bridge if it is in one
|
||||
[ -n "$bridge" ] && brctl delif $bridge $iface &> /dev/null
|
||||
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"
|
||||
|
||||
# create vlan device
|
||||
vlanctl --mcast --if-create-name $iface $vlan_dev --if $iface --set-if-mode-rg
|
||||
|
||||
# bring the vlan device up and add back to bridge if it was in one
|
||||
[ -n "$bridge" ] && brctl addif $bridge $vlan_dev &> /dev/null
|
||||
ip link set dev $vlan_dev up
|
||||
|
||||
echo $vlan_dev
|
||||
uci -q commit dhcp
|
||||
}
|
||||
|
||||
ts_create_fh() {
|
||||
iface=$1 # fh iface
|
||||
vid=$2 # SSID specific (secondary) or primary vid
|
||||
_firewall_setup() {
|
||||
local name=$1
|
||||
local network=$1
|
||||
local vid=$2
|
||||
local zone_exist=0
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
Adding FH device requires IFACE and VID.
|
||||
EOF
|
||||
exit 1
|
||||
config_load firewall
|
||||
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local new_name=$2
|
||||
local name
|
||||
|
||||
config_get name $section name
|
||||
|
||||
[ "$name" == "$new_name" ] && zone_exist=1
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
config_foreach _process_zone zone $name
|
||||
|
||||
# add rules
|
||||
# Note: removing these for now since these packets are read directly from the iface anyway
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x888e --set-rxif $vlan_dev --rule-append # incoming EAPOL
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x886c --set-rxif $vlan_dev --rule-append # incoming brcm
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --filter-vid $vid 0 --pop-tag --dscp2pbits 0 --rule-append
|
||||
[ "$zone_exist" != "0" ] && return
|
||||
|
||||
uci -q add firewall zone
|
||||
uci -q set firewall.@zone[-1].name="$name"
|
||||
uci -q add_list firewall.@zone[-1].network="$network"
|
||||
uci -q set firewall.@zone[-1].input='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].output='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].forward='ACCEPT'
|
||||
|
||||
uci -q add firewall forwarding
|
||||
uci -q set firewall.@forwarding[-1].src="$name"
|
||||
uci -q set firewall.@forwarding[-1].dest="wan"
|
||||
|
||||
uci -q commit firewall
|
||||
}
|
||||
|
||||
# Note: Currently not used (will be needed for Profile 1)
|
||||
ts_create_bh() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
_guest_net_setup() {
|
||||
local vid=$1
|
||||
local name="guest${vid}"
|
||||
local dev="guest_dev${vid}"
|
||||
local br_guest="br-guest${vid}"
|
||||
local peer="guest_peer${vid}"
|
||||
local ip_addr="192.168.${vid}.1"
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
[ "${vid}" = "${PRIMARY_VID}" ] && return
|
||||
|
||||
ip link show $dev 2> /dev/null || {
|
||||
ip link add $dev type veth peer name $peer
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
ip link set $dev up
|
||||
ip link set $port_dev up
|
||||
|
||||
# add rules
|
||||
case "$profile" in
|
||||
1 | profile_1 | profile1 | Profile_1 | Profile1)
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
;;
|
||||
2 | profile_2 | profile2 | Profile_2 | Profile2)
|
||||
vlanctl --if $iface --rx --tags 1 --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --rule-append # note: already default
|
||||
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x893a --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing IEEE1905.1
|
||||
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x888e --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing EAPOL
|
||||
;;
|
||||
*)
|
||||
ts_delete $iface
|
||||
ts_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
[ -z "$(uci -q get network.${name})" ] || return
|
||||
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="${br_guest}"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
uci -q set network.${name}.proto="static"
|
||||
uci -q set network.${name}.ipaddr="${ip_addr}"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
uci -q set network.${name}.ip6assign '60'
|
||||
|
||||
uci -q set network.br_${name}="device"
|
||||
uci -q set network.br_${name}.name="${br_guest}"
|
||||
uci -q set network.br_${name}.type="bridge"
|
||||
|
||||
if [ -z $(uci -q get network.${br_dev}.ports | grep -w ${dev}) ]; then
|
||||
uci -q add_list network.${br_dev}.ports="${dev}"
|
||||
fi
|
||||
|
||||
if [ -z $(uci -q get network.br_${name}.ports | grep -w ${peer}) ]; then
|
||||
uci -q add_list network.br_${name}.ports="${peer}"
|
||||
fi
|
||||
|
||||
if [ -z $(uci -q get network.vlan${vid}.ports | grep -w ${dev}) ]; then
|
||||
uci -q add_list network.vlan${vid}.ports="${dev}:*"
|
||||
fi
|
||||
|
||||
uci -q commit network
|
||||
}
|
||||
|
||||
ts_create_bh_drv() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
_net_setup() {
|
||||
local vid=$1
|
||||
local layer3=$2
|
||||
local name="vlan${vid}"
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local tag=":t"
|
||||
local self_flags="untagged"
|
||||
local brvid_local="1"
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
[ -z "$(uci -q get network.${name})" ] || return
|
||||
|
||||
wl vlan_mode 0 &> /dev/null # make sure this is OFF, else driver won't handle vlan
|
||||
wl -i $iface down &> /dev/null
|
||||
wl -i $iface map_profile $profile &> /dev/null # only has effect on profile 2
|
||||
wl -i $iface map_8021q_settings $vid &> /dev/null # can only be set on bBSS (read-only on bSTA)
|
||||
wl -i $iface up &> /dev/null
|
||||
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"
|
||||
|
||||
if [ "${vid}" = "${PRIMARY_VID}" ]; then
|
||||
self_flags="untagged pvid"
|
||||
tag=":*"
|
||||
elif [ -x "/usr/sbin/mapcontroller" -a "$layer3" = "1" ]; then
|
||||
brvid_local="0"
|
||||
fi
|
||||
|
||||
uci -q set network.${name}.flags="${self_flags}"
|
||||
uci -q set network.${name}.local="${brvid_local}"
|
||||
|
||||
for port in $(uci -q get network.${br_dev}.ports) ; do
|
||||
if [ -x "/usr/sbin/mapcontroller" -a "$layer3" = "1" ]; then
|
||||
echo $port | grep "guest" && continue
|
||||
fi
|
||||
uci -q get network.${name}.ports | grep -q "${port}${tag}" && continue
|
||||
uci -q add_list network.${name}.ports="${port}${tag}"
|
||||
done
|
||||
|
||||
uci -q commit network
|
||||
}
|
||||
local layer3=$(uci -q get mapagent.agent.layer3_ts)
|
||||
|
||||
ts_create_eth() {
|
||||
vid=$1
|
||||
|
||||
_ts_setup() {
|
||||
vlan_bridge=$1
|
||||
lan_bridge=$2
|
||||
vlan_dev=$3
|
||||
lan_dev=${vlan_dev}_lan
|
||||
|
||||
ip link show $vlan_dev &> /dev/null || ip link add $vlan_dev type veth peer name $lan_dev
|
||||
brctl addif $vlan_bridge $vlan_dev &> /dev/null
|
||||
brctl addif $lan_bridge $lan_dev &> /dev/null
|
||||
ip link set $vlan_dev up
|
||||
ip link set $lan_dev up
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # primary vid
|
||||
pbits=$3 # default pbits to apply
|
||||
vlan_bridge=$4 # name of ts subsystem bridge
|
||||
lan_bridge=$5 # name of node local bridge
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$pbits" ] && [ -n "$vlan_bridge" ] && [ -n "$lan_bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create virtual eth device between bridges (if it doesn't exist))
|
||||
_ts_setup $vlan_bridge $lan_bridge $iface
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
|
||||
# TODO: how to disable returning traffic back to incoming interface?
|
||||
|
||||
# add rules
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --set-pbits $pbits 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
}
|
||||
|
||||
ts_create_dhcp() {
|
||||
_br_setup() {
|
||||
local name=$1
|
||||
local sinkname=$2
|
||||
local vid=$3
|
||||
local diff=""
|
||||
|
||||
[ -z "$(uci -q get network.${name}_dev)" ] && {
|
||||
uci -q set network.${name}_dev="device"
|
||||
uci -q set network.${name}_dev.name="br-${name}"
|
||||
uci -q set network.${name}_dev.type="bridge"
|
||||
uci -q set network.${name}_dev.bridge_empty="1"
|
||||
uci -q add_list network.${name}_dev.ports="${sinkname}"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get network.${name})" ] && {
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="br-${name}"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
uci -q set network.${name}.proto="static"
|
||||
uci -q set network.${name}.ipaddr="192.168.${vid}.1"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ "$diff" = "1" ] && {
|
||||
uci -q commit network
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.device
|
||||
}
|
||||
}
|
||||
|
||||
_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
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
}
|
||||
|
||||
_wan_setup() {
|
||||
local name=$1
|
||||
|
||||
config_load firewall
|
||||
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local sink=$2
|
||||
local name
|
||||
local exists=false
|
||||
|
||||
config_get name $section name
|
||||
|
||||
[ "$name" == "lan" ] || return
|
||||
|
||||
_process_list() {
|
||||
local value=$1
|
||||
|
||||
[ "$value" == "$sink" ] && exists=true && return 1
|
||||
}
|
||||
|
||||
config_list_foreach "$section" network _process_list
|
||||
|
||||
[ $exists = false ] && {
|
||||
uci -q add_list firewall.${section}.network="${sink}"
|
||||
uci -q commit firewall
|
||||
ubus call uci commit '{"config":"firewall"}'
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
config_foreach _process_zone zone $name
|
||||
}
|
||||
|
||||
vid=$1 # primary vid
|
||||
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
VID required to configure DHCP.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
br_dev=sink_vlan${vid} # name of vlan device to create
|
||||
|
||||
|
||||
ip l a sink1_vlan${vid} type veth peer name sink2_vlan${vid}
|
||||
vlanctl --mcast --if-create-name sink2_vlan${vid} sink3_vlan${vid} --if sink2_vlan${vid} --set-if-mode-rg
|
||||
vlanctl --if sink2_vlan${vid} --rx --tags 1 --filter-vid ${vid} 0 --set-rxif sink3_vlan${vid} --pop-tag --rule-append
|
||||
vlanctl --if sink2_vlan${vid} --tx --tags 0 --filter-txif sink3_vlan${vid} --push-tag --set-vid ${vid} 0 --rule-append
|
||||
ip l s sink1_vlan${vid} up
|
||||
ip l s sink2_vlan${vid} up
|
||||
ip l s sink3_vlan${vid} up
|
||||
|
||||
_br_setup $br_dev sink3_vlan${vid} $vid
|
||||
_dhcp_setup $br_dev
|
||||
_wan_setup $br_dev
|
||||
}
|
||||
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
case "$type" in
|
||||
fh) ts_create_fh $@;;
|
||||
# bh) ts_create_bh $@;;
|
||||
bh) ts_create_bh_drv $@;;
|
||||
eth) ts_create_eth $@;;
|
||||
dhcp) ts_create_dhcp $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_delete() {
|
||||
iface=$1
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 0
|
||||
vlan_dev=${path##*upper_}
|
||||
bridge="$(_get_bridge $vlan_dev)"
|
||||
|
||||
vlanctl --if-delete $vlan_dev # note: also removes rules and removes from bridge
|
||||
|
||||
brctl addif $bridge $iface &> /dev/null
|
||||
}
|
||||
|
||||
ts_populate() {
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
[ "$type" == "eth" ] || {
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
Populating ETH rules requires IFACE and VID.
|
||||
VID required to configure.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # secondary vid
|
||||
_net_setup ${vid} ${layer3}
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 1
|
||||
vlan_dev=${path##*upper_}
|
||||
logger -t vlan "setup ts vid $vid"
|
||||
[ -x "/usr/sbin/mapcontroller" -a "$layer3" = "1" ] && {
|
||||
_dhcp_setup guest${vid}
|
||||
_firewall_setup guest${vid} ${vid}
|
||||
_guest_net_setup ${vid}
|
||||
|
||||
# add rules
|
||||
vlanctl --if $iface --rx --tags 1 --filter-vid $vid 0 --set-rxif $vlan_dev --rule-append # note: retain secondary vids
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --rule-append # note: already default
|
||||
}
|
||||
|
||||
# Disable pktfwd here and flush FlowCache rules
|
||||
echo 0 > /proc/pktfwd_dhd/enable
|
||||
echo 0 > /proc/pktfwd_wl/enable
|
||||
fcctl flush
|
||||
}
|
||||
|
||||
ts_primary() {
|
||||
local func=$1
|
||||
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
|
||||
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)
|
||||
local layer3="$(uci -q get mapagent.agent.layer3_ts)"
|
||||
restart=""
|
||||
|
||||
[ "$al_bridge" = "" ] && al_bridge="br-lan"
|
||||
|
||||
|
||||
guest_teardown() {
|
||||
local section=$1
|
||||
local config=$2
|
||||
local bridge=$3
|
||||
local option=$4
|
||||
|
||||
config_get name "$section" "$option"
|
||||
|
||||
[ "$bridge" != "$name" ] && continue
|
||||
|
||||
uci -q delete ${config}.${section}
|
||||
}
|
||||
|
||||
bridge_vlan_teardown() {
|
||||
local section=$1
|
||||
shift
|
||||
local bridge=$1
|
||||
shift
|
||||
local layer3=$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
|
||||
|
||||
#if layer3ts enabled
|
||||
if [ -x "/usr/sbin/mapcontroller" -a "$layer3" = "1" ]; then
|
||||
local br_guest="br-guest${vlan}"
|
||||
|
||||
config_load network
|
||||
config_foreach guest_teardown device "network" $br_guest "name" $@ # could easier be replaced by uci ubus api and using match field
|
||||
config_foreach guest_teardown interface "network" $br_guest "device" $@ # could easier be replaced by uci ubus api and using match field
|
||||
|
||||
config_load dhcp
|
||||
[ -n "$(uci -q get dhcp.guest${vlan})" ] && {
|
||||
uci -q delete dhcp.guest${vlan}
|
||||
restart="1"
|
||||
}
|
||||
config_load firewall
|
||||
config_foreach guest_teardown zone "firewall" guest${vlan} "name" $@ #delete firewall section with name = guest${vlan}
|
||||
config_foreach guest_teardown forwarding "firewall" guest${vlan} "src" $@ #delete firewall section with name = guest${vlan}
|
||||
fi
|
||||
|
||||
|
||||
#endif
|
||||
uci -q delete network.$section
|
||||
restart="1"
|
||||
}
|
||||
|
||||
config_load network
|
||||
(config_foreach bridge_vlan_teardown bridge-vlan $al_bridge $layer3 $@)
|
||||
|
||||
if [ "$restart" = "1" ]; then
|
||||
uci commit network
|
||||
if [ -x "/usr/sbin/mapcontroller" -a "$layer3" = "1" ]; then
|
||||
uci commit firewall
|
||||
uci commit dhcp
|
||||
fi
|
||||
dbg "trigger network restart"
|
||||
/etc/init.d/network restart
|
||||
fi
|
||||
}
|
||||
|
||||
ts_cleanup() {
|
||||
local al_bridge=$(uci -q get mapagent.agent.al_bridge)
|
||||
local layer3="$(uci -q get mapagent.agent.layer3_ts)"
|
||||
restart=""
|
||||
|
||||
[ "$al_bridge" = "" ] && al_bridge="br-lan"
|
||||
|
||||
bridge_device_teardown() {
|
||||
local section=$1
|
||||
local bridge=$2
|
||||
local layer3=$3
|
||||
local br_dev="${AL_BRIDGE/-/_}"
|
||||
local dev
|
||||
local br_guest
|
||||
local peer
|
||||
|
||||
config_get device "$section" device
|
||||
config_get vlan "$section" vlan
|
||||
|
||||
dev="guest_dev${vlan}"
|
||||
|
||||
[ "$bridge" != "$device" ] && continue
|
||||
|
||||
uci -q delete network.$section
|
||||
|
||||
echo "restart"
|
||||
|
||||
[ -x "/usr/sbin/mapcontroller" -a "$layer3" = "1" ] || continue
|
||||
|
||||
####
|
||||
# layer3 specific teardown
|
||||
####
|
||||
|
||||
guest_teardown() {
|
||||
local section=$1
|
||||
local config=$2
|
||||
local bridge=$3
|
||||
local option=$4
|
||||
|
||||
config_get name "$section" "$option"
|
||||
|
||||
[ "$bridge" != "$name" ] && continue
|
||||
|
||||
echo "$bridge=$name" > /dev/console
|
||||
|
||||
uci -q delete ${config}.${section}
|
||||
echo "uci -q delete ${config}.${section}" > /dev/console
|
||||
}
|
||||
|
||||
br_guest="br-guest${vlan}"
|
||||
|
||||
# network config guest teardown
|
||||
config_load network
|
||||
config_foreach guest_teardown device "network" $br_guest "name"
|
||||
config_foreach guest_teardown interface "network" $br_guest "device"
|
||||
|
||||
if [ -n "$(uci -q get network.${br_dev}.ports | grep -w ${dev})" ]; then
|
||||
uci -q del_list network.${br_dev}.ports="${dev}"
|
||||
fi
|
||||
|
||||
peer="guest_peer${vlan}"
|
||||
|
||||
ip link show $dev 2> /dev/null && {
|
||||
ip link del $dev
|
||||
}
|
||||
|
||||
ip link show $peer 2> /dev/null && {
|
||||
ip link del $peer
|
||||
}
|
||||
|
||||
# dhcp config guest teardown
|
||||
[ -n "$(uci -q get dhcp.guest${vlan})" ] && {
|
||||
uci -q delete dhcp.guest${vlan}
|
||||
}
|
||||
|
||||
# firewall config guest teardown
|
||||
config_load firewall
|
||||
config_foreach guest_teardown zone "firewall" guest${vlan} "name"
|
||||
config_foreach guest_teardown forwarding "firewall" guest${vlan} "src"
|
||||
}
|
||||
|
||||
config_load network
|
||||
restart="$(config_foreach bridge_device_teardown bridge-vlan $al_bridge $layer3)"
|
||||
|
||||
if [ -n "$restart" ]; then
|
||||
uci commit network
|
||||
if [ -x "/usr/sbin/mapcontroller" -a "$layer3" = "1" ]; then
|
||||
uci commit firewall
|
||||
uci commit dhcp
|
||||
fi
|
||||
dbg "trigger network restart"
|
||||
/etc/init.d/network restart
|
||||
fi
|
||||
|
||||
# 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() {
|
||||
local action=$1
|
||||
shift
|
||||
local pvid=$1 # pvid
|
||||
shift
|
||||
local ifname=$1 # guest fbss name
|
||||
shift
|
||||
local ifprefix=$@ # 4addr mode ifname prefix
|
||||
|
||||
case "$func" in
|
||||
get) vid=$(wl -i $1 map_8021q_settings); echo ${vid##* };;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
[ -z "$pvid" -o -z "$ifprefix" -o -z "$ifname" ] && return
|
||||
|
||||
ts_unicast() {
|
||||
local mac=$1
|
||||
local iface=$2
|
||||
for prefix in $@; do
|
||||
ebtables -D FORWARD -i $ifname --o ${prefix}+ --vlan-id ! $pvid -j DROP -p 802_1Q > /dev/null 2>&1
|
||||
ebtables -D FORWARD -i ${prefix}+ --o ${ifname} --vlan-id ! $pvid -j DROP -p 802_1Q > /dev/null 2>&1
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "$mac" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
[ "$action" != "add" ] && continue
|
||||
ebtables -A FORWARD -i $ifname --o ${prefix}+ --vlan-id ! $pvid -j DROP -p 802_1Q > /dev/null 2>&1
|
||||
ebtables -A FORWARD -i ${prefix}+ --o ${ifname} --vlan-id ! $pvid -j DROP -p 802_1Q > /dev/null 2>&1
|
||||
done
|
||||
|
||||
ebtables -t broute -D BROUTING -d "$mac" -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d "$mac" -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
ts_multicast() {
|
||||
local iface=$1
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "1:80:C2:00:00:13" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -D BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
create) ts_create $@;;
|
||||
delete) ts_delete $@;;
|
||||
populate) ts_populate $@;;
|
||||
primary) ts_primary $@;;
|
||||
unicast) ts_unicast $@;;
|
||||
multicast) ts_multicast $@;;
|
||||
create) dbg "create $@"; ts_create $@;;
|
||||
keep) dbg "keep $@"; ts_keep $@;;
|
||||
reload) dbg "reload $@"; ts_reload $@;;
|
||||
cleanup) dbg "cleanup $@"; ts_cleanup $@;;
|
||||
isolate) dbg "isolate $@"; ts_isolate $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
|
||||
26
map-controller/Config.in
Normal file
26
map-controller/Config.in
Normal file
@@ -0,0 +1,26 @@
|
||||
if (PACKAGE_map-controller)
|
||||
|
||||
menu "Configurations"
|
||||
|
||||
config CONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
bool "Support Dynamic Controller configuration sync"
|
||||
default y if MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT
|
||||
bool "Enable extra features through Easymesh vendor extension"
|
||||
default y
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
default CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
enabled through CONTROLLER_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
endmenu
|
||||
endif
|
||||
@@ -1,16 +1,13 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=5.4.4
|
||||
PKG_VERSION:=2.8.0.15
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=52e85d2dd2762148aaac808f0d867bce92c69a26
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_SOURCE_VERSION:=e71a5f4f7f947f4c7819b4caf238fd1bec9b4fe8
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
@@ -20,6 +17,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-controller
|
||||
@@ -34,7 +34,7 @@ define Package/map-controller/description
|
||||
endef
|
||||
|
||||
define Package/map-controller/config
|
||||
#source "$(SOURCE)/Config.in"
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -44,11 +44,22 @@ TARGET_CFLAGS += \
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG),y)
|
||||
TARGET_CFLAGS += -DCONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
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
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapcontroller $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/mapcontroller
|
||||
$(CP) $(PKG_BUILD_DIR)/src/plugins/steer/rcpi/rcpi.so $(1)/usr/lib/mapcontroller/rcpi.so
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
|
||||
@@ -1,67 +1,144 @@
|
||||
config controller 'controller'
|
||||
option enabled '1'
|
||||
option registrar '5 2' #bands on which wps registrar supported
|
||||
option debug '6'
|
||||
option registrar '2 5'
|
||||
option debug '0'
|
||||
option enable_sta_steer '0'
|
||||
option enable_bsta_steer '0'
|
||||
option use_bcn_metrics '0'
|
||||
option use_usta_metrics '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
|
||||
config interface 'lan'
|
||||
option 'dhcp'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net5'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
option enable_ts '0'
|
||||
option allow_bgdfs '0'
|
||||
option channel_plan '0'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net2'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
option ssid 'IOWRT-2.4GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'sae'
|
||||
option key '5555555555'
|
||||
option ssid 'map-bkhaul-5'
|
||||
option type 'backhaul'
|
||||
option disallow_bsta '1' # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
option type 'fronthaul'
|
||||
option vid '1'
|
||||
option network 'lan'
|
||||
option ssid 'IOWRT-5GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'sae'
|
||||
option key '2222222222'
|
||||
option ssid 'map-bkhaul-2'
|
||||
list disallow_bsta '0' # 0 or 1 profile-1 bSTA
|
||||
option vid '1'
|
||||
option type 'backhaul'
|
||||
option network 'lan'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
config policy 'policy'
|
||||
list steer_exclude '00:11:22:33:44:55'
|
||||
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
|
||||
option util_threshold '200' # channel-util as in BSS load
|
||||
option rcpi_threshold '30' # 0 - 220 valid range
|
||||
option report_scan '0' # 0 or 1 for independent scans
|
||||
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
|
||||
option report_sta_assocfails_rate '2' # reporting rate for STA assoc fails (attempts per minute)
|
||||
option report_metric_periodic '0' # 0, or 1 - 255 in secs
|
||||
option report_rcpi_threshold '0' # 0, or 1 - 220
|
||||
option report_util_threshold '0' # 0, or channel-util value
|
||||
option rcpi_hysteresis_margin '0' # 0, or > 0 - hysteresis margin
|
||||
option include_sta_stats '0' # sta stats in AP metric resp
|
||||
option include_sta_metric '0' # sta metric in AP metric resp
|
||||
option disallow_bsta_p1 '0' # 0 or 1 profile-1 bSTA
|
||||
option disallow_bsta_p2 '0' # 0 or 1 profile-2 bSTA
|
||||
config ap
|
||||
option band '5'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-5GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
# node and radio sections (per node) are auto
|
||||
# generated per Multi-AP Agent in the network
|
||||
#
|
||||
#config node 'node_0a1b2c3d4e50'
|
||||
# option agent_id '0a:1b:2c:3d:4e:50'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option backhaul_ul_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_dl_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_type 'none'
|
||||
# option primary_vid '1'
|
||||
# option primary_pcp '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
# option report_metric_periodic '0'
|
||||
# option report_scan '0'
|
||||
# option steer_exclude '0'
|
||||
# option steer_exclude_btm '0'
|
||||
# option steer_disallow '0'
|
||||
# option coordinated_cac '0'
|
||||
# option traffic_separation '0'
|
||||
# option sta_steer '0'
|
||||
|
||||
#config radio 'radio_0a1b2c3d4e53'
|
||||
# option agent_id '0a:1b:2c:3d:4e:50'
|
||||
# option macaddr '0a:1b:2c:3d:4e:53'
|
||||
# option band '2'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '70'
|
||||
# option report_rcpi_threshold '80'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config radio 'radio_0a1b2c3d4e54'
|
||||
# option agent_id '0a:1b:2c:3d:4e:50'
|
||||
# option macaddr '0a:1b:2c:3d:4e:54'
|
||||
# option band '5'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '86'
|
||||
# option report_rcpi_threshold '96'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config node 'node_3fb1c2d3e460'
|
||||
# option agent_id '3f:b1:c2:d3:e4:60'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option backhaul_ul_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_dl_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_type 'none'
|
||||
# option primary_vid '1'
|
||||
# option primary_pcp '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
# option report_metric_periodic '0'
|
||||
# option report_scan '0'
|
||||
# option steer_exclude '0'
|
||||
# option steer_exclude_btm '0'
|
||||
# option steer_disallow '0'
|
||||
# option coordinated_cac '0'
|
||||
# option traffic_separation '0'
|
||||
# option sta_steer '0'
|
||||
|
||||
#config radio 'radio_3fb1c2d3e463'
|
||||
# option agent_id '3f:b1:c2:d3:e4:60'
|
||||
# option macaddr '3f:b1:c2:d3:e4:63'
|
||||
# option band '2'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '70'
|
||||
# option report_rcpi_threshold '80'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
#config radio 'radio_3fb1c2d3e464'
|
||||
# option agent_id '3f:b1:c2:d3:e4:60'
|
||||
# option macaddr '3f:b1:c2:d3:e4:64'
|
||||
# option band '5'
|
||||
# following values use default values after onboarding if not explicitly set
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
# option rcpi_threshold '86'
|
||||
# option report_rcpi_threshold '96'
|
||||
# option report_util_threshold '0'
|
||||
# option report_rcpi_hysteresis_margin '0'
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
@@ -5,6 +5,8 @@ STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
|
||||
handle_controller_select() {
|
||||
local section="$1"
|
||||
|
||||
@@ -12,10 +14,125 @@ handle_controller_select() {
|
||||
return 1
|
||||
}
|
||||
|
||||
validate_controller_section() {
|
||||
uci_validate_section mapcontroller controller "controller" \
|
||||
'enabled:bool:true' \
|
||||
'registrar:string' \
|
||||
'debug:range(0,16)' \
|
||||
'resend_num:uinteger:0' \
|
||||
'enable_sta_steer:bool:false' \
|
||||
'enable_bsta_steer:bool:false' \
|
||||
'use_bcn_metrics:bool:false' \
|
||||
'use_usta_metrics:bool:false' \
|
||||
'allow_bgdfs:range(0,2629744)' \
|
||||
'channel_plan:range(0,2629744)' \
|
||||
'enable_ts:bool:false'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapcontroller" "Validation of controller section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_ap_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapcontroller $section "${1}" \
|
||||
'band:or("2", "5")' \
|
||||
'ssid:string' \
|
||||
'encryption:or("sae", "sae+aes", "psk2",
|
||||
"psk2+aes", "sae-mixed", "sae-mixed+aes")' \
|
||||
'key:string' \
|
||||
'vid:range(1,65535):1' \
|
||||
'type:or("backhaul", "fronthaul", "combined")' \
|
||||
'disallow_bsta:list(range(0,255)):0' \
|
||||
'enabled:bool:true'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapcontroller" "Validation of ap section $section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_node_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapcontroller $section "${1}" \
|
||||
'agent_id:macaddr' \
|
||||
'backhaul_ul_macaddr:macaddr' \
|
||||
'backhaul_dl_macaddr:macaddr' \
|
||||
'backhaul_type:or("none")' \
|
||||
'primary_vid:range(0,255):1' \
|
||||
'primary_pcp:range(0,255):0' \
|
||||
'report_sta_assocfails:bool:false' \
|
||||
'report_sta_assocfails_rate:uinteger' \
|
||||
'report_metric_periodic:range(0,255)' \
|
||||
'report_scan:bool:false' \
|
||||
'steer_exclude:list(macaddr)' \
|
||||
'steer_exclude_btm:list(macaddr)' \
|
||||
'steer_disallow:bool:false' \
|
||||
'coordinated_cac:bool:false' \
|
||||
'traffic_separation:bool:false' \
|
||||
'sta_steer:bool:false'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapcontroller" "Validation of node section $section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_radio_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section mapcontroller $section "${1}" \
|
||||
'agent_id:macaddr' \
|
||||
'macaddr:macaddr' \
|
||||
'band:or("2", "5")' \
|
||||
'steer_policy:range(0,2)' \
|
||||
'util_threshold:range(0,255)' \
|
||||
'rcpi_threshold:range(0,255)' \
|
||||
'report_rcpi_threshold:range(0,255)' \
|
||||
'report_util_threshold:range(0,255)' \
|
||||
'report_rcpi_hysteresis_margin:range(0,255)' \
|
||||
'include_sta_stats:bool:false' \
|
||||
'include_sta_metric:bool:false'
|
||||
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "mapcontroller" "Validation of radio section $section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_controller_config() {
|
||||
IS_CFG_VALID=1
|
||||
|
||||
validate_controller_section &&
|
||||
config_foreach validate_ap_section ap &&
|
||||
config_foreach validate_node_section node &&
|
||||
config_foreach validate_radio_section radio
|
||||
|
||||
[ "$IS_CFG_VALID" -ne 1 ] && {
|
||||
logger -s -t "mapcontroller" "Validation of mapcontroller UCI file failed"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
|
||||
config_load "mapcontroller"
|
||||
validate_controller_config || return 1;
|
||||
|
||||
config_get_bool enabled controller enabled 1
|
||||
[ "$enabled" -eq 0 ] && return
|
||||
|
||||
|
||||
22
map-topology/Config.in
Normal file
22
map-topology/Config.in
Normal file
@@ -0,0 +1,22 @@
|
||||
if (PACKAGE_map-topology)
|
||||
|
||||
menu "Configurations"
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT
|
||||
bool "Enable extra features through Easymesh vendor extension"
|
||||
default y
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
default TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
enabled through TOPOLOGYD_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
endmenu
|
||||
endif
|
||||
@@ -1,37 +1,44 @@
|
||||
#
|
||||
# Copyright (C) 2020 iopsys
|
||||
# Copyright (C) 2020-22 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=3.2.0
|
||||
PKG_VERSION:=2.5.0.13
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=d1fae1ff7a8bc8daea08799b9ffbdeb424903e54
|
||||
PKG_SOURCE_VERSION:=413330b08fc4608ea2f5f740cf829f62d5a8bba0
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_BUILD_DEPENDS:=ieee1905
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-topology
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libubox +ubus +libpthread +libuci +libeasy \
|
||||
+libieee1905 +map-plugin +libavahi-nodbus-support
|
||||
+libavahi-nodbus-support +libnetfilter-conntrack +libnfnetlink +libmnl
|
||||
TITLE:=Utility to build topology of a multi-AP network
|
||||
endef
|
||||
|
||||
define Package/map-topology/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-I$(STAGING_DIR)/usr/include/libnetfilter_conntrack \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Package/map-topology/description
|
||||
@@ -40,6 +47,11 @@ endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/map-topology/* $(PKG_BUILD_DIR)/
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
config global 'global'
|
||||
option ageing_timer '1440'
|
||||
option reboot_persistent '0'
|
||||
option ifname 'br-lan'
|
||||
|
||||
@@ -5,7 +5,73 @@ STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
|
||||
validate_topology_config() {
|
||||
uci_validate_section topology topology "topology" \
|
||||
'enabled:bool:true' \
|
||||
'depth:range(0,16)' \
|
||||
'interval:range(0,65535)' \
|
||||
'maxlog:range(0,128)' \
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "topology" "Validation of topology UCI file failed"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_global_section() {
|
||||
uci_validate_section hosts global "global" \
|
||||
'ageing_timer:uinteger' \
|
||||
'reboot_persistent:bool' \
|
||||
'ifname:string'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "hosts" "Validation of global section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_host_section() {
|
||||
local section="$1"
|
||||
|
||||
uci_validate_section hosts $section "${1}" \
|
||||
'macaddr:macaddr' \
|
||||
'interface_type:or("wifi","eth")' \
|
||||
'active:bool' \
|
||||
'active_last_change:string'
|
||||
|
||||
[ "$?" -ne 0 ] && {
|
||||
logger -s -t "hosts" "Validation of host section $section failed"
|
||||
IS_CFG_VALID=0
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
validate_hosts_config() {
|
||||
IS_CFG_VALID=1
|
||||
|
||||
validate_global_section &&
|
||||
config_foreach validate_host_section host
|
||||
|
||||
[ "$IS_CFG_VALID" -ne 1 ] && {
|
||||
logger -s -t "topology" "Validation of hosts UCI file failed"
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load "topology"
|
||||
validate_topology_config || return 1;
|
||||
|
||||
config_load "hosts"
|
||||
validate_hosts_config || return 1;
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/topologyd"
|
||||
procd_set_param respawn
|
||||
|
||||
45
mosquitto-auth-shadow/Makefile
Normal file
45
mosquitto-auth-shadow/Makefile
Normal file
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# Copyright (c) 2022 Genexis B.V.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Eclipse Public License 2.0 which is available at
|
||||
# https://www.eclipse.org/legal/epl-2.0/
|
||||
#
|
||||
# SPDX-License-Identifier: EPL-2.0
|
||||
#
|
||||
# Contributors:
|
||||
# Erik Karlsson - initial implementation
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mosquitto-auth-shadow
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_MAINTAINER:=Erik Karlsson <erik.karlsson@genexis.eu>
|
||||
PKG_LICENSE:=EPL-2.0
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mosquitto-auth-shadow
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=mosquitto - /etc/shadow authentication plugin
|
||||
DEPENDS:=mosquitto
|
||||
USERID:=mosquitto=200:mosquitto=200 mosquitto=200:shadow=11
|
||||
endef
|
||||
|
||||
define Package/mosquitto-auth-shadow/description
|
||||
Plugin for the mosquitto MQTT message broker that authenticates
|
||||
users using /etc/shadow
|
||||
endef
|
||||
|
||||
define Package/mosquitto-auth-shadow/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mosquitto_auth_shadow.so $(1)/usr/lib/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mosquitto-auth-shadow))
|
||||
@@ -0,0 +1 @@
|
||||
chown root:shadow /etc/shadow && chmod 0640 /etc/shadow
|
||||
25
mosquitto-auth-shadow/src/Makefile
Normal file
25
mosquitto-auth-shadow/src/Makefile
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# Copyright (c) 2022 Genexis B.V.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the
|
||||
# terms of the Eclipse Public License 2.0 which is available at
|
||||
# https://www.eclipse.org/legal/epl-2.0/
|
||||
#
|
||||
# SPDX-License-Identifier: EPL-2.0
|
||||
#
|
||||
# Contributors:
|
||||
# Erik Karlsson - initial implementation
|
||||
#
|
||||
|
||||
TARGETS = mosquitto_auth_shadow.so
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
%.pic.o: %.c
|
||||
$(CC) $(CFLAGS) -Wall -Werror -fPIC -c -o $@ $<
|
||||
|
||||
mosquitto_auth_shadow.so: mosquitto_auth_shadow.pic.o
|
||||
$(CC) $(LDFLAGS) -shared -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f *.o $(TARGETS)
|
||||
80
mosquitto-auth-shadow/src/mosquitto_auth_shadow.c
Normal file
80
mosquitto-auth-shadow/src/mosquitto_auth_shadow.c
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (c) 2022 Genexis B.V.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the
|
||||
* terms of the Eclipse Public License 2.0 which is available at
|
||||
* https://www.eclipse.org/legal/epl-2.0/
|
||||
*
|
||||
* SPDX-License-Identifier: EPL-2.0
|
||||
*
|
||||
* Contributors:
|
||||
* Erik Karlsson - initial implementation
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <shadow.h>
|
||||
#include <crypt.h>
|
||||
#include <mosquitto.h>
|
||||
#include <mosquitto_broker.h>
|
||||
#include <mosquitto_plugin.h>
|
||||
|
||||
static int basic_auth_callback(int event, void *event_data, void *userdata)
|
||||
{
|
||||
struct mosquitto_evt_basic_auth *ed = event_data;
|
||||
struct spwd spbuf, *sp = NULL;
|
||||
char buf[256];
|
||||
struct crypt_data data;
|
||||
char *hash;
|
||||
|
||||
/* Let other plugins or broker decide about anonymous login */
|
||||
if (ed->username == NULL)
|
||||
return MOSQ_ERR_PLUGIN_DEFER;
|
||||
|
||||
getspnam_r(ed->username, &spbuf, buf, sizeof(buf), &sp);
|
||||
|
||||
if (sp == NULL || sp->sp_pwdp == NULL)
|
||||
return MOSQ_ERR_AUTH;
|
||||
|
||||
/* Empty string as hash means password is not required */
|
||||
if (sp->sp_pwdp[0] == 0)
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
|
||||
if (ed->password == NULL)
|
||||
return MOSQ_ERR_AUTH;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
hash = crypt_r(ed->password, sp->sp_pwdp, &data);
|
||||
|
||||
if (hash == NULL)
|
||||
return MOSQ_ERR_AUTH;
|
||||
|
||||
if (strcmp(hash, sp->sp_pwdp) == 0)
|
||||
return MOSQ_ERR_SUCCESS;
|
||||
|
||||
return MOSQ_ERR_AUTH;
|
||||
}
|
||||
|
||||
int mosquitto_plugin_version(int supported_version_count,
|
||||
const int *supported_versions)
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
int mosquitto_plugin_init(mosquitto_plugin_id_t *identifier,
|
||||
void **user_data,
|
||||
struct mosquitto_opt *opts, int opt_count)
|
||||
{
|
||||
*user_data = identifier;
|
||||
|
||||
return mosquitto_callback_register(identifier, MOSQ_EVT_BASIC_AUTH,
|
||||
basic_auth_callback, NULL, NULL);
|
||||
}
|
||||
|
||||
int mosquitto_plugin_cleanup(void *user_data,
|
||||
struct mosquitto_opt *opts, int opt_count)
|
||||
{
|
||||
mosquitto_plugin_id_t *identifier = user_data;
|
||||
|
||||
return mosquitto_callback_unregister(identifier, MOSQ_EVT_BASIC_AUTH,
|
||||
basic_auth_callback, NULL);
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mqtt-ciotc
|
||||
PKG_VERSION:=0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=00da3fb1f1691d836037dc4d93e38d0835ba46a4
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/wifilife-testbed.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/mqtt-ciotc
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libjwt +lib-paho-mqtt +libopenssl +libubox +ubus +libblobmsg-json
|
||||
TITLE:=mqtt google iot clinet
|
||||
endef
|
||||
|
||||
define Package/mqtt-ciotc/description
|
||||
mqtt google iot client
|
||||
endef
|
||||
|
||||
define Package/mqtt-ciotc/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mqtt_ciotc $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,mqtt-ciotc))
|
||||
@@ -1,3 +0,0 @@
|
||||
config certs 'certs'
|
||||
option private '/etc/mqtt-ciotc/rsa_private.pem'
|
||||
option root '/etc/mqtt-ciotc/roots.pem'
|
||||
@@ -1,35 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=10
|
||||
PROG=/sbin/mqtt_ciotc
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
config_load mqtt_ciotc
|
||||
config_get private certs private
|
||||
config_get root certs root
|
||||
|
||||
[ -n $private ] && procd_append_param command --private-cert $private
|
||||
[ -n $root ] && procd_append_param command --root-cert $root
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
service_stop ${PROG}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# procd_send_signal wifilife # use SIGHUP
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "mqtt_ciotc"
|
||||
}
|
||||
@@ -8,35 +8,26 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=netmode
|
||||
PKG_VERSION:=0.2.0
|
||||
|
||||
PKG_SOURCE_VERSION:=5c8abbdf86e4651c7c6f14f784cfb52e69979f96
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/netmoded
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_VERSION:=0.3.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/netmode
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+fping +ubus +libubox +libuci
|
||||
TITLE:=Predefined Network Modes
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Network Modes and Utils
|
||||
endef
|
||||
|
||||
define Package/netmode/description
|
||||
Predefined Network Modes
|
||||
Network Modes and Utils
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/netmode/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/netmoded $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,netmode))
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
config netmoded 'netmoded'
|
||||
option enabled '0'
|
||||
|
||||
config setup 'setup'
|
||||
option enabled '0'
|
||||
option dir '/etc/netmodes'
|
||||
config netmode global
|
||||
option enabled 0
|
||||
# option mode 'router'
|
||||
|
||||
#config testnet testnet
|
||||
# option enabled 1
|
||||
# option destination '8.8.8.8'
|
||||
|
||||
#config shiftrange shiftrange
|
||||
# option enabled 1
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not start testnet if the feature is explicitly disabled
|
||||
[ "$(uci -q get netmode.testnet.enabled)" = "0" ] && exit 0
|
||||
|
||||
[ "$ACTION" == "ifup" -o "$ACTION" == "ifdown" ] || exit 0
|
||||
|
||||
interface_check() {
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
[ "$(uci -q get network.$INTERFACE.is_lan)" = "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
[ "$(uci -q get network.$INTERFACE.proto)" = "none" ] && exit 0
|
||||
|
||||
local defroute="$(uci -q get network.$INTERFACE.defaultroute)"
|
||||
[ "$defroute" == "0" ] && exit 0
|
||||
[ "$(uci -q get network.$INTERFACE.defaultroute)" = "0" ] && exit 0
|
||||
}
|
||||
|
||||
interface_check
|
||||
@@ -19,4 +19,3 @@ if [ -n "$(pgrep -f testnet)" ]; then
|
||||
else
|
||||
testnet &
|
||||
fi
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
# this scripts shifts the lan network prefixes
|
||||
# if a wan interface has the same network prefix.
|
||||
|
||||
# do not shift range if the feature is explicitly disabled
|
||||
[ "$(uci -q get netmode.shiftrange.enabled)" == "0" ] && exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
|
||||
|
||||
@@ -3,44 +3,72 @@
|
||||
START=10
|
||||
USE_PROCD=1
|
||||
|
||||
NETMODED="/sbin/netmoded"
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/netmode.sh
|
||||
|
||||
start_netmoded() {
|
||||
config_load netmode
|
||||
MODEDIR="/etc/netmodes"
|
||||
|
||||
config_get enabled netmoded enabled 0
|
||||
if [ "$enabled" != "1" ]; then
|
||||
return
|
||||
libnetmode_exec() {
|
||||
when="$1"
|
||||
# Execute /lib/netmode scripts
|
||||
if [ -d /lib/netmode/$when ]; then
|
||||
logger -s -p user.info -t "netmode" "Executing /lib/netmode/$when scripts"
|
||||
for script in $(ls /lib/netmode/$when/); do
|
||||
sh /lib/netmode/$when/$script
|
||||
done
|
||||
fi
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command $NETMODED
|
||||
|
||||
procd_append_param command --verbose warning -i macaddr
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
populate_netmodes
|
||||
[ -f /etc/config/netmode ] || return
|
||||
|
||||
start_netmoded
|
||||
}
|
||||
config_load netmode
|
||||
|
||||
reload_service() {
|
||||
switch_netmode
|
||||
config_get_bool enabled global enabled '0'
|
||||
[ $enabled -eq 0 ] && return
|
||||
|
||||
start_netmoded
|
||||
# Get the desired netmode from config
|
||||
config_get mode global mode
|
||||
# Check if netmode is set as boot environment parameter
|
||||
[ -n "$mode" ] || mode="$(fw_printenv -n netmode 2>/dev/null)"
|
||||
# Return if mode is not set
|
||||
[ -n "$mode" ] || return
|
||||
|
||||
# Get the last saved mode
|
||||
lastmode="$(cat $MODEDIR/.last_mode 2>/dev/null)"
|
||||
# Return if desired mode is same as last saved mode
|
||||
[ "$mode" == "$lastmode" ] && return
|
||||
|
||||
# Save mode as last mode
|
||||
[ -d $MODEDIR ] || mkdir -p $MODEDIR
|
||||
echo "$mode" > $MODEDIR/.last_mode
|
||||
|
||||
logger -s -p user.info -t "netmode" "Switching to $mode Mode" >/dev/console
|
||||
|
||||
# Execute netmode generic pre-mode-switch scripts
|
||||
libnetmode_exec "pre"
|
||||
|
||||
# Copy netmode UCI config files
|
||||
if [ -d $MODEDIR/$mode/uci ]; then
|
||||
logger -s -p user.info -t "netmode" "Copying $MODEDIR/$mode/uci/* to /etc/config/"
|
||||
cp $MODEDIR/$mode/uci/* /etc/config/ 2>/dev/null
|
||||
fi
|
||||
|
||||
# Execute netmode generic scripts
|
||||
libnetmode_exec
|
||||
|
||||
# Execute mode specific scripts
|
||||
if [ -d $MODEDIR/$mode/scripts ]; then
|
||||
logger -s -p user.info -t "netmode" "Executing $MODEDIR/$mode/scripts/* scripts"
|
||||
for script in $(ls $MODEDIR/$mode/scripts/); do
|
||||
sh $MODEDIR/$mode/scripts/$script
|
||||
done
|
||||
fi
|
||||
|
||||
# Execute netmode generic post-mode-switch scripts
|
||||
libnetmode_exec "post"
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger netmode
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Bridge Mode" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "NAT is disabled." }
|
||||
],
|
||||
"reboot" : 0
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
BRIDGEPORTS=""
|
||||
|
||||
get_vlan() {
|
||||
local device="$1"
|
||||
for section in $(uci show network | grep "=device" | cut -d '=' -f1); do
|
||||
if [ "$(uci -q get $section.ifname)" == "$device" ]; then
|
||||
uci -q get $section.name
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_wifi_devs()
|
||||
{
|
||||
|
||||
add_wdev()
|
||||
{
|
||||
local cfg=$1
|
||||
# local disabled
|
||||
|
||||
# config_get_bool disabled $cfg disabled 0
|
||||
# config_get_bool ifname $cfg ifname
|
||||
|
||||
# if [ $disabled -eq 0 -a -n "$ifname" ]; then
|
||||
# BRIDGEPORTS="$ifname"
|
||||
# fi
|
||||
|
||||
uci -q set wireless.$cfg.network="wan"
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
config_foreach add_wdev "wifi-iface"
|
||||
|
||||
uci -q commit wireless
|
||||
}
|
||||
|
||||
add_xtm_devs() {
|
||||
local section device vlan
|
||||
|
||||
for section in $(uci show dsl | grep "=.*tm-device" | cut -d'=' -f1); do
|
||||
if [ -n "$(uci -q get $section.device)" ]; then
|
||||
|
||||
vlan="$(get_vlan $device)"
|
||||
[ -n "$vlan" ] && device="$vlan"
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
BRIDGEPORTS="$BRIDGEPORTS $device"
|
||||
fi
|
||||
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_eth_ports() {
|
||||
|
||||
add_port()
|
||||
{
|
||||
local cfg=$1
|
||||
local ifname vlan
|
||||
|
||||
config_get ifname $cfg ifname
|
||||
|
||||
vlan="$(get_vlan $ifname)"
|
||||
[ -n "$vlan" ] && ifname="$vlan"
|
||||
|
||||
if [ -n "$ifname" ]; then
|
||||
BRIDGEPORTS="$BRIDGEPORTS $ifname"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load ports
|
||||
config_foreach add_port "ethport"
|
||||
}
|
||||
|
||||
add_xtm_devs
|
||||
add_eth_ports
|
||||
add_wifi_devs
|
||||
|
||||
BRIDGEPORTS="$(echo $BRIDGEPORTS | sed -e 's/[[:space:]]*$//')"
|
||||
|
||||
uci -q set network.wan.type="bridge"
|
||||
uci -q set network.wan.ifname="$BRIDGEPORTS"
|
||||
uci -q set network.wan6.ifname="@wan"
|
||||
uci -q delete network.lan.ifname
|
||||
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"description": [
|
||||
{ "en" : "Router Mode" }
|
||||
],
|
||||
"explanation": [
|
||||
{ "en" : "NAT is enabled." }
|
||||
],
|
||||
"reboot" : 0
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
|
||||
WANPORTS=""
|
||||
LANPORTS=""
|
||||
|
||||
get_vlan() {
|
||||
local device="$1"
|
||||
for section in $(uci show network | grep "=device" | cut -d '=' -f1); do
|
||||
if [ "$(uci -q get $section.ifname)" == "$device" ]; then
|
||||
uci -q get $section.name
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_wifi_devs()
|
||||
{
|
||||
|
||||
add_wdev()
|
||||
{
|
||||
local cfg=$1
|
||||
|
||||
config_get mode $cfg mode "ap"
|
||||
|
||||
if [ "$mode" == "ap" ]; then
|
||||
uci -q set wireless.$cfg.network="lan"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
config_foreach add_wdev "wifi-iface"
|
||||
|
||||
uci -q commit wireless
|
||||
}
|
||||
|
||||
add_xtm_devs() {
|
||||
local section device vlan
|
||||
|
||||
for section in $(uci show dsl | grep "=.*tm-device" | cut -d'=' -f1); do
|
||||
device="$(uci -q get $section.device)"
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
vlan="$(get_vlan $device)"
|
||||
[ -n "$vlan" ] && device="$vlan"
|
||||
|
||||
if [ -n "$device" ]; then
|
||||
WANPORTS="$WANPORTS $device"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
add_eth_ports() {
|
||||
|
||||
add_port()
|
||||
{
|
||||
local cfg=$1
|
||||
local uplink ifname vlan
|
||||
|
||||
config_get ifname $cfg ifname
|
||||
config_get_bool uplink $cfg uplink 0
|
||||
|
||||
vlan="$(get_vlan $ifname)"
|
||||
[ -n "$vlan" ] && ifname="$vlan"
|
||||
|
||||
if [ $uplink -eq 1 ]; then
|
||||
WANPORTS="$WANPORTS $ifname"
|
||||
else
|
||||
LANPORTS="$LANPORTS $ifname"
|
||||
fi
|
||||
}
|
||||
|
||||
config_load ports
|
||||
config_foreach add_port "ethport"
|
||||
}
|
||||
|
||||
add_xtm_devs
|
||||
add_eth_ports
|
||||
add_wifi_devs
|
||||
|
||||
WANPORTS="$(echo $WANPORTS | sed -e 's/[[:space:]]*$//')"
|
||||
LANPORTS="$(echo $LANPORTS | sed -e 's/[[:space:]]*$//')"
|
||||
|
||||
uci -q set network.wan.type="anywan"
|
||||
uci -q set network.wan.ifname="$WANPORTS"
|
||||
uci -q set network.wan6.ifname="@wan"
|
||||
uci -q set network.lan.type="bridge"
|
||||
uci -q set network.lan.ifname="$LANPORTS"
|
||||
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
add_owsd_ubusproxy_object_netmode() {
|
||||
local netmd=$(uci -q get owsd.ubusproxy.object | grep netmode)
|
||||
if [ -z "$netmd" ]; then
|
||||
uci -q add_list owsd.ubusproxy.object="netmode"
|
||||
uci commit owsd
|
||||
fi
|
||||
}
|
||||
|
||||
add_owsd_ubusproxy_object_netmode
|
||||
@@ -1,150 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
MODEDIR=$(uci -q get netmode.setup.dir)
|
||||
|
||||
[ -n "$MODEDIR" ] || MODEDIR="/etc/netmodes"
|
||||
|
||||
run_netmode_scripts() {
|
||||
local mode=$1
|
||||
local when=$2
|
||||
local script
|
||||
local path
|
||||
|
||||
path=$(readlink -f /etc/netmodes/$mode/)
|
||||
[ "${path:0:14}" == "/etc/netmodes/" ] || exit
|
||||
|
||||
if [ -d /etc/netmodes/$mode/scripts/$when ]; then
|
||||
logger -s -p user.info -t "netmode" "Executing $when netmode scripts" >/dev/console
|
||||
for script in $(ls /etc/netmodes/$mode/scripts/$when/); do
|
||||
sh /etc/netmodes/$mode/scripts/$when/$script
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
switch_netmode() {
|
||||
[ -f /etc/config/netmode -a -d $MODEDIR ] || return
|
||||
|
||||
config_load netmode
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled setup enabled '0'
|
||||
[ $enabled -eq 0 ] && return
|
||||
|
||||
local mode
|
||||
config_get mode setup mode
|
||||
|
||||
[ -d "/etc/netmodes/$mode" ] || return
|
||||
|
||||
logger -s -p user.info -t "netmode" "Switching to $mode Mode" >/dev/console
|
||||
|
||||
run_netmode_scripts $mode "pre"
|
||||
|
||||
local reboot=$(uci -q get netmode.$mode.reboot)
|
||||
|
||||
if [ "$reboot" == "1" ]; then
|
||||
#run_netmode_scripts $mode "post"
|
||||
reboot &
|
||||
exit
|
||||
fi
|
||||
|
||||
#run_netmode_scripts $mode "post"
|
||||
}
|
||||
|
||||
populate_netmodes() {
|
||||
[ -f /etc/config/netmode -a -d $MODEDIR ] || return
|
||||
|
||||
config_load netmode
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled setup enabled '0'
|
||||
[ $enabled -eq 0 ] && return
|
||||
|
||||
delete_netmode() {
|
||||
uci delete netmode.$1
|
||||
}
|
||||
|
||||
config_foreach delete_netmode netmode
|
||||
uci commit netmode
|
||||
|
||||
local hardware=$(db -q get hw.board.model_name)
|
||||
local keys lang desc exp exclude support
|
||||
for mode in $(ls $MODEDIR); do
|
||||
lang=""
|
||||
desc=""
|
||||
exp=""
|
||||
uci -q set netmode.$mode=netmode
|
||||
json_load "$(cat $MODEDIR/$mode/DETAILS)"
|
||||
|
||||
if json_select excluded_boards; then
|
||||
exclude=0
|
||||
_i=1
|
||||
while json_get_var board $_i; do
|
||||
case "$hardware" in
|
||||
$board)
|
||||
uci -q delete netmode.$mode
|
||||
exclude=1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
_i=$((_i+1))
|
||||
done
|
||||
json_select ..
|
||||
[ $exclude -eq 1 ] && continue
|
||||
elif json_select supported_boards; then
|
||||
support=0
|
||||
_i=1
|
||||
while json_get_var board $_i; do
|
||||
case "$hardware" in
|
||||
$board)
|
||||
support=1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
_i=$((_i+1))
|
||||
done
|
||||
json_select ..
|
||||
[ $support -eq 1 ] || {
|
||||
uci -q delete netmode.$mode
|
||||
continue
|
||||
}
|
||||
fi
|
||||
|
||||
json_select description
|
||||
json_get_keys keys
|
||||
for k in $keys; do
|
||||
json_get_keys lang $k
|
||||
lang=$(echo $lang | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||
json_select $k
|
||||
json_get_var desc $lang
|
||||
uci -q set netmode.$mode."desc_$lang"="$desc"
|
||||
[ "$lang" == "en" ] && uci -q set netmode.$mode."desc"="$desc"
|
||||
json_select ..
|
||||
done
|
||||
json_select ..
|
||||
|
||||
json_select explanation
|
||||
json_get_keys keys
|
||||
for k in $keys; do
|
||||
json_get_keys lang $k
|
||||
lang=$(echo $lang | sed 's/^[ \t]*//;s/[ \t]*$//')
|
||||
json_select $k
|
||||
json_get_var exp $lang
|
||||
uci -q set netmode.$mode."exp_$lang"="$exp"
|
||||
[ "$lang" == "en" ] && uci -q set netmode.$mode."exp"="$exp"
|
||||
json_select ..
|
||||
done
|
||||
json_select ..
|
||||
|
||||
json_get_var cred credentials
|
||||
uci -q set netmode.$mode.askcred="$cred"
|
||||
json_get_var ulb uplink_band
|
||||
uci -q set netmode.$mode.uplink_band="$ulb"
|
||||
json_get_var reboot reboot
|
||||
uci -q set netmode.$mode.reboot="$reboot"
|
||||
done
|
||||
|
||||
uci commit netmode
|
||||
}
|
||||
@@ -31,7 +31,10 @@ test_connection() {
|
||||
internet_test() {
|
||||
local link dest
|
||||
|
||||
dest="$(uci -q get diagnostics.@connectivity[0].destination)"
|
||||
# use the destination address given in config for connectivity check
|
||||
dest="$(uci -q get netmode.testnet.destination)"
|
||||
# for backwards compatibility
|
||||
[ -n "$dest" ] || dest="$(uci -q get diagnostics.@connectivity[0].destination)"
|
||||
|
||||
test_connection $dest
|
||||
|
||||
|
||||
@@ -2,16 +2,28 @@ if PACKAGE_obuspa
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config OBUSPA_MTP_ENABLE_STOMP
|
||||
bool "Enable STOMP as mtp protocol"
|
||||
default y
|
||||
config OBUSPA_DB_PATH
|
||||
string "Configure path for usp.db file"
|
||||
default "/tmp/"
|
||||
|
||||
config OBUSPA_MTP_ENABLE_MQTT
|
||||
bool "Enable MQTT as mtp protocol"
|
||||
default y
|
||||
|
||||
config OBUSPA_MTP_ENABLE_WEBSOCKETS
|
||||
bool "Enable WebSockets as mtp protocol"
|
||||
default y
|
||||
|
||||
config OBUSPA_MTP_ENABLE_STOMP
|
||||
bool "Enable STOMP as mtp protocol"
|
||||
default y
|
||||
|
||||
config OBUSPA_MTP_ENABLE_COAP
|
||||
bool "Enable CoAP as mtp protocol"
|
||||
default y
|
||||
default n
|
||||
|
||||
config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
bool "Enable verification of MQTT response topic before processing the message"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=4.1.0.18
|
||||
PKG_VERSION:=5.0.0.16.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=af3d4663d66942e3b0e3253375c5620629769aa5
|
||||
PKG_SOURCE_VERSION:=b0626e54ba4a0e8d1d261948a7114c6dc35e2dbc
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/fork/obuspa.git
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
@@ -31,7 +31,7 @@ define Package/obuspa
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
DEPENDS:=+libopenssl +libcurl +libsqlite3 +libubox +libubus +uspd +libmosquitto
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
endef
|
||||
|
||||
define Package/obuspa/description
|
||||
@@ -43,8 +43,18 @@ define Package/obuspa/config
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE
|
||||
-D_GNU_SOURCE \
|
||||
-Wall \
|
||||
-Werror
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_CONTROLLER_MTP_VERIFY),)
|
||||
TARGET_CFLAGS += -DOBUSPA_CONTROLLER_MTP_VERIFY
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_DB_PATH),)
|
||||
CONFIGURE_ARGS += \
|
||||
--localstatedir="$(CONFIG_OBUSPA_DB_PATH)"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_STOMP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -70,9 +80,18 @@ else
|
||||
--disable-coap
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_WEBSOCKETS),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-websockets
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-websockets
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/obuspa/* $(PKG_BUILD_DIR)/
|
||||
$(Build/Patch)
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -81,11 +100,14 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/USPAgent.json $(1)/etc/bbfdm/json/USPAgent.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/TransferComplete.json $(1)/etc/bbfdm/json/TransferComplete.json
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
1063
obuspa/files/etc/bbfdm/json/USPAgent.json
Normal file
1063
obuspa/files/etc/bbfdm/json/USPAgent.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=2
|
||||
STOP=02
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/obuspa
|
||||
|
||||
@@ -16,7 +16,6 @@ mqtt_num=0
|
||||
subs_num=0
|
||||
challenge_num=0
|
||||
index=0
|
||||
role_def_file=""
|
||||
PROFILE="/root/.profile"
|
||||
|
||||
. /lib/functions/network.sh
|
||||
@@ -31,11 +30,11 @@ cleanup() {
|
||||
trap cleanup EXIT
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t obuspa.init -p debug
|
||||
echo "$*"|logger -t obuspa.init -p debug
|
||||
}
|
||||
|
||||
db_set() {
|
||||
if [ -n "${1}" ]; then
|
||||
if [ -n "${1}" ] && [ -n "${2}" ]; then
|
||||
echo "${1} \"${2}\"">>${PARAM_FILE}
|
||||
else
|
||||
echo >>${PARAM_FILE}
|
||||
@@ -49,9 +48,8 @@ update_keep() {
|
||||
return;
|
||||
fi
|
||||
|
||||
grep -q "${keep_file}" ${KEEP_FILES}
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo ${keep_file} >> ${KEEP_FILES}
|
||||
if grep -q "${keep_file}" ${KEEP_FILES}; then
|
||||
echo "${keep_file}" >> ${KEEP_FILES}
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -63,12 +61,15 @@ get_index() {
|
||||
}
|
||||
|
||||
get_role_index_from_json() {
|
||||
local role="${@}"
|
||||
local role="$1"
|
||||
local role_def_file="$2"
|
||||
local num=0
|
||||
local roles_obj
|
||||
|
||||
# In case of role is empty or file not present
|
||||
if [ -z "${role}" -o ! -f "${role_def_file}" ]; then
|
||||
return 0
|
||||
if [ -z "${role}" ] || [ ! -f "${role_def_file}" ]; then
|
||||
echo "${num}"
|
||||
return ${num}
|
||||
fi
|
||||
|
||||
json_init
|
||||
@@ -79,20 +80,21 @@ get_role_index_from_json() {
|
||||
|
||||
for k in ${roles_obj}; do
|
||||
local rname
|
||||
json_select $k
|
||||
json_select "$k"
|
||||
json_get_var rname name
|
||||
json_select ..
|
||||
|
||||
if [ "${rname}" != "Untrusted" -a "${rname}" != "full_access" ]; then
|
||||
if [ "${rname}" != "Untrusted" ] && [ "${rname}" != "full_access" ]; then
|
||||
num=$(( num + 1 ))
|
||||
fi
|
||||
|
||||
if [ "${role}" = "${rname}" ]; then
|
||||
echo "${num}"
|
||||
return ${num}
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
return ${num}
|
||||
}
|
||||
|
||||
get_uci_ref_index() {
|
||||
@@ -102,10 +104,10 @@ get_uci_ref_index() {
|
||||
|
||||
index=0
|
||||
config_load $CONFIGURATION
|
||||
config_foreach get_index $1 $2
|
||||
config_foreach get_index "$1" "$2"
|
||||
val=$(cat ${USP_TEMP_FILE})
|
||||
|
||||
if [ -z $val ]; then
|
||||
if [ -z "${val}" ]; then
|
||||
val=0
|
||||
fi
|
||||
|
||||
@@ -121,7 +123,7 @@ validate_obuspa_section()
|
||||
'trust_cert:file' \
|
||||
'client_cert:file' \
|
||||
'interface:string' \
|
||||
'ifname:string:br-lan' \
|
||||
'ifname:string' \
|
||||
'debug:bool:false' \
|
||||
'prototrace:bool:false' \
|
||||
'log_level:uinteger' \
|
||||
@@ -149,7 +151,7 @@ validate_controller_section()
|
||||
'USPNotifRetryMinimumWaitInterval:uinteger:5' \
|
||||
'USPNotifRetryIntervalMultiplier:uinteger:2000' \
|
||||
'ControllerCode:string' \
|
||||
'Protocol:or("STOMP","CoAP","MQTT")' \
|
||||
'Protocol:or("STOMP","CoAP","MQTT", "WebSocket")' \
|
||||
'Reference:string' \
|
||||
'Destination:string:controller-notify-dest' \
|
||||
'Topic:string' \
|
||||
@@ -158,7 +160,14 @@ validate_controller_section()
|
||||
'coap_path:string' \
|
||||
'coap_port:port' \
|
||||
'mqtt:string' \
|
||||
'stomp:string'
|
||||
'stomp:string' \
|
||||
'Host:host' \
|
||||
'Port:port' \
|
||||
'Path:string' \
|
||||
'EnableEncryption:bool' \
|
||||
'KeepAliveInterval:uinteger' \
|
||||
'SessionRetryIntervalMultiplier:uinteger' \
|
||||
'SessionRetryMinimumWaitInterval:uinteger'
|
||||
}
|
||||
|
||||
validate_subscription_section()
|
||||
@@ -177,7 +186,7 @@ validate_mtp_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} mtp "${1}" \
|
||||
'Enable:bool:true' \
|
||||
'Protocol:or("STOMP","CoAP","MQTT")' \
|
||||
'Protocol:or("STOMP","CoAP","MQTT", "WebSocket")' \
|
||||
'Reference:string' \
|
||||
'ResponseTopicConfigured:string' \
|
||||
'PublishQoS:uinteger' \
|
||||
@@ -185,7 +194,12 @@ validate_mtp_section()
|
||||
'coap_path:string' \
|
||||
'coap_port:port' \
|
||||
'mqtt:string' \
|
||||
'stomp:string'
|
||||
'stomp:string' \
|
||||
'Path:string' \
|
||||
'Port:port' \
|
||||
'EnableEncryption:bool' \
|
||||
'KeepAliveInterval:uinteger'
|
||||
|
||||
}
|
||||
|
||||
validate_stomp_connection_section()
|
||||
@@ -223,25 +237,37 @@ validate_mqtt_client_section()
|
||||
'ConnectRetryMaxInterval:uinteger:60'
|
||||
}
|
||||
|
||||
get_oui_from_db() {
|
||||
local oui="$(db get device.deviceinfo.ManufacturerOUI)"
|
||||
validate_challenge_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} challenge "${1}" \
|
||||
'Enable:bool:true' \
|
||||
'Alias:string' \
|
||||
'Description:string' \
|
||||
'role_name:string' \
|
||||
'Role:string' \
|
||||
'Value:string' \
|
||||
'Retries:uinteger:3' \
|
||||
'LockoutPeriod:uinteger:0'
|
||||
}
|
||||
|
||||
echo "${oui}"
|
||||
get_oui_from_db() {
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
|
||||
get_serial_from_db() {
|
||||
local serial="$(db get device.deviceinfo.SerialNumber)"
|
||||
|
||||
# this can encoded further
|
||||
echo "${serial}"
|
||||
db -q get device.deviceinfo.SerialNumber
|
||||
}
|
||||
|
||||
publish_endpoint() {
|
||||
local AgentEndpointID serial oui user pass
|
||||
local opt=""
|
||||
|
||||
if ! uci -q get obuspa.localmqtt; then
|
||||
log "Remote mqtt broker configured, skip publishing endpoint"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# return if mosquitto_pub is not present
|
||||
if [ ! "$(which mosquitto_pub)" ]; then
|
||||
if [ ! "$(command -v mosquitto_pub)" ]; then
|
||||
log "mosquitto_pub not present can't publish EndpointID"
|
||||
return 0;
|
||||
fi
|
||||
@@ -256,22 +282,24 @@ publish_endpoint() {
|
||||
fi
|
||||
|
||||
config_get user localmqtt Username
|
||||
if [ -n "${user}" ]; then
|
||||
opt="-u ${user}"
|
||||
fi
|
||||
config_get pass localmqtt Password
|
||||
if [ -n "${pass}" ]; then
|
||||
opt="${opt} -P ${pass}"
|
||||
fi
|
||||
|
||||
# publish Agent's EndpointID in mosquito broker for discovery by usp-js
|
||||
# This is a work around till obuspa adds supports for mDNS discovery
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" ${opt}
|
||||
if [ -n "${user}" ] && [ -n "${pass}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username, password"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}" -P "${pass}"
|
||||
elif [ -n "${user}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username only"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}"
|
||||
else
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}"
|
||||
fi
|
||||
}
|
||||
|
||||
configure_localagent() {
|
||||
local Enable ParameterName EndpointID
|
||||
local Enable EndpointID
|
||||
|
||||
validate_localagent_section 'localagent' || {
|
||||
log "Validation of localagent section failed"
|
||||
@@ -288,33 +316,48 @@ configure_localagent() {
|
||||
configure_controller() {
|
||||
local EndpointID Enable AssignedRole PeriodicNotifInterval PeriodicNotifTime USPNotifRetryMinimumWaitInterval
|
||||
local USPNotifRetryIntervalMultiplier ControllerCode Protocol Destination coap_host coap_path coap_port
|
||||
local Reference Topic mqtt stomp assigned_role_name
|
||||
local Reference Topic mqtt stomp assigned_role_name ParameterName
|
||||
local Host Port Path EnableEncryption KeepAliveInterval
|
||||
local SessionRetryIntervalMultiplier SessionRetryMinimumWaitInterval
|
||||
|
||||
validate_controller_section "${1}" || {
|
||||
log "Validation of controller section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z "${EndpointID}" -o -z "${Protocol}" ]; then
|
||||
if [ -z "${EndpointID}" ] || [ -z "${Protocol}" ]; then
|
||||
log "controller:: EndpointID id and Protocol cannot be empty"
|
||||
return 1;
|
||||
fi
|
||||
|
||||
if [ -z "${stomp}" -a -z "${Reference}" -a -z "${mqtt}" -a -z "${coap_path}" ]; then
|
||||
# Support for backward compatibility for coap uci parameters
|
||||
if [ -n "${coap_host}" ] && [ -z "${Host}" ]; then
|
||||
Host="${coap_host}"
|
||||
fi
|
||||
|
||||
if [ -n "${coap_path}" ] && [ -z "${Path}" ]; then
|
||||
Path="${coap_path}"
|
||||
fi
|
||||
|
||||
if [ -n "${coap_port}" ] && [ -z "${Port}" ]; then
|
||||
Port="${coap_port}"
|
||||
fi
|
||||
|
||||
if [ -z "${stomp}" ] && [ -z "${Reference}" ] && [ -z "${mqtt}" ] && [ -z "${Host}" ]; then
|
||||
log "controller:: Invalid configuration"
|
||||
return 1;
|
||||
fi
|
||||
|
||||
if [ -z "${Reference}" ]; then
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
val=$(get_uci_ref_index stomp ${stomp})
|
||||
val=$(get_uci_ref_index stomp "${stomp}")
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Not able to find the referred stomp section"
|
||||
return 1;
|
||||
fi
|
||||
Reference="Device.STOMP.Connection.${val}"
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
val=$(get_uci_ref_index mqtt ${mqtt})
|
||||
val=$(get_uci_ref_index mqtt "${mqtt}")
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Not able to find the referred mqtt section"
|
||||
return 1;
|
||||
@@ -332,7 +375,7 @@ configure_controller() {
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.AssignedRole "${AssignedRole}"
|
||||
else
|
||||
if [ -n "${assigned_role_name}" ]; then
|
||||
AssignedRole=$(get_role_index ${assigned_role_name})
|
||||
AssignedRole=$(get_role_index "${assigned_role_name}")
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.AssignedRole "${AssignedRole}"
|
||||
fi
|
||||
fi
|
||||
@@ -358,9 +401,18 @@ configure_controller() {
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.STOMP.Reference "${Reference}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.STOMP.Destination "${Destination}"
|
||||
elif [ "${Protocol}" = "CoAP" ]; then
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Host "${coap_host}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Path "${coap_path}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Port "${coap_port}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Host "${Host}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Path "${Path}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.Port "${Port}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.CoAP.EnableEncryption "${EnableEncryption}"
|
||||
elif [ "${Protocol}" = "WebSocket" ]; then
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.WebSocket.Host "${Host}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.WebSocket.Port "${Port}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.WebSocket.Path "${Path}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.WebSocket.EnableEncryption "${EnableEncryption}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.WebSocket.KeepAliveInterval "${KeepAliveInterval}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.WebSocket.SessionRetryIntervalMultiplier "${SessionRetryIntervalMultiplier}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.MTP.1.WebSocket.SessionRetryMinimumWaitInterval "${SessionRetryMinimumWaitInterval}"
|
||||
else
|
||||
log "Unsupported Protocol ${Protocol}"
|
||||
fi
|
||||
@@ -373,7 +425,7 @@ configure_controller() {
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.BootParameter.${_pnum}.Alias "cpe-${_pnum}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.BootParameter.${_pnum}.Enable "${Enable}"
|
||||
db_set Device.LocalAgent.Controller.${controller_num}.BootParameter.${_pnum}.ParameterName "${param}"
|
||||
_pnum=$(( ${_pnum} + 1 ))
|
||||
_pnum=$(( _pnum + 1 ))
|
||||
done
|
||||
|
||||
db_set
|
||||
@@ -388,12 +440,13 @@ configure_subscription(){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z "${Recipient}" -a -z "${controller}" ]; then
|
||||
if [ -z "${Recipient}" ] && [ -z "${controller}" ]; then
|
||||
log "No recipient for subscription"
|
||||
return 1;
|
||||
fi
|
||||
|
||||
if [ -z "${Recipient}" ]; then
|
||||
val=$(get_uci_ref_index controller ${controller})
|
||||
val=$(get_uci_ref_index controller "${controller}")
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Not able to find the referred controller section"
|
||||
return 1;
|
||||
@@ -410,28 +463,17 @@ configure_subscription(){
|
||||
db_set Device.LocalAgent.Subscription.${subs_num}.ReferenceList "${ReferenceList}"
|
||||
db_set Device.LocalAgent.Subscription.${subs_num}.Persistent "${Persistent}"
|
||||
db_set Device.LocalAgent.Subscription.${subs_num}.Recipient "${Recipient}"
|
||||
}
|
||||
|
||||
validate_challenge_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} challenge "${1}" \
|
||||
'Enable:bool:true' \
|
||||
'Alias:string' \
|
||||
'Description:string' \
|
||||
'role_name:string' \
|
||||
'Role:string' \
|
||||
'Value:string' \
|
||||
'Retries:uinteger:3' \
|
||||
'LockoutPeriod:uinteger:0'
|
||||
db_set Device.LocalAgent.Subscription.${subs_num}.CreationDate "$(date -I'seconds')"
|
||||
}
|
||||
|
||||
check_json_load()
|
||||
{
|
||||
local ret=0
|
||||
local ret
|
||||
|
||||
ret=0
|
||||
if [ -f "${role_def_file}" ]; then
|
||||
json_init
|
||||
json_load_file "${role_def_file}" 2>&1 |grep -q Failed
|
||||
if [ $? -eq 0 ]; then # In case of invalid json file
|
||||
if json_load_file "${role_def_file}" 2>&1 |grep -q Failed; then
|
||||
log "failed to load [${role_def_file}]"
|
||||
ret=1
|
||||
fi
|
||||
@@ -443,8 +485,10 @@ check_json_load()
|
||||
get_role_index() {
|
||||
local role="Device.LocalAgent.ControllerTrust.Role"
|
||||
local idx=0
|
||||
local role_name="${@}"
|
||||
local role_name="$1"
|
||||
local role_def_file
|
||||
|
||||
role_def_file=$(uci -q get obuspa.global.role_file 2>/dev/null)
|
||||
case "${role_name}" in
|
||||
'full_access')
|
||||
idx=1;
|
||||
@@ -456,9 +500,8 @@ get_role_index() {
|
||||
local ji=0
|
||||
|
||||
check_json_load
|
||||
if [ $? -eq 0 ]; then
|
||||
get_role_index_from_json ${role_name}
|
||||
ji=$?
|
||||
if [ "$?" -eq "0" ]; then
|
||||
ji=$(get_role_index_from_json "${role_name}" "${role_def_file}")
|
||||
fi
|
||||
idx=$(( ji + 2 )) # Add predefined roles
|
||||
esac
|
||||
@@ -474,7 +517,7 @@ configure_challenges() {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ -z "${role_name}" -a -z "${Role}" ]; then
|
||||
if [ -z "${role_name}" ] && [ -z "${Role}" ]; then
|
||||
log "Either role_name or Role must defined for a challenge";
|
||||
return 1;
|
||||
fi
|
||||
@@ -487,10 +530,10 @@ configure_challenges() {
|
||||
fi
|
||||
|
||||
if [ -z "${Role}" ]; then
|
||||
Role=$(get_role_index ${role_name})
|
||||
Role=$(get_role_index "${role_name}")
|
||||
fi
|
||||
|
||||
if [ -z "${Alias}" -a -n "${role_name}" ]; then
|
||||
if [ -z "${Alias}" ] && [ -n "${role_name}" ]; then
|
||||
Alias=${role_name}
|
||||
fi
|
||||
|
||||
@@ -504,22 +547,31 @@ configure_challenges() {
|
||||
configure_mtp() {
|
||||
local Enable Protocol Reference ResponseTopicConfigured PublishQoS
|
||||
local stomp mqtt
|
||||
local Path Port EnableEncryption KeepAliveInterval
|
||||
|
||||
validate_mtp_section "${1}" || {
|
||||
log "Validation of mtp section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -n "${coap_path}" ] && [ -z "${Path}" ]; then
|
||||
Path="${coap_path}"
|
||||
fi
|
||||
|
||||
if [ -n "${coap_port}" ] && [ -z "${Port}" ]; then
|
||||
Port="${coap_port}"
|
||||
fi
|
||||
|
||||
if [ -z "${Reference}" ]; then
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
val=$(get_uci_ref_index stomp ${stomp})
|
||||
val=$(get_uci_ref_index stomp "${stomp}")
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Referred stomp section not found"
|
||||
return 1;
|
||||
fi
|
||||
Reference="Device.STOMP.Connection.${val}"
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
val=$(get_uci_ref_index mqtt ${mqtt})
|
||||
val=$(get_uci_ref_index mqtt "${mqtt}")
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Referred mqtt section not found"
|
||||
return 1;
|
||||
@@ -542,8 +594,13 @@ configure_mtp() {
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Reference "${Reference}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.STOMP.Destination "${Destination}"
|
||||
elif [ "${Protocol}" = "CoAP" ]; then
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Path "${coap_path}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Port "${coap_port}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Path "${Path}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.CoAP.Port "${Port}"
|
||||
elif [ "${Protocol}" = "WebSocket" ]; then
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.WebSocket.Path "${Path}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.WebSocket.Port "${Port}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.WebSocket.EnableEncryption "${EnableEncryption}"
|
||||
db_set Device.LocalAgent.MTP.${mtp_num}.WebSocket.KeepAliveInterval "${KeepAliveInterval}"
|
||||
else
|
||||
log "Unsupported Protocol ${Protocol} in mtp"
|
||||
fi
|
||||
@@ -583,7 +640,7 @@ configure_stomp_connection() {
|
||||
|
||||
configure_mqtt_client(){
|
||||
local BrokerAddress BrokerPort Enable Username Password ProtocolVersion KeepAliveTime
|
||||
local TransportProtocol ConnectRetryTime ConnectRetryMaxInterval ConnectRetryIntervalMultiplier
|
||||
local TransportProtocol ConnectRetryTime ConnectRetryMaxInterval ConnectRetryIntervalMultiplier ClientID
|
||||
|
||||
validate_mqtt_client_section "${1}" || {
|
||||
log "Validation of mqtt section failed"
|
||||
@@ -617,13 +674,9 @@ configure_mqtt_client(){
|
||||
|
||||
configure_obuspa() {
|
||||
local enabled trust_cert ifname interface debug prototrace log_level db_file log_dest role_file
|
||||
local client_cert
|
||||
|
||||
validate_obuspa_section "global" || {
|
||||
log "Validation of global section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
role_def_file="${role_file}"
|
||||
validate_obuspa_section "global"
|
||||
|
||||
if [ "${debug}" -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
@@ -632,72 +685,94 @@ configure_obuspa() {
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ "${debug}" -eq 1 -a "${prototrace}" -eq 1 ]; then
|
||||
if [ "${debug}" -eq 1 ] && [ "${prototrace}" -eq 1 ]; then
|
||||
procd_append_param command -p
|
||||
fi
|
||||
|
||||
if [ "${debug}" -eq 1 -a -n "${log_level}" ]; then
|
||||
procd_append_param command -v ${log_level}
|
||||
if [ "${debug}" -eq 1 ] && [ -n "${log_level}" ]; then
|
||||
procd_append_param command -v "${log_level}"
|
||||
fi
|
||||
|
||||
if [ -n "${log_dest}" ]; then
|
||||
procd_append_param command -l ${log_dest}
|
||||
procd_append_param command -l "${log_dest}"
|
||||
fi
|
||||
|
||||
if [ -n "${interface}" ]; then
|
||||
network_get_physdev ifname ${interface}
|
||||
network_get_physdev ifname "${interface}"
|
||||
fi
|
||||
|
||||
# Set this variable for root user and obuspa -c tool
|
||||
if [ -f "${PROFILE}" ]; then
|
||||
grep -q "export USP_BOARD_IFNAME=${ifname}" ${PROFILE}
|
||||
if [ "$?" -ne 0 ]; then
|
||||
grep -q "export USP_BOARD_IFNAME" ${PROFILE}
|
||||
if [ "$?" -eq 0 ]; then
|
||||
sed -i "g/export USP_BOARD_IFNAME/d" ${PROFILE}
|
||||
fi
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" >> ${PROFILE}
|
||||
if [ -n "${ifname}" ]; then
|
||||
procd_set_param env USP_BOARD_IFNAME="${ifname}"
|
||||
fi
|
||||
|
||||
if [ -z "${ifname}" ] || ! grep -F -q "export USP_BOARD_IFNAME=${ifname}" "${PROFILE}"; then
|
||||
if [ -f "${PROFILE}" ]; then
|
||||
sed -i "/export USP_BOARD_IFNAME/d" "${PROFILE}"
|
||||
fi
|
||||
|
||||
if [ -n "${ifname}" ]; then
|
||||
# Set this variable for root user and obuspa -c tool
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" >> "${PROFILE}"
|
||||
fi
|
||||
else
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" > ${PROFILE}
|
||||
fi
|
||||
|
||||
if [ -n "${db_file}" ]; then
|
||||
update_keep "${db_file}"
|
||||
procd_append_param command -f ${db_file}
|
||||
procd_append_param command -f "${db_file}"
|
||||
fi
|
||||
|
||||
if [ -n "${trust_cert}" ]; then
|
||||
update_keep "${trust_cert}"
|
||||
if [ -f "${trust_cert}" ]; then
|
||||
procd_append_param command -t ${trust_cert}
|
||||
procd_append_param command -t "${trust_cert}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${client_cert}" ]; then
|
||||
update_keep "${client_cert}"
|
||||
if [ -f "${client_cert}" ]; then
|
||||
procd_append_param command -a ${client_cert}
|
||||
procd_append_param command -a "${client_cert}"
|
||||
fi
|
||||
fi
|
||||
|
||||
procd_set_param env USP_BOARD_IFNAME=${ifname}
|
||||
}
|
||||
|
||||
# Create factory reset file
|
||||
db_init() {
|
||||
# Load configuration
|
||||
config_load $CONFIGURATION
|
||||
config_foreach configure_obuspa obuspa
|
||||
|
||||
config_foreach configure_controller controller
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
config_foreach configure_localagent localagent
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
config_foreach configure_mtp mtp
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
config_foreach configure_stomp_connection stomp
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
config_foreach configure_mqtt_client mqtt
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
config_foreach configure_subscription subscription
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
config_foreach configure_challenges challenge
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
|
||||
db_set Internal.Reboot.Cause "LocalFactoryReset"
|
||||
return 0;
|
||||
}
|
||||
|
||||
register_service()
|
||||
{
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
procd_set_param command ${PROG}
|
||||
procd_append_param command -r ${PARAM_FILE}
|
||||
|
||||
configure_obuspa
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
|
||||
procd_set_param watch usp.raw
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_running() {
|
||||
@@ -707,24 +782,19 @@ service_running() {
|
||||
start_service() {
|
||||
local enabled
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
config_load obuspa
|
||||
config_get enabled global enabled
|
||||
config_get_bool enabled global enabled 0
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
log "OBUSPA not enabled"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
procd_set_param command ${PROG}
|
||||
db_init
|
||||
procd_append_param command -r ${PARAM_FILE}
|
||||
procd_set_param respawn \
|
||||
${respawn_threshold:-5} \
|
||||
${respawn_timeout:-10} ${respawn_retry:-3}
|
||||
[ "$?" -ne 0 ] && return 1;
|
||||
|
||||
procd_set_param watch usp.raw
|
||||
procd_close_instance
|
||||
register_service
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
@@ -733,10 +803,10 @@ stop_service() {
|
||||
config_load obuspa
|
||||
config_get db_file global db_file
|
||||
|
||||
${PROG} -c stop 2>&1 >/dev/null
|
||||
${PROG} -c stop >/dev/null 2>&1
|
||||
|
||||
if [ -z "${db_file}" ]; then
|
||||
db_file="/tmp/usp.db"
|
||||
db_file="/tmp/obuspa/usp.db"
|
||||
fi
|
||||
|
||||
[ -f "${db_file}" ] && rm -f ${db_file}
|
||||
@@ -771,4 +841,14 @@ service_triggers() {
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
|
||||
procd_open_validate
|
||||
validate_obuspa_section
|
||||
validate_localagent_section
|
||||
validate_controller_section
|
||||
validate_subscription_section
|
||||
validate_mtp_section
|
||||
validate_stomp_connection_section
|
||||
validate_mqtt_client_section
|
||||
procd_close_validate
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"dmcaching_exclude": [
|
||||
"Device.DeviceInfo.ProcessStatus.Process.",
|
||||
"Device.Hosts.Host."
|
||||
"Device.InterfaceStack.",
|
||||
"Device.Hosts.Host.",
|
||||
"Device.IEEE1905.",
|
||||
"Device.WiFi.DataElements."
|
||||
]
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=owsd
|
||||
PKG_VERSION:=1.1.3
|
||||
PKG_VERSION:=1.1.4
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/owsd.git
|
||||
PKG_SOURCE_VERSION:=f78f7198944758cd2140887ecd8970432f678fc1
|
||||
PKG_SOURCE_VERSION:=e37c6f9d708c454c802eede814cc51fb89c919e9
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=lib-paho-mqtt
|
||||
PKG_VERSION:=0.1
|
||||
|
||||
PKG_SOURCE_VERSION:=9f715d0862a8e16099b5837c4e53a1bf6a6a0675
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/eclipse/paho.mqtt.c.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=edl-v10
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/lib-paho-mqtt
|
||||
CATEGORY:=Libraries
|
||||
DEPENDS:=+libopenssl
|
||||
TITLE:=package for mqtt stuff
|
||||
endef
|
||||
|
||||
|
||||
define Package/lib-paho-mqtt/description
|
||||
a library
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/build/output/*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/lib-paho-mqtt/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/output/*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,lib-paho-mqtt))
|
||||
@@ -5,14 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7426c7458f792cc66920c206d62869c5620f1400
|
||||
PKG_SOURCE_VERSION:=6c68428405bc88a9990e855f911aecc86f07f4a8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/periodicstats.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -20,13 +20,15 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
PKG_BUILD_DEPENDS:=bbf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/periodicstats
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Periodic Statistics Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbf_api
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/periodicstats/description
|
||||
@@ -35,7 +37,7 @@ endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ./periodicstats/* $(PKG_BUILD_DIR)/
|
||||
$(CP) -rf ~/git/periodicstats/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
|
||||
@@ -11,9 +11,12 @@ service_running() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
enable=$(uci -q get periodicstats.globals.enable)
|
||||
local enable
|
||||
|
||||
if [ "$(enable)" != "1" ]; then
|
||||
config_load periodicstats
|
||||
config_get_bool enable globals enable 1
|
||||
|
||||
if [ "${enable}" -ne "1" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
@@ -24,7 +27,7 @@ start_service() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger periodicstats uspd
|
||||
procd_add_reload_trigger periodicstats
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=15ba90f01914113e7c5e8f8a6df6279c882e8265
|
||||
PKG_SOURCE_VERSION:=21522c2003b8c61904acc61ff97e54fc9b0c3c92
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
|
||||
|
||||
|
||||
62
peripheral_manager/files/etc/init.d/ledmngr
Executable file
62
peripheral_manager/files/etc/init.d/ledmngr
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=20
|
||||
USE_PROCD=1
|
||||
|
||||
setled() {
|
||||
local enable
|
||||
local brightness
|
||||
|
||||
config_get_bool enable $1 enable 1
|
||||
config_get brightness $1 brightness 100
|
||||
ubus call led.$1 set "{\"enable\":$enable,\"brightness\":$brightness}"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
|
||||
config_load leds
|
||||
config_foreach setled led
|
||||
config_get_bool enable leds enable 1
|
||||
|
||||
if [ "$enable" == "0" ]; then
|
||||
ubus call leds set '{"state" : "alloff"}'
|
||||
else
|
||||
ubus call leds set '{"state" : "normal"}'
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
local led ledname
|
||||
|
||||
ubus list led* >/dev/null || sleep 1
|
||||
ubus list led* >/dev/null || sleep 1
|
||||
|
||||
[ -f /etc/config/leds ] || touch /etc/config/leds
|
||||
|
||||
if ! uci -q get leds.leds >/dev/null; then
|
||||
uci set leds.leds=leds
|
||||
uci set leds.leds.enable=1
|
||||
fi
|
||||
|
||||
for led in $(ubus list led.*); do
|
||||
ledname=${led:4}
|
||||
case $ledname in
|
||||
*phy*) continue ;;
|
||||
esac
|
||||
if ! uci -q get leds.$ledname >/dev/null; then
|
||||
uci set leds.$ledname=led
|
||||
uci set leds.$ledname.enable=1
|
||||
fi
|
||||
done
|
||||
|
||||
uci commit leds
|
||||
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "leds"
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user