mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-25 03:24:14 +08:00
Compare commits
1065 Commits
pc_improv
...
reset_reas
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b087faf6b9 | ||
|
|
2c9a35eb8c | ||
|
|
0779d9f121 | ||
|
|
afa5f38654 | ||
|
|
1eeb06fd36 | ||
|
|
d64bf6ceea | ||
|
|
c28f5afe45 | ||
|
|
1ed383bee7 | ||
|
|
8236cd4093 | ||
|
|
46a09d8f8d | ||
|
|
61c7afe582 | ||
|
|
258449fc11 | ||
|
|
f5db3d3d45 | ||
|
|
a0c6545534 | ||
|
|
96d18ad234 | ||
|
|
18c9bef5f8 | ||
|
|
bd3b904c15 | ||
|
|
350ced4c32 | ||
|
|
b4e735e731 | ||
|
|
e96e2328a7 | ||
|
|
c8c6b5ab4b | ||
|
|
9bd7e17835 | ||
|
|
fa703437e1 | ||
|
|
cfc335aed8 | ||
|
|
1139c21f34 | ||
|
|
6af6728603 | ||
|
|
5a208be259 | ||
|
|
8764f317d0 | ||
|
|
c2e9144819 | ||
|
|
fc9f946be7 | ||
|
|
2aed4dc8f5 | ||
|
|
ce1b42e095 | ||
|
|
8fee332f4c | ||
|
|
ca78501dba | ||
|
|
9280ddd093 | ||
|
|
15563ca117 | ||
|
|
0718730d6b | ||
|
|
f9ad16934c | ||
|
|
966dbd6038 | ||
|
|
b1809e6993 | ||
|
|
ad8b8b2a55 | ||
|
|
6bf1cae138 | ||
|
|
92c3d6d721 | ||
|
|
853a0c840c | ||
|
|
49bcef77aa | ||
|
|
fa8e9fc3ef | ||
|
|
e3eec0d7ab | ||
|
|
74339e6216 | ||
|
|
8197f9ad93 | ||
|
|
1f96c3d295 | ||
|
|
d1d57ca528 | ||
|
|
10428fbda0 | ||
|
|
8e5d4c53ff | ||
|
|
1fb22dfe8c | ||
|
|
99fe2c2b2a | ||
|
|
c153911acf | ||
|
|
31cd59b33c | ||
|
|
21e6193e0a | ||
|
|
3af94e2180 | ||
|
|
df91d06078 | ||
|
|
ea090f50e1 | ||
|
|
7df4486a43 | ||
|
|
6818818127 | ||
|
|
63c0fb7d3b | ||
|
|
2a38e7cd23 | ||
|
|
8f6ae03e7e | ||
|
|
fecbbe90af | ||
|
|
fe1cdbd9bc | ||
|
|
67bf2c0227 | ||
|
|
307059d44b | ||
|
|
a8aa693e18 | ||
|
|
53fc48997a | ||
|
|
9e180eb2bf | ||
|
|
b98ccac057 | ||
|
|
fb236949fc | ||
|
|
5631c28df4 | ||
|
|
8170684100 | ||
|
|
332a35102d | ||
|
|
ba5e332b0d | ||
|
|
09560fb532 | ||
|
|
c4cf8cb24b | ||
|
|
56c94f1ec6 | ||
|
|
279fe9d291 | ||
|
|
924675d271 | ||
|
|
64cf5c7c9f | ||
|
|
9fa9b1adbf | ||
|
|
9944917399 | ||
|
|
2a25fc0ec7 | ||
|
|
ebd7e68714 | ||
|
|
000762c0cb | ||
|
|
c4328f411f | ||
|
|
0428934a69 | ||
|
|
580d24e04a | ||
|
|
95778a4262 | ||
|
|
02ee448479 | ||
|
|
0dcc9743a2 | ||
|
|
1a1a1e1255 | ||
|
|
9710e46c51 | ||
|
|
19e69f7b61 | ||
|
|
e319c85064 | ||
|
|
29638a28f7 | ||
|
|
ccb337ecbd | ||
|
|
5474b1c6d0 | ||
|
|
8df0ad8e46 | ||
|
|
6e358a6bd1 | ||
|
|
20a28db536 | ||
|
|
c6ee9114bc | ||
|
|
89fb4a0857 | ||
|
|
8d86188ff1 | ||
|
|
18d6afea15 | ||
|
|
0cb9aac1f1 | ||
|
|
dfe2af4643 | ||
|
|
2fe133227d | ||
|
|
15f17da6e5 | ||
|
|
2e56ef292c | ||
|
|
65e4bebc0f | ||
|
|
ceb577a6ab | ||
|
|
2d45a45126 | ||
|
|
45294a9f0c | ||
|
|
eb5c837353 | ||
|
|
495d95dcc8 | ||
|
|
32e5dc46b3 | ||
|
|
6980c1e2e5 | ||
|
|
da727b4dc1 | ||
|
|
d8aaacc4c9 | ||
|
|
e036702c16 | ||
|
|
604a105bc9 | ||
|
|
04bdaa950f | ||
|
|
54fdaf2b43 | ||
|
|
644e98e595 | ||
|
|
9fc594d74f | ||
|
|
ac7cfb581e | ||
|
|
ba75b33fc5 | ||
|
|
912978164b | ||
|
|
7a50c328e1 | ||
|
|
f8c9088db7 | ||
|
|
fd34c3e9f3 | ||
|
|
70d7d7a64d | ||
|
|
112f4cb99d | ||
|
|
2380a6de86 | ||
|
|
b0c168322e | ||
|
|
22d8a0992c | ||
|
|
3c075c293c | ||
|
|
17ae16e5d2 | ||
|
|
46dc9e86d8 | ||
|
|
0b3420240d | ||
|
|
83ca06b626 | ||
|
|
2dafb9ec2c | ||
|
|
c2c54e5ca0 | ||
|
|
9314e4bbf3 | ||
|
|
5840332288 | ||
|
|
bb4fffb680 | ||
|
|
4b2b09080d | ||
|
|
ba651b5457 | ||
|
|
1509db0630 | ||
|
|
85e97ca660 | ||
|
|
f9640bc237 | ||
|
|
72b16e33ab | ||
|
|
4e81706967 | ||
|
|
483fc2e6cb | ||
|
|
c2594f2d37 | ||
|
|
fb2eac485b | ||
|
|
c867ab610e | ||
|
|
ef8d667b83 | ||
|
|
3934674c81 | ||
|
|
4f53f35dc1 | ||
|
|
4fe815299a | ||
|
|
9394517727 | ||
|
|
742b357026 | ||
|
|
d383896918 | ||
|
|
646f5d6e1c | ||
|
|
d897632279 | ||
|
|
47e93f13c1 | ||
|
|
70bb662514 | ||
|
|
6f9ec4bf7d | ||
|
|
fc88c554c1 | ||
|
|
5ba6ade386 | ||
|
|
0d1b585c5d | ||
|
|
bf43efa993 | ||
|
|
0e3545cacb | ||
|
|
fefe14d540 | ||
|
|
b6df14f78e | ||
|
|
24cfbe2e48 | ||
|
|
eee28bb66c | ||
|
|
5fcee38906 | ||
|
|
72a9da5bd3 | ||
|
|
2cf19c9469 | ||
|
|
bd0fed8409 | ||
|
|
b23e510dd3 | ||
|
|
bf06544066 | ||
|
|
85762b4641 | ||
|
|
60dafc2028 | ||
|
|
e6054d9f8f | ||
|
|
8b106e6b58 | ||
|
|
41edb9f1a5 | ||
|
|
f6026298e8 | ||
|
|
c3ab091cdc | ||
|
|
dcfca56db8 | ||
|
|
991657fc99 | ||
|
|
90f13664e9 | ||
|
|
e843c83d0c | ||
|
|
7d5c13a9f5 | ||
|
|
417a5c5428 | ||
|
|
0074af0d3c | ||
|
|
fae1f7d816 | ||
|
|
f500a8c749 | ||
|
|
af9e4f99c6 | ||
|
|
e451e32f77 | ||
|
|
26cbba9724 | ||
|
|
5be4e38c68 | ||
|
|
549534f8aa | ||
|
|
f4a623e637 | ||
|
|
833a9a002a | ||
|
|
ff4e68f70a | ||
|
|
b471113bfa | ||
|
|
2b997a4386 | ||
|
|
06a280707a | ||
|
|
c54fd95889 | ||
|
|
86fb3db75b | ||
|
|
70cda05eda | ||
|
|
502aab4f3c | ||
|
|
34b63e84aa | ||
|
|
5f2aa06285 | ||
|
|
5232cc61ac | ||
|
|
98d8e9866c | ||
|
|
0e59fd0d47 | ||
|
|
a7e8e65d88 | ||
|
|
1fd74364fa | ||
|
|
20c49302c1 | ||
|
|
c2e5ade3bb | ||
|
|
b933622547 | ||
|
|
7b12c29425 | ||
|
|
082452bfb5 | ||
|
|
a6b8987dac | ||
|
|
d1307bfd76 | ||
|
|
edd78f675e | ||
|
|
3a1772e1b8 | ||
|
|
b2dd40cae3 | ||
|
|
24f22d0ecc | ||
|
|
a86f478014 | ||
|
|
9a59ccc498 | ||
|
|
15e4dd732a | ||
|
|
784a281fa6 | ||
|
|
8f82b31658 | ||
|
|
3745b4e913 | ||
|
|
90d646319b | ||
|
|
13064e27b3 | ||
|
|
539bf50985 | ||
|
|
1b7b377bd1 | ||
|
|
1c9ba1c83c | ||
|
|
e307ee7aa8 | ||
|
|
6bcf7987d7 | ||
|
|
ff146bf093 | ||
|
|
0f23bee1da | ||
|
|
2070630b07 | ||
|
|
f1702b3e70 | ||
|
|
9634b0678b | ||
|
|
d395030be7 | ||
|
|
4cb0504eb3 | ||
|
|
6df57301f9 | ||
|
|
f527b8a25a | ||
|
|
fbba67542e | ||
|
|
824d6d3abe | ||
|
|
1a9a339cc6 | ||
|
|
0533f114d1 | ||
|
|
dc579e3c60 | ||
|
|
d232e76905 | ||
|
|
2fffb45748 | ||
|
|
b15f1b5026 | ||
|
|
43a0dfc863 | ||
|
|
307381c9af | ||
|
|
1a80f2df47 | ||
|
|
9b79eb42db | ||
|
|
602926b076 | ||
|
|
74cfe57095 | ||
|
|
01845eded6 | ||
|
|
11dce5812c | ||
|
|
7af15ec9a9 | ||
|
|
8359755dc8 | ||
|
|
1a735b7730 | ||
|
|
6a008d3419 | ||
|
|
6142da5d43 | ||
|
|
f5715d478a | ||
|
|
bce9364d14 | ||
|
|
425949900b | ||
|
|
938681c270 | ||
|
|
30f7a15450 | ||
|
|
4d4006309b | ||
|
|
41f1e0d52a | ||
|
|
db207a87fc | ||
|
|
89ab349565 | ||
|
|
8ffe108f95 | ||
|
|
074d9268b0 | ||
|
|
fc7b21aa73 | ||
|
|
6f83732b0e | ||
|
|
97141307ed | ||
|
|
ddec5540bc | ||
|
|
09b97ae69d | ||
|
|
977c1b5767 | ||
|
|
467b3897fb | ||
|
|
a688381a3c | ||
|
|
9bad79439b | ||
|
|
608b9637b0 | ||
|
|
fcd59e95f0 | ||
|
|
5820d98e2c | ||
|
|
9c6b9d6260 | ||
|
|
9fad74246e | ||
|
|
aab3f74290 | ||
|
|
0eb2ce3728 | ||
|
|
f9aabb68d5 | ||
|
|
9917da1ca3 | ||
|
|
acf7344c13 | ||
|
|
693ff8bd19 | ||
|
|
c1286064bb | ||
|
|
2503b1fc72 | ||
|
|
d468c13b3f | ||
|
|
064611a15d | ||
|
|
5c427dd08a | ||
|
|
1703e6d328 | ||
|
|
35c27393ce | ||
|
|
fca93627ba | ||
|
|
417a127dd9 | ||
|
|
afde0b98ad | ||
|
|
a0069cc9be | ||
|
|
368255f50b | ||
|
|
ad1233ff32 | ||
|
|
697ddc356e | ||
|
|
b82eb8325e | ||
|
|
c150053a83 | ||
|
|
7ee83ff47f | ||
|
|
98905256f8 | ||
|
|
a8a511c4ff | ||
|
|
d0d90946b3 | ||
|
|
c2ad0fa44d | ||
|
|
be7fa433c5 | ||
|
|
01e9d7c0bc | ||
|
|
2f398a2671 | ||
|
|
8254547866 | ||
|
|
e8ceb167b5 | ||
|
|
434c794671 | ||
|
|
9628be4812 | ||
|
|
bd90dc7ec2 | ||
|
|
e0736df927 | ||
|
|
afa58be1f8 | ||
|
|
3cbcac96ba | ||
|
|
a92f32eba4 | ||
|
|
842968da4f | ||
|
|
60ef90c1b6 | ||
|
|
56cec9cb7f | ||
|
|
4042d46009 | ||
|
|
d6dfc5bd08 | ||
|
|
451036aebc | ||
|
|
8d01ace7a6 | ||
|
|
d7e22b922b | ||
|
|
a1d535058d | ||
|
|
1bb307ef4f | ||
|
|
404a642e41 | ||
|
|
ae3f1819e6 | ||
|
|
fbd8f64c40 | ||
|
|
369fc0d4bb | ||
|
|
b44afe067f | ||
|
|
d69245f570 | ||
|
|
c3564ff528 | ||
|
|
fafe1d9447 | ||
|
|
e35bf1d509 | ||
|
|
8e11e5dbc8 | ||
|
|
2698ee9358 | ||
|
|
92be6f1129 | ||
|
|
4dfc196968 | ||
|
|
1c17fed77d | ||
|
|
27b9fb9350 | ||
|
|
b917a2177e | ||
|
|
2372de4864 | ||
|
|
c5d7ddd851 | ||
|
|
a688b2091c | ||
|
|
bfc7e6a78a | ||
|
|
41495cf6e5 | ||
|
|
d3d1b444de | ||
|
|
9681b6222c | ||
|
|
d20fb01a1b | ||
|
|
85e49b3df6 | ||
|
|
511e0af668 | ||
|
|
1151478d13 | ||
|
|
7e87028731 | ||
|
|
cb18ecc420 | ||
|
|
e581c05d27 | ||
|
|
3ae6c52e7d | ||
|
|
498a06916b | ||
|
|
332057fdd4 | ||
|
|
58aff3cb45 | ||
|
|
5678b6dcaa | ||
|
|
a597c514f7 | ||
|
|
3c1dcf90eb | ||
|
|
62dc6c28a3 | ||
|
|
2703ea0421 | ||
|
|
b4a0572b7c | ||
|
|
428055c911 | ||
|
|
97723f9e7a | ||
|
|
2dceb5b44b | ||
|
|
8c9689caf7 | ||
|
|
af5bb94c8c | ||
|
|
9db65fcfba | ||
|
|
2b43c27e53 | ||
|
|
c16f4d3f82 | ||
|
|
99a4f3c036 | ||
|
|
71217d4f68 | ||
|
|
ad012d7549 | ||
|
|
6cca837500 | ||
|
|
6bec3c159c | ||
|
|
fd921bb196 | ||
|
|
60d2f92da3 | ||
|
|
8f83250890 | ||
|
|
652ec8a4af | ||
|
|
937b824055 | ||
|
|
889723079b | ||
|
|
7a457ae32a | ||
|
|
7e5e38e657 | ||
|
|
44edac6572 | ||
|
|
fea3e1e4ef | ||
|
|
eae31a6dd4 | ||
|
|
3a1a65d5df | ||
|
|
70a22d0299 | ||
|
|
2a19a1a92a | ||
|
|
5b865c9dbc | ||
|
|
bc041faf04 | ||
|
|
de08bc79a1 | ||
|
|
9ab8dbdb3b | ||
|
|
f3cb8ad566 | ||
|
|
95e9630c4b | ||
|
|
2c6a9e76c8 | ||
|
|
653b74aacf | ||
|
|
c6437fbf53 | ||
|
|
3a4ad69af9 | ||
|
|
0379e816c5 | ||
|
|
b8f99bbe64 | ||
|
|
42df10c708 | ||
|
|
7369ee4c20 | ||
|
|
dc3aa2ec9d | ||
|
|
312d28bec4 | ||
|
|
45a754f567 | ||
|
|
491f2ca07d | ||
|
|
2d5f9229f2 | ||
|
|
16536b9bc3 | ||
|
|
f552b68f10 | ||
|
|
7c444911f7 | ||
|
|
7a12fb28b1 | ||
|
|
a430d76517 | ||
|
|
b48c7e14dc | ||
|
|
269d72c30a | ||
|
|
f19082aa1e | ||
|
|
43f0296ea2 | ||
|
|
6418f9fa8f | ||
|
|
58ecaf9c15 | ||
|
|
0f8887f676 | ||
|
|
a1193cc6b8 | ||
|
|
392a41b38a | ||
|
|
c3128d3a14 | ||
|
|
4d88e123a9 | ||
|
|
fb050cae2e | ||
|
|
90af4f350b | ||
|
|
605f0faacc | ||
|
|
065772401b | ||
|
|
886000a830 | ||
|
|
0b5a84e33a | ||
|
|
a2763cd075 | ||
|
|
4a8b27ed95 | ||
|
|
6eef7e4b21 | ||
|
|
a0bde81de4 | ||
|
|
5e04f9312b | ||
|
|
a1e7f80ae0 | ||
|
|
ed5169b94c | ||
|
|
c64701e6b2 | ||
|
|
db6672c9ee | ||
|
|
05c4d0d3d1 | ||
|
|
6535fe465c | ||
|
|
2703db3f2e | ||
|
|
bb603cb492 | ||
|
|
f8d7788d6f | ||
|
|
97df4367eb | ||
|
|
21fbf0253c | ||
|
|
ced2b4187f | ||
|
|
bfdd27f72a | ||
|
|
6f1953e4a4 | ||
|
|
fd816f8ee1 | ||
|
|
cbdc083db5 | ||
|
|
eb1897a730 | ||
|
|
546450566e | ||
|
|
5fb51c6fd9 | ||
|
|
5d84d0ae29 | ||
|
|
340709b527 | ||
|
|
38bef28d00 | ||
|
|
ba53aeda7d | ||
|
|
bd63c5a090 | ||
|
|
89c1fbb38a | ||
|
|
d6ff1d851b | ||
|
|
107b1576e8 | ||
|
|
47694dc23e | ||
|
|
002836769c | ||
|
|
cafb9f09ba | ||
|
|
a440adbef9 | ||
|
|
2ba04321b3 | ||
|
|
9126f2ef7d | ||
|
|
ed01ddf670 | ||
|
|
7e360f7b30 | ||
|
|
e15dcd3b25 | ||
|
|
9ee00a3c82 | ||
|
|
ba94d88f0d | ||
|
|
041e51edf3 | ||
|
|
6ca5af0790 | ||
|
|
6d32d6e8b3 | ||
|
|
2b4f9029f8 | ||
|
|
8c3bf8763e | ||
|
|
1c6243113c | ||
|
|
eedf8d2761 | ||
|
|
bf8b4de5da | ||
|
|
fd208e0e5f | ||
|
|
5b090176a1 | ||
|
|
93b1952f50 | ||
|
|
ddcfeeb339 | ||
|
|
8cea3573f7 | ||
|
|
8ac0f69992 | ||
|
|
65dea29e5f | ||
|
|
2cecb4f75a | ||
|
|
a47d302ec7 | ||
|
|
a9b3a392dd | ||
|
|
397611aff5 | ||
|
|
21c9fafc4d | ||
|
|
41efd7d712 | ||
|
|
f1e37ac0d8 | ||
|
|
ab6d3935d1 | ||
|
|
db529f651e | ||
|
|
975bf57de0 | ||
|
|
6fb3a1b91d | ||
|
|
57ae4eb344 | ||
|
|
dc79aa56f9 | ||
|
|
8334b65ad4 | ||
|
|
e9caa2e7cd | ||
|
|
49a31dbd49 | ||
|
|
31f223f7a0 | ||
|
|
8e33d24256 | ||
|
|
e6df8f9ad0 | ||
|
|
2c3e9ce606 | ||
|
|
616e15b9c4 | ||
|
|
93d2d09dcc | ||
|
|
ece7e8f22c | ||
|
|
879b473d20 | ||
|
|
ac9da0ec6f | ||
|
|
7c5046d9d8 | ||
|
|
69ccc34b2c | ||
|
|
87a6852c1a | ||
|
|
b0d1ada967 | ||
|
|
09cccc39cc | ||
|
|
7227cbd8da | ||
|
|
c57b0322b0 | ||
|
|
db626422dc | ||
|
|
26ffa55453 | ||
|
|
adc2b26a78 | ||
|
|
51e3ad0404 | ||
|
|
d9448a0de4 | ||
|
|
84eff7c8e0 | ||
|
|
53d940586e | ||
|
|
712435786a | ||
|
|
e57bbc0306 | ||
|
|
cc4aa5a415 | ||
|
|
7e502d79c8 | ||
|
|
cbbc3b3725 | ||
|
|
dcfe80ad8e | ||
|
|
c8bbe8725a | ||
|
|
71828eb20b | ||
|
|
90fd7f326d | ||
|
|
1263451924 | ||
|
|
c74662e1dd | ||
|
|
34482e3c86 | ||
|
|
96be0f9fab | ||
|
|
971d1ca37e | ||
|
|
99821b5010 | ||
|
|
c68b1c01eb | ||
|
|
a053e7752f | ||
|
|
558bd40b9f | ||
|
|
432969f0bf | ||
|
|
a7dfecba54 | ||
|
|
0ba1417643 | ||
|
|
29d6ad2fbd | ||
|
|
f7ef772ebf | ||
|
|
d0c9d595c8 | ||
|
|
912d98f496 | ||
|
|
8fb1b55e57 | ||
|
|
c5e79244c7 | ||
|
|
499f77d498 | ||
|
|
480c954677 | ||
|
|
9a5564bca4 | ||
|
|
67ee062946 | ||
|
|
7ecdc3ccb4 | ||
|
|
36490a7cda | ||
|
|
1d31c5f795 | ||
|
|
9a934269ae | ||
|
|
82e8c63c88 | ||
|
|
4fe71d66d3 | ||
|
|
74eac091ff | ||
|
|
94cf651a6c | ||
|
|
08f909388c | ||
|
|
148d25caf0 | ||
|
|
8d8cc94cdf | ||
|
|
0d6c7b2f70 | ||
|
|
0623e7017f | ||
|
|
013f820b12 | ||
|
|
9fd4584cdb | ||
|
|
3b3035441e | ||
|
|
38f36f3bdf | ||
|
|
b27646211b | ||
|
|
70b5c78d22 | ||
|
|
2356ed6075 | ||
|
|
39d484817e | ||
|
|
a73c089c2a | ||
|
|
22d9f90528 | ||
|
|
ac93499202 | ||
|
|
4dfc3455fb | ||
|
|
5bc00d53fd | ||
|
|
6ec25f158c | ||
|
|
9817ca11b5 | ||
|
|
ca49dfac97 | ||
|
|
44238e2033 | ||
|
|
e1d4bddbcf | ||
|
|
c6a739ddc0 | ||
|
|
38f657fa84 | ||
|
|
f5488143cd | ||
|
|
cebbf0f860 | ||
|
|
dcac2bd261 | ||
|
|
82c6cca440 | ||
|
|
2a952644c5 | ||
|
|
fac25dc016 | ||
|
|
623e1dc34e | ||
|
|
ed30787ca4 | ||
|
|
d68e0847c4 | ||
|
|
08cb598de4 | ||
|
|
2763ba7656 | ||
|
|
2591116be3 | ||
|
|
06876807c1 | ||
|
|
65344ebdc5 | ||
|
|
7dc743630c | ||
|
|
a8d7adbd1f | ||
|
|
ba215d1d6f | ||
|
|
fdfa1526b8 | ||
|
|
a93bde6fb5 | ||
|
|
4135fbe369 | ||
|
|
e4e63ba991 | ||
|
|
832947703c | ||
|
|
14e5601aed | ||
|
|
d3b2d4d9bf | ||
|
|
8741d7d82e | ||
|
|
910538aad7 | ||
|
|
5f36441b11 | ||
|
|
075728ce3e | ||
|
|
21687b6dc9 | ||
|
|
b5c2667d68 | ||
|
|
589c856cb7 | ||
|
|
e819a32cd7 | ||
|
|
bc8c70f7d0 | ||
|
|
fb17c3f51b | ||
|
|
0dfd361033 | ||
|
|
6d31feaa00 | ||
|
|
9df2d4b15e | ||
|
|
b91ae7f7f0 | ||
|
|
6df1768244 | ||
|
|
0a7245d2f9 | ||
|
|
6166ba0041 | ||
|
|
02577401c7 | ||
|
|
eccfd8970a | ||
|
|
7097827eb8 | ||
|
|
29e9ba389a | ||
|
|
4c6f70342a | ||
|
|
4708da4734 | ||
|
|
55aba515ff | ||
|
|
b1c9ce0d25 | ||
|
|
d3ae8b5020 | ||
|
|
ca962744b8 | ||
|
|
31c7500042 | ||
|
|
e71ee20840 | ||
|
|
38763bfc0d | ||
|
|
a43e3530c9 | ||
|
|
86ede4ab6b | ||
|
|
d234e7adcc | ||
|
|
e7e5ede6b9 | ||
|
|
476aee97a6 | ||
|
|
784c6553d8 | ||
|
|
e2883f0f45 | ||
|
|
30d01926a8 | ||
|
|
f6510849d6 | ||
|
|
d49e72be07 | ||
|
|
35e9ed9b1b | ||
|
|
e66516242a | ||
|
|
4affd50d2c | ||
|
|
06dec89452 | ||
|
|
130dbeacd5 | ||
|
|
d576d81b1f | ||
|
|
ee6edfa5a9 | ||
|
|
2f8c5e3f53 | ||
|
|
5c0010edf8 | ||
|
|
001eb7e0a3 | ||
|
|
a2209f555b | ||
|
|
8c09e8658e | ||
|
|
1d85f324a4 | ||
|
|
65926415ad | ||
|
|
50e865df53 | ||
|
|
cf352e9990 | ||
|
|
ecec95ca57 | ||
|
|
9a051abbf1 | ||
|
|
d3b5d8d598 | ||
|
|
3c4bbfb6d6 | ||
|
|
0122493c01 | ||
|
|
6098c3ab56 | ||
|
|
252c98c4ef | ||
|
|
5ea17980c8 | ||
|
|
3ba06fa10f | ||
|
|
013086f558 | ||
|
|
3a8f8d604f | ||
|
|
8612f5d4f6 | ||
|
|
6aef37d406 | ||
|
|
753dc05320 | ||
|
|
74878254b7 | ||
|
|
4f2697217a | ||
|
|
e36a9bc381 | ||
|
|
a52d654c4f | ||
|
|
6cf5641ea7 | ||
|
|
bce378a665 | ||
|
|
9952f6e580 | ||
|
|
7d0b38b9a7 | ||
|
|
3a503ea955 | ||
|
|
13cac21c60 | ||
|
|
f251701534 | ||
|
|
5b882870c9 | ||
|
|
25f3acf2fd | ||
|
|
c1fe6b05a6 | ||
|
|
4ee9169771 | ||
|
|
7172201515 | ||
|
|
c366451def | ||
|
|
5874a005c6 | ||
|
|
ffab63b86f | ||
|
|
929dd55d21 | ||
|
|
3636e217a6 | ||
|
|
b99d4413dc | ||
|
|
f2f6f6b787 | ||
|
|
f2ea1049e0 | ||
|
|
ba837ff98a | ||
|
|
324244d26b | ||
|
|
0cded2b974 | ||
|
|
27f0f7454f | ||
|
|
3ff559907b | ||
|
|
d73f8975cf | ||
|
|
3ddf258a74 | ||
|
|
cd2c817223 | ||
|
|
370c5938aa | ||
|
|
ddd88a894c | ||
|
|
459f2571ec | ||
|
|
c555b48d16 | ||
|
|
6a0f353c93 | ||
|
|
21e742d9f7 | ||
|
|
f4654e78c5 | ||
|
|
72c3e3c8ce | ||
|
|
1adf7b669f | ||
|
|
39ec8635c3 | ||
|
|
5a3fbb7902 | ||
|
|
5ecc3945f9 | ||
|
|
8a52715ad1 | ||
|
|
8333a499d0 | ||
|
|
941a46dae6 | ||
|
|
86d7bf8c67 | ||
|
|
4ef5d86feb | ||
|
|
c97637fd5f | ||
|
|
033613f999 | ||
|
|
b18f6dc39c | ||
|
|
5f5b171d5a | ||
|
|
469e9d1196 | ||
|
|
53b824d2e0 | ||
|
|
4df9b5ab94 | ||
|
|
130cf8fd53 | ||
|
|
bfd327ca02 | ||
|
|
bcea816742 | ||
|
|
ee6a27dc76 | ||
|
|
78eb76e913 | ||
|
|
21c3354b31 | ||
|
|
dcfa48d1f7 | ||
|
|
56d352fc83 | ||
|
|
56093ef532 | ||
|
|
60f1d0edbf | ||
|
|
c2021e765a | ||
|
|
83c31acbc7 | ||
|
|
9380411fa6 | ||
|
|
2a47619b32 | ||
|
|
f2c665a0cf | ||
|
|
1dca89c130 | ||
|
|
63d3ca365b | ||
|
|
fa4f08aa29 | ||
|
|
858dd78ff7 | ||
|
|
eb0e19355d | ||
|
|
4015982a87 | ||
|
|
0b6e35e36b | ||
|
|
cca03dc995 | ||
|
|
3d69811bf4 | ||
|
|
5a7e44cd04 | ||
|
|
b883f2b310 | ||
|
|
97a845fda2 | ||
|
|
21cdf07e54 | ||
|
|
13094c3a1b | ||
|
|
d3cb6a70da | ||
|
|
19570e553d | ||
|
|
50e2add3ab | ||
|
|
e33340ea8d | ||
|
|
6b882610c2 | ||
|
|
383dedb443 | ||
|
|
a8a2066675 | ||
|
|
73dfc49647 | ||
|
|
083cbd7b56 | ||
|
|
e87bcbb819 | ||
|
|
f8561996ab | ||
|
|
01d320300e | ||
|
|
3faecd3979 | ||
|
|
984962e34e | ||
|
|
6140bfa09c | ||
|
|
2cbb433cbd | ||
|
|
c676cde1fb | ||
|
|
363c2ff155 | ||
|
|
2a2650b43e | ||
|
|
a5c13c4ae7 | ||
|
|
bf40d37745 | ||
|
|
8889d06568 | ||
|
|
e7d2f54bda | ||
|
|
1e31d2accd | ||
|
|
1e08854dce | ||
|
|
cb27d96fe6 | ||
|
|
943667adc6 | ||
|
|
89b2c6ab19 | ||
|
|
760cd38113 | ||
|
|
1abc312d2c | ||
|
|
09abf6d6b1 | ||
|
|
fa203d73e0 | ||
|
|
880741d8c3 | ||
|
|
42bd6390b5 | ||
|
|
c9856f2a5b | ||
|
|
c086f72400 | ||
|
|
a50c380722 | ||
|
|
2755d6be1c | ||
|
|
359db9ddc3 | ||
|
|
e4f3daf1ed | ||
|
|
557ea195ba | ||
|
|
1c14d9f652 | ||
|
|
b8ebda638c | ||
|
|
db089a3920 | ||
|
|
4110c22f64 | ||
|
|
5b07fcce33 | ||
|
|
2219f2efba | ||
|
|
ba3b00c784 | ||
|
|
9598258993 | ||
|
|
32ab2eb2cc | ||
|
|
63c27601e5 | ||
|
|
f2d4b6ff7d | ||
|
|
e945226956 | ||
|
|
9a7ff0bbf2 | ||
|
|
97830621a6 | ||
|
|
1c77fb2e76 | ||
|
|
67c4a3c317 | ||
|
|
7f17359913 | ||
|
|
b6212b90d8 | ||
|
|
74cbe1062a | ||
|
|
2be4eeebb7 | ||
|
|
a49407ad79 | ||
|
|
24737321b0 | ||
|
|
3a72a7ee61 | ||
|
|
d9b6136916 | ||
|
|
537e1758c3 | ||
|
|
c6bbe14c6f | ||
|
|
8af265a689 | ||
|
|
193a6cf502 | ||
|
|
d6c148f7e3 | ||
|
|
afdc0006b5 | ||
|
|
2cb0f6e159 | ||
|
|
db72ee376e | ||
|
|
2bbeb83eb2 | ||
|
|
f718adf692 | ||
|
|
2aaf56ac6d | ||
|
|
426cc077e0 | ||
|
|
879e549581 | ||
|
|
78f6198d0a | ||
|
|
6ddaa150b4 | ||
|
|
9188a99c99 | ||
|
|
352a56448e | ||
|
|
5c7fea694f | ||
|
|
5474007dcf | ||
|
|
320d155a96 | ||
|
|
73f91e09db | ||
|
|
36d2b24bae | ||
|
|
f9010d9ef1 | ||
|
|
aeda3280b3 | ||
|
|
5e3b30daa8 | ||
|
|
ee2165b184 | ||
|
|
1b7fa8ba15 | ||
|
|
052dc52801 | ||
|
|
4373ec21aa | ||
|
|
892e0f3599 | ||
|
|
d9a742b734 | ||
|
|
9e1a8de1bd | ||
|
|
73c8e7eb75 | ||
|
|
41ba4fcedc | ||
|
|
b673daf265 | ||
|
|
06b9f7eb00 | ||
|
|
092026794e | ||
|
|
0bc9dd365f | ||
|
|
f4eb3ec090 | ||
|
|
7596b3b4f4 | ||
|
|
d546e1699f | ||
|
|
fe4a859af6 | ||
|
|
7ecce240d0 | ||
|
|
a8dd08cf33 | ||
|
|
9a38439d11 | ||
|
|
06c977c39d | ||
|
|
1e352925ef | ||
|
|
9b6a9158af | ||
|
|
fd49d9a203 | ||
|
|
093d1b95da | ||
|
|
52ef85a910 | ||
|
|
ca8f2f91ab | ||
|
|
3553cca81c | ||
|
|
bdeea206e3 | ||
|
|
34cb916d59 | ||
|
|
5f253a5d5c | ||
|
|
948f727a0b | ||
|
|
7b4be698fc | ||
|
|
3f079d7543 | ||
|
|
52d5bf6db6 | ||
|
|
d80d41a6f6 | ||
|
|
4b8d721af8 | ||
|
|
a2b051c773 | ||
|
|
2aa49112f3 | ||
|
|
60b21cb3ce | ||
|
|
55e9299da5 | ||
|
|
6df78961ab | ||
|
|
6a65a15b0d | ||
|
|
2a1f9a00d4 | ||
|
|
211de47076 | ||
|
|
af3cf465bc | ||
|
|
c1a8c1aa86 | ||
|
|
08fb82fae4 | ||
|
|
0c4485ea15 | ||
|
|
064b655fa9 | ||
|
|
d71d4914d5 | ||
|
|
2a7f21a8f8 | ||
|
|
d720da1852 | ||
|
|
e9f40eba08 | ||
|
|
3d68c3b9f7 | ||
|
|
f5ad0195bc | ||
|
|
85818a7778 | ||
|
|
b6e5749b7f | ||
|
|
2a1323bfd0 | ||
|
|
0c56d3ab39 | ||
|
|
c59c53aa47 | ||
|
|
90c3949696 | ||
|
|
14ca35a64b | ||
|
|
cf148f6c06 | ||
|
|
c3e0426c36 | ||
|
|
c7f3e52f92 | ||
|
|
1605577538 | ||
|
|
69ba712cb3 | ||
|
|
634d40fa01 | ||
|
|
088ed56c50 | ||
|
|
d49c758d04 | ||
|
|
187492a827 | ||
|
|
0a375e6ac4 | ||
|
|
226c5b4685 | ||
|
|
e72352d7e1 | ||
|
|
322d80f151 | ||
|
|
8e4d3920d9 | ||
|
|
241afdc4fd | ||
|
|
4ee68f7a84 | ||
|
|
11b13af489 | ||
|
|
5abf23d711 | ||
|
|
38c7075422 | ||
|
|
dead11036c | ||
|
|
e708d6caec | ||
|
|
3a7c4119ff | ||
|
|
b1fc7a09be | ||
|
|
7c0a37c8a8 | ||
|
|
bfdd241330 | ||
|
|
cdc8972031 | ||
|
|
f668c5cc33 | ||
|
|
ed0373f188 | ||
|
|
74f37ee761 | ||
|
|
3970668d0e | ||
|
|
fe833164de | ||
|
|
eca57960a0 | ||
|
|
41c8325aae | ||
|
|
c118da628d | ||
|
|
0714c79917 | ||
|
|
d01f484999 | ||
|
|
d161ccf816 | ||
|
|
e18da4e996 | ||
|
|
4aca931a23 | ||
|
|
81b0f6e7fe | ||
|
|
93873874bb | ||
|
|
88ca4b3011 | ||
|
|
a3bd6392a1 | ||
|
|
ed01591374 | ||
|
|
c48d4923d6 | ||
|
|
3dbc47b54f | ||
|
|
d6ef40fd0f | ||
|
|
b94dbcdbdf | ||
|
|
d0be4f8056 | ||
|
|
5e392d0832 | ||
|
|
acc92dfb1f | ||
|
|
5e13161b70 | ||
|
|
20034609e0 | ||
|
|
58ddcd7499 | ||
|
|
81755b83ad | ||
|
|
b96e7077fc | ||
|
|
1b0a792b56 | ||
|
|
4e093e59f3 | ||
|
|
9400526e47 | ||
|
|
a2733b66b7 | ||
|
|
40251b2371 | ||
|
|
980779a583 | ||
|
|
ad31d21380 | ||
|
|
525b56ebc5 | ||
|
|
abc15029e6 | ||
|
|
d992340d98 | ||
|
|
e5fa525364 | ||
|
|
39622c277c | ||
|
|
98a6c9bd62 | ||
|
|
409cecd943 | ||
|
|
54c92d5b42 | ||
|
|
2ef97edd43 | ||
|
|
e19c743888 | ||
|
|
81b5ade110 | ||
|
|
c0cfca286e | ||
|
|
584b0b9721 | ||
|
|
d5634eb756 | ||
|
|
38304c4d90 | ||
|
|
b92064f72b | ||
|
|
38814a8f89 | ||
|
|
9d5ff37aca | ||
|
|
68dec1aa1b | ||
|
|
f3bbafc15c | ||
|
|
1789bd5afd | ||
|
|
8e5bbbd37f | ||
|
|
95bd27f079 | ||
|
|
7a9cd965a0 | ||
|
|
67673fa604 | ||
|
|
9f54857be0 | ||
|
|
a733e610b4 | ||
|
|
f48ada800e | ||
|
|
868785688e | ||
|
|
e9ccbaa772 | ||
|
|
0b6b0e6ca2 | ||
|
|
47e0ecff71 | ||
|
|
3123202381 | ||
|
|
9a1861aeb2 | ||
|
|
bba41922cc | ||
|
|
373611b687 | ||
|
|
9576104e83 | ||
|
|
57f14e5e58 | ||
|
|
d51a6fe3c6 | ||
|
|
05b0f91ae0 | ||
|
|
aea7fe15e6 | ||
|
|
c6c5e53dc8 | ||
|
|
03d6f8ab44 | ||
|
|
06ad490dd8 | ||
|
|
439e1ac346 |
@@ -7,8 +7,4 @@ config BBF_VENDOR_PREFIX
|
||||
config BBF_OBFUSCATION_KEY
|
||||
string "Obfuscation key"
|
||||
default "371d530c95a17d1ca223a29b7a6cdc97e1135c1e0959b51106cca91a0b148b5e42742d372a359760742803f2a44bd88fca67ccdcfaeed26d02ce3b6049cb1e04"
|
||||
|
||||
config BBF_MAX_OBJECT_INSTANCES
|
||||
int "Maximum number of instances per object"
|
||||
default 255
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bbfdm
|
||||
PKG_VERSION:=1.14.1
|
||||
PKG_VERSION:=1.18.12
|
||||
|
||||
USE_LOCAL:=0
|
||||
ifneq ($(USE_LOCAL),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bbfdm.git
|
||||
PKG_SOURCE_VERSION:=b7e5e0de5a12340f3fa9c9e9e40915c4de79e8c5
|
||||
PKG_SOURCE_VERSION:=adfdb54d625b952c533670f093dae008782ff56a
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -19,6 +19,8 @@ endif
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
RSTRIP:=true
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
include bbfdm.mk
|
||||
@@ -53,7 +55,7 @@ define Package/dm-service
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Datamodel ubus backend to expose micro-service tree
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libbbfdm-api +libbbfdm-ubus +bbf_configmngr +libeasy
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr
|
||||
@@ -68,8 +70,13 @@ define Package/bbfdmd/config
|
||||
source "$(SOURCE)/Config_bbfdmd.in"
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/config
|
||||
source "$(SOURCE)/bbf_configmngr.in"
|
||||
# Below config is a hack to force-recompile dependent micro-services
|
||||
define Package/libbbfdm-api/config
|
||||
if PACKAGE_bbfdmd
|
||||
config BBF_LIBBBFDM_VERSION
|
||||
string "Internal config variable to force recompile"
|
||||
default "v${PKG_VERSION}"
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/libbbfdm-api/description
|
||||
@@ -100,8 +107,9 @@ endif
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)" \
|
||||
-DBBF_MAX_OBJECT_INSTANCES:Integer=$(CONFIG_BBF_MAX_OBJECT_INSTANCES) \
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=10485760
|
||||
-DBBFDMD_MAX_MSG_LEN:Integer=10485760 \
|
||||
-DCMAKE_BUILD_TYPE:String="Debug" \
|
||||
|
||||
|
||||
define Package/libbbfdm-api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
@@ -134,6 +142,7 @@ define Package/bbfdmd/install
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bbfdmd/ubus/bbfdmd $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/bbfdmd
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbfdmd $(1)/etc/init.d/bbfdmd
|
||||
@@ -146,6 +155,10 @@ define Package/bbfdmd/install
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/91-fix-bbfdmd-enabled-option $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/ruleng.bbfdm $(1)/etc/uci-defaults
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/ruleng
|
||||
$(INSTALL_BIN) ./files/etc/ruleng/bbfdm.json $(1)/etc/ruleng
|
||||
endef
|
||||
|
||||
define Package/dm-service/install
|
||||
@@ -154,22 +167,23 @@ define Package/dm-service/install
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dm-service/dm-service $(1)/usr/sbin/
|
||||
|
||||
$(BBFDM_REGISTER_SERVICES) -v ${CONFIG_BBF_VENDOR_PREFIX} ./bbfdm_service.json $(1) core
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libbbfdm/libcore.so $(1) core
|
||||
endef
|
||||
|
||||
define Package/bbf_configmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/
|
||||
ifeq ($(CONFIG_BBF_CONFIGMNGR_C_BACKEND),y)
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/bbf_configd $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/scripts
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
|
||||
endif
|
||||
ifeq ($(CONFIG_BBF_CONFIGMNGR_SCRIPT_BACKEND),y)
|
||||
$(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
||||
$(CP) $(PKG_BUILD_DIR)/utilities/files/usr/libexec/rpcd/bbf.config $(1)/usr/libexec/rpcd/bbf.config
|
||||
endif
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/bbf_configd $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/bbf_configd
|
||||
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bbf_configd $(1)/etc/init.d/bbf_configd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_config_notify.sh $(1)/usr/share/bbfdm/scripts/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/utilities/files/usr/share/bbfdm/scripts/bbf_default_reload.sh $(1)/etc/bbfdm/
|
||||
$(INSTALL_DATA) ./files/etc/bbfdm/critical_services.json $(1)/etc/bbfdm/
|
||||
endef
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
if PACKAGE_bbf_configmngr
|
||||
choice
|
||||
prompt "Select backend daemon for bbf.config"
|
||||
default BBF_CONFIGMNGR_C_BACKEND
|
||||
help
|
||||
Select which backend daemon should be used for ubus bbf.config
|
||||
|
||||
config BBF_CONFIGMNGR_SCRIPT_BACKEND
|
||||
bool "Use shell script backend"
|
||||
help
|
||||
Enable this option to use shell script as the backend for bbf.config. This can be useful for quick and easy scripting of configuration tasks.
|
||||
|
||||
config BBF_CONFIGMNGR_C_BACKEND
|
||||
bool "Use C code backend"
|
||||
help
|
||||
Enable this option to use a C code implementation as the backend for bbf.config. This option is generally preferred for performance-critical tasks and scenarios requiring more robust and efficient handling.
|
||||
|
||||
endchoice
|
||||
endif
|
||||
@@ -6,6 +6,7 @@ BBFDM_BASE_DM_PATH=/usr/share/bbfdm
|
||||
BBFDM_INPUT_PATH=/etc/bbfdm/micro_services
|
||||
BBFDM_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
PKG_CONFIG_DEPENDS += CONFIG_BBF_LIBBBFDM_VERSION
|
||||
#BBFDM_VERSION:=$(shell grep -oP '(?<=^PKG_VERSION:=).*' ${BBFDM_DIR}/Makefile)
|
||||
#BBFDM_TOOLS:=$(BUILD_DIR)/bbfdm-$(BBFDM_VERSION)/tools
|
||||
|
||||
@@ -89,28 +90,3 @@ BBFDM_INSTALL_SCRIPT:=$(BBFDM_DIR)/tools/bbfdm.sh -s
|
||||
|
||||
|
||||
BBFDM_REGISTER_SERVICES:=$(BBFDM_DIR)/tools/bbfdm.sh -t
|
||||
|
||||
# Deprecated functions errors
|
||||
define BbfdmInstallPluginInMicroservice
|
||||
$(warning # BbfdmInstallPluginInMicroservice function is deprecated, use BBFDM_INSTALL_MS_PLUGIN macro #)
|
||||
$(INSTALL_DIR) $(1)
|
||||
$(INSTALL_DATA) $(2) $(1)/
|
||||
endef
|
||||
|
||||
define BbfdmInstallMicroServiceInputFile
|
||||
$(warning # function BbfdmInstallMicroServiceInputFile deprecated, input file auto generated with BBFDM_INSTALL_MS_DM #)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/micro_services
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/micro_services/$(PKG_NAME).json
|
||||
endef
|
||||
|
||||
define BbfdmInstallPlugin
|
||||
$(warning # function BbfdmInstallPlugin deprecated, use BBFDM_INSTALL_CORE_PLUGIN macro #)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(2) $(1)/etc/bbfdm/plugins/
|
||||
endef
|
||||
|
||||
define BbfdmInstallPluginWithPriority
|
||||
$(warning # fucntion BbfdmInstallPluginWithPriority deprecated, use BBFDM_INSTALL_CORE_PLUGIN #)
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/plugins
|
||||
$(INSTALL_DATA) $(3) $(1)/etc/bbfdm/plugins/$(2)_$(shell basename ${3})
|
||||
endef
|
||||
|
||||
54
bbfdm/bbfdm_service.json
Normal file
54
bbfdm/bbfdm_service.json
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
"daemon": {
|
||||
"enable": "1",
|
||||
"service_name": "core",
|
||||
"unified_daemon": false,
|
||||
"services": [
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "LANConfigSecurity"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "Schedules"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "Security",
|
||||
"proto": "cwmp"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "PacketCaptureDiagnostics"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "SelfTestDiagnostics"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "Syslog"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "{BBF_VENDOR_PREFIX}OpenVPN",
|
||||
"proto": "usp"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "RootDataModelVersion"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "Reboot()"
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "FactoryReset()"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"loglevel": "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,51 @@
|
||||
{
|
||||
"usp": [
|
||||
"firewall",
|
||||
"network",
|
||||
"dhcp",
|
||||
"wireless",
|
||||
"time"
|
||||
"/etc/config/firewall",
|
||||
"/etc/bbfdm/dmmap/dmmap_firewall",
|
||||
"/etc/config/network",
|
||||
"/etc/bbfdm/dmmap/IP",
|
||||
"/etc/bbfdm/dmmap/Ethernet",
|
||||
"/etc/bbfdm/dmmap/GRE",
|
||||
"/etc/bbfdm/dmmap/IPv6rd",
|
||||
"/etc/bbfdm/dmmap/PPP",
|
||||
"/etc/bbfdm/dmmap/Routing",
|
||||
"/etc/config/dhcp",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_client",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_relay",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcpv6",
|
||||
"/etc/config/time",
|
||||
"/etc/bbfdm/dmmap/dmmap_time",
|
||||
"/etc/config/mapcontroller",
|
||||
"/etc/config/wireless",
|
||||
"/etc/bbfdm/dmmap/WiFi",
|
||||
"/etc/config/ieee1905",
|
||||
"/etc/config/mosquitto",
|
||||
"/etc/config/nginx",
|
||||
"/etc/config/netmode",
|
||||
"/etc/bbfdm/dmmap/dmmap_netmode"
|
||||
],
|
||||
"cwmp": [
|
||||
"firewall",
|
||||
"network",
|
||||
"dhcp",
|
||||
"stunc",
|
||||
"xmpp",
|
||||
"wireless",
|
||||
"time"
|
||||
"/etc/config/firewall",
|
||||
"/etc/bbfdm/dmmap/dmmap_firewall",
|
||||
"/etc/config/network",
|
||||
"/etc/bbfdm/dmmap/IP",
|
||||
"/etc/bbfdm/dmmap/Ethernet",
|
||||
"/etc/bbfdm/dmmap/GRE",
|
||||
"/etc/bbfdm/dmmap/IPv6rd",
|
||||
"/etc/bbfdm/dmmap/PPP",
|
||||
"/etc/bbfdm/dmmap/Routing",
|
||||
"/etc/config/dhcp",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_client",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcp_relay",
|
||||
"/etc/bbfdm/dmmap/dmmap_dhcpv6",
|
||||
"/etc/config/mapcontroller",
|
||||
"/etc/config/wireless",
|
||||
"/etc/bbfdm/dmmap/WiFi",
|
||||
"/etc/config/time",
|
||||
"/etc/bbfdm/dmmap/dmmap_time",
|
||||
"/etc/config/netmode",
|
||||
"/etc/bbfdm/dmmap/dmmap_netmode"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
config bbfdmd 'bbfdmd'
|
||||
option enable '1'
|
||||
option debug '0'
|
||||
option loglevel '4'
|
||||
option loglevel '3'
|
||||
|
||||
config micro_services 'micro_services'
|
||||
option enable '1'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
STOP=10
|
||||
STOP=07
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbf_configd
|
||||
@@ -10,19 +10,10 @@ log() {
|
||||
echo "${@}"|logger -t bbf.config -p info
|
||||
}
|
||||
|
||||
create_needed_directories()
|
||||
{
|
||||
mkdir -p /tmp/bbfdm/.cwmp
|
||||
mkdir -p /tmp/bbfdm/.usp
|
||||
mkdir -p /tmp/bbfdm/.bbfdm
|
||||
}
|
||||
|
||||
start_service()
|
||||
{
|
||||
local log_level
|
||||
|
||||
create_needed_directories
|
||||
|
||||
config_load bbfdm
|
||||
config_get log_level "reload_handler" log_level 2
|
||||
|
||||
@@ -36,6 +27,6 @@ start_service()
|
||||
service_triggers() {
|
||||
for config_file in /etc/config/*; do
|
||||
config_name=$(basename "$config_file")
|
||||
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh
|
||||
procd_add_config_trigger "config.change" "$config_name" /usr/share/bbfdm/scripts/bbf_config_notify.sh "$config_name"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=60
|
||||
STOP=8
|
||||
STOP=05
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/dm-service
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=97
|
||||
STOP=10
|
||||
STOP=06
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/bbfdmd
|
||||
|
||||
66
bbfdm/files/etc/ruleng/bbfdm.json
Normal file
66
bbfdm/files/etc/ruleng/bbfdm.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"hosts_refresh": {
|
||||
"if" : [
|
||||
{
|
||||
"event": "host"
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"object": "bbfdm.hostmngr",
|
||||
"method":"refresh_references_db",
|
||||
"args" : {},
|
||||
"timeout": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"dhcp_refresh": {
|
||||
"if_operator": "OR",
|
||||
"if" : [
|
||||
{
|
||||
"event": "host"
|
||||
},
|
||||
{
|
||||
"event": "wifi.dataelements.Associated"
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"object": "bbfdm.dhcpmngr",
|
||||
"method":"refresh_references_db",
|
||||
"args" : {},
|
||||
"timeout": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"ieee1905_refresh_add": {
|
||||
"if" : [
|
||||
{
|
||||
"event": "ieee1905.neighbor.add"
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"object": "bbfdm.ieee1905",
|
||||
"method":"refresh_references_db",
|
||||
"args" : {},
|
||||
"timeout": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
"ieee1905_refresh_del": {
|
||||
"if" : [
|
||||
{
|
||||
"event": "ieee1905.neighbor.del"
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"object": "bbfdm.ieee1905",
|
||||
"method":"refresh_references_db",
|
||||
"args" : {},
|
||||
"timeout": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -51,10 +51,6 @@ parse_bbfdm_sysctl_conf_file() {
|
||||
|
||||
# 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
|
||||
|
||||
2
bbfdm/files/etc/uci-defaults/ruleng.bbfdm
Normal file
2
bbfdm/files/etc/uci-defaults/ruleng.bbfdm
Normal file
@@ -0,0 +1,2 @@
|
||||
uci -q set ruleng.bbfdm=rule
|
||||
uci -q set ruleng.bbfdm.recipe='/etc/ruleng/bbfdm.json'
|
||||
@@ -9,10 +9,12 @@ SCRIPT=0
|
||||
DIAG=0
|
||||
PLUGIN=0
|
||||
DEST=""
|
||||
VENDOR_EXTN=""
|
||||
TOOLS="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
SRC=""
|
||||
EXTRA_DATA=""
|
||||
|
||||
while getopts ":mpsdtu:" opt; do
|
||||
while getopts ":mpsdtv:" opt; do
|
||||
case ${opt} in
|
||||
m)
|
||||
MICRO_SERVICE=1
|
||||
@@ -29,6 +31,9 @@ while getopts ":mpsdtu:" opt; do
|
||||
t)
|
||||
INPUT_FILE=1
|
||||
;;
|
||||
v)
|
||||
VENDOR_EXTN=${OPTARG}
|
||||
;;
|
||||
?)
|
||||
echo "Invalid option: ${OPTARG}"
|
||||
exit 1
|
||||
@@ -42,6 +47,9 @@ shift
|
||||
DEST="${1}"
|
||||
shift
|
||||
DATA="${1}"
|
||||
shift
|
||||
EXTRA_DATA="${1}"
|
||||
|
||||
|
||||
install_bin() {
|
||||
if ! install -m0755 ${1} ${2}; then
|
||||
@@ -88,6 +96,10 @@ bbfdm_install_dm()
|
||||
minfile=$(mktemp)
|
||||
jq -c 'del(..|.description?)' ${src} > ${minfile}
|
||||
|
||||
if [ -n "${VENDOR_EXTN}" ]; then
|
||||
sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${minfile}
|
||||
fi
|
||||
|
||||
src=${minfile}
|
||||
if dpkg -s python3-jsonschema >/dev/null 2>&1; then
|
||||
echo "Verifying bbfdm Datamodel JSON file"
|
||||
@@ -125,6 +137,7 @@ fi
|
||||
|
||||
if [ "${INPUT_FILE}" -eq "1" ]; then
|
||||
|
||||
tempfile=""
|
||||
if [ ! -f "${SRC}" ]; then
|
||||
echo "# Datamodel Input file ${SRC} not available"
|
||||
exit 1
|
||||
@@ -135,14 +148,24 @@ if [ "${INPUT_FILE}" -eq "1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${DATA}" ]; then
|
||||
echo "# Package name not provided ...."
|
||||
service_name="$(cat ${SRC}|jq -r '.daemon.service_name')"
|
||||
if [ -z "${service_name}" ]; then
|
||||
echo "# service_name not defined in service json ...."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tempfile=$(mktemp)
|
||||
cp ${SRC} ${tempfile}
|
||||
if [ -n "${VENDOR_EXTN}" ]; then
|
||||
sed -i "s/{BBF_VENDOR_PREFIX}/${VENDOR_EXTN}/g" ${tempfile}
|
||||
fi
|
||||
|
||||
install_dir ${DEST}/etc/bbfdm/services
|
||||
install_data ${SRC} ${DEST}/etc/bbfdm/services/${DATA}.json
|
||||
install_data ${tempfile} ${DEST}/etc/bbfdm/services/${service_name}.json
|
||||
|
||||
if [ -f "${tempfile}" ]; then
|
||||
rm ${tempfile}
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -158,18 +181,19 @@ if [ "${MICRO_SERVICE}" -eq "1" ]; then
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}.${extn##*.}
|
||||
else
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}/$(basename ${SRC})
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/${DATA}/$(printf "%02d" ${EXTRA_DATA})$(basename ${SRC})
|
||||
fi
|
||||
else
|
||||
if [ "${PLUGIN}" -eq "1" ]; then
|
||||
echo "# WARNING: BBFDM_INSTALL_CORE_PLUGIN macro will be deprecated soon. Please use BBFDM_INSTALL_MS_PLUGIN macro instead, specifying 'core' as micro-service name #"
|
||||
priority="${DATA:-0}"
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/plugins
|
||||
install_dir ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/core
|
||||
|
||||
if [ "${priority}" -gt "0" ]; then
|
||||
# install with priority if defined
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/plugins/${priority}_$(basename ${SRC})
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/core/${priority}_$(basename ${SRC})
|
||||
elif [ "${priority}" -eq "0" ]; then
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/plugins/$(basename ${SRC})
|
||||
bbfdm_install_dm ${SRC} ${DEST}/${BBFDM_BASE_DM_PATH}/micro_services/core/$(basename ${SRC})
|
||||
else
|
||||
echo "# Priority should be an unsigned integer"
|
||||
exit 1
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
if PACKAGE_bridgemngr
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config BRIDGEMNGR_BRIDGE_VLAN
|
||||
bool "Use bridge-vlan backend"
|
||||
help
|
||||
@@ -13,5 +11,7 @@ config BRIDGEMNGR_BRIDGE_VENDOR_EXT
|
||||
help
|
||||
Set this option to use bridge BBF vendor extensions.
|
||||
|
||||
endmenu
|
||||
config BRIDGEMNGR_BRIDGE_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
endif
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bridgemngr
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr
|
||||
PKG_SOURCE_VERSION:=18c2921a1cf5bfa027c11c5e6ca605ef69fd1168
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/bridgemngr.git
|
||||
PKG_SOURCE_VERSION:=e5e0d9adfc919c25d88a867d42a9c500cb09f834
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -40,7 +39,13 @@ endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX),"")
|
||||
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
|
||||
else
|
||||
VENDOR_PREFIX = $(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_PREFIX)
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VLAN),y)
|
||||
TARGET_CFLAGS += -DBRIDGE_VLAN_BACKEND
|
||||
@@ -53,8 +58,8 @@ define Package/bridgemngr/install
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libbridgemngr.so $(1) $(PKG_NAME)
|
||||
ifeq ($(CONFIG_BRIDGEMNGR_BRIDGE_VENDOR_EXT), y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libbridgeext.so $(1) $(PKG_NAME) 10
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) -v ${VENDOR_PREFIX} ./files/VLAN_Filtering_Extension.json $(1) $(PKG_NAME) 11
|
||||
endif
|
||||
|
||||
$(INSTALL_BIN) ./files/etc/init.d/bridging $(1)/etc/init.d/
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=2.1.19
|
||||
PKG_VERSION:=2.1.23
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/bulkdata.git
|
||||
PKG_SOURCE_VERSION:=628525b02ae9ccd39f4bc85cf616ed4a102bca48
|
||||
PKG_SOURCE_VERSION:=f54550f2d587a701c0a8d5cac4a0910a99ce92cf
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
"enable": "1",
|
||||
"service_name": "bulkdata",
|
||||
"unified_daemon": true,
|
||||
"proto": "cwmp",
|
||||
"services": [
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "BulkData",
|
||||
"proto": "cwmp"
|
||||
"object": "BulkData"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddnsmngr
|
||||
PKG_VERSION:=1.0.10
|
||||
PKG_VERSION:=1.0.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ddnsmngr.git
|
||||
PKG_SOURCE_VERSION:=5144e73fad92d23ae706894a4357436c3fe89355
|
||||
PKG_SOURCE_VERSION:=44af9a7b3fec3929f8554af9633a5b8068189b48
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -4,4 +4,16 @@ config DECOLLECTOR_EASYMESH_VERSION
|
||||
int "Support Easymesh version"
|
||||
default 6
|
||||
|
||||
config DECOLLECTOR_BUILD_TR181_PLUGIN
|
||||
bool "Build TR-181 mapping module (responsible for Device.WiFi.DataElements.)"
|
||||
default y
|
||||
|
||||
config DECOLLECTOR_VENDOR_EXTENSIONS
|
||||
bool "Iopsys vendor extensions for Device.WiFi.DataElements."
|
||||
default y
|
||||
|
||||
config DECOLLECTOR_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
#
|
||||
# Copyright (C) 2021-2023 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2021-2024 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2025 Genexis AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=decollector
|
||||
PKG_VERSION:=6.1.0.7
|
||||
PKG_VERSION:=6.2.3.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=db4eae19a3f716eec5a37aa2786b9bbbe3160b54
|
||||
PKG_SOURCE_VERSION:=2f618a85b4d9dab443319ee355355c526f6429c9
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/multi-ap/decollector.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@genexis.eu>
|
||||
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/iopsys/bbfdm/bbfdm.mk
|
||||
|
||||
define Package/decollector
|
||||
SECTION:=utils
|
||||
@@ -65,6 +67,18 @@ MAKE_PATH:=src
|
||||
|
||||
TARGET_CFLAGS += -DEASYMESH_VERSION=$(CONFIG_DECOLLECTOR_EASYMESH_VERSION)
|
||||
|
||||
ifeq ($(CONFIG_DECOLLECTOR_BUILD_TR181_PLUGIN),y)
|
||||
MAKE_FLAGS += DECOLLECTOR_BUILD_TR181_PLUGIN=y
|
||||
ifeq ($(CONFIG_DECOLLECTOR_VENDOR_EXTENSIONS),y)
|
||||
TARGET_CFLAGS += -DDECOLLECTOR_VENDOR_EXTENSIONS
|
||||
ifeq ($(CONFIG_DECOLLECTOR_VENDOR_PREFIX),"")
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
else
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_DECOLLECTOR_VENDOR_PREFIX)\\\"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
EXECS := \
|
||||
$(if $(CONFIG_PACKAGE_decollector),decollector)
|
||||
|
||||
@@ -75,6 +89,7 @@ define Package/decollector/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/decollector.init $(1)/etc/init.d/decollector
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/decollector $(1)/usr/sbin/
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,decollector))
|
||||
|
||||
26
decollector/bbfdm_service.json
Normal file
26
decollector/bbfdm_service.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"daemon": {
|
||||
"enable": "1",
|
||||
"service_name": "decollector",
|
||||
"unified_daemon": true,
|
||||
"services": [
|
||||
{
|
||||
"parent_dm": "Device.WiFi.",
|
||||
"object": "DataElements"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"loglevel": "3"
|
||||
},
|
||||
"apply_handler": {
|
||||
"uci": [
|
||||
{
|
||||
"file": [
|
||||
"mapcontroller"
|
||||
],
|
||||
"external_handler": "/etc/wifidmd/bbf_config_reload.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.7.3
|
||||
PKG_VERSION:=3.7.12
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=393dfd7637fdeccc24ef286c3daec9a232896b98
|
||||
PKG_SOURCE_VERSION:=a62611a36fa85f9fba1b8ec946397dc725c57630
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -56,11 +56,14 @@ endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/dspg
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/dectmngr
|
||||
ifeq ($(CONFIG_TARGET_airoha),)
|
||||
$(CP) ./firmware/common/* $(1)/etc/dspg/
|
||||
endif
|
||||
$(CP) ./files/etc/* $(1)/etc/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dect $(1)/lib/upgrade/keep.d/dect
|
||||
endef
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
config dect 'global'
|
||||
option log_dect_cmbs 'syslog'
|
||||
option log_level 'realtime,warning,error'
|
||||
option log_dect_cmbs 'syslog'
|
||||
option log_level 'realtime,warning,error'
|
||||
|
||||
config dect 'base'
|
||||
option enable '1'
|
||||
|
||||
@@ -11,6 +11,25 @@ LOG_PATH=/var/log/dectmngr
|
||||
DB_PATH=/etc/dect
|
||||
DCX81_UART_DT_ALIAS=/proc/device-tree/aliases/dcx81-uart
|
||||
|
||||
get_extension_shift() {
|
||||
local dect_exts
|
||||
|
||||
get_dect_extension() {
|
||||
local ext=$1
|
||||
local type
|
||||
|
||||
config_get type $ext type
|
||||
|
||||
[ "$type" == "dect" ] && echo $ext
|
||||
}
|
||||
|
||||
config_load "asterisk"
|
||||
|
||||
dect_exts=$(config_foreach get_dect_extension "extension" |sort |head -n1)
|
||||
|
||||
echo "${dect_exts#extension}"
|
||||
}
|
||||
|
||||
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
|
||||
stop_and_wait_dectmngr() {
|
||||
dect_pid=$(pidof $PROG)
|
||||
@@ -38,13 +57,53 @@ get_dcx81_device() {
|
||||
device_name_line="$(grep '^DEVNAME=' "$uevent_file")" || return 1
|
||||
readonly device="/dev/${device_name_line##DEVNAME=}"
|
||||
[ -c "$device" ] || return 1
|
||||
printf "%s" "$device"
|
||||
printf "%s" "$(basename $device)"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
check_dcx81_firmware() {
|
||||
local dcx81_uart=$1
|
||||
local fw_link="/lib/firmware/dcx81_firmware"
|
||||
local fw_file
|
||||
|
||||
[ -L "$fw_link" ] || return
|
||||
|
||||
fw_file=$(readlink -f $fw_link)
|
||||
[ -f "$fw_file" ] || return
|
||||
|
||||
# the symbolic link is not needed
|
||||
rm -f $fw_link
|
||||
|
||||
eval $(/sbin/cmbs_tcx -comname "$dcx81_uart" -fw_version |grep DCX81_FW_Version)
|
||||
[ -n "$DCX81_FW_Version" ] || return
|
||||
|
||||
if echo $(basename $fw_file) | grep -qi "$DCX81_FW_Version" ; then
|
||||
logger -t "$PROG" "DCX81 running expected $DCX81_FW_Version"
|
||||
return;
|
||||
fi
|
||||
|
||||
logger -t "$PROG" "DCX81 firmware upgrading to $fw_file"
|
||||
/sbin/cmbs_tcx -comname "$dcx81_uart" -fwu "$fw_file" 2>&1 >/dev/null &
|
||||
|
||||
echo -n "Updrading DCX81 firmware.." >/dev/console
|
||||
local wait_time=0
|
||||
while pidof cmbs_tcx >/dev/null && [ "$wait_time" -lt "200" ] ; do
|
||||
sleep 5
|
||||
wait_time=$(($wait_time + 5))
|
||||
echo -n "." >/dev/console
|
||||
done
|
||||
|
||||
if pidof cmbs_tcx >/dev/null ; then
|
||||
killall -9 cmbs_tcx
|
||||
logger -t "$PROG" "DCX81 firmware upgrade timeout"
|
||||
else
|
||||
logger -t "$PROG" "DCX81 firmware upgrade done"
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local opt_ext=
|
||||
local rfpi=
|
||||
@@ -59,9 +118,13 @@ start_service() {
|
||||
local dcx81_uart_device
|
||||
if ! dcx81_uart_device="$(get_dcx81_device)"; then
|
||||
logger -t "$PROG" -p daemon.warning "Could not determine DCX81 UART device. Falling back to default ttyH0."
|
||||
dcx81_uart_device=/dev/ttyH0
|
||||
dcx81_uart_device="ttyH0"
|
||||
fi
|
||||
|
||||
check_dcx81_firmware $dcx81_uart_device
|
||||
|
||||
opt_ext="-extensionShift $(get_extension_shift)"
|
||||
|
||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
||||
|
||||
@@ -77,24 +140,27 @@ start_service() {
|
||||
|
||||
config_load dect
|
||||
config_get log_dect_cmbs global log_dect_cmbs syslog
|
||||
config_get pcm_slot_start global pcm_slot_start
|
||||
config_get pcm_fsync global pcm_fsync
|
||||
|
||||
[ -n "$pcm_fsync" ] && opt_ext="$opt_ext -sync $pcm_fsync"
|
||||
[ -n "$pcm_slot_start" ] && opt_ext="$opt_ext -slotsShift $pcm_slot_start"
|
||||
|
||||
procd_open_instance
|
||||
|
||||
# dectmngr takes expects device without /dev
|
||||
readonly dcx81_uart_device_wo_dev="${dcx81_uart_device##/dev/}"
|
||||
case "$log_dect_cmbs" in
|
||||
none)
|
||||
echo "Starting dectmngr with cmbs logging disabled"
|
||||
procd_set_param command "$PROG" -comname "$dcx81_uart_device_wo_dev" $opt_ext
|
||||
procd_set_param command "$PROG" -comname "$dcx81_uart_device" $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
;;
|
||||
file)
|
||||
echo "Starting dectmngr with cmbs logging enabled to file"
|
||||
procd_set_param command "$PROG" -comname "$dcx81_uart_device_wo_dev" -log $LOG_PATH/dect-cmbs.log $opt_ext
|
||||
procd_set_param command "$PROG" -comname "$dcx81_uart_device" -log $LOG_PATH/dect-cmbs.log $opt_ext
|
||||
;;
|
||||
*)
|
||||
echo "Starting dectmngr with cmbs logging enabled to syslog"
|
||||
procd_set_param command "$PROG" -comname "$dcx81_uart_device_wo_dev" -syslog $opt_ext
|
||||
procd_set_param command "$PROG" -comname "$dcx81_uart_device" -syslog $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dhcpmngr
|
||||
PKG_VERSION:=1.0.5
|
||||
PKG_VERSION:=1.1.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dhcpmngr.git
|
||||
PKG_SOURCE_VERSION:=2a517188211849bcc324a9f9727eeb34d076c032
|
||||
PKG_SOURCE_VERSION:=5787de10680719d0c4b72e1ffcfffa895d4c0571
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
@@ -10,7 +10,6 @@ uci -q get dhcp.odhcpd >/dev/null 2>&1 && {
|
||||
[ -e /usr/lib/unbound/odhcpd.sh ] && [ -e /usr/sbin/unbound ] && {
|
||||
# then set unbound script as leasetrigger in dhcp UCI
|
||||
uci -q set dhcp.odhcpd.leasetrigger='/usr/lib/unbound/odhcpd.sh'
|
||||
uci commit dhcp
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dnsmngr
|
||||
PKG_VERSION:=1.0.14
|
||||
PKG_VERSION:=1.0.19
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/dnsmngr.git
|
||||
PKG_SOURCE_VERSION:=e64ec01b57d8b32e5230b34f6a3866250b1a8faf
|
||||
PKG_SOURCE_VERSION:=205938aa1f686d5b43460e4a17f3900ed82bd29f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -64,11 +64,15 @@ ifeq ($(CONFIG_DNSMNGR_BACKEND_DNSMASQ),y)
|
||||
endif
|
||||
|
||||
define Package/dnsmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/umdns
|
||||
$(INSTALL_DIR) $(1)/etc/umdns/tmp
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dnsmngr $(1)/lib/upgrade/keep.d/dnsmngr
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libdnsmngr.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_SCRIPT) -d $(PKG_BUILD_DIR)/scripts/nslookup $(1)
|
||||
ifeq ($(CONFIG_DNSMNGR_DNS_SD),y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libdns_sd.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/libdns_sd.so $(1) $(PKG_NAME) 10
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
1
dnsmngr/files/lib/upgrade/keep.d/dnsmngr
Normal file
1
dnsmngr/files/lib/upgrade/keep.d/dnsmngr
Normal file
@@ -0,0 +1 @@
|
||||
/etc/umdns/*
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.2.9
|
||||
PKG_VERSION:=1.2.10
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/dslmngr.git
|
||||
PKG_SOURCE_VERSION:=5340cb31f759301f5aca3fd848fc3a63b0b4663f
|
||||
PKG_SOURCE_VERSION:=8fb4093b4d26b3cb06603e110d424005e33cf5d6
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -30,6 +30,8 @@ include ../bbfdm/bbfdm.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
else ifneq ($(CONFIG_TARGET_airoha),)
|
||||
TARGET_PLATFORM=AIROHA
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
endif
|
||||
@@ -41,7 +43,7 @@ define Package/dslmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=XDSL status and configration utility
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +TARGET_airoha:br2684ctl
|
||||
endef
|
||||
|
||||
define Package/dslmngr/description
|
||||
@@ -75,7 +77,10 @@ define Package/dslmngr/install
|
||||
$(CP) ./files/common/* $(1)/
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
$(CP) ./files/broadcom/* $(1)/
|
||||
else ifneq ($(CONFIG_TARGET_airoha),)
|
||||
$(CP) ./files/airoha/* $(1)/
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dslmngr $(1)/sbin/
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
|
||||
26
dslmngr/files/airoha/etc/init.d/xdsl_wan
Executable file
26
dslmngr/files/airoha/etc/init.d/xdsl_wan
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
STOP=99
|
||||
USE_PROCD=1
|
||||
|
||||
start_service() {
|
||||
readonly need_xdsl="$(jsonfilter -i /etc/board.json -e @.dsl)"
|
||||
[ -f /etc/board.json ] || return 0
|
||||
|
||||
if [ "$need_xdsl" != "" ]; then
|
||||
procd_open_instance xdsl_wan
|
||||
procd_set_param command /sbin/xdsl_wan
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
fi
|
||||
}
|
||||
|
||||
boot() {
|
||||
: # boot-up is handled from 'hsm' application
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "dsl"
|
||||
}
|
||||
28
dslmngr/files/airoha/lib/dsl/airoha.sh
Normal file
28
dslmngr/files/airoha/lib/dsl/airoha.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
xtm_remove_devices() {
|
||||
:
|
||||
}
|
||||
|
||||
xtm_create_devices() {
|
||||
:
|
||||
}
|
||||
|
||||
xdsl_configure() {
|
||||
# Support bridged WAN interface
|
||||
ebtables --concurrent -t broute -D BROUTING -p 0xbeed -j DROP 2> /dev/null
|
||||
ebtables --concurrent -t broute -I BROUTING -p 0xbeed -j DROP
|
||||
}
|
||||
|
||||
xdsl_stop() {
|
||||
return 0
|
||||
}
|
||||
|
||||
xdsl_init() {
|
||||
readonly need_xdsl="$(jsonfilter -i /etc/board.json -e @.dsl)"
|
||||
[ "$need_xdsl" = "" ] && exit 0
|
||||
|
||||
echo "Starting DSL"
|
||||
}
|
||||
270
dslmngr/files/airoha/sbin/xdsl_wan
Executable file
270
dslmngr/files/airoha/sbin/xdsl_wan
Executable file
@@ -0,0 +1,270 @@
|
||||
#!/bin/sh
|
||||
|
||||
source "/lib/functions.sh"
|
||||
source "/lib/functions/network.sh"
|
||||
source "/lib/functions/system.sh"
|
||||
|
||||
PREVLINK=""
|
||||
LINK=""
|
||||
LINKSPEED=""
|
||||
PREVWANMODE=""
|
||||
WANMODE=""
|
||||
CONFIGURED=0
|
||||
CINDEX=0
|
||||
WANPORT="$(jsonfilter -i /etc/board.json -e @.network.wan.device)"
|
||||
|
||||
delete_atm_device() {
|
||||
/userfs/bin/blapi_cmd xdsl atm_delete_interface $CINDEX
|
||||
CINDEX=$((CINDEX+1))
|
||||
}
|
||||
|
||||
delete_atm_devices() {
|
||||
CINDEX=0
|
||||
config_load dsl
|
||||
config_foreach delete_atm_device atm-device
|
||||
}
|
||||
|
||||
configure_atm_device() {
|
||||
local vpi vci encapsulation qos_class pcr mbs scr
|
||||
local encap qos ethmac
|
||||
|
||||
config_get vpi $1 vpi "8"
|
||||
config_get vci $1 vci "35"
|
||||
config_get encapsulation $1 encapsulation "llc"
|
||||
config_get qos_class $1 qos_class "ubr"
|
||||
config_get pcr $1 pcr "0"
|
||||
config_get mbs $1 mbs "0"
|
||||
config_get scr $1 scr "0"
|
||||
|
||||
case $encapsulation in # llc, vcmux
|
||||
vcmux)
|
||||
encap="1483 Bridged IP VC-Mux"
|
||||
;;
|
||||
*)
|
||||
encap="1483 Bridged IP LLC"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
ethmac="$(echo -n "$(macaddr_add 02:AA:BB:01:23:40 $((CINDEX+2)))" | sed 's#:##g')"
|
||||
|
||||
/userfs/bin/blapi_cmd xdsl create_device $CINDEX ATM "" "$ethmac"
|
||||
/userfs/bin/blapi_cmd xdsl atm_create_interface $CINDEX ATM "$qos_class" "$encap" "$vpi" "$vci" "$pcr" "$scr" "$mbs" 0
|
||||
|
||||
CINDEX=$((CINDEX+1))
|
||||
}
|
||||
|
||||
create_atm_devices() {
|
||||
delete_atm_devices
|
||||
|
||||
CINDEX=0
|
||||
config_foreach configure_atm_device atm-device
|
||||
}
|
||||
|
||||
configure_line() {
|
||||
local mode profile bitswap sra us0 sesdrop sos roc ginp gvector mod prof
|
||||
local adsl1_flag=0 issue2_flag=0 Glite_flag=0 adsl2_flag=0 adsl2p_flag=0 vdsl2_flag=0
|
||||
local pro_8a_flag=0 pro_8b_flag=0 pro_8c_flag=0 pro_8d_flag=0 pro_12a_flag=0 pro_12b_flag=0 pro_17a_flag=0 pro_30a_flag=0 pro_35b_flag=0
|
||||
|
||||
config_get mode $1 mode "vdsl2"
|
||||
config_get profile $1 profile "35b"
|
||||
config_get bitswap $1 bitswap "1"
|
||||
config_get sra $1 sra "1"
|
||||
config_get us0 $1 us0 "1"
|
||||
config_get sos $1 sos "0"
|
||||
config_get roc $1 roc "0"
|
||||
config_get ginp $1 ginp "1"
|
||||
config_get gvector $1 gvector "1"
|
||||
|
||||
for mod in $mode; do
|
||||
[ "$mod" = "gdmt" ] && adsl1_flag=1
|
||||
[ "$mod" = "glite" ] && Glite_flag=1
|
||||
[ "$mod" = "t1413" ] && issue2_flag=1
|
||||
[ "$mod" = "adsl2" ] && adsl2_flag=1
|
||||
[ "$mod" = "adsl2p" ] && adsl2p_flag=1
|
||||
[ "$mod" = "vdsl2" ] && vdsl2_flag=1
|
||||
done
|
||||
|
||||
for prof in $profile; do
|
||||
[ "$prof" = "8a" ] && pro_8a_flag=1
|
||||
[ "$prof" = "8b" ] && pro_8b_flag=1
|
||||
[ "$prof" = "8c" ] && pro_8c_flag=1
|
||||
[ "$prof" = "8d" ] && pro_8d_flag=1
|
||||
[ "$prof" = "12a" ] && pro_12a_flag=1
|
||||
[ "$prof" = "12b" ] && pro_12b_flag=1
|
||||
[ "$prof" = "17a" ] && pro_17a_flag=1
|
||||
[ "$prof" = "30a" ] && pro_30a_flag=1
|
||||
[ "$prof" = "35b" ] && pro_35b_flag=1
|
||||
done
|
||||
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_profile "$pro_8a_flag" "$pro_8b_flag" "$pro_8c_flag" "$pro_8d_flag" "$pro_12a_flag" "$pro_12b_flag" "$pro_17a_flag" "$pro_30a_flag" "$pro_35b_flag"
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_mode "$adsl1_flag" "$issue2_flag" "$Glite_flag" "$adsl2_flag" "$adsl2p_flag" "$vdsl2_flag"
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_gvector "$((!gvector))"
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_ginp "$((!ginp))"
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_sos_roc "$((!sos))" "$((!roc))"
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_us0 "$((!us0))"
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_sra "$((!sra))"
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_bitswap "$((!bitswap))"
|
||||
|
||||
CONFIGURED=1
|
||||
}
|
||||
|
||||
configure_lines() {
|
||||
config_load dsl
|
||||
config_foreach configure_line dsl-line
|
||||
}
|
||||
|
||||
call_wan_hotplug() {
|
||||
# initializations
|
||||
local updown="$1"
|
||||
local ethwan="$2"
|
||||
|
||||
# ethernet hotlugs expect LINK and PORT environment variables set
|
||||
env -i LINK="$updown" PORT="$ethwan" /sbin/hotplug-call ethernet
|
||||
}
|
||||
|
||||
if [ "$WANPORT" = "ae_wan" -a -f /proc/device-tree/ae_wan/wan-dsl ]; then
|
||||
/etc/init.d/br2684ctl stop
|
||||
else
|
||||
/etc/init.d/br2684ctl start
|
||||
fi
|
||||
|
||||
# Wait for nas0 interface to come up.
|
||||
while [ "$(devstatus "$WANPORT" | jsonfilter -e @.up)" != "true" ]; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
while [ true ]; do
|
||||
LINK="$(awk '/ADSL link status:/{print $4}' /proc/tc3162/adsl_stats)"
|
||||
[ \( "$LINK" = "down" -o "$LINK" = "up" \) ] && break
|
||||
sleep 1
|
||||
done
|
||||
sleep 2
|
||||
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_sysvid "26 00 47 4E 58 53 00 00" # GNXS vendor id
|
||||
/userfs/bin/blapi_cmd xdsl set_adsl_version "$(ubus call fwbank dump | jsonfilter -e "@.bank[@.active=true].swver" | cut -f1 -d'_' | cut -f1 -d'-' | hexdump -e '11/1 "%02x " "\n"' | head -n1)"
|
||||
/userfs/bin/blapi_cmd xdsl set_power_up_down 1
|
||||
/userfs/bin/blapi_cmd xdsl set_power_up_down 0
|
||||
sleep 1
|
||||
|
||||
while [ true ]; do
|
||||
LINK="$(awk '/ADSL link status:/{print $4}' /proc/tc3162/adsl_stats)"
|
||||
|
||||
if [ "$LINK" != "$PREVLINK" -a \( "$LINK" = "down" -o "$LINK" = "up" \) ]; then
|
||||
if [ "$LINK" = "down" ]; then
|
||||
if [ ! -s /tmp/qos/wan_link_shape_rate ]; then
|
||||
rm -rf /tmp/qos/wan_link_shape_rate
|
||||
rm -rf /tmp/qos/wan_link_speed
|
||||
/usr/sbin/qos-uplink-bandwidth
|
||||
fi
|
||||
|
||||
[ "$CONFIGURED" -eq 0 ] && configure_lines # Needs to be done once the slave SoC is in down state and we've not been able to auto-sync.
|
||||
if [ -n "$WANMODE" ]; then
|
||||
if [ "$WANMODE" = "PTM" ]; then
|
||||
/userfs/bin/blapi_cmd xdsl ptm_do_reset_sequence 0 1
|
||||
else
|
||||
delete_atm_devices
|
||||
fi
|
||||
fi
|
||||
|
||||
call_wan_hotplug "down" "$WANPORT"
|
||||
else
|
||||
CONFIGURED=1
|
||||
WANMODE="$(awk '/TPSTC type:/{print $4}' /proc/tc3162/adsl_stats)"
|
||||
if [ "$WANMODE" != "$PREVWANMODE" ]; then
|
||||
OLDWANPORT="$WANPORT"
|
||||
network_defer_device "$OLDWANPORT"
|
||||
|
||||
if [ -f /proc/device-tree/ae_wan/wan-dsl ]; then
|
||||
WANPORT="ae_wan"
|
||||
else
|
||||
WANPORT="nas10"
|
||||
fi
|
||||
|
||||
if [ "$WANMODE" = "PTM" ]; then
|
||||
/etc/init.d/br2684ctl stop
|
||||
delete_atm_devices
|
||||
/userfs/bin/blapi_cmd system set_wan_mode 1
|
||||
/userfs/bin/blapi_cmd xdsl reload_ko 2
|
||||
/userfs/bin/blapi_cmd xdsl ptm_do_reset_sequence 1 2
|
||||
|
||||
# Set extended TPID for PTM packet flow
|
||||
sys memwl 1FB50000 81001839
|
||||
# VLAN TPID - VLAN
|
||||
sys memwl 1FB50F18 8100
|
||||
|
||||
ifconfig ${WANPORT} mtu 1500
|
||||
else
|
||||
/userfs/bin/blapi_cmd system set_wan_mode 0
|
||||
/userfs/bin/blapi_cmd xdsl reload_ko 1
|
||||
/etc/init.d/br2684ctl start
|
||||
|
||||
# Set extended TPID for ATM packet flow
|
||||
sys memwl 1FB50000 884C1839
|
||||
# VLAN TPID - MPOA
|
||||
sys memwl 1FB50F18 884C
|
||||
|
||||
ifconfig ${WANPORT} mtu 1982
|
||||
ifconfig ${WANPORT} down up
|
||||
|
||||
OLDWANPORT="$WANPORT"
|
||||
ATMINDEX="$(cat /sys/class/atm/TSARM*/atmindex | tail -n1 2> /dev/null)"
|
||||
WANPORT="nas$((ATMINDEX))"
|
||||
fi
|
||||
|
||||
if [ "$OLDWANPORT" != "$WANPORT" ]; then
|
||||
call_wan_hotplug "down" "$OLDWANPORT"
|
||||
|
||||
FILES="$(grep "$OLDWANPORT" /etc/config/* | cut -f1 -d: | uniq | cut -f4 -d/ | xargs)"
|
||||
for FILE in $FILES; do
|
||||
sed -i -e "s#${OLDWANPORT}#${WANPORT}#g" "/etc/config/${FILE}"
|
||||
"/etc/init.d/${FILE}" restart
|
||||
done
|
||||
else
|
||||
/etc/init.d/network restart
|
||||
fi
|
||||
ifconfig ${OLDWANPORT} down up
|
||||
fi
|
||||
|
||||
if [ "$WANMODE" = "PTM" ]; then
|
||||
: # ToDo
|
||||
else
|
||||
create_atm_devices
|
||||
fi
|
||||
|
||||
call_wan_hotplug "up" "$WANPORT"
|
||||
PREVWANMODE="$WANMODE"
|
||||
|
||||
if [ ! -s /tmp/qos/wan_link_shape_rate ]; then
|
||||
LINKSPEED="$(awk '/far-end interleaved channel bit rate/{print $6}' /proc/tc3162/adsl_stats)"
|
||||
LINKSPEED=$((LINKSPEED))
|
||||
if [ "$LINKSPEED" -eq 0 ]; then
|
||||
LINKSPEED="$(awk '/far-end fast channel bit rate/{print $6}' /proc/tc3162/adsl_stats)"
|
||||
LINKSPEED=$((LINKSPEED))
|
||||
fi
|
||||
|
||||
if [ "$LINKSPEED" -ne 0 ]; then
|
||||
mkdir -p /tmp/qos
|
||||
touch /tmp/qos/wan_link_shape_rate
|
||||
|
||||
/userfs/bin/qosrule discpline Rate uplink-bandwidth ${LINKSPEED}
|
||||
hw_nat -! > /dev/null 2>&1
|
||||
else
|
||||
rm -rf /tmp/qos/wan_link_speed
|
||||
/usr/sbin/qos-uplink-bandwidth
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Toggle link state
|
||||
network_defer_device "$WANPORT"
|
||||
network_ready_device "$WANPORT"
|
||||
|
||||
# We are only interested in the transtion from init -> up/down and up/down -> down/up and vice versa.
|
||||
# Since we poll the status via in-band signaling packets might get lost and the /procfs file is empty.
|
||||
# This state we don't want to handle as it will toggle the link and do a re-setup which is totally unnecessary and unwanted.
|
||||
PREVLINK="$LINK"
|
||||
fi
|
||||
|
||||
sleep 5
|
||||
done
|
||||
@@ -25,6 +25,7 @@ config dsl-line line
|
||||
list profile 12b
|
||||
list profile 17a
|
||||
list profile 30a
|
||||
list profile 35b
|
||||
option bitswap 1
|
||||
option sra 1
|
||||
option us0 1 # VDSL2 only
|
||||
|
||||
@@ -6,14 +6,14 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ebtables-extensions
|
||||
PKG_VERSION:=2.0.4
|
||||
PKG_VERSION:=2.0.5
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ebtables-extensions.git
|
||||
PKG_SOURCE_VERSION:=9a2af49b455ee25ca0694274e004ced7c09855a0
|
||||
PKG_SOURCE_VERSION:=7357622d806833d93d317164dc6673fbf5fd1629
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -189,9 +189,7 @@ define KernelPackage/ebt-mldsnooping/description
|
||||
Kernel module to enable MLD snooping for ebtables
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
endif
|
||||
-include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
|
||||
define Build/Prepare
|
||||
|
||||
@@ -236,7 +234,6 @@ endif
|
||||
$(CP) $(PKG_BUILD_DIR)/src/ebt_mldsnooping.h $(1)/include/uapi/linux/netfilter_bridge/
|
||||
endef
|
||||
|
||||
KERNEL_MAKE_FLAGS += -I$(LINUX_DIR)/include
|
||||
ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
KERNEL_MAKE_FLAGS += PLATFORM="ECONET"
|
||||
endif
|
||||
|
||||
@@ -9,5 +9,9 @@ config ETHMNGR_MACVLAN_EXTENSION
|
||||
config ETHMNGR_EXPOSE_ETHERNET_OBJECT
|
||||
bool "Expose ethernet ubus object to fetch and clear interface stats"
|
||||
default y
|
||||
|
||||
config ETHMNGR_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=3.0.4
|
||||
PKG_VERSION:=3.1.3
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/ethmngr.git
|
||||
PKG_SOURCE_VERSION:=01e1c5f6642a8fa79fc445c71558ad02bda40eb5
|
||||
PKG_MAINTAINER:=Rahul Thakur <rahul.thakur@iopsys.eu>
|
||||
PKG_SOURCE_VERSION:=7bc8297e1a74adb522f7635bab4f93a1a2620216
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -41,17 +40,25 @@ define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
ifeq ($(CONFIG_ETHMNGR_VENDOR_PREFIX),"")
|
||||
VENDOR_PREFIX = $(CONFIG_BBF_VENDOR_PREFIX)
|
||||
else
|
||||
VENDOR_PREFIX = $(CONFIG_ETHMNGR_VENDOR_PREFIX)
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/ethmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE \
|
||||
-DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
|
||||
ifeq ($(CONFIG_ETHMNGR_MACVLAN_EXTENSION),y)
|
||||
TARGET_CFLAGS += -DETHMNGR_MACVLAN_EXTENSION
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -n "$PORT" -a -n "$LINK" ] || exit 0
|
||||
|
||||
case "$PORT" in
|
||||
# do not generate ethport ubus event
|
||||
# for wifi, dsl and brige devices
|
||||
wl*|wds*|atm*|ptm*|br-*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
speed=0
|
||||
duplex=full
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
devspeed="$(ubus -t 2 call network.device status "{\"name\":\"$PORT\"}" | jsonfilter -e @.speed)"
|
||||
speed=${devspeed:0:-1}
|
||||
duplex=${devspeed:0-1}
|
||||
[ "$duplex" == "H" ] && duplex="half" || duplex="full"
|
||||
fi
|
||||
|
||||
ubus send ethport "{\"ifname\":\"$PORT\",\"link\":\"$LINK\",\"speed\":\"$speed\",\"duplex\":\"$duplex\"}"
|
||||
23
ethmngr/files/etc/ruleng/ethport.json
Normal file
23
ethmngr/files/etc/ruleng/ethport.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"ethport_update": {
|
||||
"if" : [
|
||||
{
|
||||
"event": "network.device",
|
||||
"match": {
|
||||
"wireless": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"then" : [
|
||||
{
|
||||
"cli": "/sbin/hotplug-call ethernet",
|
||||
"envs": {
|
||||
"PORT": "&network.device->ifname",
|
||||
"LINK": "&network.device->link"
|
||||
},
|
||||
"timeout": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
2
ethmngr/files/etc/uci-defaults/ruleng.ethport
Normal file
2
ethmngr/files/etc/uci-defaults/ruleng.ethport
Normal file
@@ -0,0 +1,2 @@
|
||||
uci -q set ruleng.ethport=rule
|
||||
uci -q set ruleng.ethport.recipe='/etc/ruleng/ethport.json'
|
||||
@@ -10,19 +10,14 @@ PKG_NAME:=fdtextract
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/fdtextract.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=e3cefda3b26c9aea3021b20725ce7b31b33eebc4
|
||||
PKG_SOURCE_VERSION:=7917dbcb29724476cd46164eec29848df1e5fb67
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
RSTRIP:=true
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -40,9 +35,7 @@ endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdtextract $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/fdtextract
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=firewallmngr
|
||||
PKG_VERSION:=1.0.9
|
||||
PKG_VERSION:=1.0.12
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/firewallmngr.git
|
||||
PKG_SOURCE_VERSION:=77ad8425b73a3ac63f6160dc217635394ac87907
|
||||
PKG_SOURCE_VERSION:=30319c67fb4db285a2bcd272b1c10bc040eecf19
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -29,7 +29,7 @@ define Package/firewallmngr
|
||||
CATEGORY:=Network
|
||||
TITLE:=Package to add Device.Firewall and Device.NAT. data model support.
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +firewall
|
||||
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:kmod-ipt-trigger +FIREWALLMNGR_PORT_TRIGGER:kmod-ip6t-trigger
|
||||
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:iptables-mod-trigger
|
||||
DEPENDS+=+FIREWALLMNGR_PORT_TRIGGER:iptables-mod-nfqueue
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
endef
|
||||
|
||||
@@ -2,71 +2,40 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.dnat -p info
|
||||
}
|
||||
|
||||
exec_cmd() {
|
||||
if ! eval "$*"; then
|
||||
log "Failed to run [$*]"
|
||||
fi
|
||||
}
|
||||
|
||||
reorder_dnat_rules() {
|
||||
nat_chains=$(iptables -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
|
||||
nat_chains=$(iptables -w -t nat -S | grep -E "^-N zone[a-zA-Z0-9_]+prerouting$" | cut -d' ' -f 2)
|
||||
|
||||
for chain in ${nat_chains}; do
|
||||
# Collect empty remote host & empty dport rules
|
||||
EMPTY_HOST_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
|
||||
if [ -n "${EMPTY_HOST_PORT}" ]; then
|
||||
echo "${EMPTY_HOST_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
EMPTY_HOST_PORT=$(iptables -w -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep -v "\-s ")
|
||||
|
||||
# Collect empty remote host but non empty dport rules
|
||||
EMPTY_HOST=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
|
||||
if [ -n "${EMPTY_HOST}" ]; then
|
||||
echo "${EMPTY_HOST}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
EMPTY_HOST=$(iptables -w -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep "\-\-dport" | grep -v "\-s ")
|
||||
|
||||
# Collect non empty remote host but empty dport rules
|
||||
EMPTY_PORT=$(iptables -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
|
||||
if [ -n "${EMPTY_PORT}" ]; then
|
||||
echo "${EMPTY_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd | sed 's/-A /-D /g')"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
EMPTY_PORT=$(iptables -w -t nat -S ${chain} | grep -E "REDIRECT|DNAT" | grep -v "\-\-dport" | grep "\-s ")
|
||||
|
||||
# Now add rules as per datamodel precedence shown below
|
||||
## Non empty remote host, empty dport
|
||||
## empty remote host, non empty dport
|
||||
## empty remote host, empty dport
|
||||
if [ -n "${EMPTY_PORT}" ]; then
|
||||
echo "${EMPTY_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
# Skip this chain if no matching rules were found
|
||||
[ -n "${EMPTY_HOST_PORT}" -o -n "${EMPTY_HOST}" -o -n "${EMPTY_PORT}" ] || continue
|
||||
|
||||
if [ -n "${EMPTY_HOST}" ]; then
|
||||
echo "${EMPTY_HOST}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
(
|
||||
echo '*nat'
|
||||
|
||||
if [ -n "${EMPTY_HOST_PORT}" ]; then
|
||||
echo "${EMPTY_HOST_PORT}" | while read cmd; do
|
||||
cmd1="iptables -t nat $(echo $cmd)"
|
||||
exec_cmd $cmd1
|
||||
done
|
||||
fi
|
||||
# Delete collected rules
|
||||
[ -n "${EMPTY_HOST_PORT}" ] && echo "${EMPTY_HOST_PORT}" | sed 's/^-A /-D /'
|
||||
[ -n "${EMPTY_HOST}" ] && echo "${EMPTY_HOST}" | sed 's/^-A /-D /'
|
||||
[ -n "${EMPTY_PORT}" ] && echo "${EMPTY_PORT}" | sed 's/^-A /-D /'
|
||||
|
||||
# Now add rules as per datamodel precedence shown below
|
||||
## Non empty remote host, empty dport
|
||||
## empty remote host, non empty dport
|
||||
## empty remote host, empty dport
|
||||
[ -n "${EMPTY_PORT}" ] && echo "${EMPTY_PORT}"
|
||||
[ -n "${EMPTY_HOST}" ] && echo "${EMPTY_HOST}"
|
||||
[ -n "${EMPTY_HOST_PORT}" ] && echo "${EMPTY_HOST_PORT}"
|
||||
|
||||
echo 'COMMIT'
|
||||
) | iptables-restore -w -n
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
ZONE_NAME_FILE="/tmp/service_fw_zone"
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.service -p info
|
||||
}
|
||||
|
||||
exec_cmd() {
|
||||
if ! eval "$*"; then
|
||||
if ! "$@"; then
|
||||
log "Failed to run [$*]"
|
||||
echo "-1"
|
||||
return 0
|
||||
@@ -17,6 +19,37 @@ exec_cmd() {
|
||||
return 0
|
||||
}
|
||||
|
||||
collect_zone_name() {
|
||||
local name network
|
||||
|
||||
config_get name "${1}" name ""
|
||||
if [ -z "${name}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
config_get network "${1}" network ""
|
||||
for i in ${network}; do
|
||||
var="${i}_zone"
|
||||
echo "${var}=${name}" >> "${ZONE_NAME_FILE}"
|
||||
done
|
||||
}
|
||||
|
||||
load_zone_names() {
|
||||
rm -f "${ZONE_NAME_FILE}"
|
||||
config_foreach collect_zone_name zone
|
||||
}
|
||||
|
||||
get_firewall_zone() {
|
||||
if [ ! -f "${ZONE_NAME_FILE}" ]; then
|
||||
echo ""
|
||||
return
|
||||
fi
|
||||
|
||||
var="${1}_zone="
|
||||
name="$(cat ${ZONE_NAME_FILE} | grep ${var} | head -n 1 | cut -d'=' -f 2)"
|
||||
echo "${name}"
|
||||
}
|
||||
|
||||
add_iptable_rule() {
|
||||
chain_name=$1
|
||||
protocol=$2
|
||||
@@ -73,7 +106,7 @@ add_iptable_rule() {
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "iptables ${cmd} -m comment --comment IPtables_service_rule -j ${action}")
|
||||
res=$(exec_cmd iptables -w ${cmd} -m comment --comment IPtables_service_rule -j "${action}")
|
||||
else
|
||||
#Add ipv4 sources if any
|
||||
src_list=""
|
||||
@@ -86,7 +119,7 @@ add_iptable_rule() {
|
||||
|
||||
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}")
|
||||
res=$(exec_cmd iptables -w -s "$src_list" ${cmd} -m comment --comment IPtables_service_rule -j "${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -97,7 +130,7 @@ add_iptable_rule() {
|
||||
fi
|
||||
|
||||
if [ -z "${src_prefix}" ]; then
|
||||
res=$(exec_cmd "ip6tables ${cmd} -m comment --comment IP6tables_service_rule -j ${action}")
|
||||
res=$(exec_cmd ip6tables -w ${cmd} -m comment --comment IP6tables_service_rule -j "${action}")
|
||||
else
|
||||
#Add ipv6 sources if any
|
||||
src_list=""
|
||||
@@ -110,7 +143,7 @@ add_iptable_rule() {
|
||||
|
||||
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}")
|
||||
res=$(exec_cmd ip6tables -w -s "$src_list" ${cmd} -m comment --comment IP6tables_service_rule -j "${action}")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -135,9 +168,14 @@ add_service() {
|
||||
fi
|
||||
|
||||
action=$(echo "${target}" | tr a-z A-Z)
|
||||
chain_name="zone_${interface}_input"
|
||||
res=0
|
||||
zone_name="$(get_firewall_zone ${interface})"
|
||||
if [ -z "${zone_name}" ]; then
|
||||
log "Rule can not be added without zone name for interface ${interface}"
|
||||
return
|
||||
fi
|
||||
|
||||
chain_name="zone_${zone_name}_input"
|
||||
res=0
|
||||
count=$(echo "${proto}" | sed -n "/-1/p" | wc -l)
|
||||
|
||||
if [ "${count}" -eq 0 ]; then
|
||||
@@ -160,4 +198,9 @@ add_service() {
|
||||
}
|
||||
|
||||
config_load firewall
|
||||
|
||||
load_zone_names
|
||||
|
||||
config_foreach add_service "service"
|
||||
|
||||
rm -f "${ZONE_NAME_FILE}"
|
||||
|
||||
@@ -7,7 +7,11 @@ USE_PROCD=1
|
||||
. /lib/port-trigger/port_trigger.sh
|
||||
|
||||
start_service() {
|
||||
port_trigger_handling
|
||||
port_trigger_add
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
port_trigger_clean
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
@@ -17,5 +21,6 @@ service_triggers()
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
@@ -119,18 +119,12 @@ process_port_trigger() {
|
||||
fi
|
||||
}
|
||||
|
||||
port_trigger_handling() {
|
||||
port_trigger_add() {
|
||||
rm /tmp/port_trigger_iptables 2> /dev/null
|
||||
rm /tmp/port_trigger_ip6tables 2> /dev/null
|
||||
touch /tmp/port_trigger_iptables
|
||||
touch /tmp/port_trigger_ip6tables
|
||||
|
||||
echo "iptables -w -t nat -F prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "iptables -w -t filter -F forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "iptables -w -t nat -F prerouting_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "ip6tables -w -t nat -F prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
echo "ip6tables -w -t filter -F forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
|
||||
echo "iptables -w -t nat -N prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t nat -I PREROUTING -j prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
@@ -139,7 +133,7 @@ port_trigger_handling() {
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t filter -I forwarding_wan_rule -j forwarding_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
echo "iptables -w -t nat -N prerouting_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t nat -I prerouting_wan_rule -j prerouting_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t nat -A prerouting_wan_rule -j prerouting_wan_porttrigger 2> /dev/null">>/tmp/port_trigger_iptables
|
||||
|
||||
echo "ip6tables -w -t nat -N prerouting_porttrigger 2> /dev/null">>/tmp/port_trigger_ip6tables
|
||||
ret=$?
|
||||
@@ -155,3 +149,21 @@ port_trigger_handling() {
|
||||
sh /tmp/port_trigger_iptables
|
||||
sh /tmp/port_trigger_ip6tables
|
||||
}
|
||||
|
||||
port_trigger_clean() {
|
||||
iptables -w -t nat -D PREROUTING -j prerouting_porttrigger 2> /dev/null
|
||||
iptables -w -t nat -F prerouting_porttrigger 2> /dev/null
|
||||
iptables -w -t nat -X prerouting_porttrigger 2> /dev/null
|
||||
iptables -w -t nat -D prerouting_wan_rule -j prerouting_wan_porttrigger 2> /dev/null
|
||||
iptables -w -t nat -F prerouting_wan_porttrigger 2> /dev/null
|
||||
iptables -w -t nat -X prerouting_wan_porttrigger 2> /dev/null
|
||||
iptables -w -t filter -D forwarding_wan_rule -j forwarding_wan_porttrigger 2> /dev/null
|
||||
iptables -w -t filter -F forwarding_wan_porttrigger 2> /dev/null
|
||||
iptables -w -t filter -X forwarding_wan_porttrigger 2> /dev/null
|
||||
ip6tables -w -t nat -D PREROUTING -j prerouting_porttrigger 2> /dev/null
|
||||
ip6tables -w -t nat -F prerouting_porttrigger 2> /dev/null
|
||||
ip6tables -w -t nat -X prerouting_porttrigger 2> /dev/null
|
||||
ip6tables -w -t filter -D forwarding_wan_rule -j forwarding_wan_porttrigger 2> /dev/null
|
||||
ip6tables -w -t filter -F forwarding_wan_porttrigger 2> /dev/null
|
||||
ip6tables -w -t filter -X forwarding_wan_porttrigger 2> /dev/null
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
#
|
||||
# Copyright (C) 2024 IOPSYS
|
||||
# Copyright (C) 2024-2025 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fluent-bit
|
||||
PKG_VERSION:=3.1.0
|
||||
PKG_VERSION:=4.0.4
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit.git
|
||||
PKG_SOURCE_VERSION=v$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/fluent/fluent-bit/archive/v$(PKG_VERSION)
|
||||
PKG_HASH:=7a49e110cf3050b6c29c911063494b8081f3c743274d1d95e52562d0476ba1eb
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
@@ -23,7 +25,7 @@ include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/fluent-bit
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:= +libyaml +libopenssl +libcurl +libatomic +musl-fts +flex +bison
|
||||
DEPENDS:= +libyaml +libopenssl +libcurl +libatomic +musl-fts +flex +bison +libstdcpp +@OPENSSL_WITH_NPN
|
||||
TITLE:=Fluent-Bit
|
||||
URL:=https://fluentbit.io/
|
||||
endef
|
||||
@@ -45,13 +47,14 @@ CMAKE_OPTIONS+= \
|
||||
-DFLB_RELEASE=Yes \
|
||||
-DFLB_SMALL=No \
|
||||
-DEXCLUDE_FROM_ALL=true \
|
||||
-DFLB_SHARED_LIBS=Yes \
|
||||
-DFLB_SHARED_LIB=Yes \
|
||||
-DFLB_DEBUG=Yes \
|
||||
-DFLB_ALL=No \
|
||||
-DFLB_JEMALLOC=No \
|
||||
-DFLB_EXAMPLES=No \
|
||||
-DFLB_CHUNK_TRACE=No \
|
||||
-DFLB_BACKTRACE=No \
|
||||
-DFLB_KAFKA=No \
|
||||
-DFLB_WASM=No \
|
||||
-DFLB_LUAJIT=No
|
||||
|
||||
@@ -63,15 +66,15 @@ CMAKE_OPTIONS += \
|
||||
-DFLB_IN_DISK=Yes \
|
||||
-DFLB_IN_EXEC=Yes \
|
||||
-DFLB_IN_HEAD=Yes \
|
||||
-DFLB_IN_KMSG=Yes \
|
||||
-DFLB_IN_TAIL=Yes \
|
||||
-DFLB_IN_FORWARD=No \
|
||||
-DFLB_IN_KMSG=No \
|
||||
-DFLB_IN_PROC=No \
|
||||
-DFLB_IN_RANDOM=No \
|
||||
-DFLB_IN_SERIAL=No \
|
||||
-DFLB_IN_MQTT=No \
|
||||
-DFLB_IN_STDIN=No \
|
||||
-DFLB_IN_SYSTEMD=No \
|
||||
-DFLB_IN_TAIL=No \
|
||||
-DFLB_IN_TCP=No \
|
||||
-DFLB_IN_THERMAL=No \
|
||||
-DFLB_IN_UDP=No \
|
||||
@@ -100,7 +103,7 @@ CMAKE_OPTIONS += \
|
||||
|
||||
|
||||
# Filter options
|
||||
CMAKE_OPTIONS +=
|
||||
CMAKE_OPTIONS += \
|
||||
-DFLB_FILTER_AWS=No \
|
||||
-DFLB_FILTER_ECS=No \
|
||||
-DFLB_FILTER_KUBERNETES=No \
|
||||
@@ -138,6 +141,7 @@ CMAKE_OPTIONS += \
|
||||
-DFLB_OUT_ES=No \
|
||||
-DFLB_OUT_GELF=No \
|
||||
-DFLB_OUT_INFLUXDB=No \
|
||||
-DFLB_OUT_KAFKA=No \
|
||||
-DFLB_OUT_NRLOGS=No \
|
||||
-DFLB_OUT_OPENSEARCH=No \
|
||||
-DFLB_OUT_TD=No \
|
||||
@@ -167,6 +171,7 @@ CMAKE_OPTIONS += \
|
||||
define Package/fluent-bit/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/fluent-bit
|
||||
$(INSTALL_DIR) $(1)/etc/fluent-bit/conf.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/fluent-bit $(1)/usr/sbin/
|
||||
$(INSTALL_DATA) ./files/fluent-bit.conf $(1)/etc/fluent-bit/fluent-bit.conf
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/conf/parsers.conf $(1)/etc/fluent-bit/parsers.conf
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
tag syslog
|
||||
path /dev/log
|
||||
|
||||
[INPUT]
|
||||
name kmsg
|
||||
tag kernel
|
||||
|
||||
[OUTPUT]
|
||||
name null
|
||||
match *
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
diff --git a/plugins/out_file/file.c b/plugins/out_file/file.c
|
||||
index 2e47c9666..95d28e438 100644
|
||||
--- a/plugins/out_file/file.c
|
||||
+++ b/plugins/out_file/file.c
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <msgpack.h>
|
||||
|
||||
#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -55,6 +56,7 @@ struct flb_file_conf {
|
||||
int csv_column_names;
|
||||
int mkdir;
|
||||
struct flb_output_instance *ins;
|
||||
+ char hostname[256];
|
||||
};
|
||||
|
||||
static char *check_delimiter(const char *str)
|
||||
@@ -141,6 +143,9 @@ static int cb_file_init(struct flb_output_instance *ins,
|
||||
}
|
||||
}
|
||||
|
||||
+ if (gethostname(ctx->hostname, sizeof(ctx->hostname)) != 0)
|
||||
+ snprintf(ctx->hostname, sizeof(ctx->hostname), "%s", "localhost");
|
||||
+
|
||||
tmp = flb_output_get_property("delimiter", ins);
|
||||
ret_str = check_delimiter(tmp);
|
||||
if (ret_str != NULL) {
|
||||
@@ -233,12 +238,8 @@ static int template_output_write(struct flb_file_conf *ctx,
|
||||
int i;
|
||||
msgpack_object_kv *kv;
|
||||
|
||||
- /*
|
||||
- * Right now we treat "{time}" specially and fill the placeholder
|
||||
- * with the metadata timestamp (formatted as float).
|
||||
- */
|
||||
- if (!strncmp(key, "time", size)) {
|
||||
- fprintf(fp, "%f", flb_time_to_double(tm));
|
||||
+ if (!strncmp(key, "hostname", size)) {
|
||||
+ fprintf(fp, "%s", ctx->hostname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
27
fluent-bit/patches/0002-file_out_time.patch
Normal file
27
fluent-bit/patches/0002-file_out_time.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
diff --git a/plugins/out_file/file.c b/plugins/out_file/file.c
|
||||
index 77baf6be8..04c519d5a 100644
|
||||
--- a/plugins/out_file/file.c
|
||||
+++ b/plugins/out_file/file.c
|
||||
@@ -238,10 +238,20 @@ static int template_output_write(struct flb_file_conf *ctx,
|
||||
|
||||
/*
|
||||
* Right now we treat "{time}" specially and fill the placeholder
|
||||
- * with the metadata timestamp (formatted as float).
|
||||
+ * with the metadata timestamp.
|
||||
*/
|
||||
if (!strncmp(key, "time", size)) {
|
||||
- fprintf(fp, "%f", flb_time_to_double(tm));
|
||||
+ struct tm tm_local;
|
||||
+ char buf[32];
|
||||
+ if (localtime_r(&tm->tm.tv_sec, &tm_local) == NULL) {
|
||||
+ flb_plg_error(ctx->ins, "localtime_r failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (strftime(buf, sizeof(buf), "%b %d %H:%M:%S", &tm_local) == 0) {
|
||||
+ flb_plg_error(ctx->ins, "strftime failed");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ fputs(buf, fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
diff --git a/plugins/out_syslog/syslog.c b/plugins/out_syslog/syslog.c
|
||||
index 4ecc7c4ac..cfe568245 100644
|
||||
--- a/plugins/out_syslog/syslog.c
|
||||
+++ b/plugins/out_syslog/syslog.c
|
||||
@@ -776,12 +776,42 @@ static flb_sds_t syslog_format(struct flb_syslog *ctx, msgpack_object *o,
|
||||
}
|
||||
|
||||
if (ctx->parsed_mode != FLB_SYSLOG_UDP) {
|
||||
+ unsigned int msg_len = 0;
|
||||
+
|
||||
+ /* Create new SDS for length prefix */
|
||||
+ flb_sds_t prefix = flb_sds_create_size(ctx->maxsize + 32);
|
||||
+ if (!prefix) {
|
||||
+ ret_sds = NULL;
|
||||
+ goto clean;
|
||||
+ }
|
||||
+
|
||||
+ /* Add newline also to make behaviour similar to syslog-ng */
|
||||
tmp = flb_sds_cat(*s, "\n", 1);
|
||||
if (!tmp) {
|
||||
+ flb_sds_destroy(prefix);
|
||||
ret_sds = NULL;
|
||||
goto clean;
|
||||
}
|
||||
*s = tmp;
|
||||
+
|
||||
+ msg_len = flb_sds_len(*s);
|
||||
+ tmp = flb_sds_printf(&prefix, "%u ", msg_len);
|
||||
+ if (!tmp) {
|
||||
+ flb_sds_destroy(prefix);
|
||||
+ ret_sds = NULL;
|
||||
+ goto clean;
|
||||
+ }
|
||||
+ prefix = tmp;
|
||||
+
|
||||
+ tmp = flb_sds_cat(prefix, *s, msg_len);
|
||||
+ if (!tmp) {
|
||||
+ flb_sds_destroy(prefix);
|
||||
+ ret_sds = NULL;
|
||||
+ goto clean;
|
||||
+ }
|
||||
+
|
||||
+ flb_sds_destroy(*s);
|
||||
+ *s = tmp;
|
||||
}
|
||||
}
|
||||
else {
|
||||
73
fluent-bit/patches/0020-fix_kmsg.patch
Normal file
73
fluent-bit/patches/0020-fix_kmsg.patch
Normal file
@@ -0,0 +1,73 @@
|
||||
diff --git a/plugins/in_kmsg/in_kmsg.c b/plugins/in_kmsg/in_kmsg.c
|
||||
index cd5c4cd17..15f105451 100644
|
||||
--- a/plugins/in_kmsg/in_kmsg.c
|
||||
+++ b/plugins/in_kmsg/in_kmsg.c
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <inttypes.h>
|
||||
-#include <time.h>
|
||||
|
||||
#include "in_kmsg.h"
|
||||
|
||||
@@ -123,12 +122,17 @@ static inline int process_line(const char *line,
|
||||
ctx->buffer_id++;
|
||||
|
||||
errno = 0;
|
||||
- val = strtol(p, &end, 10);
|
||||
- if ((errno == ERANGE && (val == INT_MAX || val == INT_MIN))
|
||||
+ val = strtoul(p, &end, 10);
|
||||
+ if ((errno == ERANGE && val == ULONG_MAX)
|
||||
|| (errno != 0 && val == 0)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ /* ensure something was consumed */
|
||||
+ if (end == p) {
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
/* Priority */
|
||||
priority = FLB_KLOG_PRI(val);
|
||||
|
||||
@@ -144,24 +148,35 @@ static inline int process_line(const char *line,
|
||||
}
|
||||
p++;
|
||||
|
||||
- val = strtoul(p, &end, 10);
|
||||
- if ((errno == ERANGE && (val == INT_MAX || val == INT_MIN))
|
||||
+ val = strtoull(p, &end, 10);
|
||||
+ if ((errno == ERANGE && val == ULLONG_MAX)
|
||||
|| (errno != 0 && val == 0)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ /* make sure strtoull consumed something */
|
||||
+ /* after the sequence number, the next char must be ',' */
|
||||
+ if (end == p || *end != ',') {
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
sequence = val;
|
||||
p = ++end;
|
||||
|
||||
/* Timestamp */
|
||||
- val = strtoul(p, &end, 10);
|
||||
- if ((errno == ERANGE && (val == INT_MAX || val == INT_MIN))
|
||||
+ val = strtoull(p, &end, 10);
|
||||
+ if ((errno == ERANGE && val == ULLONG_MAX)
|
||||
|| (errno != 0 && val == 0)) {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
+ /* ensure something was consumed */
|
||||
+ if (end == p) {
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
tv.tv_sec = val/1000000;
|
||||
- tv.tv_usec = val - (tv.tv_sec * 1000000);
|
||||
+ tv.tv_usec = val - ((uint64_t)tv.tv_sec * 1000000);
|
||||
|
||||
flb_time_set(&ts, ctx->boot_time.tv_sec + tv.tv_sec, tv.tv_usec * 1000);
|
||||
|
||||
60
gateway-info/Makefile
Normal file
60
gateway-info/Makefile
Normal file
@@ -0,0 +1,60 @@
|
||||
#
|
||||
# Copyright (C) 2025 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the BSD-3-Clause
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gateway-info
|
||||
PKG_VERSION:=1.0.2
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/gateway-info.git
|
||||
PKG_SOURCE_VERSION:=dd15893a8291e556a8c49ff9e143c763db0379b5
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include ../bbfdm/bbfdm.mk
|
||||
|
||||
define Package/gateway-info
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=GatewayInfo Data Model Support
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +umdns
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service +iputils-arping
|
||||
endef
|
||||
|
||||
define Package/gateway-info/description
|
||||
Package to add Device.GatewayInfo. data model support.
|
||||
endef
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) ~/git/gateway-info/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/gateway-info/install
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/services
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm/micro_services
|
||||
$(INSTALL_DATA) ./files/etc/config/gateway $(1)/etc/config/gateway
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_gateway_info.user $(1)/etc/udhcpc.user.d/udhcpc_gateway_info.user
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/86-set-gateway-device-info $(1)/etc/uci-defaults/
|
||||
$(BBFDM_REGISTER_SERVICES) ./files/bbfdm_service.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/libgwinfo.so $(1) $(PKG_NAME)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,gateway-info))
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"daemon": {
|
||||
"enable": "1",
|
||||
"service_name": "wifidmd",
|
||||
"service_name": "gateway-info",
|
||||
"unified_daemon": false,
|
||||
"services": [
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "WiFi"
|
||||
"object": "GatewayInfo"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
4
gateway-info/files/etc/config/gateway
Normal file
4
gateway-info/files/etc/config/gateway
Normal file
@@ -0,0 +1,4 @@
|
||||
config global 'global'
|
||||
option enable '1'
|
||||
option wan_interface 'wan'
|
||||
option lan_interface 'lan'
|
||||
288
gateway-info/files/etc/uci-defaults/86-set-gateway-device-info
Normal file
288
gateway-info/files/etc/uci-defaults/86-set-gateway-device-info
Normal file
@@ -0,0 +1,288 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
convert_to_hex() {
|
||||
local val=""
|
||||
local optval="${1}"
|
||||
OPTIND=1
|
||||
while getopts ":" opt "-$optval"
|
||||
do
|
||||
temp=$(printf "%02X" "'${OPTARG:-:}")
|
||||
val="${val}:${temp}"
|
||||
done
|
||||
|
||||
echo "${val}"
|
||||
}
|
||||
|
||||
configure_send_op125() {
|
||||
local sendopt="${1}"
|
||||
local intf="${2}"
|
||||
local uci="${3}"
|
||||
local hex_oui=""
|
||||
local hex_serial=""
|
||||
local hex_class=""
|
||||
local oui_len=0
|
||||
local serial_len=0
|
||||
local class_len=0
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
local opt125="125:00:00:0D:E9"
|
||||
else
|
||||
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 ""
|
||||
if [ -z "${oui}" ]; then
|
||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
||||
fi
|
||||
|
||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
||||
|
||||
config_get serial cpe serial_number ""
|
||||
if [ -z "${serial}" ]; then
|
||||
serial=$(db -q get device.deviceinfo.SerialNumber)
|
||||
fi
|
||||
|
||||
config_get class cpe product_class ""
|
||||
if [ -z "${class}" ]; then
|
||||
class=$(db -q get device.deviceinfo.ProductClass)
|
||||
fi
|
||||
|
||||
oui_len=$(echo -n "${oui}" | wc -m)
|
||||
serial_len=$(echo -n "${serial}" | wc -m)
|
||||
class_len=$(echo -n "${class}" | wc -m)
|
||||
|
||||
if [ "${oui_len}" -eq 0 ] || [ "${serial_len}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
opt125_len=$((oui_len + serial_len + class_len))
|
||||
if [ "${class_len}" -gt 0 ]; then
|
||||
opt125_len=$((opt125_len + 6))
|
||||
else
|
||||
opt125_len=$((opt125_len + 4))
|
||||
fi
|
||||
|
||||
hex_opt125_len=$(printf "%02X" "${opt125_len}")
|
||||
opt125="${opt125}:${hex_opt125_len}"
|
||||
hex_oui=$(convert_to_hex "${oui}")
|
||||
if [ -z "${hex_oui}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_oui_len=$(printf "%02X" "${oui_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:01:${hex_oui_len}${hex_oui}"
|
||||
else
|
||||
opt125="${opt125}:04:${hex_oui_len}${hex_oui}"
|
||||
fi
|
||||
|
||||
hex_serial=$(convert_to_hex "${serial}")
|
||||
if [ -z "${hex_serial}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_serial_len=$(printf "%02X" "${serial_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:02:${hex_serial_len}${hex_serial}"
|
||||
else
|
||||
opt125="${opt125}:05:${hex_serial_len}${hex_serial}"
|
||||
fi
|
||||
|
||||
if [ "${class_len}" -gt 0 ]; then
|
||||
hex_class=$(convert_to_hex "${class}")
|
||||
if [ -z "${hex_class}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_class_len=$(printf "%02X" "${class_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:03:${hex_class_len}${hex_class}"
|
||||
else
|
||||
opt125="${opt125}:06:${hex_class_len}${hex_class}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
[ -n "${sendopt}" ] && new_send_opt="$sendopt $opt125" || new_send_opt="$opt125"
|
||||
uci -q set network."${intf}".sendopts="$new_send_opt"
|
||||
else
|
||||
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_dhcp_option125() {
|
||||
local wan="${1}"
|
||||
local reqopts="$(uci -q get network."${wan}".reqopts)"
|
||||
local sendopts="$(uci -q get network."${wan}".sendopts)"
|
||||
local proto="$(uci -q get network."${wan}".proto)"
|
||||
local newreqopts=""
|
||||
local newsendopts=""
|
||||
local req125_present=0
|
||||
local send125_present=0
|
||||
local opt125="125:"
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
[ -n "${reqopts}" ] && newreqopts="$reqopts 125" || newreqopts="125"
|
||||
uci -q set network."${wan}".reqopts="$newreqopts"
|
||||
fi
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
configure_send_op125 "${sendopts}" "${wan}" "network"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dnsmasq_option125() {
|
||||
local lan="${1}"
|
||||
local send125_present=0
|
||||
local opt125="125,"
|
||||
|
||||
local proto="$(uci -q get dhcp."${lan}".dhcpv4)"
|
||||
if [ "${proto}" = "server" ]; then
|
||||
opt_list="$(uci -q get dhcp."${lan}".dhcp_option)"
|
||||
base_opt=""
|
||||
|
||||
for sopt in $opt_list; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=$(check_for_suboptions "${sopt:4}")
|
||||
base_opt="${sopt}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
uci -q del_list dhcp."${lan}".dhcp_option="${base_opt}"
|
||||
configure_send_op125 "${base_opt}" "${lan}" "dhcp"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_gateway_device_info() {
|
||||
wan_intf=""
|
||||
lan_intf=""
|
||||
|
||||
config_load gateway
|
||||
config_get_bool enable global enable '1'
|
||||
config_get wan_intf global wan_interface "wan"
|
||||
config_get lan_intf global lan_interface "lan"
|
||||
|
||||
if [ "${enable}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Set dhcp_option 125 for device info if not already configured
|
||||
enable_dhcp_option125 "${wan_intf}"
|
||||
|
||||
if [ "${wan_intf}" != "${lan_intf}" ]; then
|
||||
# This is extender no need to configure gateway info
|
||||
enable_dnsmasq_option125 "${lan_intf}"
|
||||
fi
|
||||
}
|
||||
|
||||
configure_gateway_device_info
|
||||
362
gateway-info/files/etc/udhcpc.user.d/udhcpc_gateway_info.user
Normal file
362
gateway-info/files/etc/udhcpc.user.d/udhcpc_gateway_info.user
Normal file
@@ -0,0 +1,362 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
CLASS=""
|
||||
OUI=""
|
||||
SERIAL=""
|
||||
GW_DISCOVERED=0
|
||||
_json_no_warning=1
|
||||
|
||||
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
|
||||
"4")
|
||||
OUI=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
GW_DISCOVERED=1
|
||||
;;
|
||||
"5")
|
||||
SERIAL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
GW_DISCOVERED=1
|
||||
;;
|
||||
"6")
|
||||
CLASS=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
GW_DISCOVERED=1
|
||||
;;
|
||||
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
|
||||
}
|
||||
|
||||
send_host_query() {
|
||||
intf="${1}"
|
||||
resp=1
|
||||
loop=3
|
||||
usp_serv_found=0
|
||||
sent_host=" "
|
||||
|
||||
ubus call umdns update
|
||||
while [ "${loop}" -ne 0 ]; do
|
||||
sleep 5
|
||||
|
||||
json_load "$(ubus call umdns browse)"
|
||||
if ! json_select discovered_services; then
|
||||
json_cleanup
|
||||
loop=$(( loop - 1 ))
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! json_select _usp-agt-mqtt._tcp; then
|
||||
json_cleanup
|
||||
loop=$(( loop - 1 ))
|
||||
continue
|
||||
fi
|
||||
|
||||
usp_serv_found=1
|
||||
break
|
||||
done
|
||||
|
||||
if [ "${usp_serv_found}" -eq 0 ]; then
|
||||
echo "${resp}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_get_keys keys
|
||||
for key in $keys; do
|
||||
json_select "${key}"
|
||||
json_get_var _host host ""
|
||||
|
||||
if [ -z "${_host}" ] || [[ "${sent_host}" =~ " ${_host}" ]]; then
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
|
||||
sent_host="${sent_host} ${_host}"
|
||||
cmd="ubus call umdns query '{\"question\":\"$_host\",\"interface\":\"$intf\"}'"
|
||||
sh -c "${cmd}"
|
||||
resp=0
|
||||
json_select ..
|
||||
sleep 2 # umdns query sometime takes time to resolve so adding some sleep
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
echo "${resp}"
|
||||
}
|
||||
|
||||
get_usp_agent_id() {
|
||||
dhcp_ip="${1}"
|
||||
family="ipv4"
|
||||
ID=""
|
||||
|
||||
if [[ "${dhcp_ip}" =~ ":" ]]; then
|
||||
family="ipv6"
|
||||
fi
|
||||
|
||||
json_load "$(ubus call umdns browse)"
|
||||
if ! json_select discovered_services; then
|
||||
json_cleanup
|
||||
echo "${ID}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if ! json_select _usp-agt-mqtt._tcp; then
|
||||
json_cleanup
|
||||
echo "${ID}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_get_keys keys
|
||||
for key in $keys; do
|
||||
json_select "${key}"
|
||||
if ! json_select "${family}"; then
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
|
||||
json_get_keys ips
|
||||
for ip in $ips; do
|
||||
json_get_var ip_val "${ip}"
|
||||
if [ "${ip_val}" != "${dhcp_ip}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
json_select ..
|
||||
json_select txt
|
||||
json_get_keys txts
|
||||
for _txt in $txts; do
|
||||
json_get_var text_val "${_txt}"
|
||||
if [[ "${text_val:0:3}" = "ID=" ]]; then
|
||||
ID="${text_val:3}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
break
|
||||
done
|
||||
|
||||
json_select ..
|
||||
json_select ..
|
||||
|
||||
if [ -n "${ID}" ]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
echo "${ID}"
|
||||
}
|
||||
|
||||
get_mac_address() {
|
||||
ip="${1}"
|
||||
device="${2}"
|
||||
|
||||
mac=$(grep "${ip}" /proc/net/arp | awk '{print $4}')
|
||||
if [ -z "${mac}" ]; then
|
||||
arp_resp=$(arping -b -f -c 5 -I "${device}" "${ip}" | grep 'Unicast reply from' | awk '{print $5}')
|
||||
if [ -n "${arp_resp}" ]; then
|
||||
mac=${arp_resp:1:-1}
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${mac}"
|
||||
}
|
||||
|
||||
send_unknown_gw_event() {
|
||||
mac="${1}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.unknown '{\"hwaddr\":\"$mac\"}'"
|
||||
sh -c "${cmd}"
|
||||
}
|
||||
|
||||
send_cwmp_gw_event() {
|
||||
oui="${1}"
|
||||
class="${2}"
|
||||
serial="${3}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.cwmp '{\"oui\":\"$oui\",\"class\":\"$class\",\"serial\":\"$serial\"}'"
|
||||
sh -c "${cmd}"
|
||||
}
|
||||
|
||||
send_usp_gw_event() {
|
||||
endpoint="${1}"
|
||||
|
||||
cmd="ubus -t 5 send gateway-info.gateway.usp '{\"endpoint\":\"$endpoint\"}'"
|
||||
sh -c "${cmd}"
|
||||
}
|
||||
|
||||
config_load gateway
|
||||
config_get_bool enable global enable '1'
|
||||
config_get wan_intf global wan_interface "wan"
|
||||
|
||||
if [ "${enable}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
if [ "${1}" = "deconfig" ]; then
|
||||
rm -rf /var/state/gwinfo
|
||||
return 0
|
||||
fi
|
||||
|
||||
json_load "$(ifstatus "${INTERFACE}")"
|
||||
json_get_var dev_name device ""
|
||||
json_select data
|
||||
json_get_var dhcp_ip dhcpserver ""
|
||||
json_cleanup
|
||||
|
||||
if [ -z "${dhcp_ip}" ] || [ -z "${dev_name}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
MAC=$(get_mac_address "${dhcp_ip}" "${dev_name}")
|
||||
|
||||
mkdir -p /var/state
|
||||
touch /var/state/gwinfo
|
||||
sec=$(uci -q -c /var/state get gwinfo.gatewayinfo)
|
||||
if [ -z "${sec}" ]; then
|
||||
sec=$(uci -q -c /var/state add gwinfo gatewayinfo)
|
||||
uci -q -c /var/state rename gwinfo."${sec}"="gatewayinfo"
|
||||
fi
|
||||
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.hwaddr="$MAC"
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.endpoint=""
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.class=""
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.oui=""
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.serial=""
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.proto=""
|
||||
uci -q -c /var/state commit gwinfo
|
||||
|
||||
if [ -z "$opt125" ]; then
|
||||
send_unknown_gw_event "${MAC}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
len=$(echo -n "${opt125}" | wc -c)
|
||||
get_vivsoi "${opt125}" "${len}"
|
||||
|
||||
if [ "${GW_DISCOVERED}" -eq 0 ]; then
|
||||
send_unknown_gw_event "${MAC}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.class="$CLASS"
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.oui="$OUI"
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.serial="$SERIAL"
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.proto="CWMP"
|
||||
uci -q -c /var/state commit gwinfo
|
||||
|
||||
# Check for USP parameters
|
||||
if ! ubus -t 15 wait_for umdns; then
|
||||
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
resp=$(send_host_query "${dev_name}")
|
||||
if [ "${resp}" -ne 0 ]; then
|
||||
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
ID=$(get_usp_agent_id "${dhcp_ip}")
|
||||
if [ -z "${ID}" ]; then
|
||||
send_cwmp_gw_event "${OUI}" "${CLASS}" "${SERIAL}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.endpoint="$ID"
|
||||
uci -q -c /var/state set gwinfo.gatewayinfo.proto="USP"
|
||||
uci -q -c /var/state commit gwinfo
|
||||
|
||||
send_usp_gw_event "${ID}"
|
||||
fi
|
||||
@@ -18,7 +18,8 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=gryphon-led-kernel-module
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -26,41 +27,18 @@ define KernelPackage/$(PKG_NAME)
|
||||
SUBMENU:=LED modules
|
||||
TITLE:=LED driver for Gryphon
|
||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||
DEPENDS:= +(TARGET_brcmbca):bcm963xx-bsp
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
|
||||
define KernelPackage/$(PKG_NAME)/description
|
||||
This package contains the LED driver for Gryphon devices.
|
||||
endef
|
||||
|
||||
EXTRA_KCONFIG:= CONFIG_RGB_LED=m
|
||||
|
||||
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
|
||||
# support compilation against BCM SDK kernel
|
||||
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) src/* $(PKG_BUILD_DIR)
|
||||
endef
|
||||
-include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) -C "$(LINUX_DIR)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
SUBDIRS="$(PKG_BUILD_DIR)" \
|
||||
EXTRA_CFLAGS="-DKERNEL_MODULE $(BUILDFLAGS) -I$(LINUX_DIR)/include -include generated/autoconf.h $(MODULE_INCLUDE)" \
|
||||
modules
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
#include "sk9822.h"
|
||||
|
||||
@@ -46,11 +47,6 @@ static ssize_t get_led_color(struct device *dev,
|
||||
int len;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
@@ -73,11 +69,6 @@ static ssize_t set_led_color(struct device *dev,
|
||||
size_t buflen = count;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* strip newline */
|
||||
if ((count > 0) && (buf[count-1] == '\n')) {
|
||||
buflen--;
|
||||
@@ -111,11 +102,6 @@ static ssize_t get_led_brightness(struct device *dev,
|
||||
int len;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%x\n", sk9822->led_brightness);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
@@ -138,11 +124,6 @@ static ssize_t set_led_brightness(struct device *dev,
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
unsigned long val = SK9822_DEFAULT_BRIGHTNESS;
|
||||
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (kstrtoul(buf, 16, &val)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -209,49 +190,33 @@ static int canyon_led_probe(struct platform_device *pdev)
|
||||
|
||||
platform_set_drvdata(pdev, leds);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
|
||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
leds->clock_gpio = gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
|
||||
#else
|
||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||
exit(1);
|
||||
#endif
|
||||
leds->clock_gpio = devm_gpiod_get_index(&pdev->dev, "led", 0, GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(leds->clock_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
|
||||
PTR_ERR(leds->clock_gpio));
|
||||
return PTR_ERR(leds->clock_gpio);
|
||||
}
|
||||
|
||||
gpiod_direction_output(leds->clock_gpio, 1);
|
||||
if (IS_ERR(leds->clock_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire clock GPIO %ld\n",
|
||||
PTR_ERR(leds->clock_gpio));
|
||||
return PTR_ERR(leds->clock_gpio);
|
||||
ret = gpiod_direction_output(leds->clock_gpio, 1);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to set clock GPIO output %d\n", ret);
|
||||
return ret;
|
||||
} else {
|
||||
printk(KERN_INFO "Got clock gpio\n");
|
||||
gpiod_set_value(leds->clock_gpio, 0);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
|
||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1);
|
||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
|
||||
leds->data_gpio = gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
|
||||
#else
|
||||
dev_warn(&pdev->dev, "Kernel version Not supported\n");
|
||||
exit(1);
|
||||
#endif
|
||||
leds->data_gpio = devm_gpiod_get_index(&pdev->dev, "led", 1, GPIOD_OUT_HIGH);
|
||||
if (IS_ERR(leds->data_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
|
||||
PTR_ERR(leds->data_gpio));
|
||||
return PTR_ERR(leds->data_gpio);
|
||||
}
|
||||
|
||||
gpiod_direction_output(leds->data_gpio, 1);
|
||||
if (IS_ERR(leds->data_gpio)) {
|
||||
dev_err(&pdev->dev, "Failed to acquire data GPIO %ld\n",
|
||||
PTR_ERR(leds->data_gpio));
|
||||
return PTR_ERR(leds->data_gpio);
|
||||
ret = gpiod_direction_output(leds->data_gpio, 1);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Failed to set data GPIO output %d\n", ret);
|
||||
return ret;
|
||||
} else {
|
||||
printk(KERN_INFO "Got data gpio\n");
|
||||
gpiod_set_value(leds->data_gpio, 0);
|
||||
@@ -264,45 +229,31 @@ static int canyon_led_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if 0
|
||||
printk(KERN_INFO "Flash LEDs to verify they work\n");
|
||||
sk9822_set_color_str(leds, "00FF00");
|
||||
sk9822_update(leds);
|
||||
msleep(200);
|
||||
sk9822_set_color_str(leds, "000000");
|
||||
sk9822_update(leds);
|
||||
#endif
|
||||
|
||||
printk(KERN_INFO "canyon led successfully probed\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void canyon_led_off(struct sk9822_leds *leds)
|
||||
{
|
||||
leds->led_brightness = 0;
|
||||
memset(leds->led_colors, 0, sizeof(cRGB) * leds->led_count);
|
||||
sk9822_update(leds);
|
||||
}
|
||||
|
||||
static int canyon_led_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sk9822_leds *leds;
|
||||
|
||||
sysfs_remove_group(&pdev->dev.kobj, &sk9822_dev_attr_group);
|
||||
|
||||
leds = platform_get_drvdata(pdev);
|
||||
if (IS_ERR(leds)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (leds->clock_gpio) {
|
||||
gpiod_put(leds->clock_gpio);
|
||||
}
|
||||
|
||||
if (leds->data_gpio) {
|
||||
gpiod_put(leds->data_gpio);
|
||||
}
|
||||
|
||||
printk(KERN_NOTICE "Bye, bye\n");
|
||||
canyon_led_off(platform_get_drvdata(pdev));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void canyon_led_shutdown(struct platform_device *pdev)
|
||||
{
|
||||
canyon_led_off(platform_get_drvdata(pdev));
|
||||
}
|
||||
|
||||
/**
|
||||
* platform driver metadata
|
||||
*/
|
||||
@@ -315,6 +266,7 @@ static const struct of_device_id canyon_led_of_ids[] = {
|
||||
static struct platform_driver canyon_led = {
|
||||
.probe = &canyon_led_probe,
|
||||
.remove = &canyon_led_remove,
|
||||
.shutdown = &canyon_led_shutdown,
|
||||
.driver = {
|
||||
.name = DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostmngr
|
||||
PKG_VERSION:=1.2.14
|
||||
PKG_VERSION:=1.4.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=6ea9fdb38a8e067b850841d6e7f7266bf76c363a
|
||||
PKG_SOURCE_VERSION:=ac50f621e19f74b7af4e4b8c1e810503507cc3dd
|
||||
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
|
||||
@@ -77,7 +77,7 @@ define Package/hostmngr/install
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostmngr.so $(1) $(PKG_NAME)
|
||||
|
||||
ifeq ($(CONFIG_HOSTMNGR_DATAMODEL_EXT),y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostext.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/src/bbf_plugin/libhostext.so $(1) $(PKG_NAME) 10
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
@@ -271,14 +271,14 @@ touch $ACL_FILE
|
||||
echo "iptables -w -F hosts_forward" >> $ACL_FILE
|
||||
echo "ip6tables -w -F hosts_forward" >> $ACL_FILE
|
||||
|
||||
hosts_ipv4_forward=$(iptables -t filter --list -n | grep hosts_forward)
|
||||
hosts_ipv4_forward=$(iptables -w -t filter --list -n | grep hosts_forward)
|
||||
if [ -z "$hosts_ipv4_forward" ]; then
|
||||
echo "iptables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
ret=$?
|
||||
[ $ret -eq 0 ] && echo "iptables -w -t filter -I FORWARD -j hosts_forward" >> $ACL_FILE
|
||||
fi
|
||||
|
||||
hosts_ipv6_forward=$(ip6tables -t filter --list -n | grep hosts_forward)
|
||||
hosts_ipv6_forward=$(ip6tables -w -t filter --list -n | grep hosts_forward)
|
||||
if [ -z "$hosts_ipv6_forward" ]; then
|
||||
echo "ip6tables -w -t filter -N hosts_forward" >> $ACL_FILE
|
||||
ret=$?
|
||||
|
||||
@@ -7,4 +7,16 @@ config ICWMP_MGMT_FROM_USP
|
||||
config ICWMP_BACKUP_EVENTS
|
||||
bool "Create backup of session events to persistent storage after each successful session"
|
||||
default y
|
||||
|
||||
config ICWMP_ENABLE_VENDOR_EXTN
|
||||
bool "Enable datamodel vendor extension"
|
||||
default y
|
||||
|
||||
config ICWMP_VENDOR_PREFIX
|
||||
string "Package specific datamodel Vendor Prefix for TR181 extensions"
|
||||
default ""
|
||||
|
||||
config ICWMP_ENABLE_SMM_SUPPORT
|
||||
bool "Enable software module management support"
|
||||
default n
|
||||
endmenu
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-2025 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the BSD-3-Clause
|
||||
# See /LICENSE for more information.
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=9.8.27
|
||||
PKG_VERSION:=9.10.10
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bbf/icwmp.git
|
||||
PKG_SOURCE_VERSION:=868abeb86c2974b3647c7f66e085808c0f296721
|
||||
PKG_SOURCE_VERSION:=63251b6c9789b1428604af0a5c1d23d32d14a8b8
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -52,6 +52,21 @@ ifeq ($(CONFIG_ICWMP_BACKUP_EVENTS),y)
|
||||
EXTRA_CFLAGS += -DPERSIST_BACKUP_SESSION_EVENTS
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ICWMP_ENABLE_VENDOR_EXTN),y)
|
||||
EXTRA_CFLAGS += -DICWMP_ENABLE_VENDOR_EXTN
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ICWMP_ENABLE_SMM_SUPPORT),y)
|
||||
EXTRA_CFLAGS += -DICWMP_ENABLE_SMM_SUPPORT
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ICWMP_VENDOR_PREFIX),"")
|
||||
CMAKE_OPTIONS += -DBBF_VENDOR_PREFIX:String="$(CONFIG_BBF_VENDOR_PREFIX)"
|
||||
else
|
||||
CMAKE_OPTIONS += -DBBF_VENDOR_PREFIX:String="$(CONFIG_ICWMP_VENDOR_PREFIX)"
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/icwmp/* $(PKG_BUILD_DIR)/
|
||||
@@ -69,17 +84,19 @@ define Package/icwmp/install
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/50-cwmp-align-keep-config $(1)/etc/uci-defaults/
|
||||
$(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_BIN) ./files/etc/uci-defaults/85-migrate-gw-info $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/999-cwmp-conn-config $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/vendor_log.sh $(1)/etc/icwmpd/vendor_log.sh
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/firewall.cwmp $(1)/etc/icwmpd/firewall.cwmp
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt125.user
|
||||
$(INSTALL_BIN) ./files/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user $(1)/etc/udhcpc.user.d/udhcpc_icwmp_opt43.user
|
||||
$(BBFDM_REGISTER_SERVICES) ./bbfdm_service.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_DM) $(PKG_BUILD_DIR)/libcwmpdm.so $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1) $(PKG_NAME)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) ./files/etc/bbfdm/json/CWMPManagementServer.json $(1) $(PKG_NAME) 20
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,icwmp))
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
},
|
||||
{
|
||||
"parent_dm": "Device.",
|
||||
"object": "XMPP"
|
||||
"object": "XMPP",
|
||||
"proto": "cwmp"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
config acs 'acs'
|
||||
option userid '' #$OUI-$SER
|
||||
option passwd 'iopsys'
|
||||
option passwd ''
|
||||
option periodic_inform_enable 'true'
|
||||
option periodic_inform_interval '1800'
|
||||
option periodic_inform_time '0001-01-01T00:00:00Z'
|
||||
@@ -13,21 +13,24 @@ config acs 'acs'
|
||||
# possible configs interval :[1000:65535]
|
||||
option retry_interval_multiplier '2000'
|
||||
option skip_dhcp_boot_options '0'
|
||||
option insecure_enable '0'
|
||||
option get_rpc_methods '0'
|
||||
|
||||
config cpe 'cpe'
|
||||
option enable '1'
|
||||
option default_wan_interface 'wan'
|
||||
option default_lan_interface 'lan'
|
||||
#option client_cert_path '/etc/icwmpd/client.pem'
|
||||
#option client_key_path '/etc/icwmpd/client.key'
|
||||
option log_to_console 'disable'
|
||||
option log_to_file 'disable'
|
||||
# log_severity: INFO (Default)
|
||||
# log_severity possible configs: EMERG, ALERT, CRITIC ,ERROR, WARNING, NOTICE, INFO, DEBUG
|
||||
option log_severity 'ERROR'
|
||||
option log_severity 'WARNING'
|
||||
option log_file_name '/var/log/icwmpd.log'
|
||||
option log_max_size '102400'
|
||||
option bind_retries '5'
|
||||
option userid '' #$OUI-$SER
|
||||
option passwd 'iopsys'
|
||||
option port '7547'
|
||||
option passwd ''
|
||||
option provisioning_code ''
|
||||
option amd_version '5'
|
||||
# compression possible configs: InstanceNumber, InstanceAlias
|
||||
@@ -39,9 +42,12 @@ 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'
|
||||
#option KeepConfig '1'
|
||||
#option KeepOpConf '1'
|
||||
#option ConfigScope 'UserOnly'
|
||||
option clock_sync_timeout '128'
|
||||
option disable_datatype_check '0'
|
||||
#list allowed_cr_ip '10.5.1.0/24'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '0'
|
||||
|
||||
@@ -1,24 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
ZONE_NAME_FILE="/tmp/cwmp_fw_zone"
|
||||
|
||||
#created by the icwmp package
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.cwmp -p info
|
||||
}
|
||||
|
||||
get_firewall_zone() {
|
||||
zone="$(uci show firewall|grep network|grep -w ${1}|cut -d. -f 2)"
|
||||
zone="${zone:-wan}" # defaults to wan zone
|
||||
echo "$zone"
|
||||
collect_zone_name() {
|
||||
local name network
|
||||
|
||||
config_get name "${1}" name ""
|
||||
if [ -z "${name}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
config_get network "${1}" network ""
|
||||
for i in ${network}; do
|
||||
var="${i}_zone"
|
||||
echo "${var}=${name}" >> "${ZONE_NAME_FILE}"
|
||||
done
|
||||
}
|
||||
|
||||
cleanup_exiting_rules() {
|
||||
while iptables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Open_ACS_port"; do
|
||||
load_zone_names() {
|
||||
rm -f "${ZONE_NAME_FILE}"
|
||||
config_load firewall
|
||||
config_foreach collect_zone_name zone
|
||||
}
|
||||
|
||||
get_firewall_zone() {
|
||||
if [ ! -f "${ZONE_NAME_FILE}" ]; then
|
||||
echo ""
|
||||
return
|
||||
fi
|
||||
|
||||
var="${1}_zone="
|
||||
name="$(cat ${ZONE_NAME_FILE} | grep ${var} | head -n 1 | cut -d'=' -f 2)"
|
||||
echo "${name}"
|
||||
}
|
||||
|
||||
cleanup_upstream_rules() {
|
||||
if [ -z "${1}" ]; then
|
||||
log "Rule can not be cleaned without zone name"
|
||||
return
|
||||
fi
|
||||
|
||||
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
|
||||
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}";
|
||||
@@ -26,76 +61,196 @@ cleanup_exiting_rules() {
|
||||
done
|
||||
}
|
||||
|
||||
enable="$(uci -q get cwmp.cpe.enable)"
|
||||
enable="${enable:-1}"
|
||||
|
||||
if [ "$enable" -eq 0 ]; then
|
||||
log "CWMP not enabled"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
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)
|
||||
|
||||
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 [ "${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
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
cmd6="${cmd6} --dport ${port}"
|
||||
fi
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
cleanup_downstream_rules() {
|
||||
if [ -z "${1}" ]; then
|
||||
log "Rule can not be cleaned without zone name"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -n "${ip6addr}" ]; then
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
while iptables -w 1 -nL zone_"${1}"_input --line-numbers 2>/dev/null | grep "Close_ACS_port"; do
|
||||
rule_num="$(iptables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Close_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 "Close_ACS_port"; do
|
||||
rule_num="$(ip6tables -w 1 -nL zone_"${1}"_input --line-numbers | grep "Close_ACS_port" | head -1|awk '{print $1}')"
|
||||
if [ -n "${rule_num}" ]; then
|
||||
ip6tables -w 1 -D zone_"${1}"_input "${rule_num}";
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
close_downstream_acs_port() {
|
||||
lan="${1}"
|
||||
port="${2}"
|
||||
zone_name="$(get_firewall_zone $lan)"
|
||||
|
||||
if [ -z "${zone_name}" ]; then
|
||||
log "Rule can not be added without zone name"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
cmd6="${cmd6} --dport ${port}"
|
||||
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="iptables -w 1 -I zone_${zone_name}_input -p tcp --dport ${port} -j DROP -m comment --comment=Close_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
|
||||
cmd="ip6tables -w 1 -I zone_${zone_name}_input -p tcp --dport ${port} -j DROP -m comment --comment=Close_ACS_port"
|
||||
${cmd}
|
||||
log "Applied [${cmd}]"
|
||||
}
|
||||
|
||||
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
|
||||
add_firewall_rule() {
|
||||
version="${1}"
|
||||
ipaddr="${2}"
|
||||
port="${3}"
|
||||
zone_name="${4}"
|
||||
cmd=""
|
||||
|
||||
if [ -z "${zone_name}" ]; then
|
||||
log "Rule can not be added without zone name"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "${version}" = "ipv6" ]; then
|
||||
cmd="ip6tables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
else
|
||||
cmd="iptables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
fi
|
||||
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
fi
|
||||
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
fi
|
||||
|
||||
if echo "${cmd}"|grep -q "\-\-dport \|\-s "; then
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd}
|
||||
log "Applied [${cmd}]"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_port_protection() {
|
||||
local enabled chain rule rule_num
|
||||
|
||||
config_get enabled "${1}" "${2}"
|
||||
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
config_get zonename "$1" name
|
||||
[ -n "$zonename" ] || return 0
|
||||
|
||||
chain='prerouting_'$zonename'_rule'
|
||||
|
||||
while rule=$(iptables -w -t nat -nL "$chain" --line-numbers | grep -m 1 -w CWMP_Port_protection); do
|
||||
rule_num=${rule%%[$' \t']*}
|
||||
iptables -w -t nat -D "$chain" "$rule_num"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
cleanup_port_protection() {
|
||||
config_load firewall
|
||||
config_foreach remove_port_protection zone masq
|
||||
}
|
||||
|
||||
install_port_protection() {
|
||||
local PORT="${3}"
|
||||
local enabled zonename chain
|
||||
|
||||
config_get enabled "${1}" "${2}"
|
||||
|
||||
if [ "${enabled}" -eq 1 ]; then
|
||||
config_get zonename "${1}" name
|
||||
[ -n "$zonename" ] || return 0
|
||||
|
||||
chain='prerouting_'$zonename'_rule'
|
||||
|
||||
iptables -w -t nat -I "$chain" -p tcp --dport "$PORT" -j ACCEPT -m comment --comment=CWMP_Port_protection
|
||||
iptables -w -t nat -I "$chain" -p udp --dport "$PORT" -j ACCEPT -m comment --comment=CWMP_Port_protection
|
||||
fi
|
||||
}
|
||||
|
||||
add_port_protection() {
|
||||
config_load firewall
|
||||
config_foreach install_port_protection zone masq "${1}"
|
||||
}
|
||||
|
||||
configure_connection_req_rules() {
|
||||
app="${1}"
|
||||
|
||||
cleanup_port_protection
|
||||
|
||||
wan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
||||
wan="${wan:-wan}"
|
||||
|
||||
wan_zone_name="$(get_firewall_zone $wan)"
|
||||
|
||||
cleanup_upstream_rules "${wan_zone_name}"
|
||||
|
||||
lan="$(uci -q get cwmp.cpe.default_lan_interface)"
|
||||
lan="${lan:-lan}"
|
||||
|
||||
if [ "${lan}" != "${wan}" ]; then
|
||||
lan_zone_name="$(get_firewall_zone $lan)"
|
||||
cleanup_downstream_rules "${lan_zone_name}"
|
||||
fi
|
||||
|
||||
enable="$(uci -q get cwmp.cpe.enable)"
|
||||
enable="${enable:-1}"
|
||||
|
||||
if [ "$enable" -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
url="$(uci -q get cwmp.acs.url)"
|
||||
if [ -z "${url}" ]; then
|
||||
url="$(uci -q get cwmp.acs.dhcp_url)"
|
||||
fi
|
||||
|
||||
# no need to apply firewall rule, acs url not configured
|
||||
if [ -z "${url}" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${app}" ]; then
|
||||
if ! ubus -t 1 list tr069 2>/dev/null; then
|
||||
log "cwmp client not running"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
port=$(uci -q -c /var/state get icwmp.cpe.port)
|
||||
if [ -z "${port}" ]; then
|
||||
log "cwmp cpe port not configured"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ipaddr=$(uci -q get cwmp.cpe.allowed_cr_ip)
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
for ip in $ipaddr; do
|
||||
if echo "${ip}" | grep -q ":"; then
|
||||
add_firewall_rule "ipv6" "${ip}" "${port}" "${wan_zone_name}"
|
||||
else
|
||||
add_firewall_rule "ipv4" "${ip}" "${port}" "${wan_zone_name}"
|
||||
fi
|
||||
done
|
||||
else
|
||||
# Port-only
|
||||
add_firewall_rule "ipv6" "" "${port}" "${wan_zone_name}"
|
||||
add_firewall_rule "ipv4" "" "${port}" "${wan_zone_name}"
|
||||
fi
|
||||
|
||||
if [ "${lan}" != "${wan}" ]; then
|
||||
# Close the ACS port at Lan side
|
||||
close_downstream_acs_port "${lan}" "${port}"
|
||||
fi
|
||||
|
||||
add_port_protection "${port}"
|
||||
}
|
||||
|
||||
load_zone_names
|
||||
configure_connection_req_rules "$@"
|
||||
rm -f "${ZONE_NAME_FILE}"
|
||||
|
||||
@@ -16,349 +16,6 @@ log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
regenerate_ssl_link() {
|
||||
local cert_dir
|
||||
|
||||
cert_dir="${1%/}"
|
||||
if [ -f "${cert_dir}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do not generate the c_rehash if its system default cert path
|
||||
# ca-certificate package already generates c_rehash on compilation
|
||||
[ ! -d "${cert_dir}" ] || [ "${cert_dir}" = "/etc/ssl/certs" ] && return 0
|
||||
|
||||
generate_links() {
|
||||
local file_type="$1"
|
||||
local files="${cert_dir}"/*."${file_type}"
|
||||
for cfile in ${files}; do
|
||||
if [ -f "${cfile}" ]; then
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
if [ ! -f "${cert_dir}/${rehash}.0" ]; then
|
||||
log "Generating c_rehash for ${cfile}=>${rehash}.0"
|
||||
ln -s "${cfile}" "${cert_dir}/${rehash}.0"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
generate_links "pem"
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
local wan="${1}"
|
||||
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local reqopts="$(uci -q get network."${wan}".reqopts)"
|
||||
local proto="$(uci -q get network."${wan}".proto)"
|
||||
local newreqopts=""
|
||||
local option43_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) option43_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${option43_present} -eq 1 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
newreqopts="$reqopts 43"
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
uci -q set network."${wan}".reqopts="$newreqopts"
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
fi
|
||||
}
|
||||
|
||||
convert_to_hex() {
|
||||
local val=""
|
||||
local optval="${1}"
|
||||
OPTIND=1
|
||||
while getopts ":" opt "-$optval"
|
||||
do
|
||||
temp=$(printf "%02X" "'${OPTARG:-:}")
|
||||
val="${val}:${temp}"
|
||||
done
|
||||
|
||||
echo "${val}"
|
||||
}
|
||||
|
||||
configure_send_op125() {
|
||||
local sendopt="${1}"
|
||||
local intf="${2}"
|
||||
local uci="${3}"
|
||||
local hex_oui=""
|
||||
local hex_serial=""
|
||||
local hex_class=""
|
||||
local oui_len=0
|
||||
local serial_len=0
|
||||
local class_len=0
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
local opt125="125:00:00:0D:E9"
|
||||
else
|
||||
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 ""
|
||||
if [ -z "${oui}" ]; then
|
||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
||||
fi
|
||||
|
||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
||||
|
||||
config_get serial cpe serial_number ""
|
||||
if [ -z "${serial}" ]; then
|
||||
serial=$(db -q get device.deviceinfo.SerialNumber)
|
||||
fi
|
||||
|
||||
config_get class cpe product_class ""
|
||||
if [ -z "${class}" ]; then
|
||||
class=$(db -q get device.deviceinfo.ProductClass)
|
||||
fi
|
||||
|
||||
oui_len=$(echo -n "${oui}" | wc -m)
|
||||
serial_len=$(echo -n "${serial}" | wc -m)
|
||||
class_len=$(echo -n "${class}" | wc -m)
|
||||
|
||||
if [ "${oui_len}" -eq 0 ] || [ "${serial_len}" -eq 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
opt125_len=$((oui_len + serial_len + class_len))
|
||||
if [ "${class_len}" -gt 0 ]; then
|
||||
opt125_len=$((opt125_len + 6))
|
||||
else
|
||||
opt125_len=$((opt125_len + 4))
|
||||
fi
|
||||
|
||||
hex_opt125_len=$(printf "%02X" "${opt125_len}")
|
||||
opt125="${opt125}:${hex_opt125_len}"
|
||||
hex_oui=$(convert_to_hex "${oui}")
|
||||
if [ -z "${hex_oui}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_oui_len=$(printf "%02X" "${oui_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:01:${hex_oui_len}${hex_oui}"
|
||||
else
|
||||
opt125="${opt125}:04:${hex_oui_len}${hex_oui}"
|
||||
fi
|
||||
|
||||
hex_serial=$(convert_to_hex "${serial}")
|
||||
if [ -z "${hex_serial}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_serial_len=$(printf "%02X" "${serial_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:02:${hex_serial_len}${hex_serial}"
|
||||
else
|
||||
opt125="${opt125}:05:${hex_serial_len}${hex_serial}"
|
||||
fi
|
||||
|
||||
if [ "${class_len}" -gt 0 ]; then
|
||||
hex_class=$(convert_to_hex "${class}")
|
||||
if [ -z "${hex_class}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
hex_class_len=$(printf "%02X" "${class_len}")
|
||||
if [ "${uci}" = "network" ]; then
|
||||
opt125="${opt125}:03:${hex_class_len}${hex_class}"
|
||||
else
|
||||
opt125="${opt125}:06:${hex_class_len}${hex_class}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "${uci}" = "network" ]; then
|
||||
new_send_opt="$sendopt $opt125"
|
||||
uci -q set network."${intf}".sendopts="$new_send_opt"
|
||||
else
|
||||
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
|
||||
local opt125="125,"
|
||||
|
||||
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=$(check_for_suboptions "${sopt:4}")
|
||||
base_opt="${sopt}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
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
|
||||
}
|
||||
|
||||
set_vendor_id() {
|
||||
local wan="${1}"
|
||||
local proto="$(uci -q get network."${wan}".proto)"
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
vendorid="$(uci -q get network."${wan}".vendorid)"
|
||||
if [ -z "${vendorid}" ]; then
|
||||
uci -q set network."${wan}".vendorid="dslforum.org"
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
elif [[ $vendorid != *"dslforum.org"* ]]; then
|
||||
uci -q set network."${wan}".vendorid="${vendorid},dslforum.org"
|
||||
ubus call uci commit '{"config":"network"}'
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option125() {
|
||||
local wan="${1}"
|
||||
local reqopts="$(uci -q get network."${wan}".reqopts)"
|
||||
local sendopts="$(uci -q get network."${wan}".sendopts)"
|
||||
local proto="$(uci -q get network."${wan}".proto)"
|
||||
local newreqopts=""
|
||||
local newsendopts=""
|
||||
local req125_present=0
|
||||
local send125_present=0
|
||||
local network_uci_update=0
|
||||
local opt125="125:"
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
125) req125_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
for sopt in $sendopts; do
|
||||
if [[ "$sopt" == "$opt125"* ]]; then
|
||||
send125_present=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
if [ ${req125_present} -eq 0 ]; then
|
||||
newreqopts="$reqopts 125"
|
||||
uci -q set network."${wan}".reqopts="$newreqopts"
|
||||
network_uci_update=1
|
||||
fi
|
||||
|
||||
if [ ${send125_present} -eq 0 ]; then
|
||||
configure_send_op125 "${sendopts}" "${wan}" "network"
|
||||
network_uci_update=1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ${network_uci_update} -eq 1 ]; then
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
fi
|
||||
}
|
||||
|
||||
wait_for_resolvfile() {
|
||||
local time=$1
|
||||
local tm=1
|
||||
@@ -440,7 +97,9 @@ validate_cpe_section()
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool:1' \
|
||||
'periodic_notify_interval:uinteger' \
|
||||
'fw_upgrade_keep_settings:bool'
|
||||
'KeepConfig:bool' \
|
||||
'KeepOpConf:bool' \
|
||||
'ConfigScope:string'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
@@ -481,40 +140,6 @@ validate_defaults() {
|
||||
}
|
||||
|
||||
boot() {
|
||||
local dhcp_discovery wan_interface skip_dhcp_boot_options disable_gatewayinfo
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
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
|
||||
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
|
||||
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
|
||||
|
||||
if [ -n "${ssl_capath}" ]; then
|
||||
regenerate_ssl_link "${ssl_capath}"
|
||||
fi
|
||||
|
||||
# Copy backup data so that if it restart latter on, it gets the info
|
||||
copy_cwmp_etc_files_to_varstate
|
||||
mkdir -p /var/run/icwmpd/
|
||||
@@ -545,7 +170,22 @@ start_service() {
|
||||
|
||||
stop_service()
|
||||
{
|
||||
local switch_bank KeepConfig KeepOpConf ConfigScope
|
||||
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
switch_bank=$(uci -q -c /var/state/ get icwmp.cpe.switch_bank)
|
||||
if [ "$switch_bank" = "1" ] && [ -x /etc/sysmngr/fwbank ]; then
|
||||
KeepConfig="$(uci -q get cwmp.cpe.KeepConfig)"
|
||||
KeepOpConf="$(uci -q get cwmp.cpe.KeepOpConf)"
|
||||
ConfigScope="$(uci -q get cwmp.cpe.ConfigScope)"
|
||||
|
||||
json_init
|
||||
[ -n "${KeepConfig}" ] && json_add_boolean "keep_config" "${KeepConfig}"
|
||||
[ -n "${KeepOpConf}" ] && json_add_boolean "keep_opconf" "${KeepOpConf}"
|
||||
[ -n "${ConfigScope}" ] && json_add_string "config_scope" "${ConfigScope}"
|
||||
|
||||
json_dump| /etc/sysmngr/fwbank call copy_config
|
||||
fi
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
|
||||
7
icwmp/files/etc/uci-defaults/50-cwmp-align-keep-config
Normal file
7
icwmp/files/etc/uci-defaults/50-cwmp-align-keep-config
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
keep_settings="$(uci -q get cwmp.cpe.fw_upgrade_keep_settings)"
|
||||
if [ -n "${keep_settings}" ]; then
|
||||
uci -q delete cwmp.cpe.fw_upgrade_keep_settings
|
||||
uci -q set cwmp.cpe.KeepConfig="${keep_settings}"
|
||||
fi
|
||||
@@ -4,6 +4,10 @@
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
config_load cwmp
|
||||
|
||||
if [ -f "/lib/functions/iopsys-environment.sh" ]; then
|
||||
. /lib/functions/iopsys-environment.sh
|
||||
fi
|
||||
|
||||
# Get Manufacturer OUI.
|
||||
config_get oui cpe manufacturer_oui ""
|
||||
if [ -z "${oui}" ]; then
|
||||
@@ -38,4 +42,14 @@ if [ -z "${enable_cwmp}" ]; then
|
||||
uci -q set cwmp.cpe.enable="1"
|
||||
fi
|
||||
|
||||
default_password="$(get_acs_password)"
|
||||
config_get pass cpe passwd ""
|
||||
if [ -z "${pass}" ]; then
|
||||
uci -q set cwmp.cpe.passwd="${default_password:-iopsys}"
|
||||
fi
|
||||
|
||||
config_get pass acs passwd ""
|
||||
if [ -z "${pass}" ]; then
|
||||
uci -q set cwmp.acs.passwd="${default_password:-iopsys}"
|
||||
fi
|
||||
# No need for commit here, it is done by uci_apply_defaults().
|
||||
|
||||
14
icwmp/files/etc/uci-defaults/85-migrate-gw-info
Normal file
14
icwmp/files/etc/uci-defaults/85-migrate-gw-info
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Script to migrate gateway-info options to gateway uci
|
||||
if [ ! -f "/etc/config/cwmp" ] && [ ! -f "/etc/config/gateway" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
val="$(uci -q get cwmp.cpe.disable_gatewayinfo)"
|
||||
|
||||
if [ -n "$val" ] && [ "$val" -eq 1 ]; then
|
||||
uci -q set gateway.global.enable=0
|
||||
fi
|
||||
|
||||
uci -q set cwmp.cpe.disable_gatewayinfo=""
|
||||
@@ -5,7 +5,6 @@ uci -q batch <<-EOT
|
||||
set firewall.cwmp=include
|
||||
set firewall.cwmp.path=/etc/icwmpd/firewall.cwmp
|
||||
set firewall.cwmp.reload=1
|
||||
commit firewall
|
||||
EOT
|
||||
|
||||
exit 0
|
||||
|
||||
107
icwmp/files/etc/uci-defaults/999-cwmp-conn-config
Normal file
107
icwmp/files/etc/uci-defaults/999-cwmp-conn-config
Normal file
@@ -0,0 +1,107 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
log() {
|
||||
echo "${@}"|logger -t cwmp.defaults -p info
|
||||
}
|
||||
|
||||
set_vendor_id() {
|
||||
local wan="${1}"
|
||||
local proto="$(uci -q get network."${wan}".proto)"
|
||||
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
vendorid="$(uci -q get network."${wan}".vendorid)"
|
||||
if [ -z "${vendorid}" ]; then
|
||||
uci -q set network."${wan}".vendorid="dslforum.org"
|
||||
elif [[ $vendorid != *"dslforum.org"* ]]; then
|
||||
uci -q set network."${wan}".vendorid="${vendorid},dslforum.org"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
local wan="${1}"
|
||||
|
||||
local reqopts="$(uci -q get network."${wan}".reqopts)"
|
||||
local proto="$(uci -q get network."${wan}".proto)"
|
||||
local newreqopts=""
|
||||
local option43_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) option43_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${option43_present} -eq 1 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
newreqopts="$reqopts 43"
|
||||
if [ "${proto}" = "dhcp" ]; then
|
||||
uci -q set network."${wan}".reqopts="$newreqopts"
|
||||
fi
|
||||
}
|
||||
|
||||
regenerate_ssl_link() {
|
||||
local cert_dir
|
||||
|
||||
cert_dir="${1%/}"
|
||||
if [ -f "${cert_dir}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do not generate the c_rehash if its system default cert path
|
||||
# ca-certificate package already generates c_rehash on compilation
|
||||
[ ! -d "${cert_dir}" ] || [ "${cert_dir}" = "/etc/ssl/certs" ] && return 0
|
||||
|
||||
generate_links() {
|
||||
local file_type="$1"
|
||||
local files="${cert_dir}"/*."${file_type}"
|
||||
for cfile in ${files}; do
|
||||
if [ -f "${cfile}" ]; then
|
||||
rehash="$(openssl x509 -hash -noout -in "${cfile}")"
|
||||
if [ ! -f "${cert_dir}/${rehash}.0" ]; then
|
||||
log "Generating c_rehash for ${cfile}=>${rehash}.0"
|
||||
ln -s "${cfile}" "${cert_dir}/${rehash}.0"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
generate_links "pem"
|
||||
}
|
||||
|
||||
configure_dhcp_discovery() {
|
||||
local dhcp_discovery wan_interface skip_dhcp_boot_options
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
configure_ssl_path() {
|
||||
local ssl_capath
|
||||
|
||||
config_load cwmp
|
||||
config_get ssl_capath acs ssl_capath
|
||||
|
||||
if [ -n "${ssl_capath}" ]; then
|
||||
regenerate_ssl_link "${ssl_capath}"
|
||||
fi
|
||||
}
|
||||
|
||||
configure_dhcp_discovery
|
||||
configure_ssl_path
|
||||
@@ -1,139 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
CLASS=""
|
||||
OUI=""
|
||||
SERIAL=""
|
||||
|
||||
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
|
||||
"4") OUI=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"5") SERIAL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"6") CLASS=$(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
|
||||
}
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get wan_intf cpe default_wan_interface "wan"
|
||||
|
||||
if [ "$enable_cwmp" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ -n "$opt125" ]; then
|
||||
len=$(printf "$opt125"|wc -c)
|
||||
get_vivsoi "$opt125" "$len"
|
||||
fi
|
||||
|
||||
mkdir -p /var/state
|
||||
touch /var/state/icwmp
|
||||
sec=$(uci -q -c /var/state get icwmp.gatewayinfo)
|
||||
if [ -z "${sec}" ]; then
|
||||
sec=$(uci -q -c /var/state add icwmp gatewayinfo)
|
||||
uci -q -c /var/state rename icwmp."${sec}"="gatewayinfo"
|
||||
fi
|
||||
|
||||
uci -q -c /var/state set icwmp.gatewayinfo.class="$CLASS"
|
||||
uci -q -c /var/state set icwmp.gatewayinfo.oui="$OUI"
|
||||
uci -q -c /var/state set icwmp.gatewayinfo.serial="$SERIAL"
|
||||
uci -q -c /var/state commit icwmp
|
||||
fi
|
||||
@@ -16,12 +16,12 @@ get_opt43() {
|
||||
local opt43="$1"
|
||||
local len="$2"
|
||||
|
||||
[ "$len" -gt "2" ] || return
|
||||
[ "${len}" -gt 2 ] || return
|
||||
|
||||
first_byte=${opt43:0:2}
|
||||
first_byte=$(printf "%d\n" "0x$first_byte")
|
||||
|
||||
if [ $len -ge 4 ] && [ $first_byte -ge 1 ] && [ $first_byte -le 4 ]; then
|
||||
if [ "${len}" -ge 4 ] && [ "${first_byte}" -ge 1 ] && [ "${first_byte}" -le 4 ]; then
|
||||
# it is in encapsulated form
|
||||
# opt43 encapsulated vendor-specific option has data in below format
|
||||
# Code Len Data item Code Len Data item Code
|
||||
@@ -35,7 +35,7 @@ get_opt43() {
|
||||
data="${opt43}"
|
||||
rem_len="${len}"
|
||||
# parsing of suboption of option 43
|
||||
while [ $rem_len -gt 0 ]; do
|
||||
while [ "${rem_len}" -gt 0 ]; do
|
||||
# get the suboption id
|
||||
sub_opt_id=${data:0:2}
|
||||
sub_opt_id=$(printf "%d\n" "0x$sub_opt_id")
|
||||
@@ -50,13 +50,13 @@ get_opt43() {
|
||||
|
||||
# assign the value found in sub option
|
||||
case "${sub_opt_id}" in
|
||||
"1") DHCP_ACS_URL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"1") DHCP_ACS_URL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"2") DHCP_PROV_CODE=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"2") DHCP_PROV_CODE=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"3") MIN_WAIT_INVL=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"3") MIN_WAIT_INVL=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
"4") INVL_MULTIPLIER=$(echo -n $sub_opt_val | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
"4") INVL_MULTIPLIER=$(echo -n "${sub_opt_val}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -70,13 +70,14 @@ get_opt43() {
|
||||
rem_len=$((rem_len - sub_opt_end))
|
||||
done
|
||||
else
|
||||
DHCP_ACS_URL=$(echo -n $opt43 | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
DHCP_ACS_URL=$(echo -n "${opt43}" | sed 's/\([0-9A-F]\{2\}\)/\\\\\\x\1/gI' | xargs printf && echo '')
|
||||
fi
|
||||
}
|
||||
|
||||
config_load cwmp
|
||||
config_get wan_intf cpe default_wan_interface "wan"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get_bool insecure_enable acs insecure_enable "0"
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
config_get min_wait_intvl acs dhcp_retry_min_wait_interval "0"
|
||||
config_get intvl_multi acs dhcp_retry_interval_multiplier "0"
|
||||
@@ -92,9 +93,9 @@ if [ "$discovery_enable" = "0" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
if [ "${wan_intf}" = "${INTERFACE}" ]; then
|
||||
if [ -n "$opt43" ]; then
|
||||
len=$(printf "$opt43"|wc -c)
|
||||
len=$(echo -n "$opt43"|wc -c)
|
||||
get_opt43 "$opt43" "$len"
|
||||
fi
|
||||
|
||||
@@ -102,6 +103,17 @@ if [ "${wan_intf}" == "${INTERFACE}" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${insecure_enable}" -eq "0" ]; then
|
||||
case $DHCP_ACS_URL in
|
||||
https://*)
|
||||
log "ACS url $DHCP_ACS_URL has https"
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
sec=$(uci -q get cwmp.acs)
|
||||
|
||||
if [ -z "${sec}" ]; then
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
#
|
||||
# Copyright (C) 2020-2024 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2025 Genexis Sweden AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=8.6.3
|
||||
PKG_VERSION:=8.7.41
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=64a2c525c8b66d10643696fcd51bb916f4fb1d7b
|
||||
PKG_SOURCE_VERSION:=9a61dcdd89be917a5a34caef8170074f117a53b2
|
||||
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
|
||||
@@ -41,7 +42,8 @@ define Package/libieee1905
|
||||
$(call Package/ieee1905/Default)
|
||||
TITLE:=libieee1905.so (library for CMDU and TLV handling)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +libwifiutils
|
||||
+libjson-c +libblobmsg-json +libwifiutils \
|
||||
+iputils-arping
|
||||
endef
|
||||
|
||||
define Package/ieee1905
|
||||
@@ -50,7 +52,7 @@ define Package/ieee1905
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ubus +libpthread \
|
||||
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi \
|
||||
+libwifiutils
|
||||
+libwifiutils +iputils-arping
|
||||
DEPENDS+=+IEEE1905_BUILD_TR181_PLUGIN:libbbfdm-api \
|
||||
+IEEE1905_BUILD_TR181_PLUGIN:libbbfdm-ubus \
|
||||
+IEEE1905_BUILD_TR181_PLUGIN:dm-service
|
||||
@@ -104,6 +106,7 @@ TARGET_CFLAGS += -DHAS_UBUS
|
||||
|
||||
ifeq ($(CONFIG_IEEE1905_BUILD_TR181_PLUGIN),y)
|
||||
TARGET_CFLAGS += -DBUILD_TR181_PLUGIN
|
||||
TARGET_CFLAGS += -DBBF_VENDOR_PREFIX=\\\"$(CONFIG_BBF_VENDOR_PREFIX)\\\"
|
||||
endif
|
||||
|
||||
MAKE_FLAGS += \
|
||||
@@ -113,7 +116,7 @@ MAKE_PATH:=src
|
||||
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(CP) ./files/etc $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
23
ieee1905/files/datamodel_description.json
Normal file
23
ieee1905/files/datamodel_description.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"Device.IEEE1905.AL.": {
|
||||
"type": "object",
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"access": false,
|
||||
"array": false,
|
||||
"{BBF_VENDOR_PREFIX}LocalOnlyMode": {
|
||||
"type": "boolean",
|
||||
"read": true,
|
||||
"write": true,
|
||||
"protocols": [
|
||||
"cwmp",
|
||||
"usp"
|
||||
],
|
||||
"description": "Enable or disable interfaces from ieee1905.",
|
||||
"datatype": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ config al-iface
|
||||
list ifname 'br-lan'
|
||||
list ifname '/eth.*'
|
||||
list ifname '/wl.*'
|
||||
list ifname '/ra.*'
|
||||
list ifname '/wds.*'
|
||||
|
||||
# ap sections are auto-generated/overwritten during onboarding
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/system.sh
|
||||
|
||||
BMAC=$(db -q get hw.board.basemac)
|
||||
BMAC=$(get_mac_label)
|
||||
BMAC=${BMAC//:/}
|
||||
BMAC=${BMAC// /}
|
||||
BMAC=$(printf "%12.12X" $((0x$BMAC)))
|
||||
|
||||
[ "$BMAC" == "" ] && exit 1
|
||||
|
||||
@@ -18,5 +17,3 @@ mac=$(uci -q get ieee1905.ieee1905.macaddress)
|
||||
[ "$mac" != "" ] && exit 0
|
||||
|
||||
uci set ieee1905.ieee1905.macaddress="$LMAC"
|
||||
uci commit ieee1905
|
||||
|
||||
|
||||
13
ieee1905/files/etc/uci-defaults/32-ieee1905-device-info
Normal file
13
ieee1905/files/etc/uci-defaults/32-ieee1905-device-info
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
set_val() {
|
||||
uci -q get "$1" > /dev/null || uci set "${1}=${2:-${3}}"
|
||||
}
|
||||
|
||||
set_val ieee1905.ieee1905.manufacturer "$OPENWRT_DEVICE_MANUFACTURER" IOPSYS
|
||||
set_val ieee1905.ieee1905.model_name "$(cat /tmp/sysinfo/model)" 1905-SampleDev
|
||||
set_val ieee1905.ieee1905.device_name "$NAME" 1905Device
|
||||
|
||||
exit 0
|
||||
@@ -4,7 +4,7 @@ PKG_NAME:=iopsys-analytics
|
||||
PKG_RELEASE:=$(COMMITCOUNT)
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=00189cea0a78b7a30dbfdd363b6d8e836437d1bc
|
||||
PKG_SOURCE_VERSION:=25e32ac5a860aec6e53e3449565b71595073e014
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopsys-analytics.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -31,8 +31,12 @@ define Package/$(PKG_NAME)
|
||||
+@PACKAGE_COLLECTD_ENCRYPTED_NETWORK \
|
||||
# remote syslog
|
||||
DEPENDS+= \
|
||||
+syslog-ng \
|
||||
+@SYSLOGNG_LOGROTATE \
|
||||
+@PACKAGE_syslog-ng:SYSLOGNG_LOGROTATE \
|
||||
+PACKAGE_fluent-bit:logrotate \
|
||||
+@DMCLI_REMOTE_CONNECTION
|
||||
# tools used in development/testing
|
||||
DEPENDS+= \
|
||||
+iperf3
|
||||
|
||||
endef
|
||||
|
||||
@@ -44,7 +48,13 @@ endef
|
||||
Build/Compile=
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(CP) -r $(PKG_BUILD_DIR)/files/* $(1)/
|
||||
$(CP) -r $(PKG_BUILD_DIR)/files/common/* $(1)/
|
||||
ifneq ($(CONFIG_PACKAGE_fluent-bit),)
|
||||
$(CP) -r $(PKG_BUILD_DIR)/files/fluent-bit/* $(1)/
|
||||
endif
|
||||
ifneq ($(CONFIG_PACKAGE_syslog-ng),)
|
||||
$(CP) -r $(PKG_BUILD_DIR)/files/syslog-ng/* $(1)/
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -6,13 +6,13 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=ipt-trigger
|
||||
PKG_VERSION:=1.0.2
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4f3d4427403e0a9be7653c1b92907ae8ae5f21ae
|
||||
PKG_SOURCE_VERSION:=ac1beae4794f99533b28db7d0e6e80f4c268a3e8
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/network/ipt-trigger.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
@@ -24,7 +24,7 @@ define KernelPackage/ipt-trigger
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Kernel module for iptables port trigger
|
||||
FILES:=$(PKG_BUILD_DIR)/src/ipv4/ipt_TRIGGER.ko
|
||||
DEPENDS+=+kmod-nf-nat +xtables-legacy
|
||||
DEPENDS+=+kmod-nf-nat +kmod-ipt-core
|
||||
AUTOLOAD:=$(call AutoLoad,30,ipt_TRIGGER,1)
|
||||
KCONFIG:=
|
||||
endef
|
||||
@@ -32,7 +32,7 @@ endef
|
||||
define KernelPackage/ip6t-trigger
|
||||
SUBMENU:=Other modules
|
||||
TITLE:=Kernel module for ip6tables port trigger
|
||||
DEPENDS+=+kmod-nf-nat +xtables-legacy
|
||||
DEPENDS+=+kmod-nf-nat +kmod-ipt-core
|
||||
FILES:=$(PKG_BUILD_DIR)/src/ipv6/ip6t_TRIGGER.ko
|
||||
AUTOLOAD:=$(call AutoLoad,30,ip6t_TRIGGER,1)
|
||||
KCONFIG:=
|
||||
@@ -46,9 +46,7 @@ define KernelPackage/ip6t-trigger/description
|
||||
Kernel module to enable port trigger for ip6tables
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
endif
|
||||
-include ../../broadcom/bcmkernel/bcm-kernel-toolchain.mk
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -67,8 +65,6 @@ define Build/InstallDev
|
||||
$(CP) $(PKG_BUILD_DIR)/include/ipt_TRIGGER.h $(1)/include/linux/netfilter_ipv4/
|
||||
endef
|
||||
|
||||
KERNEL_MAKE_FLAGS += -I$(LINUX_DIR)/include
|
||||
|
||||
define Build/Compile
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/src/ipv4/" modules
|
||||
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)/src/ipv6/" modules
|
||||
|
||||
55
json-schema-validator/Makefile
Normal file
55
json-schema-validator/Makefile
Normal file
@@ -0,0 +1,55 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=json-schema-validator
|
||||
PKG_VERSION:=2.3.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/pboettch/json-schema-validator.git
|
||||
PKG_SOURCE_VERSION:=$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_BUILD_DEPENDS:=nlohmann-json
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
CMAKE_OPTIONS += \
|
||||
-DJSON_VALIDATOR_BUILD_TESTS=OFF \
|
||||
-DJSON_VALIDATOR_BUILD_EXAMPLES=OFF \
|
||||
-DJSON_VALIDATOR_INSTALL=ON \
|
||||
-DJSON_VALIDATOR_SHARED_LIBS=OFF
|
||||
|
||||
define Package/json-schema-validator
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=JSON Schema Validator for nlohmann::json
|
||||
URL:=https://github.com/pboettch/json-schema-validator
|
||||
DEPENDS:=+libstdcpp +nlohmann-json
|
||||
endef
|
||||
|
||||
define Package/json-schema-validator/description
|
||||
A JSON Schema Validator for Modern C++ using nlohmann/json.
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/nlohmann
|
||||
$(CP) $(PKG_BUILD_DIR)/src/nlohmann/json-schema.hpp $(1)/usr/include/nlohmann/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libnlohmann_json_schema_validator*.a $(1)/usr/lib/ 2>/dev/null || true
|
||||
$(CP) $(PKG_BUILD_DIR)/libnlohmann_json_schema_validator*.so* $(1)/usr/lib/ 2>/dev/null || true
|
||||
endef
|
||||
|
||||
define Package/json-schema-validator/install
|
||||
true
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,json-schema-validator))
|
||||
44
jsonval/Makefile
Normal file
44
jsonval/Makefile
Normal file
@@ -0,0 +1,44 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=jsonval
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/jsonval
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Command-line JSON Schema Validator
|
||||
DEPENDS:=+nlohmann-json +json-schema-validator +libstdcpp
|
||||
endef
|
||||
|
||||
define Package/jsonval/description
|
||||
A small CLI tool to validate JSON files against a schema using json-schema-validator and nlohmann/json.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
cp -r ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(TARGET_CXX) \
|
||||
$(TARGET_CXXFLAGS) -std=c++17 \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/nlohmann \
|
||||
-L$(STAGING_DIR)/usr/lib \
|
||||
$(PKG_BUILD_DIR)/main.cpp \
|
||||
-o $(PKG_BUILD_DIR)/jsonval \
|
||||
-lnlohmann_json_schema_validator
|
||||
endef
|
||||
|
||||
define Package/jsonval/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/jsonval $(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,jsonval))
|
||||
64
jsonval/src/main.cpp
Normal file
64
jsonval/src/main.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <nlohmann/json-schema.hpp>
|
||||
|
||||
using nlohmann::json;
|
||||
using nlohmann::json_schema::json_validator;
|
||||
using namespace std;
|
||||
|
||||
void print_usage(const string& prog_name) {
|
||||
cerr << "Usage: " << prog_name << " -s <schema.json> -j <data.json>" << endl;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
string schema_path, data_path;
|
||||
|
||||
// Simple argument parsing
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
string arg = argv[i];
|
||||
if ((arg == "-s" || arg == "--schema") && i + 1 < argc) {
|
||||
schema_path = argv[++i];
|
||||
} else if ((arg == "-j" || arg == "--json") && i + 1 < argc) {
|
||||
data_path = argv[++i];
|
||||
} else {
|
||||
print_usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (schema_path.empty() || data_path.empty()) {
|
||||
print_usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ifstream schema_file(schema_path);
|
||||
ifstream data_file(data_path);
|
||||
|
||||
if (!schema_file.is_open() || !data_file.is_open()) {
|
||||
cerr << "Error: Could not open one or both files." << endl;
|
||||
return 2;
|
||||
}
|
||||
|
||||
json schema, document;
|
||||
try {
|
||||
schema_file >> schema;
|
||||
data_file >> document;
|
||||
} catch (const json::parse_error& e) {
|
||||
cerr << "Parse error: " << e.what() << endl;
|
||||
return 3;
|
||||
}
|
||||
|
||||
try {
|
||||
json_validator validator;
|
||||
validator.set_root_schema(schema);
|
||||
validator.validate(document);
|
||||
cout << "Valid" << endl;
|
||||
} catch (const std::exception& e) {
|
||||
cerr << "Validation failed: " << e.what() << endl;
|
||||
return 4;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libdsl
|
||||
PKG_VERSION:=7.2.100
|
||||
PKG_VERSION:=7.3.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=20875ec79fcc7c546c2f1253c867d6afbc8bff75
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libdsl.git
|
||||
PKG_SOURCE_VERSION:=1aa9c40f9503311652e562617b1e15533257adcc
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -37,6 +37,9 @@ else ifeq ($(CONFIG_TARGET_x86),y)
|
||||
else ifeq ($(CONFIG_TARGET_armvirt),y)
|
||||
TARGET_PLATFORM=TEST
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
else ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
TARGET_PLATFORM=AIROHA
|
||||
TARGET_CFLAGS +=-DIOPSYS_AIROHA
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
@@ -57,7 +60,7 @@ define Package/libdsl
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
MENU:=1
|
||||
TITLE:= xDSL library (libdsl)
|
||||
DEPENDS+=TARGET_brcmbca:bcm963xx-bsp
|
||||
DEPENDS+=TARGET_brcmbca:bcm963xx-bsp +TARGET_airoha:libeasy
|
||||
endef
|
||||
|
||||
define Package/libdsl/description
|
||||
|
||||
@@ -1,32 +1,28 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Iopsys
|
||||
# Copyright (C) 2025 Genexis Sweden AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libeasy
|
||||
PKG_VERSION:=7.4.5
|
||||
PKG_VERSION:=7.5.1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=67e6b91b8aca4c068a71f097f5f0576b47ec1d2e
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libeasy.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE_VERSION:=b981f7e1bd51f66041cd0c25d15af74ae1e3bc75
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libeasy.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_LICENSE_FILES:=
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@genexis.eu>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -34,9 +30,6 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall"
|
||||
|
||||
define Package/libeasy
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
@@ -47,7 +40,7 @@ define Package/libeasy
|
||||
endef
|
||||
|
||||
define Package/libeasy/description
|
||||
Library provides common utility functions
|
||||
This package provides libeasy.so for common utility functions.
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libeasy
|
||||
@@ -67,6 +60,7 @@ define Build/InstallDev/libeasy
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(call Build/InstallDev/cmake,$(1))
|
||||
$(call Build/InstallDev/libeasy,$(1),$(2))
|
||||
endef
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libethernet
|
||||
PKG_VERSION:=7.2.116
|
||||
PKG_VERSION:=7.2.117
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=243de75f54baa44a7c1aec2460e07478c4479ed9
|
||||
PKG_SOURCE_VERSION:=e917cdcfa0beb15a452f204521bea3d3571190b3
|
||||
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
|
||||
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libvoice-airoha
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0.12
|
||||
PKG_VERSION:=1.1.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:=68f0b4f3edecea9b8f05e72b6bbf3952d3946b7c
|
||||
PKG_SOURCE_VERSION:=9763c574ec69e2aa492db4f1296d4bcd53776fba
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
29
libvoice-airoha/files/etc/uci-defaults/991-libvoice-airoha
Normal file
29
libvoice-airoha/files/etc/uci-defaults/991-libvoice-airoha
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
hasVoice=$(db -q get hw.board.hasVoice)
|
||||
[ "$hasVoice" = "1" ] || exit 0
|
||||
|
||||
SLIC=$(cat /proc/device-tree/airoha-voice/slic-type)
|
||||
[ "${SLIC#pef}" != "${SLIC}" ] && {
|
||||
echo Configure TxGain and RxGain for MXL SLIC $SLIC
|
||||
|
||||
ports=$(db -q get hw.board.VoicePorts)
|
||||
for p in $(seq 0 $((ports-1))); do
|
||||
uci set asterisk.extension${p}.txgain='10'
|
||||
uci set asterisk.extension${p}.rxgain='-15'
|
||||
done
|
||||
}
|
||||
|
||||
hasDect=$(db -q get hw.board.hasDect)
|
||||
[ "$hasDect" = "1" ] || exit 0
|
||||
|
||||
# Set the DECT RFPI
|
||||
. /lib/functions/iopsys-environment.sh
|
||||
db set hw.board.dect_rfpi=$(get_dect_rfpi)
|
||||
db commit
|
||||
|
||||
# configure the PCM for DECT/DCX81
|
||||
[ -f "/proc/device-tree/aliases/dcx81-uart" ] && {
|
||||
uci set dect.global.pcm_fsync='SHORT_LF'
|
||||
uci set dect.global.dect_channel_start='3'
|
||||
}
|
||||
104
libwifi/Makefile
104
libwifi/Makefile
@@ -1,27 +1,32 @@
|
||||
#
|
||||
# Copyright (C) 2020-2023 Iopsys
|
||||
# Copyright (C) 2019-2024 Iopsys
|
||||
# Copyright (C) 2025 Genexis Sweden AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libwifi
|
||||
PKG_VERSION:=7.8.8
|
||||
PKG_VERSION:=7.22.9
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=4a1eaa7bfcaf4d2c0efeb453ea7c40b5ab7904ac
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/libwifi.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE_VERSION:=8e6dfd1f0d0d6b5a39dbb10a5820f3b80120564b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/hal/libwifi.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_LICENSE_FILES:=
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@genexis.eu>
|
||||
|
||||
MAKE_VERBOSE := 1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
ifeq ($(CONFIG_TARGET_brcmbca),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
@@ -42,10 +47,20 @@ else ifeq ($(CONFIG_TARGET_armvirt),y)
|
||||
else ifeq ($(CONFIG_TARGET_airoha),y)
|
||||
TARGET_PLATFORM=ECONET
|
||||
TARGET_WIFI_TYPE=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET
|
||||
TARGET_CFLAGS +=-DIOPSYS_ECONET -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
|
||||
ifeq ($(CONFIG_TARGET_airoha_an7581),y)
|
||||
TARGET_CFLAGS +=-DCONFIG_MTK
|
||||
endif
|
||||
else ifeq ($(CONFIG_TARGET_mediatek),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_WIFI_TYPE=MAC80211
|
||||
ifeq ($(CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cx750),y)
|
||||
TARGET_WIFI_TYPE=MEDIATEK
|
||||
TARGET_CFLAGS +=-DCONFIG_MTK -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
|
||||
else ifeq ($(CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_mediatek_mt7987a-spim-nand-an8801sb),y)
|
||||
TARGET_WIFI_TYPE=MEDIATEK
|
||||
TARGET_CFLAGS +=-DCONFIG_MTK -I$(LINUX_DIR)/include/uapi/linux/mtk_nl80211_inc
|
||||
endif
|
||||
else ifeq ($(CONFIG_TARGET_ipq95xx),y)
|
||||
TARGET_PLATFORM=IPQ95XX
|
||||
TARGET_WIFI_TYPE=QUALCOMM
|
||||
@@ -60,14 +75,14 @@ else
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-mt7915e),)
|
||||
TARGET_CFLAGS=-DMT7915_VENDOR_EXT
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-mt7915e_en7523),)
|
||||
TARGET_CFLAGS +=-DMT7915_VENDOR_EXT
|
||||
endif
|
||||
|
||||
PKG_BUILD_DEPENDS:=PACKAGE_kmod-mt7915e:mt76
|
||||
PKG_BUILD_DEPENDS:=PACKAGE_kmod-mt7915e_en7523:mt76_en7523
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_libwifi),)
|
||||
TARGET_CFLAGS +=-DHAS_WIFI
|
||||
CMAKE_OPTIONS +=-DHAS_WIFI=ON
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
|
||||
@@ -78,18 +93,8 @@ ifeq ($(CONFIG_LIBWIFI_SKIP_PROBES),y)
|
||||
TARGET_CFLAGS +=-DLIBWIFI_BRCM_SKIP_PROBES
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/openssl \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Wall -I./" \
|
||||
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||||
FPIC="$(FPIC)" \
|
||||
PLATFORM="$(TARGET_PLATFORM)" \
|
||||
WIFI_TYPE="$(TARGET_WIFI_TYPE)" \
|
||||
subdirs="$(subdirs)"
|
||||
CMAKE_OPTIONS += -DPLATFORM=$(TARGET_PLATFORM) -DWIFI_TYPE=$(TARGET_WIFI_TYPE)
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
@@ -97,43 +102,39 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/libwifi-common
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=libwifi
|
||||
SUBMENU:=IOPSYS HAL libs
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
define Package/libwifiutils
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:= WiFi utility library (libwifiutils.so)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libopenssl
|
||||
endef
|
||||
|
||||
define Package/libwifiutils/description
|
||||
Library provides WiFi utility functions
|
||||
endef
|
||||
|
||||
define Package/libwifi
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:= WiFi HAL library (libwifi-7.so.m)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcm963xx-bsp
|
||||
endef
|
||||
|
||||
define Package/libwifi/description
|
||||
Library provides WiFi HAL APIs and WiFi common utility functions
|
||||
endef
|
||||
|
||||
define Package/libwifiutils
|
||||
$(call Package/libwifi-common)
|
||||
TITLE:= WiFi utility library (libwifiutils.so)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy
|
||||
Library provides WiFi HAL APIs
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwifiutils
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/wifidefs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifiutils.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/wifidefs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/wifiutils.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/libwifiutils*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifiutils/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
define Package/libwifi
|
||||
$(call Package/libwifi-common)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +libwifiutils +TARGET_brcmbca:bcm963xx-bsp
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifiutils/libwifiutils*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifi/config
|
||||
@@ -154,13 +155,12 @@ define Package/libwifi/config
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/wifiops.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/wifi.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi-7*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifiops.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi-7*.so* $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi-7*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libwifiutils))
|
||||
|
||||
38
linux-pam/Makefile
Normal file
38
linux-pam/Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=linux-pam
|
||||
PKG_VERSION:=1.7.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/linux-pam/linux-pam.git
|
||||
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
define Package/linux-pam
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Linux PAM Module
|
||||
DEPENDS:=+libpam
|
||||
endef
|
||||
|
||||
MESON_ARGS += \
|
||||
-Dprefix=/usr \
|
||||
-Ddefault_library=shared \
|
||||
-Ddocs=disabled \
|
||||
-Deconf=disabled \
|
||||
-Dselinux=disabled \
|
||||
-Dnis=disabled \
|
||||
-Dexamples=false \
|
||||
-Dxtests=false
|
||||
|
||||
define Package/linux-pam/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/security
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./linux_pam.init $(1)/etc/init.d/linux_pam
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,linux-pam))
|
||||
18
linux-pam/linux_pam.init
Executable file
18
linux-pam/linux_pam.init
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=11
|
||||
STOP=90
|
||||
USE_PROCD=1
|
||||
|
||||
create_faillock_files()
|
||||
{
|
||||
# also create files needed by pam_faillock
|
||||
touch /var/log/faillock
|
||||
chmod 700 /var/log/faillock
|
||||
touch /var/log/btmp
|
||||
chmod 700 /var/log/btmp
|
||||
}
|
||||
|
||||
boot() {
|
||||
create_faillock_files
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
if PACKAGE_logmngr
|
||||
|
||||
choice
|
||||
prompt "Select backend for syslog management"
|
||||
default LOGMNGR_BACKEND_FLUENTBIT
|
||||
@@ -31,4 +32,5 @@ config LOGMNGR_VENDOR_LOG_FILE
|
||||
default y
|
||||
help
|
||||
It adds support for Device.DeviceInfo.VendorLogFile. Object.
|
||||
|
||||
endif
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=logmngr
|
||||
PKG_VERSION:=1.0.8
|
||||
PKG_VERSION:=1.1.4
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/system/logmngr.git
|
||||
PKG_SOURCE_VERSION:=7c2056c9f5dc23fd1260846c72210365ec69c882
|
||||
PKG_SOURCE_VERSION:=62441fdfe14a39bff8fff7c62307bd7b54d7240f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
@@ -28,9 +28,11 @@ define Package/logmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Logging Manager
|
||||
DEPENDS:=+LOGMNGR_BACKEND_FLUENTBIT:fluent-bit +LOGMNGR_LOGROTATE:logrotate
|
||||
DEPENDS:=+LOGMNGR_BACKEND_FLUENTBIT:fluent-bit
|
||||
DEPENDS+=+LOGMNGR_BACKEND_SYSLOG_NG:syslog-ng
|
||||
DEPENDS+=+LOGMNGR_LOGROTATE:logrotate
|
||||
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
|
||||
CONFLICTS:=logd
|
||||
endef
|
||||
|
||||
define Package/logmngr/description
|
||||
@@ -50,30 +52,35 @@ endif
|
||||
|
||||
define Package/logmngr/install
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/logmngr.init $(1)/etc/init.d/logmngr
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) ./files/10-logmngr_config_generate $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_BIN) ./files/etc/init.d/logmngr $(1)/etc/init.d/
|
||||
$(INSTALL_DATA) ./files/etc/config/logmngr $(1)/etc/config/
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/10-logmngr_config_migrate $(1)/etc/uci-defaults/
|
||||
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfsyslog.so $(1) core 10
|
||||
|
||||
# Install logmngr service backend
|
||||
$(INSTALL_DIR) $(1)/lib/logmngr
|
||||
ifeq ($(CONFIG_LOGMNGR_BACKEND_FLUENTBIT),y)
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) ./files/logread $(1)/sbin/
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/fluent-bit.sh $(1)/lib/logmngr/
|
||||
$(INSTALL_BIN) ./files/logread $(1)/usr/sbin
|
||||
endif
|
||||
ifeq ($(CONFIG_LOGMNGR_BACKEND_SYSLOG_NG),y)
|
||||
else ifeq ($(CONFIG_LOGMNGR_BACKEND_SYSLOG_NG),y)
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/syslog-ng.sh $(1)/lib/logmngr/
|
||||
endif
|
||||
$(BBFDM_INSTALL_CORE_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfsyslog.so $(1)
|
||||
|
||||
ifeq ($(CONFIG_LOGMNGR_LOGROTATE),y)
|
||||
$(INSTALL_BIN) ./files/11-logmngr_logrotate_config_generate $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/logmngr/logrotate.sh $(1)/lib/logmngr/
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbflogrotate.so $(1) sysmngr
|
||||
$(INSTALL_DATA) ./files/etc/uci-defaults/11-logmngr_logrotate_syslog $(1)/etc/uci-defaults/
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbflogrotate.so $(1) sysmngr 11
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LOGMNGR_VENDOR_LOG_FILE),y)
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfvendorlog.so $(1) sysmngr
|
||||
$(BBFDM_INSTALL_MS_PLUGIN) $(PKG_BUILD_DIR)/bbf_plugin/libbbfvendorlog.so $(1) sysmngr 12
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,logmngr))
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -s "/etc/config/logmngr" ]; then
|
||||
if uci -q get logmngr.@globals[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
else
|
||||
rm -f /etc/config/logmngr
|
||||
fi
|
||||
fi
|
||||
touch /etc/config/logmngr
|
||||
|
||||
uci set logmngr.globals=globals
|
||||
uci set logmngr.globals.enable=1
|
||||
|
||||
uci set logmngr.a1=action
|
||||
uci set logmngr.a1.name="ac1"
|
||||
|
||||
uci set logmngr.lf1=log_file
|
||||
uci set logmngr.lf1.enable=1
|
||||
uci set logmngr.lf1.action="ac1"
|
||||
uci set logmngr.lf1.file="/var/log/messages"
|
||||
|
||||
uci set logmngr.lr1=log_remote
|
||||
uci set logmngr.lr1.enable=0
|
||||
uci set logmngr.lr1.action="ac1"
|
||||
uci set logmngr.lr1.port="514"
|
||||
uci commit logmngr
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -s "/etc/config/logmngr" ]; then
|
||||
if uci -q get logmngr.@log_rotate[0] >/dev/null; then
|
||||
# return if there is any valid content
|
||||
exit
|
||||
fi
|
||||
uci set logmngr.lro1=log_rotate
|
||||
uci set logmngr.lro1.enable=1
|
||||
uci set logmngr.lro1.file_name="/var/log/messages"
|
||||
uci set logmngr.lro1.file_count=1
|
||||
uci set logmngr.lro1.max_file_size=1000000
|
||||
uci commit logmngr
|
||||
fi
|
||||
26
logmngr/files/etc/config/logmngr
Normal file
26
logmngr/files/etc/config/logmngr
Normal file
@@ -0,0 +1,26 @@
|
||||
config globals 'globals'
|
||||
option enable '1'
|
||||
|
||||
config source 'default_source'
|
||||
option name 'default_source'
|
||||
option system_messages '1'
|
||||
option kernel_messages '1'
|
||||
|
||||
config template 'default_template'
|
||||
option name 'default_template'
|
||||
option expression '{time} {hostname} {ident}[{pid}]: {message}'
|
||||
|
||||
config action 'default_action'
|
||||
option name 'default_action'
|
||||
list source 'default_source'
|
||||
option template 'default_template'
|
||||
|
||||
config log_file 'lf1'
|
||||
option enable '1'
|
||||
option action 'default_action'
|
||||
option file '/var/log/messages'
|
||||
|
||||
config log_remote 'lr1'
|
||||
option enable '0'
|
||||
option action 'default_action'
|
||||
option port '514'
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=12
|
||||
START=09
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
36
logmngr/files/etc/uci-defaults/10-logmngr_config_migrate
Normal file
36
logmngr/files/etc/uci-defaults/10-logmngr_config_migrate
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
# check if this is a new type UCI or old type UCI
|
||||
if ! uci -q get logmngr.default_source > /dev/null; then
|
||||
uci -q set logmngr.default_source=source
|
||||
uci -q set logmngr.default_source.name='default_source'
|
||||
uci -q set logmngr.default_source.system_messages='1'
|
||||
uci -q set logmngr.default_source.kernel_messages='1'
|
||||
fi
|
||||
|
||||
if ! uci -q get logmngr.default_template > /dev/null; then
|
||||
uci -q set logmngr.default_template=template
|
||||
uci -q set logmngr.default_template.name='default_template'
|
||||
uci -q set logmngr.default_template.expression='{time} {hostname} {ident}[{pid}]: {message}'
|
||||
fi
|
||||
|
||||
if uci -q get logmngr.a1 >/dev/null; then
|
||||
uci -q rename logmngr.a1='default_action'
|
||||
uci -q set logmngr.default_action.name='default_action'
|
||||
uci -q set logmngr.default_action.template='default_template'
|
||||
|
||||
uci -q delete logmngr.default_action.source
|
||||
uci -q add_list logmngr.default_action.source='default_source'
|
||||
fi
|
||||
|
||||
if uci -q get logmngr.lf1 >/dev/null; then
|
||||
uci -q rename logmngr.lf1='default_logfile'
|
||||
uci -q set logmngr.default_logfile.action='default_action'
|
||||
fi
|
||||
|
||||
if uci -q get logmngr.lr1 >/dev/null; then
|
||||
uci -q rename logmngr.lr1='default_logremote'
|
||||
uci -q set logmngr.default_logremote.action='default_action'
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user