mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-20 17:14:58 +08:00
Compare commits
636 Commits
internet_a
...
devel-no-h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57fa4ec5c3 | ||
|
|
40da2597a9 | ||
|
|
db246c24f4 | ||
|
|
59aad46280 | ||
|
|
65a754935e | ||
|
|
99f0cc9a01 | ||
|
|
371e27e92e | ||
|
|
724c62684f | ||
|
|
040123d2b1 | ||
|
|
c5f26d1217 | ||
|
|
55e87e47f1 | ||
|
|
bb9b397caa | ||
|
|
e1c9006b2d | ||
|
|
b7a95f200f | ||
|
|
fb15ed7deb | ||
|
|
9535b226ce | ||
|
|
48e6c149a6 | ||
|
|
068307171c | ||
|
|
b7957f5dd4 | ||
|
|
4c40999c71 | ||
|
|
ff786da6a2 | ||
|
|
25955bfeca | ||
|
|
b9f25bcd90 | ||
|
|
b8dfa5eebe | ||
|
|
10719b6c92 | ||
|
|
cdb029dcb8 | ||
|
|
55fa399ea6 | ||
|
|
c0bdff6a1c | ||
|
|
48d35004d4 | ||
|
|
e95cc9a39d | ||
|
|
c260fb4c61 | ||
|
|
4b279a83a9 | ||
|
|
3cebc8aee5 | ||
|
|
58035970a4 | ||
|
|
707a62b678 | ||
|
|
2c738bb96c | ||
|
|
fa24932e7c | ||
|
|
b8fc416fed | ||
|
|
7ad065a756 | ||
|
|
54a54d048c | ||
|
|
28fef8f5ea | ||
|
|
92a1c1e25d | ||
|
|
34c5ae9c71 | ||
|
|
1c68b9bba0 | ||
|
|
6b7d2d7c69 | ||
|
|
3482a3e94f | ||
|
|
b96d6a5a1b | ||
|
|
01625e3382 | ||
|
|
8243861c49 | ||
|
|
744c5828a5 | ||
|
|
a33b438ddc | ||
|
|
445e50f011 | ||
|
|
e845aa2a51 | ||
|
|
39aebfc782 | ||
|
|
6441d2fd01 | ||
|
|
36f02fa5f8 | ||
|
|
e80ca4319b | ||
|
|
350186614e | ||
|
|
6caec3ea06 | ||
|
|
f45ec2b32b | ||
|
|
c361b4e589 | ||
|
|
ef4e5fbef6 | ||
|
|
d9fe7d6927 | ||
|
|
920832c5c7 | ||
|
|
a1a1dafb2f | ||
|
|
45eda81ccc | ||
|
|
83db5d1e2d | ||
|
|
71e7a8121f | ||
|
|
0368ef0498 | ||
|
|
34b8267b03 | ||
|
|
13e8f80a5d | ||
|
|
f9bbd87b5d | ||
|
|
b5150eb926 | ||
|
|
ab078ad644 | ||
|
|
676244b0c7 | ||
|
|
c1b990837d | ||
|
|
7dc38d0a4a | ||
|
|
6fdb0e1e4c | ||
|
|
4712d9be73 | ||
|
|
724c060372 | ||
|
|
45e996e2fa | ||
|
|
66f4780410 | ||
|
|
f2b3838451 | ||
|
|
17e67528cc | ||
|
|
6dfd959020 | ||
|
|
65d4d6538d | ||
|
|
63efd921ed | ||
|
|
2bbe7b1eef | ||
|
|
9c6f6acf6c | ||
|
|
6bc1456655 | ||
|
|
663412be0b | ||
|
|
272d4defc0 | ||
|
|
c7f81e4ad8 | ||
|
|
03ec0f2964 | ||
|
|
53d76aaa4d | ||
|
|
43a68cb1ed | ||
|
|
8f8c6405ea | ||
|
|
1efa6ec0aa | ||
|
|
13bbdaa1e8 | ||
|
|
feeed40395 | ||
|
|
f8022eb73b | ||
|
|
07e1c78029 | ||
|
|
d1ea18952f | ||
|
|
3b0097078d | ||
|
|
9b4c941cd4 | ||
|
|
50bee657ba | ||
|
|
8412f5d2d6 | ||
|
|
eabf5b6e8f | ||
|
|
3dd525d5ff | ||
|
|
a828671570 | ||
|
|
084cb9742a | ||
|
|
f3e4a9717c | ||
|
|
b63033eeab | ||
|
|
c52754d80e | ||
|
|
6adb45d944 | ||
|
|
2478ca8fd9 | ||
|
|
c6492dfeee | ||
|
|
5fcd32a7e8 | ||
|
|
73e7efddae | ||
|
|
a934358614 | ||
|
|
620ba60f2e | ||
|
|
f89b0b1797 | ||
|
|
bafb6f304c | ||
|
|
20e5110ac5 | ||
|
|
083ffd8a3f | ||
|
|
cf8c202d01 | ||
|
|
71bbb8281c | ||
|
|
3b3d7150bd | ||
|
|
130e5c567d | ||
|
|
ba61b6c8dd | ||
|
|
b3715aee80 | ||
|
|
4064c9b98c | ||
|
|
fea576c258 | ||
|
|
189bfe4013 | ||
|
|
2370c6e82e | ||
|
|
bfda6d619e | ||
|
|
930d777931 | ||
|
|
9565fa70d2 | ||
|
|
add4061e7f | ||
|
|
15e0d8e40d | ||
|
|
a1309b2552 | ||
|
|
283f148f74 | ||
|
|
21292de648 | ||
|
|
628872d2fd | ||
|
|
6608a10538 | ||
|
|
7eaf58237a | ||
|
|
f952712b5e | ||
|
|
03d5798ea0 | ||
|
|
4a049cfecd | ||
|
|
d36c76f4de | ||
|
|
fb04949dc3 | ||
|
|
0969cc7a24 | ||
|
|
12dff011cc | ||
|
|
5572cc2ede | ||
|
|
91f5827a4f | ||
|
|
aec92583ea | ||
|
|
63f4adcc97 | ||
|
|
82df16a8c4 | ||
|
|
237f30c3f7 | ||
|
|
2dac7741d4 | ||
|
|
0cff7d0e94 | ||
|
|
5e5abdfd21 | ||
|
|
0a755e5ea5 | ||
|
|
792e3ad20d | ||
|
|
336c5047c6 | ||
|
|
9c999de243 | ||
|
|
9a71a0bc84 | ||
|
|
7fb76b6dcd | ||
|
|
4f924bec0e | ||
|
|
ea4301bf28 | ||
|
|
99fcfcfa7e | ||
|
|
81218bc62d | ||
|
|
a71a0d4036 | ||
|
|
db578ec144 | ||
|
|
9410758de0 | ||
|
|
7b05468390 | ||
|
|
6d43b68d0b | ||
|
|
ae1fb54a3c | ||
|
|
313462e3ab | ||
|
|
be56713329 | ||
|
|
caae6916ae | ||
|
|
4e1db4f14f | ||
|
|
d2298b6097 | ||
|
|
8b1ef3cd74 | ||
|
|
05da8b4210 | ||
|
|
33cd29a47d | ||
|
|
f35b198c05 | ||
|
|
2bba5ad425 | ||
|
|
cbcb5278db | ||
|
|
be032908b0 | ||
|
|
e4d7967cd5 | ||
|
|
2fd0e37395 | ||
|
|
155ed6e0e1 | ||
|
|
4f70901a8c | ||
|
|
faf81a70fd | ||
|
|
680f324a34 | ||
|
|
718c2bdd81 | ||
|
|
d5ef59f028 | ||
|
|
881b8edaa9 | ||
|
|
2b5c30f203 | ||
|
|
1e5ff3a2fd | ||
|
|
7604786437 | ||
|
|
be752464bc | ||
|
|
fe47e30520 | ||
|
|
1623fb6559 | ||
|
|
002dceac35 | ||
|
|
b0b2874fdf | ||
|
|
378ef51ea8 | ||
|
|
241fd05d5c | ||
|
|
3267082ac3 | ||
|
|
fbc67e547c | ||
|
|
57b0cde173 | ||
|
|
222116d122 | ||
|
|
4e51f87eb0 | ||
|
|
a0fa00fd93 | ||
|
|
60989716fb | ||
|
|
a50f99634e | ||
|
|
822a6ff7a1 | ||
|
|
110da023b1 | ||
|
|
03fcf31e97 | ||
|
|
96e990ad3e | ||
|
|
6709beee6c | ||
|
|
644856890b | ||
|
|
208ebe92a8 | ||
|
|
752648d604 | ||
|
|
8f5e73321f | ||
|
|
5c83a98cb3 | ||
|
|
8711c64ff6 | ||
|
|
b6477e8b84 | ||
|
|
6f24ad440c | ||
|
|
640d24ea66 | ||
|
|
60b06dd739 | ||
|
|
501966b150 | ||
|
|
32e6e38103 | ||
|
|
adce72980b | ||
|
|
695351633d | ||
|
|
a2b4aedce5 | ||
|
|
37dd1361b0 | ||
|
|
68042169ff | ||
|
|
f110bdbe68 | ||
|
|
923e714017 | ||
|
|
81dd8f8afa | ||
|
|
73d855e682 | ||
|
|
a5606ed518 | ||
|
|
ca2a495790 | ||
|
|
695b7374bc | ||
|
|
f9df86feec | ||
|
|
8686249557 | ||
|
|
a8d529f9ea | ||
|
|
4715de6308 | ||
|
|
b41ec4ff65 | ||
|
|
b3de88d2c4 | ||
|
|
063314c91d | ||
|
|
e72b600326 | ||
|
|
594b13f5f9 | ||
|
|
fdb1dbbba0 | ||
|
|
d89055f64b | ||
|
|
13ffeac51b | ||
|
|
d94c6e9995 | ||
|
|
639694c0fb | ||
|
|
6f629b7393 | ||
|
|
d4af4ca030 | ||
|
|
237cead03b | ||
|
|
d440af07b1 | ||
|
|
a09346bfc0 | ||
|
|
c9f90a6cf5 | ||
|
|
e0d07b5205 | ||
|
|
1c035c5523 | ||
|
|
38e49fc09f | ||
|
|
1ff2a366fa | ||
|
|
263b785fcb | ||
|
|
c1475dd5f1 | ||
|
|
3411ece8a8 | ||
|
|
5912c00a4b | ||
|
|
e39acfeeae | ||
|
|
b0ddc52e97 | ||
|
|
b7ea6fdfcf | ||
|
|
28fdf33411 | ||
|
|
96b753c367 | ||
|
|
e34ed69b9b | ||
|
|
d75d44795c | ||
|
|
97ce9d60e0 | ||
|
|
391dbe06cc | ||
|
|
81ae6221ac | ||
|
|
a96302230c | ||
|
|
a5b5b160e2 | ||
|
|
21d327d4fe | ||
|
|
2241f360b4 | ||
|
|
3d951f5453 | ||
|
|
9db96d7296 | ||
|
|
7a8b81f261 | ||
|
|
edd2f92dae | ||
|
|
f9fbb07f0a | ||
|
|
29418e36d8 | ||
|
|
2420391455 | ||
|
|
5221858e30 | ||
|
|
1a40a6e747 | ||
|
|
85715416a5 | ||
|
|
2133c53a5c | ||
|
|
f2a5d2987d | ||
|
|
cef675a672 | ||
|
|
78cf48518c | ||
|
|
10d36df0b6 | ||
|
|
b2e5e5ee8d | ||
|
|
14cb91a952 | ||
|
|
aba3bcbe99 | ||
|
|
95691b3de6 | ||
|
|
c6abc34868 | ||
|
|
e9e50f7402 | ||
|
|
ec66d57a7a | ||
|
|
8eb1f7b729 | ||
|
|
4d1fe3c052 | ||
|
|
93a42e1cb9 | ||
|
|
93cffa2d20 | ||
|
|
14a32ff704 | ||
|
|
1d1318dad2 | ||
|
|
cacf1e9610 | ||
|
|
cd80edc69d | ||
|
|
778bd98197 | ||
|
|
2c0e2a559f | ||
|
|
f76e8eb150 | ||
|
|
9084ce08b3 | ||
|
|
eebe898c37 | ||
|
|
ea3b3aec05 | ||
|
|
2a820a9e33 | ||
|
|
f5d77f5b19 | ||
|
|
ea4a0acac7 | ||
|
|
9655bf7740 | ||
|
|
2dce686767 | ||
|
|
6d93558c6e | ||
|
|
363c2c39aa | ||
|
|
a5f7ef04f4 | ||
|
|
7f4eeaeb1a | ||
|
|
a352b4f8fe | ||
|
|
a41e1d7299 | ||
|
|
01ce50ba59 | ||
|
|
b606530f0e | ||
|
|
0cdf15fec5 | ||
|
|
edb05ae692 | ||
|
|
889f2637fc | ||
|
|
1792c8b615 | ||
|
|
24173b4beb | ||
|
|
f59bed5f48 | ||
|
|
3a1915a027 | ||
|
|
67d8787dfa | ||
|
|
8eb41f7b94 | ||
|
|
3725fdf26a | ||
|
|
9aa65e3489 | ||
|
|
c945d0d4a6 | ||
|
|
63c8f8af95 | ||
|
|
18acbe65c4 | ||
|
|
af48c7c682 | ||
|
|
d961a590b4 | ||
|
|
e7426d5e71 | ||
|
|
e485a0514e | ||
|
|
05448a3cae | ||
|
|
be22778704 | ||
|
|
89cfa4dc0d | ||
|
|
1a69381038 | ||
|
|
0f6108a0c0 | ||
|
|
2dc1e6044a | ||
|
|
2234822346 | ||
|
|
0739cef329 | ||
|
|
572b370aec | ||
|
|
0fc7964afa | ||
|
|
10f287a885 | ||
|
|
f47a2c3ef3 | ||
|
|
bb9d1621a5 | ||
|
|
be88de9f0e | ||
|
|
d752daecbe | ||
|
|
f8482fd2ca | ||
|
|
6150acc420 | ||
|
|
b11e959fe7 | ||
|
|
76c8fbbfbc | ||
|
|
81f0e8d255 | ||
|
|
8b3ede859b | ||
|
|
82b8245f6a | ||
|
|
ba6a218a09 | ||
|
|
7db489d987 | ||
|
|
b718d566d7 | ||
|
|
c6808a3524 | ||
|
|
74b9435ba4 | ||
|
|
1e81fee38a | ||
|
|
330f8b6e71 | ||
|
|
3fbc1ea845 | ||
|
|
fdc4a07242 | ||
|
|
fc7595c072 | ||
|
|
36e7d3d221 | ||
|
|
ff11531d8c | ||
|
|
5f967edb5b | ||
|
|
22daedac3c | ||
|
|
7a1760a20f | ||
|
|
472bd4c27c | ||
|
|
b37ea343f1 | ||
|
|
0ea80c5b06 | ||
|
|
ae60472790 | ||
|
|
42f019a136 | ||
|
|
ccd87ca8bc | ||
|
|
23f74d3982 | ||
|
|
9dfbdbbb00 | ||
|
|
b5e1379c8d | ||
|
|
ce48719df9 | ||
|
|
84f2faff38 | ||
|
|
74c1017a0c | ||
|
|
510712bf86 | ||
|
|
7743425e9c | ||
|
|
50984f8f84 | ||
|
|
82fed513a8 | ||
|
|
adfaa19180 | ||
|
|
cf8b29665c | ||
|
|
43bfdc8994 | ||
|
|
b29b3a12e3 | ||
|
|
38d2c7dc25 | ||
|
|
cc3a8f55e6 | ||
|
|
a6616bb17d | ||
|
|
ad06a9f4ea | ||
|
|
d150800f1b | ||
|
|
e8b716b2a1 | ||
|
|
442ce5ce83 | ||
|
|
72f18d7acf | ||
|
|
fa905db20f | ||
|
|
de1745f4ce | ||
|
|
f6697c9003 | ||
|
|
44d9e704b3 | ||
|
|
ed9ec3b702 | ||
|
|
07f10c42dc | ||
|
|
9b45e4c9a1 | ||
|
|
d3d8bd14aa | ||
|
|
4dfe44af20 | ||
|
|
9ae9af2acf | ||
|
|
2d11f25204 | ||
|
|
2cd4776649 | ||
|
|
0aae8679c5 | ||
|
|
3bb34b88a6 | ||
|
|
8efb6e952a | ||
|
|
3ef04dbd25 | ||
|
|
9d4eade8c1 | ||
|
|
9c145bc34b | ||
|
|
2317e6b072 | ||
|
|
f12f17c6c4 | ||
|
|
23358a7f8c | ||
|
|
ef32f8b0f9 | ||
|
|
7e81d58f78 | ||
|
|
213f7850bc | ||
|
|
89a86c3629 | ||
|
|
83f4e57fe2 | ||
|
|
0ffe19196c | ||
|
|
ec9fb0cddc | ||
|
|
c1ffc565e5 | ||
|
|
dca4cd0e63 | ||
|
|
0a00f07d26 | ||
|
|
6b75585b9d | ||
|
|
59583925b5 | ||
|
|
39c594531a | ||
|
|
21d167b543 | ||
|
|
4439dd777a | ||
|
|
1b17f255cd | ||
|
|
bd7ffb6ed0 | ||
|
|
d56bd71f04 | ||
|
|
5dea0ad170 | ||
|
|
caf0bcabf4 | ||
|
|
ad6c736f5c | ||
|
|
4c5443fff8 | ||
|
|
c4c3ce2c76 | ||
|
|
f2e3dd3835 | ||
|
|
3f8a60c2fd | ||
|
|
1d62545b4d | ||
|
|
33b331d724 | ||
|
|
ac51e3b0cd | ||
|
|
6af817414a | ||
|
|
c94f060196 | ||
|
|
302daba0a6 | ||
|
|
0cfd475bc7 | ||
|
|
8bcb3d8d18 | ||
|
|
e70a2d5387 | ||
|
|
1004eab7c3 | ||
|
|
21512b44ff | ||
|
|
121bec3a3b | ||
|
|
6227fca86e | ||
|
|
21d3c577c8 | ||
|
|
286e5ce814 | ||
|
|
077337b0ea | ||
|
|
c08342b404 | ||
|
|
6ab6152d66 | ||
|
|
e3e11645b9 | ||
|
|
71abbd7024 | ||
|
|
239336f39f | ||
|
|
adfda085d7 | ||
|
|
9034a41e93 | ||
|
|
8011700c3a | ||
|
|
a4b6d1c15d | ||
|
|
885ace494e | ||
|
|
139382c930 | ||
|
|
f77697fa15 | ||
|
|
0d230c1d96 | ||
|
|
ed4fdc13c9 | ||
|
|
a729eb4e75 | ||
|
|
f4efc133f9 | ||
|
|
c2aa56adff | ||
|
|
1530b0b9e4 | ||
|
|
c0c8f92d6b | ||
|
|
da99f3b66c | ||
|
|
4ec0b703f4 | ||
|
|
81f48dc776 | ||
|
|
0927fbaf35 | ||
|
|
a61770b99d | ||
|
|
2668e9d634 | ||
|
|
a9e482d9af | ||
|
|
71cdb3e11c | ||
|
|
ecd30ae17d | ||
|
|
a28ff87eca | ||
|
|
117bca46df | ||
|
|
2657260054 | ||
|
|
69c4c6cb31 | ||
|
|
2df5b55ed7 | ||
|
|
ecacb13edf | ||
|
|
3bf7d2557c | ||
|
|
df8d9ff1ef | ||
|
|
10564d779c | ||
|
|
b64f41dc6b | ||
|
|
cddf178691 | ||
|
|
67083c4ab4 | ||
|
|
063a97a7d0 | ||
|
|
3920ab6523 | ||
|
|
406c8ef73c | ||
|
|
8651b12aa6 | ||
|
|
3bc76dc1bb | ||
|
|
71d96711bd | ||
|
|
96966f447c | ||
|
|
4efe0b0e53 | ||
|
|
6f48560b97 | ||
|
|
bdb3d1847e | ||
|
|
f2cb3f4442 | ||
|
|
3df0e75b3f | ||
|
|
0afc1b9dd5 | ||
|
|
8e1a3b1184 | ||
|
|
854c2aa507 | ||
|
|
30282db3d5 | ||
|
|
6c9f034d29 | ||
|
|
d19c85ebde | ||
|
|
dfa0414918 | ||
|
|
30a4b1b745 | ||
|
|
ebbe691ecc | ||
|
|
ec9495cd41 | ||
|
|
c736b6244a | ||
|
|
ec4bd3cd91 | ||
|
|
d685b60f45 | ||
|
|
01f98c52c9 | ||
|
|
89af5bba92 | ||
|
|
f3edc9b7eb | ||
|
|
8ec904fac2 | ||
|
|
1d10770ed5 | ||
|
|
01f738b2b3 | ||
|
|
dc0b80097b | ||
|
|
ee283c2e1b | ||
|
|
d1f4dfbb71 | ||
|
|
28603606d6 | ||
|
|
0e06579c71 | ||
|
|
89afb954da | ||
|
|
01899c924a | ||
|
|
41453f0f97 | ||
|
|
dd12c2574f | ||
|
|
f7087bb8c7 | ||
|
|
16ce80d9ee | ||
|
|
02f85d54d0 | ||
|
|
c80da485c9 | ||
|
|
38e95765a3 | ||
|
|
1141ca1ef9 | ||
|
|
f0b1a32208 | ||
|
|
28dda87cfb | ||
|
|
f5be820ad5 | ||
|
|
8820cbe1b1 | ||
|
|
11293bb304 | ||
|
|
5dcf58e7dd | ||
|
|
91d345c7fb | ||
|
|
dc4c8bafc2 | ||
|
|
98287d382b | ||
|
|
fbaa28712d | ||
|
|
84a5b3f99f | ||
|
|
4ebffa9cfb | ||
|
|
ed33a61be7 | ||
|
|
99eb4bf546 | ||
|
|
0745796112 | ||
|
|
ebcf8b4b61 | ||
|
|
01f11f1ad0 | ||
|
|
df1537cd0c | ||
|
|
b370f1c242 | ||
|
|
c71de4a811 | ||
|
|
30e8ff5884 | ||
|
|
454eba7e5e | ||
|
|
8305d28285 | ||
|
|
cf4731761d | ||
|
|
bd81dfd51b | ||
|
|
e5a41d343b | ||
|
|
97c7eacf69 | ||
|
|
d1ceed52f2 | ||
|
|
6aef44ea9b | ||
|
|
fbf0aa29a3 | ||
|
|
8a9c147952 | ||
|
|
ac30cad2ed | ||
|
|
1ae87be0ac | ||
|
|
b93ebe260b | ||
|
|
7160fadf56 | ||
|
|
f06a0e93b7 | ||
|
|
7a54b81daf | ||
|
|
bd50a960ec | ||
|
|
64d3e07dd2 | ||
|
|
9401cea337 | ||
|
|
99c15dfe30 | ||
|
|
ce43197f45 | ||
|
|
047e533140 | ||
|
|
8c70ba4f00 | ||
|
|
a3760e2082 | ||
|
|
00f9133ae3 | ||
|
|
184dcd5b97 | ||
|
|
66163d3945 | ||
|
|
8bdfd3ea51 | ||
|
|
0689c0f91a | ||
|
|
7baea620ec | ||
|
|
a14dbdfb9c | ||
|
|
7c706a045b | ||
|
|
c346df2802 | ||
|
|
27ccd1582d | ||
|
|
7c3d1f919c | ||
|
|
3f398d1016 | ||
|
|
c6b9c83194 | ||
|
|
16843b0260 | ||
|
|
61cba7f7f7 | ||
|
|
2fb2b24201 | ||
|
|
9c838d993c | ||
|
|
0e1451bcd2 | ||
|
|
0c3299f631 | ||
|
|
c07da46687 | ||
|
|
f81fc0b77b | ||
|
|
ee67f14abd | ||
|
|
e5c76f17f6 |
@@ -10,10 +10,6 @@ config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config BBF_TR104
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR143
|
||||
bool "Enable TR-143 Data Model Support"
|
||||
default y
|
||||
@@ -22,14 +18,6 @@ config BBF_TR471
|
||||
bool "Enable TR-471 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBFDM_ENABLE_JSON_PLUGIN
|
||||
bool "Enable json plugin to extend datamodel"
|
||||
default y
|
||||
|
||||
config BBFDM_ENABLE_DOTSO_PLUGIN
|
||||
bool "Enable shared library plugin to extend datamodel"
|
||||
default y
|
||||
|
||||
config BBF_MAX_OBJECT_INSTANCES
|
||||
int "Maximum number of instances per object"
|
||||
default 255
|
||||
|
||||
@@ -5,13 +5,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.0.30
|
||||
PKG_VERSION:=1.4.23
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=93a7049287b355892c9ed732f5cb3b9406ba687e
|
||||
PKG_SOURCE_VERSION:=c10303fc51a1034cb87040e0eaf23c95d2b1c658
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
@@ -99,13 +102,12 @@ define Package/libbbfdm-api/description
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/description
|
||||
Library contains the data model tree. It includes TR181, TR104 and TR143 data models
|
||||
Library contains the data model tree. It includes TR181, TR143 data models
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
ifeq ($(USE_LOCAL),1)
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
$(CP) ~/git/bbfdm/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -113,11 +115,6 @@ CMAKE_OPTIONS += \
|
||||
-DBBF_TR181=ON
|
||||
-DBBF_WIFI_DATAELEMENTS=ON
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR104),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR104=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_TR143=ON
|
||||
@@ -139,16 +136,6 @@ CMAKE_OPTIONS += \
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_JSON_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_DOTSO_PLUGIN=ON
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),default)
|
||||
CMAKE_OPTIONS += -DWITH_OPENSSL=ON
|
||||
endif
|
||||
@@ -179,21 +166,21 @@ define Package/libbbfdm/default/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbfdm/libbbfdm.so $(1)/lib/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/bbf $(1)/lib/upgrade/keep.d/bbf
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/97-firewall-service $(1)/etc/uci-defaults/97-firewall-service
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/99-link-core-plugins $(1)/etc/uci-defaults/99-link-core-plugins
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
$(INSTALL_BIN) ./files/etc/firewall.service $(1)/etc/firewall.service
|
||||
ifeq ($(CONFIG_BBF_TR143),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libbbfdm/scripts/* $(1)/usr/share/bbfdm
|
||||
$(LN) /usr/share/bbfdm/bbf.diag $(1)/usr/libexec/rpcd/bbf.diag
|
||||
endif
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
endif
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/default/prerm
|
||||
@@ -208,11 +195,12 @@ define Package/bbfdmd/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
$(INSTALL_CONF) ./files/etc/config/bbfdm $(1)/etc/config/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/src/bbfdmd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/json/input.json $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/bbfdm/bbfdm_services.sh $(1)/etc/bbfdm/
|
||||
$(INSTALL_BIN) ./files/etc/hotplug.d/iface/85-bbfdm-sysctl $(1)/etc/hotplug.d/iface/85-bbfdm-sysctl
|
||||
endef
|
||||
|
||||
define Package/userinterface/install
|
||||
@@ -225,9 +213,7 @@ define Package/userinterface/install
|
||||
$(INSTALL_BIN) ./files/etc/init.d/userinterface $(1)/etc/init.d/userinterface
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/93-userinterface-firewall $(1)/etc/uci-defaults/93-userinterface-firewall
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/94-userinterface-json $(1)/etc/uci-defaults/94-userinterface-json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-portmap-firewall $(1)/etc/uci-defaults/95-portmap-firewall
|
||||
$(INSTALL_BIN) ./files/etc/firewall.userinterface $(1)/etc/firewall.userinterface
|
||||
$(INSTALL_BIN) ./files/etc/firewall.portmap $(1)/etc/firewall.portmap
|
||||
endef
|
||||
|
||||
Package/libbbfdm/prerm = $(Package/libbbfdm/default/prerm)
|
||||
|
||||
9
bbfdm/bbfdm.mk
Normal file
9
bbfdm/bbfdm.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (C) 2023 IOPSYS
|
||||
#
|
||||
|
||||
|
||||
define BbfdmInstallPlugin
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
|
||||
endef
|
||||
47
bbfdm/files/etc/bbfdm/bbfdm_services.sh
Executable file
47
bbfdm/files/etc/bbfdm/bbfdm_services.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
BBFDMD="/usr/sbin/bbfdmd"
|
||||
|
||||
bbfdm_add_service()
|
||||
{
|
||||
local name path
|
||||
|
||||
name="${1}"
|
||||
path="${2}"
|
||||
|
||||
if [ -z "${name}" -o -z "$path" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
ubus call service add "{'name':'bbfdm.services','instances':{'$name':{'command':['$BBFDMD','-m','$path']}}}"
|
||||
}
|
||||
|
||||
bbfdm_stop_service()
|
||||
{
|
||||
local name
|
||||
|
||||
name="${1}"
|
||||
if [ -z "${name}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
if ubus call service list '{"name":"bbfdm.services"}' |grep -q "bbfdm.$name"; then
|
||||
ubus call service delete "{'name':'bbfdm.services','instance':'bbfdm.$name'}"
|
||||
fi
|
||||
}
|
||||
|
||||
usages()
|
||||
{
|
||||
echo "Usages $0: <OPTIONS>..."
|
||||
echo
|
||||
echo " -h show help"
|
||||
echo " -k micro-service name to stop"
|
||||
echo
|
||||
}
|
||||
|
||||
while getopts "s:k:h" opts; do
|
||||
case "$opts" in
|
||||
h) usages; exit 0;;
|
||||
k) bbfdm_stop_service "${OPTARG}";;
|
||||
esac
|
||||
done
|
||||
28
bbfdm/files/etc/bbfdm/input.json
Normal file
28
bbfdm/files/etc/bbfdm/input.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"daemon": {
|
||||
"config": {
|
||||
},
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/lib/libbbfdm.so",
|
||||
"plugin_dir": "/etc/bbfdm/plugins"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm"
|
||||
}
|
||||
},
|
||||
"cli": {
|
||||
"config": {
|
||||
"proto": "both",
|
||||
"instance_mode": 0
|
||||
},
|
||||
"input": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm"
|
||||
},
|
||||
"output": {
|
||||
"type": "CLI"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,6 @@ config bbfdmd 'bbfdmd'
|
||||
option enabled '1'
|
||||
option loglevel '1'
|
||||
option refresh_time '10'
|
||||
option transaction_timeout '10'
|
||||
option transaction_timeout '30'
|
||||
option subprocess_level '2'
|
||||
|
||||
|
||||
163
bbfdm/files/etc/firewall.service
Executable file
163
bbfdm/files/etc/firewall.service
Executable file
@@ -0,0 +1,163 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.service -p info
|
||||
}
|
||||
|
||||
exec_cmd() {
|
||||
if ! eval "$*"; then
|
||||
log "Failed to run [$*]"
|
||||
echo "-1"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "0"
|
||||
return 0
|
||||
}
|
||||
|
||||
add_iptable_rule() {
|
||||
chain_name=$1
|
||||
protocol=$2
|
||||
dest_port=$3
|
||||
icmp_type=$4
|
||||
family=$5
|
||||
src_prefix=$6
|
||||
action=$7
|
||||
res=-1
|
||||
|
||||
cmd="-I ${chain_name}"
|
||||
|
||||
if [ -n "${protocol}" ]; then
|
||||
cmd="${cmd} -p $protocol"
|
||||
|
||||
if [ "${protocol}" -eq 41 ] || [ "${protocol}" -eq 43 ] || [ "${protocol}" -eq 44 ] ||
|
||||
[ "${protocol}" -eq 58 ] || [ "${protocol}" -eq 59 ] || [ "${protocol}" -eq 60 ]; then
|
||||
# Explicit v6 protocols
|
||||
if [ "${family}" = "ipv4" ]; then
|
||||
echo $res
|
||||
return 0
|
||||
else
|
||||
family="ipv6"
|
||||
fi
|
||||
elif [ "${protocol}" -eq 1 ]; then
|
||||
# Explicit v4 protocols
|
||||
if [ "${family}" = "ipv6" ]; then
|
||||
echo $res
|
||||
return 0
|
||||
else
|
||||
family="ipv4"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Limitation:: iptables do not accept dport without specific protocol
|
||||
count=$(echo "${dest_port}" | sed -n "/-1/p" | wc -l)
|
||||
|
||||
if [ "${count}" -eq 0 ]; then
|
||||
# dest_port not contains -1 so need to have this match criteria
|
||||
count=$(echo "${dest_port}" | wc -w)
|
||||
if [ "${count}" -gt 1 ]; then
|
||||
# multiple ports present
|
||||
port=$(echo "${dest_port}" | sed "s/ /,/g")
|
||||
cmd="${cmd} -m multiport --dports ${port}"
|
||||
else
|
||||
cmd="${cmd} --dport ${dest_port}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${family}" = "ipv4" ] || [ "${family}" = "-1" ]; then
|
||||
if [ "${protocol}" -eq 1 ] && [ "${icmp_type}" -ge 0 ]; then
|
||||
cmd="${cmd} --icmp-type ${icmp_type}"
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "iptables ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
|
||||
else
|
||||
#Add ipv4 sources if any
|
||||
src_list=""
|
||||
for src in $src_prefix; do
|
||||
ret=$(echo $src | grep ":" | wc -l)
|
||||
if [ "${ret}" -eq 0 ]; then
|
||||
src_list="$src,$src_list"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$src_list" ]; then
|
||||
src_list=$(echo "${src_list}" | sed "s/,$//")
|
||||
res=$(exec_cmd "iptables -s $src_list ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${family}" = "ipv6" ] || [ "${family}" = "-1" ]; then
|
||||
if [ "${protocol}" -eq 58 ] && [ "${icmp_type}" -ge 0 ]; then
|
||||
cmd="${cmd} --icmpv6-type ${icmp_type}"
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "ip6tables ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
|
||||
else
|
||||
#Add ipv6 sources if any
|
||||
src_list=""
|
||||
for src in $src_prefix; do
|
||||
ret=$(echo $src | grep ":" | wc -l)
|
||||
if [ "${ret}" -eq 1 ]; then
|
||||
src_list="$src,$src_list"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$src_list" ]; then
|
||||
src_list=$(echo "${src_list}" | sed "s/,$//")
|
||||
res=$(exec_cmd "ip6tables -s $src_list ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $res
|
||||
}
|
||||
|
||||
add_service() {
|
||||
local enable proto family dest_port interface target icmp_type
|
||||
|
||||
config_get enable "$1" enable "0"
|
||||
config_get icmp_type "$1" icmp_type "-1"
|
||||
config_get target "$1" target "Accept"
|
||||
config_get interface "$1" interface ""
|
||||
config_get family "$1" family "-1"
|
||||
config_get dest_port "$1" dest_port "-1"
|
||||
config_get proto "$1" proto "-1"
|
||||
config_get src_prefix "$1" src_prefix ""
|
||||
|
||||
if [ "${enable}" -eq 0 ] || [ -z "${interface}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
action=$(echo "${target}" | tr a-z A-Z)
|
||||
chain_name="zone_${interface}_input"
|
||||
res=0
|
||||
|
||||
count=$(echo "${proto}" | sed -n "/-1/p" | wc -l)
|
||||
|
||||
if [ "${count}" -eq 0 ]; then
|
||||
# proto not contains -1 so need to have this match criteria
|
||||
for protocol in $proto; do
|
||||
res=$(add_iptable_rule "$chain_name" "$protocol" "$dest_port" "$icmp_type" "$family" "$src_prefix" "$action")
|
||||
done
|
||||
else
|
||||
# proto contains -1 so no need to have this match criteria
|
||||
res=$(add_iptable_rule "$chain_name" "" "$dest_port" "$icmp_type" "$family" "$src_prefix" "$action")
|
||||
fi
|
||||
|
||||
if [ "${res}" -ne 0 ]; then
|
||||
uci -q set firewall."${1}".status="Error"
|
||||
else
|
||||
uci -q set firewall."${1}".status=""
|
||||
fi
|
||||
|
||||
uci commit firewall
|
||||
}
|
||||
|
||||
config_load firewall
|
||||
config_foreach add_service "service"
|
||||
@@ -1,12 +1,13 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
START=65
|
||||
STOP=10
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
|
||||
BBFDM_JSON_INPUT="/etc/bbfdm/input.json"
|
||||
BBFDM_TEMP_JSON="/tmp/bbfdm/input.json"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t bbfdmd.init -p info
|
||||
@@ -16,20 +17,21 @@ validate_bbfdm_bbfdmd_section()
|
||||
{
|
||||
uci_validate_section bbfdm bbfdmd "bbfdmd" \
|
||||
'enabled:bool:true' \
|
||||
'debug:bool:false' \
|
||||
'loglevel:uinteger' \
|
||||
'sock:string' \
|
||||
'refresh_time:uinteger' \
|
||||
'transaction_timeout:uinteger' \
|
||||
'debug:bool:false' \
|
||||
'loglevel:uinteger:1' \
|
||||
'refresh_time:uinteger:0' \
|
||||
'transaction_timeout:uinteger:30' \
|
||||
'subprocess_level:uinteger'
|
||||
}
|
||||
|
||||
configure_bbfdmd()
|
||||
{
|
||||
local enabled debug sock
|
||||
local enabled debug sock update
|
||||
local jlog jrefresh jtimeout jlevel
|
||||
|
||||
update=0
|
||||
config_load bbfdm
|
||||
|
||||
validate_bbfdm_bbfdmd_section || {
|
||||
log "Validation of bbfdmd section failed"
|
||||
return 1;
|
||||
@@ -37,22 +39,8 @@ configure_bbfdmd()
|
||||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
[ ! -f "${BBFDM_JSON_INPUT}" ] && return 0
|
||||
|
||||
if [ -n "${loglevel}" ]; then
|
||||
echo "$(jq --arg res ${loglevel} '.daemon.config += {"loglevel": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
fi
|
||||
|
||||
if [ -n "${refresh_time}" ]; then
|
||||
echo "$(jq --arg res ${refresh_time} '.daemon.config += {"refresh_time": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
fi
|
||||
|
||||
if [ -n "${transaction_timeout}" ]; then
|
||||
echo "$(jq --arg res ${transaction_timeout} '.daemon.config += {"transaction_timeout": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
fi
|
||||
|
||||
if [ -n "${subprocess_level}" ]; then
|
||||
echo "$(jq --arg res ${subprocess_level} '.daemon.config += {"subprocess_level": $res}' ${BBFDM_JSON_INPUT})" > ${BBFDM_JSON_INPUT}
|
||||
if [ -f "${BBFDM_JSON_INPUT}" ]; then
|
||||
echo "$(jq --arg log ${loglevel} --arg tran ${transaction_timeout} --arg refresh ${refresh_time} --arg level ${subprocess_level} '.daemon.config += {"loglevel": $log, "refresh_time": $refresh, "transaction_timeout": $tran, "subprocess_level": $level}' ${BBFDM_JSON_INPUT})" > ${BBFDM_TEMP_JSON}
|
||||
fi
|
||||
|
||||
procd_set_param command ${PROG}
|
||||
@@ -68,10 +56,18 @@ configure_bbfdmd()
|
||||
|
||||
start_service()
|
||||
{
|
||||
mkdir -p /tmp/bbfdm
|
||||
procd_open_instance "bbfdm"
|
||||
configure_bbfdmd
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bbfdm"
|
||||
|
||||
ubus call service state '{"name":"bbfdm.services", "spawn":true}'
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
ubus call service state '{"name":"bbfdm.services", "spawn":false}'
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
62
bbfdm/files/etc/uci-defaults/96-sysctl-translation
Executable file
62
bbfdm/files/etc/uci-defaults/96-sysctl-translation
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
bbfdm_sysctl_conf="/etc/bbfdm/sysctl.conf"
|
||||
|
||||
update_device_section() {
|
||||
local section="${1}"
|
||||
local dev_name="${2}"
|
||||
local ipv6="${3}"
|
||||
local name
|
||||
|
||||
# Get name value
|
||||
config_get name "${section}" name
|
||||
|
||||
# Retrun if the name value is different to the dev_name value
|
||||
[ "${name}" != "${dev_name}" ] && return
|
||||
|
||||
if [ "${ipv6}" = "0" ]; then
|
||||
ipv6="1"
|
||||
else
|
||||
ipv6="0"
|
||||
fi
|
||||
|
||||
# Add ipv6 option
|
||||
uci -q set network.${section}.ipv6="${ipv6}"
|
||||
}
|
||||
|
||||
parse_bbfdm_sysctl_conf_file() {
|
||||
# Check if the file exists
|
||||
[ -f "${bbfdm_sysctl_conf}" ] || return
|
||||
|
||||
# Create a temporary file
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
# Load network config
|
||||
config_load network
|
||||
|
||||
# Read each line of the file
|
||||
while read -r line; do
|
||||
if echo "$line" | grep -Eq '^net\.ipv6\.conf\.(.+)\.disable_ipv6=([0-1])$'; then
|
||||
name=$(echo "$line" | sed -n 's/^net\.ipv6\.conf\.\(.*\)\.disable_ipv6=[0-1]$/\1/p')
|
||||
value=$(echo "$line" | sed -n 's/^net\.ipv6\.conf\.\(.*\)\.disable_ipv6=\([0-1]\)$/\2/p')
|
||||
|
||||
config_foreach update_device_section device "${name}" "${value}"
|
||||
else
|
||||
# If the line doesn't match, preserve it in the temporary file
|
||||
echo "$line" >> "$tmpfile"
|
||||
fi
|
||||
done < "${bbfdm_sysctl_conf}"
|
||||
|
||||
# Replace the original file with the modified content
|
||||
mv "$tmpfile" "${bbfdm_sysctl_conf}"
|
||||
|
||||
# Apply the changes
|
||||
uci commit network
|
||||
sysctl -e -p "${bbfdm_sysctl_conf}" >&-
|
||||
}
|
||||
|
||||
parse_bbfdm_sysctl_conf_file
|
||||
|
||||
exit 0
|
||||
12
bbfdm/files/etc/uci-defaults/97-firewall-service
Normal file
12
bbfdm/files/etc/uci-defaults/97-firewall-service
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOT
|
||||
delete firewall.service_hook
|
||||
set firewall.service_hook=include
|
||||
set firewall.service_hook.path=/etc/firewall.service
|
||||
set firewall.service_hook.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
exit 0
|
||||
|
||||
18
bbfdm/files/etc/uci-defaults/99-link-core-plugins
Normal file
18
bbfdm/files/etc/uci-defaults/99-link-core-plugins
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
UNIFIED_PATH="/etc/bbfdm/plugins/"
|
||||
|
||||
# Link JSON plugins
|
||||
for f in `ls -1 /etc/bbfdm/json/*.json`; do
|
||||
echo "# BBFDM JSON plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
# Link DotSo plugins
|
||||
for f in `ls -1 /usr/lib/bbfdm/*.so`; do
|
||||
echo "# BBFDM DotSO plugin ${f} not aligned #"
|
||||
ln -s ${f} "${UNIFIED_PATH}"
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.0
|
||||
PKG_VERSION:=2.1.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=2dd55d9c9eb01ed1b11e16bad9e2c3e8badfffeb
|
||||
PKG_SOURCE_VERSION:=f556410b51a2248f11358793f11ae54d3e53e85e
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -43,9 +43,9 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bbfdm/json
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bulkdatad $(1)/usr/sbin/
|
||||
$(INSTALL_DIR) $(1)/etc/bulkdata
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbf_plugin/*.json $(1)/etc/bulkdata
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
|
||||
15
bulkdata/files/etc/bulkdata/input.json
Executable file
15
bulkdata/files/etc/bulkdata/input.json
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "JSON",
|
||||
"name": "/etc/bulkdata/bulkdata.json"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.bulkdata",
|
||||
"parent_dm": "Device.",
|
||||
"object": "BulkData",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
START=60
|
||||
STOP=10
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/bulkdatad"
|
||||
BULKDATA_JSON_INPUT="/etc/bulkdata/input.json"
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
@@ -12,12 +15,14 @@ start_service() {
|
||||
config_load bulkdata
|
||||
config_get_bool enable bulkdata enable 1
|
||||
|
||||
procd_open_instance bulkdata
|
||||
[ "$enable" -eq "1" ] && {
|
||||
procd_open_instance "bulkdata"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_set_param respawn
|
||||
procd_close_instance "bulkdata"
|
||||
}
|
||||
procd_close_instance
|
||||
|
||||
bbfdm_add_service "bbfdm.bulkdata" "${BULKDATA_JSON_INPUT}"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
@@ -6,13 +6,22 @@ STOP=20
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
if [ -e "/etc/config/mapagent" -o -e "/etc/config/mapcontroller" ]; then
|
||||
config_load mapagent
|
||||
config_get_bool agent_enabled agent enabled 1
|
||||
config_load mapcontroller
|
||||
config_get_bool controller_enabled controller enabled 1
|
||||
|
||||
if [ $agent_enabled -eq 1 -o $controller_enabled -eq 1 ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/capiagent" "-p 9000"
|
||||
procd_set_param limits core="unlimited"
|
||||
#procd_set_param respawn
|
||||
#procd_set_param stdout 1
|
||||
#procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
|
||||
@@ -2,6 +2,6 @@ menu "Configuration"
|
||||
|
||||
config DECOLLECTOR_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=4.0.2.5
|
||||
PKG_VERSION:=4.2.1.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=8b68886c505b2ddb78ce7c8d1dcd09e9d1bbb943
|
||||
PKG_SOURCE_VERSION:=ae836adb0779979686d0dad34b941f319ffed1b8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
@@ -7,7 +7,7 @@ USE_PROCD=1
|
||||
PROG=/usr/sbin/decollector
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for ieee1905 ieee1905.map topology
|
||||
ubus -t 2 wait_for ieee1905 ieee1905.map
|
||||
}
|
||||
|
||||
start_service() {
|
||||
@@ -17,10 +17,13 @@ start_service() {
|
||||
|
||||
config_load mapcontroller
|
||||
config_get en controller enabled "0"
|
||||
config_get collect_int controller de_collect_interval
|
||||
|
||||
[ -n "$collect_int" -a $collect_int -lt 30 ] && collect_int=""
|
||||
|
||||
[ $en -gt 0 ] && {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" "-d"
|
||||
procd_set_param command "$PROG" "-d" "${collect_int:+-t $collect_int}"
|
||||
#procd_set_param stdout 1
|
||||
#procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.5.11
|
||||
PKG_VERSION:=3.6.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=18dece420502e25a9bd9f3b534bc6c338fcc9377
|
||||
PKG_SOURCE_VERSION:=d9cc11c81ce1ff625e4e789afa180b301c7fcf74
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
|
||||
Binary file not shown.
@@ -302,6 +302,8 @@ xdsl_stop() {
|
||||
}
|
||||
|
||||
xdsl_init() {
|
||||
[ -d /sys/class/net/dsl0/ ] || exit
|
||||
|
||||
prioritize_arp
|
||||
|
||||
echo "Starting DSL"
|
||||
|
||||
@@ -26,10 +26,6 @@ stop_service() {
|
||||
}
|
||||
|
||||
boot() {
|
||||
local HASADSL="$(db -q get hw.board.hasAdsl)"
|
||||
local HASVDSL="$(db -q get hw.board.hasVdsl)"
|
||||
[ "$HASADSL" == "1" -o "$HASVDSL" == "1" ] || return
|
||||
|
||||
xdsl_init
|
||||
|
||||
start
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=2.1.0
|
||||
PKG_VERSION:=2.1.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
|
||||
PKG_SOURCE_VERSION:=b81d06867d895245ef47004c6949f9d6dedd10ef
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -23,7 +23,7 @@ define Package/ethmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Ethernet status and configration utility
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
DEPENDS:=+(TARGET_brcmbca||TARGET_airoha||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_mediatek):libethernet +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
endef
|
||||
|
||||
define Package/ethmngr/description
|
||||
@@ -37,19 +37,14 @@ TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
|
||||
ifeq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
|
||||
define Build/Compile
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/ethmngr/install
|
||||
$(CP) ./files/common/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_brcmbca),)
|
||||
$(CP) ./files/broadcom/* $(1)/
|
||||
else
|
||||
$(CP) ./files/linux/* $(1)/
|
||||
endif
|
||||
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_mediatek),)
|
||||
$(CP) ./files/* $(1)/
|
||||
ifneq ($(CONFIG_TARGET_brcmbca)$(CONFIG_TARGET_airoha)$(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx)$(CONFIG_TARGET_mediatek),)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ethmngr $(1)/usr/sbin/
|
||||
endif
|
||||
|
||||
@@ -1,144 +0,0 @@
|
||||
# arg1: port ifname, ex: eth0
|
||||
get_max_port_speed() {
|
||||
if [ -z "$1" ]; then
|
||||
echo 0
|
||||
return
|
||||
fi
|
||||
|
||||
local ifname="$1"
|
||||
local phycap="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
|
||||
local speed=1000
|
||||
|
||||
case "$phycap" in
|
||||
10GFD*) speed=10000 ;;
|
||||
5GFD*) speed=5000 ;;
|
||||
2.5GFD*) speed=2500 ;;
|
||||
1GFD*) speed=1000 ;;
|
||||
100MFD*|100MHD*) speed=100 ;;
|
||||
10MFD*|10MHD*) speed=10 ;;
|
||||
esac
|
||||
|
||||
echo $speed
|
||||
}
|
||||
|
||||
# arg1: port name, ex: eth0
|
||||
get_port_number() {
|
||||
[ -z "$1" ] && return
|
||||
local ports="0 1 2 3 4 5 6 7 8"
|
||||
local units="0 1"
|
||||
local port="$1"
|
||||
local ifname
|
||||
|
||||
for unit in $units; do
|
||||
for prt in $ports; do
|
||||
ifname="$(ethswctl getifname $unit $prt 2>/dev/null | awk '{print$NF}')"
|
||||
if [ "$ifname" == "$port" ]; then
|
||||
echo "$unit $prt"
|
||||
return
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
reset_port() {
|
||||
local ifname="$1"
|
||||
ethctl $ifname phy-reset >/dev/null
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
power_updown() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
|
||||
local updown="up"
|
||||
[ $enabled -eq 0 ] && updown="down"
|
||||
ethctl $ifname phy-power $updown >/dev/null
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
# arg3: port speed, ex: 1000
|
||||
# arg4: port duplex, ex: full
|
||||
# arg5: port autoneg, ex: on
|
||||
# arg6: port eee, ex: 0
|
||||
# arg7: port pause, ex: 0
|
||||
set_port_settings() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
local speed="$3"
|
||||
local duplex=$4
|
||||
local autoneg=$5
|
||||
local eee=$6
|
||||
local pause=$7
|
||||
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
local unitport="$(get_port_number $ifname)"
|
||||
local unit=$(echo $unitport | cut -d ' ' -f 1)
|
||||
local port=$(echo $unitport | cut -d ' ' -f 2)
|
||||
|
||||
[ $autoneg -eq 1 ] && autoneg="on" || autoneg="off"
|
||||
[ "$duplex" == "half" ] && duplex=0 || duplex=1
|
||||
[ "$duplex" == 0 ] && dplx="HD" || dplx="FD"
|
||||
[ "$autoneg" == "on" ] && media_type="auto" || media_type="$speed$dplx"
|
||||
|
||||
phycaps="$(ethctl $ifname media-type 2>/dev/null | grep 'PHY Speed Capabilities' | awk '{print$NF}')"
|
||||
numofcaps="$(echo $phycaps | tr ':' ' ' | wc -w)"
|
||||
|
||||
# Reset the port before setting new params
|
||||
reset_port $ifname
|
||||
|
||||
if [ "$numofcaps" == "1" ]; then
|
||||
logger -t "ethmngr" "$ifname is capable of $phycaps only; not setting speed/duplex"
|
||||
else
|
||||
logger -t "ethmngr" "$ifname is capable of $phycaps; setting speed/duplex to $media_type"
|
||||
ethctl $ifname media-type $media_type ${pyhendpoint:+ port $pyhendpoint} &>/dev/null
|
||||
fi
|
||||
|
||||
[ $eee -eq 1 ] && eee="on" || eee="off"
|
||||
ethtool --set-eee $ifname eee $eee 2>/dev/null
|
||||
|
||||
case $pause in
|
||||
off|0)
|
||||
pause=0x0
|
||||
auto=off
|
||||
rx=off
|
||||
tx=off
|
||||
;;
|
||||
on|1)
|
||||
pause=0x2
|
||||
auto=off
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
auto)
|
||||
pause=0x1
|
||||
auto=on
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
tx)
|
||||
pause=0x3
|
||||
auto=off
|
||||
rx=off
|
||||
tx=on
|
||||
;;
|
||||
rx)
|
||||
pause=0x4
|
||||
auto=off
|
||||
rx=on
|
||||
tx=off
|
||||
;;
|
||||
esac
|
||||
if [ "$auto" == "on" ]; then
|
||||
# Use ethswctl utility to set pause autoneg
|
||||
# as ethtool is not setting it properly
|
||||
ethswctl -c pause -n $unit -p $port -v $pause 2>&1 >/dev/null
|
||||
else
|
||||
ethtool --pause $ifname autoneg $auto rx $rx tx $tx 2>/dev/null
|
||||
fi
|
||||
|
||||
power_updown $ifname $enabled
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=15
|
||||
STOP=90
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ethmngr
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/ethernet
|
||||
|
||||
configure_ethernet_port(){
|
||||
local cfg=$1
|
||||
local ifname enabled speed duplex autoneg eee pause
|
||||
|
||||
config_get ifname $cfg ifname
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
config_get enabled $cfg enabled 1
|
||||
config_get speed $cfg speed 1000
|
||||
config_get duplex $cfg duplex "full"
|
||||
config_get autoneg $cfg autoneg 1
|
||||
config_get eee $cfg eee 0
|
||||
config_get pause $cfg pause 0
|
||||
|
||||
set_port_settings $ifname $enabled $speed $duplex $autoneg $eee $pause
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ -s /etc/config/ports ]; then
|
||||
config_load ports
|
||||
config_foreach configure_ethernet_port ethport
|
||||
fi
|
||||
|
||||
if [ -f $PROG ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger ports
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
populate_config_from_db() {
|
||||
. /lib/functions.sh
|
||||
. /lib/network/utils.sh
|
||||
include /lib/ethernet
|
||||
|
||||
portorder="$(db -q get hw.board.ethernetPortOrder)"
|
||||
for port in $portorder; do
|
||||
speed="$(get_max_port_speed $port 2>/dev/null)"
|
||||
speed="${speed:-1000}"
|
||||
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$(get_port_name $port)"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].duplex="full"
|
||||
uci set ports.@ethport[-1].autoneg=1
|
||||
uci set ports.@ethport[-1].eee=0
|
||||
if [ "$(db -q get hw.board.ethernetWanPort)" = "$port" ]; 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
|
||||
}
|
||||
|
||||
populate_config_from_device_tree() {
|
||||
for path in $(find /proc/device-tree/ -name "port@*"); do
|
||||
port="$(cat $path/label)"
|
||||
[ -n "$port" ] || continue
|
||||
[ "$port" = "cpu" ] && continue
|
||||
speed=1000
|
||||
if [ -e "$path/phy-mode" ]; then
|
||||
phymode="$(cat $path/phy-mode)"
|
||||
case "$phymode" in
|
||||
10000*) speed=10000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
esac
|
||||
fi
|
||||
PORT="$(echo $port | tr '[a-z]' '[A-Z]')"
|
||||
uci add ports ethport
|
||||
uci rename ports.@ethport[-1]="$PORT"
|
||||
uci set ports.@ethport[-1].enabled=1
|
||||
uci set ports.@ethport[-1].name="$PORT"
|
||||
uci set ports.@ethport[-1].ifname="$port"
|
||||
uci set ports.@ethport[-1].speed="$speed"
|
||||
uci set ports.@ethport[-1].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 -a -n "$(db get hw.board.ethernetPortOrder 2>/dev/null)" ]; then
|
||||
populate_config_from_db
|
||||
elif [ -d /proc/device-tree/ ]; then
|
||||
populate_config_from_device_tree
|
||||
fi
|
||||
28
ethmngr/files/etc/init.d/ethmngr
Executable file
28
ethmngr/files/etc/init.d/ethmngr
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=15
|
||||
STOP=90
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ethmngr
|
||||
|
||||
. /lib/functions.sh
|
||||
include /lib/ethernet
|
||||
|
||||
start_service() {
|
||||
if [ -f $PROG ]; then
|
||||
procd_open_instance
|
||||
procd_set_param command ${PROG}
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger network
|
||||
}
|
||||
@@ -1,95 +0,0 @@
|
||||
# arg1: port ifname, ex: eth0
|
||||
get_max_port_speed() {
|
||||
if [ -z "$1" ]; then
|
||||
echo 0
|
||||
return
|
||||
fi
|
||||
|
||||
local ifname="$1"
|
||||
local phycap="$(ethtool $ifname | grep -A 10 "Supported link modes" | grep 00 | tail -n 1 | awk '{print$NF}')"
|
||||
local speed=1000
|
||||
|
||||
case "$phycap" in
|
||||
10000*) speed=10000 ;;
|
||||
5000*) speed=5000 ;;
|
||||
2500*) speed=2500 ;;
|
||||
1000*) speed=1000 ;;
|
||||
100*) speed=100 ;;
|
||||
10*) speed=10 ;;
|
||||
esac
|
||||
|
||||
echo $speed
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
power_updown() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
|
||||
local updown="up"
|
||||
[ $enabled -eq 0 ] && updown="down"
|
||||
ip link set dev $ifname $updown
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
# arg3: port speed, ex: 1000
|
||||
# arg4: port duplex, ex: full
|
||||
# arg5: port autoneg, ex: on
|
||||
# arg6: port eee, ex: 0
|
||||
# arg7: port pause, ex: 0
|
||||
set_port_settings() {
|
||||
local ifname="$1"
|
||||
local enabled=$2
|
||||
local speed="$3"
|
||||
local duplex=$4
|
||||
local autoneg=$5
|
||||
local eee=$6
|
||||
local pause=$7
|
||||
|
||||
[ -d /sys/class/net/$ifname ] || return
|
||||
|
||||
[ $autoneg -eq 1 ] && autoneg="on" || autoneg="off"
|
||||
ethtool --change $ifname speed $speed duplex $duplex autoneg $autoneg
|
||||
|
||||
[ $eee -eq 1 ] && eee="on" || eee="off"
|
||||
ethtool --set-eee $ifname eee $eee 2>/dev/null
|
||||
|
||||
case $pause in
|
||||
off|0)
|
||||
pause=0x0
|
||||
auto=off
|
||||
rx=off
|
||||
tx=off
|
||||
;;
|
||||
on|1)
|
||||
pause=0x2
|
||||
auto=off
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
auto)
|
||||
pause=0x1
|
||||
auto=on
|
||||
rx=on
|
||||
tx=on
|
||||
;;
|
||||
tx)
|
||||
pause=0x3
|
||||
auto=off
|
||||
rx=off
|
||||
tx=on
|
||||
;;
|
||||
rx)
|
||||
pause=0x4
|
||||
auto=off
|
||||
rx=on
|
||||
tx=off
|
||||
;;
|
||||
esac
|
||||
|
||||
ethtool --pause $ifname autoneg $auto rx $rx tx $tx 2>/dev/null
|
||||
|
||||
power_updown $ifname $enabled
|
||||
}
|
||||
42
fscryptctl/Makefile
Normal file
42
fscryptctl/Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fscryptctl
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/google/fscryptctl.git
|
||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=Encryption
|
||||
TITLE:=Fscryptctl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
fscryptctl is a low-level tool written in C that handles raw keys and manages policies for Linux filesystem encryption,
|
||||
specifically the "fscrypt" kernel interface which is supported by the ext4, f2fs, and UBIFS filesystems
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
CC="$(TARGET_CC)" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
fscryptctl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fscryptctl $(1)/usr/bin/fscryptctl
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
15
hostmngr/Config.in
Normal file
15
hostmngr/Config.in
Normal file
@@ -0,0 +1,15 @@
|
||||
if (PACKAGE_hostmngr)
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config HOSTMNGR_HOSTS_HISTORY
|
||||
bool "Keep history of hosts"
|
||||
default y
|
||||
|
||||
config HOSTMNGR_PLATFORM_HAS_WIFI
|
||||
bool "Platform has WiFi"
|
||||
default y if PACKAGE_libwifi
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
76
hostmngr/Makefile
Normal file
76
hostmngr/Makefile
Normal file
@@ -0,0 +1,76 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=edb5bbe57c5bc83035e217c73071c9b3e878dc22
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/hostmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
define Package/hostmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Show and manage hosts in the network
|
||||
DEPENDS= +libubox +libuci +libubus +ubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libnfnetlink +libmnl \
|
||||
+libnetfilter-conntrack \
|
||||
+HOSTMNGR_PLATFORM_HAS_WIFI:libwifi +libbbfdm-api
|
||||
|
||||
endef
|
||||
|
||||
define Package/hostmngr/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/hostmngr/description
|
||||
This package provides hostmngr that can detect and show host devices
|
||||
present in the network.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-I$(STAGING_DIR)/usr/include/libnetfilter_conntrack \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_HOSTMNGR_PLATFORM_HAS_WIFI),y)
|
||||
TARGET_CFLAGS += -DHAS_WIFI
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/hostmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/hostmngr/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/hostmngr $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1)/etc/hostmngr/
|
||||
$(INSTALL_DATA) ./files/etc/hostmngr/input.json $(1)/etc/hostmngr/
|
||||
$(INSTALL_DIR) $(1)/usr/share/hostmngr
|
||||
$(INSTALL_DATA) ./files/scripts/hosts_acl.sh $(1)/usr/share/hostmngr/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/hostmngr/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,hostmngr))
|
||||
9
hostmngr/files/etc/config/hosts
Normal file
9
hostmngr/files/etc/config/hosts
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
config global 'global'
|
||||
option enabled '1'
|
||||
option history '1'
|
||||
option history_file '/etc/hosts_history.json'
|
||||
option history_timeout '86400'
|
||||
|
||||
config interface
|
||||
list ifname 'br-lan'
|
||||
3
hostmngr/files/etc/firewall.hosts
Normal file
3
hostmngr/files/etc/firewall.hosts
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
sh /usr/share/hostmngr/hosts_acl.sh
|
||||
16
hostmngr/files/etc/hostmngr/input.json
Normal file
16
hostmngr/files/etc/hostmngr/input.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"daemon": {
|
||||
"input": {
|
||||
"type": "DotSo",
|
||||
"name": "/etc/hostmngr/libhostmngr.so"
|
||||
},
|
||||
"output": {
|
||||
"type": "UBUS",
|
||||
"name": "bbfdm.hosts",
|
||||
"parent_dm": "Device.",
|
||||
"object": "Hosts",
|
||||
"root_obj": "bbfdm"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
hostmngr/files/etc/init.d/hostmngr
Executable file
33
hostmngr/files/etc/init.d/hostmngr
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=65
|
||||
STOP=20
|
||||
|
||||
. /etc/bbfdm/bbfdm_services.sh
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
HOSTS_JSON_INPUT="/etc/hostmngr/input.json"
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/hostmngr" "--config hosts" "-o" "/tmp/hostmngr.log" "-f"
|
||||
# procd_set_param respawn
|
||||
procd_set_param limits core="unlimited"
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
|
||||
bbfdm_add_service "bbfdm.hosts" "${HOSTS_JSON_INPUT}"
|
||||
sh /usr/share/hostmngr/hosts_acl.sh
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "hosts"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q get hosts.global.ageing_timer || exit 0
|
||||
|
||||
|
||||
# Old hosts UCI config is detected; Convert to new format
|
||||
|
||||
ageing_timer="$(uci -q get hosts.global.ageing_timer)"
|
||||
history_timeout=$((ageing_timer*60))
|
||||
|
||||
uci -q set hosts.global.enabled=1
|
||||
uci -q delete hosts.global.ageing_timer
|
||||
uci -q set hosts.global.history_timeout="$history_timeout"
|
||||
uci -q rename hosts.global.reboot_persistent=history
|
||||
uci -q set hosts.global.history_file="/etc/hosts_history.json"
|
||||
|
||||
uci -q add hosts interface
|
||||
for ifname in $(uci -q get hosts.global.ifname); do
|
||||
uci -q add_list hosts.@interface[-1].ifname="$ifname"
|
||||
done
|
||||
|
||||
uci -q delete hosts.global.ifname
|
||||
exit 0
|
||||
233
hostmngr/files/scripts/hosts_acl.sh
Executable file
233
hostmngr/files/scripts/hosts_acl.sh
Executable file
@@ -0,0 +1,233 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
get_next_day() {
|
||||
local weekday="$1"
|
||||
case "$weekday" in
|
||||
"Mon"|"Monday") echo "Tuesday"
|
||||
;;
|
||||
"Tue"|"Tuesday") echo "Wednesday"
|
||||
;;
|
||||
"Wed"|"Wednesday") echo "Thursday"
|
||||
;;
|
||||
"Thu"|"Thursday") echo "Friday"
|
||||
;;
|
||||
"Fri"|"Friday") echo "Saturday"
|
||||
;;
|
||||
"Sat"|"Saturday") echo "Sunday"
|
||||
;;
|
||||
"Sun"|"Sunday") echo "Monday"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
get_previous_day() {
|
||||
local weekday="$1"
|
||||
case "$weekday" in
|
||||
"Mon"|"Monday") echo "Sunday"
|
||||
;;
|
||||
"Tue"|"Tuesday") echo "Monday"
|
||||
;;
|
||||
"Wed"|"Wednesday") echo "Tuesday"
|
||||
;;
|
||||
"Thu"|"Thursday") echo "Wednesday"
|
||||
;;
|
||||
"Fri"|"Friday") echo "Thursday"
|
||||
;;
|
||||
"Sat"|"Saturday") echo "Friday"
|
||||
;;
|
||||
"Sun"|"Sunday") echo "Saturday"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ip_rule_west_zone() {
|
||||
local utc_start_t_h="$1"
|
||||
local utc_stop_t_h="$2"
|
||||
local local_start_t_h="$3"
|
||||
local local_stop_t_h="$4"
|
||||
local utc_start_time="$5"
|
||||
local utc_stop_time="$6"
|
||||
|
||||
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
if [ -n "$next_days" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $next_days"
|
||||
fi
|
||||
else
|
||||
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
|
||||
IP_RULE1="$IP_RULE"
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop 23:59"
|
||||
IP_RULE1="$IP_RULE1 -m time --timestart 00:00 --timestop $utc_stop_time"
|
||||
if [ -n "$next_days" ]; then
|
||||
IP_RULE1="$IP_RULE1 --weekdays $next_days"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
fi
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ip_rule_east_zone() {
|
||||
local utc_start_t_h="$1"
|
||||
local utc_stop_t_h="$2"
|
||||
local local_start_t_h="$3"
|
||||
local local_stop_t_h="$4"
|
||||
local utc_start_time="$5"
|
||||
local utc_stop_time="$6"
|
||||
|
||||
if [ "$utc_start_t_h" -lt "$local_start_t_h" ]; then
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
else
|
||||
if [ "$utc_stop_t_h" -lt "$local_stop_t_h" ]; then
|
||||
IP_RULE1="$IP_RULE"
|
||||
IP_RULE="$IP_RULE -m time --timestart 00:00 --timestop $utc_stop_time"
|
||||
IP_RULE1="$IP_RULE1 -m time --timestart $utc_start_time --timestop 23:59"
|
||||
if [ -n "$prev_days" ]; then
|
||||
IP_RULE1="$IP_RULE1 --weekdays $prev_days"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -m time --timestart $utc_start_time --timestop $utc_stop_time"
|
||||
fi
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
local access_control
|
||||
local start_time=""
|
||||
local mac=""
|
||||
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
next_day_val=$(get_next_day $val)
|
||||
prev_day_val=$(get_previous_day $val)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
next_days="$next_day_val"
|
||||
prev_days="$prev_day_val"
|
||||
else
|
||||
day="$day,$val"
|
||||
next_days="$next_days,$next_day_val"
|
||||
prev_days="$prev_days,$prev_day_val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
IP_RULE1=""
|
||||
|
||||
config_get is_enabled "$access_control" "enable" 1
|
||||
if [ "$is_enabled" == "0" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
zone=$(date +%z | cut -c 1)
|
||||
local_start_time=$start_time
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $local_start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $local_start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
local_start_hh=$hh
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
mm=$(( rem_ss / 60 ))
|
||||
ss=$(( rem_ss % 60 ))
|
||||
local_stop_time="$hh:$mm:$ss"
|
||||
local_stop_hh=$hh
|
||||
fi
|
||||
|
||||
utc_start_time=$(date -u -d @$(date "+%s" -d "$local_start_time") +%H:%M)
|
||||
utc_stop_time=$(date -u -d @$(date "+%s" -d "$local_stop_time") +%H:%M)
|
||||
utc_start_hh=$(echo $utc_start_time | awk -F: '{ print $1 }')
|
||||
utc_stop_hh=$(echo $utc_stop_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "-" ]; then
|
||||
ip_rule_west_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
else
|
||||
ip_rule_east_zone $utc_start_hh $utc_stop_hh $local_start_hh $local_stop_hh $utc_start_time $utc_stop_time
|
||||
fi
|
||||
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j DROP"
|
||||
fi
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
IP_RULE1="$IP_RULE1 -j ACCEPT"
|
||||
fi
|
||||
fi
|
||||
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
if [ -n "$IP_RULE1" ]; then
|
||||
iptables -w -A hosts_forward ${IP_RULE1}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE1}
|
||||
fi
|
||||
|
||||
day=""
|
||||
next_days=""
|
||||
prev_days=""
|
||||
}
|
||||
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
hosts_forward=$(iptables -t filter --list | grep hosts_forward)
|
||||
if [ -z "$hosts_forward" ]; then
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
fi
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
@@ -8,21 +8,23 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.3.8
|
||||
PKG_VERSION:=9.5.27
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=09b7cd7a6b647dd8cbc038698af9298883b5c262
|
||||
PKG_SOURCE_VERSION:=ce1f7e01f0f5e7cc3a5dfeb5378d488f3e2938a0
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/icwmp/default
|
||||
SECTION:=utils
|
||||
@@ -79,10 +81,9 @@ ifeq ($(BUILD_VARIANT),mbedtls)
|
||||
CMAKE_OPTIONS += -DWITH_MBEDTLS=ON
|
||||
endif
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
ifneq ($(USE_LOCAL),)
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
@@ -93,21 +94,19 @@ define Package/icwmp/default/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json/
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libcwmpdm.so $(1)/usr/lib/bbfdm/libcwmpdm.so
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-set-random-inform-time $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1)/etc/bbfdm/json/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/CWMPManagementServer.json)
|
||||
$(call BbfdmInstallPlugin,$(1),$(PKG_BUILD_DIR)/libcwmpdm.so)
|
||||
endef
|
||||
|
||||
Package/icwmp/install = $(Package/icwmp/default/install)
|
||||
|
||||
@@ -11,6 +11,7 @@ config acs 'acs'
|
||||
option retry_min_wait_interval '5'
|
||||
# possible configs interval :[1000:65535]
|
||||
option retry_interval_multiplier '2000'
|
||||
option skip_dhcp_boot_options '0'
|
||||
|
||||
config cpe 'cpe'
|
||||
option enable '1'
|
||||
@@ -20,7 +21,7 @@ config cpe 'cpe'
|
||||
option log_to_file 'disable'
|
||||
# log_severity: INFO (Default)
|
||||
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
|
||||
option log_severity 'INFO'
|
||||
option log_severity 'ERROR'
|
||||
option log_file_name '/var/log/icwmpd.log'
|
||||
option log_max_size '102400'
|
||||
option userid '' #$OUI-$SER
|
||||
@@ -37,8 +38,10 @@ config cpe 'cpe'
|
||||
option periodic_notify_interval '10'
|
||||
option incoming_rule 'Port_Only'
|
||||
option active_notif_throttle '0'
|
||||
option disable_gatewayinfo '0'
|
||||
option fw_upgrade_keep_settings '1'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '1'
|
||||
option enable '0'
|
||||
option hostname ''
|
||||
option port '0'
|
||||
|
||||
@@ -5,46 +5,58 @@ log() {
|
||||
echo "${@}"|logger -t firewall.cwmp -p info
|
||||
}
|
||||
|
||||
if [ ! -f "/var/state/icwmp" ]; then
|
||||
get_firewall_zone() {
|
||||
zone="$(uci show firewall|grep network|grep ${1}|cut -d. -f 2)"
|
||||
zone="${zone:-wan}" # defaults to wan zone
|
||||
echo "$zone"
|
||||
}
|
||||
|
||||
cleanup_exiting_rules() {
|
||||
while iptables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Open_ACS_port"; do
|
||||
rule_num="$(iptables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Open_ACS_port" | head -1|awk '{print $1}')"
|
||||
if [ -n "${rule_num}" ]; then
|
||||
iptables -w 1 -D zone_"${1}"_input "${rule_num}";
|
||||
fi
|
||||
done
|
||||
while ip6tables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Open_ACS_port"; do
|
||||
rule_num="$(ip6tables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Open_ACS_port" | head -1|awk '{print $1}')"
|
||||
if [ -n "${rule_num}" ]; then
|
||||
ip6tables -w 1 -D zone_"${1}"_input "${rule_num}";
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
enable="$(uci -q get cwmp.cpe.enable)"
|
||||
enable="${enable:-1}"
|
||||
|
||||
if [ "$enable" -eq 0 ]; then
|
||||
log "CWMP not enabled"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
zone_name=$(uci -c /var/state -q get icwmp.acs.zonename)
|
||||
wan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
||||
wan="${wan:-wan}"
|
||||
|
||||
zone_name="$(get_firewall_zone $wan)"
|
||||
|
||||
port=$(uci -q get cwmp.cpe.port)
|
||||
port="${port:-7547}"
|
||||
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|awk '{print tolower($0)}')
|
||||
incoming_rule="${incoming_rule:-port_only}"
|
||||
|
||||
ipaddr=$(uci -c /var/state -q get icwmp.acs.ip)
|
||||
ip6addr=$(uci -c /var/state -q get icwmp.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 -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 -w 1 -F zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport "${port}" -j REJECT
|
||||
fi
|
||||
else
|
||||
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
|
||||
|
||||
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}"
|
||||
fi
|
||||
if [ -n "${ip6addr}" ]; then
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
@@ -55,6 +67,9 @@ elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
|
||||
if [ -n "${ip6addr}" ]; then
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
|
||||
@@ -64,17 +79,23 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
cleanup_exiting_rules "${zone_name}"
|
||||
|
||||
echo "${cmd}"|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd}
|
||||
log "Applied [${cmd}]"
|
||||
fi
|
||||
|
||||
echo "${cmd6}"|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd6="${cmd6} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd6}
|
||||
log "Applied [${cmd6}]"
|
||||
fi
|
||||
|
||||
uci -c /var/state -q set icwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit icwmp
|
||||
if [ -f "/var/state/icwmp" ]; then
|
||||
uci -c /var/state -q set icwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit icwmp
|
||||
fi
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/sh
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "$@" |logger -t cwmp.update -p info
|
||||
}
|
||||
|
||||
handle_icwmp_update() {
|
||||
local cwmp_enable
|
||||
config_load cwmp
|
||||
|
||||
config_get_bool cwmp_enable cpe enable 1
|
||||
if [ "$cwmp_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# wait for some time to avoid interface fluctuation
|
||||
sleep 10
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
|
||||
if [ "$ret" = "true" ]; then
|
||||
# read status from var/state/icwmp
|
||||
status=$(uci -q -c /var/state get icwmp.sess_status.current_status)
|
||||
if [ "$status" != "running" ]; then
|
||||
log "Trigger out of bound inform, since last inform status was failure"
|
||||
ubus -t 10 call tr069 inform >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
log "Restarting icwmp tr069 object"
|
||||
/etc/init.d/icwmpd restart
|
||||
fi
|
||||
}
|
||||
|
||||
handle_icwmp_update "$@"
|
||||
@@ -98,7 +98,11 @@ configure_send_op125() {
|
||||
if [ "${uci}" = "network" ]; then
|
||||
local opt125="125:00:00:0D:E9"
|
||||
else
|
||||
local opt125="125,00:00:0D:E9"
|
||||
if [ -z "${sendopt}" ]; then
|
||||
local opt125="125,00:00:0D:E9"
|
||||
else
|
||||
local opt125=":00:00:0D:E9"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_get oui cpe manufacturer_oui ""
|
||||
@@ -178,10 +182,94 @@ configure_send_op125() {
|
||||
new_send_opt="$sendopt $opt125"
|
||||
uci -q set network."${intf}".sendopts="$new_send_opt"
|
||||
else
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$opt125"
|
||||
new_send_opt="$sendopt$opt125"
|
||||
uci -q add_list dhcp."${intf}".dhcp_option="$new_send_opt"
|
||||
fi
|
||||
}
|
||||
|
||||
check_for_suboptions() {
|
||||
# Check if option 4 and 5 present inside enterprise id 3561
|
||||
data=$(echo "${1}" | sed 's/://g')
|
||||
len=$(printf "${data}"|wc -c)
|
||||
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 8 ]; do
|
||||
subopt_present=0
|
||||
|
||||
ent_id="${data:0:8}"
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
if [ $ent_id -ne 3561 ]; then
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
len_val=${data:8:2}
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
if [ $opt_len -eq 0 ]; then
|
||||
echo ${subopt_present}
|
||||
return 0
|
||||
fi
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
while [ $sub_data_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${sub_data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
case "${sub_opt_id}" in
|
||||
"4") subopt_present=1
|
||||
;;
|
||||
"5") subopt_present=1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ${subopt_present} -eq 1 ]; then
|
||||
break;
|
||||
fi
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
sub_data_len=$((sub_data_len - sub_opt_end))
|
||||
|
||||
# fetch next sub option hex string
|
||||
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
|
||||
done
|
||||
|
||||
if [ ${subopt_present} -eq 1 ]; then
|
||||
break;
|
||||
else
|
||||
# move ahead data to next enterprise id
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
fi
|
||||
done
|
||||
|
||||
echo ${subopt_present}
|
||||
}
|
||||
|
||||
enable_dnsmasq_option125() {
|
||||
local lan="${1}"
|
||||
local send125_present=0
|
||||
@@ -190,16 +278,19 @@ enable_dnsmasq_option125() {
|
||||
local proto="$(uci -q get dhcp."${lan}".dhcpv4)"
|
||||
if [ "${proto}" = "server" ]; then
|
||||
opt_list="$(uci -q get dhcp."${lan}".dhcp_option)"
|
||||
base_opt=""
|
||||
|
||||
for sopt in $opt_list; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=1
|
||||
send125_present=$(check_for_suboptions "${sopt:4}")
|
||||
base_opt="${sopt}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
configure_send_op125 "" "${lan}" "dhcp"
|
||||
uci -q del_list dhcp."${lan}".dhcp_option="${base_opt}"
|
||||
configure_send_op125 "${base_opt}" "${lan}" "dhcp"
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
fi
|
||||
fi
|
||||
@@ -316,6 +407,7 @@ validate_acs_section()
|
||||
'periodic_inform_time:string' \
|
||||
'url:string' \
|
||||
'dhcp_discovery:string' \
|
||||
'skip_dhcp_boot_options:bool:0' \
|
||||
'dhcp_url:string' \
|
||||
'compression:or("GZIP","Deflate","Disabled")' \
|
||||
'retry_min_wait_interval:range(1, 65535)' \
|
||||
@@ -345,7 +437,8 @@ validate_cpe_section()
|
||||
'exec_download:bool' \
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool' \
|
||||
'periodic_notify_interval:uinteger'
|
||||
'periodic_notify_interval:uinteger' \
|
||||
'fw_upgrade_keep_settings:bool'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
@@ -376,33 +469,32 @@ validate_defaults() {
|
||||
}
|
||||
|
||||
boot() {
|
||||
local enable_cwmp="0"
|
||||
local dhcp_discovery="0"
|
||||
local dhcp_discovery wan_interface skip_dhcp_boot_options disable_gatewayinfo
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
local wan_interface=""
|
||||
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
config_get disable_gatewayinfo cpe disable_gatewayinfo "0"
|
||||
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get skip_dhcp_boot_options acs skip_dhcp_boot_options "0"
|
||||
|
||||
if [ "${dhcp_discovery}" = "enable" ] || [ "${dhcp_discovery}" = "1" ]; then
|
||||
# Set dhcp option 43 if not already configured
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
# Set dhcp option 60
|
||||
set_vendor_id "${wan_interface}"
|
||||
if [ "${skip_dhcp_boot_options}" -ne 1 ]; then
|
||||
# Set dhcp option 43 if not already configured
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
# Set dhcp option 60
|
||||
set_vendor_id "${wan_interface}"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_get lan_interface cpe default_lan_interface ""
|
||||
if [ -n "${lan_interface}" ]; then
|
||||
# Set dhcp_option 125 if not already configured
|
||||
enable_dhcp_option125 "${wan_interface}"
|
||||
enable_dnsmasq_option125 "${lan_interface}"
|
||||
if [ "${disable_gatewayinfo}" -ne 1 ]; then
|
||||
# Set dhcp_option 125 if not already configured
|
||||
enable_dhcp_option125 "${wan_interface}"
|
||||
enable_dnsmasq_option125 "${lan_interface}"
|
||||
fi
|
||||
fi
|
||||
|
||||
config_get ssl_capath acs ssl_capath
|
||||
@@ -420,27 +512,31 @@ boot() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable_cwmp
|
||||
local enable_cwmp url dhcp_url
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get url acs url ""
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
|
||||
procd_open_instance icwmp
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
procd_close_instance
|
||||
return 0
|
||||
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
|
||||
|
||||
validate_defaults || {
|
||||
log "Validation of defaults failed"
|
||||
procd_close_instance
|
||||
return 1;
|
||||
}
|
||||
|
||||
procd_open_instance icwmp
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
if [ -n "${url}" ] || [ -n "${dhcp_url}" ]; then
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
fi
|
||||
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
@@ -460,6 +556,7 @@ reload_service() {
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
|
||||
log "Reload service $ret"
|
||||
ret="0"
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
stop
|
||||
@@ -467,38 +564,15 @@ reload_service() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
tr069_status="$(ubus -t 1 call tr069 status)"
|
||||
ret="$?"
|
||||
if [ "$ret" = "7" ]; then
|
||||
# ubus timed out may be due to uloop is busy in some task so returning
|
||||
return 0
|
||||
fi
|
||||
|
||||
status="$(echo "${tr069_status}" | jsonfilter -qe '@.cwmp.status')"
|
||||
ret="$?"
|
||||
if [ "$status" = "up" ]; then
|
||||
ubus -t 1 call tr069 command '{"command":"reload"}'
|
||||
ret="$?"
|
||||
fi
|
||||
|
||||
if [ "$status" = "init" ] || [ "$ret" -ne "0" ]; then
|
||||
log "Restarting CWMP client"
|
||||
ret=$(ubus call service list '{"name":"icwmpd"}' | jsonfilter -qe '@.icwmpd.instances.icwmp.running')
|
||||
if [ "$ret" != "true" ]; then
|
||||
log "Reloading cwmp service ..."
|
||||
stop
|
||||
start
|
||||
fi
|
||||
}
|
||||
|
||||
add_interface_trigger() {
|
||||
procd_add_interface_trigger "interface.update" "$1" /etc/icwmpd/update.sh
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
local wan_interface
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
procd_add_reload_trigger "cwmp"
|
||||
add_interface_trigger ${default_wan_interface}
|
||||
}
|
||||
|
||||
|
||||
20
icwmp/files/etc/uci-defaults/95-set-random-inform-time
Normal file
20
icwmp/files/etc/uci-defaults/95-set-random-inform-time
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_inform_time()
|
||||
{
|
||||
local sec inform_time value
|
||||
|
||||
config_load cwmp
|
||||
config_get inform_time acs periodic_inform_time '0001-01-01T00:00:00Z'
|
||||
|
||||
if [ "${inform_time}" == "0001-01-01T00:00:00Z" ]; then
|
||||
sec=$(date +%s)
|
||||
value="$(date -d @$(($sec-$RANDOM)) +%Y-%m-%dT%H:%M:%SZ)"
|
||||
|
||||
uci_set cwmp acs periodic_inform_time "$value"
|
||||
fi
|
||||
}
|
||||
|
||||
set_inform_time
|
||||
@@ -20,7 +20,6 @@ config IEEE1905_WIFI_EASYMESH
|
||||
|
||||
config IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
|
||||
bool "Fragment large CMDU frame at TLV boundary instead of octet boundary"
|
||||
default y
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.1.15
|
||||
PKG_VERSION:=8.3.4
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=a6d1c5c3e6a23129ce260613cadfaad3b2b31cc8
|
||||
PKG_SOURCE_VERSION:=526690993c93720ee1707bba6b7a08e8c28f2dd9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -89,6 +89,12 @@ ifeq ($(CONFIG_IEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY),y)
|
||||
TARGET_CFLAGS += -DIEEE1905_CMDU_FRAGMENT_TLV_BOUNDARY
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_IEEE1905_EXTENSION_ALLOWED),y)
|
||||
TARGET_CFLAGS += -DEXTENSION_ALLOWED
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DHAS_UBUS
|
||||
|
||||
MAKE_FLAGS += \
|
||||
extmod_subdirs="$(patsubst %,extensions/%,$(plugins))"
|
||||
|
||||
@@ -117,7 +123,6 @@ define Build/InstallDev/libieee1905
|
||||
$(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/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/timer_impl.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_extension.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
|
||||
@@ -2,13 +2,17 @@ config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
list extmodule 'topology'
|
||||
option registrar '2 5 6'
|
||||
list exclude_tagging '/eth.*'
|
||||
# option macaddress '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config al-iface
|
||||
option enabled '1'
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
list ifname 'br-lan'
|
||||
list ifname '/eth.*'
|
||||
list ifname '/wl.*'
|
||||
list ifname '/wds.*'
|
||||
|
||||
# ap sections are auto-generated/overwritten during onboarding
|
||||
#
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
START=60
|
||||
STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
@@ -12,11 +12,11 @@ define Package/map-plugin/config
|
||||
|
||||
config MULTIAP_EASYMESH_VERSION
|
||||
int "Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
config MULTIAP_DYNAMIC_CNTLR_SYNC_CONFIG
|
||||
bool "Sync configuration between dynamic controllers in the network"
|
||||
default n
|
||||
default y
|
||||
|
||||
config MULTIAP_FUZZ_1905_CMDUS
|
||||
bool "Include support to fuzz 1905 CMDUs for testing purpose"
|
||||
|
||||
53
iop/config
53
iop/config
@@ -11,10 +11,19 @@ CONFIG_DEVEL=y
|
||||
CONFIG_USE_STRIP=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
|
||||
CONFIG_JSON_CYCLONEDX_SBOM=y
|
||||
CONFIG_INCLUDE_CONFIG=y
|
||||
|
||||
# Image #
|
||||
CONFIG_TARGET_CUSTOMER="IOPSYS"
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
|
||||
# Although UBIFS and EXT4 images work on all non-secure-boot devices,
|
||||
# squashfs is the only officially supported rootfs filesystem.
|
||||
# A writable rootfs is useful for developping an debugging preinit code.
|
||||
# CONFIG_TARGET_ROOTFS_UBIFS is not set
|
||||
# CONFIG_TARGET_ROOTFS_EXT4FS is not set
|
||||
|
||||
# /etc/banner and /etc/device_info #
|
||||
CONFIG_IMAGEOPT=y
|
||||
CONFIG_VERSIONOPT=y
|
||||
@@ -62,14 +71,14 @@ CONFIG_PACKAGE_wifimngr=y
|
||||
|
||||
# Multi-AP #
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-agent=m
|
||||
CONFIG_PACKAGE_map-controller=m
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_decollector=y
|
||||
|
||||
CONFIG_IEEE1905_CMDU_SA_IS_ALMAC=y
|
||||
CONFIG_PACKAGE_topology-plugin=y
|
||||
CONFIG_PACKAGE_decollector=y
|
||||
CONFIG_PACKAGE_map-agent=y
|
||||
CONFIG_PACKAGE_map-controller=y
|
||||
|
||||
# Network #
|
||||
CONFIG_PACKAGE_hostmngr=y
|
||||
CONFIG_PACKAGE_netmode=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
|
||||
@@ -86,12 +95,15 @@ CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_obuspa=y
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_stunc=m
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_twamp=m
|
||||
CONFIG_PACKAGE_udpecho-client=m
|
||||
CONFIG_PACKAGE_udpecho-server=m
|
||||
CONFIG_PACKAGE_xmppc=m
|
||||
CONFIG_PACKAGE_stunc=y
|
||||
CONFIG_PACKAGE_swmodd=y
|
||||
CONFIG_PACKAGE_twamp=y
|
||||
CONFIG_PACKAGE_udpecho-client=y
|
||||
CONFIG_PACKAGE_udpecho-server=y
|
||||
CONFIG_PACKAGE_userinterface=y
|
||||
CONFIG_PACKAGE_xmppc=y
|
||||
CONFIG_PACKAGE_timemngr=y
|
||||
CONFIG_PACKAGE_self-diagnostics=y
|
||||
|
||||
# WebGUI #
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
@@ -131,11 +143,12 @@ CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
|
||||
# Services #
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_atftp=y
|
||||
CONFIG_PACKAGE_atftpd=y
|
||||
CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_dnsmasq=y
|
||||
CONFIG_PACKAGE_ssdpd=y
|
||||
CONFIG_PACKAGE_miniupnpd-iptables=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_nginx=y
|
||||
@@ -144,7 +157,7 @@ CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_PACKAGE_qos-scripts is not set
|
||||
CONFIG_PACKAGE_rdnssd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
CONFIG_PACKAGE_vsftpd-tls=y
|
||||
|
||||
# Tools and Utilities #
|
||||
CONFIG_PACKAGE_curl=y
|
||||
@@ -160,11 +173,16 @@ CONFIG_PACKAGE_ipset=y
|
||||
CONFIG_PACKAGE_ip6tables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-zz-legacy=y
|
||||
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipmark=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
CONFIG_PACKAGE_iptables-mod-nflog=y
|
||||
CONFIG_PACKAGE_iptables-mod-nfqueue=y
|
||||
CONFIG_PACKAGE_ndisc6=y
|
||||
CONFIG_PACKAGE_rdisc6=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_socat=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
|
||||
@@ -174,9 +192,13 @@ CONFIG_PACKAGE_traceroute6=y
|
||||
##########
|
||||
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_ca-certificates=y
|
||||
CONFIG_PACKAGE_crun=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_gpiod-tools=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libcap-bin=y
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
@@ -184,6 +206,7 @@ CONFIG_PACKAGE_nand-utils=y
|
||||
CONFIG_PACKAGE_openssl-util=y
|
||||
CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_procd-ujail=m
|
||||
CONFIG_PACKAGE_quota=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rrdns=y
|
||||
@@ -230,7 +253,6 @@ CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT=y
|
||||
CONFIG_BUSYBOX_CONFIG_CTTYHACK=y
|
||||
CONFIG_BUSYBOX_CONFIG_DELUSER=y
|
||||
# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q=y
|
||||
CONFIG_BUSYBOX_CONFIG_FIRST_SYSTEM_ID=100
|
||||
# CONFIG_BUSYBOX_CONFIG_HTTPD is not set
|
||||
@@ -307,3 +329,4 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_NOHUP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="sha512"
|
||||
|
||||
@@ -4,7 +4,18 @@ function feeds_update {
|
||||
heads=1
|
||||
developer=0
|
||||
override=1
|
||||
while getopts "inh" opt; do
|
||||
force=1
|
||||
|
||||
function update_failure {
|
||||
if [ $force == 1 ]; then
|
||||
echo "WARNING: Failed to update feed(s). Forced update, proceeding anyway." >&2
|
||||
else
|
||||
echo "ERROR: Failed to update feed(s). Omit -F to proceed anyway." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
while getopts "inFh" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
heads=0
|
||||
@@ -12,12 +23,16 @@ function feeds_update {
|
||||
n)
|
||||
override=0
|
||||
;;
|
||||
F)
|
||||
force=0
|
||||
;;
|
||||
h|\?)
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-h]"
|
||||
echo "Usage: ./iop feeds_update [-i] [-n] [-F] [-h]"
|
||||
echo
|
||||
echo "OPTIONS:"
|
||||
echo " -i - Only update index. Do not change HEAD in feeds."
|
||||
echo " -n - Do not replace core packages with iopsys versions."
|
||||
echo " -F - Do not force update if there are inaccessible feeds."
|
||||
echo " -h - Display this help message and exit."
|
||||
exit 1
|
||||
;;
|
||||
@@ -30,9 +45,9 @@ function feeds_update {
|
||||
|
||||
if [ $heads == 1 ]; then
|
||||
if [ $developer == 1 ]; then
|
||||
./scripts/feeds update -g
|
||||
./scripts/feeds update -g || update_failure
|
||||
else
|
||||
./scripts/feeds update
|
||||
./scripts/feeds update || update_failure
|
||||
fi
|
||||
fi
|
||||
./scripts/feeds update -ai || exit 1
|
||||
@@ -40,6 +55,7 @@ function feeds_update {
|
||||
# replace core packages with iopsys versions
|
||||
if [ $override == 1 ]; then
|
||||
./scripts/feeds install -f -p openwrt_core -a || exit 1
|
||||
./scripts/feeds install -f -p qualcomm -a || exit 1
|
||||
fi
|
||||
|
||||
(
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function genconfig {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
@@ -16,7 +17,7 @@ function genconfig {
|
||||
brcmbca_feed="target/linux/feeds/brcmbca"
|
||||
airoha_feed="target/linux/feeds/airoha"
|
||||
x86_feed="target/linux/feeds/x86"
|
||||
armvirt_feed="target/linux/feeds/armvirt"
|
||||
armsr_feed="target/linux/feeds/armsr"
|
||||
mediatek_feed="target/linux/feeds/mediatek"
|
||||
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
|
||||
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
|
||||
@@ -108,8 +109,8 @@ function genconfig {
|
||||
airoha=$(cd $airoha_feed; ./genconfig)
|
||||
[ -e $x86_feed/genconfig ] &&
|
||||
x86=$(cd $x86_feed; ./genconfig)
|
||||
[ -e $armvirt_feed/genconfig ] &&
|
||||
armvirt=$(cd $armvirt_feed; ./genconfig)
|
||||
[ -e $armsr_feed/genconfig ] &&
|
||||
armsr=$(cd $armsr_feed; ./genconfig)
|
||||
[ -e $mediatek_feed/genconfig ] &&
|
||||
mediatek=$(cd $mediatek_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
|
||||
@@ -118,7 +119,7 @@ function genconfig {
|
||||
ipq53xx=$(cd $qualcomm_ipq53xx_feed; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in brcmbca airoha x86 armvirt mediatek ipq95xx ipq53xx; do
|
||||
for list in brcmbca airoha x86 armsr mediatek ipq95xx ipq53xx; do
|
||||
echo "$list based boards:"
|
||||
a=$(echo "${!list}" | sort)
|
||||
for b in $a; do
|
||||
@@ -144,10 +145,10 @@ function genconfig {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $armvirt; do
|
||||
for p in $armsr; do
|
||||
if [ $p == $profile ]; then
|
||||
target="armvirt"
|
||||
target_config_path="$armvirt_feed/config"
|
||||
target="armsr"
|
||||
target_config_path="$armsr_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -198,6 +199,7 @@ function genconfig {
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
@@ -416,7 +418,7 @@ function genconfig {
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -483,6 +485,7 @@ function genconfig {
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
function genconfig_min {
|
||||
export CLEAN=0
|
||||
export DIRTY="--dirty"
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
@@ -15,7 +16,7 @@ function genconfig_min {
|
||||
brcmbca_feed="target/linux/feeds/brcmbca"
|
||||
airoha_feed="target/linux/feeds/airoha"
|
||||
x86_feed="target/linux/feeds/x86"
|
||||
armvirt_feed="target/linux/feeds/armvirt"
|
||||
armsr_feed="target/linux/feeds/armsr"
|
||||
mediatek_feed="target/linux/feeds/mediatek"
|
||||
qualcomm_ipq95xx_feed="target/linux/feeds/ipq95xx"
|
||||
qualcomm_ipq53xx_feed="target/linux/feeds/ipq53xx"
|
||||
@@ -107,8 +108,8 @@ function genconfig_min {
|
||||
airoha=$(cd $airoha_feed; ./genconfig)
|
||||
[ -e $x86_feed/genconfig ] &&
|
||||
x86=$(cd $x86_feed; ./genconfig)
|
||||
[ -e $armvirt_feed/genconfig ] &&
|
||||
armvirt=$(cd $armvirt_feed; ./genconfig)
|
||||
[ -e $armsr_feed/genconfig ] &&
|
||||
armsr=$(cd $armsr_feed; ./genconfig)
|
||||
[ -e $mediatek_feed/genconfig ] &&
|
||||
mediatek=$(cd $mediatek_feed; ./genconfig)
|
||||
[ -e $qualcomm_ipq95xx_feed/genconfig ] &&
|
||||
@@ -117,7 +118,7 @@ function genconfig_min {
|
||||
ipq53xx=$(cd $qualcomm_ipq53xx_feed; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in brcmbca airoha x86 armvirt mediatek ipq95xx ipq53xx; do
|
||||
for list in brcmbca airoha x86 armsr mediatek ipq95xx ipq53xx; do
|
||||
echo "$list based boards:"
|
||||
a=$(echo "${!list}" | sort)
|
||||
for b in $a; do
|
||||
@@ -143,10 +144,10 @@ function genconfig_min {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $armvirt; do
|
||||
for p in $armsr; do
|
||||
if [ $p == $profile ]; then
|
||||
target="armvirt"
|
||||
target_config_path="$armvirt_feed/config"
|
||||
target="armsr"
|
||||
target_config_path="$armsr_feed/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -197,6 +198,7 @@ function genconfig_min {
|
||||
echo 1>&2 "Usage: $0 [ OPTIONS ] < Board_Type > [ Customer [customer2 ]...]"
|
||||
echo
|
||||
echo -e " -c|--clean\t\tRemove all files under ./files and import from config "
|
||||
echo -e " -D|--no-dirty\t\tIgnore dirty tree"
|
||||
echo -e " -v|--verbose\t\tVerbose"
|
||||
echo -e " -n|--no-update\tDo NOT! Update customer config before applying"
|
||||
echo -e " -t|--target\t\tExplicitly specify the linux target to build the board profile from"
|
||||
@@ -390,7 +392,7 @@ function genconfig_min {
|
||||
|
||||
# Set target version
|
||||
local git_version
|
||||
if ! git_version="$(git describe --always --dirty --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
if ! git_version="$(git describe --always $DIRTY --tags --match '[0-9].*.*' --match '[0-9][0-9].*.*')"; then
|
||||
echo "ERROR: Failed getting version via git describe, exiting." >&2
|
||||
return 1
|
||||
fi
|
||||
@@ -451,6 +453,7 @@ function genconfig_min {
|
||||
case "$1" in
|
||||
|
||||
-c|--clean) export CLEAN=1;;
|
||||
-D|--no-dirty) export DIRTY="";;
|
||||
-n|--no-update) export IMPORT=0;;
|
||||
-v|--verbose) export VERBOSE="$(($VERBOSE + 1))";;
|
||||
-t|--target) export TARGET="$2"; shift;;
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC2029
|
||||
|
||||
build_bcmkernel_consumer() {
|
||||
local tarfile bcmkernelcommith sdkversion serverpath serverlink
|
||||
|
||||
sdkversion="$(grep "CONFIG_BRCM_SDK_VER.*=y" .config | awk -F'[_,=]' '{print$5}')"
|
||||
sdkversion="${sdkversion:0:4}${sdkversion:(-1)}"
|
||||
bcmkernelcommith="$(grep -w "PKG_SOURCE_VERSION:" "$curdir/feeds/broadcom/bcmkernel/${sdkversion:0:5}"*".mk" | cut -d'=' -f2)"
|
||||
|
||||
[ -n "$board" ] && [ -n "$bcmkernelcommith" ] || return
|
||||
|
||||
serverpath="$FPATH/bcmopen-$board-$bcmkernelcommith.tar.gz"
|
||||
serverlink="$FPATH/bcmopen-$board-$majver.$minver-latest"
|
||||
|
||||
# do not build bcmopen sdk if it was already built before
|
||||
# if it was, check if there's a symlink in place and create it if missing
|
||||
ssh "$SERVER" "test -f '$serverpath' && { test -L '$serverlink' || ln -sf '$serverpath' '$serverlink'; }" && return
|
||||
|
||||
cd "./build_dir/target-"*"/bcmkernel-"*"-${sdkversion:0:4}"*"/bcm963xx/release"
|
||||
bash do_consumer_release -p "$profile" -y -F
|
||||
|
||||
tarfile='out/bcm963xx_*_consumer.tar.gz'
|
||||
[ $(ls -1 $tarfile | wc -l) -ne 1 ] && echo "Too many tar files: '$tarfile'" && return
|
||||
|
||||
scp -pv $tarfile "$SERVER":"$serverpath"
|
||||
ssh "$SERVER" "test -f '$serverpath' && ln -sf '$serverpath' '$serverlink'"
|
||||
rm -f $tarfile
|
||||
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_endptmngr_consumer() {
|
||||
# create endptmngr open version tar file
|
||||
local endptversion endptcommith
|
||||
grep -q "CONFIG_TARGET_NO_VOICE=y" .config && return
|
||||
endptversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
endptcommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/endptmngr/Makefile | cut -d'=' -f2)
|
||||
[ -n "$profile" ] && [ -n "$endptversion" ] && [ -n "$endptcommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/endptmngr-$profile-$endptversion-$endptcommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/endptmngr-$endptversion/
|
||||
mkdir endptmngr-open-$endptversion
|
||||
mkdir endptmngr-open-$endptversion/src
|
||||
cp ./src/endptmngr endptmngr-open-$endptversion/src
|
||||
cp -r ./files/ endptmngr-open-$endptversion/
|
||||
tar -czv endptmngr-open-$endptversion/ -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
scp -pv endptmngr-$profile-$endptversion-$endptcommith.tar.gz $SERVER:$FPATH/
|
||||
cp endptmngr-$profile-$endptversion-$endptcommith.tar.gz $curdir/
|
||||
rm -rf endptmngr-open-$endptversion
|
||||
rm -f endptmngr-$profile-$endptversion-$endptcommith.tar.gz
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
function print_usage {
|
||||
echo "Usage: $0 generate_tarballs"
|
||||
echo " -t <target>"
|
||||
}
|
||||
|
||||
function generate_tarballs {
|
||||
|
||||
SERVER="god@download.iopsys.eu"
|
||||
FPATH="/var/www/html/iopsys/opensdk"
|
||||
|
||||
set -e
|
||||
git remote -v | grep -q http && return # do not continue if this is an open SDK environment
|
||||
|
||||
board=$(grep CONFIG_TARGET_FAMILY .config | cut -d'=' -f2 | tr -d '"')
|
||||
profile=$(grep CONFIG_BCM_KERNEL_PROFILE .config | cut -d'=' -f2 | tr -d '"')
|
||||
majver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f1 -d .)
|
||||
minver=$(grep CONFIG_TARGET_VERSION .config | cut -d'=' -f2 | tr -d '"' | cut -f2 -d .)
|
||||
curdir="$PWD"
|
||||
|
||||
|
||||
# Execute user command
|
||||
while getopts "t:h" opt; do
|
||||
case $opt in
|
||||
t)
|
||||
stk_target=${OPTARG}
|
||||
;;
|
||||
h)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
\?)
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$stk_target" ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_endptmngr_consumer
|
||||
else
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
register_command "generate_tarballs" "Generate tarballs for Open SDK"
|
||||
|
||||
57
libdpp/Makefile
Normal file
57
libdpp/Makefile
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdpp
|
||||
PKG_VERSION:=2.0.0
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=f22959b107a8bf443d04d6261d00074b5514dfe8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/libdpp.git
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
define Package/libdpp/description
|
||||
Library providing APIs for DPP EasyConnect frame generation and handling
|
||||
endef
|
||||
|
||||
define Package/libdpp
|
||||
TITLE:= DPP EasyConnect library (libdpp)
|
||||
DEPENDS:= +libeasy +libopenssl +libgcrypt +libubox +libwifiutils
|
||||
endef
|
||||
|
||||
MAKE_PATH:=lib
|
||||
|
||||
|
||||
define Build/InstallDev/libdpp
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/dpp_api.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/dpputils.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libdpp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/libdpp,$(1),$(2))
|
||||
endef
|
||||
|
||||
define Package/libdpp/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libdpp.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libdpp))
|
||||
@@ -24,8 +24,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
CONFIG_ID=$(SUBTARGET:bcm%=BCM%)
|
||||
CHIP_ID=$(CONFIG_ID:BCM9%=%)
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_$(CONFIG_ID) \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.2.100
|
||||
PKG_VERSION:=7.4.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=32db1b79bd88eba85a3e7518dbbbd1e29f4b06d9
|
||||
PKG_SOURCE_VERSION:=11eb263666556c419220e2a50c3a67422e79f884
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -50,6 +50,9 @@ define Build/InstallDev/libeasy
|
||||
$(CP) $(PKG_BUILD_DIR)/easy.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/event.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/bufutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/cryptutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/ecc_cryptutil.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/hlist.h $(1)/usr/include/easy/
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libethernet
|
||||
PKG_VERSION:=7.2.104
|
||||
PKG_VERSION:=7.2.107
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=d777636ca43302a95e571ab030ec44ef50905570
|
||||
PKG_SOURCE_VERSION:=9c0e9ecd62b79d4e89b4f013f04124870d237395
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libethernet.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -24,8 +24,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
CONFIG_ID=$(SUBTARGET:bcm%=BCM%)
|
||||
CHIP_ID=$(CONFIG_ID:BCM9%=%)
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_$(CONFIG_ID) \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libqos
|
||||
PKG_VERSION:=7.2.101
|
||||
PKG_VERSION:=7.2.106
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=93ca0a66d6f82bca208bbe52b75ed582b20aa094
|
||||
PKG_SOURCE_VERSION:=02dba6571fddd9b4c5b4b671270604b4c0faf9ae
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libqos.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -24,8 +24,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
CONFIG_ID=$(SUBTARGET:bcm%=BCM%)
|
||||
CHIP_ID=$(CONFIG_ID:BCM9%=%)
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_$(CONFIG_ID) \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
@@ -37,14 +38,11 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
|
||||
else ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET
|
||||
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_PLATFORM=IPQ95XX
|
||||
TARGET_CFLAGS +=-DIPQ95XX
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_CFLAGS +=-DIOPSYS_LINUX
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET, use default LINUX)
|
||||
$(info Using default LINUX)
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_CFLAGS +=-DIOPSYS_LINUX
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=8ced85cd48f8bdd7d238fc1ded3a218dd19aeae9
|
||||
PKG_SOURCE_VERSION:=e6ba6fca814f6c83a3d6ff4a5b7560fbc36d3101
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"ulaw": {
|
||||
"name": "G.711MuLaw",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_max": 60,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
@@ -10,7 +10,7 @@
|
||||
"alaw": {
|
||||
"name": "G.711ALaw",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_max": 60,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
@@ -18,15 +18,16 @@
|
||||
"g726": {
|
||||
"name": "G.726",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_max": 60,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 16
|
||||
"bitrate": 16,
|
||||
"rtp_payload": 80
|
||||
},
|
||||
"g723": {
|
||||
"name": "G.723.1",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_max": 60,
|
||||
"ptime_default": 30,
|
||||
"ptime_increment": 30,
|
||||
"bitrate": 5.3
|
||||
@@ -34,26 +35,18 @@
|
||||
"g729": {
|
||||
"name": "G.729",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_max": 60,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 8
|
||||
},
|
||||
"ilbc": {
|
||||
"name": "iLBC",
|
||||
"g722": {
|
||||
"name": "G.722",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_max": 60,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 30,
|
||||
"bitrate": 15.2
|
||||
},
|
||||
"gsm": {
|
||||
"name": "AMR",
|
||||
"ptime_min": 10,
|
||||
"ptime_max": 30,
|
||||
"ptime_default": 20,
|
||||
"ptime_increment": 20,
|
||||
"bitrate": 12.2
|
||||
"ptime_increment": 10,
|
||||
"bitrate": 64
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-broadcom
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=548f8fccc9f8f0b5dd6bb39bdd9cac8659400cb6
|
||||
PKG_SOURCE_VERSION:=e1de60c2c05935fb2f4adfc1f73feba0bb32ade6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,7 +28,7 @@ PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
||||
|
||||
LIBVOICE_PKG_BUILD_DIR := $(PKG_BUILD_DIR)
|
||||
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
export BCM_CHIP_ID:=$(SUBTARGET)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-d2
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_VERSION:=1.1.2
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
@@ -17,7 +17,7 @@ LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/$(PKG_NAME).git
|
||||
PKG_SOURCE_VERSION:=062a265754b93a865cfcd2745f200aa09fb4a668
|
||||
PKG_SOURCE_VERSION:=e6d689334000bc57498d9a3f203a8933160e1ef4
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.2.106
|
||||
PKG_VERSION:=7.4.16
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b0af6d0fc35bc0e66ae8643c038e867b4688695b
|
||||
PKG_SOURCE_VERSION:=dfafd5f7ea387d6119a9eb692e435f98b16f75a3
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -26,8 +26,9 @@ include $(INCLUDE_DIR)/package.mk
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
TARGET_WIFI_TYPE=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
CONFIG_ID=$(SUBTARGET:bcm%=BCM%)
|
||||
CHIP_ID=$(CONFIG_ID:BCM9%=%)
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_$(CONFIG_ID) \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
@@ -46,6 +47,10 @@ else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_PLATFORM=IPQ95XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM MAC80211
|
||||
TARGET_CFLAGS +=-DIPQ95XX
|
||||
else ifeq ($(CONFIG_TARGET_ipq53xx),y)
|
||||
TARGET_PLATFORM=IPQ53XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM MAC80211
|
||||
TARGET_CFLAGS +=-DIPQ53XX
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=LINUX
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
@@ -57,6 +62,12 @@ else
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-mt7915e),)
|
||||
TARGET_CFLAGS=-DMT7915_VENDOR_EXT
|
||||
endif
|
||||
|
||||
PKG_BUILD_DEPENDS:=PACKAGE_kmod-mt7915e:mt76
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libwifi),)
|
||||
TARGET_CFLAGS +=-DHAS_WIFI
|
||||
endif
|
||||
|
||||
@@ -8,28 +8,28 @@ config AGENT_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
|
||||
config AGENT_ISLAND_PREVENTION
|
||||
bool "Support Island Prevention"
|
||||
default y if MULTIAP_AGENT_ISLAND_PREVENTION
|
||||
default y
|
||||
|
||||
config AGENT_EASYMESH_R2_CERT
|
||||
bool "Compile for WFA test bed"
|
||||
|
||||
config AGENT_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT
|
||||
bool "Enable extra features through Easymesh vendor extension"
|
||||
default y
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
|
||||
config AGENT_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
default AGENT_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
enabled through AGENT_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
@@ -45,5 +45,15 @@ config AGENT_LOCAL_ACS_SERVICE
|
||||
config AGENT_STRICT_OPER_CHANNEL_REPORT
|
||||
bool "Report operation channel strictly, skip some unsolicited reports"
|
||||
|
||||
config AGENT_WIRELESS_EXPLICIT_RELOAD
|
||||
bool "Reload wireless after UCI commit"
|
||||
|
||||
config AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST
|
||||
bool "Use config opt to determine if Oper Channel Report CMDU is send as relayed multicast or directly to controller"
|
||||
default y
|
||||
|
||||
config AGENT_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=4.3.3.9
|
||||
PKG_VERSION:=4.5.0.10
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=051b38fa01fee46f4b4184442972a8af3c349b7c
|
||||
PKG_SOURCE_VERSION:=a03ea6bee6856000496d858f3b4c8d161612472d
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
@@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-agent
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:multi-ap/map-agent.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,9 +28,12 @@ define Package/map-agent
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin +ip-bridge
|
||||
+map-plugin +ip-bridge +AGENT_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_AGENT_USE_LIBDPP),y)
|
||||
TARGET_CFLAGS += -DUSE_LIBDPP
|
||||
endif
|
||||
|
||||
define Package/dynbhd
|
||||
SECTION:=utils
|
||||
@@ -74,7 +77,7 @@ TARGET_CFLAGS += -DEASYMESH_R2_CERT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_AGENT_EASYMESH_VENDOR_EXT_OUI)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
@@ -94,6 +97,14 @@ ifeq ($(CONFIG_AGENT_STRICT_OPER_CHANNEL_REPORT),y)
|
||||
TARGET_CFLAGS += -DSTRICT_OPER_CHANNEL_REPORT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_WIRELESS_EXPLICIT_RELOAD),y)
|
||||
TARGET_CFLAGS += -DWIRELESS_EXPLICIT_RELOAD
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AGENT_OPER_CHANNEL_CHANGE_RELAY_MCAST),y)
|
||||
TARGET_CFLAGS += -DOPER_CHAN_CHANGE_RELAY_MCAST
|
||||
endif
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Package/map-agent/install
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
config agent 'agent'
|
||||
option enabled '1'
|
||||
option enabled '0'
|
||||
option debug '0'
|
||||
option profile '2'
|
||||
option profile '3'
|
||||
option al_bridge 'br-lan'
|
||||
option netdev 'wlan'
|
||||
option island_prevention '0'
|
||||
option eth_onboards_wifi_bhs '0'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
option eth_onboards_wifi_bhs '1'
|
||||
option scan_on_boot_only '0'
|
||||
option chan_ch_relay_mcast '1'
|
||||
option guest_isolation '1'
|
||||
list map_port 'all'
|
||||
# option controller_macaddr '0a:1b:2c:3d:4e:50'
|
||||
|
||||
config dynamic_backhaul
|
||||
option missing_bh_timer '60'
|
||||
@@ -21,9 +23,9 @@ config controller_select
|
||||
option autostart '1'
|
||||
option local '0'
|
||||
|
||||
config radio
|
||||
option device 'phy0'
|
||||
option band '2'
|
||||
#config radio
|
||||
# option device 'phy0'
|
||||
# option band '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
@@ -34,9 +36,9 @@ config radio
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config radio
|
||||
option device 'phy1'
|
||||
option band '5'
|
||||
#config radio
|
||||
# option device 'phy1'
|
||||
# option band '5'
|
||||
# options below are auto-generated during onboarding
|
||||
# option steer_policy '0'
|
||||
# option util_threshold '0'
|
||||
@@ -47,12 +49,12 @@ config radio
|
||||
# option include_sta_stats '1'
|
||||
# option include_sta_metric '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan0'
|
||||
option band '2'
|
||||
option device 'phy0'
|
||||
option priority '2'
|
||||
#config bsta
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan0'
|
||||
# option band '2'
|
||||
# option device 'phy0'
|
||||
# option priority '2'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-2.4GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
@@ -61,12 +63,12 @@ config bsta
|
||||
# option bssid '0a:1b:2c:3d:4e:53'
|
||||
# option vid '1'
|
||||
|
||||
config bsta
|
||||
option enabled '1'
|
||||
option ifname 'wlan1'
|
||||
option band '5'
|
||||
option device 'phy1'
|
||||
option priority '0'
|
||||
#config bsta
|
||||
# option enabled '1'
|
||||
# option ifname 'wlan1'
|
||||
# option band '5'
|
||||
# option device 'phy1'
|
||||
# option priority '0'
|
||||
# options below are auto-generated during onboarding
|
||||
# option ssid 'MAP-BH-5GHz'
|
||||
# option encryption 'sae-mixed'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
. /lib/network/utils.sh
|
||||
|
||||
conn_ports_file="/tmp/map.connected.ports"
|
||||
conn_ports_file="/var/run/multiap/map.connected.ports"
|
||||
map_bh_file="/var/run/multiap/multiap.backhaul"
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
[ "${al_bridge:0:3}" = "br-" ] || exit 0
|
||||
@@ -11,11 +11,15 @@ al_brnet="${al_bridge:3}"
|
||||
# Exit if the PORT is not member of the AL Bridge
|
||||
[ "$(get_network_of $PORT)" = "$al_brnet" ] || exit 0
|
||||
|
||||
# Exit if the device is not operating in extender/repeater mode
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
############## Dynamic Backhaul Daemon ##############
|
||||
if [ -n "$(which dynbhd)" ]; then
|
||||
pidof dynbhd >/dev/null && exit 0 # dynbhd is managing the links
|
||||
|
||||
if [ ! -f $conn_ports_file ]; then
|
||||
mkdir -p /var/run/multiap
|
||||
touch $conn_ports_file
|
||||
if [ "$LINK" = "up" ]; then
|
||||
touch $conn_ports_file
|
||||
@@ -47,8 +51,6 @@ if [ -n "$wanport" ]; then
|
||||
########################################################
|
||||
else
|
||||
#################### DHCP Discovery ####################
|
||||
[ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ] || exit 0
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
brctl delif $al_bridge $PORT
|
||||
|
||||
|
||||
@@ -179,7 +179,16 @@ create_dir() {
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -f /usr/sbin/dynbhd ] && start_dynbhd_service
|
||||
if [ -f /usr/sbin/dynbhd ]; then
|
||||
# Start dynbhd only if the device is operating in extender/repeater mode
|
||||
al_bridge="$(uci -q get mapagent.agent.al_bridge)"
|
||||
if [ "${al_bridge:0:3}" = "br-" ]; then
|
||||
al_brnet="${al_bridge:3}"
|
||||
if [ "$(uci -q get network.${al_brnet}.proto)" == "dhcp" ]; then
|
||||
start_dynbhd_service
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
config_load "mapagent"
|
||||
validate_agent_config || return 1;
|
||||
@@ -210,3 +219,8 @@ reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
boot() {
|
||||
/lib/wifi/multiap conf
|
||||
start
|
||||
}
|
||||
|
||||
201
map-agent/files/lib/multiap/map_genconfig
Normal file
201
map-agent/files/lib/multiap/map_genconfig
Normal file
@@ -0,0 +1,201 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
generate_mapagent_config=0
|
||||
generate_wireless_sta_config=0
|
||||
|
||||
network_mode="$(fw_printenv -n netmode)"
|
||||
multiap_mode="$(fw_printenv -n multiap_mode)"
|
||||
|
||||
is_airoha() {
|
||||
[ -f /proc/device-tree/compatible ] || return
|
||||
strings /proc/device-tree/compatible | grep -qE '^(econet,|airoha,)'; return
|
||||
}
|
||||
|
||||
is_broadcom() {
|
||||
[ -e /dev/bcm ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
is_qualcomm() {
|
||||
[ -d /sys/module/ath12k ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
generate_multiap_config() {
|
||||
devidx=0
|
||||
|
||||
generate_config() {
|
||||
dev="$1"
|
||||
|
||||
[ -n "$dev" ] || continue
|
||||
|
||||
config_get band $dev band
|
||||
|
||||
mode_band=""
|
||||
priority=
|
||||
dpp_chan=
|
||||
channels=
|
||||
|
||||
case "$band" in
|
||||
2g)
|
||||
mode_band=2
|
||||
priority=2
|
||||
dpp_chan="81/1"
|
||||
channels="1 6 11"
|
||||
;;
|
||||
5g)
|
||||
mode_band=5
|
||||
priority=1
|
||||
dpp_chan="128/36"
|
||||
channels="36-64 100-112"
|
||||
;;
|
||||
6g)
|
||||
mode_band=6
|
||||
priority=0
|
||||
dpp_chan="133/49"
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$mode_band" ] || continue
|
||||
|
||||
devidx=$(echo ${dev} |tr -dc '0-9')
|
||||
|
||||
device="$dev"
|
||||
|
||||
if is_airoha; then
|
||||
ifprefix="wlan%_%"
|
||||
ifname="wlan${devidx}_0"
|
||||
ifname_bh="wlan${devidx}_1"
|
||||
uci set wireless.$dev.channels="$channels"
|
||||
uci commit wireless
|
||||
elif is_broadcom; then
|
||||
ifprefix="wl"
|
||||
ifname="wl${devidx}"
|
||||
ifname_bh="$ifname.1"
|
||||
device="wl${devidx}"
|
||||
brcm_setup="1"
|
||||
elif is_qualcomm; then
|
||||
ifprefix="wlan0%-"
|
||||
ifname="wlan${devidx}"
|
||||
ifname_bh="wlan${devidx}-1"
|
||||
ap_follow_sta_dfs="1"
|
||||
else
|
||||
ifprefix="wlan%-"
|
||||
ifname="wlan$devidx"
|
||||
ifname_bh="$ifname-1"
|
||||
fi
|
||||
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.ifprefix="$ifprefix"
|
||||
uci set mapagent.agent.brcm_setup="$brcm_setup"
|
||||
uci set mapagent.agent.ap_follow_sta_dfs="$ap_follow_sta_dfs"
|
||||
uci add mapagent radio
|
||||
uci set mapagent.@radio[-1].device="$device"
|
||||
uci set mapagent.@radio[-1].band="$mode_band"
|
||||
|
||||
if [ "$network_mode" == "extender" ]; then
|
||||
uci add mapagent bsta
|
||||
uci set mapagent.@bsta[-1].device="$device"
|
||||
uci set mapagent.@bsta[-1].ifname="$ifname"
|
||||
uci set mapagent.@bsta[-1].band="$mode_band"
|
||||
uci set mapagent.@bsta[-1].priority="$priority"
|
||||
|
||||
#uci add mapagent dpp_uri
|
||||
#uci set mapagent.@dpp_uri[-1].type="qrcode"
|
||||
#uci set mapagent.@dpp_uri[-1].device="$device"
|
||||
#uci set mapagent.@dpp_uri[-1].ifname="$ifname"
|
||||
#uci set mapagent.@dpp_uri[-1].band="$mode_band"
|
||||
#uci set mapagent.@dpp_uri[-1].chirp_interval="10"
|
||||
#uci add_list mapagent.@dpp_uri[-1].dpp_chan="$dpp_chan"
|
||||
|
||||
if [ $generate_wireless_sta_config -eq 1 ]; then
|
||||
secname="default_sta_${device}"
|
||||
uci set wireless.$secname=wifi-iface
|
||||
uci set wireless.$secname.device="$device"
|
||||
uci set wireless.$secname.mode="sta"
|
||||
uci set wireless.$secname.ifname="$ifname"
|
||||
uci set wireless.$secname.disabled="0"
|
||||
uci set wireless.$secname.default_disabled="1"
|
||||
uci set wireless.$secname.multi_ap="1"
|
||||
uci commit wireless
|
||||
wifi reload
|
||||
else
|
||||
ubus call uci set "{\"config\":\"wireless\",\"type\":\"wifi-iface\", \
|
||||
\"match\":{\"mode\":\"sta\", \"ifname\":\"$ifname\", \"device\":\"$device\"},\"values\":{\"multi_ap\":\"1\"}}" 2>/dev/null
|
||||
fi
|
||||
else
|
||||
uci add mapagent ap
|
||||
uci set mapagent.@ap[-1].type="fronthaul"
|
||||
uci set mapagent.@ap[-1].device="$device"
|
||||
uci set mapagent.@ap[-1].ifname="$ifname"
|
||||
uci set mapagent.@ap[-1].band="$mode_band"
|
||||
uci add mapagent ap
|
||||
uci set mapagent.@ap[-1].type="backhaul"
|
||||
uci set mapagent.@ap[-1].device="$device"
|
||||
uci set mapagent.@ap[-1].ifname="$ifname_bh"
|
||||
uci set mapagent.@ap[-1].band="$mode_band"
|
||||
|
||||
if [ "$multiap_mode" != "none" ]; then
|
||||
ubus call uci set "{\"config\":\"wireless\",\"type\":\"wifi-iface\", \
|
||||
\"match\":{\"ifname\":\"$ifname\", \"device\":\"$device\"},\"values\":{\"multi_ap\":\"2\"}}" 2>/dev/null
|
||||
ubus call uci set "{\"config\":\"wireless\",\"type\":\"wifi-iface\", \
|
||||
\"match\":{\"ifname\":\"$ifname_bh\", \"device\":\"$device\"},\"values\":{\"multi_ap\":\"1\"}}" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
config_foreach generate_config wifi-device
|
||||
}
|
||||
|
||||
map_genconf () {
|
||||
if [ -f /etc/config/mapagent -a -z "$(uci -q get mapagent.@radio[0].band)" ]; then
|
||||
generate_mapagent_config=1
|
||||
fi
|
||||
|
||||
if [ "$network_mode" == "extender" ]; then
|
||||
if ! uci show wireless | grep -q "mode=.*sta"; then
|
||||
generate_wireless_sta_config=1
|
||||
|
||||
if is_broadcom; then
|
||||
for section in $(uci show wireless | grep wifi-device | cut -d'.' -f2 | cut -d'=' -f1); do
|
||||
uci -q set wireless.$section.apsta="1"
|
||||
done
|
||||
fi
|
||||
|
||||
for section in $(uci show wireless | grep "mode=.*ap" | cut -d'.' -f2); do
|
||||
uci delete wireless.$section
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
generate_multiap_config
|
||||
|
||||
if [ $generate_mapagent_config -eq 1 ]; then
|
||||
uci set mapagent.agent.enabled="1"
|
||||
if [ "$multiap_mode" == "agent" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=0
|
||||
uci -q set mapagent.@controller_select[0].local=0
|
||||
elif [ "$multiap_mode" == "auto" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=0
|
||||
elif [ "$multiap_mode" == "full" ]; then
|
||||
uci -q set mapagent.@controller_select[0].autostart=1
|
||||
uci -q set mapagent.@controller_select[0].local=1
|
||||
elif [ "$multiap_mode" == "none" ]; then
|
||||
uci set mapagent.agent.enabled="0"
|
||||
fi
|
||||
uci -q commit mapagent
|
||||
fi
|
||||
|
||||
|
||||
if [ "$multiap_mode" == "agent" -o "$multiap_mode" == "none" ]; then
|
||||
uci set mapcontroller.controller.enabled="0"
|
||||
else
|
||||
uci set mapcontroller.controller.enabled="1"
|
||||
fi
|
||||
uci -q commit mapcontroller
|
||||
}
|
||||
@@ -11,20 +11,24 @@ config CONTROLLER_EASYMESH_VENDOR_EXT
|
||||
default y
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
|
||||
config CONTROLLER_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 2
|
||||
default 4
|
||||
|
||||
config CONTROLLER_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
default CONTROLLER_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
enabled through CONTROLLER_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
config CONTROLLER_USE_LIBDPP
|
||||
bool "Depend on libdpp for DPP EasyConnect"
|
||||
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=4.3.0.8
|
||||
PKG_VERSION:=4.5.0.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=0d83f8acd66a4cb97f2f123149696334d7f03e6e
|
||||
PKG_SOURCE_VERSION:=3c915f5f17ff339487a3b8533d384a23888b9c9a
|
||||
PKG_MAINTAINER:=Jakob Olsson <jakob.olsson@iopsys.eu>
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-controller
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:multi-ap/map-controller.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -27,9 +27,15 @@ define Package/map-controller
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libwifiutils +libieee1905 +ieee1905 +map-plugin \
|
||||
+CONTROLLER_USE_LIBDPP:libdpp
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_USE_LIBDPP),y)
|
||||
TARGET_CFLAGS += -DUSE_LIBDPP
|
||||
endif
|
||||
|
||||
|
||||
define Package/map-controller/description
|
||||
This package provides WiFi MultiAP Controller as per the EasyMesh-R2 specs.
|
||||
endef
|
||||
@@ -53,7 +59,7 @@ TARGET_CFLAGS += -DCONTROLLER_SYNC_DYNAMIC_CNTLR_CONFIG
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_CONTROLLER_EASYMESH_VENDOR_EXT_OUI)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
config controller 'controller'
|
||||
option enabled '1'
|
||||
option registrar '2 5'
|
||||
option enabled '1' # may be modified by other package start-up scripts (i.e. map-agent)
|
||||
option profile '3'
|
||||
option registrar '2 5 6'
|
||||
option debug '0'
|
||||
option bcn_metrics_max_num '10'
|
||||
option initial_channel_scan '0'
|
||||
option primary_vid '0'
|
||||
option enable_ts '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
option allow_bgdfs '0'
|
||||
option channel_plan '0'
|
||||
option de_collect_interval '60'
|
||||
|
||||
config sta_steering
|
||||
option steer_module 'rcpi'
|
||||
@@ -18,40 +21,65 @@ config sta_steering
|
||||
option use_usta_metrics '0'
|
||||
option bandsteer '0'
|
||||
option diffsnr '8'
|
||||
option rcpi_threshold_2g '70'
|
||||
option rcpi_threshold_5g '86'
|
||||
option rcpi_threshold_6g '86'
|
||||
option report_rcpi_threshold_2g '80'
|
||||
option report_rcpi_threshold_5g '96'
|
||||
option report_rcpi_threshold_6g '96'
|
||||
|
||||
###################
|
||||
# Default AP sections credentials will by updated
|
||||
# by uci-defaults script 99-mapcntlr
|
||||
###################
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid '$DEVICE_MANUFACTURER-$BASEMAC_ADDR'
|
||||
option encryption 'sae-mixed'
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option ssid 'IOWRT-2.4GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option type 'fronthaul'
|
||||
option vid '1'
|
||||
option ssid 'IOWRT-5GHz'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid '$DEVICE_MANUFACTURER-$BASEMAC_ADDR'
|
||||
option encryption 'sae-mixed'
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
option ssid '$DEVICE_MANUFACTURER-$BASEMAC_ADDR'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_FH_KEY'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-2.4GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
list disallow_bsta '0'
|
||||
option ssid 'MAP-BH-5GHz'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-5GHz'
|
||||
option encryption 'sae'
|
||||
option key '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ0'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
|
||||
config ap
|
||||
option band '6'
|
||||
option ssid 'MAP-$BASEMAC_ADDR-BH-6GHz'
|
||||
option encryption 'sae'
|
||||
option key '$WIFI_BH_KEY'
|
||||
option type 'backhaul'
|
||||
option vid '1'
|
||||
|
||||
# node and radio sections (per node) are auto
|
||||
# generated per Multi-AP Agent in the network
|
||||
@@ -62,8 +90,6 @@ config ap
|
||||
# option backhaul_ul_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_dl_macaddr '00:00:00:00:00:00'
|
||||
# option backhaul_type 'none'
|
||||
# option primary_vid '1'
|
||||
# option primary_pcp '0'
|
||||
# option report_sta_assocfails '0'
|
||||
# option report_sta_assocfails_rate '0'
|
||||
# option report_metric_periodic '0'
|
||||
|
||||
18
map-controller/files/etc/uci-defaults/99-mapcntlr
Normal file
18
map-controller/files/etc/uci-defaults/99-mapcntlr
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/device_info
|
||||
|
||||
WIFI_BH_KEY=$(openssl rand -rand /dev/urandom -hex 64 2>/dev/null | openssl dgst -hex -sha256 | cut -d " " -f 2)
|
||||
WIFI_BH_KEY=${WIFI_BH_KEY::-1}
|
||||
|
||||
BASEMAC_ADDR="$(fw_printenv -n ethaddr | tr -d ':' | tr 'a-z' 'A-Z')"
|
||||
[ ${#BASEMAC_ADDR} -eq 12 ] || BASEMAC_ADDR="$(db -q get device.deviceinfo.BaseMACAddress | tr -d ':')"
|
||||
|
||||
WIFI_FH_KEY="$(db get hw.board.wpa_key)"
|
||||
WIFI_FH_KEY="${WIFI_FH_KEY:-1234567890}"
|
||||
|
||||
sed -i -e "s/\$BASEMAC_ADDR/$BASEMAC_ADDR/g" \
|
||||
-e "s/\$WIFI_FH_KEY/$WIFI_FH_KEY/g" \
|
||||
-e "s/\$WIFI_BH_KEY/$WIFI_BH_KEY/g" \
|
||||
-e "s/\$DEVICE_MANUFACTURER/$DEVICE_MANUFACTURER/g" \
|
||||
/etc/config/mapcontroller 2>/dev/null
|
||||
@@ -7,14 +7,14 @@ config TOPOLOGYD_EASYMESH_VENDOR_EXT
|
||||
default y
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
string
|
||||
default "\\\\x11\\\\x22\\\\x33"
|
||||
hex "Vendor OUI default"
|
||||
default 0xB456FA
|
||||
|
||||
config TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI
|
||||
string "Vendor OUI in '\\\\xAB\\\\xCD\\\\xEF' format"
|
||||
hex "Vendor OUI in 0xAABBCC format"
|
||||
default TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI_DEFAULT
|
||||
help
|
||||
Extra features not covered by the base Easymesh specification can be
|
||||
Extra features not covered by the base EasyMesh specification can be
|
||||
enabled through TOPOLOGYD_EASYMESH_VENDOR_EXT. Please provide the Vendor's OUI
|
||||
through which such features would be exposed.
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=2.5.1.24
|
||||
PKG_VERSION:=2.5.2.1
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=9f15e813c39ff23cef27975ce138bd3286f30adf
|
||||
PKG_SOURCE_VERSION:=914f1ead2e65c1e24ed2d8786aa883730db2208f
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
@@ -49,7 +49,7 @@ endef
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT),y)
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=\\\"$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)\\\"
|
||||
TARGET_CFLAGS += -DEASYMESH_VENDOR_EXT_OUI=$(CONFIG_TOPOLOGYD_EASYMESH_VENDOR_EXT_OUI)
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TOPOLOGYD_HOST_WAN_STATS),y)
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
config global 'global'
|
||||
option ageing_timer '1440'
|
||||
option reboot_persistent '0'
|
||||
list ifname 'br-lan'
|
||||
@@ -4,4 +4,4 @@ config topology 'topology'
|
||||
option depth '8'
|
||||
option interval '60'
|
||||
option maxlog '32'
|
||||
option profile '2'
|
||||
option profile '4'
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
day=""
|
||||
IP_RULE=""
|
||||
|
||||
process_ac_schedule() {
|
||||
local acs_id="$1"
|
||||
local is_enabled
|
||||
local access_control
|
||||
local start_time=""
|
||||
local stop_time=""
|
||||
local mac=""
|
||||
|
||||
handle_day_list() {
|
||||
local value=$1
|
||||
|
||||
val=$(echo $value | cut -c 1-3)
|
||||
if [ -z $day ]; then
|
||||
day="$val"
|
||||
else
|
||||
day="$day,$val"
|
||||
fi
|
||||
}
|
||||
|
||||
config_list_foreach "$acs_id" "day" handle_day_list
|
||||
config_get is_enabled "$acs_id" "enable" 1
|
||||
config_get access_control "$acs_id" "dm_parent"
|
||||
|
||||
if [ "$is_enabled" == "0" ] || [ -z "$access_control" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
IP_RULE=""
|
||||
|
||||
mac=$(uci -q get hosts.$access_control.macaddr)
|
||||
access_policy=$(uci -q get hosts.$access_control.access_policy)
|
||||
|
||||
config_get start_time "$acs_id" "start_time"
|
||||
config_get duration "$acs_id" "duration"
|
||||
|
||||
if [ -z "$mac" ] && [ -z "$start_time" ] && [ -z "$duration" ] && [ -z "$day" ] && [ -z "$access_policy" ]; then
|
||||
return
|
||||
fi
|
||||
if [ -n "$mac" ]; then
|
||||
IP_RULE="$IP_RULE -m mac --mac-source $mac"
|
||||
fi
|
||||
|
||||
# as per iptables manual default starttime is 00:00
|
||||
# default stoptime is 23:59
|
||||
if [ -z "$start_time" ]; then
|
||||
start_time="0:0"
|
||||
fi
|
||||
|
||||
if [ -n "$duration" ]; then
|
||||
hh=$(echo $start_time | awk -F: '{ print $1 }')
|
||||
mm=$(echo $start_time | awk -F: '{ print $2 }')
|
||||
hh_s=`expr $hh \* 3600`
|
||||
mm_s=`expr $mm \* 60`
|
||||
ss=$(( hh_s + mm_s ))
|
||||
|
||||
stop_ss=$(( ss + duration ))
|
||||
hh=$(( stop_ss / 3600 ))
|
||||
if [ $hh -lt 24 ]; then
|
||||
rem_ss=$(( stop_ss % 3600 ))
|
||||
mm=$(( rem_ss / 60 ))
|
||||
ss=$(( rem_ss % 60 ))
|
||||
stop_time="$hh:$mm:$ss"
|
||||
else
|
||||
stop_time="23:59"
|
||||
fi
|
||||
else
|
||||
stop_time="23:59"
|
||||
fi
|
||||
|
||||
# conversion to utc
|
||||
zone=$(date +%z | cut -c 1)
|
||||
utc_h=$(date -u -d @$(date "+%s" -d "$start_time") +%H)
|
||||
local_h=$(echo $start_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "+" ] && [ $utc_h -gt $local_h ]; then
|
||||
start_utc="0:0"
|
||||
else
|
||||
start_utc=$(date -u -d @$(date "+%s" -d "$start_time") +%H:%M)
|
||||
fi
|
||||
|
||||
utc_h=$(date -u -d @$(date "+%s" -d "$stop_time") +%H)
|
||||
local_h=$(echo $stop_time | awk -F: '{ print $1 }')
|
||||
if [ "$zone" == "-" ] && [ $utc_h -lt $local_h ]; then
|
||||
stop_utc="23:59"
|
||||
else
|
||||
stop_utc=$(date -u -d @$(date "+%s" -d "$stop_time") +%H:%M)
|
||||
fi
|
||||
|
||||
|
||||
IP_RULE="$IP_RULE -m time --timestart $start_utc --timestop $stop_utc"
|
||||
if [ -n "$day" ]; then
|
||||
IP_RULE="$IP_RULE --weekdays $day"
|
||||
fi
|
||||
|
||||
if [ "$access_policy" == "Deny" ]; then
|
||||
IP_RULE="$IP_RULE -j DROP"
|
||||
else
|
||||
IP_RULE="$IP_RULE -j ACCEPT"
|
||||
fi
|
||||
|
||||
iptables -w -A hosts_forward ${IP_RULE}
|
||||
ip6tables -w -A hosts_forward ${IP_RULE}
|
||||
|
||||
day=""
|
||||
}
|
||||
|
||||
iptables -w -F hosts_forward
|
||||
ip6tables -w -F hosts_forward
|
||||
|
||||
iptables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && iptables -w -t filter -I FORWARD -j hosts_forward
|
||||
ip6tables -w -t filter -N hosts_forward
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && ip6tables -w -t filter -I FORWARD -j hosts_forward
|
||||
|
||||
# Load /etc/config/hosts UCI file
|
||||
config_load hosts
|
||||
config_foreach process_ac_schedule ac_schedule
|
||||
|
||||
@@ -89,16 +89,24 @@ interfaces_ok(){
|
||||
# check if upstream untagged
|
||||
IFS=" "
|
||||
for itf in $up_interf; do
|
||||
# check if there exist a device section for this upstream interface, if yes the
|
||||
# do nothing, if no then split the it at . and use the native interface as
|
||||
# upstream interface
|
||||
dev_section=$(ubus call uci get '{"config":"network", "type":"device", "match":{"name":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
|
||||
# check if there exist a interface section for this upstream interface, if yes the
|
||||
# do nothing, if no then generate config as mcast config is outdated
|
||||
local dev_section=$(uci show network | grep -E "\.device=\'$itf\'" | cut -d'.' -f2)
|
||||
|
||||
# mcast config is outdated, simply generate as per new logic
|
||||
if [ -z "$dev_section" ]; then
|
||||
# check if the itf is a native interface && return 1
|
||||
native=$(ubus call uci get '{"config":"ports", "type":"ethport", "match":{"ifname":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[])
|
||||
[ -z "native" ] && return 1
|
||||
return 1
|
||||
else
|
||||
section_type=$(uci get network.$dev_section)
|
||||
if [ "$section_type" == "interface" ]; then
|
||||
# interface section exits, hence, sync has already happened
|
||||
# nothing to do further, just return
|
||||
return 0
|
||||
else
|
||||
# mcast config is outdated
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
|
||||
@@ -10,70 +10,83 @@ PROG_EXE=/usr/sbin/mcproxy
|
||||
PROG_PARAMS=
|
||||
PROG_PARAMS_SEPARATOR=:
|
||||
|
||||
setup_mcast_mode() {
|
||||
local snooped_interface=$1
|
||||
local mcast_mode=$2
|
||||
snooping_bridges=
|
||||
|
||||
local mcast_flood=
|
||||
|
||||
__device_is_bridge() {
|
||||
local device="$2"
|
||||
local devsec__="$(uci show network | grep name=.*$device | grep -v ifname | cut -d'.' -f2)"
|
||||
local sectype="$(uci -q get network.$devsec__)"
|
||||
local devtype="$(uci -q get network.$devsec__.type)"
|
||||
[ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1
|
||||
eval "$1=$devsec__"
|
||||
}
|
||||
|
||||
device_is_bridge() {
|
||||
local device="$1"
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
if [ -z "$snooped_interface" ]; then
|
||||
return
|
||||
fi
|
||||
__device_is_bridge devsec "$device" || return 1
|
||||
}
|
||||
|
||||
if [ $mcast_mode == "2" ]; then # disable mcast flood
|
||||
mcast_flood=0
|
||||
device_ports() {
|
||||
local device="$1"
|
||||
local devsec=
|
||||
|
||||
if __device_is_bridge devsec "$device"; then
|
||||
echo "$(uci get network.$devsec.ports)"
|
||||
else
|
||||
mcast_flood=1
|
||||
echo "$device"
|
||||
fi
|
||||
}
|
||||
|
||||
for intf in $snooped_interface;
|
||||
do
|
||||
devsec="$(uci show network | grep name=.*$intf | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
ports="$(uci get network.$devsec.ports)"
|
||||
for prt in $ports; do
|
||||
echo $mcast_flood > /sys/class/net/$prt/brport/multicast_flood
|
||||
done
|
||||
else
|
||||
if [ -f /sys/class/net/$intf/brport/multicast_flood ]; then
|
||||
echo $mcast_flood > /sys/class/net/$intf/brport/multicast_flood
|
||||
fi
|
||||
fi
|
||||
device_has_ip() {
|
||||
local protocol="$1"
|
||||
local device="$2"
|
||||
|
||||
# Read the openwrt interface for the device.
|
||||
# Device can have multiple logical interfaces like wan and wan6
|
||||
# but same l3 device
|
||||
# NB. Don't use 'get_network_of' here.
|
||||
# This function fails in some uci configurations for interfaces that refer
|
||||
# to a device indirectly.
|
||||
local ifaces=$(ubus call network.interface dump | jsonfilter -e "@.interface[@.device='$device'].interface")
|
||||
for iface in $ifaces; do
|
||||
local ip=
|
||||
case "$protocol" in
|
||||
"igmp") network_get_ipaddr ip "$iface" ;;
|
||||
"mld") network_get_ipaddr6 ip "$iface" ;;
|
||||
esac
|
||||
[ -n "$ip" ] && return
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
config_mcproxy_interfaces() {
|
||||
local upstreams="$1"
|
||||
local downstreams="$2"
|
||||
local exceptions="$3"
|
||||
local protocol="$1"
|
||||
local upstreams="$2"
|
||||
local downstreams="$3"
|
||||
local exceptions="$4"
|
||||
|
||||
if [ -z "$upstreams" ] || [ -z "$downstreams" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
local str_up=""
|
||||
if [ -n "$upstreams" ]; then
|
||||
for upstream in $upstreams; do
|
||||
str_up="$str_up \"$upstream\""
|
||||
done
|
||||
fi
|
||||
for upstream in $upstreams; do
|
||||
device_has_ip "$protocol" "$upstream" || continue
|
||||
str_up="$str_up \"$upstream\""
|
||||
done
|
||||
[ -z "$str_up" ] && return 1
|
||||
|
||||
local str_down=""
|
||||
if [ -n "$downstreams" ]; then
|
||||
for downstream in $downstreams; do
|
||||
str_down="$str_down \"$downstream\""
|
||||
done
|
||||
fi
|
||||
for downstream in $downstreams; do
|
||||
device_has_ip "$protocol" "$downstream" || continue
|
||||
str_down="$str_down \"$downstream\""
|
||||
done
|
||||
[ -z "$str_down" ] && return 1
|
||||
|
||||
if [ ! -z $downstream ]; then
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$exceptions" ] || [ -z "$upstreams" ]; then
|
||||
return
|
||||
fi
|
||||
echo -e "pinstance main:$str_up ==>$str_down;\n" >> $CONFFILE
|
||||
|
||||
for excp in $exceptions; do
|
||||
local filter=""
|
||||
@@ -89,34 +102,129 @@ config_mcproxy_interfaces() {
|
||||
;;
|
||||
esac
|
||||
|
||||
for upstream in $upstreams; do
|
||||
echo "pinstance main upstream \"$upstream\" in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream \"$upstream\" out blacklist table{$filter };" >> $CONFFILE
|
||||
for upstream in $str_up; do
|
||||
echo "pinstance main upstream $upstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main upstream $upstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
|
||||
for downstream in $downstreams; do
|
||||
echo "pinstance main downstream \"$downstream\" in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream \"$downstream\" out blacklist table{$filter };" >> $CONFFILE
|
||||
for downstream in $str_down; do
|
||||
echo "pinstance main downstream $downstream in blacklist table{$filter };" >> $CONFFILE
|
||||
echo "pinstance main downstream $downstream out blacklist table{$filter };" >> $CONFFILE
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_snooping() {
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
local downstreams="$1"
|
||||
local snooping="$2"
|
||||
|
||||
for downstream in $downstreams; do
|
||||
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
echo 1 > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
if device_is_bridge "$downstream"; then
|
||||
echo $snooping > /sys/class/net/$downstream/bridge/multicast_snooping
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_fastleave() {
|
||||
local downstreams="$1"
|
||||
local fastleave="$2"
|
||||
local prt
|
||||
|
||||
for downstream in $downstreams; do
|
||||
for prt in $(device_ports $downstream); do
|
||||
if [ -f /sys/class/net/$prt/brport/multicast_fast_leave ]; then
|
||||
echo $fastleave > /sys/class/net/$prt/brport/multicast_fast_leave
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_version() {
|
||||
local protocol="$1"
|
||||
local interfaces="$2"
|
||||
local version="$3"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $version > /sys/class/net/$iface/bridge/multicast_"$protocol"_version
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_robustness() {
|
||||
local interfaces="$1"
|
||||
local robustness="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $robustness > /sys/class/net/$iface/bridge/multicast_last_member_count
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_query_interval() {
|
||||
local interfaces="$1"
|
||||
local query_interval="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $query_interval > /sys/class/net/$iface/bridge/multicast_query_interval
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_q_resp_interval() {
|
||||
local interfaces="$1"
|
||||
local q_resp_interval="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $q_resp_interval > /sys/class/net/$iface/bridge/multicast_query_response_interval
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_last_mem_q_int() {
|
||||
local interfaces="$1"
|
||||
local last_mem_q_int="$2"
|
||||
|
||||
for iface in $interfaces; do
|
||||
echo $last_mem_q_int > /sys/class/net/$iface/bridge/multicast_last_member_interval
|
||||
done
|
||||
}
|
||||
|
||||
config_sysfs_mcast_flood() {
|
||||
local downstreams=$1
|
||||
local mcast_mode=$2
|
||||
local prt
|
||||
|
||||
local mcast_flood=
|
||||
if [ $mcast_mode == "2" ]; then # disable mcast flood
|
||||
mcast_flood=0
|
||||
else
|
||||
mcast_flood=1
|
||||
fi
|
||||
|
||||
for downstream in $downstreams; do
|
||||
for prt in $(device_ports $downstream); do
|
||||
if [ -f /sys/class/net/$prt/brport/multicast_flood ]; then
|
||||
echo $mcast_flood > /sys/class/net/$prt/brport/multicast_flood
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
config_snooping_mode() {
|
||||
local interfaces="$1"
|
||||
local snooping="$2"
|
||||
|
||||
# snooping_mode:
|
||||
# 0 - snooping is disabled
|
||||
# 1 - multicast flood is enabled
|
||||
# 2 - multicast flood is disabled
|
||||
[ -z "$snooping_mode" ] && snooping_mode=2
|
||||
|
||||
if [ "$snooping_mode" == 0 ]; then
|
||||
config_sysfs_mcast_snooping "$interfaces" 0
|
||||
else
|
||||
config_sysfs_mcast_snooping "$interfaces" 1
|
||||
fi
|
||||
|
||||
config_sysfs_mcast_flood "$interfaces" "$snooping_mode"
|
||||
}
|
||||
|
||||
config_mcproxy_instance() {
|
||||
local protocol="$1"
|
||||
local version="$2"
|
||||
@@ -129,7 +237,6 @@ config_mcproxy_instance() {
|
||||
local exceptions=
|
||||
local upstreams=
|
||||
local downstreams=
|
||||
local intf_has_ip=
|
||||
local mcast_mode=2 # default value 2 is for blocking mode
|
||||
|
||||
CONFFILE=/var/etc/mcproxy_"$protocol".conf
|
||||
@@ -156,6 +263,11 @@ config_mcproxy_instance() {
|
||||
upstreams=$igmp_p_up_interfaces
|
||||
downstreams=$igmp_p_down_interfaces
|
||||
mcast_mode=$igmp_p_mode
|
||||
|
||||
# mcproxy reserves two multicast subscriptions for igmp router service groups
|
||||
local mg=$(cat /proc/sys/net/ipv4/igmp_max_memberships)
|
||||
mg=$((mg+2))
|
||||
echo $mg > /proc/sys/net/ipv4/igmp_max_memberships
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
case "$version" in
|
||||
[1-2])
|
||||
@@ -178,100 +290,130 @@ config_mcproxy_instance() {
|
||||
mcast_mode=$mld_p_mode
|
||||
fi
|
||||
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
config_sysfs_mcast_snooping
|
||||
|
||||
[ -n "$max_groups" ] && echo -e "max_groups $max_groups;" >> $CONFFILE
|
||||
[ -n "$robustness" ] && echo -e "rv $robustness;" >> $CONFFILE
|
||||
[ -n "$query_interval" ] && echo -e "qi $query_interval;" >> $CONFFILE
|
||||
[ -n "$q_resp_interval" ] && echo -e "qri $q_resp_interval;" >> $CONFFILE
|
||||
[ -n "$last_mem_q_int" ] && echo -e "lmqi $last_mem_q_int;" >> $CONFFILE
|
||||
if [[ -n $fast_leave ]]; then
|
||||
echo -e "fastleave $fast_leave;\n" >> $CONFFILE
|
||||
config_sysfs_mcast_fastleave $fast_leave
|
||||
[ -n "$fast_leave" ] && echo -e "fastleave $fast_leave;\n" >> $CONFFILE
|
||||
|
||||
config_mcproxy_interfaces "$protocol" "$upstreams" "$downstreams" "$exceptions" || return
|
||||
|
||||
# for snooping to work we should enable it on the bridge, doing it from
|
||||
# here instead of from inside network config
|
||||
if [ "$downstreams" != "$snooping_bridges" ]; then
|
||||
config_sysfs_mcast_snooping "$downstreams" 1
|
||||
[ -n $fast_leave ] &&
|
||||
config_sysfs_mcast_fastleave "$downstreams" "$fast_leave"
|
||||
config_sysfs_mcast_flood "$downstreams" "$mcast_mode"
|
||||
fi
|
||||
|
||||
setup_mcast_mode $downstreams $mcast_mode
|
||||
[ -n "$upstreams" ] && [ -n "$downstreams" ] &&
|
||||
config_mcproxy_interfaces "$upstreams" "$downstreams" "$exceptions"
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
}
|
||||
|
||||
# In case on proxy, upstreams is a list. Iterating and running the mcproxy
|
||||
# for each valid upstream interface
|
||||
for upstream_device in $upstreams;
|
||||
do
|
||||
# Read the upstream interface for the upstream device
|
||||
# upstream device can have multiple logical interfaces like wan and wan6
|
||||
# but same l3 device
|
||||
local upstream_ifaces=$(get_network_of $upstream_device)
|
||||
disable_snooping_iface() {
|
||||
local iface="$(uci -q get network.$1.name)"
|
||||
config_sysfs_mcast_snooping "$iface" 0
|
||||
}
|
||||
|
||||
for iface in $upstream_ifaces;
|
||||
do
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
network_get_ipaddr upstream_ip $iface
|
||||
if [ ! -z "${upstream_ip}" ]; then
|
||||
intf_has_ip=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
disable_snooping() {
|
||||
config_load network
|
||||
config_foreach disable_snooping_iface device
|
||||
}
|
||||
|
||||
if [ "$protocol" == "mld" ]; then
|
||||
network_get_ipaddr6 upstream_ip $iface
|
||||
if [ ! -z "${upstream_ip}" ]; then
|
||||
intf_has_ip=1
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
config_snooping() {
|
||||
local protocol="$1"
|
||||
|
||||
if [ -z "${intf_has_ip}" ]; then
|
||||
continue
|
||||
fi
|
||||
local version=
|
||||
local robustness=
|
||||
local query_interval=
|
||||
local q_resp_interval=
|
||||
local last_mem_q_int=
|
||||
local fast_leave=0
|
||||
local snooping_mode=
|
||||
local interfaces=
|
||||
|
||||
PROG_PARAMS="${PROG_PARAMS} -f ${CONFFILE}${PROG_PARAMS_SEPARATOR}"
|
||||
local HZ=100
|
||||
|
||||
local all_interfaces=
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
all_interfaces=$igmp_s_iface
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
all_interfaces=$mld_s_iface
|
||||
fi
|
||||
for iface in $all_interfaces; do
|
||||
device_is_bridge "$iface" || continue
|
||||
interfaces="$interfaces $iface"
|
||||
done
|
||||
[ -z "$interfaces" ] && return
|
||||
snooping_bridges="$interfaces"
|
||||
|
||||
if [ "$protocol" == "igmp" ]; then
|
||||
case "$igmp_s_version" in
|
||||
[1-3])
|
||||
version="$igmp_s_version"
|
||||
;;
|
||||
*)
|
||||
version="2"
|
||||
;;
|
||||
esac
|
||||
|
||||
robustness=$igmp_s_robustness
|
||||
query_interval=$(( igmp_s_query_interval * HZ ))
|
||||
q_resp_interval=$(( igmp_s_q_resp_interval * HZ / 10 ))
|
||||
last_mem_q_int=$(( igmp_s_last_mem_q_int * HZ / 10 ))
|
||||
fast_leave=$igmp_s_fast_leave
|
||||
snooping_mode=$igmp_s_mode
|
||||
elif [ "$protocol" == "mld" ]; then
|
||||
case "$mld_s_version" in
|
||||
[1-2])
|
||||
version="$mld_s_version"
|
||||
;;
|
||||
*)
|
||||
version="2"
|
||||
;;
|
||||
esac
|
||||
|
||||
robustness=$mld_s_robustness
|
||||
query_interval=$(( mld_s_query_interval * HZ ))
|
||||
q_resp_interval=$(( mld_s_q_resp_interval * HZ / 10 ))
|
||||
last_mem_q_int=$(( mld_s_last_mem_q_int * HZ / 10 ))
|
||||
fast_leave=$mld_s_fast_leave
|
||||
snooping_mode=$mld_s_mode
|
||||
fi
|
||||
|
||||
config_snooping_mode "$interfaces" "$snooping_mode"
|
||||
|
||||
[ -n "$version" ] && config_sysfs_mcast_version "$protocol" "$interfaces" "$version"
|
||||
[ -n "$robustness" ] && config_sysfs_mcast_robustness "$interfaces" "$robustness"
|
||||
[ -n "$query_interval" ] && config_sysfs_mcast_query_interval "$interfaces" "$query_interval"
|
||||
[ -n "$q_resp_interval" ] && config_sysfs_mcast_q_resp_interval "$interfaces" "$q_resp_interval"
|
||||
[ -n "$last_mem_q_int" ] && config_sysfs_mcast_last_mem_q_int "$interfaces" "$last_mem_q_int"
|
||||
[ -n "$fast_leave" ] && config_sysfs_mcast_fastleave "$interfaces" "$fast_leave"
|
||||
}
|
||||
|
||||
config_mcproxy() {
|
||||
disable_snooping
|
||||
if [ "$igmp_p_enable" == "1" ]; then
|
||||
config_mcproxy_instance igmp "$igmp_p_version"
|
||||
elif [ "$igmp_s_enable" == "1" ]; then
|
||||
config_snooping igmp "$igmp_s_version"
|
||||
fi
|
||||
|
||||
if [ "$mld_p_enable" == "1" ]; then
|
||||
config_mcproxy_instance mld "$mld_p_version"
|
||||
elif [ "$mld_s_enable" == "1" ]; then
|
||||
config_snooping mld "$mld_s_version"
|
||||
fi
|
||||
}
|
||||
|
||||
config_sysfs_mcast_fastleave() {
|
||||
local devsec=
|
||||
local sectype=
|
||||
local devtype=
|
||||
local ports=
|
||||
|
||||
for downstream in $downstreams; do
|
||||
devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)"
|
||||
sectype="$(uci -q get network.$devsec)"
|
||||
devtype="$(uci -q get network.$devsec.type)"
|
||||
if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then
|
||||
ports="$(uci get network.$devsec.ports)"
|
||||
for prt in $ports; do
|
||||
echo $1 > /sys/class/net/$prt/brport/multicast_fast_leave
|
||||
done
|
||||
else
|
||||
[[ -f /sys/class/net/$downstream/brport/multicast_fast_leave ]] && echo $1 > /sys/class/net/$downstream/brport/multicast_fast_leave
|
||||
fi
|
||||
done
|
||||
|
||||
setup_mcast_mode() {
|
||||
:
|
||||
}
|
||||
|
||||
configure_mcast() {
|
||||
config_global_params "set_max_groups_and_sources"
|
||||
|
||||
# mcproxy reserves two multicast subscriptions for igmp router service groups
|
||||
local mg=$(cat /proc/sys/net/ipv4/igmp_max_memberships)
|
||||
mg=$((mg+2))
|
||||
echo $mg > /proc/sys/net/ipv4/igmp_max_memberships
|
||||
|
||||
read_mcast_snooping_params
|
||||
read_mcast_proxy_params
|
||||
config_mcproxy
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
* Erik Karlsson - initial implementation
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <string.h>
|
||||
#include <shadow.h>
|
||||
#include <crypt.h>
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obudpst
|
||||
PKG_VERSION:=7.5.1
|
||||
PKG_VERSION:=8.0.0
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/BroadbandForum/obudpst.git
|
||||
PKG_SOURCE_VERSION:=a8faf1925ea9189467e7f8d3b9d93c67c8b927bd
|
||||
PKG_SOURCE_VERSION:=1d00a6de1147b5fb4280c443a67b7e5ded3a5c97
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
if PACKAGE_obuspa
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config OBUSPA_DB_PATH
|
||||
string "Configure path for usp.db file"
|
||||
default "/tmp/"
|
||||
|
||||
config OBUSPA_MTP_ENABLE_MQTT
|
||||
bool "Enable MQTT as mtp protocol"
|
||||
default y
|
||||
@@ -25,5 +18,8 @@ config OBUSPA_MTP_ENABLE_COAP
|
||||
config OBUSPA_CONTROLLER_MTP_VERIFY
|
||||
bool "Enable verification of controller MTP before processing the message"
|
||||
default n
|
||||
endmenu
|
||||
|
||||
config OBUSPA_ENABLE_TEST_CONTROLLER
|
||||
bool "Adds a test controller by default"
|
||||
default n
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=obuspa
|
||||
PKG_VERSION:=7.0.2.22
|
||||
PKG_VERSION:=7.0.5.5
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/obuspa.git
|
||||
PKG_SOURCE_VERSION:=27e47dcd5b8351faee48b6eb316fed64eeaaaee9
|
||||
PKG_SOURCE_VERSION:=ad32d70ccbe3942b945bf6caf74988bd5660cf96
|
||||
PKG_MAINTAINER:=Vivek Dutta <vivek.dutta@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -19,18 +19,19 @@ endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/obuspa
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=USP agent
|
||||
MENU:=1
|
||||
DEPENDS:=+libopenssl +libuci +libblobmsg-json +libcurl +libsqlite3 +libubox +libubus +libmosquitto-ssl +libwebsockets-openssl
|
||||
endef
|
||||
|
||||
@@ -44,48 +45,40 @@ endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE \
|
||||
-DHAVE_STRERROR_R \
|
||||
-Wall \
|
||||
-D_DM_VENDOR_PREFIX=$(CONFIG_BBF_VENDOR_PREFIX) \
|
||||
-Werror
|
||||
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_PREFIX=/tmp
|
||||
CMAKE_OPTIONS += -DCMAKE_INSTALL_LOCALSTATEDIR=""
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_CONTROLLER_MTP_VERIFY),)
|
||||
TARGET_CFLAGS += -DOBUSPA_CONTROLLER_MTP_VERIFY
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_OBUSPA_DB_PATH),)
|
||||
CONFIGURE_ARGS += \
|
||||
--localstatedir="$(CONFIG_OBUSPA_DB_PATH)"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_STOMP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-stomp
|
||||
CMAKE_OPTIONS += -DENABLE_STOMP=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-stomp
|
||||
CMAKE_OPTIONS += -DENABLE_STOMP=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_MQTT),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-mqtt
|
||||
CMAKE_OPTIONS += -DENABLE_MQTT=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-mqtt
|
||||
CMAKE_OPTIONS += -DENABLE_MQTT=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_COAP),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-coap
|
||||
CMAKE_OPTIONS += -DENABLE_COAP=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-coap
|
||||
CMAKE_OPTIONS += -DENABLE_COAP=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OBUSPA_MTP_ENABLE_WEBSOCKETS),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-websockets
|
||||
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=ON
|
||||
else
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-websockets
|
||||
CMAKE_OPTIONS += -DENABLE_WEBSOCKETS=OFF
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
@@ -100,16 +93,22 @@ define Package/obuspa/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/obuspa
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/obuspa $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/obuspa $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/obuspa $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/roles.json $(1)/etc/obuspa/roles.json
|
||||
$(INSTALL_DATA) ./files/etc/obuspa/dmcaching_exclude.json $(1)/etc/obuspa/dmcaching_exclude.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/USPAgent.json $(1)/etc/bbfdm/json/USPAgent.json
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/json/TransferComplete.json $(1)/etc/bbfdm/json/TransferComplete.json
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/00-obuspa-extender-mode $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/01-fix-upgrade-uci $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/02-obuspa-dhcp-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
|
||||
$(call BbfdmInstallPlugin,$(1),./files/etc/bbfdm/json/USPAgent.json)
|
||||
ifeq ($(CONFIG_OBUSPA_ENABLE_TEST_CONTROLLER),y)
|
||||
$(INSTALL_BIN) ./files/etc/init.d/usptest $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/55-test-usp-controller $(1)/etc/uci-defaults/
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,obuspa))
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
{
|
||||
"Device.LocalAgent.": {
|
||||
"type": "object",
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"TransferComplete!": {
|
||||
"type": "event",
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"Command": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"CommandKey": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"Requestor": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"TransferType": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"enumerations": [
|
||||
"Download",
|
||||
"Upload"
|
||||
]
|
||||
},
|
||||
"Affected": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string"
|
||||
},
|
||||
"TransferURL": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "URL",
|
||||
"range": [
|
||||
{
|
||||
"max": 2048
|
||||
}
|
||||
]
|
||||
},
|
||||
"StartTime": {
|
||||
"type": "dateTime",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "dateTime"
|
||||
},
|
||||
"CompleteTime": {
|
||||
"type": "dateTime",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "dateTime"
|
||||
},
|
||||
"FaultCode": {
|
||||
"type": "unsignedInt",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "unsignedInt"
|
||||
},
|
||||
"FaultString": {
|
||||
"type": "string",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"version": "2.12",
|
||||
"protocols": [
|
||||
"usp"
|
||||
],
|
||||
"datatype": "string",
|
||||
"range": [
|
||||
{
|
||||
"max": 256
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
config obuspa 'global'
|
||||
option enabled '1'
|
||||
option debug '0'
|
||||
option log_level '1'
|
||||
option debug '1'
|
||||
option dhcp_discovery '1'
|
||||
option log_level '2'
|
||||
option prototrace '0'
|
||||
option db_file '/etc/obuspa/usp.db'
|
||||
#option role_file '/etc/obuspa/roles.json'
|
||||
option role_file '/etc/obuspa/roles.json'
|
||||
option dm_caching_exclude '/etc/obuspa/dmcaching_exclude.json'
|
||||
#option trust_cert '/etc/obuspa/rootCA.pem'
|
||||
#option client_cert '/etc/obuspa/client.pem'
|
||||
#option log_dest '/var/log/obuspa'
|
||||
#option log_dest '/tmp/obuspa.log'
|
||||
|
||||
|
||||
@@ -196,6 +196,10 @@ validate_obuspa_section()
|
||||
'debug:bool:0' \
|
||||
'prototrace:bool:0' \
|
||||
'log_level:uinteger' \
|
||||
'min_num_to_group:uinteger' \
|
||||
'max_group_sep:uinteger' \
|
||||
'max_cache_time:uinteger' \
|
||||
'ipc_timeout:uinteger' \
|
||||
'log_dest:string' \
|
||||
'db_file:string' \
|
||||
'role_file:file'
|
||||
@@ -226,8 +230,8 @@ validate_controller_section()
|
||||
'Path:string' \
|
||||
'EnableEncryption:bool' \
|
||||
'PeriodicNotifInterval:uinteger' \
|
||||
'SessionMode:string:Allow'
|
||||
|
||||
'SessionMode:string:Allow' \
|
||||
'ProvisioningCode:string'
|
||||
}
|
||||
|
||||
validate_subscription_section()
|
||||
@@ -319,7 +323,7 @@ configure_controller()
|
||||
{
|
||||
local EndpointID Enable
|
||||
local Protocol Destination
|
||||
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName
|
||||
local Topic mqtt stomp assigned_role_name AssignedRole ParameterName ProvisioningCode
|
||||
local Host Port Path EnableEncryption Reference SessionMode PeriodicNotifInterval
|
||||
local dm_ref sec
|
||||
|
||||
@@ -358,6 +362,10 @@ configure_controller()
|
||||
db_set "${BASEPATH}.Enable" "${Enable}"
|
||||
db_set "${BASEPATH}.EndpointID" "${EndpointID}"
|
||||
|
||||
if [ -n "${ProvisioningCode}" ]; then
|
||||
db_set "${BASEPATH}.ProvisioningCode" "${ProvisioningCode}"
|
||||
fi
|
||||
|
||||
if [ -n "${PeriodicNotifInterval}" ]; then
|
||||
db_set "${BASEPATH}.PeriodicNotifInterval" "${PeriodicNotifInterval}"
|
||||
fi
|
||||
@@ -1025,37 +1033,30 @@ db_init()
|
||||
return 0;
|
||||
}
|
||||
|
||||
register_service()
|
||||
{
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
procd_set_param command ${PROG}
|
||||
|
||||
configure_obuspa
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-5}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-3}"
|
||||
|
||||
procd_set_param watch bbfdm
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 0
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0;
|
||||
procd_open_instance ${CONFIGURATION}
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
db_init "${1}"
|
||||
procd_set_param command ${PROG}
|
||||
configure_obuspa
|
||||
procd_set_param respawn \
|
||||
"${respawn_threshold:-10}" \
|
||||
"${respawn_timeout:-10}" "${respawn_retry:-5}"
|
||||
#procd_set_param limits core="unlimited"
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/obuspa/
|
||||
db_init "${1}"
|
||||
register_service
|
||||
procd_close_instance ${CONFIGURATION}
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
${PROG} -c stop >/dev/null 2>&1
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
timeout 5 ${PROG} -c stop
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
@@ -1065,25 +1066,4 @@ reload_service() {
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "obuspa"
|
||||
|
||||
# Create a reload trigger if schema update avaialble
|
||||
procd_open_trigger
|
||||
json_add_array
|
||||
json_add_string "" "bbfdm"
|
||||
json_add_array
|
||||
json_add_string "" "if"
|
||||
json_add_array
|
||||
json_add_string "" "eq"
|
||||
json_add_string "" "action"
|
||||
json_add_string "" "schema_update_available"
|
||||
json_close_array
|
||||
json_add_array
|
||||
json_add_string "" "run_script"
|
||||
json_add_string "" "/etc/init.d/obuspa"
|
||||
json_add_string "" "restart"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
}
|
||||
|
||||
75
obuspa/files/etc/init.d/usptest
Executable file
75
obuspa/files/etc/init.d/usptest
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=01
|
||||
USE_PROCD=1
|
||||
|
||||
log()
|
||||
{
|
||||
echo "$*"|logger -t usptest -p debug
|
||||
}
|
||||
|
||||
get_oui_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
|
||||
get_serial_from_db()
|
||||
{
|
||||
db -q get device.deviceinfo.SerialNumber
|
||||
}
|
||||
|
||||
publish_endpoint()
|
||||
{
|
||||
local AgentEndpointID serial oui user pass
|
||||
|
||||
if ! uci -q get obuspa.testmqtt; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
# return if mosquitto_pub is not present
|
||||
if [ ! "$(command -v mosquitto_pub)" ]; then
|
||||
log "mosquitto_pub not present can't publish EndpointID"
|
||||
return 0;
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
# 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//+/%2B}"
|
||||
fi
|
||||
|
||||
config_get user testmqtt Username ""
|
||||
config_get pass testmqtt Password ""
|
||||
|
||||
# publish Agent's EndpointID in mosquito broker for discovery by usp-js
|
||||
# This is a work around till obuspa adds supports for mDNS discovery
|
||||
if [ -n "${user}" ] && [ -n "${pass}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username, password"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}" -P "${pass}"
|
||||
elif [ -n "${user}" ]; then
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker with username only"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}" -u "${user}"
|
||||
else
|
||||
log "Publishing EndpointID ${AgentEndpointID} to local mqtt broker"
|
||||
mosquitto_pub -r -t "obuspa/EndpointID" -m "${AgentEndpointID}"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance usptest
|
||||
publish_endpoint
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
publish_endpoint
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "mosquitto" "obuspa"
|
||||
}
|
||||
@@ -1,7 +1,18 @@
|
||||
{
|
||||
"roles": [
|
||||
{
|
||||
"name": "admin",
|
||||
"name": "full_access",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_ALL"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Untrusted",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
@@ -13,13 +24,172 @@
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"object": "Device.DeviceInfo.ProcessStatus.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorConfigFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.VendorLogFile.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.Processor.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "admin",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.Reboot()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.FactoryReset()",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.Server.Pool.{i}.StaticAddress.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
@@ -27,17 +197,352 @@
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.{BBF_VENDOR_PREFIX}URLFilter.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SoftwareModules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -48,47 +553,311 @@
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
"PERMIT_NONE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DeviceInfo.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Time.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UPnP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Bridging.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Ethernet.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv4.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DHCPv6.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Hosts.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.NAT.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PPP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Routing.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.IEEE1905.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.InterfaceStack.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.DynamicDNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.LANConfigSecurity.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Security.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.RouterAdvertisement.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Services.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.UserInterface.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.PeriodicStatistics.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.SoftwareModules.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object":"Device.Users.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.LocalAgent.Subscription.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_ADD",
|
||||
"PERMIT_SET",
|
||||
"PERMIT_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.WiFi.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.DNS.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO"
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.IP.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST"
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "undefined-1"
|
||||
},
|
||||
{
|
||||
"name": "undefined-2"
|
||||
},
|
||||
{
|
||||
"name": "undefined-3"
|
||||
"name": "extender",
|
||||
"permission": [
|
||||
{
|
||||
"object": "Device.",
|
||||
"perm": [
|
||||
"PERMIT_NONE"
|
||||
]
|
||||
},
|
||||
{
|
||||
"object": "Device.SSH.",
|
||||
"perm": [
|
||||
"PERMIT_GET",
|
||||
"PERMIT_GET_INST",
|
||||
"PERMIT_OBJ_INFO",
|
||||
"PERMIT_CMD_INFO",
|
||||
"PERMIT_OPER",
|
||||
"PERMIT_SUBS_VAL_CHANGE",
|
||||
"PERMIT_SUBS_OBJ_ADD",
|
||||
"PERMIT_SUBS_OBJ_DEL",
|
||||
"PERMIT_SUBS_EVT_OPER_COMP"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "undefined-4"
|
||||
|
||||
13
obuspa/files/etc/uci-defaults/00-obuspa-extender-mode
Normal file
13
obuspa/files/etc/uci-defaults/00-obuspa-extender-mode
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
config_load obuspa
|
||||
config_get interface global interface ""
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
if [ "${mode}" == "extender" -a -z "$interface" ] ; then
|
||||
uci_set obuspa global interface "lan"
|
||||
fi
|
||||
fi
|
||||
59
obuspa/files/etc/uci-defaults/02-obuspa-dhcp-option
Normal file
59
obuspa/files/etc/uci-defaults/02-obuspa-dhcp-option
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
configure_dhcp_options() {
|
||||
local enabled inerface discovery
|
||||
config_load obuspa
|
||||
config_get_bool enabled global enabled 1
|
||||
config_get interface global interface "wan"
|
||||
config_get_bool discovery global dhcp_discovery 1
|
||||
|
||||
if [ "${enabled}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${discovery}" -eq 1 ]; then
|
||||
network_uci_update=0
|
||||
reqopts="$(uci -q get network."${interface}".reqopts)"
|
||||
proto="$(uci -q get network."${interface}".proto)"
|
||||
local req125_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
sendopts="$(uci -q get network."${interface}".sendopts)"
|
||||
opt124="124:"
|
||||
send124_present=0
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt124"* ]]; then
|
||||
send124_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${interface}".reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send124_present} -eq 0 ]; then
|
||||
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
|
||||
uci -q set network."${interface}".sendopts="$newsendopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${network_uci_update} -eq 1 ]; then
|
||||
uci commit network
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_dhcp_options
|
||||
70
obuspa/files/etc/uci-defaults/55-test-usp-controller
Normal file
70
obuspa/files/etc/uci-defaults/55-test-usp-controller
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
if [ ! -f "/etc/config/obuspa" ]; then
|
||||
echo "Local obuspa not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/config/mosquitto" ]; then
|
||||
echo "Local mosquitto broker not available"
|
||||
return 0
|
||||
fi
|
||||
|
||||
add_obuspa_test_mtp()
|
||||
{
|
||||
uci_add obuspa mtp test_mtp
|
||||
uci_set obuspa test_mtp Protocol 'MQTT'
|
||||
uci_set obuspa test_mtp ResponseTopicConfigured '/usp/endpoint'
|
||||
uci_set obuspa test_mtp mqtt 'testmqtt'
|
||||
}
|
||||
|
||||
add_obuspa_test_mqtt()
|
||||
{
|
||||
# Adds Device.MQTT.Client.
|
||||
uci_add obuspa mqtt testmqtt
|
||||
uci_set obuspa testmqtt BrokerAddress '127.0.0.1'
|
||||
uci_set obuspa testmqtt BrokerPort '1883'
|
||||
uci_set obuspa testmqtt TransportProtocol 'TCP/IP'
|
||||
}
|
||||
|
||||
add_obuspa_test_controller()
|
||||
{
|
||||
# Adds Device.LocalAgent.Controller.
|
||||
uci_add obuspa controller testcontroller
|
||||
uci_set obuspa testcontroller EndpointID 'proto::interop-usp-controller'
|
||||
uci_set obuspa testcontroller Protocol 'MQTT'
|
||||
uci_set obuspa testcontroller Topic '/usp/controller'
|
||||
uci_set obuspa testcontroller mqtt 'testmqtt'
|
||||
uci_set obuspa testcontroller assigned_role_name 'full_access'
|
||||
}
|
||||
|
||||
add_usp_test()
|
||||
{
|
||||
uci_add mosquitto listener usptest
|
||||
uci_set mosquitto usptest enabled 1
|
||||
uci_set mosquitto usptest port '9001'
|
||||
uci_set mosquitto usptest protocol 'websockets'
|
||||
uci_set mosquitto usptest require_certificates '0'
|
||||
uci_set mosquitto usptest auth_plugin '/usr/lib/mosquitto_auth_shadow.so'
|
||||
}
|
||||
|
||||
add_obuspa_config()
|
||||
{
|
||||
uci_add mosquitto listener obuspa
|
||||
uci_set mosquitto obuspa enabled 1
|
||||
uci_set mosquitto obuspa port '1883'
|
||||
uci_set mosquitto obuspa no_remote_access '1'
|
||||
uci_set mosquitto obuspa allow_anonymous '1'
|
||||
}
|
||||
|
||||
# Install test usp controller config
|
||||
uci_load mosquitto
|
||||
add_usp_test
|
||||
add_obuspa_config
|
||||
|
||||
uci_load obuspa
|
||||
add_obuspa_test_mtp
|
||||
add_obuspa_test_mqtt
|
||||
add_obuspa_test_controller
|
||||
314
obuspa/files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
Normal file
314
obuspa/files/etc/udhcpc.user.d/udhcpc_obuspa_opt125.user
Normal file
@@ -0,0 +1,314 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
URL=""
|
||||
PROV_CODE=""
|
||||
RETRY_MIN_INTERVAL="5"
|
||||
RETRY_INTERVAL_MUL="2000"
|
||||
ENDPOINT_ID=""
|
||||
|
||||
get_oui_from_db() {
|
||||
db -q get device.deviceinfo.ManufacturerOUI
|
||||
}
|
||||
|
||||
get_serial_from_db() {
|
||||
db -q get device.deviceinfo.SerialNumber
|
||||
}
|
||||
|
||||
get_vivsoi() {
|
||||
# opt125 environment variable has data in below format
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | enterprise-number1 |
|
||||
# | |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||
# | data-len1 | |
|
||||
# +-+-+-+-+-+-+-+-+ option-data1 |
|
||||
# / /
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|
||||
# | enterprise-number2 | ^
|
||||
# | | |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
||||
# | data-len2 | | optional
|
||||
# +-+-+-+-+-+-+-+-+ option-data2 | |
|
||||
# / / |
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
|
||||
# ~ ... ~ V
|
||||
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ -----
|
||||
|
||||
# Enterprise Id Len Sub Op SLen Data Sub Op SLen Data Sub Op SLen Data
|
||||
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
|
||||
# | id | n | 1 | n1 | D1 | 2 | n2 | D2 | ... | 6 | n6 | D6 |
|
||||
# +-------------+-----+------+------+----+------+-----+----+-----+------+-----+----+
|
||||
|
||||
local opt125="$1"
|
||||
local len="$2"
|
||||
local ent_id
|
||||
|
||||
#hex-string 2 character=1 Byte
|
||||
# length in hex string will be twice of actual Byte length
|
||||
[ "$len" -gt "8" ] || return
|
||||
|
||||
data="${opt125}"
|
||||
rem_len="${len}"
|
||||
while [ $rem_len -gt 0 ]; do
|
||||
ent_id=${data:0:8}
|
||||
ent_id=$(printf "%d\n" "0x$ent_id")
|
||||
|
||||
if [ $ent_id -ne 3561 ]; then
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - $data_len ))
|
||||
continue
|
||||
fi
|
||||
|
||||
# read the length of enterprise data
|
||||
len_val=${data:8:2}
|
||||
data_len=$(printf "%d\n" "0x$len_val")
|
||||
# add 4 byte for ent_id and 1 byte for len
|
||||
data_len=$(( data_len * 2 + 10 ))
|
||||
|
||||
opt_len=$(printf "%d\n" "0x$len_val")
|
||||
[ $opt_len -eq 0 ] && return
|
||||
|
||||
# populate the option data of enterprise id
|
||||
sub_data_len=$(( opt_len * 2))
|
||||
# starting 10 means ahead of length field
|
||||
sub_data=${data:10:"${sub_data_len}"}
|
||||
|
||||
# parsing of suboption of option 125
|
||||
while [ $sub_data_len -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${sub_data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
|
||||
# get the length of suboption
|
||||
sub_opt_len=${sub_data:2:2}
|
||||
sub_opt_len=$(printf "%d\n" "0x$sub_opt_len")
|
||||
sub_opt_len=$(( sub_opt_len * 2 ))
|
||||
|
||||
# get the value of sub option starting 4 means starting after length
|
||||
sub_opt_val=${sub_data:4:${sub_opt_len}}
|
||||
|
||||
# assign the value found in sub option
|
||||
case "${sub_opt_id}" in
|
||||
"25") URL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"26") PROV_CODE=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"27") RETRY_MIN_INTERVAL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"28") RETRY_INTERVAL_MUL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"29") ENDPOINT_ID=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
esac
|
||||
|
||||
# add 2 bytes for sub_opt id and sub_opt len field
|
||||
sub_opt_end=$(( sub_opt_len + 4 ))
|
||||
|
||||
# update the remaining sub option hex string length
|
||||
sub_data_len=$((sub_data_len - sub_opt_end))
|
||||
|
||||
# fetch next sub option hex string
|
||||
sub_data=${sub_data:${sub_opt_end}:${sub_data_len}}
|
||||
done
|
||||
|
||||
# move ahead data to next enterprise id
|
||||
data=${data:"${data_len}":"${rem_len}"}
|
||||
rem_len=$(( rem_len - data_len ))
|
||||
done
|
||||
}
|
||||
|
||||
get_netmode()
|
||||
{
|
||||
local mode
|
||||
|
||||
if command -v fw_printenv; then
|
||||
mode="$(fw_printenv -n netmode)"
|
||||
fi
|
||||
|
||||
if [ "$mode" != "extender" ]; then
|
||||
mode="full_access"
|
||||
fi
|
||||
|
||||
echo "$mode"
|
||||
}
|
||||
|
||||
config_load obuspa
|
||||
config_get_bool enable_obuspa global enabled 1
|
||||
config_get wan_intf global interface "wan"
|
||||
config_get_bool dhcp_discovery global dhcp_discovery 1
|
||||
|
||||
if [ "$enable_obuspa" = "0" ] || [ "$dhcp_discovery" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt125" ]; then
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
get_vivsoi "$opt125" "$len"
|
||||
fi
|
||||
|
||||
if [ -z "$URL" ] || [ -z "$ENDPOINT_ID" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
proto=""
|
||||
ip=""
|
||||
port=""
|
||||
topic=""
|
||||
is_fqdn=1
|
||||
|
||||
case $URL in
|
||||
ws://*) is_fqdn=0;;
|
||||
wss://*) is_fqdn=0;;
|
||||
mqtt://*) is_fqdn=0;;
|
||||
mqtts://*) is_fqdn=0;;
|
||||
*) is_fqdn=1
|
||||
esac;
|
||||
|
||||
if [ ${is_fqdn} -eq 1 ]; then
|
||||
# This is an FQDN, perform DNS query
|
||||
nslookup -type=a $URL > /tmp/fqdn_ip
|
||||
nslookup -type=ptr $URL > /tmp/fqdn_ptr
|
||||
return 0
|
||||
else
|
||||
proto=$(echo "${URL}" | awk -F: '{print $1}')
|
||||
dest=$(echo "${URL}" | awk -F/ '{print $3}')
|
||||
ip=$(echo "${dest}" | awk -F: '{print $1}')
|
||||
port=$(echo "${dest}" | awk -F: '{print $2}')
|
||||
topic=$(echo "${URL}" | sed 's/^.*:'"${port}"'/\1/g')
|
||||
fi
|
||||
|
||||
offered_proto=""
|
||||
if [ "${proto}" == "mqtt" ] || [ "${proto}" == "mqtts" ]; then
|
||||
offered_proto="MQTT"
|
||||
elif [ "${proto}" == "ws" ] || [ "${proto}" == "wss" ]; then
|
||||
offered_proto="WebSocket"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
|
||||
uci_change=0
|
||||
mtp_encrypt="0"
|
||||
## Handling of controller section
|
||||
ct_endpoint=$(uci -q get obuspa.dhcpcontroller.EndpointID)
|
||||
ct_proto=$(uci -q get obuspa.dhcpcontroller.Protocol)
|
||||
ct_topic=$(uci -q get obuspa.dhcpcontroller.Topic)
|
||||
ct_enable=$(uci -q get obuspa.dhcpcontroller.Enable)
|
||||
ct_prov=$(uci -q get obuspa.dhcpcontroller.ProvisioningCode)
|
||||
|
||||
if [ "${ct_endpoint}" != "${ENDPOINT_ID}" ] || [ "${ct_proto}" != "${offered_proto}" ] || [ "${ct_topic}" != "${topic}" ] || [ "${ct_enable}" != "1" ] || [ "${ct_prov}" != "${PROV_CODE}" ]; then
|
||||
uci -q del obuspa.dhcpcontroller
|
||||
sec=$(uci -q add obuspa controller)
|
||||
uci -q rename obuspa."${sec}"='dhcpcontroller'
|
||||
uci -q set obuspa.dhcpcontroller.EndpointID="${ENDPOINT_ID}"
|
||||
uci -q set obuspa.dhcpcontroller.ProvisioningCode="${PROV_CODE}"
|
||||
uci -q set obuspa.dhcpcontroller.Protocol="${offered_proto}"
|
||||
if [ "${offered_proto}" == "MQTT" ]; then
|
||||
uci -q set obuspa.dhcpcontroller.Topic="${topic}"
|
||||
uci -q set obuspa.dhcpcontroller.mqtt='dhcpmqtt'
|
||||
else
|
||||
uci -q set obuspa.dhcpcontroller.Path="${topic}"
|
||||
uci -q set obuspa.dhcpcontroller.Host="${ip}"
|
||||
uci -q set obuspa.dhcpcontroller.Port="${port}"
|
||||
if [ "${proto}" == "wss" ]; then
|
||||
uci -q set obuspa.dhcpcontroller.EnableEncryption='1'
|
||||
mtp_encrypt="1"
|
||||
else
|
||||
uci -q set obuspa.dhcpcontroller.EnableEncryption='0'
|
||||
mtp_encrypt="0"
|
||||
fi
|
||||
fi
|
||||
|
||||
uci -q set obuspa.dhcpcontroller.assigned_role_name="$(get_netmode)"
|
||||
uci -q set obuspa.dhcpcontroller.Enable='1'
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
if [ "${offered_proto}" == "WebSocket" ]; then
|
||||
ex_mqtt=$(uci -q get obuspa.dhcpmqtt)
|
||||
if [ -n "${ex_mqtt}" ]; then
|
||||
uci -q del obuspa.dhcpmqtt
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
## Handling of mtp section
|
||||
ct_proto=$(uci -q get obuspa.dhcpmtp.Protocol)
|
||||
ct_port=$(uci -q get obuspa.dhcpmtp.Port)
|
||||
ct_enable=$(uci -q get obuspa.dhcpmtp.Enable)
|
||||
ct_encrypt=$(uci -q get obuspa.dhcpmtp.EnableEncryption)
|
||||
|
||||
if [ "${ct_proto}" != "WebSocket" ] || [ "${ct_port}" != "${port}" ] || [ "${ct_enable}" != "1" ] || [ "${ct_encrypt}" != "${mtp_encrypt}" ]; then
|
||||
uci -q del obuspa.dhcpmtp
|
||||
sec=$(uci -q add obuspa mtp)
|
||||
uci -q rename obuspa."${sec}"='dhcpmtp'
|
||||
uci -q set obuspa.dhcpmtp.Protocol='WebSocket'
|
||||
uci -q set obuspa.dhcpmtp.Port="${port}"
|
||||
uci -q set obuspa.dhcpmtp.Enable='1'
|
||||
uci -q set obuspa.dhcpmtp.EnableEncryption="${mtp_encrypt}"
|
||||
uci_change=1
|
||||
fi
|
||||
else
|
||||
if [ "${proto}" == "mqtt" ]; then
|
||||
transport_proto="TCP/IP"
|
||||
else
|
||||
transport_proto="TLS"
|
||||
fi
|
||||
|
||||
## Handling of mqtt section
|
||||
ct_address=$(uci -q get obuspa.dhcpmqtt.BrokerAddress)
|
||||
ct_port=$(uci -q get obuspa.dhcpmqtt.BrokerPort)
|
||||
ct_proto=$(uci -q get obuspa.dhcpmqtt.TransportProtocol)
|
||||
ct_enable=$(uci -q get obuspa.dhcpmqtt.Enable)
|
||||
ct_ver=$(uci -q get obuspa.dhcpmqtt.ProtocolVersion)
|
||||
|
||||
if [ "${ct_address}" != "${ip}" ] || [ "${ct_port}" != "${port}" ] || [ "${ct_proto}" != "${transport_proto}" ] || [ "${ct_enable}" != "1" ] || [ "${ct_ver}" != "5.0" ]; then
|
||||
uci -q del obuspa.dhcpmqtt
|
||||
sec=$(uci -q add obuspa mqtt)
|
||||
uci -q rename obuspa."${sec}"='dhcpmqtt'
|
||||
uci -q set obuspa.dhcpmqtt.BrokerAddress="${ip}"
|
||||
uci -q set obuspa.dhcpmqtt.BrokerPort="${port}"
|
||||
uci -q set obuspa.dhcpmqtt.TransportProtocol="${transport_proto}"
|
||||
uci -q set obuspa.dhcpmqtt.Enable='1'
|
||||
uci -q set obuspa.dhcpmqtt.ProtocolVersion='5.0'
|
||||
uci_change=1
|
||||
fi
|
||||
|
||||
## Handling of mtp section
|
||||
ct_proto=$(uci -q get obuspa.dhcpmtp.Protocol)
|
||||
ct_topic=$(uci -q get obuspa.dhcpmtp.ResponseTopicConfigured)
|
||||
ct_enable=$(uci -q get obuspa.dhcpmtp.Enable)
|
||||
|
||||
config_load obuspa
|
||||
config_get AgentEndpointID localagent EndpointID ""
|
||||
if [ -z "${AgentEndpointID}" ]; then
|
||||
serial=$(get_serial_from_db)
|
||||
oui=$(get_oui_from_db)
|
||||
AgentEndpointID=$(echo "${oui}-${serial//+/%2B}")
|
||||
fi
|
||||
|
||||
topic_base=$(echo "${AgentEndpointID}" | sed -E 's/[^[:alnum:]]/_/g')
|
||||
agent_topic="/usp/${topic_base}/endpoint"
|
||||
|
||||
if [ "${ct_proto}" != "MQTT" ] || [ "${ct_topic}" != "${agent_topic}" ] || [ "${ct_enable}" != "1" ]; then
|
||||
uci -q del obuspa.dhcpmtp
|
||||
sec=$(uci -q add obuspa mtp)
|
||||
uci -q rename obuspa."${sec}"='dhcpmtp'
|
||||
uci -q set obuspa.dhcpmtp.Protocol='MQTT'
|
||||
uci -q set obuspa.dhcpmtp.ResponseTopicConfigured="${agent_topic}"
|
||||
uci -q set obuspa.dhcpmtp.Enable='1'
|
||||
uci -q set obuspa.dhcpmtp.mqtt='dhcpmqtt'
|
||||
uci_change=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${uci_change} -eq 1 ]; then
|
||||
ubus call uci commit '{"config":"obuspa"}'
|
||||
fi
|
||||
fi
|
||||
@@ -20,7 +20,7 @@
|
||||
void DM_PRIV_RequestInit(dm_req_t *req, dm_node_t *node, char *path, dm_instances_t *inst);
|
||||
--- a/src/core/msg_handler.c
|
||||
+++ b/src/core/msg_handler.c
|
||||
@@ -893,6 +893,20 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
@@ -902,6 +902,20 @@ char *MtpSendItemToString(mtp_send_item_
|
||||
|
||||
/*********************************************************************//**
|
||||
**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/src/core/data_model.c
|
||||
+++ b/src/core/data_model.c
|
||||
@@ -1242,7 +1242,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
@@ -1243,7 +1243,7 @@ int DATA_MODEL_NotifyInstanceAdded(char
|
||||
// Exit if instance already exists - nothing to do
|
||||
if (exists)
|
||||
{
|
||||
@@ -9,7 +9,7 @@
|
||||
return USP_ERR_CREATION_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1327,7 +1327,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
@@ -1328,7 +1328,7 @@ int DATA_MODEL_NotifyInstanceDeleted(cha
|
||||
// Exit if instance does not exist - nothing to do
|
||||
if (exists == false)
|
||||
{
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
diff --git a/src/core/data_model.c b/src/core/data_model.c
|
||||
index 2cf4b6c..b92cf59 100644
|
||||
--- a/src/core/data_model.c
|
||||
+++ b/src/core/data_model.c
|
||||
@@ -136,6 +136,7 @@ void DumpDataModelNodeMap(void);
|
||||
int GetVendorParam(dm_node_t *node, char *path, dm_instances_t *inst, char *buf, int len, dm_req_t *req);
|
||||
@@ -137,6 +137,7 @@ int GetVendorParam(dm_node_t *node, char
|
||||
int SetVendorParam(dm_node_t *node, char *path, dm_instances_t *inst, char *value, dm_req_t *req);
|
||||
double_link_t *FindLinkToFirstObject(double_linked_list_t *list);
|
||||
|
||||
+extern bool is_running_cli_local_command;
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** DATA_MODEL_Init
|
||||
@@ -223,7 +224,9 @@ int DATA_MODEL_Init(void)
|
||||
@@ -224,7 +225,9 @@ int DATA_MODEL_Init(void)
|
||||
}
|
||||
|
||||
// Set the default values of OUI, Serial Number and (LocalAgent) EndpointID, and cache EndpointID
|
||||
|
||||
12
obuspa/patches/0008-fix_cmake_warning.patch
Normal file
12
obuspa/patches/0008-fix_cmake_warning.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/src/protobuf-c/protobuf-c.c b/src/protobuf-c/protobuf-c.c
|
||||
index 3dc5473..0a6bde7 100644
|
||||
--- a/src/protobuf-c/protobuf-c.c
|
||||
+++ b/src/protobuf-c/protobuf-c.c
|
||||
@@ -1926,6 +1926,7 @@ repeated_field_pack_to_buffer(const ProtobufCFieldDescriptor *field,
|
||||
buffer->append(buffer, rv, scratch);
|
||||
tmp = pack_buffer_packed_payload(field, count, array, buffer);
|
||||
assert(tmp == payload_len);
|
||||
+ (void)tmp; // Keep cmake production build happy
|
||||
return rv + payload_len;
|
||||
} else {
|
||||
size_t siz;
|
||||
@@ -0,0 +1,121 @@
|
||||
diff --git a/src/core/device_bulkdata.c b/src/core/device_bulkdata.c
|
||||
index 8e44f59..a77bd71 100755
|
||||
--- a/src/core/device_bulkdata.c
|
||||
+++ b/src/core/device_bulkdata.c
|
||||
@@ -2995,6 +2995,33 @@ char *bulkdata_generate_json_report(bulkdata_profile_t *bp, char *report_timesta
|
||||
return result;
|
||||
}
|
||||
|
||||
+/*********************************************************************//**
|
||||
+**
|
||||
+** safe_asprintf
|
||||
+**
|
||||
+** Wrapper around asprintf that calls terminate in case of error
|
||||
+**
|
||||
+** \param strp -- pointer to the output string
|
||||
+** \param fmt -- printing format
|
||||
+**
|
||||
+** \return None
|
||||
+**
|
||||
+**************************************************************************/
|
||||
+static void safe_asprintf(char **strp, const char *fmt, ...)
|
||||
+{
|
||||
+ int ret;
|
||||
+ va_list argp;
|
||||
+
|
||||
+ va_start(argp, fmt);
|
||||
+ ret = vasprintf(strp, fmt, argp);
|
||||
+ va_end(argp);
|
||||
+
|
||||
+ if (ret == -1) {
|
||||
+ USP_ERR_Terminate("%s (%d): asprintf(%s) failed",
|
||||
+ __FUNCTION__, __LINE__, fmt);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/*********************************************************************//**
|
||||
**
|
||||
** append_string_to_target
|
||||
@@ -3024,7 +3051,7 @@ void append_string_to_target(char *str, char **output)
|
||||
}
|
||||
|
||||
assert(tmp != NULL);
|
||||
- asprintf(output, "%s%s", tmp, str);
|
||||
+ safe_asprintf(output, "%s%s", tmp, str);
|
||||
free(tmp);
|
||||
}
|
||||
|
||||
@@ -3072,9 +3099,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
|
||||
if (strcasecmp(csv_format, "ParameterPerRow") == 0) {
|
||||
if (strcmp(row_timestamp, "None") == 0)
|
||||
- asprintf(&str, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
|
||||
+ safe_asprintf(&str, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
|
||||
else
|
||||
- asprintf(&str, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
|
||||
+ safe_asprintf(&str, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
|
||||
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &output);
|
||||
@@ -3091,14 +3118,14 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
// Add Collection time to each csv report element (only if specified and not 'None')
|
||||
if (strcmp(row_timestamp, "Unix-Epoch")==0)
|
||||
{
|
||||
- asprintf(×tamp, "%lld", (long long int)report->collection_time);
|
||||
+ safe_asprintf(×tamp, "%lld", (long long int)report->collection_time);
|
||||
}
|
||||
else if (strcmp(row_timestamp, "ISO-8601")==0)
|
||||
{
|
||||
char *result = iso8601_from_unix_time(report->collection_time, buf, sizeof(buf));
|
||||
if (result != NULL)
|
||||
{
|
||||
- asprintf(×tamp, "%s", buf);
|
||||
+ safe_asprintf(×tamp, "%s", buf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3151,9 +3178,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
if (type) {
|
||||
if (strcasecmp(csv_format, "ParameterPerRow") == 0) {
|
||||
if (timestamp == NULL)
|
||||
- asprintf(&str, "%s%c%s%c%s%c", param_path, separator, param_value, separator, type, rowseparator);
|
||||
+ safe_asprintf(&str, "%s%c%s%c%s%c", param_path, separator, param_value, separator, type, rowseparator);
|
||||
else
|
||||
- asprintf(&str, "%s%c%s%c%s%c%s%c", timestamp, separator, param_path, separator, param_value, separator, type, rowseparator);
|
||||
+ safe_asprintf(&str, "%s%c%s%c%s%c%s%c", timestamp, separator, param_path, separator, param_value, separator, type, rowseparator);
|
||||
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &output);
|
||||
@@ -3161,9 +3188,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
str = NULL;
|
||||
} else {
|
||||
if (str1 == NULL || strlen(str1) == 0)
|
||||
- asprintf(&str, "%s", param_path);
|
||||
+ safe_asprintf(&str, "%s", param_path);
|
||||
else
|
||||
- asprintf(&str, "%c%s", separator, param_path);
|
||||
+ safe_asprintf(&str, "%c%s", separator, param_path);
|
||||
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &str1);
|
||||
@@ -3171,9 +3198,9 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
str = NULL;
|
||||
|
||||
if (str2 == NULL || strlen(str2) == 0)
|
||||
- asprintf(&str, "%s", param_value);
|
||||
+ safe_asprintf(&str, "%s", param_value);
|
||||
else
|
||||
- asprintf(&str, "%c%s", separator, param_value);
|
||||
+ safe_asprintf(&str, "%c%s", separator, param_value);
|
||||
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &str2);
|
||||
@@ -3190,7 +3217,7 @@ char *bulkdata_generate_csv_report(bulkdata_profile_t *bp, char *field_separator
|
||||
}
|
||||
|
||||
if (strcasecmp(csv_format, "ParameterPerColumn") == 0) {
|
||||
- asprintf(&str, "%c", rowseparator);
|
||||
+ safe_asprintf(&str, "%c", rowseparator);
|
||||
assert(str != NULL);
|
||||
append_string_to_target(str, &str1);
|
||||
append_string_to_target(str, &str2);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user