mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-20 01:20:35 +08:00
Compare commits
571 Commits
stan-devel
...
dectlogcha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a01d85693 | ||
|
|
4a53405944 | ||
|
|
f4175d1056 | ||
|
|
ca89942898 | ||
|
|
719ef4d172 | ||
|
|
be0c9d79b0 | ||
|
|
72ecd3d35e | ||
|
|
445cfef73e | ||
|
|
e398b994da | ||
|
|
2cddf06c61 | ||
|
|
f42b9b4a62 | ||
|
|
e3dcdd6c4d | ||
|
|
acac9f08d2 | ||
|
|
3f5708e292 | ||
|
|
c49e2ed7de | ||
|
|
70a000f674 | ||
|
|
4748533fa2 | ||
|
|
ad1966b1ba | ||
|
|
89b367fcf4 | ||
|
|
3bec20d547 | ||
|
|
dde30f9d4a | ||
|
|
f93ba6ec61 | ||
|
|
13b3bdde7e | ||
|
|
1ccd68992f | ||
|
|
3ddbb176aa | ||
|
|
bea0ee5aa5 | ||
|
|
d30a942adb | ||
|
|
f53496233d | ||
|
|
a8f3bea932 | ||
|
|
95dd997cc9 | ||
|
|
62eb925e8c | ||
|
|
3b6e2ad2d7 | ||
|
|
3199e091c4 | ||
|
|
723be11ebc | ||
|
|
6c6a81bacb | ||
|
|
8dc5820987 | ||
|
|
60e0730a6d | ||
|
|
aed486f1f9 | ||
|
|
f2c11f12c3 | ||
|
|
b71fecbb6a | ||
|
|
76310d7e6e | ||
|
|
eac345c3e3 | ||
|
|
9570193737 | ||
|
|
c1d8341be7 | ||
|
|
ae033eb05e | ||
|
|
e16b9c7a0e | ||
|
|
53fb4d46c1 | ||
|
|
0fd29ae954 | ||
|
|
0be6005691 | ||
|
|
0f1e642fe0 | ||
|
|
0ead07e668 | ||
|
|
5bcc5d05dc | ||
|
|
ab91bd9941 | ||
|
|
314f90a0f4 | ||
|
|
429112ba92 | ||
|
|
b3c54526c2 | ||
|
|
b624d52243 | ||
|
|
1b661a7407 | ||
|
|
ec55634131 | ||
|
|
12dfd9be28 | ||
|
|
466d442666 | ||
|
|
28b4fa040a | ||
|
|
2077f29acf | ||
|
|
7335034c2b | ||
|
|
9ae0800d77 | ||
|
|
5d74e693c7 | ||
|
|
d513b5b799 | ||
|
|
40503fc42d | ||
|
|
34acd302be | ||
|
|
705fb9e41b | ||
|
|
8fb0ffc766 | ||
|
|
8e8442e508 | ||
|
|
e7486f4538 | ||
|
|
957d176f26 | ||
|
|
454afbbc98 | ||
|
|
ebda97fe62 | ||
|
|
b261816fe4 | ||
|
|
0fe82491e3 | ||
|
|
a4e457a3ee | ||
|
|
1a4ab4713e | ||
|
|
4cce081fd3 | ||
|
|
a730c6a2e0 | ||
|
|
932385bec1 | ||
|
|
642ffec9cd | ||
|
|
d1cd14742e | ||
|
|
c9309739a6 | ||
|
|
979fe82336 | ||
|
|
e7c84ac6ba | ||
|
|
9a8f2cb393 | ||
|
|
7af3534bc9 | ||
|
|
f1795e0263 | ||
|
|
a2115711bb | ||
|
|
2b26e9083b | ||
|
|
1978d357c9 | ||
|
|
822f77590d | ||
|
|
3d31052d40 | ||
|
|
dc56c93b73 | ||
|
|
0dd95029e6 | ||
|
|
5f92faf0a1 | ||
|
|
31ed1f802b | ||
|
|
c73ac6665b | ||
|
|
431d1fbf34 | ||
|
|
2ddb4fb5fc | ||
|
|
1835fe7a50 | ||
|
|
d0e30dade4 | ||
|
|
be867f1b25 | ||
|
|
9b2318242b | ||
|
|
8fee87c3c6 | ||
|
|
2fbdb4b3d2 | ||
|
|
337c9a52f9 | ||
|
|
6c86adbf86 | ||
|
|
e316bea78f | ||
|
|
233d714564 | ||
|
|
13b742fe44 | ||
|
|
c23ae5dad1 | ||
|
|
3c7aa191ea | ||
|
|
d8bbc9de81 | ||
|
|
92e353bb49 | ||
|
|
17fd78bc94 | ||
|
|
68ca3b1d07 | ||
|
|
05a5616347 | ||
|
|
90f102b36a | ||
|
|
3e95e599e4 | ||
|
|
12d1e79339 | ||
|
|
9ffed931c6 | ||
|
|
aa8949e9e4 | ||
|
|
c31e10cd88 | ||
|
|
1257c11c69 | ||
|
|
147c6de58c | ||
|
|
b821b189d1 | ||
|
|
cae7d71907 | ||
|
|
92748d489a | ||
|
|
9847af7e74 | ||
|
|
8e98dc9526 | ||
|
|
1fe4fbdd4e | ||
|
|
e4f24b2223 | ||
|
|
ec905407f0 | ||
|
|
0c0c7316fa | ||
|
|
72da7b55c2 | ||
|
|
60fe16d7ce | ||
|
|
cb1fa79dcd | ||
|
|
15ab89ef7d | ||
|
|
975f4e7552 | ||
|
|
a3a7c6da1b | ||
|
|
dca442ce01 | ||
|
|
6f00aa22fd | ||
|
|
575f5c9d19 | ||
|
|
a699302f46 | ||
|
|
4ef7a8034b | ||
|
|
9675953bf6 | ||
|
|
d3d4c87f82 | ||
|
|
52ced81af6 | ||
|
|
20f17b81c5 | ||
|
|
aafcebaf3d | ||
|
|
6126333ad9 | ||
|
|
fc15efe427 | ||
|
|
59d28497d9 | ||
|
|
3a4a1b64bf | ||
|
|
1ce127080e | ||
|
|
f9a4bfa6d6 | ||
|
|
e4365786b9 | ||
|
|
65c619060d | ||
|
|
ef370bc886 | ||
|
|
0730c65372 | ||
|
|
626e1241d6 | ||
|
|
b86544da9a | ||
|
|
3e38df2389 | ||
|
|
d34d6e8bf0 | ||
|
|
2f8a76e34d | ||
|
|
55f1310daa | ||
|
|
57b528f2af | ||
|
|
670904cd6c | ||
|
|
ad0633029c | ||
|
|
9b823e5937 | ||
|
|
431325e6e6 | ||
|
|
fd8fa1d7e2 | ||
|
|
572bfa61dd | ||
|
|
5963ff1139 | ||
|
|
363d3dfcb7 | ||
|
|
cf12bbe6e2 | ||
|
|
426437c233 | ||
|
|
742ded177d | ||
|
|
a5f6b10a50 | ||
|
|
c25139968a | ||
|
|
f52700c0f0 | ||
|
|
5bc8757a3e | ||
|
|
5b0fe1d2dc | ||
|
|
a31ae89e79 | ||
|
|
bd72194d2d | ||
|
|
babb25709b | ||
|
|
ea37c333f9 | ||
|
|
be07b58cf5 | ||
|
|
13a6a59469 | ||
|
|
b6301bba94 | ||
|
|
dd627b7f70 | ||
|
|
0d2a12f029 | ||
|
|
0f1460f45f | ||
|
|
022e506a56 | ||
|
|
9025395702 | ||
|
|
35ce40b964 | ||
|
|
0c915ba8b8 | ||
|
|
60ab6d1a6b | ||
|
|
8ec45319bc | ||
|
|
1536d860dd | ||
|
|
49858f3601 | ||
|
|
1c305c69e4 | ||
|
|
e592e2d567 | ||
|
|
ff7714c88e | ||
|
|
9dda4d7ffa | ||
|
|
10cee1f785 | ||
|
|
8816c26e2a | ||
|
|
aba742a5e7 | ||
|
|
d199dadd39 | ||
|
|
fca18d2da5 | ||
|
|
3b819f5b1d | ||
|
|
b49d14370d | ||
|
|
3f2befa23a | ||
|
|
52809e1e94 | ||
|
|
52ff5c79dd | ||
|
|
09ad1ffa91 | ||
|
|
1d2d9b7b97 | ||
|
|
7f405f04ac | ||
|
|
16134d0a2d | ||
|
|
5fbc784901 | ||
|
|
0eaba859a7 | ||
|
|
7828e67308 | ||
|
|
985ccf339f | ||
|
|
b8f36d23ec | ||
|
|
4f7aeaaec2 | ||
|
|
d976140484 | ||
|
|
747436ce8f | ||
|
|
dde560d314 | ||
|
|
34ec63d1f2 | ||
|
|
d4465d81f7 | ||
|
|
022ec4d6bb | ||
|
|
6c68ff3be7 | ||
|
|
9e1e0eb0df | ||
|
|
63ba56b87e | ||
|
|
53ab41ea2f | ||
|
|
d1477636f9 | ||
|
|
b2e8affb08 | ||
|
|
2dc9b89cd5 | ||
|
|
77acc69dbe | ||
|
|
5ac418113e | ||
|
|
1ba55b753e | ||
|
|
d483abe7d2 | ||
|
|
511d471d54 | ||
|
|
206ecd46db | ||
|
|
f9f31384c2 | ||
|
|
2c4e50ab10 | ||
|
|
ac46849475 | ||
|
|
4db7061884 | ||
|
|
de40d120e2 | ||
|
|
e54e20de45 | ||
|
|
7add2a163d | ||
|
|
499709e2df | ||
|
|
c566d23c78 | ||
|
|
a5c8b7145f | ||
|
|
0419beb911 | ||
|
|
8bb22efe7d | ||
|
|
bff8f75bbb | ||
|
|
be57a189f7 | ||
|
|
9c365459bb | ||
|
|
f4e9f29d3d | ||
|
|
ac56460fec | ||
|
|
cb2077377a | ||
|
|
673dfc8589 | ||
|
|
a287107ee1 | ||
|
|
47396a4e4f | ||
|
|
d82756305c | ||
|
|
5bd754fc9a | ||
|
|
bed5379108 | ||
|
|
d8e5dcf859 | ||
|
|
64f9e23850 | ||
|
|
aaffffdba2 | ||
|
|
0d6980e0ec | ||
|
|
61f454043d | ||
|
|
defe48e4e8 | ||
|
|
4d893499a5 | ||
|
|
e32f2f09be | ||
|
|
183ba5d634 | ||
|
|
809113d4b2 | ||
|
|
927b002aa6 | ||
|
|
c5654ad9ab | ||
|
|
2e3013dc56 | ||
|
|
a7dd783b49 | ||
|
|
d3451b7bd4 | ||
|
|
776860187d | ||
|
|
d2dda88aad | ||
|
|
22871d2410 | ||
|
|
707203b42a | ||
|
|
60fb332fff | ||
|
|
bd0d27ebc9 | ||
|
|
0af83a4892 | ||
|
|
715f58db4d | ||
|
|
cdfa0a7313 | ||
|
|
9b12400c0b | ||
|
|
b59e3250af | ||
|
|
f742ce11ae | ||
|
|
7a6ff46b8a | ||
|
|
e3d9a24ed7 | ||
|
|
88fcb2e4df | ||
|
|
0f05633d74 | ||
|
|
5173b01cb2 | ||
|
|
86cf6fc81e | ||
|
|
2ee29d8252 | ||
|
|
ef178897ba | ||
|
|
1d4b28acd4 | ||
|
|
2b6e74fb80 | ||
|
|
32cfd29d74 | ||
|
|
63959e908e | ||
|
|
80e2035662 | ||
|
|
7527faca9c | ||
|
|
b7e010be3b | ||
|
|
84ad0eec4e | ||
|
|
bd188aaed2 | ||
|
|
4d244eb31e | ||
|
|
14aab50849 | ||
|
|
3a605fd8f5 | ||
|
|
f9bbce19dd | ||
|
|
a1677793d3 | ||
|
|
d7a8913072 | ||
|
|
34c5ea3c75 | ||
|
|
c006db0e21 | ||
|
|
4e42968aca | ||
|
|
9b48e54734 | ||
|
|
77a41d56a1 | ||
|
|
90fa843074 | ||
|
|
524c718242 | ||
|
|
e00102c2b9 | ||
|
|
2c0b6b76e2 | ||
|
|
9e9dc5b1a9 | ||
|
|
4535b14305 | ||
|
|
478e3a5c8b | ||
|
|
98302e0523 | ||
|
|
4dc45c779a | ||
|
|
c1bef47f50 | ||
|
|
9fb0c48a22 | ||
|
|
d8e35df684 | ||
|
|
d0189d605f | ||
|
|
8de1704440 | ||
|
|
f6f1644bab | ||
|
|
b1c705544b | ||
|
|
bd8d574177 | ||
|
|
4b5c88b015 | ||
|
|
32245d37c3 | ||
|
|
56d2b9c4e3 | ||
|
|
08244c5392 | ||
|
|
146bc95709 | ||
|
|
25a861a55f | ||
|
|
86fab6969f | ||
|
|
5463df37e1 | ||
|
|
a480a0c95d | ||
|
|
89068fa876 | ||
|
|
c3cee3431c | ||
|
|
bf70b518bd | ||
|
|
ad293962c1 | ||
|
|
6badc20bcc | ||
|
|
f8b51b9ca5 | ||
|
|
a5c390efdd | ||
|
|
6d011f8626 | ||
|
|
f1d5e5d7cd | ||
|
|
0fed56903c | ||
|
|
2ac7be4652 | ||
|
|
7e34649ce7 | ||
|
|
a404da9124 | ||
|
|
d152eb0f17 | ||
|
|
fb8ed439b8 | ||
|
|
6b23da2314 | ||
|
|
bc90649202 | ||
|
|
0f31eb632f | ||
|
|
5c37dc2165 | ||
|
|
b4ce04d317 | ||
|
|
1f817c4e8f | ||
|
|
26599ba94e | ||
|
|
26fe0bc7de | ||
|
|
37493eb8be | ||
|
|
b3dda9b4e5 | ||
|
|
94879c6de9 | ||
|
|
a15f586ecf | ||
|
|
f3c5face44 | ||
|
|
4488510e4b | ||
|
|
4685cb49d4 | ||
|
|
6ad633cbf4 | ||
|
|
d97c335cb5 | ||
|
|
3563683cec | ||
|
|
330bb08d1b | ||
|
|
93f2090d0e | ||
|
|
d9ae18761b | ||
|
|
40a1a45412 | ||
|
|
f459eaafb9 | ||
|
|
a80ed328c3 | ||
|
|
15d9fc0339 | ||
|
|
916edb4ba3 | ||
|
|
eb67d5ab6e | ||
|
|
dd43b90e91 | ||
|
|
5fee9aa7b4 | ||
|
|
b821c760df | ||
|
|
2dbcf3c75c | ||
|
|
952366cbc6 | ||
|
|
23a18999d5 | ||
|
|
2d2dffbec2 | ||
|
|
758ee8ec9f | ||
|
|
c38ce1be3b | ||
|
|
2b5332adc3 | ||
|
|
70c3d5d5e1 | ||
|
|
df41990929 | ||
|
|
6edc7cbb94 | ||
|
|
d7bffebd5b | ||
|
|
8f81a71b57 | ||
|
|
9452ada64f | ||
|
|
1a3d267ee1 | ||
|
|
2f6b40bdd2 | ||
|
|
d1c2be5b08 | ||
|
|
fdee0c734c | ||
|
|
88513db735 | ||
|
|
8bdbefcc80 | ||
|
|
ee33f0ae7d | ||
|
|
5cd57a3ee9 | ||
|
|
56a6cbf04a | ||
|
|
1fb879fca0 | ||
|
|
a3fd03c390 | ||
|
|
00594ba01e | ||
|
|
132bba5c20 | ||
|
|
06f160af35 | ||
|
|
04bf025b8f | ||
|
|
1daa8d7f1a | ||
|
|
97a302a20a | ||
|
|
87a0fbe8bf | ||
|
|
54b4140e09 | ||
|
|
99267f902b | ||
|
|
0338a2fd7c | ||
|
|
e134a5ed08 | ||
|
|
0d8f4a3de8 | ||
|
|
d5e7cb1a28 | ||
|
|
e995fcb14d | ||
|
|
f865531fa5 | ||
|
|
104f3e2e83 | ||
|
|
d298757300 | ||
|
|
b66ade378a | ||
|
|
be36f2e3e8 | ||
|
|
00dc43eb39 | ||
|
|
efeeb00a0a | ||
|
|
cc5b7a8a17 | ||
|
|
ce8425ce70 | ||
|
|
ce5b916828 | ||
|
|
7f04196f58 | ||
|
|
762d5a5daa | ||
|
|
abc997d3f3 | ||
|
|
924b54d8d3 | ||
|
|
bd8dd65766 | ||
|
|
5372956a9a | ||
|
|
bf0ddc5321 | ||
|
|
7895966aa2 | ||
|
|
0f716b5197 | ||
|
|
dd56712aa4 | ||
|
|
b7de0cf4bb | ||
|
|
09f6449a6e | ||
|
|
f00e7fe965 | ||
|
|
dd7aac2a8c | ||
|
|
49ffec4bc9 | ||
|
|
0a638e202b | ||
|
|
82676d8390 | ||
|
|
95d6cadee1 | ||
|
|
4672442d50 | ||
|
|
7a8759e46a | ||
|
|
f28659ebe0 | ||
|
|
f10457c8cb | ||
|
|
bd3f962614 | ||
|
|
a4aa0b3521 | ||
|
|
06204d8523 | ||
|
|
4b5dbec851 | ||
|
|
ab6035acbd | ||
|
|
72b7726f1e | ||
|
|
56ab101640 | ||
|
|
4ee030a2ea | ||
|
|
ec402a2ea1 | ||
|
|
52466671ab | ||
|
|
3a54432533 | ||
|
|
7a8e1b9076 | ||
|
|
237e8d7b6d | ||
|
|
bd468e4761 | ||
|
|
67169eff2a | ||
|
|
1ad1ef12b4 | ||
|
|
a012f98b4c | ||
|
|
1f3c696867 | ||
|
|
b861a89031 | ||
|
|
ca9e4f1765 | ||
|
|
a94c701f66 | ||
|
|
13684e1ce6 | ||
|
|
00d5c0849c | ||
|
|
2ae25830e7 | ||
|
|
645a3bb5e5 | ||
|
|
85fbea1d40 | ||
|
|
4be8594678 | ||
|
|
1cb7520cb9 | ||
|
|
bb6131b1f7 | ||
|
|
f268b27622 | ||
|
|
85387d16b1 | ||
|
|
566a5ebcc7 | ||
|
|
48104e2831 | ||
|
|
f9e6d17778 | ||
|
|
47ffb81c08 | ||
|
|
fd050bc759 | ||
|
|
76d1fd9cb3 | ||
|
|
3bf86b8652 | ||
|
|
c914639104 | ||
|
|
425d48e974 | ||
|
|
c339eae256 | ||
|
|
fa7ef67b91 | ||
|
|
fc374d0f29 | ||
|
|
01808d21b2 | ||
|
|
5a1fdc0b07 | ||
|
|
6a84c4511a | ||
|
|
11704f2f91 | ||
|
|
d48965a03f | ||
|
|
bd12c3d6e8 | ||
|
|
249072f280 | ||
|
|
ece01dd366 | ||
|
|
2d82d20613 | ||
|
|
e6371c74d6 | ||
|
|
aa25a78ff1 | ||
|
|
60d1c43735 | ||
|
|
795fc9e805 | ||
|
|
1af894cba6 | ||
|
|
4ba1558caa | ||
|
|
cfb06f61d0 | ||
|
|
d786c69d46 | ||
|
|
5d2b838d3e | ||
|
|
88060bc42a | ||
|
|
16c3f49ff5 | ||
|
|
4b6eaad9a8 | ||
|
|
af241bb222 | ||
|
|
ae621822c4 | ||
|
|
1a6ac9fa87 | ||
|
|
749e38735a | ||
|
|
292276ce75 | ||
|
|
1bcc2854af | ||
|
|
cee063223e | ||
|
|
44e1f1c867 | ||
|
|
0b2d89a810 | ||
|
|
d16a53087d | ||
|
|
f4ca987fae | ||
|
|
c6e8ad013c | ||
|
|
76e6d34d67 | ||
|
|
3bdc80057b | ||
|
|
87f6ea2a1c | ||
|
|
24e065f9a8 | ||
|
|
ba7d1c1153 | ||
|
|
42a13509a4 | ||
|
|
d5b529311a | ||
|
|
dd7e804cab | ||
|
|
ea779bb6c7 | ||
|
|
7ea1adc2d9 | ||
|
|
ae186df3c9 | ||
|
|
8fe00c184f | ||
|
|
a5f99f4fc3 | ||
|
|
5c2c368800 | ||
|
|
8d078181f9 | ||
|
|
6b8e047d33 | ||
|
|
b073b86450 | ||
|
|
61eccddf93 | ||
|
|
98465ecf62 | ||
|
|
fdad57f796 | ||
|
|
8da760a491 | ||
|
|
fb8010b5fd | ||
|
|
7a669d7e1b | ||
|
|
21cb7c14e0 | ||
|
|
7fc00dbbda | ||
|
|
4cf278cbf1 | ||
|
|
7ac322b707 |
@@ -1,5 +1,7 @@
|
||||
if PACKAGE_libbbfdm
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config BBF_VENDOR_EXTENSION
|
||||
bool "Enable Vendor Extension"
|
||||
default y
|
||||
@@ -24,4 +26,12 @@ config BBF_TR143
|
||||
bool "Enable TR-143 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBFDM_ENABLE_JSON_PLUGIN
|
||||
bool "Enable json plugin to extend datamodel"
|
||||
default n
|
||||
|
||||
config BBFDM_ENABLE_DOTSO_PLUGIN
|
||||
bool "Enable shared library plugin to extend datamodel"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
53
bbf/Makefile
53
bbf/Makefile
@@ -5,11 +5,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=4.5.6
|
||||
PKG_VERSION:=6.4.27
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=86383aed1923815695a30e42d973c4e65af17406
|
||||
PKG_SOURCE_VERSION:=710485a57e311a5b4c5434efe3e79fc58cb6c429
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -23,19 +23,19 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libbbf_api
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=BBF
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for libbbfdm API
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SUBMENU:=BBF
|
||||
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 +libmbedtls +libcurl
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libcurl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -81,11 +81,6 @@ CONFIGURE_ARGS += \
|
||||
--enable-libopenssl
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libmbedtls
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-vendor-extension
|
||||
@@ -96,36 +91,48 @@ CONFIGURE_ARGS += \
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-json-plugin
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared-library
|
||||
endif
|
||||
|
||||
define Package/libbbf_api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/* $(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_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/*
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
|
||||
$(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/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbf_api))
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
PKG_SOURCE_VERSION:=e4f39d1bf4678fc05b9d02e81b194c70719909e4
|
||||
PKG_SOURCE_VERSION:=b35e7862bc17fc11dc1f757c7b93900995a28633
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
||||
|
||||
|
||||
@@ -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))
|
||||
11
dectmngr/Config.in
Normal file
11
dectmngr/Config.in
Normal file
@@ -0,0 +1,11 @@
|
||||
if PACKAGE_dectmngr
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config ENABLE_LINE_SETTINGS_EXTENSION
|
||||
bool "Enable Line Settings List extension "
|
||||
default y
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
@@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.1.10
|
||||
PKG_VERSION:=3.5.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=23f727445d858ecf6f447a6f2f371f6d17feda66
|
||||
PKG_SOURCE_VERSION:=ef9d4c6124d0ca66f048f3d678d9a25f13aa4207
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -34,29 +34,40 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=DECT Manager
|
||||
DEPENDS:= +libubox +ubus
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS+="-Wall"
|
||||
TARGET_CFLAGS += \
|
||||
-Wall \
|
||||
-I$(STAGING_DIR)/usr/include/libxml2
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_LINE_SETTINGS_EXTENSION),y)
|
||||
TARGET_CFLAGS += -DENABLE_LINE_SETTINGS_EXTENSION
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/dectmngr
|
||||
$(CP) ./files/etc/* $(1)/etc/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dect $(1)/lib/upgrade/keep.d/dect
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
3
dectmngr/files/etc/config/dect
Normal file
3
dectmngr/files/etc/config/dect
Normal file
@@ -0,0 +1,3 @@
|
||||
config dect 'global'
|
||||
option log_dect_cmbs 'syslog'
|
||||
option log_level 'realtime,warning,error'
|
||||
@@ -1,2 +0,0 @@
|
||||
config dectmngr 'general'
|
||||
option log_dect_cmbs '0'
|
||||
BIN
dectmngr/files/etc/dspg/04130010.bin
Normal file
BIN
dectmngr/files/etc/dspg/04130010.bin
Normal file
Binary file not shown.
@@ -26,6 +26,7 @@ start_service() {
|
||||
local opt_ext=
|
||||
local rfpi=
|
||||
local model_id=
|
||||
local rxtun=
|
||||
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
@@ -34,24 +35,33 @@ start_service() {
|
||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
||||
|
||||
# model_id=$(db -q get hw.board.dect_model_id)
|
||||
# Setting model_id to 0x010203 is a workaround to reduce synchronisation time of some handset
|
||||
# TODO: remove below line and uncomment the line above to get value from db when the problem is solved
|
||||
model_id="01.02.03"
|
||||
[ -n "$model_id" -a ${#model_id} -eq 8 ] && opt_ext="$opt_ext -model $model_id"
|
||||
model_id=$(db -q get hw.board.dect_model_id)
|
||||
[ -n "$model_id" -a ${#model_id} -eq 8 ] || {
|
||||
echo "Invalid hw.board.dect_model_id:$model_id. Set to 30.3B.06"
|
||||
model_id="30.3B.06"
|
||||
}
|
||||
opt_ext="$opt_ext -model $model_id"
|
||||
|
||||
config_load dectmngr
|
||||
config_get_bool log_dect_cmbs general log_dect_cmbs 0
|
||||
rxtun=$(db -q get hw.board.dect_rxtun)
|
||||
[ -n "$rxtun" -a ${#rxtun} -eq 2 ] && opt_ext="$opt_ext -rxtun $rxtun"
|
||||
|
||||
config_load dect
|
||||
config_get log_dect_cmbs global log_dect_cmbs syslog
|
||||
|
||||
procd_open_instance
|
||||
if [ $log_dect_cmbs -eq 0 ]; then
|
||||
if [ "$log_dect_cmbs" = "none" ]; then
|
||||
echo "Starting dectmngr with cmbs logging disabled"
|
||||
procd_set_param command $PROG -comname ttyH0 $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
else
|
||||
echo "Starting dectmngr with cmbs logging enabled"
|
||||
elif [ "$log_dect_cmbs" = "file" ]; then
|
||||
echo "Starting dectmngr with cmbs logging enabled to file"
|
||||
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
|
||||
else
|
||||
echo "Starting dectmngr with cmbs logging enabled to syslog"
|
||||
procd_set_param command $PROG -comname ttyH0 -syslog $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
fi
|
||||
|
||||
procd_set_param respawn 6 2 3
|
||||
procd_set_param term_timeout 20
|
||||
procd_set_param triggers asterisk
|
||||
@@ -66,13 +76,13 @@ stop_service() {
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop_and_wait_dectmngr
|
||||
start
|
||||
ubus call dect reload
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger asterisk
|
||||
procd_add_config_trigger "config.change" "asterisk" /etc/init.d/dectmngr restart
|
||||
procd_add_config_trigger "config.change" "dect" /etc/init.d/dectmngr reload
|
||||
}
|
||||
|
||||
boot() {
|
||||
|
||||
1
dectmngr/files/lib/upgrade/keep.d/dect
Normal file
1
dectmngr/files/lib/upgrade/keep.d/dect
Normal file
@@ -0,0 +1 @@
|
||||
/etc/dect/LA_DB
|
||||
@@ -8,12 +8,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.1.1
|
||||
PKG_VERSION:=1.1.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a316c41610610e7c1ef26353587da58e1f75157e
|
||||
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -33,7 +33,7 @@ exec_class_log() {
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 8;;
|
||||
@@ -55,7 +55,7 @@ get_priority() {
|
||||
}
|
||||
|
||||
get_mark() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo "0x41/0x3df";;
|
||||
|
||||
@@ -15,7 +15,7 @@ exec_log() {
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
@@ -98,7 +98,7 @@ manage_rule() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
protocol=$(echo ${proto}|tr [A-Z] [a-z])
|
||||
protocol=$(echo ${proto}|tr 'A-Z' 'a-z')
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
|
||||
@@ -19,7 +19,7 @@ exec_log() {
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.2.35
|
||||
PKG_VERSION:=6.4.40
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d3dba203e5bedfd4b8a1e51d5dd6d8fc9e632d70
|
||||
PKG_SOURCE_VERSION:=699744d5ae9e043715c260f9b58bbc18747895f9
|
||||
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
|
||||
@@ -32,7 +32,6 @@ define Package/easy-soc-libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=IOPSYS Easy SoC libraries
|
||||
SUBMENU:=IOPSYS Easy SoC libraries
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
@@ -79,7 +78,6 @@ endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
MAKE_FLAGS += \
|
||||
|
||||
@@ -18,6 +18,7 @@ define Build/InstallDev/libeasy
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/hlist.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_VERSION:=0.5
|
||||
PKG_VERSION:=0.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=76c02a334ddd238f4412ba954e3dd739fb3709af
|
||||
PKG_SOURCE_VERSION:=3a71d4124061287783e0d4c763b1b20e925d2133
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -30,7 +30,7 @@ PKG_BUILD_PARALLEL:=1
|
||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
||||
|
||||
export CONFIG_BRCM_SDK_VER_504002
|
||||
export CONFIG_BRCM_SDK_VER_504021
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -7,6 +7,8 @@ USE_PROCD=1
|
||||
NAME=endptmngr
|
||||
|
||||
start_service() {
|
||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param env hw_board_hasDect=$(db get hw.board.hasDect)
|
||||
procd_set_param command $NAME
|
||||
|
||||
@@ -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:=45575262de7a9690bcb2c760f35e2c74e88e1176
|
||||
PKG_SOURCE_VERSION:=7e013f0afa68378d38a6bdc9b0c5a342bd3dd0a5
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
|
||||
@@ -28,6 +28,7 @@ define KernelPackage/$(PKG_NAME)
|
||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||
DEPENDS:= +(TARGET_iopsys_brcm63xx_arm):bcmkernel
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
@@ -40,6 +41,21 @@ EXTRA_KCONFIG:= CONFIG_RGB_LED=m
|
||||
|
||||
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)
|
||||
|
||||
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-
|
||||
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"
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
||||
|
||||
@@ -43,10 +43,15 @@
|
||||
static ssize_t get_led_color(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
/* [ln] todo: dummy implementation */
|
||||
int len;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%d\n", 123);
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
return -EIO;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
if PACKAGE_icwmp
|
||||
|
||||
menu "Configuration"
|
||||
choice
|
||||
prompt "Select ACS sever"
|
||||
default CWMP_ACS_MULTI
|
||||
@@ -18,6 +19,6 @@ config CWMP_DEBUG
|
||||
config CWMP_DEVEL_DEBUG
|
||||
bool "Compile with development debug options"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=8.1.1-2021-08-26
|
||||
PKG_VERSION:=8.2.27
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=ecaf463dbd79a3c1f7d3249e19cde70d6c628420
|
||||
PKG_SOURCE_VERSION:=da88c8c28656b2db54ab205d26faccda68546c05
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -29,8 +29,6 @@ PKG_CONFIG_DEPENDS:= \
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
@@ -57,24 +55,8 @@ endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifneq ($(CWMP_REVISION)_,_)
|
||||
ifneq ($(CWMP_REVISION),exported)
|
||||
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||
TARGET_CFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||
TARGET_LDFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
TARGET_LDFLAGS += \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--with-uci-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubus-include-path=$(STAGING_DIR)/usr/include
|
||||
-D_GNU_SOURCE \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -99,26 +81,19 @@ endif
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Enabling rc.d symlink for icwmpd"
|
||||
/etc/init.d/icwmpd enable
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Disabling rc.d symlink for icwmpd"
|
||||
/etc/init.d/icwmpd disable
|
||||
fi
|
||||
exit 0
|
||||
$(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_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
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
config acs 'acs'
|
||||
option url ''
|
||||
option userid '' #$OUI-$SER
|
||||
option passwd 'iopsys'
|
||||
option periodic_inform_enable 'true'
|
||||
option periodic_inform_interval '1800'
|
||||
option periodic_inform_time '0001-01-01T00:00:00Z'
|
||||
option ParameterKey ''
|
||||
option dhcp_discovery 'enable'
|
||||
# compression possible configs: GZIP, Deflate, Disabled
|
||||
option compression 'Disabled'
|
||||
@@ -39,6 +37,7 @@ config cpe 'cpe'
|
||||
option exec_download '0'
|
||||
option periodic_notify_enable '1'
|
||||
option periodic_notify_interval '10'
|
||||
option incoming_rule 'Port_Only'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '1'
|
||||
|
||||
@@ -1,21 +1,81 @@
|
||||
#created by the icwmp package
|
||||
zone_name=""
|
||||
port=""
|
||||
if [ "$zone_name" = "" ]; then
|
||||
#!/bin/sh
|
||||
|
||||
#created by the icwmp package
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.cwmp -p info
|
||||
}
|
||||
|
||||
if [ ! -f "/var/state/cwmp" ]; then
|
||||
touch "/var/state/cwmp"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
zone_name=$(uci -c /var/state -q get cwmp.acs.zonename)
|
||||
port=$(uci -q get cwmp.cpe.port)
|
||||
ipaddr=$(uci -c /var/state -q get cwmp.acs.ip)
|
||||
ip6addr=$(uci -c /var/state -q get cwmp.acs.ip6)
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr 'A-Z' 'a-z')
|
||||
|
||||
if [ -z "${zone_name}" ]; then
|
||||
log "empty firewall zone name"
|
||||
exit 0
|
||||
elif [ "$zone_name" = "icwmp" ]; then
|
||||
iptables -nL zone_icwmp_input 2> /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
iptables -N zone_icwmp_input
|
||||
iptables -t filter -A INPUT -j zone_icwmp_input
|
||||
iptables -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
iptables -w 1 -N zone_icwmp_input
|
||||
iptables -w 1 -t filter -A INPUT -j zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
else
|
||||
iptables -F zone_icwmp_input
|
||||
iptables -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
iptables -w 1 -F zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
fi
|
||||
else
|
||||
iptables -F zone_icwmp_input 2> /dev/null
|
||||
iptables -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -X zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -F zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -X zone_icwmp_input 2> /dev/null
|
||||
fi
|
||||
#iptables -I FW_ZONE -p tcp -s ACS_ADDRESS --dport PORT -j ACCEPT --comment "Open ACS port"
|
||||
|
||||
cmd="iptables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
cmd6="ip6tables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
|
||||
# default incoming rule is Port only
|
||||
if [ -z "${incoming_rule}" ]; then
|
||||
incoming_rule="port_only"
|
||||
fi
|
||||
|
||||
if [ "${incoming_rule}" = "ip_only" ]; then
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
cmd6="${cmd6} --dport ${port}"
|
||||
fi
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
cmd6="${cmd6} --dport ${port}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ${cmd}|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd}
|
||||
fi
|
||||
|
||||
echo ${cmd6}|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd6="${cmd6} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd6}
|
||||
fi
|
||||
|
||||
uci -c /var/state -q set cwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit cwmp
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
[ -f /etc/config/cwmp ] || exit 0
|
||||
|
||||
handle_icwmp_restart() {
|
||||
[ -f /tmp/switching_mode ] && exit 0
|
||||
[ -f /tmp/wificontrol.txt -a -f /tmp/netmode-conf.pid ] && exit 0
|
||||
|
||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
mkdir -p /tmp/ipv4
|
||||
|
||||
network_flush_cache
|
||||
|
||||
local previpaddr=""
|
||||
local curipaddr=""
|
||||
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
|
||||
previpaddr=$(cat $ipaddrfile 2>/dev/null)
|
||||
network_get_ipaddr curipaddr $INTERFACE
|
||||
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
|
||||
|
||||
local prevgateway=""
|
||||
local curgateway=""
|
||||
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
|
||||
prevgateway=$(cat $gatewayfile 2>/dev/null)
|
||||
network_get_gateway curgateway $INTERFACE
|
||||
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
|
||||
|
||||
local prevsubnets=""
|
||||
local cursubnets=""
|
||||
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
|
||||
prevsubnets=$(cat $subnetsfile 2>/dev/null)
|
||||
network_get_subnets cursubnets $INTERFACE
|
||||
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
|
||||
|
||||
local prevdnsservers=""
|
||||
local curdnsservers=""
|
||||
local dnsserverfile=/tmp/ipv4/$INTERFACE-dnsservers
|
||||
prevdnsservers=$(cat $dnsserverfile 2>/dev/null)
|
||||
network_get_dnsserver curdnsservers $INTERFACE
|
||||
[ -n "$curdnsservers" ] && echo $curdnsservers > $dnsserverfile || rm -f $dnsserverfile
|
||||
|
||||
local prevdev=""
|
||||
local curdev=""
|
||||
local devfile=/tmp/ipv4/$INTERFACE-dev
|
||||
prevdev=$(cat $devfile 2>/dev/null)
|
||||
network_get_device curdev $INTERFACE
|
||||
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
|
||||
|
||||
local prevopt43url=""
|
||||
local curopt43url=""
|
||||
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
|
||||
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
|
||||
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
|
||||
|
||||
[ \
|
||||
"$prevdev" == "$curdev" -a \
|
||||
"$previpaddr" = "$curipaddr" -a \
|
||||
"$prevgateway" = "$curgateway" -a \
|
||||
"$prevsubnets" = "$cursubnets" -a \
|
||||
"$prevdnsservers" = "$curdnsservers" \
|
||||
] && {
|
||||
[ "$prevopt43url" = "$curopt43url" ] && exit 0
|
||||
[ -z "$prevopt43url" ] && exit 0
|
||||
}
|
||||
|
||||
/etc/init.d/icwmpd reload &
|
||||
}
|
||||
|
||||
handle_icwmp_restart
|
||||
43
icwmp/files/etc/icwmpd/update.sh
Normal file
43
icwmp/files/etc/icwmpd/update.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
log() {
|
||||
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"`
|
||||
|
||||
log "Handling dhcp option value ${vendorspecinf}"
|
||||
[ -n "$vendorspecinf" ] && {
|
||||
local url=""
|
||||
local old_url="$(uci -q get cwmp.acs.dhcp_url)"
|
||||
|
||||
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
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
handle_icwmp_update
|
||||
@@ -6,125 +6,41 @@ include /lib/network
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
STOP=2
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/icwmpd"
|
||||
|
||||
EXTRA_HELP=" start [GetRPCMethods] Start icwmpd service and send GetRPCMethods"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
validate_url() {
|
||||
# SCHEMA_LIST: contain list of possible schemas that could be present in the acs url
|
||||
# Example: SCHEMA_LIST="http https"
|
||||
SCHEMA_LIST="http"
|
||||
|
||||
for schema in $SCHEMA_LIST; do
|
||||
dest=`echo $1 | sed 's/$schema:\/\///g' | cut -f1 -d \/ | cut -f1 -d:`
|
||||
if [ "_$dest" != "_" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
get_acs_url() {
|
||||
local default_acs="http://10.10.1.6:8000/openacs/acs"
|
||||
local acs_dhcp_discovery="$(uci -q get cwmp.acs.dhcp_discovery)"
|
||||
local url="$(uci -q get cwmp.acs.url)"
|
||||
local dhcp_url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
|
||||
if [ "$acs_dhcp_discovery" == "enable" -a -n "$dhcp_url" -o -z "$url" ]; then
|
||||
url="$dhcp_url"
|
||||
log "ACS URL from DHCP server: $url"
|
||||
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url" || url="$default_acs"
|
||||
elif [ -n "$url" ];then
|
||||
url="$(uci -q get cwmp.acs.url)"
|
||||
log "ACS URL from configuration: $url"
|
||||
else
|
||||
url="$default_acs"
|
||||
log "Using default ACS URL: $url"
|
||||
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url"
|
||||
fi
|
||||
|
||||
validate_url "$url"
|
||||
if [ "$?" != "0" ];then
|
||||
echo "Invalid ACS URL: $url"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
local wan=$1
|
||||
local discovery=0
|
||||
case $2 in
|
||||
enable|1) discovery=1 ;;
|
||||
esac
|
||||
local wan="${1}"
|
||||
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local enabled
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
local tropts="43"
|
||||
local oldreqopts="$reqopts"
|
||||
local ropt iopt
|
||||
local newreqopts=""
|
||||
local option43_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $tropts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
43) option43_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${option43_present} -eq 1 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
newreqopts="$reqopts 43"
|
||||
if [ $proto == "dhcp" ]; then
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
[ "$newreqopts" == "$oldreqopts" ] && return
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
fi
|
||||
########################################################
|
||||
}
|
||||
|
||||
wait_for_option43() {
|
||||
local time=$1
|
||||
local default_wan_interface dhcp_discovery url
|
||||
|
||||
config_get default_wan_interface cpe default_wan_interface "wan"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get url acs url
|
||||
|
||||
enable_dhcp_option43 $default_wan_interface $dhcp_discovery
|
||||
|
||||
local tm=0
|
||||
|
||||
if [ "$dhcp_discovery" == "enable" -o "$dhcp_discovery" == "1" ]
|
||||
then
|
||||
log "Waiting for discovery of ACS URL from dhcp server ..."
|
||||
while [ $tm -le $time ]
|
||||
do
|
||||
acs_url=`uci -P /var/state -q get cwmp.acs.dhcp_url`
|
||||
if [ "$acs_url" != "" ]
|
||||
then
|
||||
break
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
tm=$((tm+1))
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
wait_for_resolvfile() {
|
||||
@@ -142,55 +58,215 @@ wait_for_resolvfile() {
|
||||
}
|
||||
|
||||
set_wan_interface() {
|
||||
local wan_interface="${1}"
|
||||
local l3_device=""
|
||||
local default_wan_interface=""
|
||||
|
||||
config_get default_wan_interface cpe default_wan_interface "wan"
|
||||
json_load "$(ifstatus $default_wan_interface)"
|
||||
if [ -z "${wan_interface}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
json_load "$(ifstatus ${wan_interface})"
|
||||
json_get_var l3_device l3_device
|
||||
if [ "$l3_device" != "" ];then
|
||||
uci -q set cwmp.cpe.interface="$l3_device"
|
||||
if [ -n "$l3_device" ]; then
|
||||
uci -q set cwmp.cpe.interface="${l3_device}"
|
||||
uci -q commit cwmp
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ ! -f /tmp/.icwmpd_boot ]; then
|
||||
touch /etc/icwmpd/.icwmpd_boot
|
||||
touch /tmp/.icwmpd_boot
|
||||
else
|
||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /etc/config/wireless ] && log "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless
|
||||
[ -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
|
||||
[ -f /usr/sbin/asterisk ] && log "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk
|
||||
|
||||
config_load cwmp
|
||||
set_wan_interface
|
||||
wait_for_option43 20
|
||||
get_acs_url
|
||||
|
||||
procd_open_instance icwmp
|
||||
procd_set_param command "$PROG"
|
||||
if [ "$1" = "GetRPCMethods" ];then
|
||||
procd_append_param command -g
|
||||
elif [ -f /etc/icwmpd/.icwmpd_boot ]; then
|
||||
procd_append_param command -b
|
||||
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
|
||||
procd_set_param respawn \
|
||||
${respawn_threshold:-5} \
|
||||
${respawn_timeout:-10} ${respawn_retry:-3}
|
||||
|
||||
procd_close_instance
|
||||
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
|
||||
fi
|
||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]
|
||||
then
|
||||
mv /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
|
||||
fi
|
||||
if [ -f /var/run/icwmpd/icwmpd_backup_session.xml ]
|
||||
then
|
||||
cp /var/run/icwmpd/icwmpd_backup_session.xml /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
|
||||
fi
|
||||
}
|
||||
|
||||
validate_acs_section()
|
||||
{
|
||||
uci_validate_section cwmp acs "acs" \
|
||||
'passwd:string' \
|
||||
'periodic_inform_enable:bool' \
|
||||
'periodic_inform_interval:uinteger' \
|
||||
'periodic_inform_time:string' \
|
||||
'url: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'
|
||||
|
||||
}
|
||||
|
||||
validate_cpe_section()
|
||||
{
|
||||
uci_validate_section cwmp cpe "cpe" \
|
||||
'interface:string' \
|
||||
'default_wan_interface:string' \
|
||||
'log_to_console:or("enable","disable")' \
|
||||
'log_to_file:or("enable","disable")' \
|
||||
'log_severity:or("EMERG", "ALERT", "CRITIC" ,"ERROR", "WARNING", "NOTICE", "INFO", "DEBUG")' \
|
||||
'log_file_name:string' \
|
||||
'log_max_size:uinteger' \
|
||||
'userid:string' \
|
||||
'passwd:string' \
|
||||
'port:uinteger' \
|
||||
'provisioning_code:string:""' \
|
||||
'amd_version:range(1, 6)' \
|
||||
'instance_mode:or("InstanceNumber","InstanceAlias")' \
|
||||
'session_timeout:uinteger' \
|
||||
'notification:bool' \
|
||||
'exec_download:bool' \
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool' \
|
||||
'periodic_notify_interval:uinteger'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
config_load cwmp
|
||||
|
||||
validate_acs_section || {
|
||||
log "Validation of acs section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ -z "${url}" -a -z "${dhcp_url}" ] && {
|
||||
log "ACS url is empty can't start"
|
||||
return 1;
|
||||
}
|
||||
|
||||
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"
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool dhcp_discovery acs dhcp_discovery 1
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
|
||||
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
|
||||
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"
|
||||
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;
|
||||
}
|
||||
|
||||
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}
|
||||
|
||||
procd_set_param watch network.interface
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
log "Restarting CWMP client"
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_config_trigger "config.change" "cwmp" /etc/init.d/icwmpd reload
|
||||
procd_add_reload_trigger "cwmp"
|
||||
|
||||
procd_open_trigger
|
||||
json_add_array
|
||||
json_add_string "" "interface.update"
|
||||
json_add_array
|
||||
json_add_array
|
||||
json_add_string "" "run_script"
|
||||
json_add_string "" "/etc/icwmpd/update.sh"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
|
||||
# Get Manufacturer OUI.
|
||||
oui=$(uci -q get cwmp.cpe.manufacturer_oui)
|
||||
if [ -z "${oui}" ]; then
|
||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
||||
fi
|
||||
|
||||
# Get factory base MAC.
|
||||
baseMac=$(db -q get hw.board.basemac)
|
||||
|
||||
# Erase colon and space characters.
|
||||
baseMac=${baseMac//:/}
|
||||
baseMac=${baseMac// /}
|
||||
|
||||
# Caseing and fixed length string.
|
||||
mac=$(printf "%12.12X" $((0x$baseMac)))
|
||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
||||
|
||||
# Get system serial number.
|
||||
serial=$(db -q get hw.board.serial_number)
|
||||
serial=$(uci -q get cwmp.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)
|
||||
@@ -21,12 +21,12 @@ cpe_userid=$(uci -q get cwmp.cpe.userid)
|
||||
# Only set if they are empty
|
||||
if [ -z "$acs_userid" ]
|
||||
then
|
||||
uci -q set cwmp.acs.userid="${mac:0:6}-${serial}"
|
||||
uci -q set cwmp.acs.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
if [ -z "$cpe_userid" ]
|
||||
then
|
||||
uci -q set cwmp.cpe.userid="${mac:0:6}-${serial}"
|
||||
uci -q set cwmp.cpe.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
# No need for commit here, it is done by uci_apply_defaults().
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_cwmp_reqopts() {
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local wan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
local dhcp_discovery=$(uci -q get cwmp.acs.dhcp_discovery)
|
||||
local discovery=0
|
||||
case $dhcp_discovery in
|
||||
enable|1) discovery=1 ;;
|
||||
esac
|
||||
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
local tropts="43"
|
||||
local oldreqopts="$reqopts"
|
||||
local ropt iopt
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $tropts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
if [ "$proto" == "dhcp" ]; then
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
[ "$newreqopts" == "$oldreqopts" ] && return
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
fi
|
||||
}
|
||||
|
||||
regenerate_ssl_link(){
|
||||
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
|
||||
}
|
||||
|
||||
set_cwmp_reqopts
|
||||
regenerate_ssl_link
|
||||
18
icwmp/files/etc/uci-defaults/95-icwmp-generate-ssl
Normal file
18
icwmp/files/etc/uci-defaults/95-icwmp-generate-ssl
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/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 @@
|
||||
/etc/icwmpd/.icwmpd_backup_session.xml
|
||||
/var/run/icwmpd/icwmpd_backup_session.xml
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# As part of sysupgrade we copy CWMP Backup Session XML file.
|
||||
|
||||
|
||||
# Abort on any error.
|
||||
set -e
|
||||
|
||||
|
||||
# Do nothing if user want to discard old settings.
|
||||
if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Source functions.
|
||||
for f in /lib/upgrade/iopsys*.sh; do
|
||||
[ -r "$f" -a -s "$f" ] || continue
|
||||
source $f
|
||||
done
|
||||
|
||||
|
||||
if [ -s "${2}/etc/icwmpd/.icwmpd_backup_session.xml" ]; then
|
||||
cat "${2}/etc/icwmpd/.icwmpd_backup_session.xml" > "/etc/icwmpd/.icwmpd_backup_session.xml"
|
||||
fi
|
||||
|
||||
# Report success.
|
||||
log "post-hooks" "CWMP Backup Session XML file migrated"
|
||||
|
||||
exit 0
|
||||
@@ -6,5 +6,9 @@ config IEEE1905_EXTENSION_ALLOWED
|
||||
bool "Allow plugins to extend 1905 CMDUs and/or TLVs"
|
||||
default y
|
||||
|
||||
config IEEE1905_PLATFORM_HAS_WIFI
|
||||
bool "Platform has WiFi"
|
||||
default y if PACKAGE_libwifi
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
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
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=3.3.6
|
||||
PKG_VERSION:=4.6.19
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e224f6280173aa0e190f10d38aa0ae3714667c9b
|
||||
PKG_SOURCE_VERSION:=7267a76fafa264792415a1cdc697a9e47934a1e6
|
||||
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
|
||||
@@ -37,26 +37,30 @@ endef
|
||||
define Package/libieee1905
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE+= (library for CMDU and TLV handling)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl +libwifi \
|
||||
+libjson-c +libblobmsg-json
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libopenssl
|
||||
endef
|
||||
|
||||
define Package/ieee1905
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE+= ieee1905d (daemon implementing 1905.1 and provides cli)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl +libwifi \
|
||||
+libjson-c +libblobmsg-json +libwifi +ubus +libpthread \
|
||||
+libnl-genl +libieee1905
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ubus +libpthread \
|
||||
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi
|
||||
endef
|
||||
|
||||
|
||||
define Package/map-plugin
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE:=Multi-AP (Easymesh) plugin
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl +libwifi \
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+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
|
||||
@@ -68,8 +72,18 @@ endef
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -100,6 +114,7 @@ define Build/InstallDev/map-plugin
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map2.h $(1)/usr/include/map2.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map_module.h $(1)/usr/include/map_module.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/cntlrsync.h $(1)/usr/include/cntlrsync.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
endef
|
||||
@@ -110,6 +125,7 @@ define Build/InstallDev/libieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu_ackq.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/1905_tlvs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
|
||||
@@ -123,6 +139,11 @@ define Build/InstallDev
|
||||
$(call Build/InstallDev/map-plugin,$(1),$(2))
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/ieee1905/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,ieee1905))
|
||||
$(eval $(call BuildPackage,libieee1905))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
CONFIG_BUILD_NLS=y
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
@@ -18,7 +17,6 @@ CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_gre=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
@@ -26,6 +24,7 @@ CONFIG_PACKAGE_map-topology=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_ip-full=y
|
||||
@@ -189,8 +188,6 @@ CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
CONFIG_KERNEL_DEVTMPFS=y
|
||||
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
@@ -219,3 +216,7 @@ CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
# 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
|
||||
|
||||
@@ -14,7 +14,7 @@ function feeds_update {
|
||||
done
|
||||
|
||||
|
||||
git remote -v | grep -q http || developer=1
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ function genconfig {
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export THEMEDIR="tmp/juci-themes"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
@@ -14,12 +13,9 @@ function genconfig {
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
mediatek="target/linux/iopsys-mediatek"
|
||||
econet="target/linux/iopsys-econet"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
@@ -115,21 +111,15 @@ function genconfig {
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $mediatek/genconfig ] &&
|
||||
iopsys_mediatek=$(cd $mediatek; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $bcm27xx/genconfig ] &&
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_mediatek iopsys_econet iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -154,14 +144,6 @@ function genconfig {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_mediatek; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_mediatek"
|
||||
target_config_path="$mediatek/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_econet"
|
||||
@@ -170,14 +152,6 @@ function genconfig {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
target_config_path="$intel_mips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_x86"
|
||||
@@ -193,25 +167,10 @@ function genconfig {
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
target_config_path="$bcm27xx/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
endptAllowed=0
|
||||
|
||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||
}
|
||||
|
||||
v() {
|
||||
@@ -244,7 +203,7 @@ function genconfig {
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
@@ -261,7 +220,7 @@ function genconfig {
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
@@ -315,13 +274,6 @@ function genconfig {
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
|
||||
if [ ! -d "$THEMEDIR" ]; then
|
||||
mkdir -p $THEMEDIR
|
||||
elif [ -d "$THEMEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $THEMEDIR/*"
|
||||
rm -rf $THEMEDIR/*
|
||||
fi
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
@@ -366,32 +318,16 @@ function genconfig {
|
||||
echo "" >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
elif [ "$target" = "iopsys_ramips" ]; then
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
if [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_mediatek" ]; then
|
||||
subtarget="mt7622"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
@@ -410,11 +346,6 @@ function genconfig {
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/juci-theme" ]; then
|
||||
customer="$(echo $CUSTOMER | tr 'A-Z' 'a-z')"
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
@@ -430,11 +361,14 @@ function genconfig {
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
# Enable Pckage source tree override if selected
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
@@ -442,12 +376,8 @@ function genconfig {
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
# rewrite url to clone with ssh instead of http
|
||||
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
||||
[ $bcmAllowed -eq 0 ] && echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
else
|
||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
|
||||
@@ -9,14 +9,12 @@ function genconfig_min {
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
target_config_path=""
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
econet="target/linux/iopsys-econet"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
@@ -80,7 +78,7 @@ function genconfig_min {
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
local profile=$1
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
@@ -102,7 +100,7 @@ function genconfig_min {
|
||||
|
||||
if [ $pfound -eq 1 ]; then
|
||||
target="$(echo $TARGET | tr '-' '_')"
|
||||
config_path="$targetpath/config"
|
||||
target_config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
@@ -112,17 +110,15 @@ function genconfig_min {
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $bcm27xx/genconfig ] &&
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -134,7 +130,7 @@ function genconfig_min {
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
target_config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -142,15 +138,15 @@ function genconfig_min {
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
target_config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
target="iopsys_econet"
|
||||
target_config_path="$econet/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -158,7 +154,7 @@ function genconfig_min {
|
||||
for p in $iopsys_x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_x86"
|
||||
config_path="$x86/config"
|
||||
target_config_path="$x86/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -166,22 +162,13 @@ function genconfig_min {
|
||||
for p in $iopsys_armvirt; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_armvirt"
|
||||
config_path="$armvirt/config"
|
||||
target_config_path="$armvirt/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
config_path="$bcm27xx/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
@@ -210,7 +197,8 @@ function genconfig_min {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig dg400prime IOPSYS"
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
@@ -260,12 +248,12 @@ function genconfig_min {
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
@@ -312,41 +300,25 @@ function genconfig_min {
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
elif [ "$target" = "iopsys_ramips" ]; then
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
if [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_mediatek" ]; then
|
||||
subtarget="mt7622"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
@@ -368,21 +340,25 @@ function genconfig_min {
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
@@ -455,6 +431,8 @@ function genconfig_min {
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
|
||||
122
juci/Makefile
122
juci/Makefile
@@ -1,122 +0,0 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=juci
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/juci.git
|
||||
PKG_SOURCE_VERSION:=70b66bfc7f0e25e77b6920c3d44e5b05f4bfcf95
|
||||
PKG_VERSION:=2020-05-27
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
PKG_RELEASE=$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/juci
|
||||
$(Package/juci/default)
|
||||
SECTION:=juci
|
||||
CATEGORY:=JUCI
|
||||
MENU=1
|
||||
TITLE:=JUCI Core Package (select this to select default plugins)
|
||||
DEPENDS:=+libubox +libubus +owsd +rpcd +rpcd-mod-file +questd
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/src/
|
||||
ln -s $(PKG_BUILD_DIR) $(1)/usr/src/juci
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(call Build/Compile/Default,THEME_PATH="$(TOPDIR)/tmp/juci-themes/")
|
||||
endef
|
||||
|
||||
define Package/juci/description
|
||||
JUCI Javascript UCI Web interface.
|
||||
endef
|
||||
|
||||
define Package/juci/install
|
||||
$(INSTALL_DIR) $(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/juci/* $(1)/
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/juci/postinst
|
||||
#!/bin/sh
|
||||
|
||||
juci-update
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,juci))
|
||||
|
||||
####### Extensions / Themes and Plugins
|
||||
|
||||
define RegisterAddonInner
|
||||
define Package/$(2)
|
||||
SECTION:=juci
|
||||
CATEGORY:=JUCI
|
||||
TITLE:=default
|
||||
SUBMENU:=$(1)
|
||||
TITLE:=$(if $(3),$(3),JUCI $(2) plugin)
|
||||
DEPENDS:=$(4)
|
||||
endef
|
||||
|
||||
define Package/$(2)/install
|
||||
$(INSTALL_DIR) $$(1)/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/$(2)/* $$(1)/
|
||||
endef
|
||||
endef
|
||||
|
||||
define RegisterAddon
|
||||
$(eval $(call RegisterAddonInner,$(1),$(2),$(3),$(4),$(5)))
|
||||
$(eval $(call BuildPackage,$(2)))
|
||||
endef
|
||||
|
||||
$(eval $(call RegisterAddon,Plugins,juci-catv, CATV Module,@(PACKAGE_catv)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-cgroups, CGroups Module,@(PACKAGE_icgroupd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-ddns, DDNS Configuration,@(PACKAGE_ddns-scripts)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-diagnostics, Simple Diagnostics,@(PACKAGE_busybox)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-ndt, NDT Speed Test client,@(PACKAGE_ndt)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-dnsmasq-dhcp, DHCP/DNSMasq Configuration,@(PACKAGE_dnsmasq||PACKAGE_dnsmasq-full)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-dropbear, Dropbear Configuration,@(PACKAGE_dropbear)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-easyqos, Easy QoS module,@(PACKAGE_easy-qos)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-event, Event Module,@(PACKAGE_owsd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-firewall-fw3, Firewall Configuration,@(PACKAGE_firewall)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-icwmp, TR-069 Module,@(PACKAGE_icwmp)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-config-backup, Config Backup Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-qos, QoS module,@(PACKAGE_qos-scripts)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-voice-client, Asterisk Voice Client Module,@(PACKAGE_asterisk)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-minidlna, MiniDLNA Configuration,@(PACKAGE_minidlna)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mcproxy, Multicast Proxy Configuration,@(PACKAGE_mcproxy)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mod-status, Status Reporting Module,@(PACKAGE_questd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mod-system, System Administration Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-mwan3, mwan3 Configuration,@(PACKAGE_mwan3)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-natalie-dect, DECT Module,@(PACKAGE_dectmngr2)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-netmode, Netmode Module,@(PACKAGE_netmode)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-device, Network Device Configuration,@(PACKAGE_netifd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-dsl, DSL Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-netifd, Network Module,@(PACKAGE_netifd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-network-port, Ethernet Port Configuration,@(PACKAGE_port-management)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-openvpn, OpenVPN configuration,@(PACKAGE_openvpn)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-owsd, OWSD configuration,@(PACKAGE_owsd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-printer, p910nd Printer Server Configuration,@(PACKAGE_p910nd)))
|
||||
#$(eval $(call RegisterAddon,Plugins,juci-realtime-graphs, Realtime Graphs))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-samba, Samba Configuration,@(PACKAGE_samba3)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-sfp, SFP Configuration,@(PACKAGE_peripheral_manager)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-snmpd, SNMP Module,@(PACKAGE_snmpd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-sysupgrade, Sysupgrade Firmware Upgrade,@(PACKAGE_rpcd-mod-rpcsys)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-uhttpd, uHTTPD Configuration,@(PACKAGE_uhttpd)))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-upnp, UPnP Configuration Module,@(PACKAGE_miniupnpd)))
|
||||
#$(eval $(call RegisterAddon,Plugins,juci-usb, USB Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-wireless, Wireless Management Module))
|
||||
$(eval $(call RegisterAddon,Plugins,juci-wifilife, WiFi Life Module,@(PACKAGE_wifilife)))
|
||||
$(eval $(call RegisterAddon,Themes,juci-theme-iopsys))
|
||||
|
||||
####### dynamically publish themes as packages #######
|
||||
$(foreach th,$(wildcard $(TOPDIR)/tmp/juci-themes/*),$(eval $(call RegisterAddon,Themes,$(notdir $(th)))))
|
||||
@@ -1,66 +0,0 @@
|
||||
config juci 'juci'
|
||||
option homepage 'overview'
|
||||
option theme 'juci-theme-iopsys'
|
||||
option favicon 'favicon.ico'
|
||||
|
||||
config login 'login'
|
||||
option showusername '1'
|
||||
option defaultuser 'user'
|
||||
|
||||
config localization 'localization'
|
||||
option default_language 'en'
|
||||
list languages 'en'
|
||||
|
||||
config wiki 'wiki'
|
||||
option visible '0'
|
||||
option version 'v4.2.x'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget11WAN'
|
||||
list require 'ubus:network.interface'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget10Network'
|
||||
list require 'ubus:network.interface'
|
||||
list require 'ubus:router.network->hosts'
|
||||
|
||||
config widget
|
||||
list name 'overviewWidget00WiFi'
|
||||
list require 'ubus:wifi'
|
||||
list require 'ubus:wifi.wps'
|
||||
|
||||
config menu
|
||||
option path 'overview'
|
||||
option page 'overview'
|
||||
|
||||
config menu
|
||||
option path 'system'
|
||||
option page 'system'
|
||||
option redirect 'first'
|
||||
|
||||
config menu
|
||||
option path 'status'
|
||||
option page 'status'
|
||||
option redirect 'first'
|
||||
|
||||
config menu
|
||||
option path 'status/system'
|
||||
option page 'status-system'
|
||||
list require 'ubus:router.system->info'
|
||||
|
||||
config menu
|
||||
option path 'status/network'
|
||||
option page 'status-network'
|
||||
list require 'ubus:network.interface'
|
||||
|
||||
config menu
|
||||
option path 'status/dsl'
|
||||
option page 'network-dsl-status'
|
||||
list require 'ubus:dsl->stats'
|
||||
list require 'ubus:dsl->status'
|
||||
|
||||
config menu
|
||||
option path 'system/upgrade'
|
||||
option page 'settings-upgrade'
|
||||
list expose 'admin'
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
. /lib/functions.sh
|
||||
|
||||
START=94
|
||||
STOP=06
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=juci
|
||||
|
||||
start_service() {
|
||||
mkdir -p /tmp/juci
|
||||
touch /www/index.html.gz
|
||||
chmod 755 /www/cgi-bin/luci
|
||||
# this will simply update index.html to include any files that are for some reason not included
|
||||
# a good way to make sure all plugins are properly included at each boot
|
||||
config_load juci
|
||||
local theme
|
||||
config_get theme juci theme
|
||||
if [ "$theme" ]
|
||||
then
|
||||
if [ -f /www/themes/theme.js.gz ]
|
||||
then
|
||||
rm -f /www/themes/theme.js.gz
|
||||
fi
|
||||
if [ -f /www/themes/*$theme.js.gz ]
|
||||
then
|
||||
ln -s /www/themes/*$theme.js.gz /www/themes/theme.js.gz
|
||||
fi
|
||||
fi
|
||||
juci-update
|
||||
}
|
||||
|
||||
stop() {
|
||||
service_stop /sbin/juci
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger juci
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
USER_SECTION=""
|
||||
USER_EXISTS=0
|
||||
|
||||
find_user(){
|
||||
local section="$1"
|
||||
local user="$2"
|
||||
config_get username $section username
|
||||
if [ "$username" == "$user" ]; then
|
||||
USER_SECTION="$section"
|
||||
USER_EXISTS=1
|
||||
fi
|
||||
}
|
||||
|
||||
config_load rpcd
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login root
|
||||
if [ $USER_EXISTS -eq 1 ]; then
|
||||
uci delete rpcd.$USER_SECTION
|
||||
fi
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login admin
|
||||
if [ $USER_EXISTS -eq 0 ]; then
|
||||
uci -q add rpcd login >/dev/null
|
||||
uci -q set rpcd.@login[-1].username="admin"
|
||||
uci -q set rpcd.@login[-1].password="\$p\$admin"
|
||||
uci -q add_list rpcd.@login[-1].read="enduser"
|
||||
uci -q add_list rpcd.@login[-1].read="administrator"
|
||||
uci -q add_list rpcd.@login[-1].write="enduser"
|
||||
uci -q add_list rpcd.@login[-1].write="administrator"
|
||||
fi
|
||||
|
||||
USER_EXISTS=0
|
||||
config_foreach find_user login user
|
||||
if [ $USER_EXISTS -eq 0 ]; then
|
||||
uci -q add rpcd login >/dev/null
|
||||
uci -q set rpcd.@login[-1].username="user"
|
||||
uci -q set rpcd.@login[-1].password="\$p\$user"
|
||||
uci -q add_list rpcd.@login[-1].read="enduser"
|
||||
uci -q add_list rpcd.@login[-1].write="enduser"
|
||||
fi
|
||||
|
||||
uci commit rpcd
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"administrator": {
|
||||
"description": "Administrator Access Rights",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"file": [
|
||||
"write"
|
||||
],
|
||||
"rpc-sys": [
|
||||
"upgrade_start",
|
||||
"upgrade_test"
|
||||
]
|
||||
}
|
||||
},
|
||||
"write": {
|
||||
"file": {
|
||||
"/tmp/firmware.bin": ["write"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
{
|
||||
"enduser": {
|
||||
"description": "End User Access Rights",
|
||||
"read": {
|
||||
"ubus": {
|
||||
"dect": [
|
||||
"state",
|
||||
"handset",
|
||||
"status",
|
||||
"call"
|
||||
],
|
||||
"dsl": [
|
||||
"status",
|
||||
"stats"
|
||||
],
|
||||
"network.device": [
|
||||
"status"
|
||||
],
|
||||
"network.interface*": [
|
||||
"status",
|
||||
"dump",
|
||||
"up",
|
||||
"down"
|
||||
],
|
||||
"router.network": [
|
||||
"clients",
|
||||
"hosts",
|
||||
"dump"
|
||||
],
|
||||
"router.system": [
|
||||
"info",
|
||||
"memory",
|
||||
"filesystem",
|
||||
"process",
|
||||
"processes"
|
||||
],
|
||||
"session": [
|
||||
"access",
|
||||
"list",
|
||||
"destroy",
|
||||
"login"
|
||||
],
|
||||
"system": [
|
||||
"info",
|
||||
"board",
|
||||
"reboot"
|
||||
],
|
||||
"testnet": [
|
||||
"status"
|
||||
],
|
||||
"uci": [
|
||||
"*"
|
||||
],
|
||||
"voice.asterisk": [
|
||||
"status",
|
||||
"call_log",
|
||||
"platform",
|
||||
"supported_countries"
|
||||
],
|
||||
"wifi": [
|
||||
"status"
|
||||
],
|
||||
"wifi.ap.*": [
|
||||
"status",
|
||||
"stats",
|
||||
"assoclist",
|
||||
"stations"
|
||||
],
|
||||
"wifi.radio.*": [
|
||||
"status",
|
||||
"stats",
|
||||
"scan",
|
||||
"scanresults",
|
||||
"autochannel"
|
||||
],
|
||||
"wifi.wps": [
|
||||
"start",
|
||||
"stop",
|
||||
"status",
|
||||
"showpin"
|
||||
]
|
||||
},
|
||||
"uci": [
|
||||
"dhcp",
|
||||
"firewall",
|
||||
"juci",
|
||||
"network",
|
||||
"voice_client",
|
||||
"wireless"
|
||||
],
|
||||
"owsd": [
|
||||
"client",
|
||||
"wifi.radio",
|
||||
"wifi.sta",
|
||||
"wifi.wps"
|
||||
]
|
||||
},
|
||||
"write": {
|
||||
"uci": [
|
||||
"dhcp",
|
||||
"firewall",
|
||||
"network",
|
||||
"wireless"
|
||||
],
|
||||
"uci_granular": {
|
||||
"dhcp": [
|
||||
{
|
||||
"match": {
|
||||
".type": "dhcp"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "host"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"firewall": [
|
||||
{
|
||||
"match": {
|
||||
".type": "settings",
|
||||
".name": "settings"
|
||||
},
|
||||
"option": [
|
||||
"disabled"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "zone"
|
||||
},
|
||||
"option": [
|
||||
"masq",
|
||||
"name",
|
||||
"network"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "redirect"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "rule"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "dmz"
|
||||
},
|
||||
"option": [
|
||||
"enabled",
|
||||
"host",
|
||||
"ip6addr"
|
||||
]
|
||||
}
|
||||
],
|
||||
"network": [
|
||||
{
|
||||
"match": {
|
||||
".type": "interface"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"wireless": [
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-status"
|
||||
},
|
||||
"option": [
|
||||
"wps"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-iface",
|
||||
"mode": "ap"
|
||||
},
|
||||
"option": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"match": {
|
||||
".type": "wifi-device"
|
||||
},
|
||||
"option": [
|
||||
"channel"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"owsd": [
|
||||
"client",
|
||||
"wifi.radio",
|
||||
"wifi.sta",
|
||||
"wifi.wps"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
10
map-agent/Config.in
Normal file
10
map-agent/Config.in
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
|
||||
endmenu
|
||||
endif
|
||||
@@ -5,20 +5,21 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=5.1.3
|
||||
PKG_VERSION:=7.1.10
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=7d77f0ac5ecb5a5375a803d687d7cd4e37c68b49
|
||||
PKG_SOURCE_VERSION:=8d2fa1af3b0cbdb65f791b490e72c5925cccaa05
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-agent.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-agent
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_BUILD_DEPENDS:=map-plugin
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -30,12 +31,26 @@ define Package/map-agent
|
||||
+map-plugin
|
||||
endef
|
||||
|
||||
|
||||
define Package/dynbhd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dynamic Backhaul Daemon
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin +map-agent
|
||||
endef
|
||||
|
||||
|
||||
define Package/map-agent/description
|
||||
This package implements EasyMesh R2 compliant WiFi Agent.
|
||||
endef
|
||||
|
||||
define Package/dynbhd/description
|
||||
Dyanmic LAN/WAN port detection and loop avoidance.
|
||||
endef
|
||||
|
||||
define Package/map-agent/config
|
||||
#source "$(SOURCE)/Config.in"
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -43,6 +58,10 @@ 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
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
@@ -53,4 +72,21 @@ define Package/map-agent/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/dynbhd/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/lib/wifi/dynbhd
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/ethernet
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/dynbhd $(1)/usr/sbin/dynbhd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/api $(1)/lib/wifi/dynbhd/api
|
||||
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/map-dynamic-backhaul $(1)/etc/hotplug.d/ethernet/map-dynamic-backhaul
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/map-agent/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,map-agent))
|
||||
$(eval $(call BuildPackage,dynbhd))
|
||||
|
||||
@@ -4,7 +4,7 @@ config agent 'agent'
|
||||
option profile '2'
|
||||
option al_bridge 'br-lan'
|
||||
|
||||
#config fh-iface
|
||||
#config ap
|
||||
# option ifname 'wl0'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
@@ -17,15 +17,17 @@ config agent 'agent'
|
||||
# option steer_legacy_retry_secs '3600'
|
||||
# option assoc_ctrl_secs '30'
|
||||
# option band '2'
|
||||
# option type 'fronthaul'
|
||||
|
||||
#config fh-iface
|
||||
#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 bk-iface
|
||||
#config bsta
|
||||
# option ifname 'apclii0'
|
||||
# option enabled '1'
|
||||
# option onboarded '0'
|
||||
|
||||
49
map-agent/files/etc/hotplug.d/ethernet/map-dynamic-backhaul
Executable file
49
map-agent/files/etc/hotplug.d/ethernet/map-dynamic-backhaul
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
|
||||
|
||||
[ -z "$wan" ] && exit 1 # no configuration
|
||||
[ "$PORT" != "$wan" ] && exit 0
|
||||
|
||||
remove_from_bridge() {
|
||||
config_get ifname "$section" ifname
|
||||
|
||||
ubus call network.interface.$bridge remove_device '{"name":"$ifname"}'
|
||||
}
|
||||
|
||||
update_bstas() {
|
||||
local section="$1"
|
||||
local action="$2"
|
||||
local ifname onboarded
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get_bool enabled "$section" enabled 0
|
||||
|
||||
if [ "$action" = "down" ]; then
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
# wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
elif [ "$action" = "up" ]; then
|
||||
[ "$enabled" -eq 0 ] && return
|
||||
wpa_cli -i "$ifname" reconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" enable_network 0 > /dev/null 2>&1
|
||||
# wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
#touch "$MAPFILE"
|
||||
|
||||
config_load "mapagent"
|
||||
bridge=$(uci get mapagent.agent.al_bridge | cut -d '-' -f2)
|
||||
config_foreach remove_from_bridge bsta $bridge
|
||||
config_foreach update_bstas bsta down
|
||||
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT"
|
||||
else
|
||||
rm -f "$MAPFILE"
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bsta up
|
||||
fi
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
|
||||
[ -z "$wan" ] && exit 1 # no configuration
|
||||
[ "$PORT" != "$wan" ] && exit 0
|
||||
|
||||
update_bstas() {
|
||||
local section="$1"
|
||||
local action="$2"
|
||||
local ifname onboarded
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get_bool onboarded "$section" onboarded 0
|
||||
|
||||
[ "$onboarded" -eq 0 ] && return
|
||||
|
||||
wpa_cli -i "$ifname" "$action" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch /tmp/map.agent.bsta_global_disable
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bk-iface disconnect
|
||||
else
|
||||
rm -f /tmp/map.agent.bsta_global_disable
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bk-iface reconnect
|
||||
fi
|
||||
@@ -5,8 +5,200 @@ STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
|
||||
MAP_DEV="map_dev"
|
||||
MAP_IF="map"
|
||||
|
||||
create_map() {
|
||||
ip link add lei type veth peer name lei_map 2>/dev/null
|
||||
ip link add link lei name lei_lan type vlan id 1 2>/dev/null
|
||||
|
||||
uci -q set network.${MAP_DEV}=device
|
||||
uci -q set network.${MAP_DEV}.name=br-map
|
||||
uci -q set network.${MAP_DEV}.type=bridge
|
||||
|
||||
uci -q show network.${MAP_DEV}.ports | grep -q lei_map || {
|
||||
uci -q add_list network.${MAP_DEV}.ports='lei_map'
|
||||
}
|
||||
|
||||
uci -q set network.${MAP_IF}=interface
|
||||
uci -q set network.${MAP_IF}.device=br-map
|
||||
uci -q set network.${MAP_IF}.is_lan=1
|
||||
|
||||
uci -q show network.br_lan.ports | grep -q lei_lan || {
|
||||
uci -q add_list network.br_lan.ports="lei_lan"
|
||||
}
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-map
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.interface.map
|
||||
|
||||
brctl addif br-map lei_map 2>/dev/null
|
||||
brctl addif br-lan lei_lan 2>/dev/null
|
||||
|
||||
ip link set lei up 2>/dev/null
|
||||
ip link set lei_map up 2>/dev/null
|
||||
ip link set lei_lan up 2>/dev/null
|
||||
}
|
||||
|
||||
remove_map() {
|
||||
ip link delete ${MAP_VETH} &>/dev/null
|
||||
|
||||
uci -q delete network.${MAP_DEV}
|
||||
uci -q delete network.${MAP_IF}
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-lan
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
}
|
||||
|
||||
start_dynbhd_service() {
|
||||
rm -f /tmp/map.agent.bsta_global_disable
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/dynbhd"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
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'
|
||||
|
||||
[ "$?" -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)'
|
||||
|
||||
[ "$?" -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_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
|
||||
|
||||
[ "$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
|
||||
|
||||
@@ -16,6 +208,10 @@ 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 respawn
|
||||
@@ -24,9 +220,13 @@ start_service() {
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
#stop_service() {
|
||||
# remove_map
|
||||
#}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
procd_add_reload_trigger "mapagent"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -7,8 +7,14 @@
|
||||
# write_credentials - write bBSS credentials to fBSS
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/wifi/traffic_separation
|
||||
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
|
||||
diff=0
|
||||
onbrd_bssid=0
|
||||
onbrd_band=0
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
@@ -23,12 +29,42 @@ EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
type_to_multi_ap () {
|
||||
type="$1"
|
||||
|
||||
if [ "$type" = "backhaul" ]; then
|
||||
echo "1"
|
||||
return
|
||||
elif [ "$type" = "fronthaul" ]; then
|
||||
echo "2"
|
||||
return
|
||||
elif [ "$type" = "combined" ]; then
|
||||
echo "3"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "0"
|
||||
}
|
||||
|
||||
get_type_by_section() {
|
||||
section="$1"
|
||||
|
||||
config_get type $section type "0"
|
||||
|
||||
echo "$(type_to_multi_ap $type)"
|
||||
}
|
||||
|
||||
brcm_sync_credentials() {
|
||||
bands=""
|
||||
json_init
|
||||
mapagent_process_fh() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
|
||||
[ "$dev" != "$device" ] && return
|
||||
@@ -41,10 +77,21 @@ brcm_sync_credentials() {
|
||||
section=$(uci add ieee1905 ap)
|
||||
[ "$section" == "" ] && return
|
||||
|
||||
uci set ieee1905.${section}.band=$band
|
||||
uci set ieee1905.${section}.ssid=$ssid
|
||||
uci set ieee1905.${section}.encryption=$encryption
|
||||
uci set ieee1905.${section}.key=$key
|
||||
uci -q set ieee1905.${section}.band=$band
|
||||
uci -q set ieee1905.${section}.ssid="$ssid"
|
||||
uci -q set ieee1905.${section}.encryption=$encryption
|
||||
uci -q set ieee1905.${section}.key="$key"
|
||||
json_select "$band" > /dev/null
|
||||
if [ "$?" = "0" ]; then
|
||||
json_get_keys keys
|
||||
|
||||
for key in ${keys};
|
||||
do
|
||||
json_get_var val "$key"
|
||||
uci -q set ieee1905.${section}.$key="$val"
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
@@ -62,12 +109,43 @@ brcm_sync_credentials() {
|
||||
fi
|
||||
done
|
||||
|
||||
config_foreach mapagent_process_fh fh-iface $device
|
||||
config_foreach mapagent_process_fh ap $device
|
||||
bands="$bands $band"
|
||||
}
|
||||
|
||||
ieee1905_del_ap() {
|
||||
append_value() {
|
||||
local section=$1
|
||||
local key=$2
|
||||
shift
|
||||
shift
|
||||
|
||||
while [ "$key" != "" ]; do
|
||||
val=$(uci -q get ieee1905.$section.$key)
|
||||
[ "$val" = "" ] && {
|
||||
key=$1
|
||||
shift
|
||||
continue
|
||||
}
|
||||
json_add_string "$key" ${val}
|
||||
key=$1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
local section=$1
|
||||
local band
|
||||
|
||||
config_get band $section band
|
||||
json_select "$band" > /dev/null
|
||||
rc=$?
|
||||
[ "$rc" != "0" ] && json_add_object "$band"
|
||||
append_value $section "manufacturer" "model_name" "device_name" "model_number" "serial_number" "device_type" "os_version"
|
||||
if [ "$rc" != "0" ]; then
|
||||
json_close_object
|
||||
else
|
||||
json_select ..
|
||||
fi
|
||||
|
||||
uci -q delete ieee1905.${section}
|
||||
}
|
||||
@@ -76,12 +154,12 @@ brcm_sync_credentials() {
|
||||
config_foreach ieee1905_del_ap ap
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_process_radio wifi-radio
|
||||
config_foreach mapagent_process_radio radio
|
||||
|
||||
uci commit ieee1905
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
|
||||
brcm_write_credentials() {
|
||||
config_load mapagent
|
||||
|
||||
@@ -89,8 +167,8 @@ brcm_write_credentials() {
|
||||
write_wireless() {
|
||||
local section=$1
|
||||
local map_ifname=$2
|
||||
local bk_ssid=$3
|
||||
local bk_key=$4
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
@@ -98,24 +176,26 @@ brcm_write_credentials() {
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
#echo applying bk_ssid = $bk_ssid bk_key = $bk_key
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_ssid="$bk_ssid"
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_key="$bk_key"
|
||||
}
|
||||
config_load wireless
|
||||
|
||||
config_foreach write_wireless wifi-iface $1 $2 $3
|
||||
config_foreach write_wireless wifi-iface "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
mapagent_find_fbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
local bk_ssid=$3
|
||||
local bk_key=$4
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
config_get multi_ap $section multi_ap "0"
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
|
||||
@@ -124,18 +204,20 @@ brcm_write_credentials() {
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
#echo applying bk_ssid = $bk_ssid bk_key = $bk_key
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
$(mapagent_apply_wireless $ifname $bk_ssid $bk_key)
|
||||
echo $(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key") 2> /dev/null
|
||||
}
|
||||
|
||||
mapagent_find_bbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
config_get multi_ap $section multi_ap "0"
|
||||
config_get enabled $section enabled "1"
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
@@ -147,9 +229,9 @@ brcm_write_credentials() {
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
|
||||
#echo found ssid=$ssid key=$key
|
||||
#echo found ssid="$ssid" key="$key"
|
||||
|
||||
config_foreach mapagent_find_fbss fh-iface $dev $ssid $key
|
||||
config_foreach mapagent_find_fbss ap $dev "$ssid" "$key"
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
@@ -159,21 +241,38 @@ brcm_write_credentials() {
|
||||
|
||||
#echo found dev=$dev
|
||||
|
||||
config_foreach mapagent_find_bbss fh-iface $device
|
||||
config_foreach mapagent_find_bbss ap $device
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_process_radio wifi-radio
|
||||
config_foreach mapagent_process_radio radio
|
||||
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
brcm_set_network() {
|
||||
local ifname=$1
|
||||
local num=$2
|
||||
local bssid=$3
|
||||
|
||||
wpa_cli -i $ifname set_n $num bssid $bssid
|
||||
}
|
||||
|
||||
bsta_steer() {
|
||||
local ifname=$1
|
||||
local bssid=$2
|
||||
|
||||
wpa_cli -i $ifname set_n 0 bssid $bssid
|
||||
wpa_cli -i $ifname roam $bssid
|
||||
rc=$(wpa_cli -i $ifname set_n 0 bssid $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
|
||||
rc=$(wpa_cli -i $ifname roam $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
write_bsta_config() {
|
||||
@@ -181,6 +280,7 @@ write_bsta_config() {
|
||||
|
||||
#echo diff = $diff > /dev/console
|
||||
|
||||
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wl_bsta() {
|
||||
@@ -193,7 +293,7 @@ write_bsta_config() {
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
#echo setting diff = $diff > /dev/console
|
||||
uci set wireless.${section}.bssid=$bssid
|
||||
uci -q set wireless.${section}.bssid=$bssid
|
||||
echo 1
|
||||
}
|
||||
config_load wireless
|
||||
@@ -206,6 +306,7 @@ write_bsta_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
|
||||
|
||||
config_get ifname $section ifname
|
||||
#echo bsta = $bsta > /dev/console
|
||||
|
||||
@@ -213,15 +314,43 @@ write_bsta_config() {
|
||||
#echo found ifname=$ifname > /dev/console
|
||||
|
||||
config_get bssid $section bssid
|
||||
config_get band $section band
|
||||
ret=$(mapagent_apply_wl_bsta $ifname $bssid)
|
||||
[ "$ret" == "1" ] && diff=1
|
||||
[ "$ret" == "1" ] && {
|
||||
diff=1
|
||||
onbrd_bssid=$bssid
|
||||
onbrd_band=$band
|
||||
}
|
||||
}
|
||||
|
||||
mapagent_apply_bssid_same_band() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
|
||||
config_foreach mapagent_process_bk bk-iface $ifname
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
uci -q set wireless.${section}.bssid=$bssid
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onbrd_band" != "$band" -o "$onboarded" = "1" ] && return
|
||||
|
||||
config_get ifname $1 ifname
|
||||
|
||||
config_load wireless
|
||||
config_foreach apply_config wifi-iface $ifname $onbrd_bssid
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
config_foreach mapagent_process_bk bsta $ifname
|
||||
|
||||
#echo result diff = $diff > /dev/console
|
||||
[ "$diff" == "1" ] && {
|
||||
config_foreach mapagent_apply_bssid_same_band bsta
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
#echo reloading wireless > /dev/console
|
||||
}
|
||||
@@ -258,6 +387,9 @@ brcm_teardown_iface() {
|
||||
local section=$1
|
||||
local iface=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$iface" != "$ifname" ] && return
|
||||
@@ -272,13 +404,378 @@ brcm_teardown_iface() {
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_teardown_bss fh-iface $iface
|
||||
config_foreach mapagent_teardown_bss ap $iface
|
||||
|
||||
uci commit wireless
|
||||
uci commit mapagent
|
||||
}
|
||||
|
||||
brcm_bsta_to_wireless() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_find_lowest_prio_onboarded() {
|
||||
mapagent_process_bk() {
|
||||
config_get priority $1 priority "2"
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onboarded" = "0" ] && return
|
||||
|
||||
if [ -z "$sec" -o "$prio" = "-1" -o "$priority" -lt "$prio" ]; then
|
||||
sec=$1
|
||||
prio=$priority
|
||||
fi
|
||||
}
|
||||
|
||||
local sec=""
|
||||
local prio="-1"
|
||||
|
||||
config_foreach mapagent_process_bk bsta
|
||||
echo $sec
|
||||
}
|
||||
|
||||
mapagent_enable_best() {
|
||||
#echo 1=$1 best=$best > /dev/console
|
||||
if [ "$1" = "$best" ]; then
|
||||
uci -q set mapagent.$1.enabled='1'
|
||||
else
|
||||
uci -q set mapagent.$1.enabled='0'
|
||||
fi
|
||||
}
|
||||
|
||||
mapagent_bsta_to_wireless() {
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
local ssid="$3"
|
||||
local key="$4"
|
||||
local encryption=$5
|
||||
local enabled=$6
|
||||
local bssid=$7
|
||||
local disabled="0"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ -z "$enabled" -o "$enabled" = "0" ] && disabled="1"
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
|
||||
uci -q set wireless.${section}.ssid="$ssid"
|
||||
uci -q set wireless.${section}.key="$key"
|
||||
uci -q set wireless.${section}.encryption=$encryption
|
||||
uci -q set wireless.${section}.bssid="$bssid"
|
||||
#uci -q set wireless.${section}.disabled=$disabled
|
||||
|
||||
[ "$disabled" != "1" ] && return
|
||||
wpa_cli -i "$bsta" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$bsta" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$bsta" save_config > /dev/null 2>&1
|
||||
|
||||
echo 1
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $@
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
mapagent_find_other_creds() {
|
||||
#echo "trying to find other creds for $2" > /dev/console
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$3" != "$band" -o "$onboarded" = "0" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
config_get enabled $1 enabled "0"
|
||||
config_get bssid $1 bssid
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $2 "$ssid" "$key" $encryption $4 "$bssid")
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
config_get ifname $1 ifname
|
||||
config_get onboarded $1 onboarded "0"
|
||||
config_get enabled $1 enabled "0"
|
||||
|
||||
if [ "$onboarded" = "0" ]; then
|
||||
config_foreach mapagent_find_other_creds bsta $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")
|
||||
fi
|
||||
}
|
||||
|
||||
# best=$(mapagent_find_lowest_prio_onboarded)
|
||||
#
|
||||
# [ -z "$best" ] && return
|
||||
#
|
||||
# band=$1
|
||||
# sec=""
|
||||
# prio=""
|
||||
#
|
||||
# config_foreach mapagent_enable_best bsta $best
|
||||
# uci commit mapagent
|
||||
config_load mapagent
|
||||
|
||||
diff=$(config_foreach mapagent_bsta_to_wireless bsta)
|
||||
|
||||
# [ "$diff" != "" ] && {
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
sync_mapcontroller_from_wireless() {
|
||||
ubus -t 5 wait_for wifi
|
||||
[ "$?" != "0" ] && return
|
||||
|
||||
[ ! -f "/etc/config/wireless" ] && return
|
||||
|
||||
status=$(ubus -S call wifi status)
|
||||
|
||||
device_to_band() {
|
||||
local ifname=$1
|
||||
json_load "$status"
|
||||
json_select "radios"
|
||||
json_get_keys keys
|
||||
|
||||
for key in $keys; do
|
||||
json_select $key
|
||||
json_get_var name name
|
||||
|
||||
if [ "$name" != "$ifname" ]; then
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
|
||||
json_get_var band band
|
||||
|
||||
if [ "$band" == "5GHz" ]; then
|
||||
echo "5"
|
||||
elif [ "$band" == "2.4GHz" ]; then
|
||||
echo "2"
|
||||
fi
|
||||
|
||||
break
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
wireless_process_iface() {
|
||||
local section=$1
|
||||
local type="ap"
|
||||
local enabled="1"
|
||||
|
||||
config_get multi_ap $section multi_ap 0
|
||||
[ "$multi_ap" != "1" ] && [ "$multi_ap" != "2" ] && return
|
||||
|
||||
config_get mode $section mode "ap"
|
||||
[ "$mode" != "ap" ] && return
|
||||
|
||||
config_get device $section device
|
||||
band=$(device_to_band $device)
|
||||
[ "$band" == "" ] && return
|
||||
|
||||
config_get ssid $section ssid
|
||||
config_get key $section key
|
||||
config_get encryption $section encryption
|
||||
config_get start_disabled $section start_disabled "0"
|
||||
config_get network $section network
|
||||
|
||||
|
||||
cntlr_section=$(uci add mapcontroller ${type})
|
||||
uci -q set mapcontroller.${cntlr_section}.ssid="$ssid"
|
||||
uci -q set mapcontroller.${cntlr_section}.key="$key"
|
||||
uci -q set mapcontroller.${cntlr_section}.encryption="$encryption"
|
||||
uci -q set mapcontroller.${cntlr_section}.band="$band"
|
||||
uci -q set mapcontroller.${cntlr_section}.vid="1"
|
||||
uci -q set mapcontroller.${cntlr_section}.network="$network"
|
||||
|
||||
[ "$multi_ap" == "1" ] && map_type="backhaul" || map_type="fronthaul"
|
||||
uci -q set mapcontroller.${cntlr_section}.type="$map_type"
|
||||
|
||||
[ "$start_disabled" == "1" ] && enabled="0"
|
||||
uci -q set mapcontroller.${cntlr_section}.enabled="$enabled"
|
||||
}
|
||||
|
||||
mapcontroller_teardown() {
|
||||
local section=$1
|
||||
|
||||
uci delete mapcontroller.$1
|
||||
}
|
||||
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_teardown ap
|
||||
|
||||
config_load wireless
|
||||
config_foreach wireless_process_iface wifi-iface
|
||||
uci commit mapcontroller
|
||||
}
|
||||
|
||||
bsta_scan_on_enabled() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_enable_bk() {
|
||||
config_get ifname $1 ifname
|
||||
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
|
||||
}
|
||||
|
||||
config_foreach mapagent_enable_bk bsta
|
||||
}
|
||||
|
||||
bsta_enable_all() {
|
||||
mapagent_enable_bk() {
|
||||
config_get ifname $1 ifname "2"
|
||||
uci -q set mapagent.$1.enabled="1"
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
|
||||
config_foreach mapagent_enable_bk bsta
|
||||
uci commit mapagent
|
||||
bsta_scan_on_enabled
|
||||
}
|
||||
|
||||
bsta_disable_lower_priority() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_get_priority() {
|
||||
config_get ifname $1 ifname
|
||||
|
||||
[ "$ifname" != "$2" ] && return
|
||||
|
||||
config_get priority $1 priority "2"
|
||||
|
||||
echo "$priority"
|
||||
}
|
||||
|
||||
mapagent_disable_lower_bk() {
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section="$1"
|
||||
local bsta="$2"
|
||||
local enabled="$3"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
|
||||
[ "$enabled" != "0" ] && return
|
||||
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
local ifname="$1"
|
||||
local enabled="$2"
|
||||
|
||||
[ "$enabled" != "0" ] && return
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $ifname $enabled
|
||||
}
|
||||
|
||||
local enabled="1"
|
||||
|
||||
config_get ifname $1 ifname
|
||||
config_get priority $1 priority
|
||||
|
||||
[ "$ifname" != "$2" -a "$priority" -gt "$3" ] && enabled="0"
|
||||
|
||||
uci -q set mapagent.$1.enabled="$enabled"
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
|
||||
prio=$(config_foreach mapagent_get_priority bsta $bsta)
|
||||
#echo bsta $bsta has prio $prio > /dev/console
|
||||
|
||||
config_foreach mapagent_disable_lower_bk bsta $bsta $prio
|
||||
uci commit mapagent
|
||||
|
||||
# ubus call uci commit '{"config":"wireless"}'
|
||||
}
|
||||
|
||||
|
||||
bsta_use_link() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_disable_bk() {
|
||||
local bsta="$2"
|
||||
|
||||
config_get ifname $1 ifname
|
||||
config_get enabled $1 enabled
|
||||
|
||||
[ "$bsta" = "$ifname" ] && return
|
||||
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
|
||||
config_foreach mapagent_disable_bk bsta $bsta
|
||||
}
|
||||
|
||||
bsta_swap_to_link() {
|
||||
bsta_disable_lower_priority $1
|
||||
bsta_use_link $1
|
||||
|
||||
wpa_cli -i "$1" enable_network 0 > /dev/null
|
||||
wpa_cli -i "$1" reconnect > /dev/null
|
||||
wpa_cli -i "$1" save_config > /dev/null
|
||||
}
|
||||
|
||||
set_uplink_backhaul_info() {
|
||||
local ul_1905id=$1
|
||||
local ul_mac=$2
|
||||
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_add_string "backhaul_device_id" "$ul_1905id"
|
||||
json_add_string "backhaul_macddr" "$ul_mac"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
set_uplink() {
|
||||
local type=$1
|
||||
local ifname=$2
|
||||
local hwaddr
|
||||
|
||||
hwaddr="$(ifconfig $ifname | grep -i hwaddr | awk '{print $5}' | awk '{print tolower($0)}')"
|
||||
|
||||
json_init
|
||||
json_add_string "type" "$type"
|
||||
json_add_string "ifname" "$ifname"
|
||||
json_add_string "macaddr" "$hwaddr"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
unset_uplink() {
|
||||
rm "$MAPFILE" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
func=$1
|
||||
shift
|
||||
@@ -290,8 +787,20 @@ case "$func" in
|
||||
write_credentials) brcm_write_credentials;;
|
||||
sync_credentials) brcm_sync_credentials;;
|
||||
bsta_steer) bsta_steer $@;;
|
||||
set_network) brcm_set_network $@;;
|
||||
write_bsta_config) write_bsta_config $@;;
|
||||
teardown_iface) brcm_teardown_iface $@;;
|
||||
bsta_to_wireless) brcm_bsta_to_wireless $@;;
|
||||
sync_mapcontroller_from_wireless) sync_mapcontroller_from_wireless $@;;
|
||||
ts) ts_sub $@;;
|
||||
bsta_enable_all) bsta_enable_all $@;;
|
||||
bsta_disable_lower_priority) bsta_disable_lower_priority $@;;
|
||||
bsta_scan_on_enabled) bsta_scan_on_enabled $@;;
|
||||
bsta_use_link) bsta_use_link $@;;
|
||||
bsta_swap_to_link) bsta_swap_to_link $@;;
|
||||
set_uplink) set_uplink $@;;
|
||||
set_uplink_backhaul_info) set_uplink_backhaul_info $@;;
|
||||
unset_uplink) unset_uplink $@;;
|
||||
--help|help) usage;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
|
||||
511
map-agent/files/lib/wifi/traffic_separation
Executable file
511
map-agent/files/lib/wifi/traffic_separation
Executable file
@@ -0,0 +1,511 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
### Traffic Separation ###
|
||||
|
||||
dbg() {
|
||||
logger -t traffic_separation $@
|
||||
}
|
||||
|
||||
ts_sub() {
|
||||
|
||||
ts_usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [create|delete|populate|primary|reload]
|
||||
Traffic Separation related functions.
|
||||
create fh <iface> <vid> - create vlan device and rules for wifi fronthaul
|
||||
create bh <iface> <vid> <profile> - create vlan device and rules for wifi backhaul
|
||||
create eth <iface> <vid> <pbits> - create vlan device and rules for logical ethernet interface
|
||||
delete <iface> - delete vlan device
|
||||
populate eth <iface> <vid> - add secondary network rules for logical ethernet interface
|
||||
primary get <iface> - read primary VID for interface from driver (from Association Response frame IE)
|
||||
reload - reload network with new configuration
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_get_bridge() {
|
||||
local bridge=$(ip link show $1 | grep -o "master [^\s]*" | cut -d ' ' -f 2)
|
||||
echo $bridge
|
||||
}
|
||||
|
||||
set_wireless_bridge() {
|
||||
config_load wireless
|
||||
|
||||
_set_network() {
|
||||
local sec=$1
|
||||
local iface=$2
|
||||
local bridge=$3
|
||||
|
||||
config_get ifname $sec ifname
|
||||
[ "$iface" != "$ifname" ] && continue
|
||||
|
||||
config_get mode $sec mode
|
||||
config_get multi_ap $sec multi_ap "0"
|
||||
[ "$mode" = "sta" -a "$multi_ap" = "1" ] && continue
|
||||
|
||||
config_get network $sec network
|
||||
local new_network=${bridge##br-}
|
||||
if [ "$new_network" != "$network" ] ; then
|
||||
uci -q set wireless.${sec}.network=${new_network}
|
||||
uci commit wireless
|
||||
fi
|
||||
|
||||
brctl addif $bridge $iface &> /dev/null
|
||||
}
|
||||
|
||||
config_foreach _set_network wifi-iface ${1} ${2}
|
||||
}
|
||||
|
||||
ts_create() {
|
||||
|
||||
_create_vlan_dev() {
|
||||
iface=$1 # real iface
|
||||
vid=$2 # Vlan ID
|
||||
bridge=$3 # bridge iface should be connected
|
||||
vlan_dev=$4
|
||||
|
||||
old_bridge="$(_get_bridge $iface)" # bridge iface is connected to
|
||||
|
||||
# remove interface from bridge if it is in one
|
||||
[ -n "$old_bridge" ] && brctl delif $old_bridge $iface &> /dev/null
|
||||
|
||||
# (re)create vlan device
|
||||
ip link show $vlan_dev && vlanctl --if-delete $vlan_dev
|
||||
vlanctl --mcast --if-create-name $iface $vlan_dev --if $iface --set-if-mode-rg
|
||||
|
||||
vlanctl --if $iface --tx --tags 0 --default-miss-drop
|
||||
vlanctl --if $iface --tx --tags 1 --default-miss-drop
|
||||
vlanctl --if $iface --tx --tags 2 --default-miss-drop
|
||||
vlanctl --if $iface --rx --tags 0 --default-miss-drop
|
||||
vlanctl --if $iface --rx --tags 1 --default-miss-drop
|
||||
vlanctl --if $iface --rx --tags 2 --default-miss-drop
|
||||
|
||||
# bring the vlan device up and add back to bridge if it was in one
|
||||
brctl addif $bridge $vlan_dev &> /dev/null
|
||||
}
|
||||
|
||||
ts_create_fh() {
|
||||
iface=$1 # fh iface
|
||||
vid=$2 # SSID specific (secondary) or primary vid
|
||||
bridge=$3
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding FH device requires IFACE, VID and bridge
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
#set_wireless_bridge $iface $bridge
|
||||
|
||||
vlan_dev=${iface}_vlan${vid}
|
||||
ip link set $vlan_dev down
|
||||
_create_vlan_dev $iface $vid $bridge $vlan_dev
|
||||
|
||||
# add rules
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x886c --set-rxif $vlan_dev --rule-append # incoming brcm
|
||||
|
||||
# EAPOL frames
|
||||
vlanctl --if $iface --rx --tags 0 --filter-ethertype 34958 --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --rx --tags 1 --filter-ethertype 34958 --pop-tag --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --tx --tags 0 --filter-txif $vlan_dev --filter-ethertype 34958 --rule-append
|
||||
|
||||
# 8021q vlan id TAG/UNTAG
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --filter-vid $vid 0 --pop-tag --dscp2pbits 0 --rule-append
|
||||
|
||||
ip link set $iface up
|
||||
ip link set $vlan_dev up
|
||||
}
|
||||
|
||||
ts_create_bh() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
bridge=$4 # bridge interface should be connected to
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
#[ -n "$bridge" ] && set_wireless_bridge $iface $bridge
|
||||
|
||||
old_vid=$(wl -i $1 map_8021q_settings)
|
||||
old_vid=${old_vid##* }
|
||||
old_profile=$(wl -i $1 map_profile | cut -d ' ' -f 3)
|
||||
|
||||
[ "$old_vid" = "$vid" -a "$old_profile" = "$profile" ] && return
|
||||
|
||||
wl vlan_mode 0 &> /dev/null # make sure this is OFF, else driver won't handle vlan
|
||||
wl -i $iface down &> /dev/null
|
||||
wl -i $iface map_profile $profile &> /dev/null # only has effect on profile 2
|
||||
wl -i $iface map_8021q_settings $vid &> /dev/null # can only be set on bBSS (read-only on bSTA)
|
||||
wl -i $iface up &> /dev/null
|
||||
}
|
||||
|
||||
ts_create_lei() {
|
||||
vid=$1 # primary vid
|
||||
pbits=$2 # default pbits to apply
|
||||
vlan_bridge=$3 # name of ts subsystem bridge
|
||||
lan_bridge=$4 # name of node local bridge
|
||||
|
||||
[ -n "$vid" ] && [ -n "$pbits" ] && [ -n "$vlan_bridge" ] && [ -n "$lan_bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
ip link show lei &> /dev/null || {
|
||||
ip link add link lei name lei_lan type vlan id 1 2>/dev/null
|
||||
}
|
||||
|
||||
old_vid=$(ip -d link show lei_lan | sed -n 's/vlan.*id \([0-9][0-9]*\) .*/\1/p')
|
||||
|
||||
[ "$old_vid" != "$vid" ] && {
|
||||
ip link del lei_lan
|
||||
ip link add link lei name lei_lan type vlan id ${vid}
|
||||
}
|
||||
|
||||
brctl addif ${lan_bridge} lei_lan &>/dev/null
|
||||
brctl addif ${vlan_bridge} lei_map &>/dev/null
|
||||
|
||||
ip link set lei up
|
||||
ip link set lei_map up
|
||||
ip link set lei_lan up
|
||||
}
|
||||
|
||||
_create_eth() {
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # primary vid
|
||||
bridge=$3 # name of ts subsystem bridge
|
||||
pbits=0
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
dbg create $@
|
||||
|
||||
ip link set $iface down
|
||||
|
||||
vlan_dev=${iface}_vlan${vid}
|
||||
ip link set $vlan_dev down
|
||||
_create_vlan_dev $iface $vid $bridge $vlan_dev
|
||||
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --set-pbits $pbits 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
|
||||
[ $# -le 3 ] && exit 0
|
||||
shift 3
|
||||
|
||||
while [ -n "$1" ] ; do
|
||||
vid=$1
|
||||
vlanctl --if $iface --rx --tags 1 --filter-vid $vid 0 --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --rule-append
|
||||
shift
|
||||
done
|
||||
|
||||
ip link set $iface up
|
||||
ip link set $vlan_dev up
|
||||
}
|
||||
|
||||
ts_create_eths() {
|
||||
pvid=$1 # primary vid
|
||||
bridge=$2 # name of ts subsystem bridge
|
||||
|
||||
shift 2
|
||||
# TODO use ieee1905 bridge
|
||||
for iface in $(uci get network.br_lan.ports) ; do
|
||||
[ "$iface" = "lei_lan" ] && continue
|
||||
_create_eth $iface $pvid $bridge $@
|
||||
ubus call ieee1905 del_interface "{\"ifname\":\"$iface\"}"
|
||||
done
|
||||
}
|
||||
|
||||
ts_create_dhcp() {
|
||||
local diff=""
|
||||
|
||||
_net_setup() {
|
||||
local name=$1
|
||||
local devname=$2
|
||||
local vid=$3
|
||||
|
||||
[ -z "$(uci -q get network.${name})" ] && {
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="$devname"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
uci -q set network.${name}.proto="static"
|
||||
# TODO vid > 255
|
||||
local ip_addr="192.168.${vid}.1"
|
||||
[ "${vid}" = "1" ] && ip_addr="192.168.${vid}.2"
|
||||
uci -q set network.${name}.ipaddr="${ip_addr}"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ "$diff" = "1" ] && uci -q commit network
|
||||
}
|
||||
|
||||
_br_setup() {
|
||||
local name=$1
|
||||
local sinkname=$2
|
||||
local vid=$3
|
||||
|
||||
[ -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
|
||||
}
|
||||
|
||||
_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"
|
||||
|
||||
diff="1"
|
||||
uci -q commit dhcp
|
||||
}
|
||||
|
||||
_firewall_setup() {
|
||||
local name=$1
|
||||
local network=$2
|
||||
local zone_exist=0
|
||||
|
||||
config_load firewall
|
||||
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local new_name=$2
|
||||
local name
|
||||
|
||||
config_get name $section name
|
||||
|
||||
[ "$name" == "$new_name" ] && zone_exist=1
|
||||
}
|
||||
|
||||
config_foreach _process_zone zone $name
|
||||
|
||||
[ "$zone_exist" != "0" ] && return
|
||||
|
||||
uci -q add firewall zone
|
||||
uci -q set firewall.@zone[-1].name="$name"
|
||||
uci -q add_list firewall.@zone[-1].network="$network"
|
||||
uci -q set firewall.@zone[-1].input='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].output='ACCEPT'
|
||||
uci -q set firewall.@zone[-1].forward='ACCEPT'
|
||||
|
||||
uci -q add firewall forwarding
|
||||
uci -q set firewall.@forwarding[-1].src="$name"
|
||||
uci -q set firewall.@forwarding[-1].dest="wan"
|
||||
|
||||
diff="1"
|
||||
uci -q commit firewall
|
||||
}
|
||||
|
||||
vid=$1 # primary vid
|
||||
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
VID required to configure DHCP.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
ip link show sink${vid} || {
|
||||
ip link add sink${vid} type veth peer name sink${vid}_vlan
|
||||
ip link add link sink${vid} name sink${vid}_peer type vlan id ${vid}
|
||||
}
|
||||
|
||||
ip link set sink${vid} up
|
||||
ip link set sink${vid}_peer up
|
||||
ip link set sink${vid}_vlan up
|
||||
|
||||
diff=""
|
||||
_net_setup sink${vid} sink${vid}_peer ${vid}
|
||||
_dhcp_setup sink${vid}
|
||||
_firewall_setup lan${vid} sink${vid}
|
||||
|
||||
[ "$diff" = "1" ] && {
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.interface.sink${vid}
|
||||
}
|
||||
|
||||
brctl addif br-map sink${vid}_vlan &> /dev/null
|
||||
}
|
||||
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
case "$type" in
|
||||
fh) ts_create_fh $@;;
|
||||
bh) ts_create_bh $@;;
|
||||
lei) ts_create_lei $@;;
|
||||
eths) ts_create_eths $@;;
|
||||
dhcp) ts_create_dhcp $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_delete() {
|
||||
iface=$1
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 0
|
||||
|
||||
vlan_dev=${path##*upper_}
|
||||
bridge="$(_get_bridge $vlan_dev)"
|
||||
|
||||
[ -n "$bridge" ] && {
|
||||
vlanctl --if-delete $vlan_dev # note: also removes rules and removes from bridge
|
||||
brctl addif $bridge $iface &> /dev/null # needed to add again
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ts_populate() {
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
[ "$type" == "eth" ] || {
|
||||
cat <<EOF
|
||||
Populating ETH rules requires IFACE and VID.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # secondary vid
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 1
|
||||
vlan_dev=${path##*upper_}
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
ts_primary() {
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
get) vid=$(wl -i $1 map_8021q_settings); echo ${vid##* };;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_unicast() {
|
||||
local mac=$1
|
||||
local iface=$2
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "$mac" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d "$mac" -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d "$mac" -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
ts_multicast() {
|
||||
local iface=$1
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "1:80:C2:00:00:13" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -D BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
ts_reload() {
|
||||
local dhcp_reload=$1
|
||||
|
||||
# workaround for missing backhaul wifi.ap.* ubus obj's:
|
||||
# iterate in config and setup bh
|
||||
config_load wireless
|
||||
|
||||
_setup_bh_iface() {
|
||||
local sec=$1
|
||||
local iface=$2
|
||||
local bridge=$3
|
||||
|
||||
config_get ifname $sec ifname
|
||||
|
||||
config_get mode $sec mode
|
||||
config_get multi_ap $sec multi_ap "0"
|
||||
[ "$mode" = "ap" -a "$multi_ap" = "1" ] && {
|
||||
ts_create bh $ifname 1 2 br-map
|
||||
}
|
||||
}
|
||||
|
||||
config_foreach _setup_bh_iface wifi-iface
|
||||
|
||||
[ -n "dhcp_reload" ] && /etc/init.d/dnsmasq reload
|
||||
|
||||
# another workaround for netif? removed
|
||||
# sink devices for br-map bridge
|
||||
for sink in $(ubus list network.interface.sink*) ; do
|
||||
local sink_vlan=${sink/network.interface./}_vlan
|
||||
brctl addif br-map $sink_vlan &> /dev/null
|
||||
done
|
||||
}
|
||||
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
create) dbg "create $@"; ts_create $@;;
|
||||
delete) dbg "delete $@"; ts_delete $@;;
|
||||
populate) dbg "populate $@"; ts_populate $@;;
|
||||
primary) dbg "primary $@"; ts_primary $@;;
|
||||
unicast) dbg "unicast $@"; ts_unicast $@;;
|
||||
multicast) dbg "multicast $@"; ts_multicast $@;;
|
||||
reload) dbg "reload $@"; ts_reload $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
10
map-controller/Config.in
Normal file
10
map-controller/Config.in
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
|
||||
endmenu
|
||||
endif
|
||||
@@ -5,20 +5,20 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.0.4
|
||||
PKG_VERSION:=6.0.5
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=7ff209e575f4a07eecbd7a21f903f27e49c48574
|
||||
PKG_SOURCE_VERSION:=3562b7f774e6dffda2e58ad2acb382fc439273fb
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-controller.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-controller
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
PKG_BUILD_DEPENDS:=map-plugin
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -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,6 +44,10 @@ TARGET_CFLAGS += \
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG),y)
|
||||
TARGET_CFLAGS += -DCONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
endif
|
||||
|
||||
define Package/map-controller/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/* $(1)/
|
||||
@@ -51,4 +55,10 @@ define Package/map-controller/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapcontroller $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/map-controller/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,map-controller))
|
||||
|
||||
@@ -2,43 +2,66 @@ config controller 'controller'
|
||||
option enabled '1'
|
||||
option registrar '5 2' #bands on which wps registrar supported
|
||||
option debug '6'
|
||||
option al_bridge 'br-lan'
|
||||
option enable_sta_steer '0'
|
||||
option enable_bsta_steer '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
|
||||
config vlan 'lan'
|
||||
option network 'lan'
|
||||
option id '1'
|
||||
config interface 'lan'
|
||||
option 'dhcp'
|
||||
|
||||
config fh-credentials
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net5'
|
||||
option vlan '1'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
|
||||
config fh-credentials
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net2'
|
||||
# option bk_ssid 'multiap_ssid123'
|
||||
# option bk_key 'multiap_key123'
|
||||
option vlan '1'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
|
||||
config bk-credentials
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae'
|
||||
option key '5555555555'
|
||||
option ssid 'map-bkhaul-5'
|
||||
option multi_ap '2'
|
||||
option type 'backhaul'
|
||||
option disallow_bsta '1' # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
option vlan '1'
|
||||
option vid '1'
|
||||
option network 'lan'
|
||||
|
||||
|
||||
config bk-credentials
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'psk2'
|
||||
option encryption 'sae'
|
||||
option key '2222222222'
|
||||
option ssid 'map-bkhaul-2'
|
||||
option multi_ap '2'
|
||||
option disallow_bsta '0' # 0 or 1 profile-1 bSTA
|
||||
option vlan '1'
|
||||
list disallow_bsta '0' # 0 or 1 profile-1 bSTA
|
||||
option vid '1'
|
||||
option type 'backhaul'
|
||||
option network 'lan'
|
||||
|
||||
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
|
||||
|
||||
@@ -5,6 +5,8 @@ STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
IS_CFG_VALID=1
|
||||
|
||||
handle_controller_select() {
|
||||
local section="$1"
|
||||
|
||||
@@ -12,10 +14,122 @@ 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'
|
||||
|
||||
[ "$?" -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
|
||||
|
||||
@@ -48,6 +162,8 @@ reload_service() {
|
||||
config_get_bool enabled controller enabled 1
|
||||
if [ "$enabled" -eq 0 ]; then
|
||||
stop
|
||||
# Start but without instance so reload trigger works.
|
||||
start
|
||||
return
|
||||
fi
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=2.1.8
|
||||
PKG_VERSION:=3.2.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=68c8ebb9ffd72873bb35971b9ea854a6c1e1df5c
|
||||
PKG_SOURCE_VERSION:=ddf78cca217ebfa83733a532bdd2d17b6c3af54e
|
||||
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
|
||||
@@ -30,7 +30,9 @@ define Package/map-topology
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Package/map-topology/description
|
||||
Constructs network topology and show it as json structure over UBUS
|
||||
|
||||
@@ -5,7 +5,72 @@ 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'
|
||||
|
||||
[ "$?" -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
|
||||
|
||||
@@ -59,9 +59,6 @@ mld_p_up_interfaces=""
|
||||
mld_p_down_interfaces=""
|
||||
mld_p_exceptions=""
|
||||
|
||||
# Standard parameters need by BCM's multicast daemon
|
||||
allow_brdevice=0
|
||||
|
||||
proxdevs=""
|
||||
ethwan="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
@@ -170,6 +167,36 @@ config_mcast_querier_params() {
|
||||
echo "${protocol}-last-member-query-interval $last_mem_q_int" >> $CONFFILE
|
||||
}
|
||||
|
||||
config_snooping_upstream_interface() {
|
||||
local snooping_upstream_intf=""
|
||||
|
||||
json_load "$(devstatus $1)"
|
||||
logger -t "mcastconf" "$(devstatus $1)"
|
||||
itr=1
|
||||
json_select bridge-members
|
||||
|
||||
# loop over the bridge and find the device on wan port
|
||||
while json_get_var dev $itr; do
|
||||
case "$dev" in
|
||||
*.*)
|
||||
port="$(echo "$dev" | cut -d'.' -f 1)"
|
||||
if [ $port == $ethwan ]; then
|
||||
ifconfig $dev | grep RUNNING >/dev/null && $snooping_upstream_intf="$dev" && break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
itr=$(($itr + 1))
|
||||
done
|
||||
json_select ..
|
||||
|
||||
# if none of the bridge members are on wan port, set the wan port itself
|
||||
if [ -n "$snooping_upstream_intf" ]; then
|
||||
echo "upstream-interface $snooping_upstream_intf" >>$CONFFILE
|
||||
else
|
||||
echo "upstream-interface $ethwan" >>$CONFFILE
|
||||
fi
|
||||
}
|
||||
|
||||
config_snooping_on_bridge() {
|
||||
local protocol="$1"
|
||||
local bcm_mcast_p=1
|
||||
@@ -187,39 +214,6 @@ config_snooping_on_bridge() {
|
||||
done
|
||||
}
|
||||
|
||||
handle_bridged_proxy_interface() {
|
||||
local p2="$1"
|
||||
local p_enable=0
|
||||
|
||||
if [ "$p2" == "igmp" ]; then
|
||||
p_enable=$igmp_p_enable
|
||||
else
|
||||
p_enable=$mld_p_enable
|
||||
fi
|
||||
|
||||
if [ $p_enable -eq 1 -a $allow_brdevice -eq 1 ]
|
||||
then
|
||||
proxdevs="$proxdevs $2"
|
||||
echo "upstream-interface $2" >>$CONFFILE
|
||||
else
|
||||
json_load "$(devstatus $2)"
|
||||
itr=1
|
||||
json_select bridge-members
|
||||
while json_get_var dev $itr; do
|
||||
case "$dev" in
|
||||
*.*)
|
||||
port="$(echo "$dev" | cut -d'.' -f 1)"
|
||||
if [ $port == $ethwan ]; then
|
||||
ifconfig $dev | grep RUNNING >/dev/null && proxdevs="$proxdevs $dev" && break
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
itr=$(($itr + 1))
|
||||
done
|
||||
json_select ..
|
||||
fi
|
||||
}
|
||||
|
||||
config_mcast_proxy_interface() {
|
||||
local itr
|
||||
local p1="$1"
|
||||
@@ -234,7 +228,8 @@ config_mcast_proxy_interface() {
|
||||
for proxif in $2; do
|
||||
case "$proxif" in
|
||||
br-*)
|
||||
handle_bridged_proxy_interface $p1 $proxif
|
||||
proxdevs="$proxdevs $proxif"
|
||||
echo "upstream-interface $proxif" >>$CONFFILE
|
||||
;;
|
||||
*)
|
||||
ifconfig $proxif | grep RUNNING >/dev/null && proxdevs="$proxdevs $proxif"
|
||||
@@ -246,7 +241,12 @@ config_mcast_proxy_interface() {
|
||||
echo "${p1}-proxy-interfaces $proxdevs" >> $CONFFILE
|
||||
fi
|
||||
|
||||
[ -n "$proxdevs" ] && echo "${p1}-mcast-interfaces $proxdevs" >> $CONFFILE
|
||||
# if proxdevs is empty set the wan port as mcast-interface
|
||||
if [ -n "$proxdevs" ]; then
|
||||
echo "${p1}-mcast-interfaces $proxdevs" >> $CONFFILE
|
||||
else
|
||||
echo "${p1}-mcast-interfaces $ethwan" >> $CONFFILE
|
||||
fi
|
||||
}
|
||||
|
||||
configure_mcpd_snooping() {
|
||||
@@ -259,14 +259,14 @@ configure_mcpd_snooping() {
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
config_snooping_common_params $protocol $igmp_s_version $igmp_s_robustness $igmp_s_mode
|
||||
config_mcast_querier_params $protocol $igmp_s_query_interval $igmp_s_q_resp_interval $igmp_s_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol "$igmp_s_iface"
|
||||
config_snooping_upstream_interface "$igmp_s_iface"
|
||||
config_snooping_on_bridge $protocol $igmp_s_iface $igmp_s_mode
|
||||
exceptions=$igmp_s_exceptions
|
||||
fast_leave=$igmp_s_fast_leave
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
config_snooping_common_params $protocol $mld_s_version $mld_s_robustness $mld_s_mode
|
||||
config_mcast_querier_params $protocol $mld_s_query_interval $mld_s_q_resp_interval $mld_s_last_mem_q_int
|
||||
config_mcast_proxy_interface $protocol "$mld_s_iface"
|
||||
config_snooping_upstream_interface "$mld_s_iface"
|
||||
config_snooping_on_bridge $protocol $mld_s_iface $mld_s_mode
|
||||
exceptions=$mld_s_exceptions
|
||||
fast_leave=$mld_s_fast_leave
|
||||
@@ -458,7 +458,7 @@ read_mcast_stats() {
|
||||
case $line in
|
||||
br-*)
|
||||
found_ip=0
|
||||
grp_ip="$(echo $line | awk -F ' ' '{ print $9 }')"
|
||||
grp_ip="$(echo $line | awk -F ' ' '{ print $10 }')"
|
||||
if [ -z "$mcast_addrs" ]; then
|
||||
mcast_addrs="$grp_ip"
|
||||
continue
|
||||
@@ -510,7 +510,7 @@ read_mcast_stats() {
|
||||
if [ "$snoop_iface" != "$intf" ]; then
|
||||
continue
|
||||
fi
|
||||
grp_ip="$(echo $line | awk -F ' ' '{ print $9 }')"
|
||||
grp_ip="$(echo $line | awk -F ' ' '{ print $10 }')"
|
||||
if [ "$grp_ip" != "$gip_addr" ]; then
|
||||
continue
|
||||
fi
|
||||
@@ -523,12 +523,12 @@ read_mcast_stats() {
|
||||
fi
|
||||
|
||||
json_add_object ""
|
||||
host_ip="$(echo $line | awk -F ' ' '{ print $13 }')"
|
||||
host_ip="$(echo $line | awk -F ' ' '{ print $14 }')"
|
||||
h_ip="$(ipcalc.sh $host_ip | grep IP | awk '{print substr($0,4)}')"
|
||||
json_add_string "ipaddr" "$h_ip"
|
||||
src_port="$(echo $line | awk -F ' ' '{ print $2 }')"
|
||||
json_add_string "device" "$src_port"
|
||||
timeout="$(echo $line | awk -F ' ' '{ print $14 }')"
|
||||
timeout="$(echo $line | awk -F ' ' '{ print $15 }')"
|
||||
json_add_int "timeout" "$timeout"
|
||||
json_close_object #close the associated device object
|
||||
;;
|
||||
|
||||
@@ -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,71 @@
|
||||
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 /etc/netmodes/.last_mode 2>/dev/null)"
|
||||
# Return if desired mode is same as last saved mode
|
||||
[ "$mode" == "$lastmode" ] && return
|
||||
|
||||
# Save mode as last mode
|
||||
echo "$mode" > /etc/netmodes/.last_mode
|
||||
|
||||
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
|
||||
|
||||
|
||||
42
obudpst/Makefile
Normal file
42
obudpst/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# Copyright (c) 2020, Broadband Forum
|
||||
# Copyright (c) 2020, AT&T Communications
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obudpst
|
||||
PKG_VERSION:=7.2.1
|
||||
PKG_SOURCE_VERSION:=9c448095c9773bd7e5cea143af07817ad9f3c6ba
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/BroadbandForum/obudpst.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/obudpst
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS+=+libopenssl
|
||||
TITLE:=Open Broadband-UDP Speed Test (OB-UDPST)
|
||||
endef
|
||||
|
||||
define Build/Install
|
||||
:
|
||||
endef
|
||||
|
||||
define Package/obudpst/description
|
||||
Open Broadband-UDP Speed Test (OB-UDPST) is a client/server software utility to demonstrate
|
||||
one approach of doing IP capacity measurements described by Broadband Forum TR-471.
|
||||
endef
|
||||
|
||||
define Package/obudpst/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/udpst $(1)/usr/sbin/udpst
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obudpst))
|
||||
@@ -1,5 +1,7 @@
|
||||
if PACKAGE_obuspa
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config OBUSPA_MTP_ENABLE_STOMP
|
||||
bool "Enable STOMP as mtp protocol"
|
||||
default y
|
||||
@@ -11,5 +13,5 @@ config OBUSPA_MTP_ENABLE_MQTT
|
||||
config OBUSPA_MTP_ENABLE_COAP
|
||||
bool "Enable CoAP as mtp protocol"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=4.1.0.1
|
||||
PKG_VERSION:=4.1.0.18
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=bb552093a94b0e6afd01a815cfad08236b2ea7e2
|
||||
PKG_SOURCE_VERSION:=af3d4663d66942e3b0e3253375c5620629769aa5
|
||||
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
|
||||
@@ -29,6 +29,7 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/obuspa
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
DEPENDS:=+libopenssl +libcurl +libsqlite3 +libubox +libubus +uspd +libmosquitto
|
||||
endef
|
||||
@@ -80,13 +81,11 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
|
||||
$(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_BIN) ./files/etc/hotplug.d/iface/85-obuspa $(1)/etc/hotplug.d/iface/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
config obuspa 'global'
|
||||
option enabled '1'
|
||||
option interface 'wan'
|
||||
#option ifname 'eth0.1'
|
||||
option debug '0'
|
||||
option interface 'loopback'
|
||||
#option ifname 'lo'
|
||||
option debug '1'
|
||||
option log_level '1'
|
||||
option prototrace '0'
|
||||
#option db_file '/etc/obuspa/usp.db'
|
||||
#option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
@@ -46,7 +47,7 @@ config subscription
|
||||
# option Description 'Request to get Administrative access'
|
||||
# option role_name 'full_access'
|
||||
# option Enable '1'
|
||||
# option Value 'admin'
|
||||
# option Value 'YWRtaW4='
|
||||
# option Retries 2
|
||||
# option LockoutPeriod 60
|
||||
|
||||
@@ -54,6 +55,6 @@ config subscription
|
||||
# option Description 'Request to get User access'
|
||||
# option role_name 'user'
|
||||
# option Enable '1'
|
||||
# option Value 'user'
|
||||
# option Value 'dXNlcg=='
|
||||
# option Retries 3
|
||||
# option LockoutPeriod 30
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$(uci -q get obuspa.global.interface)" == "$INTERFACE" ] || exit 0
|
||||
|
||||
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
|
||||
[ "$ACTION" = ifupdate -a -z "$IFUPDATE_ADDRESSES" ] && exit 0
|
||||
|
||||
/etc/init.d/obuspa reload
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=2
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/obuspa
|
||||
|
||||
EXTRA_COMMANDS="remove_db"
|
||||
EXTRA_HELP=" remove_db Removes obuspa persistent db before restarting, self trigger with uci change"
|
||||
|
||||
PARAM_FILE="/tmp/obuspa_param_reset.txt"
|
||||
CONFIGURATION=obuspa
|
||||
PARAM_FILE="/tmp/obuspa_param_reset.txt"
|
||||
KEEP_FILES="/lib/upgrade/keep.d/obuspa"
|
||||
USP_TEMP_FILE="/tmp/usp.tmp"
|
||||
controller_num=0
|
||||
@@ -19,6 +17,7 @@ subs_num=0
|
||||
challenge_num=0
|
||||
index=0
|
||||
role_def_file=""
|
||||
PROFILE="/root/.profile"
|
||||
|
||||
. /lib/functions/network.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
@@ -43,6 +42,19 @@ db_set() {
|
||||
fi
|
||||
}
|
||||
|
||||
update_keep() {
|
||||
keep_file=${1}
|
||||
|
||||
if [ -z "${keep_file}" ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
grep -q "${keep_file}" ${KEEP_FILES}
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo ${keep_file} >> ${KEEP_FILES}
|
||||
fi
|
||||
}
|
||||
|
||||
get_index() {
|
||||
index=$(( index + 1 ))
|
||||
if [ "$1" = "$2" ]; then
|
||||
@@ -55,7 +67,7 @@ get_role_index_from_json() {
|
||||
local num=0
|
||||
|
||||
# In case of role is empty or file not present
|
||||
if [ -z "${role}" -o ! -f ${role_def_file} ]; then
|
||||
if [ -z "${role}" -o ! -f "${role_def_file}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
@@ -86,7 +98,7 @@ get_role_index_from_json() {
|
||||
get_uci_ref_index() {
|
||||
local val;
|
||||
|
||||
[ -f ${USP_TEMP_FILE} ] && rm -f ${USP_TEMP_FILE}
|
||||
[ -f "${USP_TEMP_FILE}" ] && rm -f ${USP_TEMP_FILE}
|
||||
|
||||
index=0
|
||||
config_load $CONFIGURATION
|
||||
@@ -111,6 +123,7 @@ validate_obuspa_section()
|
||||
'interface:string' \
|
||||
'ifname:string:br-lan' \
|
||||
'debug:bool:false' \
|
||||
'prototrace:bool:false' \
|
||||
'log_level:uinteger' \
|
||||
'log_dest:string' \
|
||||
'db_file:string' \
|
||||
@@ -121,7 +134,6 @@ validate_localagent_section()
|
||||
{
|
||||
uci_validate_section ${CONFIGURATION} localagent "${1}" \
|
||||
'Enable:bool:true' \
|
||||
'ParameterName:string:Device.DeviceInfo.SoftwareVersion' \
|
||||
'EndpointID:string'
|
||||
}
|
||||
|
||||
@@ -141,6 +153,7 @@ validate_controller_section()
|
||||
'Reference:string' \
|
||||
'Destination:string:controller-notify-dest' \
|
||||
'Topic:string' \
|
||||
'ParameterName:list(string)' \
|
||||
'coap_host:host' \
|
||||
'coap_path:string' \
|
||||
'coap_port:port' \
|
||||
@@ -210,9 +223,55 @@ validate_mqtt_client_section()
|
||||
'ConnectRetryMaxInterval:uinteger:60'
|
||||
}
|
||||
|
||||
get_oui_from_db() {
|
||||
local oui="$(db get device.deviceinfo.ManufacturerOUI)"
|
||||
|
||||
echo "${oui}"
|
||||
}
|
||||
|
||||
get_serial_from_db() {
|
||||
local serial="$(db get device.deviceinfo.SerialNumber)"
|
||||
|
||||
# this can encoded further
|
||||
echo "${serial}"
|
||||
}
|
||||
|
||||
publish_endpoint() {
|
||||
local AgentEndpointID serial oui user pass
|
||||
local opt=""
|
||||
|
||||
# return if mosquitto_pub is not present
|
||||
if [ ! "$(which mosquitto_pub)" ]; then
|
||||
log "mosquitto_pub not present can't publish EndpointID"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# Get endpoint id from obuspa config first
|
||||
config_load obuspa
|
||||
config_get AgentEndpointID localagent EndpointID ""
|
||||
if [ -z "${AgentEndpointID}" ]; then
|
||||
serial=$(get_serial_from_db)
|
||||
oui=$(get_oui_from_db)
|
||||
AgentEndpointID="os::${oui}-${serial}"
|
||||
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}
|
||||
}
|
||||
|
||||
configure_localagent() {
|
||||
local Enable ParameterName EndpointID
|
||||
local _num
|
||||
|
||||
validate_localagent_section 'localagent' || {
|
||||
log "Validation of localagent section failed"
|
||||
@@ -223,14 +282,6 @@ configure_localagent() {
|
||||
db_set Device.LocalAgent.EndpointID "${EndpointID}"
|
||||
fi
|
||||
|
||||
_num=1
|
||||
while [ ${_num} -le ${controller_num} ]
|
||||
do
|
||||
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.Enable "${Enable}"
|
||||
db_set Device.LocalAgent.Controller.${_num}.BootParameter.1.ParameterName "${ParameterName}"
|
||||
_num=$(( ${_num} + 1 ))
|
||||
done
|
||||
|
||||
db_set
|
||||
}
|
||||
|
||||
@@ -254,17 +305,17 @@ configure_controller() {
|
||||
return 1;
|
||||
fi
|
||||
|
||||
if [ -z ${Reference} ]; then
|
||||
if [ ${Protocol} = "STOMP" ]; then
|
||||
if [ -z "${Reference}" ]; then
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
val=$(get_uci_ref_index stomp ${stomp})
|
||||
if [ ${val} -eq 0 ]; then
|
||||
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
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
val=$(get_uci_ref_index mqtt ${mqtt})
|
||||
if [ ${val} -eq 0 ]; then
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Not able to find the referred mqtt section"
|
||||
return 1;
|
||||
fi
|
||||
@@ -314,6 +365,17 @@ configure_controller() {
|
||||
log "Unsupported Protocol ${Protocol}"
|
||||
fi
|
||||
|
||||
local param
|
||||
local _pnum=1
|
||||
|
||||
for param in ${ParameterName}
|
||||
do
|
||||
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 ))
|
||||
done
|
||||
|
||||
db_set
|
||||
}
|
||||
|
||||
@@ -330,9 +392,9 @@ configure_subscription(){
|
||||
log "No recipient for subscription"
|
||||
fi
|
||||
|
||||
if [ -z ${Recipient} ]; then
|
||||
if [ -z "${Recipient}" ]; then
|
||||
val=$(get_uci_ref_index controller ${controller})
|
||||
if [ ${val} -eq 0 ]; then
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Not able to find the referred controller section"
|
||||
return 1;
|
||||
fi
|
||||
@@ -366,9 +428,9 @@ validate_challenge_section()
|
||||
check_json_load()
|
||||
{
|
||||
local ret=0
|
||||
if [ -f ${role_def_file} ]; then
|
||||
if [ -f "${role_def_file}" ]; then
|
||||
json_init
|
||||
json_load_file ${role_def_file} 2>&1 |grep -q Failed
|
||||
json_load_file "${role_def_file}" 2>&1 |grep -q Failed
|
||||
if [ $? -eq 0 ]; then # In case of invalid json file
|
||||
log "failed to load [${role_def_file}]"
|
||||
ret=1
|
||||
@@ -412,7 +474,7 @@ configure_challenges() {
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ -z "${role_name}" -a -z ${Role} ]; then
|
||||
if [ -z "${role_name}" -a -z "${Role}" ]; then
|
||||
log "Either role_name or Role must defined for a challenge";
|
||||
return 1;
|
||||
fi
|
||||
@@ -448,17 +510,17 @@ configure_mtp() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if [ -z ${Reference} ]; then
|
||||
if [ ${Protocol} = "STOMP" ]; then
|
||||
if [ -z "${Reference}" ]; then
|
||||
if [ "${Protocol}" = "STOMP" ]; then
|
||||
val=$(get_uci_ref_index stomp ${stomp})
|
||||
if [ ${val} -eq 0 ]; then
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Referred stomp section not found"
|
||||
return 1;
|
||||
fi
|
||||
Reference="Device.STOMP.Connection.${val}"
|
||||
elif [ ${Protocol} = "MQTT" ]; then
|
||||
elif [ "${Protocol}" = "MQTT" ]; then
|
||||
val=$(get_uci_ref_index mqtt ${mqtt})
|
||||
if [ ${val} -eq 0 ]; then
|
||||
if [ "${val}" -eq 0 ]; then
|
||||
log "Referred mqtt section not found"
|
||||
return 1;
|
||||
fi
|
||||
@@ -554,7 +616,7 @@ configure_mqtt_client(){
|
||||
|
||||
|
||||
configure_obuspa() {
|
||||
local enabled trust_cert ifname interface debug log_level db_file log_dest role_file
|
||||
local enabled trust_cert ifname interface debug prototrace log_level db_file log_dest role_file
|
||||
|
||||
validate_obuspa_section "global" || {
|
||||
log "Validation of global section failed"
|
||||
@@ -563,15 +625,18 @@ configure_obuspa() {
|
||||
|
||||
role_def_file="${role_file}"
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
if [ "${debug}" -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ "${debug}" -eq 1 -a "${prototrace}" -eq 1 ]; then
|
||||
procd_append_param command -p
|
||||
fi
|
||||
|
||||
if [ -n ${log_level} ]; then
|
||||
if [ "${debug}" -eq 1 -a -n "${log_level}" ]; then
|
||||
procd_append_param command -v ${log_level}
|
||||
fi
|
||||
|
||||
@@ -580,28 +645,37 @@ configure_obuspa() {
|
||||
fi
|
||||
|
||||
if [ -n "${interface}" ]; then
|
||||
network_get_device ifname ${interface}
|
||||
log "ifname from ${interface} is ${ifname}"
|
||||
network_get_physdev ifname ${interface}
|
||||
fi
|
||||
|
||||
# Set this variable for root user and obuspa -c tool
|
||||
grep -q "export USP_BOARD_IFNAME=${ifname}" /root/.profile || \
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" >> /root/.profile
|
||||
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}
|
||||
fi
|
||||
else
|
||||
echo "export USP_BOARD_IFNAME=${ifname}" > ${PROFILE}
|
||||
fi
|
||||
|
||||
if [ -n "${db_file}" ]; then
|
||||
echo "${db_file}" >>${KEEP_FILES}
|
||||
update_keep "${db_file}"
|
||||
procd_append_param command -f ${db_file}
|
||||
fi
|
||||
|
||||
if [ -n "${trust_cert}" ]; then
|
||||
echo "${trust_cert}" >>${KEEP_FILES}
|
||||
update_keep "${trust_cert}"
|
||||
if [ -f "${trust_cert}" ]; then
|
||||
procd_append_param command -t ${trust_cert}
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "${client_cert}" ]; then
|
||||
echo "${client_cert}" >>${KEEP_FILES}
|
||||
update_keep "${client_cert}"
|
||||
if [ -f "${client_cert}" ]; then
|
||||
procd_append_param command -a ${client_cert}
|
||||
fi
|
||||
@@ -612,10 +686,6 @@ configure_obuspa() {
|
||||
|
||||
# Create factory reset file
|
||||
db_init() {
|
||||
[ -f ${PARAM_FILE} ] && rm -f ${PARAM_FILE}
|
||||
[ -f /tmp/usp.db ] && rm -f /tmp/usp.db
|
||||
[ -f ${KEEP_FILES} ] && rm -f ${KEEP_FILES}
|
||||
|
||||
# Load configuration
|
||||
config_load $CONFIGURATION
|
||||
config_foreach configure_obuspa obuspa
|
||||
@@ -630,26 +700,8 @@ db_init() {
|
||||
db_set Internal.Reboot.Cause "LocalFactoryReset"
|
||||
}
|
||||
|
||||
# if uci changes for obuspa remove persistent db and then reload
|
||||
remove_db() {
|
||||
local db_file
|
||||
|
||||
config_load obuspa
|
||||
config_get db_file global db_file
|
||||
|
||||
log "Removing db file (${db_file})"
|
||||
[ -f ${db_file} ] && rm -f ${db_file}
|
||||
|
||||
sed -i "g/export USP_BOARD_IFNAME/d" /root/.profile
|
||||
|
||||
log "Restarting service"
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus -t 10 wait_for usp.raw
|
||||
procd_running ${CONFIGURATION}
|
||||
publish_endpoint
|
||||
}
|
||||
|
||||
start_service() {
|
||||
@@ -663,12 +715,6 @@ start_service() {
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus wait_for usp.raw
|
||||
if [ "$?" -ne 0 ]; then
|
||||
log "OBUSPA failed to start usp.raw not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
procd_set_param command ${PROG}
|
||||
db_init
|
||||
@@ -682,7 +728,19 @@ start_service() {
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
local db_file
|
||||
|
||||
config_load obuspa
|
||||
config_get db_file global db_file
|
||||
|
||||
${PROG} -c stop 2>&1 >/dev/null
|
||||
|
||||
if [ -z "${db_file}" ]; then
|
||||
db_file="/tmp/usp.db"
|
||||
fi
|
||||
|
||||
[ -f "${db_file}" ] && rm -f ${db_file}
|
||||
[ -f "${PARAM_FILE}" ] && rm -f ${PARAM_FILE}
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
@@ -691,8 +749,7 @@ reload_service() {
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "uspd" "mosquitto"
|
||||
procd_add_config_trigger "config.change" "${CONFIGURATION}" /etc/init.d/obuspa remove_db
|
||||
procd_add_reload_trigger "obuspa" "mosquitto"
|
||||
|
||||
# Create a reload trigger if schema update avaialble
|
||||
procd_open_trigger
|
||||
@@ -711,13 +768,7 @@ service_triggers() {
|
||||
json_add_string "" "reload"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "1000"
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
|
||||
|
||||
# local interface
|
||||
# config_load obuspa
|
||||
# config_get interface global interface
|
||||
# [ -n "$interface" ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/obuspa reload
|
||||
}
|
||||
|
||||
@@ -2,19 +2,6 @@
|
||||
|
||||
[ "$ACTION" = ifup ] || exit 0
|
||||
|
||||
handle_interface() {
|
||||
ifname=$(uci get network.$1.ifname)
|
||||
|
||||
case "$ifname" in
|
||||
@*)
|
||||
alias_interface="$1 $alias_interface"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
config_load network
|
||||
config_foreach handle_interface "interface"
|
||||
|
||||
compare_owsd_iface() {
|
||||
local interface
|
||||
|
||||
@@ -24,13 +11,6 @@ compare_owsd_iface() {
|
||||
/etc/init.d/owsd reload
|
||||
exit
|
||||
fi
|
||||
|
||||
for i in $alias_interface; do
|
||||
if [ "$INTERFACE" == "$i" ]; then
|
||||
/etc/init.d/owsd reload
|
||||
exit
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_load owsd
|
||||
|
||||
@@ -289,8 +289,8 @@ parser_timeout()
|
||||
#data format is digital with time unit
|
||||
#10s-10 seconds 10m-10 minutes 10h-10 hours 10d-10 days
|
||||
if [ -n "$1" ]; then
|
||||
flag=$(echo "$1"| tr -d [0-9] | tr '[A-Z]' '[a-z]')
|
||||
data=$(echo "$1"| tr -cd [0-9])
|
||||
flag=$(echo "$1"| tr -d '0-9' | tr 'A-Z' 'a-z')
|
||||
data=$(echo "$1"| tr -cd '0-9')
|
||||
|
||||
case $flag in
|
||||
m)
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=periodicstats
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.1.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d53b540a89165753922707ed624b315d58abd10a
|
||||
PKG_SOURCE_VERSION:=7426c7458f792cc66920c206d62869c5620f1400
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/periodicstats.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -26,7 +26,7 @@ define Package/periodicstats
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Periodic Statistics Daemon
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm +libbbf_api +uspd
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbf_api
|
||||
endef
|
||||
|
||||
define Package/periodicstats/description
|
||||
|
||||
@@ -4,26 +4,23 @@ START=99
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=periodicstatsd
|
||||
PROG=/usr/sbin/periodicstatsd
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
start_service() {
|
||||
ubus wait_for usp
|
||||
if [ -f "/etc/config/periodicstats" ]; then
|
||||
if [ "$(uci -q get periodicstats.globals.enable)" == "1" ]; then
|
||||
procd_open_instance periodicstatsd
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
fi
|
||||
service_running() {
|
||||
ubus -t 10 wait_for usp.raw
|
||||
}
|
||||
|
||||
stop() {
|
||||
#stop_service() is called after procd killed the service
|
||||
echo ;
|
||||
start_service() {
|
||||
enable=$(uci -q get periodicstats.globals.enable)
|
||||
|
||||
if [ "$(enable)" != "1" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
procd_open_instance periodicstatsd
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
|
||||
@@ -12,7 +12,7 @@ PKG_NAME:=peripheral_manager
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=785166a9861a119623556163179915727896156b
|
||||
PKG_SOURCE_VERSION:=15ba90f01914113e7c5e8f8a6df6279c882e8265
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ usage () {
|
||||
}
|
||||
|
||||
[ $# -ne 1 ] && usage
|
||||
ledstate=$(echo $1 | tr '[A-Z]' '[a-z]')
|
||||
ledstate=$(echo $1 | tr 'A-Z' 'a-z')
|
||||
|
||||
case $ledstate in
|
||||
normal|test|allon|alloff|production)
|
||||
ubus call leds set "{\"state\" : \"$ledstate\"}"
|
||||
ubus call leds set "{\"state\" : \"$ledstate\"}"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
|
||||
38
ponmngr/Makefile
Normal file
38
ponmngr/Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Copyright (C) 2013-2021 iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ponmngr
|
||||
PKG_VERSION:=1.0.0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ponmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=ponmngr packets manager daemon
|
||||
endef
|
||||
|
||||
define Package/ponmngr/description
|
||||
Configures pon
|
||||
endef
|
||||
|
||||
#define Build/Prepare
|
||||
# $(CP) -rf ./ponmngr/* $(PKG_BUILD_DIR)/
|
||||
#endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/ponmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ponmngr))
|
||||
36
ponmngr/files/etc/init.d/pon
Executable file
36
ponmngr/files/etc/init.d/pon
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=ponmngr
|
||||
PROG="/usr/sbin/omcid start"
|
||||
|
||||
include /lib/pon
|
||||
|
||||
|
||||
start_service() {
|
||||
if [ -f "/etc/config/pon" ]; then
|
||||
procd_open_instance $NAME
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
start_gpon
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
start
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
service_stop ${PROG}
|
||||
stop_gpon
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
27
ponmngr/files/etc/uci-defaults/60-pon-generate
Executable file
27
ponmngr/files/etc/uci-defaults/60-pon-generate
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
basemac="$(db -q get hw.board.basemac | tr -d ':')"
|
||||
|
||||
if [ -s "/etc/config/pon" ]; then
|
||||
if uci -q get pon.globals >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/pon
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/pon
|
||||
|
||||
mac=''
|
||||
if [ -z "$basemac" ]; then
|
||||
mac="12345678"
|
||||
else
|
||||
# read last 8 characters of basemac without :
|
||||
mac=${basemac: -8}
|
||||
fi
|
||||
|
||||
uci set pon.globals=globals
|
||||
uci set pon.globals.enabled="1"
|
||||
uci set pon.globals.serial_number="BRCM$mac"
|
||||
|
||||
uci commit pon
|
||||
70
ponmngr/files/lib/pon/broadcom.sh
Executable file
70
ponmngr/files/lib/pon/broadcom.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
configure_snpwd() {
|
||||
local serial_no password
|
||||
serial_no="$1"
|
||||
password="$2"
|
||||
|
||||
# serial number comprises of 2 parts, vendor id and vendor specific, the vendor id is
|
||||
# a string while the vendor specific is a hex, so split the 2 and set accordingly
|
||||
local vendor_id vendor_specific
|
||||
vendor_id=${serial_no:0:4}
|
||||
vendor_specific=${serial_no: -8}
|
||||
|
||||
# attempt to conver vendor_id from string to hex
|
||||
vendor_id=$(echo $vendor_id | hexdump -e '4/1 "%02X" "\n"')
|
||||
vendor_id=${vendor_id:0:8}
|
||||
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure gpon onu_sn={vendor_id=$vendor_id,vendor_specific=$vendor_specific}
|
||||
if [ -n "$password" ]; then
|
||||
password=$(echo $password | hexdump -n ${#password} -e '16/1 "%02X""\n"')
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure gpon password=$password
|
||||
fi
|
||||
}
|
||||
|
||||
configure_gpon() {
|
||||
local enabled serial_no password
|
||||
config_load pon
|
||||
config_get enabled globals "enabled"
|
||||
|
||||
if [ "$enabled" == "0" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
config_get serial_no globals "serial_number"
|
||||
config_get password globals "password"
|
||||
|
||||
configure_snpwd $serial_no $password
|
||||
}
|
||||
|
||||
start_gpon() {
|
||||
if [ -n "$(which gponctl)" ]; then
|
||||
configure_gpon
|
||||
gponctl start
|
||||
fi
|
||||
}
|
||||
|
||||
stop_gpon() {
|
||||
if [ -n "$(which gponctl)" ]; then
|
||||
gponctl stop
|
||||
fi
|
||||
}
|
||||
|
||||
get_gpon_status() {
|
||||
json_init
|
||||
status="$(gponctl getstate)"
|
||||
admin_status="$(echo $status | head -n1 | awk '{print $8;}')"
|
||||
json_add_string "admin_status" "$admin_status"
|
||||
op_status="$(echo $status | head -n1 | awk '{print $12;}')"
|
||||
case $op_status in
|
||||
NUMBER)
|
||||
op_status="$(echo $status | head -n1 | awk '{print $13;}')"
|
||||
;;
|
||||
esac
|
||||
|
||||
op_status=${op_status:1:2}
|
||||
json_add_string "operational_status" "$op_status"
|
||||
json_dump
|
||||
}
|
||||
19
ponmngr/files/usr/libexec/rpcd/pon
Executable file
19
ponmngr/files/usr/libexec/rpcd/pon
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/functions.sh
|
||||
include /lib/pon
|
||||
|
||||
case "$1" in
|
||||
list)
|
||||
echo '{ "status": {} }'
|
||||
;;
|
||||
call)
|
||||
case "$2" in
|
||||
status)
|
||||
get_gpon_status
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/network/utils.sh
|
||||
populate_config_from_db() {
|
||||
. /lib/network/utils.sh
|
||||
|
||||
populate_config(){
|
||||
if [ -s "/etc/config/ports" ]; then
|
||||
if uci -q get ports.@ethport[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
return 0
|
||||
else
|
||||
rm -f /etc/config/ports
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/ports
|
||||
|
||||
local portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
for port in $portorder; do
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$(get_port_name $port)"
|
||||
@@ -35,4 +25,44 @@ populate_config(){
|
||||
uci commit ports
|
||||
}
|
||||
|
||||
[ -f /sbin/db -a -f /etc/board-db/config/hw ] && populate_config
|
||||
populate_config_from_device_tree() {
|
||||
for port in $(find /proc/device-tree/ -name "port@*"); do
|
||||
port="$(cat $port/label)"
|
||||
[ -n "$port" ] || continue
|
||||
[ "$port" = "cpu" ] && continue
|
||||
PORT="$(echo $port | tr '[a-z]' '[A-Z]')"
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$PORT"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$PORT"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed=1000
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
if [ "$port" = "wan" ]; then
|
||||
uci set ports.@ethport[-1].pause=1
|
||||
uci set ports.@ethport[-1].uplink=1
|
||||
else
|
||||
uci set ports.@ethport[-1].pause=0
|
||||
fi
|
||||
done
|
||||
uci commit ports
|
||||
}
|
||||
|
||||
if [ -s "/etc/config/ports" ]; then
|
||||
if uci -q get ports.@ethport[0] >/dev/null; then
|
||||
# exit if there is any valid content
|
||||
exit 0
|
||||
else
|
||||
rm -f /etc/config/ports
|
||||
fi
|
||||
fi
|
||||
|
||||
touch /etc/config/ports
|
||||
|
||||
if [ -f /sbin/db ] && [ -f /etc/board-db/config/hw ]; then
|
||||
populate_config_from_db
|
||||
elif [ -d /proc/device-tree/ ]; then
|
||||
populate_config_from_device_tree
|
||||
fi
|
||||
|
||||
@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=qosmngr
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=460327011d932580f55c7b70acb1e652dd3c95a3
|
||||
PKG_SOURCE_VERSION:=e3d608e4bacd367fed99bcdd7f56b3fba7b02891
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/qosmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -23,11 +23,6 @@ start_service() {
|
||||
fi
|
||||
}
|
||||
|
||||
stop() {
|
||||
#stop_service() is called after procd killed the service
|
||||
echo ;
|
||||
}
|
||||
|
||||
boot() {
|
||||
setup_qos
|
||||
start
|
||||
@@ -37,12 +32,8 @@ service_triggers() {
|
||||
procd_add_reload_trigger qos
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
# Call functions to configure QoS
|
||||
start
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
setup_qos
|
||||
start
|
||||
}
|
||||
|
||||
@@ -21,6 +21,10 @@ generate_queue(){
|
||||
case $cpu_model in
|
||||
68*) no_of_q="0 1 2 3" ;;
|
||||
esac
|
||||
|
||||
if grep -qE '[0-9]+ archer$' /proc/devices; then
|
||||
no_of_q="0 1 2 3"
|
||||
fi
|
||||
fi
|
||||
|
||||
i=0
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
. /lib/network/port.sh
|
||||
|
||||
IP_RULE=""
|
||||
BR_RULE=""
|
||||
@@ -13,6 +14,7 @@ PREV_ORDER=""
|
||||
CURR_ORDER=""
|
||||
MAX_ORDER=""
|
||||
|
||||
|
||||
# Function to handle a queue order and
|
||||
# update total number of queues
|
||||
handle_q_order() {
|
||||
@@ -325,6 +327,15 @@ broute_filter_on_ether_type() {
|
||||
BR_RULE="$BR_RULE --proto $1"
|
||||
}
|
||||
|
||||
broute_filter_on_dscp() {
|
||||
# The broadcom option --ip-dscp-extend actually accepts tos
|
||||
# and not dscp and that too in hex, hence, perform the conversion
|
||||
# from dscp in uci to tos first and then convert to hex
|
||||
tos_val=$(($1<<2))
|
||||
tos_hex=$(printf "%x" $tos_val)
|
||||
BR_RULE="$BR_RULE --ip-dscp-extend $tos_hex"
|
||||
}
|
||||
|
||||
broute_filter_on_vid() {
|
||||
case "$BR_RULE" in
|
||||
*proto*)
|
||||
@@ -355,6 +366,7 @@ handle_ebtables_rules() {
|
||||
config_get src_if "$sid" "ifname"
|
||||
config_get src_mac "$sid" "src_mac"
|
||||
config_get dst_mac "$sid" "dst_mac"
|
||||
config_get dscp_filter "$sid" "dscp_filter"
|
||||
config_get pcp_check "$sid" "pcp_check"
|
||||
config_get eth_type "$sid" "ethertype"
|
||||
config_get vid "$sid" "vid_check"
|
||||
@@ -393,6 +405,13 @@ handle_ebtables_rules() {
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
if [ -n "$dscp_filter" ]; then
|
||||
# filter on ethertype and proto is same thing
|
||||
broute_filter_on_ether_type IPv4
|
||||
broute_filter_on_dscp $dscp_filter
|
||||
is_l2_rule=1
|
||||
fi
|
||||
|
||||
if [ -n "$eth_type" ]; then
|
||||
broute_filter_on_ether_type $eth_type
|
||||
is_l2_rule=1
|
||||
@@ -671,17 +690,20 @@ assign_policer_to_port() {
|
||||
local pindex="$2"
|
||||
local portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
local wanport="$(db -q get hw.board.ethernetWanPort)"
|
||||
local runner_lan_ports="$(bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/examine port | grep ': port/index=lan' | sed -e 's#\.##g' | cut -f2 -d' ' | sort -u | xargs)"
|
||||
local i=1
|
||||
|
||||
for port in $portorder; do
|
||||
if [ "$ifname" == "$port" ]; then
|
||||
if [ "$wanport" == "$port" ]; then
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=wan0 ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
|
||||
else
|
||||
local i="${port: -1}"
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure port/index=lan$i ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
|
||||
local lanport="$(echo -n "$runner_lan_ports" | cut -f${i} -d' ')"
|
||||
bdmf_shell -c `cat /var/bdmf_sh_id` -cmd /b/configure $lanport ingress_rate_limit={traffic_types=8,policer={policer/dir=us,index=$pindex}}
|
||||
fi
|
||||
break
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
}
|
||||
|
||||
@@ -745,11 +767,6 @@ config_ingress_rate_limit() {
|
||||
local in_burst_size=$3
|
||||
local wanport="$(db -q get hw.board.ethernetWanPort)"
|
||||
|
||||
if [ "$ifname" == "$wanport" ]; then
|
||||
logger -t qosmngr "policing is not support on port $ifname"
|
||||
return
|
||||
fi
|
||||
|
||||
# Unit in uci file is in bps while that accepted by ethswctl is kbits
|
||||
if [ $ingress_rate -lt 1000 ]; then
|
||||
return
|
||||
@@ -763,7 +780,10 @@ config_ingress_rate_limit() {
|
||||
in_burst_size=$((in_burst_size / 1000))
|
||||
fi
|
||||
|
||||
ethswctl -c rxratectrl -n 1 -p $ifname -x $ingress_rate -y $in_burst_size
|
||||
local unitport="$(get_port_number $ifname)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
ethswctl -c rxratectrl -n $unit -p $port -x $ingress_rate -y $in_burst_size
|
||||
}
|
||||
|
||||
#function to handle a classify section
|
||||
@@ -822,7 +842,7 @@ configure_classify() {
|
||||
fcctl flush
|
||||
}
|
||||
|
||||
configure_queue() {
|
||||
pre_configure_queue() {
|
||||
# Delete queues
|
||||
rm -rf /tmp/qos/queue_stats
|
||||
|
||||
@@ -836,12 +856,15 @@ configure_queue() {
|
||||
for i in 0 1 2 3 4 5 6 7; do
|
||||
tmctl delqcfg --devtype 0 --if $intf --qid $i &>/dev/null
|
||||
done
|
||||
tmctl porttminit --devtype 0 --if $intf --flag 0 --numqueues 8
|
||||
|
||||
mkdir -p /tmp/qos/$intf
|
||||
touch /tmp/qos/$intf/q_order
|
||||
touch /tmp/qos/$intf/q_precedence
|
||||
done
|
||||
}
|
||||
|
||||
configure_queue() {
|
||||
# Load UCI file
|
||||
config_load qos
|
||||
config_foreach handle_q_order queue
|
||||
@@ -854,10 +877,14 @@ configure_policer() {
|
||||
# the old config if any and return
|
||||
if [ $POLICER_SKIP -eq 0 ]; then
|
||||
for intf in $(db get hw.board.ethernetPortOrder); do
|
||||
local unitport="$(get_port_number $intf)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
# setting rate and burst size to 0 disables rate limiting
|
||||
ethswctl -c rxratectrl -n 1 -p $intf -x 0 -y 0
|
||||
if [ $port != "" -a $unit != "" ]; then
|
||||
ethswctl -c rxratectrl -n $unit -p $port -x 0 -y 0
|
||||
fi
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
# Delete policer
|
||||
@@ -885,8 +912,12 @@ configure_policer() {
|
||||
}
|
||||
|
||||
configure_qos() {
|
||||
configure_queue
|
||||
#queue configuration is being done after shaper configuration,
|
||||
#If port shapingrate configuration on DISC device is called after queue configuration then
|
||||
#driver overwrites the queue shaping rate with default value of port shaping rate.
|
||||
pre_configure_queue
|
||||
configure_shaper
|
||||
configure_queue
|
||||
configure_policer
|
||||
configure_classify
|
||||
}
|
||||
@@ -904,6 +935,7 @@ reload_qos() {
|
||||
elif [ "$service_name" == "shaper" ]; then
|
||||
configure_shaper
|
||||
elif [ "$service_name" == "queue" ]; then
|
||||
pre_configure_queue
|
||||
configure_queue
|
||||
elif [ "$service_name" == "classify" ]; then
|
||||
configure_classify
|
||||
|
||||
@@ -6,9 +6,9 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=questd
|
||||
PKG_VERSION:=5.2.2
|
||||
PKG_VERSION:=5.2.3
|
||||
|
||||
PKG_SOURCE_VERSION:=cd05311b505cc5025a8559c616b55e9fb4d1857d
|
||||
PKG_SOURCE_VERSION:=cf54bd65ec821ac67f3aa1caeebcd3ea9aae07ad
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/questd
|
||||
|
||||
|
||||
@@ -12,12 +12,3 @@ start_service() {
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger network wireless
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
ubus -t 5 call router.network reload
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user