mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-20 01:20:35 +08:00
Compare commits
1289 Commits
ap_autocon
...
dectmngr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99e85b92b2 | ||
|
|
f1795e0263 | ||
|
|
a2115711bb | ||
|
|
2b26e9083b | ||
|
|
1978d357c9 | ||
|
|
822f77590d | ||
|
|
3d31052d40 | ||
|
|
dc56c93b73 | ||
|
|
0dd95029e6 | ||
|
|
5f92faf0a1 | ||
|
|
31ed1f802b | ||
|
|
c73ac6665b | ||
|
|
431d1fbf34 | ||
|
|
2ddb4fb5fc | ||
|
|
1835fe7a50 | ||
|
|
d0e30dade4 | ||
|
|
be867f1b25 | ||
|
|
9b2318242b | ||
|
|
8fee87c3c6 | ||
|
|
2fbdb4b3d2 | ||
|
|
337c9a52f9 | ||
|
|
6c86adbf86 | ||
|
|
e316bea78f | ||
|
|
233d714564 | ||
|
|
13b742fe44 | ||
|
|
c23ae5dad1 | ||
|
|
3c7aa191ea | ||
|
|
d8bbc9de81 | ||
|
|
92e353bb49 | ||
|
|
17fd78bc94 | ||
|
|
68ca3b1d07 | ||
|
|
05a5616347 | ||
|
|
90f102b36a | ||
|
|
3e95e599e4 | ||
|
|
12d1e79339 | ||
|
|
9ffed931c6 | ||
|
|
aa8949e9e4 | ||
|
|
c31e10cd88 | ||
|
|
1257c11c69 | ||
|
|
147c6de58c | ||
|
|
b821b189d1 | ||
|
|
cae7d71907 | ||
|
|
92748d489a | ||
|
|
9847af7e74 | ||
|
|
8e98dc9526 | ||
|
|
1fe4fbdd4e | ||
|
|
e4f24b2223 | ||
|
|
ec905407f0 | ||
|
|
0c0c7316fa | ||
|
|
72da7b55c2 | ||
|
|
60fe16d7ce | ||
|
|
cb1fa79dcd | ||
|
|
15ab89ef7d | ||
|
|
975f4e7552 | ||
|
|
a3a7c6da1b | ||
|
|
dca442ce01 | ||
|
|
6f00aa22fd | ||
|
|
575f5c9d19 | ||
|
|
a699302f46 | ||
|
|
4ef7a8034b | ||
|
|
9675953bf6 | ||
|
|
d3d4c87f82 | ||
|
|
52ced81af6 | ||
|
|
20f17b81c5 | ||
|
|
aafcebaf3d | ||
|
|
6126333ad9 | ||
|
|
fc15efe427 | ||
|
|
59d28497d9 | ||
|
|
3a4a1b64bf | ||
|
|
1ce127080e | ||
|
|
f9a4bfa6d6 | ||
|
|
e4365786b9 | ||
|
|
65c619060d | ||
|
|
ef370bc886 | ||
|
|
0730c65372 | ||
|
|
626e1241d6 | ||
|
|
b86544da9a | ||
|
|
3e38df2389 | ||
|
|
d34d6e8bf0 | ||
|
|
2f8a76e34d | ||
|
|
55f1310daa | ||
|
|
57b528f2af | ||
|
|
670904cd6c | ||
|
|
ad0633029c | ||
|
|
9b823e5937 | ||
|
|
431325e6e6 | ||
|
|
fd8fa1d7e2 | ||
|
|
572bfa61dd | ||
|
|
5963ff1139 | ||
|
|
363d3dfcb7 | ||
|
|
cf12bbe6e2 | ||
|
|
426437c233 | ||
|
|
742ded177d | ||
|
|
a5f6b10a50 | ||
|
|
c25139968a | ||
|
|
f52700c0f0 | ||
|
|
5bc8757a3e | ||
|
|
5b0fe1d2dc | ||
|
|
a31ae89e79 | ||
|
|
bd72194d2d | ||
|
|
babb25709b | ||
|
|
ea37c333f9 | ||
|
|
be07b58cf5 | ||
|
|
13a6a59469 | ||
|
|
b6301bba94 | ||
|
|
dd627b7f70 | ||
|
|
0d2a12f029 | ||
|
|
0f1460f45f | ||
|
|
022e506a56 | ||
|
|
9025395702 | ||
|
|
35ce40b964 | ||
|
|
0c915ba8b8 | ||
|
|
60ab6d1a6b | ||
|
|
8ec45319bc | ||
|
|
1536d860dd | ||
|
|
49858f3601 | ||
|
|
1c305c69e4 | ||
|
|
e592e2d567 | ||
|
|
ff7714c88e | ||
|
|
9dda4d7ffa | ||
|
|
10cee1f785 | ||
|
|
8816c26e2a | ||
|
|
aba742a5e7 | ||
|
|
d199dadd39 | ||
|
|
fca18d2da5 | ||
|
|
3b819f5b1d | ||
|
|
b49d14370d | ||
|
|
3f2befa23a | ||
|
|
52809e1e94 | ||
|
|
52ff5c79dd | ||
|
|
09ad1ffa91 | ||
|
|
1d2d9b7b97 | ||
|
|
7f405f04ac | ||
|
|
16134d0a2d | ||
|
|
5fbc784901 | ||
|
|
0eaba859a7 | ||
|
|
7828e67308 | ||
|
|
985ccf339f | ||
|
|
b8f36d23ec | ||
|
|
4f7aeaaec2 | ||
|
|
d976140484 | ||
|
|
747436ce8f | ||
|
|
dde560d314 | ||
|
|
34ec63d1f2 | ||
|
|
d4465d81f7 | ||
|
|
022ec4d6bb | ||
|
|
6c68ff3be7 | ||
|
|
9e1e0eb0df | ||
|
|
63ba56b87e | ||
|
|
53ab41ea2f | ||
|
|
d1477636f9 | ||
|
|
b2e8affb08 | ||
|
|
2dc9b89cd5 | ||
|
|
77acc69dbe | ||
|
|
5ac418113e | ||
|
|
1ba55b753e | ||
|
|
d483abe7d2 | ||
|
|
511d471d54 | ||
|
|
206ecd46db | ||
|
|
f9f31384c2 | ||
|
|
2c4e50ab10 | ||
|
|
ac46849475 | ||
|
|
4db7061884 | ||
|
|
de40d120e2 | ||
|
|
e54e20de45 | ||
|
|
7add2a163d | ||
|
|
499709e2df | ||
|
|
c566d23c78 | ||
|
|
a5c8b7145f | ||
|
|
0419beb911 | ||
|
|
8bb22efe7d | ||
|
|
bff8f75bbb | ||
|
|
be57a189f7 | ||
|
|
9c365459bb | ||
|
|
f4e9f29d3d | ||
|
|
ac56460fec | ||
|
|
cb2077377a | ||
|
|
673dfc8589 | ||
|
|
a287107ee1 | ||
|
|
47396a4e4f | ||
|
|
d82756305c | ||
|
|
5bd754fc9a | ||
|
|
bed5379108 | ||
|
|
d8e5dcf859 | ||
|
|
64f9e23850 | ||
|
|
aaffffdba2 | ||
|
|
0d6980e0ec | ||
|
|
61f454043d | ||
|
|
defe48e4e8 | ||
|
|
4d893499a5 | ||
|
|
e32f2f09be | ||
|
|
183ba5d634 | ||
|
|
809113d4b2 | ||
|
|
927b002aa6 | ||
|
|
c5654ad9ab | ||
|
|
2e3013dc56 | ||
|
|
a7dd783b49 | ||
|
|
d3451b7bd4 | ||
|
|
776860187d | ||
|
|
d2dda88aad | ||
|
|
22871d2410 | ||
|
|
707203b42a | ||
|
|
60fb332fff | ||
|
|
bd0d27ebc9 | ||
|
|
0af83a4892 | ||
|
|
715f58db4d | ||
|
|
cdfa0a7313 | ||
|
|
9b12400c0b | ||
|
|
b59e3250af | ||
|
|
f742ce11ae | ||
|
|
7a6ff46b8a | ||
|
|
e3d9a24ed7 | ||
|
|
88fcb2e4df | ||
|
|
0f05633d74 | ||
|
|
5173b01cb2 | ||
|
|
86cf6fc81e | ||
|
|
2ee29d8252 | ||
|
|
ef178897ba | ||
|
|
1d4b28acd4 | ||
|
|
2b6e74fb80 | ||
|
|
32cfd29d74 | ||
|
|
63959e908e | ||
|
|
80e2035662 | ||
|
|
7527faca9c | ||
|
|
b7e010be3b | ||
|
|
84ad0eec4e | ||
|
|
bd188aaed2 | ||
|
|
4d244eb31e | ||
|
|
14aab50849 | ||
|
|
3a605fd8f5 | ||
|
|
f9bbce19dd | ||
|
|
a1677793d3 | ||
|
|
d7a8913072 | ||
|
|
34c5ea3c75 | ||
|
|
c006db0e21 | ||
|
|
4e42968aca | ||
|
|
9b48e54734 | ||
|
|
77a41d56a1 | ||
|
|
90fa843074 | ||
|
|
524c718242 | ||
|
|
e00102c2b9 | ||
|
|
2c0b6b76e2 | ||
|
|
9e9dc5b1a9 | ||
|
|
4535b14305 | ||
|
|
478e3a5c8b | ||
|
|
98302e0523 | ||
|
|
4dc45c779a | ||
|
|
c1bef47f50 | ||
|
|
9fb0c48a22 | ||
|
|
d8e35df684 | ||
|
|
d0189d605f | ||
|
|
8de1704440 | ||
|
|
f6f1644bab | ||
|
|
b1c705544b | ||
|
|
bd8d574177 | ||
|
|
4b5c88b015 | ||
|
|
32245d37c3 | ||
|
|
56d2b9c4e3 | ||
|
|
08244c5392 | ||
|
|
146bc95709 | ||
|
|
25a861a55f | ||
|
|
86fab6969f | ||
|
|
5463df37e1 | ||
|
|
a480a0c95d | ||
|
|
89068fa876 | ||
|
|
c3cee3431c | ||
|
|
bf70b518bd | ||
|
|
ad293962c1 | ||
|
|
6badc20bcc | ||
|
|
f8b51b9ca5 | ||
|
|
a5c390efdd | ||
|
|
6d011f8626 | ||
|
|
f1d5e5d7cd | ||
|
|
0fed56903c | ||
|
|
2ac7be4652 | ||
|
|
7e34649ce7 | ||
|
|
a404da9124 | ||
|
|
d152eb0f17 | ||
|
|
fb8ed439b8 | ||
|
|
6b23da2314 | ||
|
|
bc90649202 | ||
|
|
0f31eb632f | ||
|
|
5c37dc2165 | ||
|
|
b4ce04d317 | ||
|
|
1f817c4e8f | ||
|
|
26599ba94e | ||
|
|
26fe0bc7de | ||
|
|
37493eb8be | ||
|
|
b3dda9b4e5 | ||
|
|
94879c6de9 | ||
|
|
a15f586ecf | ||
|
|
f3c5face44 | ||
|
|
4488510e4b | ||
|
|
4685cb49d4 | ||
|
|
6ad633cbf4 | ||
|
|
d97c335cb5 | ||
|
|
3563683cec | ||
|
|
330bb08d1b | ||
|
|
93f2090d0e | ||
|
|
d9ae18761b | ||
|
|
40a1a45412 | ||
|
|
f459eaafb9 | ||
|
|
a80ed328c3 | ||
|
|
15d9fc0339 | ||
|
|
916edb4ba3 | ||
|
|
eb67d5ab6e | ||
|
|
dd43b90e91 | ||
|
|
5fee9aa7b4 | ||
|
|
b821c760df | ||
|
|
2dbcf3c75c | ||
|
|
952366cbc6 | ||
|
|
23a18999d5 | ||
|
|
2d2dffbec2 | ||
|
|
758ee8ec9f | ||
|
|
c38ce1be3b | ||
|
|
2b5332adc3 | ||
|
|
70c3d5d5e1 | ||
|
|
df41990929 | ||
|
|
6edc7cbb94 | ||
|
|
d7bffebd5b | ||
|
|
8f81a71b57 | ||
|
|
9452ada64f | ||
|
|
1a3d267ee1 | ||
|
|
2f6b40bdd2 | ||
|
|
d1c2be5b08 | ||
|
|
fdee0c734c | ||
|
|
88513db735 | ||
|
|
8bdbefcc80 | ||
|
|
ee33f0ae7d | ||
|
|
5cd57a3ee9 | ||
|
|
56a6cbf04a | ||
|
|
1fb879fca0 | ||
|
|
a3fd03c390 | ||
|
|
00594ba01e | ||
|
|
132bba5c20 | ||
|
|
06f160af35 | ||
|
|
04bf025b8f | ||
|
|
1daa8d7f1a | ||
|
|
97a302a20a | ||
|
|
87a0fbe8bf | ||
|
|
54b4140e09 | ||
|
|
99267f902b | ||
|
|
0338a2fd7c | ||
|
|
e134a5ed08 | ||
|
|
0d8f4a3de8 | ||
|
|
d5e7cb1a28 | ||
|
|
e995fcb14d | ||
|
|
f865531fa5 | ||
|
|
104f3e2e83 | ||
|
|
d298757300 | ||
|
|
b66ade378a | ||
|
|
be36f2e3e8 | ||
|
|
00dc43eb39 | ||
|
|
efeeb00a0a | ||
|
|
cc5b7a8a17 | ||
|
|
ce8425ce70 | ||
|
|
ce5b916828 | ||
|
|
7f04196f58 | ||
|
|
762d5a5daa | ||
|
|
abc997d3f3 | ||
|
|
924b54d8d3 | ||
|
|
bd8dd65766 | ||
|
|
5372956a9a | ||
|
|
bf0ddc5321 | ||
|
|
7895966aa2 | ||
|
|
0f716b5197 | ||
|
|
dd56712aa4 | ||
|
|
b7de0cf4bb | ||
|
|
09f6449a6e | ||
|
|
f00e7fe965 | ||
|
|
dd7aac2a8c | ||
|
|
49ffec4bc9 | ||
|
|
0a638e202b | ||
|
|
82676d8390 | ||
|
|
95d6cadee1 | ||
|
|
4672442d50 | ||
|
|
7a8759e46a | ||
|
|
f28659ebe0 | ||
|
|
f10457c8cb | ||
|
|
bd3f962614 | ||
|
|
a4aa0b3521 | ||
|
|
06204d8523 | ||
|
|
4b5dbec851 | ||
|
|
ab6035acbd | ||
|
|
72b7726f1e | ||
|
|
56ab101640 | ||
|
|
4ee030a2ea | ||
|
|
ec402a2ea1 | ||
|
|
52466671ab | ||
|
|
3a54432533 | ||
|
|
7a8e1b9076 | ||
|
|
237e8d7b6d | ||
|
|
bd468e4761 | ||
|
|
67169eff2a | ||
|
|
1ad1ef12b4 | ||
|
|
a012f98b4c | ||
|
|
1f3c696867 | ||
|
|
b861a89031 | ||
|
|
ca9e4f1765 | ||
|
|
a94c701f66 | ||
|
|
13684e1ce6 | ||
|
|
00d5c0849c | ||
|
|
2ae25830e7 | ||
|
|
645a3bb5e5 | ||
|
|
85fbea1d40 | ||
|
|
4be8594678 | ||
|
|
1cb7520cb9 | ||
|
|
bb6131b1f7 | ||
|
|
f268b27622 | ||
|
|
85387d16b1 | ||
|
|
566a5ebcc7 | ||
|
|
48104e2831 | ||
|
|
f9e6d17778 | ||
|
|
47ffb81c08 | ||
|
|
fd050bc759 | ||
|
|
76d1fd9cb3 | ||
|
|
3bf86b8652 | ||
|
|
c914639104 | ||
|
|
425d48e974 | ||
|
|
c339eae256 | ||
|
|
fa7ef67b91 | ||
|
|
fc374d0f29 | ||
|
|
01808d21b2 | ||
|
|
5a1fdc0b07 | ||
|
|
6a84c4511a | ||
|
|
11704f2f91 | ||
|
|
d48965a03f | ||
|
|
bd12c3d6e8 | ||
|
|
249072f280 | ||
|
|
ece01dd366 | ||
|
|
2d82d20613 | ||
|
|
e6371c74d6 | ||
|
|
aa25a78ff1 | ||
|
|
60d1c43735 | ||
|
|
795fc9e805 | ||
|
|
1af894cba6 | ||
|
|
4ba1558caa | ||
|
|
cfb06f61d0 | ||
|
|
d786c69d46 | ||
|
|
5d2b838d3e | ||
|
|
88060bc42a | ||
|
|
16c3f49ff5 | ||
|
|
4b6eaad9a8 | ||
|
|
af241bb222 | ||
|
|
ae621822c4 | ||
|
|
1a6ac9fa87 | ||
|
|
749e38735a | ||
|
|
292276ce75 | ||
|
|
1bcc2854af | ||
|
|
cee063223e | ||
|
|
44e1f1c867 | ||
|
|
0b2d89a810 | ||
|
|
d16a53087d | ||
|
|
f4ca987fae | ||
|
|
c6e8ad013c | ||
|
|
76e6d34d67 | ||
|
|
3bdc80057b | ||
|
|
87f6ea2a1c | ||
|
|
24e065f9a8 | ||
|
|
ba7d1c1153 | ||
|
|
42a13509a4 | ||
|
|
d5b529311a | ||
|
|
dd7e804cab | ||
|
|
ea779bb6c7 | ||
|
|
7ea1adc2d9 | ||
|
|
ae186df3c9 | ||
|
|
8fe00c184f | ||
|
|
a5f99f4fc3 | ||
|
|
5c2c368800 | ||
|
|
8d078181f9 | ||
|
|
6b8e047d33 | ||
|
|
b073b86450 | ||
|
|
61eccddf93 | ||
|
|
98465ecf62 | ||
|
|
fdad57f796 | ||
|
|
8da760a491 | ||
|
|
fb8010b5fd | ||
|
|
7a669d7e1b | ||
|
|
21cb7c14e0 | ||
|
|
7fc00dbbda | ||
|
|
4cf278cbf1 | ||
|
|
7ac322b707 | ||
|
|
818bf818a3 | ||
|
|
e7f75bba07 | ||
|
|
542e9d02e1 | ||
|
|
266a8d27a0 | ||
|
|
52bd1b02c4 | ||
|
|
79f9a81d66 | ||
|
|
5722b66e40 | ||
|
|
03ab529375 | ||
|
|
fa071854de | ||
|
|
6f5d1b88f9 | ||
|
|
326c9b75b9 | ||
|
|
1568031ba3 | ||
|
|
b1dbd89de8 | ||
|
|
aef1a050fa | ||
|
|
e42c88e453 | ||
|
|
7b0dd92085 | ||
|
|
88a46d54d5 | ||
|
|
3ccf98a642 | ||
|
|
fa449667fe | ||
|
|
2abf0f63df | ||
|
|
c53c3dcfc7 | ||
|
|
ab3e270238 | ||
|
|
1d5f1647b1 | ||
|
|
a3b5bf68b8 | ||
|
|
92ec110e27 | ||
|
|
fbf8cea8af | ||
|
|
3843bcea55 | ||
|
|
b9ef557a02 | ||
|
|
c3924d5761 | ||
|
|
a7f537e734 | ||
|
|
24f09d7048 | ||
|
|
973cd18a45 | ||
|
|
99717b5254 | ||
|
|
61641f1b14 | ||
|
|
c6eadab0b8 | ||
|
|
73c1c6aee0 | ||
|
|
f096e3a76c | ||
|
|
25c9a7ebac | ||
|
|
89ff50412e | ||
|
|
1f839c80bb | ||
|
|
e3a42fc8cf | ||
|
|
8f5d47b5d5 | ||
|
|
5bab70dee7 | ||
|
|
e1b385b676 | ||
|
|
c55f8790ff | ||
|
|
1171e41fe5 | ||
|
|
5ef2844c7b | ||
|
|
99efedcf0f | ||
|
|
f5afeba8ac | ||
|
|
0f5dfa0395 | ||
|
|
377e940927 | ||
|
|
41df4b3105 | ||
|
|
88cc1792d8 | ||
|
|
b775d2b45b | ||
|
|
28e3fc9223 | ||
|
|
1f6145e16b | ||
|
|
44fbd4c993 | ||
|
|
a082f44bba | ||
|
|
a06e9017bd | ||
|
|
860d5c40a6 | ||
|
|
7dcc594fba | ||
|
|
9ebc827e85 | ||
|
|
7002da04e2 | ||
|
|
e47a300305 | ||
|
|
40a04b8615 | ||
|
|
c45a0ceae4 | ||
|
|
a4f53e11da | ||
|
|
2936f538aa | ||
|
|
49634a0c0e | ||
|
|
c191553de2 | ||
|
|
04b0490017 | ||
|
|
984f5454ef | ||
|
|
3f60546197 | ||
|
|
33a8f7fe81 | ||
|
|
ae1a0b0738 | ||
|
|
04205b9ac2 | ||
|
|
55fd3f6241 | ||
|
|
7bab39b4b2 | ||
|
|
095a635ac2 | ||
|
|
f1a9452b56 | ||
|
|
cdd1f7ab75 | ||
|
|
f709852ae3 | ||
|
|
b84033c641 | ||
|
|
aadbbda3e9 | ||
|
|
c9e6cf8428 | ||
|
|
7265b88a70 | ||
|
|
ec3128865b | ||
|
|
78c895f23a | ||
|
|
f87742703b | ||
|
|
27e2d73ae1 | ||
|
|
3de93cf5c2 | ||
|
|
4b0041f6fd | ||
|
|
f020406a90 | ||
|
|
74b15fdca3 | ||
|
|
e113ff5534 | ||
|
|
4e3216e405 | ||
|
|
58c8fe5bb4 | ||
|
|
5cf12fea90 | ||
|
|
ca74205ac1 | ||
|
|
c8b670737a | ||
|
|
89314cae0b | ||
|
|
d85d2048c0 | ||
|
|
426a2b89a3 | ||
|
|
1a8a95e2f6 | ||
|
|
cec2fe6f92 | ||
|
|
dba7f1f97c | ||
|
|
15a5c5dedf | ||
|
|
0c20ed1c78 | ||
|
|
6995815f77 | ||
|
|
eb8d678e0f | ||
|
|
f831eb5259 | ||
|
|
3a19aca30f | ||
|
|
4a039722fc | ||
|
|
6a51fb87de | ||
|
|
6eb4364b48 | ||
|
|
730335f7d2 | ||
|
|
9775ac0bb4 | ||
|
|
0c779bb73b | ||
|
|
9d8957d853 | ||
|
|
bb9cfdf487 | ||
|
|
dcb6cad37d | ||
|
|
379d6b878b | ||
|
|
1e0e15653a | ||
|
|
bd25c841d4 | ||
|
|
5a67915eec | ||
|
|
f78381e0d2 | ||
|
|
c657b6cd76 | ||
|
|
cdb6bed47c | ||
|
|
fe8ac41906 | ||
|
|
b0c0230535 | ||
|
|
36ae18c95b | ||
|
|
963af3d4b5 | ||
|
|
08825a3914 | ||
|
|
cd3c3669c3 | ||
|
|
8141f9d62c | ||
|
|
2603da87a7 | ||
|
|
98a9ee7ba5 | ||
|
|
8dd0627a3f | ||
|
|
bf73f20997 | ||
|
|
ecba6c9067 | ||
|
|
2778420bcd | ||
|
|
abc2c6c233 | ||
|
|
3c96d7d3b9 | ||
|
|
a0165dcc73 | ||
|
|
5ae47c1892 | ||
|
|
882d6911d4 | ||
|
|
6e49e15db6 | ||
|
|
c1f4516d8e | ||
|
|
26a05cbb75 | ||
|
|
30baf028d7 | ||
|
|
678d8ad567 | ||
|
|
47f5c981f7 | ||
|
|
656f9fb27b | ||
|
|
402669463a | ||
|
|
f9b9d172ef | ||
|
|
6a8445c545 | ||
|
|
92addd0ba0 | ||
|
|
4f061b4b66 | ||
|
|
bc3991024d | ||
|
|
e42b1097a1 | ||
|
|
84bd79bdd6 | ||
|
|
156fd4f766 | ||
|
|
3fc4b8a73e | ||
|
|
3706e0b9ef | ||
|
|
5017b9155e | ||
|
|
f1a24d7008 | ||
|
|
11efefb309 | ||
|
|
864c69d8ae | ||
|
|
66290ca8bb | ||
|
|
3a603c64eb | ||
|
|
904cc86836 | ||
|
|
a6b4cccfcc | ||
|
|
1ba929a1bc | ||
|
|
27db3c5545 | ||
|
|
c0d178f2a5 | ||
|
|
b76cf64e03 | ||
|
|
cb0f28ef56 | ||
|
|
cad2b4be1f | ||
|
|
1b3b27088b | ||
|
|
52ede67c78 | ||
|
|
da710a8ea5 | ||
|
|
e0685ee791 | ||
|
|
77d1a1fe79 | ||
|
|
f8af9dc5ec | ||
|
|
2948186053 | ||
|
|
7750caf7f5 | ||
|
|
317145634e | ||
|
|
a0bca11b5e | ||
|
|
b92491464e | ||
|
|
f9e82d7b5b | ||
|
|
6ce90a657e | ||
|
|
00f9ef780c | ||
|
|
ae820c047d | ||
|
|
c00060ccd6 | ||
|
|
99fe0ef701 | ||
|
|
3272f6a7ca | ||
|
|
be779fb032 | ||
|
|
cdaa705bf2 | ||
|
|
b25640f5cd | ||
|
|
3e1eb2c26a | ||
|
|
502a2208da | ||
|
|
f5b4997f5a | ||
|
|
7f3363ed1b | ||
|
|
4a088ffd1c | ||
|
|
b3a24bc064 | ||
|
|
b8b49c884a | ||
|
|
3bbd300a6f | ||
|
|
228e5d6e2c | ||
|
|
5073a86a81 | ||
|
|
09fb98d1a8 | ||
|
|
c8fcae0267 | ||
|
|
bb1a867ba9 | ||
|
|
12f7b56d8e | ||
|
|
9b9b69db8f | ||
|
|
bfd89fed46 | ||
|
|
6b3dd5818f | ||
|
|
fdd1dca318 | ||
|
|
598b38c030 | ||
|
|
3faff63044 | ||
|
|
8f7c3669b4 | ||
|
|
f719073b64 | ||
|
|
38324be853 | ||
|
|
eda07c2623 | ||
|
|
8e57bbc89b | ||
|
|
d96302eea4 | ||
|
|
d808393085 | ||
|
|
be10424499 | ||
|
|
885f7f1239 | ||
|
|
3267182a19 | ||
|
|
1b5c95d390 | ||
|
|
ab22b4c6b1 | ||
|
|
58734bc8f3 | ||
|
|
16a80f24ec | ||
|
|
9f23a4e63c | ||
|
|
2154f7c134 | ||
|
|
1327943b0d | ||
|
|
3511b47856 | ||
|
|
d9ddb5f128 | ||
|
|
9e7915e0b8 | ||
|
|
df488dcfb4 | ||
|
|
529cb0aeb2 | ||
|
|
5ab09d60df | ||
|
|
f7121e0e84 | ||
|
|
9f632e96a7 | ||
|
|
64d79c39bc | ||
|
|
ae15ae5dd7 | ||
|
|
313fb95cdd | ||
|
|
b56536c1e0 | ||
|
|
5a6c51162c | ||
|
|
358b411758 | ||
|
|
d3dbf90646 | ||
|
|
8539d6cfe8 | ||
|
|
7c173a7357 | ||
|
|
219d8e7557 | ||
|
|
10a7f18099 | ||
|
|
da2393edec | ||
|
|
36c46c3717 | ||
|
|
6272cb32de | ||
|
|
9ce26b7f23 | ||
|
|
15134a7247 | ||
|
|
2de708e08b | ||
|
|
38e5604fed | ||
|
|
131c152165 | ||
|
|
242327a978 | ||
|
|
c25e6ab28f | ||
|
|
fe1e1af143 | ||
|
|
891e294746 | ||
|
|
61f2920db1 | ||
|
|
ca051ca489 | ||
|
|
afbb5646bd | ||
|
|
1647299798 | ||
|
|
efbdd85054 | ||
|
|
0b2f5dda9a | ||
|
|
bea9ff0f87 | ||
|
|
9bbfeee6aa | ||
|
|
8a1f53463d | ||
|
|
dd41b4b573 | ||
|
|
abee9b7f90 | ||
|
|
7bb1e1fabe | ||
|
|
1f06ccede8 | ||
|
|
b111eb1246 | ||
|
|
c3eeb956d9 | ||
|
|
fdabc69dfa | ||
|
|
e4f56f549c | ||
|
|
debc7f9ec6 | ||
|
|
0c8cdd6297 | ||
|
|
6cecf882b8 | ||
|
|
4d12bc6833 | ||
|
|
2dbce56aa9 | ||
|
|
00b1d90297 | ||
|
|
63bb34d06a | ||
|
|
aede464e88 | ||
|
|
6ab355131f | ||
|
|
8564d6081e | ||
|
|
c01d17de44 | ||
|
|
f5cdc3a3e7 | ||
|
|
10b20e8fd4 | ||
|
|
49f3ec4cd4 | ||
|
|
ae23f756ec | ||
|
|
c7ae8699ca | ||
|
|
df6a493b47 | ||
|
|
14136cd10a | ||
|
|
923747dc4e | ||
|
|
efb2c35438 | ||
|
|
00887c2cfc | ||
|
|
6afb559fe3 | ||
|
|
be301272fa | ||
|
|
b2ac4d3a46 | ||
|
|
52b4f37130 | ||
|
|
88fc0d3692 | ||
|
|
a9c8166acd | ||
|
|
8e21ad37f7 | ||
|
|
329458ea54 | ||
|
|
aa34cd098e | ||
|
|
c2fad5fad2 | ||
|
|
32a9117209 | ||
|
|
0c04b05abe | ||
|
|
a8bd624873 | ||
|
|
7a3dee480e | ||
|
|
ff67433326 | ||
|
|
c2627f0005 | ||
|
|
eb8152c1c5 | ||
|
|
94f5d5b98b | ||
|
|
9d5b9d46e2 | ||
|
|
de27e0408d | ||
|
|
61321b369c | ||
|
|
d5071bf28d | ||
|
|
b87959cc61 | ||
|
|
567e6d9870 | ||
|
|
13ed87c4be | ||
|
|
b084d4498b | ||
|
|
14253e84ac | ||
|
|
163c543147 | ||
|
|
7af90d69ee | ||
|
|
4e1a1c45a0 | ||
|
|
40612ae2ef | ||
|
|
2aae4c8109 | ||
|
|
4fe198c7bf | ||
|
|
f514d81709 | ||
|
|
2e6ac5bb49 | ||
|
|
1d06631503 | ||
|
|
dec1cb5146 | ||
|
|
1b5be728d2 | ||
|
|
5915f5a7c3 | ||
|
|
1d41fce2a3 | ||
|
|
02fa994bce | ||
|
|
bed1a643a5 | ||
|
|
c8a33d6aaf | ||
|
|
6ce52f1c87 | ||
|
|
a74127ade7 | ||
|
|
3095a304be | ||
|
|
ae26c1e9a8 | ||
|
|
64dbe2aac5 | ||
|
|
6cad2afe3a | ||
|
|
501193da98 | ||
|
|
21cabf5141 | ||
|
|
aa91b4d17e | ||
|
|
119f285d84 | ||
|
|
75bbf1524a | ||
|
|
082bf1560d | ||
|
|
fec3683f7c | ||
|
|
8a02e8dedf | ||
|
|
1c9afee81c | ||
|
|
97e44aac0a | ||
|
|
8aa7978f70 | ||
|
|
8319f90d8b | ||
|
|
989ff55cc7 | ||
|
|
0e8ecee541 | ||
|
|
e82f77983d | ||
|
|
181b7688e8 | ||
|
|
c8de1c1d35 | ||
|
|
8540d5ebbf | ||
|
|
c48cd18584 | ||
|
|
3ccc71658f | ||
|
|
c9f0c9c92b | ||
|
|
18ff1d3965 | ||
|
|
d6bb313565 | ||
|
|
13d33c03a2 | ||
|
|
0a91cd5acb | ||
|
|
ad0867991f | ||
|
|
18545a1fb9 | ||
|
|
0378afa773 | ||
|
|
06b4b106e1 | ||
|
|
916ecab7c9 | ||
|
|
543c3da5dc | ||
|
|
2bfd924868 | ||
|
|
c12bc7eee9 | ||
|
|
e9c5c111c5 | ||
|
|
f6c3a62378 | ||
|
|
362fb7b238 | ||
|
|
020c8f29e1 | ||
|
|
10bf43efa9 | ||
|
|
5e3a7e7af0 | ||
|
|
a76c0a433d | ||
|
|
026ccd759e | ||
|
|
0df9c6fc36 | ||
|
|
3751ae692a | ||
|
|
0160f21f10 | ||
|
|
52f35c0763 | ||
|
|
e650d27f76 | ||
|
|
8d6d7626b8 | ||
|
|
e6c6b2c9ae | ||
|
|
67693a8954 | ||
|
|
88ed893a07 | ||
|
|
fd369ac2fb | ||
|
|
c1bb3a5c0f | ||
|
|
d1d455a51d | ||
|
|
fe63598021 | ||
|
|
7853733a75 | ||
|
|
7d991d89be | ||
|
|
88892e5f7c | ||
|
|
b30434d872 | ||
|
|
9995b4a3f2 | ||
|
|
27c515e258 | ||
|
|
8373ffae75 | ||
|
|
888b247706 | ||
|
|
86eed4ba84 | ||
|
|
63335fb119 | ||
|
|
bc3dc5c3db | ||
|
|
0097bc5d89 | ||
|
|
4b04b8445f | ||
|
|
317e644e11 | ||
|
|
1ac9c4f057 | ||
|
|
35f02d2891 | ||
|
|
067e3dc7b8 | ||
|
|
3d9cfc03fb | ||
|
|
a6c3c54091 | ||
|
|
dbe1a31d09 | ||
|
|
d5f0c80b2e | ||
|
|
fd60b8121c | ||
|
|
0001b91c41 | ||
|
|
733c88df8c | ||
|
|
1d1c8a25f2 | ||
|
|
c47857f950 | ||
|
|
d503d4390e | ||
|
|
15165b3066 | ||
|
|
0fe9ac1a0d | ||
|
|
99a4fe3f05 | ||
|
|
ca1e348b5c | ||
|
|
550330cb33 | ||
|
|
e427dd0f09 | ||
|
|
2eb3c89f36 | ||
|
|
6408e0254c | ||
|
|
7db30978e3 | ||
|
|
cbc7711204 | ||
|
|
263cdbc501 | ||
|
|
0bc5379667 | ||
|
|
f334f25b12 | ||
|
|
b54a6f9f52 | ||
|
|
5eba44b51f | ||
|
|
79aa793d47 | ||
|
|
6f40b3fe47 | ||
|
|
57401ea50e | ||
|
|
469a1f3dd2 | ||
|
|
ab77076213 | ||
|
|
f377f135bd | ||
|
|
0041b46b67 | ||
|
|
bf14a2013c | ||
|
|
3706193d98 | ||
|
|
323376f6a0 | ||
|
|
d09cc5cf02 | ||
|
|
218faefc0f | ||
|
|
d80f3147fd | ||
|
|
2d8c76ba58 | ||
|
|
083fd0376f | ||
|
|
22e2cb491a | ||
|
|
3f63c60a9d | ||
|
|
e9c6d5d4a4 | ||
|
|
b26e80748c | ||
|
|
d683c240a9 | ||
|
|
defb23338a | ||
|
|
aabf092369 | ||
|
|
84b63deafa | ||
|
|
1ffc4255ad | ||
|
|
481a055d54 | ||
|
|
9cd40a75d5 | ||
|
|
b606d834d7 | ||
|
|
f752c9fbce | ||
|
|
d7ad33b2ba | ||
|
|
425be291f8 | ||
|
|
3f4e770a3f | ||
|
|
9b27f7c349 | ||
|
|
184cb1c823 | ||
|
|
69fc6842c2 | ||
|
|
d607931a2d | ||
|
|
5ce6004d58 | ||
|
|
febe4679bc | ||
|
|
73448b888b | ||
|
|
31de1fdb65 | ||
|
|
7a04489b26 | ||
|
|
9f6a17e38a | ||
|
|
b2b6f4a4b1 | ||
|
|
6eabe4170f | ||
|
|
5e8a9b461a | ||
|
|
55b5312443 | ||
|
|
214ded2ce8 | ||
|
|
28177ccd12 | ||
|
|
9f08eb3ba0 | ||
|
|
497c700d1b | ||
|
|
5159e04508 | ||
|
|
d034408de9 | ||
|
|
d953dadccc | ||
|
|
49b466b8ef | ||
|
|
3ca52b35ad | ||
|
|
051826305e | ||
|
|
7f3e3d9c3e | ||
|
|
4790d3b915 | ||
|
|
69c430e502 | ||
|
|
e5db655422 | ||
|
|
d2b9140468 | ||
|
|
7a7097facc | ||
|
|
cec3913238 | ||
|
|
722cca0d26 | ||
|
|
0c418c8d4e | ||
|
|
9038766677 | ||
|
|
5b0a9699f0 | ||
|
|
1732abca49 | ||
|
|
5bbda10e68 | ||
|
|
6fdd2ba9ad | ||
|
|
e0ba35300f | ||
|
|
c354891742 | ||
|
|
e86b12fcbd | ||
|
|
cee10ef824 | ||
|
|
aab3799f3f | ||
|
|
0c9e81565e | ||
|
|
af0bedc16c | ||
|
|
b84c1e6775 | ||
|
|
c558d65793 | ||
|
|
eaed835d1c | ||
|
|
1ad4d6b0fb | ||
|
|
4378f26209 | ||
|
|
df7f1090b3 | ||
|
|
0b3bd71b0c | ||
|
|
fa397d90a3 | ||
|
|
94d061bb74 | ||
|
|
365f071e9c | ||
|
|
e17db02d67 | ||
|
|
4a6420b5b4 | ||
|
|
55b85a5fe0 | ||
|
|
419eaf87a5 | ||
|
|
f7b842b06a | ||
|
|
b5dd7861ca | ||
|
|
680a39cbea | ||
|
|
5495066a88 | ||
|
|
796063ea6d | ||
|
|
ad7ca90872 | ||
|
|
563024c9a5 | ||
|
|
0a8e0ffdec | ||
|
|
755c0d3a3a | ||
|
|
7c4bd1e415 | ||
|
|
5fff31c8b1 | ||
|
|
518adb78bc | ||
|
|
a5ea97e248 | ||
|
|
ba111ca23a | ||
|
|
9066a3b852 | ||
|
|
da9c130053 | ||
|
|
e68b0bdd29 | ||
|
|
62afe68988 | ||
|
|
32c1ac029d | ||
|
|
1c26adf945 | ||
|
|
ad1e36bd51 | ||
|
|
5877112f5e | ||
|
|
6e1f635f40 | ||
|
|
b468a999b9 | ||
|
|
a845c00b61 | ||
|
|
e4f14cde2a | ||
|
|
9c1d0111c0 | ||
|
|
51e2dc8996 | ||
|
|
1583a152a3 | ||
|
|
4b48ec0049 | ||
|
|
d10066a1cf | ||
|
|
93d6848507 | ||
|
|
c108347db8 | ||
|
|
2619b78b80 | ||
|
|
df6f24731e | ||
|
|
9f7bf5d3e0 | ||
|
|
06665246e5 | ||
|
|
2f51c4fc69 | ||
|
|
262e346eb4 | ||
|
|
6eeb07a738 | ||
|
|
cda2c6f628 | ||
|
|
89cd93fa45 | ||
|
|
1d7f102b55 | ||
|
|
d7dd7e3645 | ||
|
|
ecc67fa3a5 | ||
|
|
bf06ef8bd4 | ||
|
|
8271b3b9b8 | ||
|
|
1bdab0bf97 | ||
|
|
a0c094b5a1 | ||
|
|
defab5f8a1 | ||
|
|
7894d505e4 | ||
|
|
a7785b1a2d | ||
|
|
ac7dd3ea14 | ||
|
|
a58a2a95f2 | ||
|
|
2e26726bce | ||
|
|
b46d737152 | ||
|
|
f78010b8b3 | ||
|
|
88524fdbc9 | ||
|
|
1a399a9332 | ||
|
|
533614b4f4 | ||
|
|
ada468f63b | ||
|
|
f4dd679f2e | ||
|
|
b9ecd3513d | ||
|
|
6e1c57dc91 | ||
|
|
f54729e36e | ||
|
|
afae7a9d3f | ||
|
|
61ebc2c3a3 | ||
|
|
4f820cd74c | ||
|
|
a8e48ca428 | ||
|
|
a92b3c004c | ||
|
|
b5bb871de5 | ||
|
|
c22b03a510 | ||
|
|
a828ecbd14 | ||
|
|
272f77e46d | ||
|
|
eab05e10a5 | ||
|
|
08adc4f106 | ||
|
|
8a4397b82e | ||
|
|
00952364da | ||
|
|
cbc988c360 | ||
|
|
13f34d166e | ||
|
|
16a1b5b361 | ||
|
|
c25f70efc4 | ||
|
|
47dbd02ab4 | ||
|
|
64d5f38931 | ||
|
|
298a8e8c78 | ||
|
|
f8e68aa249 | ||
|
|
72de25fb65 | ||
|
|
e38d07407f | ||
|
|
5418076f88 | ||
|
|
29af99d53e | ||
|
|
ad0dfafa9e | ||
|
|
16df43ccdc | ||
|
|
3e07e3cd0d | ||
|
|
c6be1e0c6b | ||
|
|
606e8e4518 | ||
|
|
4aaf074694 | ||
|
|
b3716a9f42 | ||
|
|
bfdb9eda4f | ||
|
|
3a92a09f66 | ||
|
|
78a07d7719 | ||
|
|
255d5ea39e | ||
|
|
d50a164af7 | ||
|
|
5d6c215f23 | ||
|
|
4de73e9cb0 | ||
|
|
bfee02596a | ||
|
|
f52a5fb870 | ||
|
|
4ec5d4ca03 | ||
|
|
fbdfe7493a | ||
|
|
495dec638a | ||
|
|
32e44b7b5e | ||
|
|
21d30f18a7 | ||
|
|
2617f831a2 | ||
|
|
130d8c243e | ||
|
|
e4494f9958 | ||
|
|
40228bda04 | ||
|
|
27e0257e6a | ||
|
|
4e812c4e18 | ||
|
|
1d6b8e3271 | ||
|
|
8f718e80fd | ||
|
|
6baa72c846 | ||
|
|
779c964b3f | ||
|
|
d120f2e63d | ||
|
|
bc2e7077ec | ||
|
|
924eb2e39c | ||
|
|
64ce9b009f | ||
|
|
50c6a07027 | ||
|
|
ac02982008 | ||
|
|
69c9f88730 | ||
|
|
cb5c1979e6 | ||
|
|
20d31ec7c6 | ||
|
|
f5b8fbb033 | ||
|
|
5e01100d14 | ||
|
|
748e2500f6 | ||
|
|
dc5001c949 | ||
|
|
b84fb8e456 | ||
|
|
6bbf691df1 | ||
|
|
ff6fcd8438 | ||
|
|
d454e5eb38 | ||
|
|
9cfeee53e9 | ||
|
|
2b8c0a26ae | ||
|
|
d752678875 | ||
|
|
6df6762cd7 | ||
|
|
40d4f72784 | ||
|
|
b7cd1f15f9 | ||
|
|
ff2ae72bd2 | ||
|
|
93180ac277 | ||
|
|
84831d3d95 | ||
|
|
09de34b98a | ||
|
|
7da60b67cc | ||
|
|
ce5541aef8 | ||
|
|
4b564df4c0 | ||
|
|
5e6580ccf2 | ||
|
|
15a055ffdd | ||
|
|
e68fac5e9b | ||
|
|
df82765a3b | ||
|
|
f9070e4c3f | ||
|
|
9d94b7d594 | ||
|
|
d1ed021a04 | ||
|
|
9987882a1c | ||
|
|
83b6fb7330 | ||
|
|
8c3d54ff7d | ||
|
|
4e78d1c075 | ||
|
|
2109e5ff4f | ||
|
|
e417f30841 | ||
|
|
6610f42769 | ||
|
|
81cdd1a9ea | ||
|
|
d69061f95e | ||
|
|
7f757e9291 | ||
|
|
5c4719c6e4 | ||
|
|
0ea0df8b82 | ||
|
|
2dceba94a8 | ||
|
|
f34380326f | ||
|
|
547a976981 | ||
|
|
116d6370ca | ||
|
|
6024f034ea | ||
|
|
4fb8ec2016 | ||
|
|
5dfa4996a6 | ||
|
|
eaf990c616 | ||
|
|
d6cf5b6dfe | ||
|
|
03c62cd618 | ||
|
|
ba0e921101 | ||
|
|
8428773a9c | ||
|
|
0c33f36c88 | ||
|
|
1c2b381072 | ||
|
|
4482e7defd | ||
|
|
3740560fd3 | ||
|
|
e4cea887e2 | ||
|
|
4e42c07257 | ||
|
|
26e48a7b83 | ||
|
|
105dab05d2 | ||
|
|
40e062550b | ||
|
|
7bc068c0c6 | ||
|
|
ae243101f1 | ||
|
|
613ef10273 | ||
|
|
06c2d704a9 | ||
|
|
14f7f0d328 | ||
|
|
a0324b3f5e | ||
|
|
16a9b07497 | ||
|
|
7c91b86d01 | ||
|
|
2076e35808 | ||
|
|
8f04c3e3b3 | ||
|
|
76b7d03f5e | ||
|
|
c3bf9de599 | ||
|
|
a3c0948a46 | ||
|
|
084995366f | ||
|
|
a2468234cd | ||
|
|
39445eaec0 | ||
|
|
898455ceee | ||
|
|
7a422d4244 | ||
|
|
cbc1f3b798 | ||
|
|
7e1d84b6d6 | ||
|
|
9821c3fbac | ||
|
|
1eb318b09a | ||
|
|
b1e3ef111b | ||
|
|
e57d5962d1 | ||
|
|
556cd32a18 | ||
|
|
61cf78c264 | ||
|
|
9dfcb15415 | ||
|
|
1420241d40 | ||
|
|
530a4b99bd | ||
|
|
21b3284b75 | ||
|
|
04d13dc7a4 | ||
|
|
a290ae71ee | ||
|
|
d45f42427f | ||
|
|
a230016663 | ||
|
|
60314e6a42 | ||
|
|
38702b44c4 | ||
|
|
75b9f292a0 | ||
|
|
2fc567be5d | ||
|
|
94db04db83 | ||
|
|
d9ae8fac97 | ||
|
|
34dda55644 | ||
|
|
a6ee4c8122 | ||
|
|
368ddf1d31 | ||
|
|
bcdc8e5dc0 | ||
|
|
781f3409ad | ||
|
|
4cc72a2dc6 | ||
|
|
93dee37808 | ||
|
|
42bc8f91ce | ||
|
|
5d16f075ab | ||
|
|
841751d7e2 | ||
|
|
8bc324c3b4 | ||
|
|
20287be7e2 | ||
|
|
6d1e026af4 | ||
|
|
2cfabc4eb2 | ||
|
|
8f0e98f50b | ||
|
|
d3cf57ef77 | ||
|
|
036e27876a | ||
|
|
69f8fcb047 | ||
|
|
c344fbe2ea | ||
|
|
0a29c12e09 | ||
|
|
68ca5f7fb8 | ||
|
|
8cb7c61007 | ||
|
|
61359cb291 | ||
|
|
4a439783c8 | ||
|
|
cd1ad2ec7a | ||
|
|
9a25147997 | ||
|
|
ad4c0f5cf1 | ||
|
|
3f6076369f | ||
|
|
fbc699524a | ||
|
|
f7c45760da | ||
|
|
e03c14ae2b | ||
|
|
355e042820 | ||
|
|
53d2088715 | ||
|
|
833c97d216 | ||
|
|
59d2324acd | ||
|
|
e3cb3586d7 |
@@ -24,6 +24,7 @@ PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/mediatek/ated.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@@ -1,23 +1,37 @@
|
||||
if PACKAGE_libbbfdm
|
||||
|
||||
config LIBBBFDM_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
menu "Configuration"
|
||||
|
||||
config BBF_VENDOR_EXTENSION
|
||||
bool "Enable Vendor Extension"
|
||||
default y
|
||||
|
||||
config BBF_VENDOR_LIST
|
||||
string "Vendor List"
|
||||
default "iopsys"
|
||||
|
||||
config BBF_VENDOR_PREFIX
|
||||
string "Vendor Prefix"
|
||||
default "X_IOPSYS_EU_"
|
||||
|
||||
config BBF_TR181
|
||||
bool "Compile with tr181 device features"
|
||||
bool "Enable TR-181 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR104
|
||||
bool "Compile with tr104 voice features"
|
||||
bool "Enable TR-104 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR143
|
||||
bool "Compile with tr143 diagnostics features"
|
||||
bool "Enable TR-143 Data Model Support"
|
||||
default y
|
||||
|
||||
config BBF_TR157
|
||||
bool "Compile with tr157 bulkdata collector features"
|
||||
default y
|
||||
config BBFDM_ENABLE_JSON_PLUGIN
|
||||
bool "Enable json plugin to extend datamodel"
|
||||
default n
|
||||
|
||||
config BBFDM_ENABLE_DOTSO_PLUGIN
|
||||
bool "Enable shared library plugin to extend datamodel"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
71
bbf/Makefile
71
bbf/Makefile
@@ -1,17 +1,18 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbbfdm
|
||||
PKG_VERSION:=3.2.5
|
||||
PKG_VERSION:=6.4.18
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bbf.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=301cbd0bed43ed9274bad3e8bcddcfd807755412
|
||||
PKG_SOURCE_VERSION:=2758c0380e9dbec87b119df239aee29c7ed1ec48
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -22,17 +23,19 @@ PKG_LICENSE_FILES:=LICENSE
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/libbbf_api
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for libbbfdm API
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c
|
||||
endef
|
||||
|
||||
define Package/libbbfdm
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=Library for broadband-forum data model
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libmbedtls
|
||||
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json +libjson-c +libtrace +libbbf_api +libopenssl +libcurl
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/config
|
||||
@@ -44,7 +47,7 @@ define Package/libbbf_api/description
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/description
|
||||
Library contains the data model tree. It includes TR181, TR104, TR143 and TR157 data models
|
||||
Library contains the data model tree. It includes TR181, TR104 and TR143 data models
|
||||
endef
|
||||
|
||||
USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
|
||||
@@ -54,10 +57,9 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += -DCUSTOM_PREFIX=\\\"$(CONFIG_LIBBBFDM_VENDOR_PREFIX)\\\"
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
-D_GNU_SOURCE \
|
||||
-Wall -Werror \
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR181),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -74,50 +76,63 @@ CONFIGURE_ARGS += \
|
||||
--enable-tr143
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBF_TR157),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-tr157
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libopenssl),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libopenssl
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_libmbedtls),y)
|
||||
ifeq ($(CONFIG_BBF_VENDOR_EXTENSION),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-libmbedtls
|
||||
--enable-vendor-extension
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
BBF_VENDOR_LIST="$(CONFIG_BBF_VENDOR_LIST)" \
|
||||
BBF_VENDOR_PREFIX="$(CONFIG_BBF_VENDOR_PREFIX)"
|
||||
|
||||
endif ##CONFIG_BBF_VENDOR_EXTENSION
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_JSON_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-json-plugin
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_BBFDM_ENABLE_DOTSO_PLUGIN),y)
|
||||
CONFIGURE_ARGS += \
|
||||
--enable-shared-library
|
||||
endif
|
||||
|
||||
define Package/libbbf_api/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.so* $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/share/bbfdm
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/dmmap
|
||||
$(INSTALL_DIR) $(1)/etc/bbfdm/json
|
||||
$(INSTALL_DIR) $(1)/usr/lib/bbfdm
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.so* $(1)/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/* $(1)/usr/share/bbfdm
|
||||
endef
|
||||
|
||||
define Package/libbbfdm/prerm
|
||||
#!/bin/sh
|
||||
rm -rf /etc/bbfdm/*
|
||||
rm -rf /etc/bbfdm/dmmap/*
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbfdm
|
||||
$(INSTALL_DIR) $(1)/usr/include/libbbf_api
|
||||
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(CP) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.h $(1)/usr/include/libbbfdm/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/libbbf_api/*.h $(1)/usr/include/libbbf_api/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbfdm.{a,so*} $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/.libs/libbbf_api.{a,so*} $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libbbf_api))
|
||||
|
||||
@@ -8,10 +8,20 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulkdata
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.3
|
||||
|
||||
PKG_SOURCE_VERSION:=b35e7862bc17fc11dc1f757c7b93900995a28633
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/bulkdata.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
@@ -26,10 +36,6 @@ define Package/$(PKG_NAME)/description
|
||||
BBF BulkData Collection
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(CP) ./src/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
@@ -41,4 +47,4 @@ define Package/$(PKG_NAME)/install
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
PROG = bulkdatad
|
||||
LIB = libbulkdata.so
|
||||
|
||||
PROG_OBJS = bulkdata.o common.o config.o http.o log.o report.o times.o buci.o
|
||||
LIB_OBJS = datamodel.o
|
||||
|
||||
PROG_CFLAGS = $(CFLAGS) -Wall -Werror -fPIC
|
||||
PROG_LDFLAGS = $(LDFLAGS) -lubus -luci -lubox -ljson-c -lcurl -lblobmsg_json -lbbfdm
|
||||
LIB_LDFLAGS = $(LDFLAGS) -lbbf_api
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(PROG_CFLAGS) $(FPIC) -c -o $@ $<
|
||||
|
||||
all: $(PROG) $(LIB)
|
||||
|
||||
$(PROG): $(PROG_OBJS)
|
||||
$(CC) $(PROG_CFLAGS) -o $@ $^ $(PROG_LDFLAGS)
|
||||
|
||||
$(LIB): $(LIB_OBJS)
|
||||
$(CC) $(PROG_CFLAGS) $(LIB_LDFLAGS) -shared -o $@ $^
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROG) $(LIB)
|
||||
@@ -1,265 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "buci.h"
|
||||
|
||||
struct uci_context *uci_ctx = NULL;
|
||||
|
||||
int buci_init(void)
|
||||
{
|
||||
uci_ctx = uci_alloc_context();
|
||||
if (!uci_ctx) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int buci_fini(void)
|
||||
{
|
||||
if (uci_ctx) {
|
||||
uci_free_context(uci_ctx);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool buci_validate_section(const char *str)
|
||||
{
|
||||
if (!*str)
|
||||
return false;
|
||||
|
||||
for (; *str; str++) {
|
||||
unsigned char c = *str;
|
||||
|
||||
if (isalnum(c) || c == '_')
|
||||
continue;
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static int buci_init_ptr(struct uci_context *ctx, struct uci_ptr *ptr, char *package, char *section, char *option, char *value)
|
||||
{
|
||||
memset(ptr, 0, sizeof(struct uci_ptr));
|
||||
|
||||
/* value */
|
||||
if (value) {
|
||||
ptr->value = value;
|
||||
}
|
||||
ptr->package = package;
|
||||
if (!ptr->package)
|
||||
goto error;
|
||||
|
||||
ptr->section = section;
|
||||
if (!ptr->section) {
|
||||
ptr->target = UCI_TYPE_PACKAGE;
|
||||
goto lastval;
|
||||
}
|
||||
|
||||
ptr->option = option;
|
||||
if (!ptr->option) {
|
||||
ptr->target = UCI_TYPE_SECTION;
|
||||
goto lastval;
|
||||
} else {
|
||||
ptr->target = UCI_TYPE_OPTION;
|
||||
}
|
||||
|
||||
lastval:
|
||||
if (ptr->section && !buci_validate_section(ptr->section))
|
||||
ptr->flags |= UCI_LOOKUP_EXTENDED;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct uci_section *buci_walk_section(char *package, char *section_type, struct uci_section *prev_section)
|
||||
{
|
||||
struct uci_ptr ptr;
|
||||
struct uci_element *e;
|
||||
struct uci_section *next_section;
|
||||
|
||||
if (section_type == NULL) {
|
||||
if (prev_section) {
|
||||
e = &prev_section->e;
|
||||
if (e->list.next == &prev_section->package->sections)
|
||||
return NULL;
|
||||
e = container_of(e->list.next, struct uci_element, list);
|
||||
next_section = uci_to_section(e);
|
||||
return next_section;
|
||||
}
|
||||
else {
|
||||
if (buci_init_ptr(uci_ctx, &ptr, package, NULL, NULL, NULL)) {
|
||||
return NULL;
|
||||
}
|
||||
if (uci_lookup_ptr(uci_ctx, &ptr, NULL, true) != UCI_OK) {
|
||||
return NULL;
|
||||
}
|
||||
if (ptr.p->sections.next == &ptr.p->sections)
|
||||
return NULL;
|
||||
e = container_of(ptr.p->sections.next, struct uci_element, list);
|
||||
next_section = uci_to_section(e);
|
||||
|
||||
return next_section;
|
||||
}
|
||||
}
|
||||
else {
|
||||
struct uci_list *ul, *shead = NULL;
|
||||
|
||||
if (prev_section) {
|
||||
ul = &prev_section->e.list;
|
||||
shead = &prev_section->package->sections;
|
||||
}
|
||||
else {
|
||||
if (buci_init_ptr(uci_ctx, &ptr, package, NULL, NULL, NULL)) {
|
||||
return NULL;
|
||||
}
|
||||
if (uci_lookup_ptr(uci_ctx, &ptr, NULL, true) != UCI_OK) {
|
||||
return NULL;
|
||||
}
|
||||
ul = &ptr.p->sections;
|
||||
shead = &ptr.p->sections;
|
||||
}
|
||||
while (ul->next != shead) {
|
||||
e = container_of(ul->next, struct uci_element, list);
|
||||
next_section = uci_to_section(e);
|
||||
if (strcmp(next_section->type, section_type) == 0)
|
||||
return next_section;
|
||||
ul = ul->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void buci_print_list(struct uci_list *uh, char **val, char *delimiter)
|
||||
{
|
||||
struct uci_element *e;
|
||||
static char buffer[512];
|
||||
char *buf = buffer;
|
||||
*buf = '\0';
|
||||
|
||||
uci_foreach_element(uh, e) {
|
||||
if (*buf) {
|
||||
strcat(buf, delimiter);
|
||||
strcat(buf, e->name);
|
||||
}
|
||||
else {
|
||||
strcpy(buf, e->name);
|
||||
}
|
||||
}
|
||||
*val = buf;
|
||||
}
|
||||
|
||||
struct uci_element *buci_lookup_list(struct uci_list *list, const char *name)
|
||||
{
|
||||
struct uci_element *e;
|
||||
|
||||
uci_foreach_element(list, e) {
|
||||
if (!strcmp(e->name, name))
|
||||
return e;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int uci_lookup_ptr_bysection(struct uci_context *ctx, struct uci_ptr *ptr, struct uci_section *section, char *option, char *value)
|
||||
{
|
||||
struct uci_element *e;
|
||||
memset(ptr, 0, sizeof(struct uci_ptr));
|
||||
|
||||
ptr->package = section->package->e.name;
|
||||
ptr->section = section->e.name;
|
||||
ptr->option = option;
|
||||
ptr->value = value;
|
||||
ptr->flags |= UCI_LOOKUP_DONE;
|
||||
|
||||
ptr->p = section->package;
|
||||
ptr->s = section;
|
||||
|
||||
if (ptr->option) {
|
||||
e = buci_lookup_list(&ptr->s->options, ptr->option);
|
||||
if (!e)
|
||||
return UCI_OK;
|
||||
ptr->o = uci_to_option(e);
|
||||
ptr->last = e;
|
||||
ptr->target = UCI_TYPE_OPTION;
|
||||
}
|
||||
else {
|
||||
ptr->last = &ptr->s->e;
|
||||
ptr->target = UCI_TYPE_SECTION;
|
||||
}
|
||||
|
||||
ptr->flags |= UCI_LOOKUP_COMPLETE;
|
||||
|
||||
return UCI_OK;
|
||||
}
|
||||
|
||||
char *buci_get_value_bysection(struct uci_section *section, char *option)
|
||||
{
|
||||
struct uci_ptr ptr;
|
||||
char *val = "";
|
||||
|
||||
if (uci_lookup_ptr_bysection(uci_ctx, &ptr, section, option, NULL) != UCI_OK) {
|
||||
return val;
|
||||
}
|
||||
|
||||
if (!ptr.o)
|
||||
return val;
|
||||
|
||||
if(ptr.o->type == UCI_TYPE_LIST) {
|
||||
buci_print_list(&ptr.o->v.list, &val, " ");
|
||||
return val;
|
||||
}
|
||||
|
||||
if (ptr.o->v.string)
|
||||
return ptr.o->v.string;
|
||||
else
|
||||
return val;
|
||||
}
|
||||
|
||||
char *buci_get_value(char *package, char *section, char *option)
|
||||
{
|
||||
struct uci_ptr ptr;
|
||||
char *val = "";
|
||||
|
||||
if (!section || !option)
|
||||
return val;
|
||||
|
||||
if (buci_init_ptr(uci_ctx, &ptr, package, section, option, NULL)) {
|
||||
return val;
|
||||
}
|
||||
if (uci_lookup_ptr(uci_ctx, &ptr, NULL, true) != UCI_OK) {
|
||||
return val;
|
||||
}
|
||||
|
||||
if (!ptr.o)
|
||||
return val;
|
||||
|
||||
if(ptr.o->type == UCI_TYPE_LIST) {
|
||||
buci_print_list(&ptr.o->v.list, &val, " ");
|
||||
return val;
|
||||
}
|
||||
|
||||
if (ptr.o->v.string)
|
||||
return ptr.o->v.string;
|
||||
else
|
||||
return val;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BUCI_H
|
||||
#define __BUCI_H
|
||||
|
||||
#include <uci.h>
|
||||
|
||||
int buci_init(void);
|
||||
int buci_fini(void);
|
||||
struct uci_section *buci_walk_section(char *package, char *section_type, struct uci_section *prev_section);
|
||||
void buci_print_list(struct uci_list *uh, char **val, char *delimiter);
|
||||
struct uci_element *buci_lookup_list(struct uci_list *list, const char *name);
|
||||
int uci_lookup_ptr_bysection(struct uci_context *ctx, struct uci_ptr *ptr, struct uci_section *section, char *option, char *value);
|
||||
char *buci_get_value_bysection(struct uci_section *section, char *option);
|
||||
char *buci_get_value(char *package, char *section, char *option);
|
||||
|
||||
#define buci_foreach_section(package, section_type, section) \
|
||||
for (section = buci_walk_section(package, section_type, NULL); \
|
||||
section != NULL; \
|
||||
section = buci_walk_section(package, section_type, section))
|
||||
|
||||
#endif //__BUCI_H
|
||||
@@ -1,144 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
* Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <libubox/uloop.h>
|
||||
|
||||
#include "http.h"
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "common.h"
|
||||
#include "report.h"
|
||||
#include "times.h"
|
||||
#include "bulkdata.h"
|
||||
|
||||
struct bulkdata bulkdata_main = {0};
|
||||
int profiles_number = 0;
|
||||
|
||||
void bulkdata_profile_cb(struct uloop_timeout *timeout);
|
||||
|
||||
int get_retry_period(int min)
|
||||
{
|
||||
srand(time(NULL));
|
||||
return rand()%min + min;
|
||||
}
|
||||
|
||||
static void bulkdata_run_profiles(struct bulkdata *bulkdata)
|
||||
{
|
||||
unsigned int next_period;
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < profiles_number; i++) {
|
||||
bulkdata->profile[i].utimer.cb = bulkdata_profile_cb;
|
||||
LIST_HEAD(failedreports);
|
||||
bulkdata->profile[i].failed_reports = &failedreports;
|
||||
next_period = get_next_period(bulkdata->profile[i].time_reference, bulkdata->profile[i].reporting_interval);
|
||||
bulkdata_log(SINFO, "The session of profile_id %d will be start in %d sec", bulkdata->profile[i].profile_id, next_period);
|
||||
uloop_timeout_set(&bulkdata->profile[i].utimer, next_period * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
int http_send_report(struct profile *profile, char *report)
|
||||
{
|
||||
char *msg_in = NULL;
|
||||
int http_code;
|
||||
|
||||
http_client_init(profile);
|
||||
bulkdata_log(SINFO, "Send the report of profile_id %d to Bulkdata Collector", profile->profile_id);
|
||||
http_code = http_send_message(profile, report, strlen(report), &msg_in);
|
||||
http_client_exit();
|
||||
return http_code;
|
||||
}
|
||||
|
||||
void bulkdata_profile_cb(struct uloop_timeout *timeout)
|
||||
{
|
||||
struct profile *profile;
|
||||
unsigned int http_code, retry_period;
|
||||
char *report = NULL;
|
||||
|
||||
profile = container_of(timeout, struct profile, utimer);
|
||||
time_t now = time(NULL);
|
||||
|
||||
bulkdata_log(SINFO, "New session of profile_id %d started", profile->profile_id);
|
||||
if(profile->retry_count == 0 || profile->next_retry > now || !profile->http_retry_enable) //Perdiodic execution
|
||||
create_encoding_bulkdata_report(profile, &report);
|
||||
else
|
||||
create_failed_report(profile, &report);
|
||||
|
||||
bulkdata_log(SDEBUG, "The content of the profile_id report %d is :\n==========\n%s\n==========\n", profile->profile_id, report);
|
||||
http_code= http_send_report(profile, report);
|
||||
if(http_code != 200){
|
||||
if(profile->retry_count == 0 || profile->next_retry > now || !profile->http_retry_enable) { //Perdiodic execution
|
||||
retry_period = get_retry_period(profile->http_retry_minimum_wait_interval);
|
||||
profile->next_period = now + profile->reporting_interval;
|
||||
profile->next_retry = now + retry_period;
|
||||
profile->retry_count = 1;
|
||||
profile->min_retry = profile->http_retry_minimum_wait_interval * 2;
|
||||
if((profile->next_retry < profile->next_period) && profile->http_retry_enable) {
|
||||
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, retry_period);
|
||||
uloop_timeout_set(timeout, 1000 * retry_period);
|
||||
}
|
||||
else {
|
||||
bulkdata_log(SINFO, "Start New session of profile_id %d in %d sec", profile->profile_id, profile->reporting_interval);
|
||||
uloop_timeout_set(timeout, 1000 * profile->reporting_interval);
|
||||
}
|
||||
} else { //Retry execution
|
||||
retry_period= get_retry_period(profile->min_retry);
|
||||
profile->min_retry*=2;
|
||||
profile->next_retry+=retry_period;
|
||||
profile->retry_count++;
|
||||
if(profile->next_retry < profile->next_period) {
|
||||
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, retry_period);
|
||||
uloop_timeout_set(timeout, 1000 * retry_period);
|
||||
}
|
||||
else {
|
||||
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, (profile->next_period-profile->next_retry+retry_period));
|
||||
uloop_timeout_set(timeout, 1000 * (profile->next_period-profile->next_retry+retry_period));
|
||||
}
|
||||
}
|
||||
if(profile->new_report){
|
||||
bulkdata_add_failed_report(profile, profile->new_report);
|
||||
FREE(profile->new_report);
|
||||
}
|
||||
FREE(report);
|
||||
} else {
|
||||
if(profile->retry_count == 0 || profile->next_retry > now || !profile->http_retry_enable) {
|
||||
bulkdata_log(SINFO, "Start New session of profile_id %d in %d sec", profile->profile_id, profile->reporting_interval);
|
||||
uloop_timeout_set(timeout, 1000 * profile->reporting_interval);
|
||||
}
|
||||
else {
|
||||
bulkdata_log(SINFO, "Retry session of profile_id %d in %d sec", profile->profile_id, (profile->next_period-profile->next_retry));
|
||||
uloop_timeout_set(timeout, 1000 * (profile->next_period-profile->next_retry));
|
||||
}
|
||||
FREE(profile->new_report);
|
||||
FREE(report);
|
||||
empty_failed_reports_list(profile);
|
||||
profile->retry_count= 0;
|
||||
}
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
struct bulkdata *bulkdata = &bulkdata_main;
|
||||
if (bulkdata_config_init(bulkdata) == -1)
|
||||
return -1;
|
||||
bulkdata_log(SINFO, "Start bulkdatad daemon");
|
||||
|
||||
uloop_init();
|
||||
bulkdata_run_profiles(bulkdata);
|
||||
uloop_run();
|
||||
uloop_done();
|
||||
|
||||
bulkdata_config_fini(bulkdata);
|
||||
bulkdata_log(SINFO, "Stop bulkdatad daemon");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __BULKDATA_H
|
||||
#define __BULKDATA_H
|
||||
|
||||
extern struct bulkdata bulkdata_main;
|
||||
extern int profiles_number;
|
||||
|
||||
#endif /* __BULKDATA_H */
|
||||
@@ -1,105 +0,0 @@
|
||||
# README #
|
||||
|
||||
bulkdatad is an implementation of The HTTP bulk data collection mechanism which is an extended feature of CPE and other agents implementing TR-069(CWMP) or TR-369(USP), defined by the Broadband Forum. It provides a means by which an Auto-Configuration Server (ACS), or USP Controller, can configure an agent to periodically send a JSON or CSV formatted set of Device information to an HTTP server running a data collection application.
|
||||
|
||||
## Configuration File ##
|
||||
|
||||
The bulkdatad UCI configuration is located in **'/etc/config/bulkdata'**, and contains 4 sections: **bulkdata**, **profile**, **profile\_parameter** and **profile\_http\_request\_uri\_parameter**.
|
||||
|
||||
```
|
||||
config bulkdata 'bulkdata'
|
||||
option enable '0'
|
||||
option log_level '3'
|
||||
|
||||
config profile
|
||||
option profile_id '1'
|
||||
option enable '0'
|
||||
option csv_encoding_row_time_stamp 'unix'
|
||||
option json_encoding_report_time_stamp 'unix'
|
||||
option http_retry_minimum_wait_interval '5'
|
||||
option http_retry_interval_multiplier '2000'
|
||||
|
||||
config profile_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
|
||||
config profile_http_request_uri_parameter
|
||||
option profile_id '1'
|
||||
option name ''
|
||||
option reference ''
|
||||
```
|
||||
|
||||
### bulkdata section ###
|
||||
|
||||
It defines **bulkdata configuration**: enable and log\_level.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ----------- | ------- | ----------------------------------------------------------------------------------------------- |
|
||||
| `enable` | boolean | Enables the BulkData feature if set to **1**. |
|
||||
| `log_level` | integer | Specifies the log type to use, by default **'INFO'**. The possible types are **'EMERG', 'ALERT', 'CRITIC' ,'ERROR', 'WARNING', 'NOTICE', 'INFO' and 'DEBUG'**. |
|
||||
|
||||
### profile section ###
|
||||
|
||||
It defines **the profile section configuration**: enable, name,... The possible options for **profile** section are listed below:
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---------------------------------- | ------- | ---------------------------------------------- |
|
||||
| `profile_id` | integer | The profile id to use. |
|
||||
| `enable` | boolean | If set to **1**, enables the bulkdata profile. |
|
||||
| `name` | string | The name of the profile. |
|
||||
| `nbre_of_retained_failed_reports` | integer | The number of failed reports to be retained and transmitted at the end of the current reporting interval. |
|
||||
| `protocol` | string | The protocol used for the collection profile. |
|
||||
| `encoding_type` | string | The encoding type used for the collection profile. |
|
||||
| `reporting_interval` | integer | The reporting interval in seconds. |
|
||||
| `time_reference` | integer | The time reference to determine when the profile will be transmitted to the ACS collector. |
|
||||
| `csv_encoding_field_separator` | string | The field separator to use when encoding CSV data. |
|
||||
| `csv_encoding_row_separator` | string | The row separator to use when encoding CSV data. |
|
||||
| `csv_encoding_escape_character` | string | The escape character to use when encoding CSV data. |
|
||||
| `csv_encoding_report_format` | string | Describes how reports will be formatted. Two possible formats are supported: **'ParameterPerRow' and 'ParameterPerColumn'**. |
|
||||
| `csv_encoding_row_time_stamp` | string | The format of the timestamp to use for data inserted into the row. The row time stamp supported are **'Unix-Epoch', 'ISO-8601' and 'None'**. |
|
||||
| `json_encoding_report_format` | string | Describes the report format. The supported report formats are **'ObjectHierarchy' and 'NameValuePair'**. |
|
||||
| `json_encoding_report_time_stamp` | string | The format of the timestamp to use for the JSON Object named "CollectionTime". The supported timestamp are **'Unix-Epoch', 'ISO-8601' and 'None'**. |
|
||||
| `http_url` | string | The URL of the collection server. |
|
||||
| `http_username` | string | The username of the collection server. |
|
||||
| `http_password` | string | The password of the collection server. |
|
||||
| `http_compression` | string | The HTTP Compression mechanism used by the collection server. The supported compression mechanism are **'GZIP', 'Compress' and 'Deflate'**. |
|
||||
| `http_method` | string | The HTTP method used by the collection server. Two methods are supported: **'POST' and 'PUT'**. |
|
||||
| `http_use_date_header` | boolean | If set to **1**, the CPE encodes the HTTP Date Header. |
|
||||
| `http_retry_enable` | boolean | If set to **1**, the CPE retries unsuccessful attempts to transfer data. |
|
||||
| `http_retry_minimum_wait_interval` | integer | The data transfer retry wait interval. |
|
||||
| `http_retry_interval_multiplier` | integer | The retry interval multiplier. |
|
||||
| `http_persist_across_reboot` | boolean | If set to **1**, failed data transfers must be persisted across reboots. |
|
||||
|
||||
### profile_parameter section ###
|
||||
|
||||
It defines **the profile\_parameter section configuration**: profile\_id, name, reference.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------- | --------------------------------------- |
|
||||
| `profile_id` | integer | The id of the used profile. |
|
||||
| `name` | string | The name of the profile parameter. |
|
||||
| `reference` | string | The reference of the profile parameter. |
|
||||
|
||||
### profile_http_request_uri_parameter section ###
|
||||
|
||||
It defines **the profile\_http\_request\_uri\_parameter section configuration**: profile\_id, name, reference.
|
||||
|
||||
| Name | Type | Description |
|
||||
| ------------ | ------- | --------------------------------------- |
|
||||
| `profile_id` | integer | The id of the used profile. |
|
||||
| `name` | string | The name of the Request-URI parameter. |
|
||||
| `reference` | string | The reference of the profile parameter. |
|
||||
|
||||
## Dependencies ##
|
||||
|
||||
To successfully build bulkdatad, the following libraries are needed:
|
||||
|
||||
| Dependency | Link | License |
|
||||
| ----------- | ------------------------------------------- | -------------- |
|
||||
| libuci | https://git.openwrt.org/project/uci.git | LGPL 2.1 |
|
||||
| libubox | https://git.openwrt.org/project/libubox.git | BSD |
|
||||
| libjson-c | https://s3.amazonaws.com/json-c_releases | MIT |
|
||||
| libcurl | https://dl.uxnr.de/mirror/curl | MIT |
|
||||
| libbbfdm | https://dev.iopsys.eu/iopsys/bbf.git | LGPL 2.1 |
|
||||
|
||||
@@ -1,450 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
* Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
|
||||
static pathnode *head = NULL;
|
||||
static pathnode *temphead = NULL;
|
||||
|
||||
int bulkdata_dm_ctx_init(struct dmctx *ctx)
|
||||
{
|
||||
struct bulkdata *bulkdata = &bulkdata_main;
|
||||
dm_ctx_init(ctx, bulkdata->instance_mode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bulkdata_dm_ctx_clean(struct dmctx *ctx)
|
||||
{
|
||||
dm_ctx_clean(ctx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char **str_split(const char* str, const char* delim, size_t* numtokens)
|
||||
{
|
||||
char *s = strdup(str);
|
||||
size_t tokens_alloc = 1;
|
||||
size_t tokens_used = 0;
|
||||
char **tokens = calloc(tokens_alloc, sizeof(char*));
|
||||
char *token, *strtok_ctx;
|
||||
for (token = strtok_r(s, delim, &strtok_ctx); token != NULL; token = strtok_r(NULL, delim, &strtok_ctx)) {
|
||||
if (tokens_used == tokens_alloc) {
|
||||
tokens_alloc *= 2;
|
||||
tokens = realloc(tokens, tokens_alloc * sizeof(char*));
|
||||
}
|
||||
tokens[tokens_used++] = strdup(token);
|
||||
}
|
||||
// cleanup
|
||||
if (tokens_used == 0) {
|
||||
FREE(tokens);
|
||||
} else {
|
||||
tokens = realloc(tokens, tokens_used * sizeof(char*));
|
||||
}
|
||||
*numtokens = tokens_used;
|
||||
FREE(s);
|
||||
return tokens;
|
||||
}
|
||||
|
||||
static bool bulkdata_match(const char *string, const char *pattern)
|
||||
{
|
||||
regex_t re;
|
||||
if (regcomp(&re, pattern, REG_EXTENDED) != 0) return 0;
|
||||
int status = regexec(&re, string, 0, NULL, 0);
|
||||
regfree(&re);
|
||||
if (status != 0) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool is_res_required(char *str, int *start, int *len)
|
||||
{
|
||||
char temp_char[NAME_MAX] = {'\0'};
|
||||
|
||||
if (bulkdata_match(str, GLOB_CHAR)) {
|
||||
int s_len = strlen(str);
|
||||
int b_len = s_len, p_len = s_len;
|
||||
|
||||
char *star = strchr(str, '*');
|
||||
if(star)
|
||||
s_len = star - str;
|
||||
*start = MIN(MIN(s_len, p_len), b_len);
|
||||
if (*start == s_len)
|
||||
*len = 1;
|
||||
|
||||
strncpy(temp_char, str+*start, *len);
|
||||
|
||||
if (bulkdata_match(temp_char, "[*+]+"))
|
||||
return true;
|
||||
}
|
||||
*start = strlen(str);
|
||||
return false;
|
||||
}
|
||||
|
||||
static void insert(char *data, bool active)
|
||||
{
|
||||
pathnode *link = (pathnode*) calloc(1, sizeof(pathnode));
|
||||
if(!link) {
|
||||
return;
|
||||
}
|
||||
|
||||
link->ref_path = data;
|
||||
|
||||
if(active) {
|
||||
link->next = head;
|
||||
head = link;
|
||||
} else {
|
||||
link->next = temphead;
|
||||
temphead = link;
|
||||
}
|
||||
}
|
||||
|
||||
static void swap_heads(void)
|
||||
{
|
||||
pathnode *temp = head;
|
||||
head = temphead;
|
||||
temphead = temp;
|
||||
}
|
||||
|
||||
static void deleteList(void)
|
||||
{
|
||||
pathnode *ptr = head, *temp;
|
||||
while(ptr != NULL) {
|
||||
temp = ptr;
|
||||
free(ptr->ref_path);
|
||||
if(ptr->next != NULL) {
|
||||
ptr = ptr->next;
|
||||
} else {
|
||||
ptr = NULL;
|
||||
}
|
||||
free(temp);
|
||||
}
|
||||
head = NULL;
|
||||
swap_heads();
|
||||
}
|
||||
|
||||
void bulkdata_add_data_to_list(struct list_head *dup_list, char *name, char *value, char *type)
|
||||
{
|
||||
struct resultsnode *link;
|
||||
link = calloc(1, sizeof(struct resultsnode));
|
||||
list_add_tail(&link->list, dup_list);
|
||||
link->name = strdup(name);
|
||||
link->data = strdup(value);
|
||||
link->type = strdup(type);
|
||||
}
|
||||
|
||||
void bulkdata_delete_data_from_list(struct resultsnode *link)
|
||||
{
|
||||
list_del(&link->list);
|
||||
FREE(link->name);
|
||||
FREE(link->data);
|
||||
FREE(link->type);
|
||||
FREE(link);
|
||||
}
|
||||
|
||||
void bulkdata_free_data_from_list(struct list_head *dup_list)
|
||||
{
|
||||
struct resultsnode *link;
|
||||
while (dup_list->next != dup_list) {
|
||||
link = list_entry(dup_list->next, struct resultsnode, list);
|
||||
bulkdata_delete_data_from_list(link);
|
||||
}
|
||||
}
|
||||
|
||||
static bool bulkdata_get(int operation, char *path, struct dmctx *dm_ctx)
|
||||
{
|
||||
int fault = 0;
|
||||
|
||||
switch(operation) {
|
||||
case CMD_GET_NAME:
|
||||
fault = dm_entry_param_method(dm_ctx, CMD_GET_NAME, path, "true", NULL);
|
||||
break;
|
||||
case CMD_GET_VALUE:
|
||||
fault = dm_entry_param_method(dm_ctx, CMD_GET_VALUE, path, NULL, NULL);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (dm_ctx->list_fault_param.next != &dm_ctx->list_fault_param) {
|
||||
return false;
|
||||
}
|
||||
if (fault) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
char *bulkdata_get_value_param(char *path)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
struct dm_parameter *n;
|
||||
char *value = NULL;
|
||||
|
||||
bulkdata_dm_ctx_init(&ctx);
|
||||
if(bulkdata_get(CMD_GET_VALUE, path, &ctx)) {
|
||||
list_for_each_entry(n, &ctx.list_parameter, list) {
|
||||
value = strdup(n->data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
bulkdata_dm_ctx_clean(&ctx);
|
||||
return value;
|
||||
}
|
||||
|
||||
void bulkdata_get_value(char *path, struct list_head *list)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
struct dm_parameter *n;
|
||||
|
||||
bulkdata_dm_ctx_init(&ctx);
|
||||
if(bulkdata_get(CMD_GET_VALUE, path, &ctx)) {
|
||||
list_for_each_entry(n, &ctx.list_parameter, list) {
|
||||
bulkdata_add_data_to_list(list, n->name, n->data, n->type);
|
||||
}
|
||||
}
|
||||
bulkdata_dm_ctx_clean(&ctx);
|
||||
}
|
||||
|
||||
bool bulkdata_get_name(char *path)
|
||||
{
|
||||
struct dmctx ctx = {0};
|
||||
struct dm_parameter *n;
|
||||
bool ret = false;
|
||||
|
||||
bulkdata_dm_ctx_init(&ctx);
|
||||
if(bulkdata_get(CMD_GET_NAME, path, &ctx)) {
|
||||
list_for_each_entry(n, &ctx.list_parameter, list) {
|
||||
insert(strdup(n->name), false);
|
||||
}
|
||||
ret = true;
|
||||
}
|
||||
bulkdata_dm_ctx_clean(&ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void fill_node_path(void)
|
||||
{
|
||||
pathnode *p=head;
|
||||
while(p!=NULL) {
|
||||
bulkdata_get_name(p->ref_path);
|
||||
p=p->next;
|
||||
}
|
||||
deleteList();
|
||||
}
|
||||
|
||||
static void bulkdata_filter_results(char *path, int start, int end)
|
||||
{
|
||||
int startpos = start, m_index = 0, m_len = 0;
|
||||
char *pp = path + startpos;
|
||||
char exp[NAME_MAX] = {'\0'};
|
||||
|
||||
if(start >= end) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!is_res_required(pp, &m_index, &m_len)) {
|
||||
//append rest of the path to the final list
|
||||
if(pp == path ) {
|
||||
insert(strdup(pp), true);
|
||||
return;
|
||||
}
|
||||
|
||||
pathnode *p = head;
|
||||
while(p != NULL) {
|
||||
char name[NAME_MAX] = {'\0'};
|
||||
strcpy(name, p->ref_path);
|
||||
strcat(name, pp);
|
||||
insert(strdup(name), false);
|
||||
p = p->next;
|
||||
}
|
||||
deleteList();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the string before the match
|
||||
char name[NAME_MAX]={'\0'};
|
||||
strncpy(name, pp, m_index);
|
||||
|
||||
pathnode *p = head;
|
||||
if(p == NULL) {
|
||||
insert(strdup(name), false);
|
||||
}
|
||||
|
||||
while(p != NULL) {
|
||||
char ref_name[NAME_MAX] = {'\0'};
|
||||
sprintf(ref_name, "%s%s", p->ref_path, name);
|
||||
insert(strdup(ref_name), false);
|
||||
p = p->next;
|
||||
}
|
||||
deleteList();
|
||||
|
||||
startpos += m_index;
|
||||
strncpy(exp, pp+m_index, m_len);
|
||||
pp = path + startpos;
|
||||
fill_node_path();
|
||||
startpos += 2;
|
||||
bulkdata_filter_results(path, startpos, end);
|
||||
}
|
||||
|
||||
static void bulkdata_parse_results(struct list_head *list)
|
||||
{
|
||||
pathnode *p = head;
|
||||
while(p != NULL) {
|
||||
bulkdata_get_value(p->ref_path, list);
|
||||
p = p->next;
|
||||
}
|
||||
deleteList();
|
||||
}
|
||||
|
||||
void bulkdata_get_value_results(char *path, struct list_head *list)
|
||||
{
|
||||
bulkdata_filter_results(path, 0, strlen(path));
|
||||
bulkdata_parse_results(list);
|
||||
}
|
||||
|
||||
char *create_request_url(struct profile *profile)
|
||||
{
|
||||
int i = 0, http_uri_number = profile->profile_http_request_uri_parameter_number;
|
||||
char *value, *uri_param = NULL, *uri_tmp = NULL, *http_url = NULL;
|
||||
|
||||
for (i = 0; i < http_uri_number; i++)
|
||||
{
|
||||
if((profile->profile_http_uri_parameter[i].reference == NULL) || (profile->profile_http_uri_parameter[i].name == NULL))
|
||||
continue;
|
||||
value = bulkdata_get_value_param(profile->profile_http_uri_parameter[i].reference);
|
||||
if(!uri_param) {
|
||||
asprintf(&uri_param, "&%s=%s", profile->profile_http_uri_parameter[i].name, value);
|
||||
free(value);
|
||||
}
|
||||
else {
|
||||
uri_tmp = strdup(uri_param);
|
||||
free(uri_param);
|
||||
asprintf(&uri_param, "%s&%s=%s", uri_tmp, profile->profile_http_uri_parameter[i].name, value);
|
||||
free(value);
|
||||
free(uri_tmp);
|
||||
}
|
||||
}
|
||||
if(uri_param) {
|
||||
asprintf(&http_url, "%s%s", profile->http_url, uri_param);
|
||||
free(uri_param);
|
||||
} else {
|
||||
asprintf(&http_url, "%s", profile->http_url);
|
||||
}
|
||||
return http_url;
|
||||
}
|
||||
|
||||
char *get_bulkdata_profile_parameter_name(char *paramref, char *paramname, char *param)
|
||||
{
|
||||
char **paramarr, *idx1 = NULL, *idx2 = NULL, *res = NULL, *instance = NULL, *tmp = NULL, *retparam = NULL, *s = NULL;
|
||||
int i, j = 0;
|
||||
size_t length;
|
||||
|
||||
if(paramname == NULL || strlen(paramname) <= 0)
|
||||
return strdup(param);
|
||||
paramarr = str_split(paramref, "*", &length);
|
||||
res = strdup(paramname);
|
||||
for(i = 0; i < length; i++) {
|
||||
if(i == length - 1)
|
||||
break;
|
||||
j++;
|
||||
idx1 = strstr(param, paramarr[i]);
|
||||
idx2 = strstr(param, paramarr[i+1]);
|
||||
instance = (char*)calloc(idx2 - idx1 - strlen(paramarr[i]) + 1, sizeof(char));
|
||||
memcpy(instance, idx1 + strlen(paramarr[i]), idx2 - idx1 - strlen(paramarr[i]));
|
||||
tmp = strdup(res);
|
||||
FREE(res);
|
||||
asprintf(&res, "%s.%s", tmp, instance);
|
||||
FREE(tmp);
|
||||
FREE(instance);
|
||||
}
|
||||
if ((s = strstr(param,paramarr[j]) ) != NULL && strlen(s) == strlen(paramarr[j]))
|
||||
asprintf(&retparam, "%s", res);
|
||||
else
|
||||
asprintf(&retparam, "%s.%s", res, strstr(param, paramarr[j]) + strlen(paramarr[j]));
|
||||
|
||||
FREE(res);
|
||||
for(int k = 0; k < length; k++)
|
||||
FREE(paramarr[k]);
|
||||
FREE(paramarr);
|
||||
|
||||
return retparam;
|
||||
}
|
||||
|
||||
void append_string_to_string(char *strappend, char **target)
|
||||
{
|
||||
char *tmp = NULL;
|
||||
|
||||
if(strappend == NULL || strlen(strappend) <= 0)
|
||||
return;
|
||||
if(*target == NULL || strlen(*target) <= 0) {
|
||||
*target = strdup(strappend);
|
||||
return;
|
||||
} else {
|
||||
tmp = strdup(*target);
|
||||
FREE(*target);
|
||||
}
|
||||
asprintf(target, "%s%s", tmp, strappend);
|
||||
FREE(tmp);
|
||||
}
|
||||
|
||||
void bulkdata_add_failed_report(struct profile *profile, char *freport)
|
||||
{
|
||||
struct failed_reports *report, *retreport, *rtmp;
|
||||
|
||||
if(profile->nbre_failed_reports < profile->nbre_of_retained_failed_reports || profile->nbre_of_retained_failed_reports < 0) {
|
||||
profile->nbre_failed_reports++;
|
||||
} else {
|
||||
list_for_each_entry_safe(retreport, rtmp, profile->failed_reports, list) {
|
||||
bulkdata_delete_failed_report(retreport);
|
||||
break;
|
||||
}
|
||||
}
|
||||
report = calloc(1, sizeof(struct failed_reports));
|
||||
list_add_tail(&report->list, profile->failed_reports);
|
||||
report->freport= strdup(freport);
|
||||
}
|
||||
|
||||
void bulkdata_delete_failed_report(struct failed_reports *report)
|
||||
{
|
||||
if(report != NULL) {
|
||||
list_del(&report->list);
|
||||
FREE(report->freport);
|
||||
FREE(report);
|
||||
}
|
||||
}
|
||||
|
||||
struct failed_reports* empty_failed_reports_list(struct profile *profile)
|
||||
{
|
||||
struct failed_reports *report, *rtmp;
|
||||
|
||||
if(list_empty(profile->failed_reports))
|
||||
return NULL;
|
||||
list_for_each_entry_safe(report, rtmp, profile->failed_reports, list) {
|
||||
list_del(&report->list);
|
||||
FREE(report->freport);
|
||||
FREE(report);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void add_failed_reports_to_report_csv(struct profile *profile, char **report, int isnext)
|
||||
{
|
||||
struct failed_reports *retreport = NULL;
|
||||
int j = 0;
|
||||
|
||||
if(list_empty(profile->failed_reports))
|
||||
return;
|
||||
list_for_each_entry(retreport, profile->failed_reports, list) {
|
||||
if(!j && isnext) {
|
||||
j = 1;
|
||||
continue;
|
||||
}
|
||||
append_string_to_string(retreport->freport, report);
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __COMMON_H
|
||||
#define __COMMON_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <regex.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <libubox/blobmsg.h>
|
||||
#include <libubox/blobmsg_json.h>
|
||||
#include <libubox/utils.h>
|
||||
#include <libubus.h>
|
||||
|
||||
#include <libbbfdm/dmentry.h>
|
||||
#include <libbbfdm/dmbbfcommon.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "bulkdata.h"
|
||||
|
||||
typedef struct pathnode {
|
||||
char *ref_path;
|
||||
struct pathnode *next;
|
||||
} pathnode;
|
||||
|
||||
typedef struct resultsnode {
|
||||
struct list_head list;
|
||||
char *name;
|
||||
char *data;
|
||||
char *type;
|
||||
} resultsnode;
|
||||
|
||||
struct failed_reports {
|
||||
struct list_head list;
|
||||
char *freport;
|
||||
};
|
||||
|
||||
#define GLOB_CHAR "[[+*]+"
|
||||
|
||||
int bulkdata_dm_ctx_init(struct dmctx *ctx);
|
||||
int bulkdata_dm_ctx_clean(struct dmctx *ctx);
|
||||
|
||||
char *bulkdata_get_value_param(char *path);
|
||||
void bulkdata_get_value(char *path, struct list_head *list);
|
||||
|
||||
void bulkdata_free_data_from_list(struct list_head *dup_list);
|
||||
void bulkdata_get_value_results(char *path, struct list_head *list);
|
||||
char *create_request_url(struct profile *profile);
|
||||
char *get_bulkdata_profile_parameter_name(char *paramref, char *paramname, char *param);
|
||||
void append_string_to_string(char *strappend, char **target);
|
||||
void bulkdata_add_failed_report(struct profile *profile, char *freport);
|
||||
void bulkdata_delete_failed_report(struct failed_reports *report);
|
||||
|
||||
struct failed_reports *empty_failed_reports_list(struct profile *profile);
|
||||
void add_failed_reports_to_report_csv(struct profile *profile, char **report, int isnext);
|
||||
|
||||
#endif //__COMMON_H
|
||||
@@ -1,523 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
* Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <strings.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "config.h"
|
||||
#include "buci.h"
|
||||
#include "common.h"
|
||||
#include "bulkdata.h"
|
||||
|
||||
int get_log_level_config(struct bulkdata *bulkdata)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
||||
buci_init();
|
||||
value = buci_get_value("bulkdata", "bulkdata", "log_level");
|
||||
if(value != NULL && *value != '\0')
|
||||
bulkdata->log_level = atoi(value);
|
||||
else
|
||||
bulkdata->log_level = DEFAULT_LOGLEVEL;
|
||||
bulkdata_log(SDEBUG,"Log Level of Bulkdata is : %d", bulkdata->log_level);
|
||||
buci_fini();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_amd_version_config(struct bulkdata *bulkdata)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
||||
buci_init();
|
||||
value = buci_get_value("cwmp", "cpe", "amd_version");
|
||||
if(value != NULL && *value != '\0')
|
||||
bulkdata->amd_version = atoi(value);
|
||||
else
|
||||
bulkdata->amd_version = DEFAULT_AMD_VERSION;
|
||||
bulkdata_log(SDEBUG,"CWMP Amendment Version is : %d", bulkdata->amd_version);
|
||||
buci_fini();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_instance_mode_config(struct bulkdata *bulkdata)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
||||
buci_init();
|
||||
value = buci_get_value("cwmp", "cpe", "instance_mode");
|
||||
if(value != NULL && *value != '\0') {
|
||||
if(!strcmp(value, "InstanceNumber"))
|
||||
bulkdata->instance_mode = INSTANCE_MODE_NUMBER;
|
||||
else
|
||||
bulkdata->instance_mode = INSTANCE_MODE_ALIAS;
|
||||
}
|
||||
else
|
||||
bulkdata->instance_mode = DEFAULT_INSTANCE_MODE;
|
||||
bulkdata_log(SDEBUG,"CWMP Instance Mode is : %d", bulkdata->instance_mode);
|
||||
buci_fini();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_device_id_config(struct bulkdata *bulkdata)
|
||||
{
|
||||
struct dmctx dmctx = {0};
|
||||
|
||||
bulkdata_dm_ctx_init(&dmctx);
|
||||
bulkdata->device_id.manufacturer_oui = bulkdata_get_value_param("Device.DeviceInfo.ManufacturerOUI");
|
||||
bulkdata->device_id.product_class = bulkdata_get_value_param("Device.DeviceInfo.ProductClass");
|
||||
bulkdata->device_id.serial_number = bulkdata_get_value_param("Device.DeviceInfo.SerialNumber");
|
||||
bulkdata_dm_ctx_clean(&dmctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int load_profile_config(struct bulkdata *bulkdata, struct uci_section *s, int i)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
||||
value = buci_get_value_bysection(s, "profile_id");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].profile_id = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The profile_id of profile_id %d is : %d", i, bulkdata->profile[i].profile_id);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "nbre_of_retained_failed_reports");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].nbre_of_retained_failed_reports = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The nombre of retained failed reports of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].nbre_of_retained_failed_reports);
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "protocol");
|
||||
if(value != NULL && *value != '\0' && strcasecmp(value, "http")==0) {
|
||||
bulkdata->profile[i].protocol = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The protocol of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].protocol);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "encoding_type");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].encoding_type = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The encoding type of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].encoding_type);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "reporting_interval");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].reporting_interval = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The reporting interval of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].reporting_interval);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "time_reference");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].time_reference = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The time reference of profile_id %d is : %ld", bulkdata->profile[i].profile_id, bulkdata->profile[i].time_reference);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "csv_encoding_field_separator");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].csv_encoding_field_separator = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The csv encoding field separator of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_field_separator);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "csv_encoding_row_separator");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].csv_encoding_row_separator = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The csv encoding row separator of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_row_separator);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "csv_encoding_escape_character");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].csv_encoding_escape_character = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The csv encoding escape character of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_escape_character);
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "csv_encoding_report_format");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].csv_encoding_report_format = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The csv encoding report format of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_report_format);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "csv_encoding_row_time_stamp");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].csv_encoding_row_time_stamp = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The csv encoding row time stamp of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].csv_encoding_row_time_stamp);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "json_encoding_report_format");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].json_encoding_report_format = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The json encoding report format of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].json_encoding_report_format);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "json_encoding_report_time_stamp");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].json_encoding_report_time_stamp = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The json encoding report time stamp of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].json_encoding_report_time_stamp);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "http_url");
|
||||
if(value != NULL && *value != '\0') {
|
||||
char *url = NULL;
|
||||
asprintf(&url, "%s?oui=%s&pc=%s&sn=%s", value, bulkdata->device_id.manufacturer_oui, bulkdata->device_id.serial_number, bulkdata->device_id.serial_number);
|
||||
bulkdata->profile[i].http_url = strdup(url);
|
||||
free(url);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP url of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_url);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "http_username");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_username = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP username of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_username);
|
||||
} else {
|
||||
bulkdata->profile[i].http_username = NULL;
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "http_password");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_password = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP password of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_password);
|
||||
} else {
|
||||
bulkdata->profile[i].http_password = NULL;
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "http_compression");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_compression = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP compression of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_compression);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "http_method");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_method = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP method of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_method);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "http_use_date_header");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_use_date_header = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP use date header of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_use_date_header);
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "http_retry_enable");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_retry_enable = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP retry enable of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_retry_enable);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "http_retry_minimum_wait_interval");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_retry_minimum_wait_interval = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP retry minimum wait interval of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_retry_minimum_wait_interval);
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "http_retry_interval_multiplier");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_retry_interval_multiplier = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP retry interval multiplier of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_retry_interval_multiplier);
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "http_persist_across_reboot");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_persist_across_reboot = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP persist across reboot of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_persist_across_reboot);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "http_ssl_capath");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_ssl_capath = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP ssl capath of profile_id %d is : %s", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_ssl_capath);
|
||||
} else {
|
||||
bulkdata->profile[i].http_ssl_capath = NULL;
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "http_insecure_enable");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].http_insecure_enable = atoi(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP insecure enable of profile_id %d is : %d", bulkdata->profile[i].profile_id, bulkdata->profile[i].http_insecure_enable);
|
||||
}
|
||||
|
||||
bulkdata->profile[i].retry_count = 0;
|
||||
bulkdata->profile[i].nbre_failed_reports = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_profiles_enable(struct bulkdata *bulkdata)
|
||||
{
|
||||
struct uci_section *s;
|
||||
char *enable;
|
||||
int i = 0, nbr_profiles = 0;
|
||||
|
||||
buci_init();
|
||||
|
||||
buci_foreach_section("bulkdata", "profile", s) {
|
||||
enable = buci_get_value_bysection(s, "enable");
|
||||
if(strcmp(enable, "1") == 0) {
|
||||
nbr_profiles++;
|
||||
}
|
||||
}
|
||||
|
||||
if(nbr_profiles != 0)
|
||||
bulkdata->profile = calloc(2, sizeof(struct profile));
|
||||
|
||||
buci_foreach_section("bulkdata", "profile", s) {
|
||||
enable = buci_get_value_bysection(s, "enable");
|
||||
if(strcmp(enable, "1") == 0) {
|
||||
if(load_profile_config(bulkdata, s, i) == -1) {
|
||||
bulkdata_log(SCRIT,"Not able to start bulkdata: some required bulkdata configurations in profile must be set");
|
||||
return -1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
profiles_number = nbr_profiles;
|
||||
|
||||
buci_fini();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int load_profile_parameter_config(struct bulkdata *bulkdata, struct uci_section *s, int i, int j)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
||||
value = buci_get_value_bysection(s, "name");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].profile_parameter[j].name = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The parameter name %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_parameter[j].name);
|
||||
} else {
|
||||
bulkdata->profile[i].profile_parameter[j].name = NULL;
|
||||
}
|
||||
|
||||
value = buci_get_value_bysection(s, "reference");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].profile_parameter[j].reference = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The parameter reference %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_parameter[j].reference);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_profiles_parameters(struct bulkdata *bulkdata)
|
||||
{
|
||||
struct uci_section *s;
|
||||
char *profile_id;
|
||||
int i, j, nbr_profile_parameters;
|
||||
|
||||
buci_init();
|
||||
|
||||
for (i = 0; i < profiles_number; i++) {
|
||||
j = 0;
|
||||
nbr_profile_parameters = 0;
|
||||
buci_foreach_section("bulkdata", "profile_parameter", s) {
|
||||
profile_id = buci_get_value_bysection(s, "profile_id");
|
||||
if(bulkdata->profile[i].profile_id != atoi(profile_id))
|
||||
continue;
|
||||
nbr_profile_parameters++;
|
||||
if(nbr_profile_parameters == 1) {
|
||||
bulkdata->profile[i].profile_parameter = calloc(1, sizeof(struct profile_parameter));
|
||||
} else {
|
||||
bulkdata->profile[i].profile_parameter = realloc(bulkdata->profile[i].profile_parameter, nbr_profile_parameters * sizeof(struct profile_parameter));
|
||||
}
|
||||
if(load_profile_parameter_config(bulkdata, s, i, j) == -1) {
|
||||
bulkdata_log(SCRIT,"Not able to start bulkdata: some required bulkdata configurations in profile_parameter must be set");
|
||||
return -1;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
bulkdata->profile[i].profile_parameter_number = nbr_profile_parameters;
|
||||
}
|
||||
|
||||
buci_fini();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int load_profile_http_request_uri_parameter_config(struct bulkdata *bulkdata, struct uci_section *s, int i, int j)
|
||||
{
|
||||
char *value = NULL;
|
||||
|
||||
value = buci_get_value_bysection(s, "name");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].profile_http_uri_parameter[j].name = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP resuest URI parameter name %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_http_uri_parameter[j].name);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
value = buci_get_value_bysection(s, "reference");
|
||||
if(value != NULL && *value != '\0') {
|
||||
bulkdata->profile[i].profile_http_uri_parameter[j].reference = strdup(value);
|
||||
value = NULL;
|
||||
bulkdata_log(SDEBUG,"The HTTP resuest URI parameter reference %d of profile_id %d is : %s", j+1, bulkdata->profile[i].profile_id, bulkdata->profile[i].profile_http_uri_parameter[j].reference);
|
||||
} else
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int get_profile_http_request_uri_parameter(struct bulkdata *bulkdata)
|
||||
{
|
||||
struct uci_section *s;
|
||||
char *profile_id;
|
||||
int i, j, nbr_profile_http_request_uri_parameter;
|
||||
|
||||
buci_init();
|
||||
|
||||
for (i = 0; i < profiles_number; i++) {
|
||||
j = 0;
|
||||
nbr_profile_http_request_uri_parameter = 0;
|
||||
buci_foreach_section("bulkdata", "profile_http_request_uri_parameter", s) {
|
||||
profile_id = buci_get_value_bysection(s, "profile_id");
|
||||
if(bulkdata->profile[i].profile_id != atoi(profile_id))
|
||||
continue;
|
||||
nbr_profile_http_request_uri_parameter++;
|
||||
if(nbr_profile_http_request_uri_parameter == 1) {
|
||||
bulkdata->profile[i].profile_http_uri_parameter = calloc(1, sizeof(struct profile_http_request_uri_parameter));
|
||||
} else {
|
||||
bulkdata->profile[i].profile_http_uri_parameter = realloc(bulkdata->profile[i].profile_http_uri_parameter, nbr_profile_http_request_uri_parameter * sizeof(struct profile_http_request_uri_parameter));
|
||||
}
|
||||
if(load_profile_http_request_uri_parameter_config(bulkdata, s, i, j)== -1) {
|
||||
bulkdata_log(SCRIT,"Not able to start bulkdata: some required bulkdata configurations in profile_http_request_uri_parameter must be set");
|
||||
return -1;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
bulkdata->profile[i].profile_http_request_uri_parameter_number = nbr_profile_http_request_uri_parameter;
|
||||
}
|
||||
|
||||
buci_fini();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bulkdata_config_init(struct bulkdata *bulkdata)
|
||||
{
|
||||
get_log_level_config(bulkdata);
|
||||
get_amd_version_config(bulkdata);
|
||||
get_instance_mode_config(bulkdata);
|
||||
get_device_id_config(bulkdata);
|
||||
if (get_profiles_enable(bulkdata) == -1)
|
||||
return -1;
|
||||
if (get_profiles_parameters(bulkdata) == -1)
|
||||
return -1;
|
||||
if (get_profile_http_request_uri_parameter(bulkdata) == -1)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int free_device_id_config(struct bulkdata *bulkdata)
|
||||
{
|
||||
FREE(bulkdata->device_id.manufacturer_oui);
|
||||
FREE(bulkdata->device_id.product_class);
|
||||
FREE(bulkdata->device_id.serial_number);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int free_profiles_enable(struct bulkdata *bulkdata)
|
||||
{
|
||||
for(int i = 0; i < profiles_number; i++) {
|
||||
FREE(bulkdata->profile[i].protocol);
|
||||
FREE(bulkdata->profile[i].encoding_type);
|
||||
FREE(bulkdata->profile[i].csv_encoding_field_separator);
|
||||
FREE(bulkdata->profile[i].csv_encoding_row_separator);
|
||||
FREE(bulkdata->profile[i].csv_encoding_escape_character);
|
||||
FREE(bulkdata->profile[i].csv_encoding_report_format);
|
||||
FREE(bulkdata->profile[i].csv_encoding_row_time_stamp);
|
||||
FREE(bulkdata->profile[i].json_encoding_report_format);
|
||||
FREE(bulkdata->profile[i].json_encoding_report_time_stamp);
|
||||
FREE(bulkdata->profile[i].http_url);
|
||||
FREE(bulkdata->profile[i].http_username);
|
||||
FREE(bulkdata->profile[i].http_password);
|
||||
FREE(bulkdata->profile[i].http_compression);
|
||||
FREE(bulkdata->profile[i].http_method);
|
||||
FREE(bulkdata->profile[i].http_ssl_capath);
|
||||
}
|
||||
FREE(bulkdata->profile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int free_profiles_parameters(struct bulkdata *bulkdata)
|
||||
{
|
||||
for(int i = 0; i < profiles_number; i++) {
|
||||
for(int j = 0; j < bulkdata->profile[i].profile_parameter_number; j++) {
|
||||
FREE(bulkdata->profile[i].profile_parameter[j].name);
|
||||
FREE(bulkdata->profile[i].profile_parameter[j].reference);
|
||||
}
|
||||
FREE(bulkdata->profile[i].profile_parameter);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int free_profile_http_request_uri_parameter(struct bulkdata *bulkdata)
|
||||
{
|
||||
for(int i = 0; i < profiles_number; i++) {
|
||||
for(int j = 0; j < bulkdata->profile[i].profile_http_request_uri_parameter_number; j++) {
|
||||
FREE(bulkdata->profile[i].profile_http_uri_parameter[j].name);
|
||||
FREE(bulkdata->profile[i].profile_http_uri_parameter[j].reference);
|
||||
}
|
||||
FREE(bulkdata->profile[i].profile_http_uri_parameter);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bulkdata_config_fini(struct bulkdata *bulkdata)
|
||||
{
|
||||
free_device_id_config(bulkdata);
|
||||
free_profiles_parameters(bulkdata);
|
||||
free_profile_http_request_uri_parameter(bulkdata);
|
||||
free_profiles_enable(bulkdata);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __CONFIG_H
|
||||
#define __CONFIG_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <time.h>
|
||||
#include <libubox/uloop.h>
|
||||
|
||||
#define DEFAULT_AMD_VERSION 2
|
||||
#define DEFAULT_INSTANCE_MODE 0
|
||||
|
||||
typedef struct device_id {
|
||||
char *manufacturer_oui;
|
||||
char *product_class;
|
||||
char *serial_number;
|
||||
} device_id;
|
||||
|
||||
typedef struct profile_parameter {
|
||||
int profile_id;
|
||||
char *name;
|
||||
char *reference;
|
||||
} profile_parameter;
|
||||
|
||||
typedef struct profile_http_request_uri_parameter {
|
||||
int profile_id;
|
||||
char *name;
|
||||
char *reference;
|
||||
} profile_http_request_uri_parameter;
|
||||
|
||||
typedef struct profile {
|
||||
struct uloop_timeout utimer;
|
||||
int profile_id;
|
||||
int nbre_of_retained_failed_reports;
|
||||
int nbre_failed_reports;
|
||||
int reporting_interval;
|
||||
int profile_parameter_number;
|
||||
int profile_http_request_uri_parameter_number;
|
||||
int http_retry_minimum_wait_interval;
|
||||
int http_retry_interval_multiplier;
|
||||
int min_retry;
|
||||
int retry_count;
|
||||
char *protocol;
|
||||
char *encoding_type;
|
||||
char *csv_encoding_field_separator;
|
||||
char *csv_encoding_row_separator;
|
||||
char *csv_encoding_escape_character;
|
||||
char *csv_encoding_report_format;
|
||||
char *csv_encoding_row_time_stamp;
|
||||
char *json_encoding_report_format;
|
||||
char *json_encoding_report_time_stamp;
|
||||
char *http_url;
|
||||
char *http_username;
|
||||
char *http_password;
|
||||
char *http_compression;
|
||||
char *http_method;
|
||||
char *http_ssl_capath;
|
||||
char *new_report;
|
||||
time_t time_reference;
|
||||
time_t next_retry;
|
||||
time_t next_period;
|
||||
bool http_persist_across_reboot;
|
||||
bool http_insecure_enable;
|
||||
bool enable;
|
||||
bool http_use_date_header;
|
||||
bool http_retry_enable;
|
||||
struct profile_parameter *profile_parameter;
|
||||
struct profile_http_request_uri_parameter *profile_http_uri_parameter;
|
||||
struct list_head *failed_reports;
|
||||
} profile;
|
||||
|
||||
typedef struct bulkdata {
|
||||
struct device_id device_id;
|
||||
struct profile *profile;
|
||||
int log_level;
|
||||
int amd_version;
|
||||
unsigned int instance_mode;
|
||||
} bulkdata;
|
||||
|
||||
int bulkdata_config_init(struct bulkdata *bulkdata);
|
||||
int bulkdata_config_fini(struct bulkdata *bulkdata);
|
||||
|
||||
#ifndef FREE
|
||||
#define FREE(x) do { if(x) {free(x); x = NULL;} } while (0)
|
||||
#endif
|
||||
|
||||
#endif //__CONFIG_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License version 2.1
|
||||
* as published by the Free Software Foundation
|
||||
*
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#ifndef _BULKDATA_H_
|
||||
#define _BULKDATA_H_
|
||||
|
||||
#include <libbbf_api/dmcommon.h>
|
||||
|
||||
extern DMOBJ tDeviceBulkDataObj[];
|
||||
extern DMOBJ tBulkDataObj[];
|
||||
extern DMLEAF tBulkDataParams[];
|
||||
extern DMOBJ tBulkDataProfileObj[];
|
||||
extern DMLEAF tBulkDataProfileParams[];
|
||||
extern DMLEAF tBulkDataProfileParameterParams[];
|
||||
extern DMLEAF tBulkDataProfileCSVEncodingParams[];
|
||||
extern DMLEAF tBulkDataProfileJSONEncodingParams[];
|
||||
extern DMOBJ tBulkDataProfileHTTPObj[];
|
||||
extern DMLEAF tBulkDataProfileHTTPParams[];
|
||||
extern DMLEAF tBulkDataProfileHTTPRequestURIParameterParams[];
|
||||
|
||||
#endif //__BULKDATA_H_
|
||||
|
||||
@@ -1,196 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
* Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*/
|
||||
|
||||
#include "http.h"
|
||||
|
||||
static struct http_client http_c;
|
||||
static CURL *curl;
|
||||
|
||||
int http_client_init(struct profile *profile)
|
||||
{
|
||||
char *url = create_request_url(profile);
|
||||
if(url) {
|
||||
asprintf(&http_c.url, "%s", url);
|
||||
free(url);
|
||||
}
|
||||
bulkdata_log(SINFO, "ACS url: %s", http_c.url);
|
||||
|
||||
curl_global_init(CURL_GLOBAL_SSL);
|
||||
curl = curl_easy_init();
|
||||
if (!curl) return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void http_client_exit(void)
|
||||
{
|
||||
FREE(http_c.url);
|
||||
|
||||
if (http_c.header_list) {
|
||||
curl_slist_free_all(http_c.header_list);
|
||||
http_c.header_list = NULL;
|
||||
}
|
||||
|
||||
curl_easy_cleanup(curl);
|
||||
curl_global_cleanup();
|
||||
|
||||
}
|
||||
|
||||
static size_t http_get_response(void *buffer, size_t size, size_t rxed, char **msg_in)
|
||||
{
|
||||
char *c;
|
||||
|
||||
if (asprintf(&c, "%s%.*s", *msg_in, (int) (size * rxed), (char *)buffer) == -1) {
|
||||
FREE(*msg_in);
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(*msg_in);
|
||||
*msg_in = c;
|
||||
|
||||
return size * rxed;
|
||||
}
|
||||
|
||||
int http_send_message(struct profile *profile, char *msg_out, int msg_out_len, char **msg_in)
|
||||
{
|
||||
CURLcode res;
|
||||
long http_code = 0;
|
||||
char errbuf[CURL_ERROR_SIZE];
|
||||
|
||||
http_c.header_list = NULL;
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "User-Agent: iopsys-bulkdata");
|
||||
if (!http_c.header_list) return -1;
|
||||
|
||||
if (profile->http_use_date_header) {
|
||||
if (bulkdata_get_time() != NULL) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, bulkdata_get_time());
|
||||
if (!http_c.header_list) return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(profile->encoding_type, "json") == 0) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Type: application/json; charset=\"utf-8\"");
|
||||
if (!http_c.header_list) return -1;
|
||||
|
||||
if(strcmp (profile->json_encoding_report_format, "objecthierarchy") == 0) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"ObjectHierarchy\"");
|
||||
if (!http_c.header_list) return -1;
|
||||
} else if(strcmp(profile->json_encoding_report_format, "namevaluepair") == 0) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"NameValuePair\"");
|
||||
if (!http_c.header_list) return -1;
|
||||
}
|
||||
} else if(strcmp(profile->encoding_type, "csv") == 0) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Type: text/csv; charset=\"utf-8\"");
|
||||
if (!http_c.header_list) return -1;
|
||||
|
||||
if(strcmp (profile->csv_encoding_report_format, "row") == 0) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"ParameterPerRow\"");
|
||||
if (!http_c.header_list) return -1;
|
||||
} else if(strcmp (profile->csv_encoding_report_format, "column") == 0) {
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "BBF-Report-Format: \"ParameterPerColumn\"");
|
||||
if (!http_c.header_list) return -1;
|
||||
}
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_URL, http_c.url);
|
||||
curl_easy_setopt(curl, CURLOPT_USERNAME, profile->http_username);
|
||||
curl_easy_setopt(curl, CURLOPT_PASSWORD, profile->http_password);
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC|CURLAUTH_DIGEST);
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT, HTTP_TIMEOUT);
|
||||
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, HTTP_TIMEOUT);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
curl_easy_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
|
||||
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
|
||||
|
||||
if(strcasecmp(profile->http_compression, "gzip") == 0) {
|
||||
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "gzip");
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Encoding: gzip");
|
||||
} else if(strcasecmp(profile->http_compression, "compress") == 0) {
|
||||
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "compress");
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Encoding: compress");
|
||||
} else if(strcasecmp(profile->http_compression, "deflate") == 0) {
|
||||
curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING, "deflate");
|
||||
http_c.header_list = curl_slist_append(http_c.header_list, "Content-Encoding: deflate");
|
||||
}
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, http_c.header_list);
|
||||
if(strcasecmp(profile->http_method, "put") == 0)
|
||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, msg_out);
|
||||
if (msg_out)
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) msg_out_len);
|
||||
else
|
||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, http_get_response);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, msg_in);
|
||||
|
||||
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
|
||||
|
||||
if (profile->http_ssl_capath)
|
||||
curl_easy_setopt(curl, CURLOPT_CAPATH, profile->http_ssl_capath);
|
||||
if (profile->http_insecure_enable) {
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
}
|
||||
*msg_in = (char *) calloc (1, sizeof(char));
|
||||
|
||||
res = curl_easy_perform(curl);
|
||||
|
||||
if(res != CURLE_OK) {
|
||||
size_t len = strlen(errbuf);
|
||||
if(len) {
|
||||
if (errbuf[len - 1] == '\n') errbuf[len - 1] = '\0';
|
||||
bulkdata_log(SCRIT, "libcurl: (%d) %s", res, errbuf);
|
||||
} else {
|
||||
bulkdata_log(SCRIT, "libcurl: (%d) %s", res, curl_easy_strerror(res));
|
||||
}
|
||||
}
|
||||
|
||||
if (!strlen(*msg_in))
|
||||
FREE(*msg_in);
|
||||
|
||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_code);
|
||||
if(http_code == 200)
|
||||
bulkdata_log(SINFO, "Receive HTTP 200 OK from Bulkdata Collector");
|
||||
else if(http_code == 401)
|
||||
bulkdata_log(SINFO, "Receive HTTP 401 Unauthorized from Bulkdata Collector");
|
||||
else if(http_code == 204)
|
||||
bulkdata_log(SINFO, "Receive HTTP 204 No Content from Bulkdata Collector");
|
||||
else
|
||||
bulkdata_log(SINFO, "Receive HTTP %d from Bulkdata Collector", http_code);
|
||||
|
||||
if(http_code == 415)
|
||||
{
|
||||
strcpy(profile->http_compression, "None");
|
||||
goto error;
|
||||
}
|
||||
if (http_code != 200 && http_code != 204)
|
||||
goto error;
|
||||
|
||||
curl_easy_reset(curl);
|
||||
if (http_c.header_list) {
|
||||
curl_slist_free_all(http_c.header_list);
|
||||
http_c.header_list = NULL;
|
||||
}
|
||||
|
||||
if (res) goto error;
|
||||
|
||||
return http_code;
|
||||
|
||||
error:
|
||||
FREE(*msg_in);
|
||||
if (http_c.header_list) {
|
||||
curl_slist_free_all(http_c.header_list);
|
||||
http_c.header_list = NULL;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __HTTP_H
|
||||
#define __HTTP_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <curl/curl.h>
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
#include "times.h"
|
||||
#include "common.h"
|
||||
|
||||
#define HTTP_TIMEOUT 30
|
||||
|
||||
struct http_client
|
||||
{
|
||||
struct curl_slist *header_list;
|
||||
char *url;
|
||||
};
|
||||
|
||||
int http_client_init(struct profile *profile);
|
||||
void http_client_exit(void);
|
||||
int http_send_message(struct profile *profile, char *msg_out, int msg_out_len, char **msg_in);
|
||||
|
||||
#endif //__HTTP_H
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "bulkdata.h"
|
||||
#include "config.h"
|
||||
#include "log.h"
|
||||
|
||||
static const int log_syslogmap[] = {
|
||||
[SCRIT] = LOG_CRIT,
|
||||
[SWARNING] = LOG_WARNING,
|
||||
[SNOTICE] = LOG_NOTICE,
|
||||
[SINFO] = LOG_INFO,
|
||||
[SDEBUG] = LOG_DEBUG
|
||||
};
|
||||
|
||||
static const char* log_str[] = {
|
||||
[SCRIT] = "CRITICAL",
|
||||
[SWARNING] = "WARNING",
|
||||
[SNOTICE] = "NOTICE",
|
||||
[SINFO] = "INFO",
|
||||
[SDEBUG] = "DEBUG"
|
||||
};
|
||||
|
||||
void bulkdata_log(int priority, const char *format, ...)
|
||||
{
|
||||
va_list vl;
|
||||
|
||||
if (priority <= bulkdata_main.log_level) {
|
||||
time_t t = time(NULL);
|
||||
struct tm tm = *localtime(&t);
|
||||
va_start(vl, format);
|
||||
printf("%d-%02d-%02d %02d:%02d:%02d [bulkdata] %s - ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, log_str[priority]);
|
||||
vprintf(format, vl);
|
||||
va_end(vl);
|
||||
printf("\n");
|
||||
|
||||
openlog("bulkdata", 0, LOG_DAEMON);
|
||||
va_start(vl, format);
|
||||
vsyslog(log_syslogmap[priority], format, vl);
|
||||
va_end(vl);
|
||||
closelog();
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LOG_H
|
||||
#define __LOG_H
|
||||
|
||||
#define DEFAULT_LOGLEVEL SINFO
|
||||
|
||||
enum bulkdata_log_level_enum {
|
||||
SCRIT,
|
||||
SWARNING,
|
||||
SNOTICE,
|
||||
SINFO,
|
||||
SDEBUG,
|
||||
__MAX_SLOG
|
||||
};
|
||||
|
||||
void bulkdata_log(int priority, const char *format, ...);
|
||||
|
||||
#endif //__LOG_H
|
||||
@@ -1,336 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
* Author: Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "report.h"
|
||||
|
||||
static void add_new_json_obj(json_object *json_obj, char *name, char *data, char *type)
|
||||
{
|
||||
json_object *jobj;
|
||||
if(strstr(type, "unsignedInt") || strstr(type, "int") || strstr(type, "long"))
|
||||
jobj = json_object_new_int64(atoi(data));
|
||||
else if(strstr(type, "bool"))
|
||||
jobj = json_object_new_boolean(atoi(data));
|
||||
else
|
||||
jobj = json_object_new_string(data);
|
||||
|
||||
json_object_object_add(json_obj, name, jobj);
|
||||
}
|
||||
|
||||
static void create_json_bulkdata_report_object_hierarchy(struct profile *profile, char **report)
|
||||
{
|
||||
struct json_object *json_obj, *json_obj1, *json_obj2;
|
||||
struct resultsnode *p;
|
||||
int i, j, profile_param_number = profile->profile_parameter_number;
|
||||
char *param_name, *result, *pch, *pchr, *collection_time = NULL;
|
||||
char buf[1024] = {0};
|
||||
|
||||
json_obj = json_object_new_object();
|
||||
get_time_stamp(profile->json_encoding_report_time_stamp, &collection_time);
|
||||
if(collection_time) {
|
||||
if(strcmp(profile->json_encoding_report_time_stamp, "iso8601") == 0)
|
||||
json_object_object_add(json_obj, "CollectionTime", json_object_new_string(collection_time));
|
||||
else
|
||||
json_object_object_add(json_obj, "CollectionTime", json_object_new_int64(atoi(collection_time)));
|
||||
free(collection_time);
|
||||
}
|
||||
json_obj2 = json_obj;
|
||||
for (i = 0; i < profile_param_number; i++) {
|
||||
LIST_HEAD(results_list);
|
||||
bulkdata_get_value_results(profile->profile_parameter[i].reference, &results_list);
|
||||
list_for_each_entry(p, &results_list, list) {
|
||||
char *argv[128] = {0};
|
||||
j = 0;
|
||||
param_name = get_bulkdata_profile_parameter_name(profile->profile_parameter[i].reference, profile->profile_parameter[i].name, p->name);
|
||||
strcpy(buf, param_name);
|
||||
for (pch = strtok_r(buf, ".", &pchr); pch != NULL; pch = strtok_r(NULL, ".", &pchr)) {
|
||||
argv[j] = pch;
|
||||
json_obj1 = (json_object *)dmjson_select_obj(json_obj, argv);
|
||||
if (json_obj1)
|
||||
json_obj2 = json_obj1;
|
||||
else {
|
||||
if (pchr != NULL && *pchr != '\0') {
|
||||
json_object *new_obj = json_object_new_object();
|
||||
json_object_object_add(json_obj2, pch, new_obj);
|
||||
json_obj2 = new_obj;
|
||||
}
|
||||
else
|
||||
add_new_json_obj(json_obj2, pch, p->data, p->type);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
bulkdata_free_data_from_list(&results_list);
|
||||
FREE(param_name);
|
||||
}
|
||||
result = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
|
||||
*report = strdup(result);
|
||||
json_object_put(json_obj);
|
||||
}
|
||||
|
||||
static void create_json_bulkdata_report_name_value_pair(struct profile *profile, char **report)
|
||||
{
|
||||
struct json_object *json_obj;
|
||||
struct resultsnode *p;
|
||||
char *param_name, *result, *collection_time = NULL;
|
||||
int i = 0, profile_param_number = profile->profile_parameter_number;
|
||||
|
||||
json_obj = json_object_new_object();
|
||||
get_time_stamp(profile->json_encoding_report_time_stamp, &collection_time);
|
||||
if(collection_time) {
|
||||
if(strcmp(profile->json_encoding_report_time_stamp, "iso8601") == 0)
|
||||
json_object_object_add(json_obj, "CollectionTime", json_object_new_string(collection_time));
|
||||
else
|
||||
json_object_object_add(json_obj, "CollectionTime", json_object_new_int64(atoi(collection_time)));
|
||||
free(collection_time);
|
||||
}
|
||||
for (i = 0; i < profile_param_number; i++) {
|
||||
LIST_HEAD(results_list);
|
||||
bulkdata_get_value_results(profile->profile_parameter[i].reference, &results_list);
|
||||
list_for_each_entry(p, &results_list, list) {
|
||||
param_name = get_bulkdata_profile_parameter_name(profile->profile_parameter[i].reference, profile->profile_parameter[i].name, p->name);
|
||||
add_new_json_obj(json_obj, param_name, p->data, p->type);
|
||||
FREE(param_name);
|
||||
}
|
||||
bulkdata_free_data_from_list(&results_list);
|
||||
}
|
||||
result = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
|
||||
*report = strdup(result);
|
||||
json_object_put(json_obj);
|
||||
}
|
||||
|
||||
static void add_failed_reports_to_report_json(struct profile *profile, char *new_report, char **report, int isnext)
|
||||
{
|
||||
json_object *json_obj, *json_array, *json_string;
|
||||
struct failed_reports *retreport = NULL;
|
||||
char *msgout = NULL;
|
||||
int j = 0;
|
||||
|
||||
json_obj = json_object_new_object();
|
||||
json_array = json_object_new_array();
|
||||
json_object_object_add(json_obj,"Report", json_array);
|
||||
|
||||
if(list_empty(profile->failed_reports))
|
||||
goto new_report;
|
||||
|
||||
list_for_each_entry(retreport, profile->failed_reports, list) {
|
||||
if(!j && isnext) {
|
||||
j = 1;
|
||||
continue;
|
||||
}
|
||||
json_string = json_tokener_parse(retreport->freport);
|
||||
json_object_array_add(json_array, json_string);
|
||||
}
|
||||
|
||||
new_report :
|
||||
if(new_report) {
|
||||
json_string = json_tokener_parse(new_report);
|
||||
json_object_array_add(json_array, json_string);
|
||||
}
|
||||
|
||||
msgout = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
|
||||
*report = strdup(msgout);
|
||||
json_object_put(json_obj);
|
||||
}
|
||||
|
||||
static void create_report_json(char *new_report, char **report)
|
||||
{
|
||||
json_object *json_obj, *json_array, *json_string;
|
||||
char *msgout = NULL;
|
||||
|
||||
json_obj = json_object_new_object();
|
||||
json_array = json_object_new_array();
|
||||
json_object_object_add(json_obj,"Report", json_array);
|
||||
|
||||
if(new_report) {
|
||||
json_string = json_tokener_parse(new_report);
|
||||
json_object_array_add(json_array, json_string);
|
||||
}
|
||||
|
||||
msgout = (char *)json_object_to_json_string_ext(json_obj, JSON_C_TO_STRING_PRETTY);
|
||||
*report = strdup(msgout);
|
||||
json_object_put(json_obj);
|
||||
}
|
||||
|
||||
int create_json_bulkdata_report(struct profile *profile, char **report)
|
||||
{
|
||||
/*
|
||||
* create json msg of current report
|
||||
* parse failed reports list and add it to the report
|
||||
* then add new report to the report
|
||||
*/
|
||||
char *msgout;
|
||||
|
||||
profile->new_report = NULL;
|
||||
if(strcmp(profile->json_encoding_report_format, "objecthierarchy") == 0) {
|
||||
create_json_bulkdata_report_object_hierarchy(profile, &msgout);
|
||||
} else if(strcmp(profile->json_encoding_report_format, "namevaluepair") == 0) {
|
||||
create_json_bulkdata_report_name_value_pair(profile, &msgout);
|
||||
}
|
||||
|
||||
if(profile->nbre_of_retained_failed_reports != 0) {
|
||||
if(profile->nbre_failed_reports >= profile->nbre_of_retained_failed_reports && profile->nbre_of_retained_failed_reports > 0)
|
||||
add_failed_reports_to_report_json(profile, msgout, report, 1);
|
||||
else
|
||||
add_failed_reports_to_report_json(profile, msgout, report, 0);
|
||||
} else {
|
||||
create_report_json(msgout, report);
|
||||
}
|
||||
|
||||
append_string_to_string(msgout, &profile->new_report);
|
||||
FREE(msgout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int create_csv_bulkdata_report(struct profile *profile, char **report)
|
||||
{
|
||||
/*
|
||||
* create csv msg of current report
|
||||
* parse failed reports list and add it to the report
|
||||
*/
|
||||
int i;
|
||||
struct resultsnode *p;
|
||||
char *str1 = NULL, *str2 = NULL, *str = NULL, *paramprofilename, *timestamp = NULL, *type = NULL, rowseparator = '\0', separator = '\0';
|
||||
|
||||
if(strcmp(profile->csv_encoding_row_separator, " ") == 0)
|
||||
rowseparator = '\n';
|
||||
else if(strcmp(profile->csv_encoding_row_separator, " ") == 0)
|
||||
rowseparator = '\r';
|
||||
|
||||
if(profile->csv_encoding_field_separator)
|
||||
separator = profile->csv_encoding_field_separator[0];
|
||||
|
||||
get_time_stamp(profile->csv_encoding_row_time_stamp, ×tamp);
|
||||
/*
|
||||
* Create header ReportTimestamp,ParameterName,ParameterValue,ParameterType in case of ParameterPerRow
|
||||
*/
|
||||
if(strcmp(profile->csv_encoding_report_format, "row") == 0) {
|
||||
if(timestamp == NULL)
|
||||
asprintf(&str, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
|
||||
else
|
||||
asprintf(&str, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
|
||||
append_string_to_string(str, report);
|
||||
FREE(str);
|
||||
if(profile->nbre_of_retained_failed_reports != 0) {
|
||||
if(profile->nbre_failed_reports >= profile->nbre_of_retained_failed_reports && profile->nbre_of_retained_failed_reports > 0)
|
||||
add_failed_reports_to_report_csv(profile, report, 1);
|
||||
else
|
||||
add_failed_reports_to_report_csv(profile, report, 0);
|
||||
}
|
||||
}
|
||||
if(strcmp(profile->csv_encoding_report_format, "column") == 0 && timestamp != NULL) {
|
||||
if(profile->nbre_of_retained_failed_reports != 0) {
|
||||
if(profile->nbre_failed_reports >= profile->nbre_of_retained_failed_reports && profile->nbre_of_retained_failed_reports > 0)
|
||||
add_failed_reports_to_report_csv(profile, report, 1);
|
||||
else
|
||||
add_failed_reports_to_report_csv(profile, report, 0);
|
||||
}
|
||||
append_string_to_string("ReportTimestamp", &str1);
|
||||
append_string_to_string(timestamp, &str2);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add New reports
|
||||
*/
|
||||
profile->new_report = NULL;
|
||||
for(i = 0; i < profile->profile_parameter_number; i++) {
|
||||
LIST_HEAD(results_list);
|
||||
bulkdata_get_value_results(profile->profile_parameter[i].reference, &results_list);
|
||||
list_for_each_entry(p, &results_list, list) {
|
||||
paramprofilename = get_bulkdata_profile_parameter_name(profile->profile_parameter[i].reference, profile->profile_parameter[i].name, p->name);
|
||||
if(strcmp(profile->csv_encoding_report_format, "row") == 0) {
|
||||
type = strstr(p->type, ":");
|
||||
if(timestamp == NULL)
|
||||
asprintf(&str, "%s%c%s%c%s%c", paramprofilename, separator, p->data, separator, type+1, rowseparator);
|
||||
else
|
||||
asprintf(&str, "%s%c%s%c%s%c%s%c", timestamp, separator, paramprofilename, separator, p->data, separator, type+1, rowseparator);
|
||||
append_string_to_string(str, report);
|
||||
append_string_to_string(str, &profile->new_report);
|
||||
FREE(str);
|
||||
} else if(strcmp(profile->csv_encoding_report_format, "column") == 0) {
|
||||
if(str1 == NULL || strlen(str1) <= 0)
|
||||
asprintf(&str, "%s", paramprofilename);
|
||||
else
|
||||
asprintf(&str, "%c%s", separator, paramprofilename);
|
||||
append_string_to_string(str, &str1);
|
||||
FREE(str);
|
||||
if(str2 == NULL || strlen(str2) <= 0)
|
||||
asprintf(&str, "%s", p->data);
|
||||
else
|
||||
asprintf(&str, "%c%s", separator, p->data);
|
||||
append_string_to_string(str, &str2);
|
||||
FREE(str);
|
||||
}
|
||||
FREE(paramprofilename);
|
||||
}
|
||||
bulkdata_free_data_from_list(&results_list);
|
||||
}
|
||||
if(strcmp(profile->csv_encoding_report_format, "column") == 0) {
|
||||
asprintf(&str, "%c", rowseparator);
|
||||
append_string_to_string(str, &str1);
|
||||
append_string_to_string(str, &str2);
|
||||
append_string_to_string(str1, report);
|
||||
append_string_to_string(str2, report);
|
||||
append_string_to_string(str1, &profile->new_report);
|
||||
append_string_to_string(str2, &profile->new_report);
|
||||
}
|
||||
FREE(str);
|
||||
FREE(str1);
|
||||
FREE(str2);
|
||||
FREE(timestamp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void create_json_failed_report(struct profile *profile, char **report)
|
||||
{
|
||||
add_failed_reports_to_report_json(profile, NULL, report, 0);
|
||||
}
|
||||
|
||||
static void create_csv_failed_report(struct profile *profile, char **report)
|
||||
{
|
||||
char rowseparator = '\0', separator = '\0', *timestamp = NULL;
|
||||
|
||||
if(strcmp(profile->csv_encoding_row_separator, " ") == 0) {
|
||||
rowseparator = '\n';
|
||||
} else if(strcmp(profile->csv_encoding_row_separator, " ") == 0) {
|
||||
rowseparator = '\r';
|
||||
}
|
||||
|
||||
if(profile->csv_encoding_field_separator)
|
||||
separator = profile->csv_encoding_field_separator[0];
|
||||
|
||||
get_time_stamp(profile->csv_encoding_row_time_stamp, ×tamp);
|
||||
if(strcmp(profile->csv_encoding_report_format, "row") == 0) {
|
||||
if(timestamp == NULL)
|
||||
asprintf(report, "ParameterName%cParameterValue%cParameterType%c", separator, separator, rowseparator);
|
||||
else
|
||||
asprintf(report, "ReportTimestamp%cParameterName%cParameterValue%cParameterType%c", separator, separator, separator, rowseparator);
|
||||
}
|
||||
add_failed_reports_to_report_csv(profile, report, 0);
|
||||
}
|
||||
|
||||
void create_encoding_bulkdata_report(struct profile *profile, char **report)
|
||||
{
|
||||
if(strcasecmp(profile->encoding_type, "json") == 0) {
|
||||
create_json_bulkdata_report(profile, report);
|
||||
} else if(strcasecmp(profile->encoding_type, "csv") == 0) {
|
||||
create_csv_bulkdata_report(profile, report);
|
||||
}
|
||||
}
|
||||
|
||||
void create_failed_report(struct profile *profile, char **report)
|
||||
{
|
||||
if(strcasecmp(profile->encoding_type, "json") == 0) {
|
||||
create_json_failed_report(profile, report);
|
||||
} else if(strcasecmp(profile->encoding_type, "csv") == 0) {
|
||||
create_csv_failed_report(profile, report);
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
* Author: Omar Kallel <omar.kallel@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __REPORT_H_
|
||||
#define __REPORT_H_
|
||||
|
||||
#include <json-c/json.h>
|
||||
#include "common.h"
|
||||
#include "times.h"
|
||||
#include "config.h"
|
||||
|
||||
void create_encoding_bulkdata_report(struct profile *profile, char **report);
|
||||
void create_failed_report(struct profile *profile, char **report);
|
||||
|
||||
#endif /* __REPORT_H_ */
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "times.h"
|
||||
|
||||
const char *bulkdata_get_time(void)
|
||||
{
|
||||
static char local_time[64];
|
||||
|
||||
time_t t_time = time(NULL);
|
||||
struct tm *t_tm = localtime(&t_time);
|
||||
if (t_tm == NULL)
|
||||
return NULL;
|
||||
|
||||
if (strftime(local_time, sizeof(local_time),"Date: %a, %d %b %Y %X%z GMT", t_tm) == 0)
|
||||
return NULL;
|
||||
|
||||
return local_time;
|
||||
}
|
||||
|
||||
void get_time_stamp(const char *format, char **timestamp)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
|
||||
if (strcmp(format, "unix") == 0) {
|
||||
asprintf(timestamp, "%ld", now);
|
||||
} else if (strcmp(format, "iso8601") == 0) {
|
||||
char buf[32] = {0};
|
||||
struct tm *ts = localtime(&now);
|
||||
strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S%Z", ts);
|
||||
asprintf(timestamp, "%s", buf);
|
||||
} else
|
||||
timestamp = NULL;
|
||||
}
|
||||
|
||||
unsigned int get_next_period(time_t time_reference, int reporting_interval)
|
||||
{
|
||||
unsigned int next_period;
|
||||
time_t now = time(NULL);
|
||||
|
||||
if (now > time_reference)
|
||||
next_period = reporting_interval - ((now - time_reference) % reporting_interval);
|
||||
else
|
||||
next_period = (time_reference - now) % reporting_interval;
|
||||
|
||||
if (next_period == 0)
|
||||
next_period = reporting_interval;
|
||||
|
||||
return next_period;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Copyright (C) 2020 iopsys Software Solutions AB
|
||||
* Author: Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __TIMES_H
|
||||
#define __TIMES_H
|
||||
|
||||
const char *bulkdata_get_time(void);
|
||||
void get_time_stamp(const char *format, char **timestamp);
|
||||
unsigned int get_next_period(time_t time_reference, int reporting_interval);
|
||||
|
||||
#endif /* __TIMES_H */
|
||||
38
bulut/Makefile
Normal file
38
bulut/Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Copyright (C) 2019 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bulut
|
||||
PKG_VERSION:=0.2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/bulut/bulut-gw-client.git
|
||||
PKG_SOURCE_VERSION:=227700c44817afa2c392fa08bf4cf70fa6177f01
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/bulut
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=
|
||||
TITLE:=bulut
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include
|
||||
|
||||
define Package/bulut/description
|
||||
obuspa keys
|
||||
endef
|
||||
|
||||
define Package/bulut/install
|
||||
$(CP) $(PKG_BUILD_DIR)/files/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,bulut))
|
||||
11
dectmngr/Config.in
Normal file
11
dectmngr/Config.in
Normal file
@@ -0,0 +1,11 @@
|
||||
if PACKAGE_dectmngr
|
||||
|
||||
menu "Configuration"
|
||||
|
||||
config ENABLE_LINE_SETTINGS_EXTENSION
|
||||
bool "Enable Line Settings List extension "
|
||||
default y
|
||||
|
||||
endmenu
|
||||
|
||||
endif
|
||||
73
dectmngr/Makefile
Normal file
73
dectmngr/Makefile
Normal file
@@ -0,0 +1,73 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dectmngr
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=3.4.7
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=1894596674aa655691ee5b6ff3d283ca4cf5d2eb
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY
|
||||
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
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=DECT Manager
|
||||
DEPENDS:= +libubox +ubus +uci +libxml2
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
DECT manager is a daemon that provides UBUS RPC objects and sends UBUS events for communication with the DECT chip.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -av --exclude=.* ~/git/voip/dectmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-Wall \
|
||||
-I$(STAGING_DIR)/usr/include/libxml2
|
||||
|
||||
ifeq ($(CONFIG_ENABLE_LINE_SETTINGS_EXTENSION),y)
|
||||
TARGET_CFLAGS += -DENABLE_LINE_SETTINGS_EXTENSION
|
||||
endif
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/app/dectmngr $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/dectmngr
|
||||
$(CP) ./files/etc/* $(1)/etc/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/dect $(1)/lib/upgrade/keep.d/dect
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
2
dectmngr/files/etc/config/dect
Normal file
2
dectmngr/files/etc/config/dect
Normal file
@@ -0,0 +1,2 @@
|
||||
config dect 'global'
|
||||
option log_dect_cmbs 'syslog'
|
||||
BIN
dectmngr/files/etc/dspg/04131C10.bin
Normal file
BIN
dectmngr/files/etc/dspg/04131C10.bin
Normal file
Binary file not shown.
96
dectmngr/files/etc/init.d/dectmngr
Executable file
96
dectmngr/files/etc/init.d/dectmngr
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
source /lib/functions/uci-defaults.sh
|
||||
|
||||
START=70
|
||||
STOP=12
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=dectmngr
|
||||
PROG=/usr/sbin/dectmngr
|
||||
LOG_PATH=/var/log/dectmngr
|
||||
DB_PATH=/etc/dect
|
||||
|
||||
# Ask dectmngr to exit nicely and wait for it to clean up, which is a slow process.
|
||||
stop_and_wait_dectmngr() {
|
||||
pidof $NAME && killall -q $NAME
|
||||
|
||||
pidof $NAME && sleep 2 # wait for the process to stop gracefully
|
||||
while pidof $NAME; do
|
||||
killall -q -9 $NAME
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local opt_ext=
|
||||
local rfpi=
|
||||
local model_id=
|
||||
local rxtun=
|
||||
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
echo 1 > /sys/class/gpio/gpio14/value
|
||||
|
||||
rfpi=$(db -q get hw.board.dect_rfpi)
|
||||
[ -n "$rfpi" -a ${#rfpi} -eq 14 ] && opt_ext="$opt_ext -rfpi $rfpi"
|
||||
|
||||
model_id=$(db -q get hw.board.dect_model_id)
|
||||
[ -n "$model_id" -a ${#model_id} -eq 8 ] || {
|
||||
echo "Invalid hw.board.dect_model_id:$model_id. Set to 30.3B.06"
|
||||
model_id="30.3B.06"
|
||||
}
|
||||
opt_ext="$opt_ext -model $model_id"
|
||||
|
||||
rxtun=$(db -q get hw.board.dect_rxtun)
|
||||
[ -n "$rxtun" -a ${#rxtun} -eq 2 ] && opt_ext="$opt_ext -rxtun $rxtun"
|
||||
|
||||
config_load dect
|
||||
config_get log_dect_cmbs global log_dect_cmbs syslog
|
||||
|
||||
procd_open_instance
|
||||
if [ "$log_dect_cmbs" = "none" ]; then
|
||||
echo "Starting dectmngr with cmbs logging disabled"
|
||||
procd_set_param command $PROG -comname ttyH0 $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
elif [ "$log_dect_cmbs" = "file" ]; then
|
||||
echo "Starting dectmngr with cmbs logging enabled to file"
|
||||
procd_set_param command $PROG -comname ttyH0 -log $LOG_PATH/dect-cmbs.log $opt_ext
|
||||
else
|
||||
echo "Starting dectmngr with cmbs logging enabled to syslog"
|
||||
procd_set_param command $PROG -comname ttyH0 -syslog $opt_ext
|
||||
rm -f $LOG_PATH/*
|
||||
fi
|
||||
|
||||
procd_set_param respawn 6 2 3
|
||||
procd_set_param term_timeout 20
|
||||
procd_set_param triggers asterisk
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
test $(db get hw.board.hasDect) = "0" && return
|
||||
|
||||
echo 0 > /sys/class/gpio/gpio14/value
|
||||
stop_and_wait_dectmngr
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
ubus call dect reload
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_config_trigger "config.change" "asterisk" /etc/init.d/dectmngr restart
|
||||
procd_add_config_trigger "config.change" "dect" /etc/init.d/dectmngr reload
|
||||
}
|
||||
|
||||
boot() {
|
||||
echo 14 > /sys/class/gpio/export
|
||||
echo out > /sys/class/gpio/gpio14/direction
|
||||
|
||||
[ ! -d $LOG_PATH ] && mkdir -p $LOG_PATH
|
||||
[ ! -d $DB_PATH ] && mkdir -p $DB_PATH
|
||||
start
|
||||
}
|
||||
|
||||
1
dectmngr/files/lib/upgrade/keep.d/dect
Normal file
1
dectmngr/files/lib/upgrade/keep.d/dect
Normal file
@@ -0,0 +1 @@
|
||||
/etc/dect/LA_DB
|
||||
@@ -1,56 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.3.0
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dectmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=2c8990fd5275d469e8ab6c7a99e17fe0a56052ea
|
||||
PKG_NAME:=dectmngr2
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
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
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/dectmngr2
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dectmngr2
|
||||
URL:=
|
||||
DEPENDS:= +natalie-dect-h bcmkernel +libubox +ubus +libpicoevent endptmngr
|
||||
endef
|
||||
|
||||
define Package/dectmngr2/description
|
||||
Dectmngr2
|
||||
endef
|
||||
|
||||
|
||||
define Package/dectmngr2/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/dect/
|
||||
$(INSTALL_DIR) $(1)/etc/config/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults/
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dectmngr2 $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/target.bin $(1)/etc/dect/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/nvs_default $(1)/etc/dect/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dect $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dectmngr-wrapper.sh $(1)/usr/sbin/
|
||||
$(CP) ./files/dect.config $(1)/etc/config/dect
|
||||
$(CP) ./files/etc/uci-defaults/* $(1)/etc/uci-defaults/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,dectmngr2))
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
config dect 'dect'
|
||||
option radio 'auto'
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
# Workaround for product DG400 which has an
|
||||
# incorrect value in nvram from factory.
|
||||
|
||||
if [ -e "/proc/nvram/BoardId" ]; then
|
||||
boardid=$(cat /proc/nvram/BoardId)
|
||||
ulBoardStuffOption=$(cat /proc/nvram/ulBoardStuffOption)
|
||||
|
||||
if [ "$boardid" = "DG400R0" -a "$ulBoardStuffOption" = "0xffffffff" ]; then
|
||||
echo "0xfffffff2" >/proc/nvram/ulBoardStuffOption
|
||||
|
||||
db -q batch <<-EOT
|
||||
set hw.board.has_dect=1
|
||||
commit hw.board
|
||||
EOT
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -8,14 +8,15 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=dslmngr
|
||||
PKG_VERSION:=1.1.0
|
||||
PKG_VERSION:=1.1.2
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=400cc66081f2b10b481d5a745bc505b78af098bd
|
||||
PKG_SOURCE_VERSION:=bb754ae620a9fc66fd6fc0745f0fead0708c7a17
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/dslmngr.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -43,7 +44,7 @@ define Package/dslmngr
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=XDSL status and configration utility
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl
|
||||
DEPENDS:=+libdsl +libuci +libubox +ubus +libpthread +libnl-genl +libeasy
|
||||
endef
|
||||
|
||||
define Package/dslmngr/description
|
||||
|
||||
@@ -33,7 +33,7 @@ exec_class_log() {
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 8;;
|
||||
@@ -55,7 +55,7 @@ get_priority() {
|
||||
}
|
||||
|
||||
get_mark() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo "0x41/0x3df";;
|
||||
|
||||
@@ -15,7 +15,7 @@ exec_log() {
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
@@ -98,7 +98,7 @@ manage_rule() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
protocol=$(echo ${proto}|tr [A-Z] [a-z])
|
||||
protocol=$(echo ${proto}|tr 'A-Z' 'a-z')
|
||||
prio_num=$(get_priority ${priority})
|
||||
if [ -n "${macaddr}" -a -n "${prio_num}" ]; then
|
||||
for p in ${port}; do
|
||||
|
||||
@@ -19,7 +19,7 @@ exec_log() {
|
||||
}
|
||||
|
||||
get_priority() {
|
||||
local prio=$(echo $1|tr [A-Z] [a-z]);
|
||||
local prio=$(echo $1|tr 'A-Z' 'a-z');
|
||||
case "${prio}" in
|
||||
"lowest")
|
||||
echo 0;;
|
||||
|
||||
@@ -11,6 +11,7 @@ PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/easy-soc-events.git
|
||||
PKG_SOURCE_VERSION:=5c582b0165b574dc94e4865f82e0bb91fa561754
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/easy-soc-events-$(PKG_VERSION)
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
|
||||
@@ -1,23 +1,5 @@
|
||||
if (PACKAGE_libwifi || PACKAGE_libdsl || PACKAGE_libethernet)
|
||||
menu "configurations"
|
||||
# libeasy configuration
|
||||
|
||||
config IOP_LLA_LIBS_DEBUG
|
||||
bool "Enable debugging support"
|
||||
config LIBWIFI_USE_CTRL_IFACE
|
||||
bool "Use UNIX sockets"
|
||||
default n
|
||||
|
||||
config LIBWIFI_DEBUG
|
||||
depends on PACKAGE_libwifi
|
||||
bool "Enable wifi debugging"
|
||||
default n
|
||||
|
||||
config LIBDSL_DEBUG
|
||||
depends on PACKAGE_libdsl
|
||||
bool "Enable xdsl debugging"
|
||||
default n
|
||||
|
||||
config LIBDSL_TEST
|
||||
depends on PACKAGE_libdsl
|
||||
bool "Libdsl test program"
|
||||
default n
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -7,16 +7,17 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easy-soc-libs
|
||||
PKG_VERSION:=6.0.2
|
||||
PKG_VERSION:=6.4.34
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=fee575f414324c68d0916fab06d10eccb78541fd
|
||||
PKG_SOURCE_VERSION:=dd2ab2e5b83d585849aae3d539c1a8cd6dcb7146
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/easy-soc-libs.git
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -29,48 +30,21 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/easy-soc-libs
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=IOPSYS easy SoC libraries
|
||||
SUBMENU:=IOPSYS easy SoC libraries
|
||||
TITLE:=IOPSYS Easy SoC libraries
|
||||
SUBMENU:=IOPSYS Easy SoC libraries
|
||||
DEPENDS:=+libopenssl
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define Package/libwifi/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libeasy
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Common helper functions library (libeasy)
|
||||
DEPENDS+=+libnl +libnl-route
|
||||
endef
|
||||
|
||||
define Package/libwifi
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy
|
||||
endef
|
||||
|
||||
define Package/libethernet
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Ethernet library (libethernet)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
TARGET_PLATFORM=BROADCOM
|
||||
CHIP_ID=$(patsubst "%",%,$(CONFIG_BCM_CHIP_ID))
|
||||
TARGET_CFLAGS +=-DIOPSYS_BROADCOM -DCHIP_$(CHIP_ID) -DCONFIG_BCM9$(CHIP_ID) \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
|
||||
-I$(STAGING_DIR)/usr/include/bcm963xx/userspace/public/include
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_ramips),y)
|
||||
TARGET_PLATFORM=MEDIATEK
|
||||
TARGET_CFLAGS +=-DIOPSYS_MEDIATEK
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_linksys),y)
|
||||
TARGET_PLATFORM=MARVELL
|
||||
TARGET_CFLAGS +=-DIOPSYS_MARVELL
|
||||
else ifeq ($(CONFIG_TARGET_intel_mips),y)
|
||||
TARGET_PLATFORM=INTEL
|
||||
TARGET_CFLAGS +=-DIOPSYS_INTEL
|
||||
else ifeq ($(CONFIG_TARGET_iopsys_x86),y)
|
||||
TARGET_PLATFORM=TEST
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
@@ -78,26 +52,30 @@ else ifeq ($(CONFIG_TARGET_iopsys_armvirt),y)
|
||||
TARGET_PLATFORM=TEST
|
||||
TARGET_CFLAGS +=-DIOPSYS_TEST
|
||||
else
|
||||
$(info Unexpected CONFIG_TARGET)
|
||||
$(info Unexpected CONFIG_TARGET, use default MAC80211)
|
||||
TARGET_PLATFORM=MAC80211
|
||||
TARGET_CFLAGS +=-DIOPSYS_MAC80211
|
||||
endif
|
||||
|
||||
export TARGET_PLATFORM
|
||||
|
||||
ifdef CONFIG_IOP_LLA_LIBS_DEBUG
|
||||
TARGET_CFLAGS += -DIOP_LLA_LIBS_DEBUG
|
||||
endif
|
||||
|
||||
define Package/libdsl
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= XDSL library (libdsl)
|
||||
DEPENDS+=+TARGET_intel_mips:dsl-cpe-api-vrx +TARGET_intel_mips:dsl-cpe-fapi +TARGET_intel_mips:kmod-ppa-drv
|
||||
endef
|
||||
|
||||
subdirs := \
|
||||
$(if $(CONFIG_PACKAGE_libeasy),libeasy) \
|
||||
$(if $(CONFIG_PACKAGE_libwifi),libwifi) \
|
||||
$(if $(CONFIG_PACKAGE_libdsl),libdsl) \
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet)
|
||||
$(if $(CONFIG_PACKAGE_libethernet),libethernet) \
|
||||
$(if $(CONFIG_PACKAGE_libqos),libqos)
|
||||
|
||||
EASY_SOC_LIBS := \
|
||||
libeasy \
|
||||
libwifi \
|
||||
libdsl \
|
||||
libethernet \
|
||||
libqos
|
||||
|
||||
ifeq ($(CONFIG_LIBWIFI_USE_CTRL_IFACE),y)
|
||||
TARGET_CFLAGS +=-DLIBWIFI_USE_CTRL_IFACE
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
@@ -117,79 +95,36 @@ define Build/Prepare
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev/libeasy
|
||||
$(INSTALL_DIR) $(1)/usr/include/easy
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
include easy.mk
|
||||
include wifi.mk
|
||||
include dsl.mk
|
||||
include ethernet.mk
|
||||
include qos.mk
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),\
|
||||
$(PKG_BUILD_DIR)/.config_$(patsubst "%",%,$(CONFIG_TARGET_PROFILE)))
|
||||
define Build/Compile/rebuild
|
||||
$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.so\* | $(XARGS) rm -f;
|
||||
$(if $(wildcard $(PKG_BUILD_DIR)/config_*), \
|
||||
rm -f $(PKG_BUILD_DIR)/.config_*)
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/InstallDev/libdsl
|
||||
$(INSTALL_DIR) $(1)/usr/include/xdsl
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libethernet
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
|
||||
endef
|
||||
STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell echo $(TARGET_CFLAGS) | mkhash md5)
|
||||
|
||||
define Build/Compile
|
||||
$(Build/Compile/rebuild)
|
||||
touch $(PKG_BUILD_DIR)/.config_$(CONFIG_TARGET_PROFILE)
|
||||
$(call Build/Compile/Default)
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
|
||||
endif
|
||||
$(foreach dir,$(subdirs),$(call Build/Compile/$(dir)))
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(foreach dir,$(subdirs),$(call Build/InstallDev/$(dir),$(1),$(2));)
|
||||
endef
|
||||
|
||||
define Package/libeasy/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libethernet/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libdsl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
|
||||
endif
|
||||
endef
|
||||
|
||||
define Package/easy-soc-libs/install
|
||||
:
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libeasy))
|
||||
$(eval $(call BuildPackage,libwifi))
|
||||
$(eval $(call BuildPackage,libdsl))
|
||||
$(eval $(call BuildPackage,libethernet))
|
||||
$(eval $(foreach e,$(EASY_SOC_LIBS),$(call BuildPackage,$(e))))
|
||||
|
||||
44
easy-soc-libs/dsl.mk
Normal file
44
easy-soc-libs/dsl.mk
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
define Package/libdsl
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= xDSL library (libdsl)
|
||||
endef
|
||||
|
||||
define Package/libdsl/config
|
||||
if PACKAGE_libdsl
|
||||
config LIBDSL_DEBUG
|
||||
depends on PACKAGE_libdsl
|
||||
bool "Enable dsl debugging"
|
||||
default n
|
||||
|
||||
config LIBDSL_TEST
|
||||
depends on PACKAGE_libdsl
|
||||
bool "Enable dsl test program"
|
||||
default n
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libdsl
|
||||
$(INSTALL_DIR) $(1)/usr/include/xdsl
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/xdsl.h $(1)/usr/include/xdsl
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/xtm.h $(1)/usr/include/xdsl
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/common.h $(1)/usr/include/xdsl
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
define Build/Compile/libdsl
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)/libdsl/test" $(MAKE_FLAGS)
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/libdsl/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/libdsl.so* $(1)/usr/lib/
|
||||
ifeq ($(CONFIG_LIBDSL_TEST),y)
|
||||
$(CP) $(PKG_BUILD_DIR)/libdsl/test/libdsl_test $(1)/usr/bin/
|
||||
endif
|
||||
endef
|
||||
29
easy-soc-libs/easy.mk
Normal file
29
easy-soc-libs/easy.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
define Package/libeasy
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Common helper functions library (libeasy)
|
||||
DEPENDS+=+libnl +libnl-route
|
||||
endef
|
||||
|
||||
define Package/libeasy/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libeasy
|
||||
$(INSTALL_DIR) $(1)/usr/include/easy
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/easy.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/event.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/if_utils.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/debug.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/hlist.h $(1)/usr/include/easy/
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libeasy/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libeasy/libeasy*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
27
easy-soc-libs/ethernet.mk
Normal file
27
easy-soc-libs/ethernet.mk
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
define Package/libethernet
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= Ethernet library (libethernet)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_ramips:swconfig
|
||||
endef
|
||||
|
||||
define Package/libethernet/config
|
||||
config LIBETHERNET_DEBUG
|
||||
depends on PACKAGE_libethernet
|
||||
bool "Enable ethernet debugging"
|
||||
default n
|
||||
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libethernet
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/ethernet.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libethernet/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libethernet/libethernet.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
27
easy-soc-libs/qos.mk
Normal file
27
easy-soc-libs/qos.mk
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
define Package/libqos
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= QoS library (libqos)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy
|
||||
endef
|
||||
|
||||
define Package/libqos/config
|
||||
config LIBQOS_DEBUG
|
||||
depends on PACKAGE_libqos
|
||||
bool "Enable qos debugging"
|
||||
default n
|
||||
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libqos
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libqos/include/qos.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libqos/libqos.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libqos/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libqos/libqos*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
29
easy-soc-libs/wifi.mk
Normal file
29
easy-soc-libs/wifi.mk
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
define Package/libwifi
|
||||
$(call Package/easy-soc-libs)
|
||||
TITLE:= WiFi library (libwifi)
|
||||
DEPENDS+=+libnl +libnl-route +libeasy +TARGET_iopsys_brcm63xx_arm:bcmkernel
|
||||
endef
|
||||
|
||||
define Package/libwifi/config
|
||||
if PACKAGE_libdsl
|
||||
config LIBWIFI_DEBUG
|
||||
depends on PACKAGE_libwifi
|
||||
bool "Enable wifi debugging"
|
||||
default n
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwifi
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/wifi.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwifi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifi/libwifi*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
@@ -6,26 +6,21 @@
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.4
|
||||
PKG_SOURCE_VERSION:=d87c1def50d9672dbeb9d5972f36a364b29334b9
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_VERSION:=0.6
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_VERSION:=548fa04d2714feeadb500192905fa6fb8172e6dd
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_LICENSE:=MIT
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
BRCM_KERNEL_PROFILE=$(shell echo $(CONFIG_BCM_KERNEL_PROFILE) | sed s/\"//g)
|
||||
PKG_SOURCE:=endptmngr-$(BRCM_KERNEL_PROFILE)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://download.iopsys.eu/iopsys/opensdk/
|
||||
PKG_NAME:=endptmngr-open
|
||||
PATCH_DIR:=
|
||||
PKG_HASH:=skip
|
||||
else
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/endptmngr.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_NAME:=endptmngr
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
export BUILD_DIR
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -33,15 +28,10 @@ PKG_BUILD_PARALLEL:=1
|
||||
|
||||
# All config variable that are passed to the make invocation, directly or
|
||||
# indirectly. This ensures that the package is rebuilt on config-changes.
|
||||
PKG_CONFIG_DEPENDS := \
|
||||
CONFIG_TARGET_BOARD
|
||||
|
||||
export CONFIG_BRCM_SDK_VER_504001
|
||||
export CONFIG_BRCM_SDK_VER_504002
|
||||
export CONFIG_BRCM_SDK_VER_504003
|
||||
export CONFIG_BRCM_SDK_VER_504004
|
||||
export CONFIG_BRCM_SDK_VER_504005
|
||||
PKG_CONFIG_DEPENDS:=CONFIG_TARGET_BOARD
|
||||
|
||||
export CONFIG_BRCM_SDK_VER_504021
|
||||
export CONFIG_BCM_CHIP_ID
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -51,27 +41,24 @@ endef
|
||||
|
||||
define Package/endptmngr
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Brcmslic
|
||||
TITLE:=Broadcom Voice Endpoint Manager
|
||||
URL:=
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +bcmkernel @TARGET_HAS_VOICE @BCM_VOICE
|
||||
DEPENDS:= +libubox +ubus +libpicoevent +uci +bcmkernel @TARGET_HAS_VOICE @BCM_VOICE
|
||||
endef
|
||||
|
||||
define Package/endptmngr/description
|
||||
endptmngr
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_ENDPT_OPEN),y)
|
||||
|
||||
define Build/Compile
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -av --exclude=.* ~/git/endptmngr/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
|
||||
endif
|
||||
|
||||
|
||||
define Package/endptmngr/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
cp $(PKG_BUILD_DIR)/files/etc/init.d/* $(1)/etc/init.d/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/endptmngr $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
|
||||
27
endptmngr/files/etc/init.d/endptmngr
Executable file
27
endptmngr/files/etc/init.d/endptmngr
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=68
|
||||
STOP=12
|
||||
|
||||
USE_PROCD=1
|
||||
NAME=endptmngr
|
||||
|
||||
start_service() {
|
||||
[ "$(db -q get hw.board.hasVoice)" = "1" ] || return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param env hw_board_hasDect=$(db get hw.board.hasDect)
|
||||
procd_set_param command $NAME
|
||||
procd_set_param respawn "5" "0" "3"
|
||||
procd_set_param nice -12
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger asterisk
|
||||
}
|
||||
@@ -5,13 +5,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ethmngr
|
||||
PKG_VERSION:=1.0.4
|
||||
PKG_VERSION:=2.0.1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=b7135381aedf1bde6f7ab10b41be372a9bd7d155
|
||||
PKG_SOURCE_VERSION:=5a0ff3bc7c49dcb05129f423ef8e0c4929f6aa03
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ethmngr.git
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
51
fdtextract/Makefile
Normal file
51
fdtextract/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2021 IOPSYS Software Solutions AB
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fdtextract
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.0
|
||||
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/fdtextract.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=7e013f0afa68378d38a6bdc9b0c5a342bd3dd0a5
|
||||
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
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=fdtextract
|
||||
DEPENDS:= +libfdt
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Command to extract sub images from FIT images.
|
||||
endef
|
||||
|
||||
MAKE_FLAGS += \
|
||||
CFLAGS+="-Wall"
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/fdtextract $(1)/usr/sbin/
|
||||
$(STRIP) $(1)/usr/sbin/fdtextract
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -28,6 +28,7 @@ define KernelPackage/$(PKG_NAME)
|
||||
FILES:=$(PKG_BUILD_DIR)/$(PKG_NAME).$(LINUX_KMOD_SUFFIX)
|
||||
KCONFIG:=CONFIG_PACKAGE_kmod-gryphon-led-kernel-module=y
|
||||
AUTOLOAD:=$(call AutoLoad,60,$(PKG_NAME))
|
||||
DEPENDS:= +(TARGET_iopsys_brcm63xx_arm):bcmkernel
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_URL:=
|
||||
endef
|
||||
@@ -40,6 +41,21 @@ EXTRA_KCONFIG:= CONFIG_RGB_LED=m
|
||||
|
||||
MODULE_INCLUDE=-I$(PKG_BUILD_DIR)
|
||||
|
||||
|
||||
ifeq ($(CONFIG_TARGET_iopsys_brcm63xx_arm),y)
|
||||
LINUX_DIR:=$(BUILD_DIR)/bcmkernel/bcm963xx/kernel/linux-4.19
|
||||
MODULES_SUBDIR:=lib/modules/4.19.183
|
||||
TARGET_CROSS:=$(CONFIG_BCM_TOOLCHAIN)/bin/$(CONFIG_BCM_TOOLTUPLE)
|
||||
|
||||
ifeq ($(CONFIG_BCM_CHIP_ID),$(filter $(CONFIG_BCM_CHIP_ID),"63158" "6856" "6858"))
|
||||
# These targets use a 64-bit kernel
|
||||
LINUX_KARCH:=arm64
|
||||
TARGET_CROSS:=/opt/toolchains/crosstools-aarch64-gcc-9.2-linux-4.19-glibc-2.30-binutils-2.32/bin/aarch64-buildroot-linux-gnu-
|
||||
endif
|
||||
# For some reason, Broadcom's kernel does not set the include paths correctly when compiling out-of-tree modules
|
||||
EXTRA_KCPPFLAGS:="-I $(LINUX_DIR)/../bcmkernel/include -I $(LINUX_DIR)/arch/arm/mach-bcm963xx/include"
|
||||
endif
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)/kdevlinks/
|
||||
$(CP) -s `pwd`/src/* $(PKG_BUILD_DIR)/kdevlinks/
|
||||
|
||||
@@ -43,12 +43,18 @@
|
||||
static ssize_t get_led_color(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
/* [ln] todo: dummy implementation */
|
||||
int len;
|
||||
struct sk9822_leds *sk9822 = dev_get_drvdata(dev);
|
||||
|
||||
len = sprintf(buf, "%d\n", 123);
|
||||
if (IS_ERR(sk9822)) {
|
||||
printk(KERN_ERR "Platform get drvdata returned NULL\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
len = scnprintf(buf, PAGE_SIZE, "%02x%02x%02x\n", sk9822->led_colors[0].r, sk9822->led_colors[0].g, sk9822->led_colors[0].b);
|
||||
if (len <= 0) {
|
||||
dev_err(dev, "sk9822: Invalid sprintf len: %d\n", len);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return len;
|
||||
@@ -99,8 +105,69 @@ static ssize_t set_led_color(struct device *dev,
|
||||
}
|
||||
static DEVICE_ATTR(led_color, S_IRUGO | S_IWUSR, get_led_color, set_led_color);
|
||||
|
||||
static ssize_t get_led_brightness(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
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);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set LED brightness
|
||||
* @retval count number of bytes written
|
||||
* @retval -EINVAL if the message is not a valid hexadecimal number
|
||||
* @retval -EIO for all other errors (e.g. leds cannot be configured)
|
||||
*/
|
||||
static ssize_t set_led_brightness(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
int ret = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
if(val > SK9822_DEFAULT_BRIGHTNESS) {
|
||||
val = SK9822_DEFAULT_BRIGHTNESS;
|
||||
}
|
||||
|
||||
sk9822->led_brightness = (uint8_t)val;
|
||||
|
||||
// Now push to the HW
|
||||
ret = sk9822_update(sk9822);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "Failed to update led\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
static DEVICE_ATTR(led_brightness, S_IRUGO | S_IWUSR, get_led_brightness, set_led_brightness);
|
||||
|
||||
|
||||
static struct attribute *sk9822_dev_attrs[] = {
|
||||
&dev_attr_led_color.attr,
|
||||
&dev_attr_led_brightness.attr,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
if PACKAGE_icwmp
|
||||
|
||||
config CWMP_SCRIPTS_FULL
|
||||
bool "Install all icwmp scripts"
|
||||
default y
|
||||
|
||||
menu "Configuration"
|
||||
choice
|
||||
prompt "Select ACS sever"
|
||||
default CWMP_ACS_MULTI
|
||||
@@ -22,6 +19,6 @@ config CWMP_DEBUG
|
||||
config CWMP_DEVEL_DEBUG
|
||||
bool "Compile with development debug options"
|
||||
default n
|
||||
|
||||
endmenu
|
||||
endif
|
||||
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=6.2-2020-12-17
|
||||
PKG_VERSION:=8.2.25
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=80382e4dc769fa5eccd819d9a63ec59826f1bd36
|
||||
PKG_SOURCE_VERSION:=22a1606d972d2dd05b23abe94323f72232727b37
|
||||
PKG_RELEASE=$(PKG_SOURCE_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
@@ -28,8 +29,6 @@ PKG_CONFIG_DEPENDS:= \
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
CWMP_REVISION=$(shell svnversion ./src/ -n|cut -f2 -d:)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
@@ -37,7 +36,7 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:=CWMP client
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl +libbbfdm +libbbf_api
|
||||
DEPENDS:=+libuci +libmicroxml +libubox +jshn +libubus +libblobmsg-json +libpthread +ubusd +shflags +getopt +zlib +libjson-c +libopenssl +curl +libcurl
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
@@ -56,24 +55,8 @@ endef
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-D_GNU_SOURCE -D_AADJ
|
||||
|
||||
ifneq ($(CWMP_REVISION)_,_)
|
||||
ifneq ($(CWMP_REVISION),exported)
|
||||
ifneq ($(CWMP_REVISION),Unversioned directory)
|
||||
TARGET_CFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||
TARGET_LDFLAGS += "-DCWMP_REVISION=\\\"$(CWMP_REVISION)\\\""
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
TARGET_LDFLAGS += \
|
||||
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--with-uci-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubox-include-path=$(STAGING_DIR)/usr/include \
|
||||
--with-libubus-include-path=$(STAGING_DIR)/usr/include
|
||||
-D_GNU_SOURCE \
|
||||
"-DCWMP_REVISION=\\\"$(PKG_SOURCE_VERSION)\\\""
|
||||
|
||||
ifeq ($(CONFIG_CWMP_ACS_MULTI),y)
|
||||
CONFIGURE_ARGS += \
|
||||
@@ -98,33 +81,19 @@ endif
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/etc/icwmpd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin
|
||||
ifeq ($(CONFIG_CWMP_SCRIPTS_FULL),y)
|
||||
$(INSTALL_DIR) $(1)/usr/share/icwmp
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/defaults $(1)/usr/share/icwmp
|
||||
$(CP) $(PKG_BUILD_DIR)/scripts/functions $(1)/usr/share/icwmp
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/icwmp.sh $(1)/usr/sbin/icwmp
|
||||
endif
|
||||
$(CP) ./files/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Enabling rc.d symlink for icwmpd"
|
||||
/etc/init.d/icwmpd enable
|
||||
fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/prerm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
echo "Disabling rc.d symlink for icwmpd"
|
||||
/etc/init.d/icwmpd disable
|
||||
fi
|
||||
exit 0
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/uci-defaults
|
||||
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/icwmpd $(1)/usr/sbin/icwmpd
|
||||
$(INSTALL_DATA) ./files/etc/config/cwmp $(1)/etc/config/cwmp
|
||||
$(INSTALL_BIN) ./files/etc/firewall.cwmp $(1)/etc/firewall.cwmp
|
||||
$(INSTALL_BIN) ./files/etc/init.d/icwmpd $(1)/etc/init.d/icwmpd
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/85-cwmp-set-userid $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/90-cwmpfirewall $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) ./files/etc/uci-defaults/95-icwmp-generate-ssl $(1)/etc/uci-defaults/
|
||||
$(INSTALL_DATA) ./files/lib/upgrade/keep.d/icwmp $(1)/lib/upgrade/keep.d/icwmp
|
||||
$(INSTALL_BIN) ./files/etc/icwmpd/update.sh $(1)/etc/icwmpd/update.sh
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
config acs 'acs'
|
||||
option url ''
|
||||
option userid '' #$OUI-$SER
|
||||
option passwd 'iopsys'
|
||||
option periodic_inform_enable 'true'
|
||||
option periodic_inform_interval '1800'
|
||||
option periodic_inform_time '0'
|
||||
option ParameterKey ''
|
||||
option periodic_inform_time '0001-01-01T00:00:00Z'
|
||||
option dhcp_discovery 'enable'
|
||||
# compression possible configs: GZIP, Deflate, Disabled
|
||||
option compression 'Disabled'
|
||||
@@ -30,17 +28,16 @@ config cpe 'cpe'
|
||||
option userid '' #$OUI-$SER
|
||||
option passwd 'iopsys'
|
||||
option port '7547'
|
||||
option ubus_socket '/var/run/ubus.sock'
|
||||
option provisioning_code ''
|
||||
option amd_version '5'
|
||||
# compression possible configs: InstanceNumber, InstanceAlias
|
||||
option instance_mode 'InstanceNumber'
|
||||
option session_timeout '60'
|
||||
option notification '1'
|
||||
option datamodel 'tr181'
|
||||
option exec_download '0'
|
||||
option periodic_notify_enable '1'
|
||||
option periodic_notify_interval '10'
|
||||
option incoming_rule 'Port_Only'
|
||||
|
||||
config lwn 'lwn'
|
||||
option enable '1'
|
||||
|
||||
@@ -1,21 +1,81 @@
|
||||
#created by the icwmp package
|
||||
zone_name=""
|
||||
port=""
|
||||
if [ "$zone_name" = "" ]; then
|
||||
#!/bin/sh
|
||||
|
||||
#created by the icwmp package
|
||||
log() {
|
||||
echo "${@}"|logger -t firewall.cwmp -p info
|
||||
}
|
||||
|
||||
if [ ! -f "/var/state/cwmp" ]; then
|
||||
touch "/var/state/cwmp"
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
zone_name=$(uci -c /var/state -q get cwmp.acs.zonename)
|
||||
port=$(uci -q get cwmp.cpe.port)
|
||||
ipaddr=$(uci -c /var/state -q get cwmp.acs.ip)
|
||||
ip6addr=$(uci -c /var/state -q get cwmp.acs.ip6)
|
||||
incoming_rule=$(uci -q get cwmp.cpe.incoming_rule|tr 'A-Z' 'a-z')
|
||||
|
||||
if [ -z "${zone_name}" ]; then
|
||||
log "empty firewall zone name"
|
||||
exit 0
|
||||
elif [ "$zone_name" = "icwmp" ]; then
|
||||
iptables -nL zone_icwmp_input 2> /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
iptables -N zone_icwmp_input
|
||||
iptables -t filter -A INPUT -j zone_icwmp_input
|
||||
iptables -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
iptables -w 1 -N zone_icwmp_input
|
||||
iptables -w 1 -t filter -A INPUT -j zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
else
|
||||
iptables -F zone_icwmp_input
|
||||
iptables -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
iptables -w 1 -F zone_icwmp_input
|
||||
iptables -w 1 -I zone_icwmp_input -p tcp --dport $port -j REJECT
|
||||
fi
|
||||
else
|
||||
iptables -F zone_icwmp_input 2> /dev/null
|
||||
iptables -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -X zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -F zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -t filter -D INPUT -j zone_icwmp_input 2> /dev/null
|
||||
iptables -w 1 -X zone_icwmp_input 2> /dev/null
|
||||
fi
|
||||
#iptables -I FW_ZONE -p tcp -s ACS_ADDRESS --dport PORT -j ACCEPT --comment "Open ACS port"
|
||||
|
||||
cmd="iptables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
cmd6="ip6tables -w 1 -I zone_${zone_name}_input -p tcp"
|
||||
|
||||
# default incoming rule is Port only
|
||||
if [ -z "${incoming_rule}" ]; then
|
||||
incoming_rule="port_only"
|
||||
fi
|
||||
|
||||
if [ "${incoming_rule}" = "ip_only" ]; then
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
elif [ "${incoming_rule}" = "port_only" ]; then
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
cmd6="${cmd6} --dport ${port}"
|
||||
fi
|
||||
else
|
||||
if [ -n "${ipaddr}" ]; then
|
||||
cmd="${cmd} -s ${ipaddr}"
|
||||
cmd6="${cmd6} -s ${ip6addr}"
|
||||
fi
|
||||
|
||||
if [ -n "${port}" ]; then
|
||||
cmd="${cmd} --dport ${port}"
|
||||
cmd6="${cmd6} --dport ${port}"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ${cmd}|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd="${cmd} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd}
|
||||
fi
|
||||
|
||||
echo ${cmd6}|grep -q "\-\-dport \|\-s "
|
||||
if [ "$?" -eq 0 ]; then
|
||||
cmd6="${cmd6} -j ACCEPT -m comment --comment=Open_ACS_port"
|
||||
${cmd6}
|
||||
fi
|
||||
|
||||
uci -c /var/state -q set cwmp.cpe.firewall_restart="init"
|
||||
uci -c /var/state -q commit cwmp
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/network.sh
|
||||
|
||||
[ "$ACTION" == "ifup" ] || exit 0
|
||||
|
||||
[ -f /etc/config/cwmp ] || exit 0
|
||||
|
||||
handle_icwmp_restart() {
|
||||
[ -f /tmp/switching_mode ] && exit 0
|
||||
[ -f /tmp/wificontrol.txt -a -f /tmp/netmode-conf.pid ] && exit 0
|
||||
|
||||
[ "$INTERFACE" == "loopback" ] && exit 0
|
||||
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
[ -n "$defwan" -a "$(uci -q get network.$defwan)" == "interface" -a "$defwan" != "$INTERFACE" ] && exit 0
|
||||
|
||||
local islan="$(uci -q get network.$INTERFACE.is_lan)"
|
||||
[ "$islan" == "1" ] && exit 0
|
||||
|
||||
local proto="$(uci -q get network.$INTERFACE.proto)"
|
||||
[ "$proto" == "none" ] && exit 0
|
||||
|
||||
local ifname="$(uci -q get network.$INTERFACE.ifname)"
|
||||
[ "${ifname:0:1}" == "@" ] && exit 0
|
||||
|
||||
mkdir -p /tmp/ipv4
|
||||
|
||||
network_flush_cache
|
||||
|
||||
local previpaddr=""
|
||||
local curipaddr=""
|
||||
local ipaddrfile=/tmp/ipv4/$INTERFACE-ipaddr
|
||||
previpaddr=$(cat $ipaddrfile 2>/dev/null)
|
||||
network_get_ipaddr curipaddr $INTERFACE
|
||||
[ -n "$curipaddr" ] && echo $curipaddr > $ipaddrfile || rm -f $ipaddrfile
|
||||
|
||||
local prevgateway=""
|
||||
local curgateway=""
|
||||
local gatewayfile=/tmp/ipv4/$INTERFACE-gateway
|
||||
prevgateway=$(cat $gatewayfile 2>/dev/null)
|
||||
network_get_gateway curgateway $INTERFACE
|
||||
[ -n "$curgateway" ] && echo $curgateway > $gatewayfile || rm -f $gatewayfile
|
||||
|
||||
local prevsubnets=""
|
||||
local cursubnets=""
|
||||
local subnetsfile=/tmp/ipv4/$INTERFACE-subnets
|
||||
prevsubnets=$(cat $subnetsfile 2>/dev/null)
|
||||
network_get_subnets cursubnets $INTERFACE
|
||||
[ -n "$cursubnets" ] && echo $cursubnets > $subnetsfile || rm -f $subnetsfile
|
||||
|
||||
local prevdnsservers=""
|
||||
local curdnsservers=""
|
||||
local dnsserverfile=/tmp/ipv4/$INTERFACE-dnsservers
|
||||
prevdnsservers=$(cat $dnsserverfile 2>/dev/null)
|
||||
network_get_dnsserver curdnsservers $INTERFACE
|
||||
[ -n "$curdnsservers" ] && echo $curdnsservers > $dnsserverfile || rm -f $dnsserverfile
|
||||
|
||||
local prevdev=""
|
||||
local curdev=""
|
||||
local devfile=/tmp/ipv4/$INTERFACE-dev
|
||||
prevdev=$(cat $devfile 2>/dev/null)
|
||||
network_get_device curdev $INTERFACE
|
||||
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
|
||||
|
||||
local prevopt43url=""
|
||||
local curopt43url=""
|
||||
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
|
||||
prevopt43url=$(cat $opt43urlfile 2>/dev/null)
|
||||
curopt43url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
[ -n "$curopt43url" ] && echo $curopt43url > $opt43urlfile || rm -f $opt43urlfile
|
||||
|
||||
[ \
|
||||
"$prevdev" == "$curdev" -a \
|
||||
"$previpaddr" = "$curipaddr" -a \
|
||||
"$prevgateway" = "$curgateway" -a \
|
||||
"$prevsubnets" = "$cursubnets" -a \
|
||||
"$prevdnsservers" = "$curdnsservers" \
|
||||
] && {
|
||||
[ "$prevopt43url" = "$curopt43url" ] && exit 0
|
||||
[ -z "$prevopt43url" ] && exit 0
|
||||
}
|
||||
|
||||
/etc/init.d/icwmpd reload &
|
||||
}
|
||||
|
||||
handle_icwmp_restart
|
||||
43
icwmp/files/etc/icwmpd/update.sh
Normal file
43
icwmp/files/etc/icwmpd/update.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
log() {
|
||||
echo $@ |logger -t cwmp.update -p info
|
||||
}
|
||||
|
||||
handle_icwmp_update() {
|
||||
local defwan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
local vendorspecinf=`ifstatus ${defwan} | jsonfilter -e "@.data.vendorspecinf"`
|
||||
|
||||
log "Handling dhcp option value ${vendorspecinf}"
|
||||
[ -n "$vendorspecinf" ] && {
|
||||
local url=""
|
||||
local old_url="$(uci -q get cwmp.acs.dhcp_url)"
|
||||
|
||||
case $vendorspecinf in
|
||||
http://*|https://*)
|
||||
url="${vendorspecinf}"
|
||||
;;
|
||||
*)
|
||||
for optval in $vendorspecinf; do
|
||||
case $optval in
|
||||
1=*)
|
||||
url="$(echo $optval | cut -d"=" -f2-)"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -n "$url" ]; then
|
||||
log "## icwmp url[${old_url}] changed to [${url}]"
|
||||
if [ "${url}" != "${old_url}" ]; then
|
||||
log "Restarting icwmp url[${old_url}] changed to [${url}]"
|
||||
uci -q set cwmp.acs.dhcp_url="$url"
|
||||
uci commit cwmp
|
||||
ubus call uci commit '{"config":"cwmp"}'
|
||||
fi
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
handle_icwmp_update
|
||||
@@ -6,126 +6,41 @@ include /lib/network
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
STOP=2
|
||||
|
||||
USE_PROCD=1
|
||||
PROG="/usr/sbin/icwmpd"
|
||||
|
||||
EXTRA_COMMANDS="notify"
|
||||
EXTRA_HELP=" start [GetRPCMethods] Start icwmpd service and send GetRPCMethods"
|
||||
|
||||
validate_url() {
|
||||
# SCHEMA_LIST: contain list of possible schemas that could be present in the acs url
|
||||
# Example: SCHEMA_LIST="http https"
|
||||
SCHEMA_LIST="http"
|
||||
|
||||
for schema in $SCHEMA_LIST; do
|
||||
dest=`echo $1 | sed 's/$schema:\/\///g' | cut -f1 -d \/ | cut -f1 -d:`
|
||||
if [ "_$dest" != "_" ]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
build_dmmap_instance() {
|
||||
[ ! -e /etc/icwmpd/.icwmpd_backup_session.xml ] && /usr/sbin/icwmp get name "" 0 >/dev/null 2>&1
|
||||
}
|
||||
|
||||
get_acs_url() {
|
||||
local default_acs="http://10.10.1.6:8000/openacs/acs"
|
||||
local acs_dhcp_discovery="$(uci -q get cwmp.acs.dhcp_discovery)"
|
||||
local url="$(uci -q get cwmp.acs.url)"
|
||||
local dhcp_url="$(uci -P /var/state -q get cwmp.acs.dhcp_url)"
|
||||
|
||||
if [ "$acs_dhcp_discovery" == "enable" -a -n "$dhcp_url" -o -z "$url" ]; then
|
||||
url="$dhcp_url"
|
||||
echo "ACS URL from DHCP server: $url"
|
||||
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url" || url="$default_acs"
|
||||
elif [ -n "$url" ];then
|
||||
url="$(uci -q get cwmp.acs.url)"
|
||||
echo "ACS URL from configuration: $url"
|
||||
else
|
||||
url="$default_acs"
|
||||
echo "Using default ACS URL: $url"
|
||||
[ -n "$url" ] && uci -P /var/state -q set cwmp.acs.url="$url"
|
||||
fi
|
||||
|
||||
validate_url "$url"
|
||||
if [ "$?" != "0" ];then
|
||||
echo "Invalid ACS URL: $url"
|
||||
exit 1
|
||||
fi
|
||||
log() {
|
||||
echo "${@}"|logger -t cwmp.init -p info
|
||||
}
|
||||
|
||||
enable_dhcp_option43() {
|
||||
local wan=$1
|
||||
local discovery=0
|
||||
case $2 in
|
||||
enable|1) discovery=1 ;;
|
||||
esac
|
||||
local wan="${1}"
|
||||
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local enabled
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
local tropts="43"
|
||||
local oldreqopts="$reqopts"
|
||||
local ropt iopt
|
||||
local newreqopts=""
|
||||
local option43_present=0
|
||||
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $tropts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
43) option43_present=1 ;;
|
||||
*) ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${option43_present} -eq 1 ]; then
|
||||
return;
|
||||
fi
|
||||
|
||||
newreqopts="$reqopts 43"
|
||||
if [ $proto == "dhcp" ]; then
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
[ "$newreqopts" == "$oldreqopts" ] && return
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
fi
|
||||
########################################################
|
||||
}
|
||||
|
||||
wait_for_option43() {
|
||||
local time=$1
|
||||
local default_wan_interface dhcp_discovery url
|
||||
|
||||
config_get default_wan_interface cpe default_wan_interface "wan"
|
||||
config_get dhcp_discovery acs dhcp_discovery "0"
|
||||
config_get url acs url
|
||||
|
||||
enable_dhcp_option43 $default_wan_interface $dhcp_discovery
|
||||
|
||||
local tm=0
|
||||
|
||||
if [ "$dhcp_discovery" == "enable" -o "$dhcp_discovery" == "1" ]
|
||||
then
|
||||
echo "Waiting for discovery of ACS URL from dhcp server ..."
|
||||
while [ $tm -le $time ]
|
||||
do
|
||||
acs_url=`uci -P /var/state -q get cwmp.acs.dhcp_url`
|
||||
if [ "$acs_url" != "" ]
|
||||
then
|
||||
break
|
||||
else
|
||||
sleep 1
|
||||
fi
|
||||
tm=$((tm+1))
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
wait_for_resolvfile() {
|
||||
@@ -143,60 +58,215 @@ wait_for_resolvfile() {
|
||||
}
|
||||
|
||||
set_wan_interface() {
|
||||
local wan_interface="${1}"
|
||||
local l3_device=""
|
||||
local default_wan_interface=""
|
||||
|
||||
config_get default_wan_interface cpe default_wan_interface "wan"
|
||||
json_load "$(ifstatus $default_wan_interface)"
|
||||
if [ -z "${wan_interface}" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
json_load "$(ifstatus ${wan_interface})"
|
||||
json_get_var l3_device l3_device
|
||||
if [ "$l3_device" != "" ];then
|
||||
uci -q set cwmp.cpe.interface="$l3_device"
|
||||
if [ -n "$l3_device" ]; then
|
||||
uci -q set cwmp.cpe.interface="${l3_device}"
|
||||
uci -q commit cwmp
|
||||
fi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
if [ ! -f /tmp/.icwmpd_boot ]; then
|
||||
touch /etc/icwmpd/.icwmpd_boot
|
||||
touch /tmp/.icwmpd_boot
|
||||
else
|
||||
[ -f /sbin/netifd ] && echo "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /etc/config/wireless ] && echo "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless
|
||||
[ -f /usr/sbin/dnsmasq ] && echo "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && echo "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
[ -f /usr/sbin/asterisk ] && echo "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk
|
||||
|
||||
config_load cwmp
|
||||
build_dmmap_instance
|
||||
set_wan_interface
|
||||
wait_for_option43 20
|
||||
get_acs_url
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
if [ "$1" = "GetRPCMethods" ];then
|
||||
procd_append_param command -g
|
||||
elif [ -f /etc/icwmpd/.icwmpd_boot ]; then
|
||||
procd_append_param command -b
|
||||
copy_cwmp_etc_files_to_varstate() {
|
||||
if [ ! -f /var/state/cwmp ]
|
||||
then
|
||||
if [ -f /etc/icwmpd/cwmp ]
|
||||
then
|
||||
uci -q -c /etc/icwmpd delete cwmp.acs
|
||||
uci -q -c /etc/icwmpd commit cwmp
|
||||
cp /etc/icwmpd/cwmp /var/state/cwmp
|
||||
else
|
||||
touch /var/state/cwmp
|
||||
fi
|
||||
procd_set_param respawn "3" "7" "0"
|
||||
procd_close_instance
|
||||
#procd_open_instance
|
||||
#[ "$(uci -q get cwmp.cpe.notification)" == "1" ] && procd_append_param command "/usr/sbin/icwmp_notifd"
|
||||
#procd_close_instance
|
||||
fi
|
||||
|
||||
mkdir -p /var/run/icwmpd
|
||||
if [ -f /etc/icwmpd/icwmpd_backup_session.xml ]
|
||||
then
|
||||
mv /etc/icwmpd/icwmpd_backup_session.xml /var/run/icwmpd 2>/dev/null
|
||||
fi
|
||||
if [ -f /etc/icwmpd/dm_enabled_notify.xml ]
|
||||
then
|
||||
mv /etc/icwmpd/dm_enabled_notify /var/run/icwmpd 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
copy_cwmp_varstate_files_to_etc() {
|
||||
if [ -f /var/state/cwmp ]
|
||||
then
|
||||
cp /var/state/cwmp /etc/icwmpd 2>/dev/null
|
||||
fi
|
||||
if [ -f /var/run/icwmpd/icwmpd_backup_session.xml ]
|
||||
then
|
||||
cp /var/run/icwmpd/icwmpd_backup_session.xml /etc/icwmpd 2>/dev/null
|
||||
fi
|
||||
if [ -f /var/run/icwmpd/dm_enabled_notify.xml ]
|
||||
then
|
||||
cp /var/run/icwmpd/dm_enabled_notify /etc/icwmpd 2>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
validate_acs_section()
|
||||
{
|
||||
uci_validate_section cwmp acs "acs" \
|
||||
'passwd:string' \
|
||||
'periodic_inform_enable:bool' \
|
||||
'periodic_inform_interval:uinteger' \
|
||||
'periodic_inform_time:string' \
|
||||
'url:string' \
|
||||
'dhcp_url:string' \
|
||||
'compression:or("GZIP","Deflate","Disabled")' \
|
||||
'retry_min_wait_interval:range(1, 65535)' \
|
||||
'retry_interval_multiplier:range(1000, 65535)' \
|
||||
'https_ssl_capath:file' \
|
||||
'ipv6_enable:bool'
|
||||
|
||||
}
|
||||
|
||||
validate_cpe_section()
|
||||
{
|
||||
uci_validate_section cwmp cpe "cpe" \
|
||||
'interface:string' \
|
||||
'default_wan_interface:string' \
|
||||
'log_to_console:or("enable","disable")' \
|
||||
'log_to_file:or("enable","disable")' \
|
||||
'log_severity:or("EMERG", "ALERT", "CRITIC" ,"ERROR", "WARNING", "NOTICE", "INFO", "DEBUG")' \
|
||||
'log_file_name:string' \
|
||||
'log_max_size:uinteger' \
|
||||
'userid:string' \
|
||||
'passwd:string' \
|
||||
'port:uinteger' \
|
||||
'provisioning_code:string:""' \
|
||||
'amd_version:range(1, 6)' \
|
||||
'instance_mode:or("InstanceNumber","InstanceAlias")' \
|
||||
'session_timeout:uinteger' \
|
||||
'notification:bool' \
|
||||
'exec_download:bool' \
|
||||
'periodic_notify_enable:bool' \
|
||||
'enable:bool' \
|
||||
'periodic_notify_interval:uinteger'
|
||||
}
|
||||
|
||||
validate_defaults() {
|
||||
config_load cwmp
|
||||
|
||||
validate_acs_section || {
|
||||
log "Validation of acs section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ -z "${url}" -a -z "${dhcp_url}" ] && {
|
||||
log "ACS url is empty can't start"
|
||||
return 1;
|
||||
}
|
||||
|
||||
validate_cpe_section || {
|
||||
log "Validation of cpe section failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
[ -z "${default_wan_interface}" ] && {
|
||||
log "Wan interface is empty"
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
boot() {
|
||||
local dhcp_url=""
|
||||
local discovery="1"
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool dhcp_discovery acs dhcp_discovery 1
|
||||
config_get dhcp_url acs dhcp_url ""
|
||||
|
||||
if [ "${dhcp_discovery}" == "enable" -o "${dhcp_discovery}" == "1" ]; then
|
||||
if [ -z "${dhcp_url}" ]; then
|
||||
log "dhcp discovery enabled but no dhcp url, trigger update"
|
||||
/etc/icwmpd/update.sh
|
||||
fi
|
||||
fi
|
||||
start
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enable_cwmp
|
||||
local wan_interface
|
||||
local dhcp_discovery
|
||||
|
||||
config_load cwmp
|
||||
config_get_bool enable_cwmp cpe enable 1
|
||||
config_get dhcp_discovery acs dhcp_discovery
|
||||
config_get wan_interface cpe default_wan_interface "wan"
|
||||
|
||||
if [ "$enable_cwmp" = "0" -o "$enable_cwmp" = "false" ]; then
|
||||
log "CWMP is not enabled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Set wan interface if not configured
|
||||
set_wan_interface "${wan_interface}"
|
||||
|
||||
# Set dhcp option 43 if dhcp discovery enabled
|
||||
if [ "${dhcp_discovery}" == "enable" -o "${dhcp_discovery}" == "1" ]; then
|
||||
enable_dhcp_option43 "${wan_interface}"
|
||||
fi
|
||||
|
||||
[ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface
|
||||
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
|
||||
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
|
||||
|
||||
# Copy backup data so that if it restart latter on it gets the info
|
||||
copy_cwmp_etc_files_to_varstate
|
||||
|
||||
validate_defaults || {
|
||||
log "Validation of defaults failed"
|
||||
return 1;
|
||||
}
|
||||
|
||||
procd_open_instance icwmp
|
||||
procd_set_param command "$PROG"
|
||||
procd_append_param command -b
|
||||
procd_set_param respawn \
|
||||
${respawn_threshold:-5} \
|
||||
${respawn_timeout:-10} ${respawn_retry:-3}
|
||||
|
||||
procd_set_param watch network.interface
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
stop_service()
|
||||
{
|
||||
copy_cwmp_varstate_files_to_etc
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
log "Restarting CWMP client"
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
notify() {
|
||||
ubus -t 1 call tr069 notify >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_config_trigger "config.change" "cwmp" /etc/init.d/icwmpd reload
|
||||
procd_add_reload_trigger "cwmp"
|
||||
|
||||
procd_open_trigger
|
||||
json_add_array
|
||||
json_add_string "" "interface.update"
|
||||
json_add_array
|
||||
json_add_array
|
||||
json_add_string "" "run_script"
|
||||
json_add_string "" "/etc/icwmpd/update.sh"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "2000"
|
||||
json_close_array
|
||||
procd_close_trigger
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Copy defaults by the factory to the cwmp UCI user section.
|
||||
|
||||
# Get Manufacturer OUI.
|
||||
oui=$(uci -q get cwmp.cpe.manufacturer_oui)
|
||||
if [ -z "${oui}" ]; then
|
||||
oui=$(db -q get device.deviceinfo.ManufacturerOUI)
|
||||
fi
|
||||
|
||||
# Get factory base MAC.
|
||||
baseMac=$(db -q get hw.board.basemac)
|
||||
|
||||
# Erase colon and space characters.
|
||||
baseMac=${baseMac//:/}
|
||||
baseMac=${baseMac// /}
|
||||
|
||||
# Caseing and fixed length string.
|
||||
mac=$(printf "%12.12X" $((0x$baseMac)))
|
||||
oui=$(echo "${oui}" | tr 'a-f' 'A-F')
|
||||
|
||||
# Get system serial number.
|
||||
serial=$(db -q get hw.board.serial_number)
|
||||
serial=$(uci -q get cwmp.cpe.serial_number)
|
||||
if [ -z "${serial}" ]; then
|
||||
serial=$(db -q get device.deviceinfo.SerialNumber)
|
||||
fi
|
||||
|
||||
# Get userid values
|
||||
acs_userid=$(uci -q get cwmp.acs.userid)
|
||||
@@ -21,12 +21,12 @@ cpe_userid=$(uci -q get cwmp.cpe.userid)
|
||||
# Only set if they are empty
|
||||
if [ -z "$acs_userid" ]
|
||||
then
|
||||
uci -q set cwmp.acs.userid="${mac:0:6}-${serial}"
|
||||
uci -q set cwmp.acs.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
if [ -z "$cpe_userid" ]
|
||||
then
|
||||
uci -q set cwmp.cpe.userid="${mac:0:6}-${serial}"
|
||||
uci -q set cwmp.cpe.userid="${oui}-${serial}"
|
||||
fi
|
||||
|
||||
# No need for commit here, it is done by uci_apply_defaults().
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
set_cwmp_reqopts() {
|
||||
### Ask for DHCP Option 43 only if CWMP is enabled ###
|
||||
local wan=$(uci -q get cwmp.cpe.default_wan_interface)
|
||||
local dhcp_discovery=$(uci -q get cwmp.acs.dhcp_discovery)
|
||||
local discovery=0
|
||||
case $dhcp_discovery in
|
||||
enable|1) discovery=1 ;;
|
||||
esac
|
||||
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.$wan.reqopts)"
|
||||
local proto="$(uci -q get network.$wan.proto)"
|
||||
local tropts="43"
|
||||
local oldreqopts="$reqopts"
|
||||
local ropt iopt
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $tropts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
43) [ $discovery -eq 1 ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
if [ "$proto" == "dhcp" ]; then
|
||||
newreqopts="$(echo $newreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
oldreqopts="$(echo $oldreqopts | tr ' ' '\n' | sort -n | tr '\n' ' ' | sed 's/^[ \t]*//;s/[ \t]*$//')"
|
||||
[ "$newreqopts" == "$oldreqopts" ] && return
|
||||
uci -q set network.$wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
fi
|
||||
}
|
||||
|
||||
regenerate_ssl_link(){
|
||||
local cert_dir="/etc/ssl/certs"
|
||||
local all_file=$(ls $cert_dir/*.pem)
|
||||
for cfile in $all_file
|
||||
do
|
||||
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
|
||||
done
|
||||
}
|
||||
|
||||
set_cwmp_reqopts
|
||||
regenerate_ssl_link
|
||||
18
icwmp/files/etc/uci-defaults/95-icwmp-generate-ssl
Normal file
18
icwmp/files/etc/uci-defaults/95-icwmp-generate-ssl
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
regenerate_ssl_link(){
|
||||
[ ! -d "/etc/ssl/certs" ] && return 0;
|
||||
[ ! -f "/etc/ssl/certs/*.pem" ] && return 0;
|
||||
|
||||
local cert_dir="/etc/ssl/certs"
|
||||
local all_file=$(ls $cert_dir/*.pem)
|
||||
|
||||
for cfile in $all_file
|
||||
do
|
||||
ln -s $cfile $cert_dir/$(openssl x509 -hash -noout -in $cfile).0
|
||||
done
|
||||
}
|
||||
|
||||
regenerate_ssl_link
|
||||
@@ -1 +1 @@
|
||||
/etc/icwmpd/.icwmpd_backup_session.xml
|
||||
/var/run/icwmpd/icwmpd_backup_session.xml
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# As part of sysupgrade we copy CWMP Backup Session XML file.
|
||||
|
||||
|
||||
# Abort on any error.
|
||||
set -e
|
||||
|
||||
|
||||
# Do nothing if user want to discard old settings.
|
||||
if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Source functions.
|
||||
for f in /lib/upgrade/iopsys*.sh; do
|
||||
[ -r "$f" -a -s "$f" ] || continue
|
||||
source $f
|
||||
done
|
||||
|
||||
|
||||
if [ -s "${2}/etc/icwmpd/.icwmpd_backup_session.xml" ]; then
|
||||
cat "${2}/etc/icwmpd/.icwmpd_backup_session.xml" > "/etc/icwmpd/.icwmpd_backup_session.xml"
|
||||
fi
|
||||
|
||||
# Report success.
|
||||
log "post-hooks" "CWMP Backup Session XML file migrated"
|
||||
|
||||
exit 0
|
||||
@@ -1,29 +1,14 @@
|
||||
if PACKAGE_ieee1905 || PACKAGE_lib1905al
|
||||
if (PACKAGE_ieee1905)
|
||||
|
||||
menu "developer/debug options"
|
||||
menu "Configurations"
|
||||
|
||||
config IEEE1905_MAP_COMPLETE_NETWORK
|
||||
bool "Create network topology for complete network"
|
||||
default n
|
||||
config IEEE1905_EXTENSION_ALLOWED
|
||||
bool "Allow plugins to extend 1905 CMDUs and/or TLVs"
|
||||
default y
|
||||
|
||||
config IEEE1905_SPEED_UP_DISCOVERY
|
||||
bool "Speed up discovery of an AL in network"
|
||||
default y
|
||||
config IEEE1905_PLATFORM_HAS_WIFI
|
||||
bool "Platform has WiFi"
|
||||
default y if PACKAGE_libwifi
|
||||
|
||||
config IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
bool "Do not accept M1/M2 messages from unknown AL(s)"
|
||||
default y
|
||||
|
||||
choice
|
||||
prompt "Select ALME support"
|
||||
default IEEE1905_ALME_OVER_UBUS
|
||||
|
||||
config IEEE1905_ALME_OVER_UBUS
|
||||
bool "ALME methods supported over ubus"
|
||||
|
||||
#config IEEE1905_ALME_OVER_TCP
|
||||
# bool "ALME server over TCP port"
|
||||
|
||||
endchoice
|
||||
endmenu
|
||||
endif
|
||||
|
||||
@@ -1,141 +1,140 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
# Copyright (C) 2021 IOPSYS
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ieee1905
|
||||
PKG_VERSION:=2.1.32
|
||||
PKG_VERSION:=4.6.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=2bb1c564d31a99d80a3f977c1f817777722a601d
|
||||
PKG_SOURCE_VERSION:=373602c3644ead5c61aece58e1f88f52838bb38b
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/ieee1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/ieee1905
|
||||
|
||||
define Package/ieee1905/Default
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 daemon
|
||||
DEPENDS:= +libuci +libjson-c +libieee1905 +ubox +libpcap +libopenssl +libwifi +libeasy
|
||||
SUBMENU:=IEEE-1905.1 stack
|
||||
endef
|
||||
|
||||
define Package/ieee1905/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/ieee1905/description
|
||||
IEEE1905 stack with extended functionalities.
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/libieee1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 cmdu tlv utility library
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE+= (library for CMDU and TLV handling)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json
|
||||
endef
|
||||
|
||||
define Package/libwsc
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Wifi Simple Configuration building and processing library
|
||||
DEPENDS= +libopenssl +libuci +libubus
|
||||
define Package/ieee1905
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE+= ieee1905d (daemon implementing 1905.1 and provides cli)
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ubus +libpthread \
|
||||
+libieee1905 +IEEE1905_PLATFORM_HAS_WIFI:libwifi
|
||||
endef
|
||||
|
||||
define Package/lib1905hle
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=IEEE1905 hle stack library
|
||||
|
||||
define Package/map-plugin
|
||||
$(call Package/ieee1905/Default,$(1))
|
||||
TITLE:=Multi-AP (Easymesh) plugin
|
||||
DEPENDS= +libubox +libuci +libubus +libeasy +libnl-genl \
|
||||
+libjson-c +libblobmsg-json +ieee1905 +libieee1905
|
||||
endef
|
||||
|
||||
LIBS := \
|
||||
$(if $(CONFIG_PACKAGE_libwsc),libwsc.so)
|
||||
define Package/ieee1905/description
|
||||
This package provides IEEE Std 1905.1 stack.
|
||||
endef
|
||||
|
||||
define Package/libieee1905/description
|
||||
This package provides library functions for IEEE Std 1905.1 stack.
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall \
|
||||
-Wextra
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
MAKE_FLAGS += \
|
||||
LIBS="$(LIBS)"
|
||||
|
||||
ifeq ($(CONFIG_IEEE1905_SPEED_UP_DISCOVERY),y)
|
||||
TARGET_CFLAGS += -DSPEED_UP_DISCOVERY
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_DO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS),y)
|
||||
TARGET_CFLAGS += -DDO_NOT_ACCEPT_UNAUTHENTICATED_COMMANDS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_ALME_OVER_TCP),y)
|
||||
TARGET_CFLAGS += -DALME_OVER_TCP
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_ALME_OVER_UBUS),y)
|
||||
TARGET_CFLAGS += -DALME_OVER_UBUS
|
||||
endif
|
||||
ifeq ($(CONFIG_IEEE1905_MAP_COMPLETE_NETWORK),y)
|
||||
TARGET_CFLAGS += -DIEEE1905_MAP_COMPLETE_NETWORK
|
||||
ifeq ($(CONFIG_IEEE1905_PLATFORM_HAS_WIFI),y)
|
||||
TARGET_CFLAGS += -DHAS_WIFI
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/ieee1905/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
MAKE_PATH:=src
|
||||
|
||||
|
||||
define Package/ieee1905/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_DIR) $(1)/etc/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) ./files/etc/init.d/ieee1905 $(1)/etc/init.d/ieee1905
|
||||
$(INSTALL_DATA) ./files/etc/config/ieee1905 $(1)/etc/config/ieee1905
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ieee1905d $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/lib1905hle/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/lib1905hle.so $(1)/usr/lib/lib1905hle.so
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ieee1905d $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/libieee1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib/libieee1905.so
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/libwsc/install
|
||||
define Package/map-plugin/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/libwsc.so
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev/libwsc.so
|
||||
define Build/InstallDev/map-plugin
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map2.h $(1)/usr/include/map2.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map_module.h $(1)/usr/include/map_module.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/cntlrsync.h $(1)/usr/include/cntlrsync.h
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/map.so $(1)/usr/lib/ieee1905/map.so
|
||||
$(CP) $(PKG_BUILD_DIR)/src/extensions/map/libmaputil.so $(1)/usr/lib/libmaputil.so
|
||||
endef
|
||||
|
||||
|
||||
define Build/InstallDev/libieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libwsc/include/wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libwsc.so $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/cmdu_ackq.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/1905_tlvs.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/i1905_wsc.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/bufutil.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/timer_impl.h $(1)/usr/include/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libmidgen.so $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/libieee1905.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/include/ieee1905
|
||||
$(INSTALL_DIR) $(1)/usr/include/lib1905hle
|
||||
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/ieee1905/
|
||||
$(CP) $(PKG_BUILD_DIR)/libieee1905/include/*.h $(1)/usr/include/ieee1905/
|
||||
$(CP) $(PKG_BUILD_DIR)/lib1905hle/include/*.h $(1)/usr/include/lib1905hle/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/lib/libieee1905.so $(1)/usr/lib
|
||||
$(foreach lib,$(LIBS),$(call Build/InstallDev/$(lib),$(1),$(2));)
|
||||
$(call Build/InstallDev/libieee1905,$(1),$(2))
|
||||
$(call Build/InstallDev/map-plugin,$(1),$(2))
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libieee1905))
|
||||
$(eval $(call BuildPackage,lib1905hle))
|
||||
$(eval $(call BuildPackage,libwsc))
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/ieee1905/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,ieee1905))
|
||||
$(eval $(call BuildPackage,libieee1905))
|
||||
$(eval $(call BuildPackage,map-plugin))
|
||||
|
||||
31
ieee1905/files/etc/config/ieee1905
Normal file → Executable file
31
ieee1905/files/etc/config/ieee1905
Normal file → Executable file
@@ -1,17 +1,22 @@
|
||||
config ieee1905 'ieee1905'
|
||||
option enabled '1'
|
||||
option debug true
|
||||
option debug_level 2
|
||||
option macaddress 'auto'
|
||||
option registrar 0
|
||||
option cmdu_event 1
|
||||
option map_plugin 1
|
||||
option enabled '1'
|
||||
option extension '1'
|
||||
list extmodule 'map'
|
||||
option registrar '2 5'
|
||||
|
||||
config security 'security'
|
||||
list method 'PBC'
|
||||
config ap
|
||||
option band '2'
|
||||
option ssid 'TestSSID.2'
|
||||
option encryption 'psk2'
|
||||
option key '5555500000'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option ssid 'TestSSID.5'
|
||||
option encryption 'psk2'
|
||||
option key '2222200000'
|
||||
|
||||
config al-iface
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option media 'bridge'
|
||||
|
||||
option enabled 1
|
||||
option ifname 'br-lan'
|
||||
option type 'bridge'
|
||||
67
ieee1905/files/etc/init.d/ieee1905
Normal file → Executable file
67
ieee1905/files/etc/init.d/ieee1905
Normal file → Executable file
@@ -1,72 +1,25 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=96
|
||||
STOP=22
|
||||
STOP=21
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/ieee1905d
|
||||
|
||||
validate_ieee1905_section()
|
||||
{
|
||||
uci_validate_section ieee1905 ieee1905 "${1}" \
|
||||
'debug:bool:false' \
|
||||
'enabled:bool:false'
|
||||
}
|
||||
|
||||
configure_ieee1905()
|
||||
{
|
||||
local enabled debug
|
||||
|
||||
validate_ieee1905_section ${1} || {
|
||||
echo "Validation of ieee1905 section failed"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if [ ${debug} -eq 1 ]; then
|
||||
# Forward stdout of the command to logd
|
||||
procd_set_param stdout 1
|
||||
# Same for stderr
|
||||
procd_set_param stderr 1
|
||||
fi
|
||||
|
||||
if [ ${enabled} -ne 1 ]; then
|
||||
exit 0;
|
||||
fi
|
||||
}
|
||||
|
||||
configure_network()
|
||||
{
|
||||
ebtables -L FORWARD|grep -iqE "1:80:C2:(0)+:(0)+:13.*-j.*DROP"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "Applying drop rule to drop pkts forwared by kernel to 1905.1 multicast mac"
|
||||
ebtables -A FORWARD -d 01:80:c2:00:00:13 -j DROP
|
||||
fi
|
||||
}
|
||||
|
||||
service_running() {
|
||||
ubus -t 2 wait_for wifi
|
||||
}
|
||||
|
||||
start_service() {
|
||||
|
||||
[ -d /usr/lib/ieee1905 ] || mkdir -p /usr/lib/ieee1905
|
||||
|
||||
procd_open_instance ieee1905
|
||||
procd_set_param command ${PROG}
|
||||
configure_ieee1905 "ieee1905"
|
||||
configure_network
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/ieee1905d"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "network"
|
||||
procd_add_reload_trigger "wireless"
|
||||
procd_add_reload_trigger "netmode"
|
||||
procd_add_reload_trigger "ieee1905"
|
||||
}
|
||||
|
||||
@@ -5,15 +5,16 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=imonitor
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_SOURCE_PROTO=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/imonitor.git
|
||||
PKG_SOURCE_VERSION:=532f4900862bcb45d8cd4bf37555fabda81750b6
|
||||
PKG_SOURCE_VERSION:=4beb1d5d6925507f1850a84c0b83aaf12a082f7f
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=${PKG_NAME}-${PKG_VERSION}
|
||||
PKG_INSTALL:=1
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=inbd
|
||||
PKG_VERSION:=1.0.1
|
||||
PKG_VERSION:=1.2.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=3135944f3357a7a2c1c206be7b65bbb7ac6d1e58
|
||||
PKG_SOURCE_VERSION:=10f765f3d0fcc226b6ecf0c481598c9e7f76315e
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/inbd
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
45
iop/config
45
iop/config
@@ -1,4 +1,3 @@
|
||||
CONFIG_BUILD_NLS=y
|
||||
CONFIG_BUSYBOX_CUSTOM=y
|
||||
CONFIG_CCACHE=y
|
||||
CONFIG_DEBUG=y
|
||||
@@ -6,7 +5,7 @@ CONFIG_DEVEL=y
|
||||
CONFIG_PACKAGE_6in4=y
|
||||
CONFIG_PACKAGE_6rd=y
|
||||
CONFIG_PACKAGE_6to4=y
|
||||
CONFIG_PACKAGE_alsa-lib=y
|
||||
CONFIG_PACKAGE_at=y
|
||||
CONFIG_PACKAGE_atftp=m
|
||||
CONFIG_PACKAGE_atftpd=m
|
||||
CONFIG_PACKAGE_bulkdata=y
|
||||
@@ -18,17 +17,16 @@ CONFIG_PACKAGE_ddns-scripts=y
|
||||
CONFIG_PACKAGE_ds-lite=y
|
||||
CONFIG_PACKAGE_ethtool=y
|
||||
CONFIG_PACKAGE_getopt=y
|
||||
CONFIG_PACKAGE_glib2=y
|
||||
CONFIG_PACKAGE_gre=y
|
||||
CONFIG_PACKAGE_icwmp=y
|
||||
CONFIG_PACKAGE_ieee1905=y
|
||||
CONFIG_PACKAGE_map-1905=y
|
||||
CONFIG_PACKAGE_map-topology=y
|
||||
CONFIG_PACKAGE_mosquitto-client-ssl=y
|
||||
CONFIG_PACKAGE_mosquitto-ssl=y
|
||||
CONFIG_PACKAGE_wfadatad=y
|
||||
CONFIG_PACKAGE_wfadatad-collector=y
|
||||
CONFIG_PACKAGE_imonitor=m
|
||||
CONFIG_PACKAGE_inbd=y
|
||||
CONFIG_PACKAGE_iopupgrade=y
|
||||
CONFIG_PACKAGE_ip-full=y
|
||||
CONFIG_PACKAGE_iperf3=y
|
||||
CONFIG_PACKAGE_ipset=y
|
||||
@@ -37,23 +35,15 @@ CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
|
||||
CONFIG_PACKAGE_iptables-mod-filter=y
|
||||
CONFIG_PACKAGE_iptables-mod-ipopt=y
|
||||
# CONFIG_PACKAGE_iwatchdog is not set
|
||||
CONFIG_PACKAGE_juci=y
|
||||
CONFIG_PACKAGE_juci-dnsmasq-dhcp=y
|
||||
CONFIG_PACKAGE_juci-firewall-fw3=y
|
||||
CONFIG_PACKAGE_juci-mod-status=y
|
||||
CONFIG_PACKAGE_juci-mod-system=y
|
||||
CONFIG_PACKAGE_juci-network-device=y
|
||||
CONFIG_PACKAGE_juci-network-dsl=y
|
||||
CONFIG_PACKAGE_juci-network-netifd=y
|
||||
CONFIG_PACKAGE_juci-sysupgrade=y
|
||||
CONFIG_PACKAGE_juci-wireless=y
|
||||
CONFIG_PACKAGE_juci-theme-iopsys=y
|
||||
CONFIG_PACKAGE_libdaemon=y
|
||||
CONFIG_PACKAGE_libgmp=y
|
||||
CONFIG_PACKAGE_libreadline=y
|
||||
CONFIG_PACKAGE_jq=y
|
||||
CONFIG_PACKAGE_libreswan=m
|
||||
CONFIG_PACKAGE_libwifi=y
|
||||
CONFIG_PACKAGE_lscpu=y
|
||||
CONFIG_PACKAGE_luci-nginx=y
|
||||
# CONFIG_LUCI_JSMIN is not set
|
||||
# CONFIG_LUCI_CSSTIDY is not set
|
||||
CONFIG_PACKAGE_luci-mod-dashboard=y
|
||||
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
|
||||
CONFIG_PACKAGE_map=y
|
||||
CONFIG_PACKAGE_miniupnpd=y
|
||||
CONFIG_PACKAGE_mwan3=y
|
||||
@@ -70,6 +60,7 @@ CONFIG_OPENSSL_WITH_COMPRESSION=y
|
||||
CONFIG_PACKAGE_openvpn-easy-rsa=y
|
||||
CONFIG_PACKAGE_openvpn-openssl=y
|
||||
CONFIG_PACKAGE_owsd=y
|
||||
CONFIG_PACKAGE_periodicstats=y
|
||||
CONFIG_PACKAGE_peripheral_manager=y
|
||||
CONFIG_PACKAGE_port-management=y
|
||||
CONFIG_PACKAGE_ppp-mod-pppoa=y
|
||||
@@ -86,24 +77,23 @@ CONFIG_PACKAGE_relayd=y
|
||||
CONFIG_PACKAGE_resolveip=y
|
||||
CONFIG_PACKAGE_rpcd=y
|
||||
CONFIG_PACKAGE_rpcd-mod-rpcsys=y
|
||||
CONFIG_PACKAGE_rsync=y
|
||||
CONFIG_PACKAGE_rulengd=y
|
||||
CONFIG_PACKAGE_strace=y
|
||||
CONFIG_PACKAGE_sulu=y
|
||||
CONFIG_PACKAGE_swmodd=m
|
||||
CONFIG_PACKAGE_tc=y
|
||||
CONFIG_PACKAGE_tcpdump=y
|
||||
CONFIG_PACKAGE_terminfo=y
|
||||
CONFIG_PACKAGE_traceroute6=y
|
||||
CONFIG_PACKAGE_uledd=y
|
||||
CONFIG_PACKAGE_umbim=y
|
||||
CONFIG_PACKAGE_uqmi=y
|
||||
CONFIG_PACKAGE_urlfilter=y
|
||||
CONFIG_PACKAGE_usb-modeswitch=y
|
||||
CONFIG_PACKAGE_usbreset=y
|
||||
CONFIG_PACKAGE_uspd=y
|
||||
CONFIG_PACKAGE_vsftpd-tls=m
|
||||
CONFIG_PACKAGE_wget=y
|
||||
CONFIG_PACKAGE_wwan=y
|
||||
CONFIG_PACKAGE_wifimngr=y
|
||||
CONFIG_PACKAGE_uuidgen=y
|
||||
CONFIG_PACKAGE_xl2tpd=y
|
||||
CONFIG_PACKAGE_zoneinfo-core=y
|
||||
CONFIG_PACKAGE_zoneinfo-europe=y
|
||||
@@ -192,13 +182,12 @@ CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS=y
|
||||
CONFIG_BUSYBOX_CONFIG_TIMEOUT=y
|
||||
CONFIG_BUSYBOX_CONFIG_NOHUP=y
|
||||
CONFIG_LIBCURL_CRYPTO_AUTH=y
|
||||
# CONFIG_LIBCURL_MBEDTLS is not set
|
||||
CONFIG_LIBCURL_OPENSSL=y
|
||||
CONFIG_OPENVPN_openssl_ENABLE_IPROUTE2=y
|
||||
# CONFIG_SIGNED_PACKAGES is not set
|
||||
CONFIG_KERNEL_DEVTMPFS=y
|
||||
CONFIG_KERNEL_DEVTMPFS_MOUNT=y
|
||||
# CONFIG_BUSYBOX_CONFIG_IP is not set
|
||||
CONFIG_LOCALMIRROR="https://download.iopsys.eu/iopsys/mirror/"
|
||||
|
||||
@@ -220,8 +209,14 @@ CONFIG_TARGET_PREINIT_IP=""
|
||||
CONFIG_TARGET_PREINIT_NETMASK=""
|
||||
CONFIG_TARGET_PREINIT_BROADCAST=""
|
||||
|
||||
# Generate rootfs tar file
|
||||
CONFIG_TARGET_ROOTFS_TARGZ=y
|
||||
|
||||
# The urandom-seed package is very strange. It seeds urandom with urandom...
|
||||
# Disable it. Most SoCs nowadays has HW random generators anyway.
|
||||
# CONFIG_PACKAGE_urandom-seed is not set
|
||||
# CONFIG_PACKAGE_urngd is not set
|
||||
|
||||
# We use OpenSSL, no need to ship multiple TLS libraries
|
||||
CONFIG_PACKAGE_libustream-openssl=y
|
||||
# CONFIG_PACKAGE_libustream-wolfssl is not set
|
||||
|
||||
@@ -14,7 +14,7 @@ function feeds_update {
|
||||
done
|
||||
|
||||
|
||||
git remote -v | grep -q http || developer=1
|
||||
git remote -v | grep -qE '(git@|ssh://)' && developer=1
|
||||
|
||||
cp .config .genconfig_config_bak
|
||||
|
||||
@@ -32,7 +32,7 @@ function feeds_update {
|
||||
fi
|
||||
|
||||
# targets need to be installed explicitly
|
||||
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx"
|
||||
targets="iopsys-brcm63xx-arm iopsys-ramips intel_mips iopsys-x86 iopsys-armvirt iopsys-bcm27xx iopsys-mediatek iopsys-econet"
|
||||
for target in $targets
|
||||
do
|
||||
rm -f target/linux/$target
|
||||
|
||||
@@ -5,7 +5,6 @@ function genconfig {
|
||||
export IMPORT=1
|
||||
export SRCTREEOVERR=0
|
||||
export FILEDIR="files/"
|
||||
export THEMEDIR="tmp/juci-themes"
|
||||
CURRENT_CONFIG_FILE=".current_config_file"
|
||||
export CONFIGPATH="package/feeds/iopsys/iop"
|
||||
CUSTPATH="customerconfigs"
|
||||
@@ -14,10 +13,9 @@ function genconfig {
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
target_config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
econet="target/linux/iopsys-econet"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
@@ -113,17 +111,15 @@ function genconfig {
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $bcm27xx/genconfig ] &&
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -148,10 +144,10 @@ function genconfig {
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
target_config_path="$intel_mips/config"
|
||||
target="iopsys_econet"
|
||||
target_config_path="$econet/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -171,29 +167,10 @@ function genconfig {
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
target_config_path="$bcm27xx/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
#mediatekAllowed=0
|
||||
|
||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||
#git ls-remote git@dev.iopsys.eu:mediatek/linux.git -q 2>/dev/null && mediatekAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:dialog/natalie-dect-12.26.git -q 2>/dev/null && natalieAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||
}
|
||||
|
||||
v() {
|
||||
@@ -226,7 +203,7 @@ function genconfig {
|
||||
local ALL="$1"
|
||||
local CUSTOMER="$2"
|
||||
if [ "$CUSTOMER" -a -d "$CUSTCONF/$CUSTOMER" ]; then
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 "$CUSTCONF/$CUSTOMER" | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
echo "$CUSTOMER has following boards:"
|
||||
for board in $boards; do
|
||||
@@ -243,7 +220,7 @@ function genconfig {
|
||||
if [ "$customers" -a "$ALL" == 1 ]; then
|
||||
for customer in $customers; do
|
||||
echo $customer
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common | grep -v juci-theme)"
|
||||
local boards="$(ls -1 $CUSTCONF/$customer | grep -v common)"
|
||||
if [ "$boards" ]; then
|
||||
for board in $boards; do
|
||||
echo -e "\t$board"
|
||||
@@ -297,13 +274,6 @@ function genconfig {
|
||||
v "rm -rf $FILEDIR*"
|
||||
rm -rf $FILEDIR*
|
||||
fi
|
||||
|
||||
if [ ! -d "$THEMEDIR" ]; then
|
||||
mkdir -p $THEMEDIR
|
||||
elif [ -d "$THEMEDIR" -a $CLEAN -eq 1 ]; then
|
||||
v "rm -rf $THEMEDIR/*"
|
||||
rm -rf $THEMEDIR/*
|
||||
fi
|
||||
}
|
||||
|
||||
create_and_copy_files()
|
||||
@@ -348,27 +318,16 @@ function genconfig {
|
||||
echo "" >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
elif [ "$target" = "iopsys_ramips" ]; then
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
if [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
@@ -387,11 +346,6 @@ function genconfig {
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/$BOARDTYPE/fs/* $FILEDIR
|
||||
fi
|
||||
if [ -d "$CUSTCONF/$CUSTOMER/juci-theme" ]; then
|
||||
customer="$(echo $CUSTOMER | tr 'A-Z' 'a-z')"
|
||||
v "cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer"
|
||||
cp -ar $CUSTCONF/$CUSTOMER/juci-theme $THEMEDIR/juci-theme-$customer
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
@@ -407,11 +361,14 @@ function genconfig {
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
# Enable Pckage source tree override if selected
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
# developer mode selected ?
|
||||
@@ -419,16 +376,8 @@ function genconfig {
|
||||
if [ $DEVELOPER -eq 1 ]; then
|
||||
# rewrite url to clone with ssh instead of http
|
||||
echo "CONFIG_GITMIRROR_REWRITE=y" >>.config
|
||||
[ $bcmAllowed -eq 0 ] && echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
[ $endptAllowed -eq 0 ] && echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
[ $natalieAllowed -eq 0 ] && echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
#[ $mediatekAllowed -eq 0 ] && echo "CONFIG_MEDIATEK_OPEN=y" >> .config
|
||||
else
|
||||
echo "# CONFIG_GITMIRROR_REWRITE is not set" >>.config
|
||||
echo "CONFIG_BCM_OPEN=y" >> .config
|
||||
echo "CONFIG_ENDPT_OPEN=y" >> .config
|
||||
echo "CONFIG_NATALIE_OPEN=y" >> .config
|
||||
#echo "CONFIG_MEDIATEK_OPEN=y" >> .config
|
||||
fi
|
||||
|
||||
if [ -n "$BRCM_MAX_JOBS" ]
|
||||
@@ -436,9 +385,6 @@ function genconfig {
|
||||
echo "CONFIG_BRCM_MAX_JOBS=\"1\"" >>.config
|
||||
fi
|
||||
|
||||
# Force regeneration of themes
|
||||
touch package/feeds/juci/juci/Makefile
|
||||
|
||||
# Force regeneration of kernel Makefile
|
||||
# Needed to disable kmods for iopsys-brcm targets
|
||||
touch package/kernel/linux/Makefile
|
||||
|
||||
@@ -9,14 +9,12 @@ function genconfig_min {
|
||||
CUSTPATH="customerconfigs"
|
||||
export CUSTCONF="customerconfigs/customers"
|
||||
export VERBOSE=0
|
||||
#always use the mirror
|
||||
export DEVELOPER=0
|
||||
target="bogus"
|
||||
config_path=""
|
||||
bcm27xx="target/linux/iopsys-bcm27xx"
|
||||
target_config_path=""
|
||||
brcm63xx_arm="target/linux/iopsys-brcm63xx-arm"
|
||||
ramips="target/linux/iopsys-ramips"
|
||||
intel_mips="target/linux/intel_mips"
|
||||
econet="target/linux/iopsys-econet"
|
||||
x86="target/linux/iopsys-x86"
|
||||
armvirt="target/linux/iopsys-armvirt"
|
||||
|
||||
@@ -80,7 +78,7 @@ function genconfig_min {
|
||||
|
||||
# Takes a board name and returns the target name in global var $target
|
||||
set_target() {
|
||||
local profile=$1
|
||||
local profile=$1
|
||||
|
||||
[ -n "$profile" ] || return
|
||||
|
||||
@@ -102,7 +100,7 @@ function genconfig_min {
|
||||
|
||||
if [ $pfound -eq 1 ]; then
|
||||
target="$(echo $TARGET | tr '-' '_')"
|
||||
config_path="$targetpath/config"
|
||||
target_config_path="$targetpath/config"
|
||||
fi
|
||||
|
||||
return
|
||||
@@ -112,17 +110,15 @@ function genconfig_min {
|
||||
iopsys_brcm63xx_arm=$(cd $brcm63xx_arm; ./genconfig)
|
||||
[ -e $ramips/genconfig ] &&
|
||||
iopsys_ramips=$(cd $ramips; ./genconfig)
|
||||
[ -e $intel_mips/genconfig ] &&
|
||||
iopsys_intel_mips=$(cd $intel_mips; ./genconfig)
|
||||
[ -e $econet/genconfig ] &&
|
||||
iopsys_econet=$(cd $econet; ./genconfig)
|
||||
[ -e $x86/genconfig ] &&
|
||||
iopsys_x86=$(cd $x86; ./genconfig)
|
||||
[ -e $armvirt/genconfig ] &&
|
||||
iopsys_armvirt=$(cd $armvirt; ./genconfig)
|
||||
[ -e $bcm27xx/genconfig ] &&
|
||||
iopsys_bcm27xx=$(cd $bcm27xx; ./genconfig)
|
||||
|
||||
if [ "$profile" == "LIST" ]; then
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_intel_mips iopsys_x86 iopsys_armvirt iopsys_bcm27xx; do
|
||||
for list in iopsys_brcm63xx_arm iopsys_ramips iopsys_econet iopsys_x86 iopsys_armvirt; do
|
||||
echo "$list based boards:"
|
||||
for b in ${!list}; do
|
||||
echo -e "\t$b"
|
||||
@@ -134,7 +130,7 @@ function genconfig_min {
|
||||
for p in $iopsys_brcm63xx_arm; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_brcm63xx_arm"
|
||||
config_path="$brcm63xx_arm/config"
|
||||
target_config_path="$brcm63xx_arm/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -142,15 +138,15 @@ function genconfig_min {
|
||||
for p in $iopsys_ramips; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_ramips"
|
||||
config_path="$ramips/config"
|
||||
target_config_path="$ramips/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_intel_mips; do
|
||||
for p in $iopsys_econet; do
|
||||
if [ $p == $profile ]; then
|
||||
target="intel_mips"
|
||||
config_path="$intel_mips/config"
|
||||
target="iopsys_econet"
|
||||
target_config_path="$econet/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -158,7 +154,7 @@ function genconfig_min {
|
||||
for p in $iopsys_x86; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_x86"
|
||||
config_path="$x86/config"
|
||||
target_config_path="$x86/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
@@ -166,32 +162,19 @@ function genconfig_min {
|
||||
for p in $iopsys_armvirt; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_armvirt"
|
||||
config_path="$armvirt/config"
|
||||
target_config_path="$armvirt/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
for p in $iopsys_bcm27xx; do
|
||||
if [ $p == $profile ]; then
|
||||
target="iopsys_bcm27xx"
|
||||
config_path="$bcm27xx/config"
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
git remote -v | grep -q http || {
|
||||
git remote -v | grep -qE '(git@|ssh://)' && {
|
||||
DEVELOPER=1
|
||||
|
||||
bcmAllowed=0
|
||||
endptAllowed=0
|
||||
natalieAllowed=0
|
||||
mediatekAllowed=0
|
||||
|
||||
git ls-remote git@dev.iopsys.eu:broadcom/bcmcreator.git -q 2>/dev/null && bcmAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:mediatek/linux.git -q 2>/dev/null && mediatekAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:dialog/natalie-dect-12.26.git -q 2>/dev/null && natalieAllowed=1
|
||||
git ls-remote git@dev.iopsys.eu:iopsys/endptmngr.git -q 2>/dev/null && endptAllowed=1
|
||||
}
|
||||
|
||||
@@ -214,7 +197,8 @@ function genconfig_min {
|
||||
echo -e " -a|--list-all\t\tList all Customers and their board types"
|
||||
echo -e " -b|--boards\t\tList all board types"
|
||||
echo
|
||||
echo "Example ./iop genconfig dg400prime IOPSYS"
|
||||
echo "Example ./iop genconfig eg400 OPERATORX"
|
||||
echo "(if no customerconfig is chosen, iopsys config will be used)"
|
||||
echo
|
||||
exit 0
|
||||
}
|
||||
@@ -264,12 +248,12 @@ function genconfig_min {
|
||||
|
||||
generate_config()
|
||||
{
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
DIFFFILE="$1"
|
||||
MASTERFILE="$2"
|
||||
while read p; do
|
||||
v "$p"
|
||||
sed -r -i "$p" $MASTERFILE
|
||||
done < $DIFFFILE
|
||||
}
|
||||
|
||||
setup_dirs()
|
||||
@@ -316,35 +300,25 @@ function genconfig_min {
|
||||
v "cp $CONFIGPATH/config .config"
|
||||
cp $CONFIGPATH/config .config
|
||||
|
||||
if [ -f $config_path/config ]; then
|
||||
cat $config_path/config >> .config
|
||||
if [ -f $target_config_path/config ]; then
|
||||
cat $target_config_path/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -f $config_path/$BOARDTYPE/config ]; then
|
||||
cat $config_path/$BOARDTYPE/config >> .config
|
||||
if [ -f $target_config_path/$BOARDTYPE/config ]; then
|
||||
cat $target_config_path/$BOARDTYPE/config >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
|
||||
#special handling for intel_mips/iopsys_ramips which use TARGET_DEVICES
|
||||
if [ "$target" = "intel_mips" ]; then
|
||||
subtarget="xrx500"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${device}=y" >> .config
|
||||
elif [ "$target" = "iopsys_ramips" ]; then
|
||||
# Special handling for targets which use TARGET_DEVICES
|
||||
if [ "$target" = "iopsys_ramips" ]; then
|
||||
subtarget="mt7621"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_bcm27xx" ]; then
|
||||
subtarget="iopsys_bcm2711"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
echo "CONFIG_TARGET_MULTI_PROFILE=y" >> .config
|
||||
echo "CONFIG_TARGET_PER_DEVICE_ROOTFS=y" >> .config
|
||||
device=$(echo $BOARDTYPE | tr a-z A-Z)
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
echo "CONFIG_TARGET_DEVICE_${target}_${subtarget}_DEVICE_${BOARDTYPE}=y" >> .config
|
||||
elif [ "$target" = "iopsys_econet" ]; then
|
||||
subtarget="en7562"
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${subtarget}=y" >> .config
|
||||
else
|
||||
echo "CONFIG_TARGET_${target}=y" >> .config
|
||||
echo "CONFIG_TARGET_${target}_${BOARDTYPE}=y" >> .config
|
||||
@@ -366,21 +340,25 @@ function genconfig_min {
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/common/common.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/common/common.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/common/common.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
if [ -e "$CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff" ]; then
|
||||
v "Apply $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff"
|
||||
cat $CUSTCONF/$CUSTOMER/$BOARDTYPE/$BOARDTYPE.diff >> .config
|
||||
echo "" >> .config
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Set target version
|
||||
local GIT_TAG=$(git describe --abbrev=0 --tags)
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_TAG}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_TAG}\"" >> .config
|
||||
local GIT_REV=$(git rev-parse --short HEAD)
|
||||
local GIT_VER="$GIT_TAG"
|
||||
git describe --contains $GIT_REV >/dev/null 2>&1 || GIT_VER="${GIT_TAG}_${GIT_REV}"
|
||||
echo "CONFIG_TARGET_VERSION=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_CODE=\"${GIT_VER}\"" >> .config
|
||||
echo "CONFIG_VERSION_PRODUCT=\"$BOARDTYPE"\" >> .config
|
||||
|
||||
|
||||
# Enable Package source tree override if selected
|
||||
[ $SRCTREEOVERR -eq 1 ] && echo CONFIG_SRC_TREE_OVERRIDE=y >> .config
|
||||
|
||||
@@ -453,6 +431,8 @@ function genconfig_min {
|
||||
shift;
|
||||
done
|
||||
|
||||
CUSTREPO="${CUSTREPO:-git@dev.iopsys.eu:consumer/iopsys.git}"
|
||||
|
||||
setup_dirs
|
||||
create_and_copy_files "$@"
|
||||
fi
|
||||
|
||||
@@ -30,25 +30,6 @@ build_bcmkernel_consumer() {
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_natalie_consumer() {
|
||||
# create natalie-dect open version tar file
|
||||
local natalieversion nataliecommith
|
||||
grep -q "CONFIG_TARGET_NO_DECT=y" .config && return
|
||||
natalieversion=$(grep -w "PKG_VERSION:" ./feeds/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
|
||||
nataliecommith=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/iopsys/natalie-dect/Makefile | cut -d'=' -f2)
|
||||
[ -n "$profile" ] && [ -n "$natalieversion" ] && [ -n "$nataliecommith" ] || return
|
||||
ssh $SERVER "test -f $FPATH/natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz" && return
|
||||
cd ./build_dir/target-*/natalie-dect-$natalieversion/
|
||||
mkdir natalie-dect-open-$natalieversion
|
||||
cp -f ipkg-*/natalie-dect/lib/modules/*/extra/dect.ko natalie-dect-open-$natalieversion/dect.ko
|
||||
tar -czv natalie-dect-open-$natalieversion/ -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
|
||||
scp -pv natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $SERVER:$FPATH/
|
||||
cp natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz $curdir/
|
||||
rm -rf natalie-dect-open-$natalieversion
|
||||
rm -f natalie-dect-$profile-$natalieversion-$nataliecommith.tar.gz
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_endptmngr_consumer() {
|
||||
# create endptmngr open version tar file
|
||||
local endptversion endptcommith
|
||||
@@ -70,46 +51,6 @@ build_endptmngr_consumer() {
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_mediatek_kernel() {
|
||||
local mediatek_commit kernel
|
||||
|
||||
mediatek_commit=$(grep CONFIG_KERNEL_GIT_COMMIT .config | cut -d '=' -f2 | tr -d '"')
|
||||
kernel=linux-git*
|
||||
[ -n "$mediatek_commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/mediatek-kernel-open-$mediatek_commit.tar.gz" && return
|
||||
echo "Building mediatek kernel tarball from kernel commit:"
|
||||
echo $mediatek_commit
|
||||
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/linux-git*
|
||||
|
||||
# remove git repo
|
||||
rm -rf .git
|
||||
cd ..
|
||||
|
||||
tar -czv $kernel -f mediatek-kernel-open-$mediatek_commit.tar.gz
|
||||
scp -pv mediatek-kernel-open-$mediatek_commit.tar.gz $SERVER:$FPATH/
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
build_mediatek_wifi_consumer() {
|
||||
local ver commit
|
||||
local chip=$1
|
||||
|
||||
ver=$(grep -w "PKG_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
|
||||
commit=$(grep -w "PKG_SOURCE_VERSION:" ./feeds/mediatek/mt${chip}/Makefile | cut -d'=' -f2)
|
||||
[ -n "$ver" ] && [ -n "$commit" ] || return
|
||||
ssh $SERVER "test -f $FPATH/mtk${chip}e-${ver}_${commit}.tar.xz" && return
|
||||
cd build_dir/target-mipsel_1004kc*/linux-iopsys-ramips*/mtk${chip}e-$ver/ipkg-*
|
||||
mkdir -p mtk${chip}e-$ver/src
|
||||
cp -rf kmod-mtk${chip}e/etc mtk${chip}e-$ver/src/
|
||||
cp -rf kmod-mtk${chip}e/lib mtk${chip}e-$ver/src/
|
||||
tar Jcf mtk${chip}e-${ver}_${commit}.tar.xz mtk${chip}e-$ver
|
||||
scp -pv mtk${chip}e-${ver}_${commit}.tar.xz $SERVER:$FPATH/
|
||||
cp mtk${chip}e-${ver}_${commit}.tar.xz $curdir/
|
||||
rm -rf mtk${chip}e-$ver
|
||||
rm -f mtk${chip}e-${ver}_${commit}.tar.xz
|
||||
cd "$curdir"
|
||||
}
|
||||
|
||||
function print_usage {
|
||||
echo "Usage: $0 generate_tarballs"
|
||||
echo " -t <target>"
|
||||
@@ -154,12 +95,7 @@ function generate_tarballs {
|
||||
|
||||
if [ "$stk_target" == "broadcom" ]; then
|
||||
build_bcmkernel_consumer
|
||||
build_natalie_consumer
|
||||
build_endptmngr_consumer
|
||||
elif [ "$stk_target" == "mediatek" ]; then
|
||||
build_mediatek_kernel
|
||||
build_mediatek_wifi_consumer 7603
|
||||
build_mediatek_wifi_consumer 7615
|
||||
else
|
||||
echo "Invalid target: $stk_target"
|
||||
print_usage
|
||||
|
||||
@@ -1,12 +1,29 @@
|
||||
# this is a developer helper script to install the public ssh key in the created image
|
||||
|
||||
DROPBEAR_AUTHORIZED_KEYS_FILE=/etc/dropbear/authorized_keys
|
||||
|
||||
function get_ssh_public_keys {
|
||||
(
|
||||
shopt -s nullglob
|
||||
# home directory, not all of those are supported by dropbear,
|
||||
# but let's include them now already to decrease future maintenance
|
||||
cat /dev/null ~/.ssh/{id_rsa,id_dsa,id_ecdsa,id_ecdsa_sk,id_ed25519,id_ed25519_sk,id_xmss}.pub 2> /dev/null
|
||||
# keys added manually or automatically to the build dir
|
||||
cat "files${DROPBEAR_AUTHORIZED_KEYS_FILE}" 2>/dev/null
|
||||
# keys in the agent (useful when using SSH agent forwarding)
|
||||
ssh-add -L 2> /dev/null
|
||||
) | sort | uniq
|
||||
}
|
||||
|
||||
function install_key {
|
||||
|
||||
mkdir -p files/etc/dropbear
|
||||
test -e ~/.ssh/id_dsa.pub && cat ~/.ssh/id_dsa.pub >>files/etc/dropbear/authorized_keys
|
||||
test -e ~/.ssh/id_rsa.pub && cat ~/.ssh/id_rsa.pub >>files/etc/dropbear/authorized_keys
|
||||
chmod 0644 files/etc/dropbear/authorized_keys
|
||||
|
||||
local build_dir_dropbear_authorized_keys_file="files${DROPBEAR_AUTHORIZED_KEYS_FILE}"
|
||||
mkdir -p "$(dirname "$build_dir_dropbear_authorized_keys_file")"
|
||||
get_ssh_public_keys > "$build_dir_dropbear_authorized_keys_file"
|
||||
chmod 0644 "$build_dir_dropbear_authorized_keys_file"
|
||||
echo "Keys in "$build_dir_dropbear_authorized_keys_file" are now:"
|
||||
cat "$build_dir_dropbear_authorized_keys_file"
|
||||
echo
|
||||
echo "Disabling login on serial console..."
|
||||
echo "::sysinit:/etc/init.d/rcS S boot" >files/etc/inittab
|
||||
echo "::shutdown:/etc/init.d/rcS K shutdown" >>files/etc/inittab
|
||||
echo "console::askconsolelate:/bin/cttyhack /bin/ash --login" >>files/etc/inittab
|
||||
@@ -14,4 +31,25 @@ function install_key {
|
||||
echo Done
|
||||
}
|
||||
|
||||
function ssh_install_key_help() {
|
||||
echo Usage: $0 ssh_install_key HOSTNAME
|
||||
echo
|
||||
echo "Installs SSH public keys to a device's authorized_keys file"
|
||||
}
|
||||
|
||||
|
||||
# this is a developer helper script to install the public ssh key on host running dropbear
|
||||
function ssh_install_key {
|
||||
if [ $# -ne 1 ] || [ "$1" == '--help' ]; then
|
||||
ssh_install_key_help
|
||||
[ $# -eq 1 ]; return
|
||||
fi
|
||||
host="$1"
|
||||
local keys="$(get_ssh_public_keys)"
|
||||
echo "Adding the following keys to $DROPBEAR_AUTHORIZED_KEYS_FILE on $host:"
|
||||
echo "$keys"
|
||||
ssh root@$host "echo '$keys' >> '$DROPBEAR_AUTHORIZED_KEYS_FILE'" && echo ok
|
||||
}
|
||||
|
||||
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"
|
||||
register_command "install_key" "Install the user's public ssh key in the created image"
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# this is a developer helper script to install the public ssh key on host running dropbear
|
||||
|
||||
function ssh_install_key {
|
||||
if [ -e ~/.ssh/id_rsa.pub ]; then
|
||||
echo "Adding public RSA key to $1"
|
||||
KEY=`cat ~/.ssh/id_rsa.pub`
|
||||
elif [ -e ~/.ssh/id_dsa.pub ]; then
|
||||
echo "Adding public DSA key to $1"
|
||||
KEY=`cat ~/.ssh/id_dsa.pub`
|
||||
else
|
||||
echo "No public key found"
|
||||
exit 1
|
||||
fi
|
||||
ssh root@$1 "echo '$KEY' >> /etc/dropbear/authorized_keys" && echo ok
|
||||
}
|
||||
|
||||
register_command "ssh_install_key" "Install the users public ssh key on host running dropbear"
|
||||
@@ -26,14 +26,8 @@ function taas-init() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# NAND erase block size.
|
||||
nandBlkSz=$(grep CONFIG_TARGET_NAND_BLOCKSZ .config | \
|
||||
tr -s "=\"" " " | cut -d " " -f 2)
|
||||
nandBlkSz=$((nandBlkSz / 1024))
|
||||
|
||||
# Create a list of all images which might be of use.
|
||||
for f in ${PWD}/bin/targets/iopsys-*/generic/last.* \
|
||||
${PWD}/build_dir/target-arm*/bcmkernel/bcm963xx/targets/9*/bcm*_linux_raw_image_${nandBlkSz}.bin; do
|
||||
for f in ${PWD}/bin/targets/iopsys-*/generic/last.*; do
|
||||
[[ -s "$f" ]] && images+=("$f")
|
||||
done
|
||||
|
||||
|
||||
@@ -492,7 +492,8 @@ check_feeds()
|
||||
echo "Now checking if any changes have been done to the feeds."
|
||||
echo -e "${Green}_______________________________________________________________________________${Color_Off}"
|
||||
|
||||
feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
feeds="$1"
|
||||
[ -n "$feeds" ] || feeds=$(grep -v "^#" feeds.conf| awk '{print $2}')
|
||||
for feed in `echo $feeds`
|
||||
do
|
||||
feed_hash=$(feeds_hash $feed)
|
||||
@@ -552,7 +553,7 @@ check_feeds()
|
||||
done
|
||||
}
|
||||
|
||||
feeds_at_top()
|
||||
is_local_and_remote_same()
|
||||
{
|
||||
git remote update 2>/dev/null 1>/dev/null
|
||||
LOCAL=$(git rev-parse @)
|
||||
@@ -581,7 +582,7 @@ feeds_at_top()
|
||||
usage(){
|
||||
echo -e "$0 [flags]"
|
||||
echo -e "flags:"
|
||||
echo -e " -v\tVerbose mode"
|
||||
echo -e " -f\tFeed to update"
|
||||
echo -e " -h\tShow this help"
|
||||
echo -e " -u\tUpdate package version\n"
|
||||
}
|
||||
@@ -589,7 +590,7 @@ usage(){
|
||||
# Exported interface
|
||||
function update_package {
|
||||
|
||||
UPDATE=0
|
||||
UPDATE=0
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
|
||||
@@ -603,18 +604,18 @@ function update_package {
|
||||
Cyan='\033[0;36m' # Cyan
|
||||
White='\033[0;37m' # White
|
||||
|
||||
while getopts "v:hu" opt; do
|
||||
while getopts "f:hu" opt; do
|
||||
case $opt in
|
||||
v)
|
||||
verbose=$OPTARG
|
||||
f)
|
||||
feed=$OPTARG
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
u)
|
||||
UPDATE=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
@@ -637,9 +638,9 @@ function update_package {
|
||||
set -E
|
||||
trap '[ "$?" -ne 99 ] || exit 99' ERR
|
||||
|
||||
feeds_at_top
|
||||
check_packages
|
||||
check_feeds
|
||||
is_local_and_remote_same
|
||||
[ -n "$feed" ] || check_packages
|
||||
check_feeds $feed
|
||||
}
|
||||
|
||||
register_command "update_package" "Publish changes to packages and feeds"
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 iopsys
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=iopupgrade
|
||||
PKG_VERSION:=1.0.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_VERSION:=01f2afd6c831d6f9eb2940c7e7af16f7e4d439c2
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/iopupgrade
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
# support parallel build
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
#re create configure scripts if not present.
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
|
||||
# this way we don't need to pick out the resulting files from the build dir.
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/iopupgrade
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Iopsys system upgrade utility
|
||||
URL:=
|
||||
# DEPENDS:=
|
||||
endef
|
||||
|
||||
define Package/iopupgrade/description
|
||||
Application handling peripheral
|
||||
endef
|
||||
|
||||
define Package/iopupgrade/install
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/etc/
|
||||
$(INSTALL_DIR) $(1)/etc/init.d/
|
||||
$(INSTALL_DIR) $(1)/sbin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iopupgrade $(1)/sbin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,iopupgrade))
|
||||
|
||||
@@ -1,329 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
###############################################################################
|
||||
# Global variables. can be used directly in any function called.
|
||||
cur_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
# eg: rootfs_0 or rootfs_1, currently used
|
||||
upd_vol="" # num,[0/1] Number used for ubifs root filesystem volume name.
|
||||
# eg: rootfs_0 or rootfs_1, the one we want to update
|
||||
cmdline="" # command line settings.
|
||||
cmdline_match="" # Headers to match to the image
|
||||
|
||||
###############################################################################
|
||||
# file local variables. should not be used in imported functions. Can be used
|
||||
# by functions declared in this script
|
||||
chroot_cmdline="" # command line for the iop_chroot command.
|
||||
board="" # string, Board name that is going to be matched
|
||||
# against header of firmware image
|
||||
upd_ubi_id="" # num, UBI volume number for the volume name
|
||||
# "rootfs_$upd_vol", use to know what volume to run
|
||||
# ubiupdatevol on.
|
||||
run_cleanup=0 # if set the cleanup should be run otherwise we skip it.
|
||||
run_mount_cleanup=0 # set if we should run umount in cleanup
|
||||
upd_kernel=0 # set to 1 if system has the kernel in own mtd partition
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
upd_noreboot=0 # set to 1 if we should not reboot after programming
|
||||
upd_forceimage=0 # set this to force upgrade even if image is for wrong board.
|
||||
upd_forceboot=0 # set this to force upgrade of boot loader
|
||||
upd_keepconfig=0 # set this to keep the current configuration.
|
||||
###############################################################################
|
||||
# import external functions
|
||||
source /lib/upgrade/iopsys.sh
|
||||
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||
|
||||
# only call function if it exists
|
||||
function_call() {
|
||||
if type "$1" 2>/dev/null >/dev/null
|
||||
then
|
||||
$1 $@
|
||||
fi
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Cleanup and error handling functions.
|
||||
function log {
|
||||
TIME=$(date)
|
||||
[ $log_stdout -eq 1 ] && echo "$@"
|
||||
echo "[$TIME] $@" >>/tmp/upd_log
|
||||
}
|
||||
|
||||
# we need to handle ctrl-c, segmentation fault, sigpipe and other abnormal
|
||||
# terminations. no printing to stdout/stderr allowed in this function or
|
||||
# anyhting it calls as stdout/stderr might no longer exist
|
||||
function finish {
|
||||
|
||||
if [ $run_cleanup -eq 1 ]
|
||||
then
|
||||
|
||||
function_call upd_cleanup
|
||||
run_cleanup=0
|
||||
log ""
|
||||
fi
|
||||
|
||||
if [ $run_mount_cleanup -eq 1 ]
|
||||
then
|
||||
log "Cleaning up after mount"
|
||||
umount_newroot
|
||||
fi
|
||||
# always kill the timeout process, will leave the sleep but that is harmless
|
||||
# as long as the kill will nerver be run.
|
||||
if [ -n "$TIMEOUT_PID" ]; then
|
||||
kill $TIMEOUT_PID 2>/dev/null
|
||||
TIMEOUT_PID=""
|
||||
fi
|
||||
|
||||
lock -u /tmp/iopu.lock
|
||||
}
|
||||
|
||||
function ctrl_c {
|
||||
|
||||
# on ctrl-c we remove the exit handler as it is called directly.
|
||||
trap - EXIT
|
||||
|
||||
# call cleanup function
|
||||
finish
|
||||
|
||||
# do not continue program
|
||||
exit 1
|
||||
}
|
||||
|
||||
function sig_pipe {
|
||||
log_stdout=0 # stdin,stdout,stderr do not exist anymore
|
||||
log "Got sigpipe. Turning of log printing to stdout"
|
||||
}
|
||||
|
||||
# if a timout happens terminate
|
||||
function timeout {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Not much that can be done if the mount fails but to try again.
|
||||
# if after 10 seconds there still is errors abort program.
|
||||
# UBIFS has some wierd time intervall after ubiupdatevol where
|
||||
# a mount of the newly written data results in a busy error.
|
||||
function mount_retry {
|
||||
local tries=0
|
||||
|
||||
while [ $tries -lt 10 ]
|
||||
do
|
||||
if mount $@ 2>/dev/null
|
||||
then
|
||||
return
|
||||
fi
|
||||
tries=$((tries + 1))
|
||||
sleep 1
|
||||
done
|
||||
|
||||
log "mount failed for command [mount $@] so upgrade failed."
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
function mount_newroot {
|
||||
run_mount_cleanup=1
|
||||
mkdir -p /tmp/newroot
|
||||
mkdir -p /tmp/newroot_overlay
|
||||
|
||||
mount_retry -t ubifs ubi0:rootfs_$upd_vol /tmp/newroot
|
||||
|
||||
mount_retry -o noatime,lowerdir=/tmp/newroot,upperdir=/tmp/newroot/overlay,workdir=/tmp/newroot/lib/overlay.tmp -t overlay "overlayfs:/tmp/newroot/overlay" /tmp/newroot_overlay
|
||||
mount_retry --bind /tmp/newroot/ /tmp/newroot_overlay/rom
|
||||
|
||||
mount_retry --bind /dev /tmp/newroot_overlay/dev
|
||||
mount_retry --bind /proc /tmp/newroot_overlay/proc
|
||||
mount_retry --bind /sys /tmp/newroot_overlay/sys
|
||||
mount_retry -t tmpfs -o noatime,mode=0755 root /tmp/newroot_overlay/tmp
|
||||
|
||||
mkdir -p /tmp/newroot_overlay/tmp/oldroot
|
||||
mount_retry --bind / /tmp/newroot_overlay/tmp/oldroot
|
||||
mount_retry --bind /tmp /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||
}
|
||||
|
||||
function umount_newroot {
|
||||
umount /tmp/newroot_overlay/tmp/oldroot/tmp
|
||||
umount /tmp/newroot_overlay/tmp/oldroot
|
||||
umount /tmp/newroot_overlay/tmp
|
||||
umount /tmp/newroot_overlay/sys
|
||||
umount /tmp/newroot_overlay/proc
|
||||
umount /tmp/newroot_overlay/dev
|
||||
umount /tmp/newroot_overlay/rom
|
||||
umount /tmp/newroot_overlay
|
||||
umount /tmp/newroot
|
||||
rmdir /tmp/newroot_overlay /tmp/newroot
|
||||
run_mount_cleanup=0
|
||||
}
|
||||
|
||||
function usage {
|
||||
echo "usage: $0 iopu [opts] "
|
||||
echo ""
|
||||
echo "opts:"
|
||||
echo ""
|
||||
echo " -n Do not do the final reboot of the target board"
|
||||
echo " -c Keep configuration"
|
||||
echo " -x Force install even if firmware is not for this board"
|
||||
echo " -b Force install of bootloader regardless of version installed"
|
||||
echo " -r Jump into chroot env of other system"
|
||||
echo " -f Firmware file to use"
|
||||
echo " -C \"command\" Execute command in chroot env of other system"
|
||||
}
|
||||
|
||||
# Execute command in newroot(other system root)
|
||||
function newroot_exec {
|
||||
|
||||
upd_vol=$(get_flashbank_next)
|
||||
mount_newroot
|
||||
(ENV=/sbin/iopu_chroot_env chroot /tmp/newroot_overlay "$@")
|
||||
echo ""
|
||||
umount_newroot
|
||||
|
||||
}
|
||||
|
||||
function system_is_y_image {
|
||||
|
||||
# find out what rootfs volume is active.
|
||||
cur_vol=$(get_flashbank_current)
|
||||
upd_vol=$(get_flashbank_next)
|
||||
|
||||
# convert volume name "rootfs_$upd_vol" into ubi volume id
|
||||
upd_ubi_id=$(ubinfo -d 0 -N rootfs_$upd_vol | awk "/Volume ID:/ {print \$3}")
|
||||
log "installing Root Fileystem into UBI volume rootfs_$upd_vol"
|
||||
|
||||
# prepare to match dsl.
|
||||
function_call upd_conf_dsl
|
||||
|
||||
log "now starting writing data to flash with [ iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id ]"
|
||||
run_cleanup=1 # When we start to actually write data there might be some
|
||||
# things that need cleanup if we get an error/crash
|
||||
if ! iopupgrade $cmdline -M "$cmdline_match" -u ubi0_$upd_ubi_id; then
|
||||
log "iopupgrade program Failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "Firmware programmed to flash."
|
||||
|
||||
# Force upgrade of boot loader
|
||||
[ $upd_forceboot -eq 1 ] && chroot_cmdline="$chroot_cmdline -b"
|
||||
|
||||
if [ $upd_keepconfig -eq 1 ]; then
|
||||
log "Transfering configuration to new system."
|
||||
chroot_cmdline="$chroot_cmdline -c"
|
||||
fi
|
||||
|
||||
mount_newroot
|
||||
if ! chroot /tmp/newroot_overlay /sbin/iopu_chroot $chroot_cmdline; then
|
||||
log "Configuration migration failed!"
|
||||
exit 1
|
||||
fi
|
||||
umount_newroot
|
||||
|
||||
log "New firmware fully installed."
|
||||
run_cleanup=0
|
||||
|
||||
|
||||
# Now make sure that we actually boot the new system on the next reboot
|
||||
upd_finnish
|
||||
|
||||
}
|
||||
|
||||
function system_is_FIT_image {
|
||||
|
||||
# prepare to match dsl.
|
||||
#function_call upd_conf_dsl
|
||||
|
||||
#here we write data
|
||||
bcm_flasher $firmware_file
|
||||
bcm_bootstate 1
|
||||
log "Firmware programmed to flash."
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
||||
# just one instance
|
||||
# this check has to be done before we install handler to avoid removing the
|
||||
# lock even if it was not available.
|
||||
if ! lock -n /tmp/iopu.lock
|
||||
then
|
||||
echo "Another instance of iopu already running"
|
||||
echo "If you are sure this is wrong remove file /tmp/iopu.lock"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap finish EXIT
|
||||
trap ctrl_c INT
|
||||
trap timeout SIGALRM
|
||||
trap sig_pipe SIGPIPE
|
||||
|
||||
while getopts "nrxbhcC:f:" opt; do
|
||||
case $opt in
|
||||
n)
|
||||
upd_noreboot=1
|
||||
;;
|
||||
x)
|
||||
upd_forceimage=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
c)
|
||||
upd_keepconfig=1
|
||||
;;
|
||||
r)
|
||||
newroot_exec /bin/sh
|
||||
exit
|
||||
;;
|
||||
C)
|
||||
newroot_exec "${OPTARG}"
|
||||
exit
|
||||
;;
|
||||
f)
|
||||
firmware_file="${OPTARG}"
|
||||
;;
|
||||
h)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# put a timeout on this if it takes longer than 120 seconds we should abort
|
||||
# and clean up
|
||||
(
|
||||
sleep 120 && kill -ALRM $$ 2>/dev/null # send it a SIGALRM signal
|
||||
)&
|
||||
TIMEOUT_PID=$!
|
||||
|
||||
log "Firmware upgrade started"
|
||||
|
||||
# Should board name be checked
|
||||
if [ $upd_forceimage -eq 0 ]
|
||||
then
|
||||
board=$(db get hw.board.model_name)
|
||||
cmdline_match="board=$board"
|
||||
fi
|
||||
|
||||
# BUG: should probably read a config file.
|
||||
if [ -f /proc/nvram/boardid ]
|
||||
then
|
||||
system_is_FIT_image
|
||||
else
|
||||
system_is_y_image
|
||||
fi
|
||||
|
||||
# spawn the reboot to a subshell to allow the main program to quit before reset
|
||||
# to avoid any hanged network connection like ssh
|
||||
if [ $upd_noreboot -eq 0 ]
|
||||
then
|
||||
(
|
||||
log_stdout=0 # stdin,stdout,stderr do not exist anymore, we are in a
|
||||
# subshell and then the trap is no longer working.
|
||||
sleep 1
|
||||
log "Rebooting NOW!!!"
|
||||
log ""
|
||||
reboot
|
||||
)&
|
||||
log "Reboot initiated"
|
||||
else
|
||||
log "Skipping reboot"
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This program is intended to be run in a chroot environment where the old system
|
||||
# is mounted in /tmp/oldroot
|
||||
#
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Global variables. can be used directly in any function called.
|
||||
|
||||
|
||||
###############################################################################
|
||||
# file local variables. should not be used in imported functions. Can be used
|
||||
# by functions declared in this script
|
||||
upd_forceboot=0
|
||||
log_stdout=1 # set to 0 to prevent the log to also print to stdout
|
||||
upd_keepconfig=0 # set this to keep the current configuration.
|
||||
|
||||
###############################################################################
|
||||
# import external functions
|
||||
|
||||
source /lib/upgrade/iopsys.sh
|
||||
[ -f /lib/upgrade/iopupgrade ] && source /lib/upgrade/iopupgrade
|
||||
|
||||
|
||||
# only call function if it exists
|
||||
function_call() {
|
||||
if [ -n "$1" ] && type "$1" 2>/dev/null >/dev/null
|
||||
then
|
||||
$1 "$@" || exit
|
||||
fi
|
||||
}
|
||||
# Cleanup and error handling functions.
|
||||
function log {
|
||||
TIME=$(date)
|
||||
[ $log_stdout -eq 1 ] && echo "$@"
|
||||
echo "[$TIME] $@" >>/root/upd_log
|
||||
}
|
||||
|
||||
|
||||
while getopts "hbc" opt; do
|
||||
case $opt in
|
||||
h)
|
||||
upd_usage
|
||||
exit 1
|
||||
;;
|
||||
c)
|
||||
upd_keepconfig=1
|
||||
;;
|
||||
b)
|
||||
upd_forceboot=1
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# copy old install log over
|
||||
cp /tmp/oldroot/tmp/upd_log /root/upd_log
|
||||
|
||||
# Upgrade boot loader if needed.
|
||||
function_call upd_program_boot
|
||||
|
||||
# Let the new upgrade do whatever it needs,
|
||||
# such as configuration migration etc.
|
||||
if [ $upd_keepconfig -eq 1 -a -x /lib/upgrade/post-rootfs-fixup ]; then
|
||||
(/lib/upgrade/post-rootfs-fixup /dev/null /tmp/oldroot) || exit
|
||||
fi
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
# this is run when "iopr -r" is executed.
|
||||
# intended to just show what environment is actually started.
|
||||
|
||||
cat /etc/banner
|
||||
|
||||
echo "/tmp/oldroot:"
|
||||
echo " Contains the running root filesystem. It is live so files are in use"
|
||||
echo " Anything copying/reading files from there needs to make sure it is done safely."
|
||||
echo ""
|
||||
|
||||
Color_Off='\033[0m' # Text Reset
|
||||
Red='\033[0;31m' # Red
|
||||
|
||||
PS1="${Red}chroot_new${Color_Off}:\w\#"
|
||||
export PS1
|
||||
export Red
|
||||
export Color_Off
|
||||
@@ -10,6 +10,7 @@ PKG_RELEASE:=1.0.0
|
||||
PKG_SOURCE_VERSION:=44b32937a062ec4ffc9f7355841dc94ab6efa50f
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/json-editor.git
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
@@ -16,6 +16,7 @@ PKG_SOURCE_URL:=https://dev.iopsys.eu/mirror/microxml.git
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=72965423184f24cc0b963d91c2d1863cdb01b6aa
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_LICENSE:=LGPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ PKG_LICENSE:=LGPL-2.1-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ PKG_SOURCE_VERSION:=e4b4c5cce35a52da152776a00532aa0b80879c5b
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=GPLv2
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
@@ -14,6 +14,7 @@ PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/loop-detector
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2019 Iopsys
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-1905
|
||||
PKG_VERSION:=0.0.14
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=745a773b15f35275df63a20e1be342d24b7e7534
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-1905.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/map-1905
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:= MultiAP Stack
|
||||
DEPENDS:= +ubox +ieee1905
|
||||
endef
|
||||
|
||||
define Package/map-1905/description
|
||||
MultiAP plugin for ieee1905d based on Wifi alliance's MAP-r2 specification
|
||||
endef
|
||||
|
||||
define Package/libmaputils
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WFA MultiAP utility library
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-D_GNU_SOURCE \
|
||||
-fstrict-aliasing \
|
||||
-Wall \
|
||||
-Wextra
|
||||
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
$(CP) -rf ~/git/map-1905/* $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
define Package/map-1905/install
|
||||
$(INSTALL_DIR) $(1)/usr/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/ieee1905
|
||||
$(CP) $(PKG_BUILD_DIR)/libwifimap2.so $(1)/usr/lib/ieee1905/
|
||||
endef
|
||||
|
||||
define Package/libmaputils/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/libmaputils.so
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include
|
||||
$(INSTALL_DIR) $(1)/usr/include/map1905
|
||||
$(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/map1905/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/libmaputils.so $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libmaputils))
|
||||
$(eval $(call BuildPackage,map-1905))
|
||||
@@ -1,21 +1,25 @@
|
||||
#
|
||||
# Copyright (C) 2020 IOPSYS Software Solutions AB
|
||||
# Copyright (C) 2020-21 IOPSYS Software Solutions AB
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-agent
|
||||
PKG_VERSION:=2.0.3
|
||||
PKG_VERSION:=6.6.2
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=6bb0bba83e4c5189c93ed339ed061b86d7766f4d
|
||||
PKG_SOURCE_VERSION:=ca0a34926e155338964ff55f8c9e28a80b38bc78
|
||||
PKG_MAINTAINER:=Anjan Chanda <anjan.chanda@iopsys.eu>
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-agent.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-agent
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -23,13 +27,28 @@ define Package/map-agent
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi multi-AP Agent (EasyMesh R2)
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libmaputils
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin
|
||||
endef
|
||||
|
||||
|
||||
define Package/dynbhd
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Dynamic Backhaul Daemon
|
||||
DEPENDS:=+libwifi +libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 \
|
||||
+map-plugin +map-agent
|
||||
endef
|
||||
|
||||
|
||||
define Package/map-agent/description
|
||||
This package implements EasyMesh R2 compliant WiFi Agent.
|
||||
endef
|
||||
|
||||
define Package/dynbhd/description
|
||||
Dyanmic LAN/WAN port detection and loop avoidance.
|
||||
endef
|
||||
|
||||
define Package/map-agent/config
|
||||
#source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
@@ -41,20 +60,29 @@ TARGET_CFLAGS += \
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/map-agent
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/src/include/*.h $(1)/usr/include/map-agent
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/timer_impl.h $(1)/usr/include/map-agent
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/*.so* $(1)/usr/lib/
|
||||
endef
|
||||
|
||||
define Package/map-agent/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/src/utils/*.so* $(1)/usr/lib/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapagent $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
define Package/dynbhd/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_DIR) $(1)/lib/wifi/dynbhd
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/ethernet
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/dynbhd $(1)/usr/sbin/dynbhd
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/api $(1)/lib/wifi/dynbhd/api
|
||||
# $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dynbh/map-dynamic-backhaul $(1)/etc/hotplug.d/ethernet/map-dynamic-backhaul
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/map-agent/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,map-agent))
|
||||
$(eval $(call BuildPackage,dynbhd))
|
||||
|
||||
34
map-agent/files/etc/config/mapagent
Normal file
34
map-agent/files/etc/config/mapagent
Normal file
@@ -0,0 +1,34 @@
|
||||
config agent 'agent'
|
||||
option enabled '1'
|
||||
option debug '6'
|
||||
option profile '2'
|
||||
option al_bridge 'br-lan'
|
||||
|
||||
#config ap
|
||||
# option ifname 'wl0'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# list assoc_ctrl '00:10:20:30:40:50'
|
||||
# option btm_retry '3'
|
||||
# option btm_retry_secs '180'
|
||||
# option fallback_legacy '1'
|
||||
# option steer_legacy_reassoc_secs '30'
|
||||
# option steer_legacy_retry_secs '3600'
|
||||
# option assoc_ctrl_secs '30'
|
||||
# option band '2'
|
||||
# option type 'fronthaul'
|
||||
|
||||
#config ap
|
||||
# option ifname 'wl1'
|
||||
# option steer 'rssi bssload'
|
||||
# list exclude '00:11:22:33:44:55'
|
||||
# list exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
# option band '5'
|
||||
# option type 'fronthaul'
|
||||
|
||||
#config bsta
|
||||
# option ifname 'apclii0'
|
||||
# option enabled '1'
|
||||
# option onboarded '0'
|
||||
# option disallow_bsta '1 # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
49
map-agent/files/etc/hotplug.d/ethernet/map-dynamic-backhaul
Executable file
49
map-agent/files/etc/hotplug.d/ethernet/map-dynamic-backhaul
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
wan=$(db -q get hw.board.ethernetWanPort)
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
|
||||
|
||||
[ -z "$wan" ] && exit 1 # no configuration
|
||||
[ "$PORT" != "$wan" ] && exit 0
|
||||
|
||||
remove_from_bridge() {
|
||||
config_get ifname "$section" ifname
|
||||
|
||||
ubus call network.interface.$bridge remove_device '{"name":"$ifname"}'
|
||||
}
|
||||
|
||||
update_bstas() {
|
||||
local section="$1"
|
||||
local action="$2"
|
||||
local ifname onboarded
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get_bool enabled "$section" enabled 0
|
||||
|
||||
if [ "$action" = "down" ]; then
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
# wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
elif [ "$action" = "up" ]; then
|
||||
[ "$enabled" -eq 0 ] && return
|
||||
wpa_cli -i "$ifname" reconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" enable_network 0 > /dev/null 2>&1
|
||||
# wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$LINK" = "up" ]; then
|
||||
#touch "$MAPFILE"
|
||||
|
||||
config_load "mapagent"
|
||||
bridge=$(uci get mapagent.agent.al_bridge | cut -d '-' -f2)
|
||||
config_foreach remove_from_bridge bsta $bridge
|
||||
config_foreach update_bstas bsta down
|
||||
|
||||
/lib/wifi/multiap set_uplink "eth" "$PORT"
|
||||
else
|
||||
rm -f "$MAPFILE"
|
||||
config_load "mapagent"
|
||||
config_foreach update_bstas bsta up
|
||||
fi
|
||||
46
map-agent/files/etc/hotplug.d/ethernet/map-topology-discovery
Executable file
46
map-agent/files/etc/hotplug.d/ethernet/map-topology-discovery
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
[ "$LINK" == "up" ] || exit 0
|
||||
[ "$PORT" == "" ] && exit 1
|
||||
|
||||
ubus list ieee1905 > /dev/null 2>&1
|
||||
|
||||
rc="$?"
|
||||
|
||||
[ "$rc" != 0 ] && exit 1
|
||||
|
||||
issue_discovery() {
|
||||
local iface="$1"
|
||||
|
||||
res=$(ubus -t5 call ieee1905 buildcmdu "{\"type\":0, \"ifname\":\"${iface}\"}")
|
||||
json_load "$res" > /dev/null 2>&1
|
||||
json_get_var data data
|
||||
|
||||
[ "$data" == "" ] && return
|
||||
|
||||
ubus call ieee1905 cmdu "{\"dst\":\"01:80:c2:00:00:13\", \"type\":0, \"data\":\"${data}\"}"
|
||||
}
|
||||
|
||||
process_vlans() {
|
||||
section="$1"
|
||||
|
||||
config_get ifname "$section" ifname
|
||||
config_get name "$section" name
|
||||
|
||||
[ "$2" == "$ifname" ] || return
|
||||
[ "$name" == "" ] && return
|
||||
|
||||
issue_discovery $name
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
# find and publish over any vlans
|
||||
config_load network
|
||||
config_foreach process_vlans interface $PORT
|
||||
config_foreach process_vlans device $PORT
|
||||
|
||||
issue_discovery $PORT
|
||||
96
map-agent/files/etc/init.d/mapagent
Executable file
96
map-agent/files/etc/init.d/mapagent
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
MAP_DEV="map_dev"
|
||||
MAP_IF="map"
|
||||
MAP_VETH="lei"
|
||||
|
||||
create_map() {
|
||||
uci -q set network.${MAP_DEV}=device
|
||||
uci -q set network.${MAP_DEV}.name=br-map
|
||||
uci -q set network.${MAP_DEV}.type=bridge
|
||||
uci -q set network.${MAP_DEV}.bridge_empty=1
|
||||
|
||||
uci -q set network.${MAP_IF}=interface
|
||||
uci -q set network.${MAP_IF}.device=br-map
|
||||
uci -q set network.${MAP_IF}.is_lan=1
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-map
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.device
|
||||
|
||||
ip link add ${MAP_VETH} type veth peer name ${MAP_VETH}_lan 2>/dev/null
|
||||
brctl addif br-map ${MAP_VETH} 2>/dev/null
|
||||
brctl addif br-lan ${MAP_VETH}_lan 2>/dev/null
|
||||
ip link set ${MAP_VETH} up 2>/dev/null
|
||||
ip link set ${MAP_VETH}_lan up 2>/dev/null
|
||||
}
|
||||
|
||||
remove_map() {
|
||||
ip link delete ${MAP_VETH} &>/dev/null
|
||||
|
||||
uci -q delete network.${MAP_DEV}
|
||||
uci -q delete network.${MAP_IF}
|
||||
|
||||
uci -q set mapagent.agent.al_bridge=br-lan
|
||||
|
||||
uci -q commit
|
||||
|
||||
ubus call network reload
|
||||
}
|
||||
|
||||
start_dynbhd_service() {
|
||||
rm -f /tmp/map.agent.bsta_global_disable
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/dynbhd"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service() {
|
||||
[ -f /usr/sbin/dynbhd ] && start_dynbhd_service
|
||||
|
||||
config_load "mapagent"
|
||||
|
||||
ubus -t 5 wait_for wifi
|
||||
|
||||
sleep 2
|
||||
|
||||
local enabled
|
||||
config_get_bool enabled agent enabled 1
|
||||
[ "$enabled" -eq 0 ] && return 1
|
||||
|
||||
local ts
|
||||
config_get_bool ts agent vlan_segregation 0
|
||||
[ "$ts" -eq 1 ] && create_map #|| remove_map
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/mapagent" "-d"
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
#stop_service() {
|
||||
# remove_map
|
||||
#}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "mapagent"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
764
map-agent/files/lib/wifi/multiap
Executable file
764
map-agent/files/lib/wifi/multiap
Executable file
@@ -0,0 +1,764 @@
|
||||
#!/bin/sh
|
||||
|
||||
# functions
|
||||
# wireless_teardown - tear down ifaces based on mapagent config
|
||||
# setup_network - prepare /etc/config/network if necessary
|
||||
# setup_wireless - prepare /etc/config/wireless based on mapagent config
|
||||
# write_credentials - write bBSS credentials to fBSS
|
||||
|
||||
. /lib/functions.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
. /lib/wifi/traffic_separation
|
||||
|
||||
MAPFILE="/tmp/multiap.backhaul"
|
||||
|
||||
diff=0
|
||||
onbrd_bssid=0
|
||||
onbrd_band=0
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [wireless_teardown|setup_network|setup_wireless|write_credentials]
|
||||
Platform specific Multi-AP script to prepare network and wifi subsystem based on
|
||||
mapagent configuration.
|
||||
wireless_teardown - tear down ifaces in /etc/config/wireless
|
||||
setup_network - prepare /etc/config/network
|
||||
setup_wireless - prepare /etc/config/wireless
|
||||
write_credentials - write bBSS credentials to fBSS
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
type_to_multi_ap () {
|
||||
type="$1"
|
||||
|
||||
if [ "$type" = "backhaul" ]; then
|
||||
echo "1"
|
||||
return
|
||||
elif [ "$type" = "fronthaul" ]; then
|
||||
echo "2"
|
||||
return
|
||||
elif [ "$type" = "combined" ]; then
|
||||
echo "3"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "0"
|
||||
}
|
||||
|
||||
get_type_by_section() {
|
||||
section="$1"
|
||||
|
||||
config_get type $section type "0"
|
||||
|
||||
echo "$(type_to_multi_ap $type)"
|
||||
}
|
||||
|
||||
brcm_sync_credentials() {
|
||||
bands=""
|
||||
mapagent_process_fh() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
|
||||
[ "$dev" != "$device" ] && return
|
||||
|
||||
config_get band $section band
|
||||
config_get ssid $section ssid
|
||||
config_get encryption $section encryption
|
||||
config_get key $section key
|
||||
|
||||
section=$(uci add ieee1905 ap)
|
||||
[ "$section" == "" ] && return
|
||||
|
||||
uci -q set ieee1905.${section}.band=$band
|
||||
uci -q set ieee1905.${section}.ssid="$ssid"
|
||||
uci -q set ieee1905.${section}.encryption=$encryption
|
||||
uci -q set ieee1905.${section}.key="$key"
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
local section=$1
|
||||
|
||||
config_get device $section device
|
||||
config_get band $section band
|
||||
config_get dedicated_backhaul $section dedicated_backhaul 0
|
||||
|
||||
[ "$dedicated_backhaul" != "0" ] && return
|
||||
|
||||
for b in $bands; do
|
||||
if [ "$b" == "$band" ]; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
config_foreach mapagent_process_fh ap $device
|
||||
bands="$bands $band"
|
||||
}
|
||||
|
||||
ieee1905_del_ap() {
|
||||
local section=$1
|
||||
|
||||
uci -q delete ieee1905.${section}
|
||||
}
|
||||
|
||||
config_load ieee1905
|
||||
config_foreach ieee1905_del_ap ap
|
||||
|
||||
config_load mapagent
|
||||
config_foreach mapagent_process_radio radio
|
||||
|
||||
uci commit ieee1905
|
||||
}
|
||||
|
||||
|
||||
brcm_write_credentials() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wireless() {
|
||||
write_wireless() {
|
||||
local section=$1
|
||||
local map_ifname=$2
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
#echo found device=$device map=$multi_ap ifname=$ifname mapifname=$map_ifname
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_ssid="$bk_ssid"
|
||||
uci -q set wireless.${section}.multi_ap_backhaul_key="$bk_key"
|
||||
}
|
||||
config_load wireless
|
||||
|
||||
config_foreach write_wireless wifi-iface "$1" "$2" "$3"
|
||||
}
|
||||
|
||||
mapagent_find_fbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
local bk_ssid="$3"
|
||||
local bk_key="$4"
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
|
||||
[ "$device" != "$dev" ] && return
|
||||
[ "$multi_ap" != "2" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
#echo applying bk_ssid = "$bk_ssid" bk_key = "$bk_key"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
echo $(mapagent_apply_wireless $ifname "$bk_ssid" "$bk_key") 2> /dev/null
|
||||
}
|
||||
|
||||
mapagent_find_bbss() {
|
||||
local section=$1
|
||||
local dev=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get device $section device
|
||||
config_get enabled $section enabled "1"
|
||||
|
||||
#echo found dev=$dev device=$device map=$multi_ap
|
||||
|
||||
[ "$enabled" == "0" ] && return
|
||||
[ "$device" != "$dev" ] && return
|
||||
[ "$multi_ap" != "1" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
|
||||
#echo found ssid="$ssid" key="$key"
|
||||
|
||||
config_foreach mapagent_find_fbss ap $dev "$ssid" "$key"
|
||||
}
|
||||
|
||||
mapagent_process_radio() {
|
||||
local section=$1
|
||||
|
||||
config_get device $section device
|
||||
|
||||
#echo found dev=$dev
|
||||
|
||||
config_foreach mapagent_find_bbss ap $device
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_process_radio radio
|
||||
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
brcm_set_network() {
|
||||
local ifname=$1
|
||||
local num=$2
|
||||
local bssid=$3
|
||||
|
||||
wpa_cli -i $ifname set_n $num bssid $bssid
|
||||
}
|
||||
|
||||
bsta_steer() {
|
||||
local ifname=$1
|
||||
local bssid=$2
|
||||
|
||||
rc=$(wpa_cli -i $ifname set_n 0 bssid $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
|
||||
rc=$(wpa_cli -i $ifname roam $bssid)
|
||||
[ "$rc" == "FAIL" ] && {
|
||||
echo "1"
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
write_bsta_config() {
|
||||
local ifname=$1
|
||||
|
||||
#echo diff = $diff > /dev/console
|
||||
|
||||
|
||||
config_load mapagent
|
||||
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
local bssid=$3
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
#echo setting diff = $diff > /dev/console
|
||||
uci -q set wireless.${section}.bssid=$bssid
|
||||
echo 1
|
||||
}
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $1 $2
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
mapagent_process_bk() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
|
||||
|
||||
config_get ifname $section ifname
|
||||
#echo bsta = $bsta > /dev/console
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
#echo found ifname=$ifname > /dev/console
|
||||
|
||||
config_get bssid $section bssid
|
||||
config_get band $section band
|
||||
ret=$(mapagent_apply_wl_bsta $ifname $bssid)
|
||||
[ "$ret" == "1" ] && {
|
||||
diff=1
|
||||
onbrd_bssid=$bssid
|
||||
onbrd_band=$band
|
||||
}
|
||||
}
|
||||
|
||||
mapagent_apply_bssid_same_band() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
uci -q set wireless.${section}.bssid=$bssid
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onbrd_band" != "$band" -o "$onboarded" = "1" ] && return
|
||||
|
||||
config_get ifname $1 ifname
|
||||
|
||||
config_load wireless
|
||||
config_foreach apply_config wifi-iface $ifname $onbrd_bssid
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
config_foreach mapagent_process_bk bsta $ifname
|
||||
|
||||
#echo result diff = $diff > /dev/console
|
||||
[ "$diff" == "1" ] && {
|
||||
config_foreach mapagent_apply_bssid_same_band bsta
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
#echo reloading wireless > /dev/console
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
brcm_teardown_iface() {
|
||||
config_load mapagent
|
||||
|
||||
local iface=$1
|
||||
|
||||
mapagent_teardown_wireless() {
|
||||
write_wireless() {
|
||||
local section=$1
|
||||
local map_ifname=$2
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$ifname" != "$map_ifname" ] && return
|
||||
|
||||
uci -q set wireless.${section}.start_disabled="1"
|
||||
uci -q set wireless.${section}.ssid="DISABLED-SSID"
|
||||
uci -q set wireless.${section}.key="DISABLED-KEY"
|
||||
uci -q delete wireless.${section}.multi_ap_backhaul_ssid
|
||||
uci -q delete wireless.${section}.multi_ap_backhaul_key
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach write_wireless wifi-iface $1
|
||||
}
|
||||
|
||||
mapagent_teardown_bss() {
|
||||
local section=$1
|
||||
local iface=$2
|
||||
|
||||
multi_ap=$(get_type_by_section $section)
|
||||
[ "$multi_ap" == "0" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$iface" != "$ifname" ] && return
|
||||
|
||||
config_get ifname $section ifname
|
||||
uci -q set mapagent.${section}.enabled="0"
|
||||
uci -q set mapagent.${section}.ssid="DISABLED-SSID"
|
||||
uci -q set mapagent.${section}.key="DISABLED-KEY"
|
||||
|
||||
# subshell in hopes to maintain mapagent config loaded
|
||||
$(mapagent_teardown_wireless $ifname)
|
||||
}
|
||||
|
||||
|
||||
config_foreach mapagent_teardown_bss ap $iface
|
||||
|
||||
uci commit wireless
|
||||
uci commit mapagent
|
||||
}
|
||||
|
||||
brcm_bsta_to_wireless() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_find_lowest_prio_onboarded() {
|
||||
mapagent_process_bk() {
|
||||
config_get priority $1 priority "2"
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$onboarded" = "0" ] && return
|
||||
|
||||
if [ -z "$sec" -o "$prio" = "-1" -o "$priority" -lt "$prio" ]; then
|
||||
sec=$1
|
||||
prio=$priority
|
||||
fi
|
||||
}
|
||||
|
||||
local sec=""
|
||||
local prio="-1"
|
||||
|
||||
config_foreach mapagent_process_bk bsta
|
||||
echo $sec
|
||||
}
|
||||
|
||||
mapagent_enable_best() {
|
||||
#echo 1=$1 best=$best > /dev/console
|
||||
if [ "$1" = "$best" ]; then
|
||||
uci -q set mapagent.$1.enabled='1'
|
||||
else
|
||||
uci -q set mapagent.$1.enabled='0'
|
||||
fi
|
||||
}
|
||||
|
||||
mapagent_bsta_to_wireless() {
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section=$1
|
||||
local bsta=$2
|
||||
local ssid="$3"
|
||||
local key="$4"
|
||||
local encryption=$5
|
||||
local enabled=$6
|
||||
local bssid=$7
|
||||
local disabled="0"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ -z "$enabled" -o "$enabled" = "0" ] && disabled="1"
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
|
||||
uci -q set wireless.${section}.ssid="$ssid"
|
||||
uci -q set wireless.${section}.key="$key"
|
||||
uci -q set wireless.${section}.encryption=$encryption
|
||||
uci -q set wireless.${section}.bssid="$bssid"
|
||||
#uci -q set wireless.${section}.disabled=$disabled
|
||||
|
||||
[ "$disabled" != "1" ] && return
|
||||
wpa_cli -i "$bsta" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$bsta" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$bsta" save_config > /dev/null 2>&1
|
||||
|
||||
echo 1
|
||||
}
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $@
|
||||
uci commit wireless
|
||||
}
|
||||
|
||||
mapagent_find_other_creds() {
|
||||
#echo "trying to find other creds for $2" > /dev/console
|
||||
config_get band $1 band
|
||||
config_get onboarded $1 onboarded "0"
|
||||
|
||||
[ "$3" != "$band" -o "$onboarded" = "0" ] && return
|
||||
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
config_get enabled $1 enabled "0"
|
||||
config_get bssid $1 bssid
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $2 "$ssid" "$key" $encryption $4 "$bssid")
|
||||
}
|
||||
|
||||
config_get band $1 band
|
||||
config_get ifname $1 ifname
|
||||
config_get onboarded $1 onboarded "0"
|
||||
config_get enabled $1 enabled "0"
|
||||
|
||||
if [ "$onboarded" = "0" ]; then
|
||||
config_foreach mapagent_find_other_creds bsta $ifname $band $enabled
|
||||
else
|
||||
config_get ssid $1 ssid
|
||||
config_get key $1 key
|
||||
config_get encryption $1 encryption
|
||||
config_get bssid $1 bssid
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname "$ssid" "$key" $encryption $enabled "$bssid")
|
||||
fi
|
||||
}
|
||||
|
||||
# best=$(mapagent_find_lowest_prio_onboarded)
|
||||
#
|
||||
# [ -z "$best" ] && return
|
||||
#
|
||||
# band=$1
|
||||
# sec=""
|
||||
# prio=""
|
||||
#
|
||||
# config_foreach mapagent_enable_best bsta $best
|
||||
# uci commit mapagent
|
||||
config_load mapagent
|
||||
|
||||
diff=$(config_foreach mapagent_bsta_to_wireless bsta)
|
||||
|
||||
# [ "$diff" != "" ] && {
|
||||
ubus call uci commit '{"config":"wireless"}'
|
||||
# }
|
||||
}
|
||||
|
||||
|
||||
sync_mapcontroller_from_wireless() {
|
||||
ubus -t 5 wait_for wifi
|
||||
[ "$?" != "0" ] && return
|
||||
|
||||
[ ! -f "/etc/config/wireless" ] && return
|
||||
|
||||
status=$(ubus -S call wifi status)
|
||||
|
||||
device_to_band() {
|
||||
local ifname=$1
|
||||
json_load "$status"
|
||||
json_select "radios"
|
||||
json_get_keys keys
|
||||
|
||||
for key in $keys; do
|
||||
json_select $key
|
||||
json_get_var name name
|
||||
|
||||
if [ "$name" != "$ifname" ]; then
|
||||
json_select ..
|
||||
continue
|
||||
fi
|
||||
|
||||
json_get_var band band
|
||||
|
||||
if [ "$band" == "5GHz" ]; then
|
||||
echo "5"
|
||||
elif [ "$band" == "2.4GHz" ]; then
|
||||
echo "2"
|
||||
fi
|
||||
|
||||
break
|
||||
done
|
||||
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
wireless_process_iface() {
|
||||
local section=$1
|
||||
local type="ap"
|
||||
local enabled="1"
|
||||
|
||||
config_get multi_ap $section multi_ap 0
|
||||
[ "$multi_ap" != "1" ] && [ "$multi_ap" != "2" ] && return
|
||||
|
||||
config_get mode $section mode "ap"
|
||||
[ "$mode" != "ap" ] && return
|
||||
|
||||
config_get device $section device
|
||||
band=$(device_to_band $device)
|
||||
[ "$band" == "" ] && return
|
||||
|
||||
config_get ssid $section ssid
|
||||
config_get key $section key
|
||||
config_get encryption $section encryption
|
||||
config_get start_disabled $section start_disabled "0"
|
||||
config_get network $section network
|
||||
|
||||
|
||||
cntlr_section=$(uci add mapcontroller ${type})
|
||||
uci -q set mapcontroller.${cntlr_section}.ssid="$ssid"
|
||||
uci -q set mapcontroller.${cntlr_section}.key="$key"
|
||||
uci -q set mapcontroller.${cntlr_section}.encryption="$encryption"
|
||||
uci -q set mapcontroller.${cntlr_section}.band="$band"
|
||||
uci -q set mapcontroller.${cntlr_section}.vid="1"
|
||||
uci -q set mapcontroller.${cntlr_section}.network="$network"
|
||||
|
||||
[ "$multi_ap" == "1" ] && map_type="backhaul" || map_type="fronthaul"
|
||||
uci -q set mapcontroller.${cntlr_section}.type="$map_type"
|
||||
|
||||
[ "$start_disabled" == "1" ] && enabled="0"
|
||||
uci -q set mapcontroller.${cntlr_section}.enabled="$enabled"
|
||||
}
|
||||
|
||||
mapcontroller_teardown() {
|
||||
local section=$1
|
||||
|
||||
uci delete mapcontroller.$1
|
||||
}
|
||||
|
||||
config_load mapcontroller
|
||||
config_foreach mapcontroller_teardown ap
|
||||
|
||||
config_load wireless
|
||||
config_foreach wireless_process_iface wifi-iface
|
||||
uci commit mapcontroller
|
||||
}
|
||||
|
||||
bsta_scan_on_enabled() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_enable_bk() {
|
||||
config_get ifname $1 ifname
|
||||
config_get enabled $1 enabled
|
||||
|
||||
echo ifname $ifname enabled $enabled
|
||||
|
||||
[ "$enabled" = "0" ] && return
|
||||
|
||||
wpa_cli -i "$ifname" enable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" reconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
|
||||
config_foreach mapagent_enable_bk bsta
|
||||
}
|
||||
|
||||
bsta_enable_all() {
|
||||
mapagent_enable_bk() {
|
||||
config_get ifname $1 ifname "2"
|
||||
uci -q set mapagent.$1.enabled="1"
|
||||
}
|
||||
|
||||
config_load mapagent
|
||||
|
||||
config_foreach mapagent_enable_bk bsta
|
||||
uci commit mapagent
|
||||
bsta_scan_on_enabled
|
||||
}
|
||||
|
||||
bsta_disable_lower_priority() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_get_priority() {
|
||||
config_get ifname $1 ifname
|
||||
|
||||
[ "$ifname" != "$2" ] && return
|
||||
|
||||
config_get priority $1 priority "2"
|
||||
|
||||
echo "$priority"
|
||||
}
|
||||
|
||||
mapagent_disable_lower_bk() {
|
||||
mapagent_apply_wl_bsta() {
|
||||
apply_config() {
|
||||
local section="$1"
|
||||
local bsta="$2"
|
||||
local enabled="$3"
|
||||
|
||||
config_get ifname $section ifname
|
||||
|
||||
[ "$bsta" == "$ifname" ] || return
|
||||
|
||||
[ "$enabled" != "0" ] && return
|
||||
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
local ifname="$1"
|
||||
local enabled="$2"
|
||||
|
||||
[ "$enabled" != "0" ] && return
|
||||
|
||||
config_load wireless
|
||||
|
||||
config_foreach apply_config wifi-iface $ifname $enabled
|
||||
}
|
||||
|
||||
local enabled="1"
|
||||
|
||||
config_get ifname $1 ifname
|
||||
config_get priority $1 priority
|
||||
|
||||
[ "$ifname" != "$2" -a "$priority" -gt "$3" ] && enabled="0"
|
||||
|
||||
uci -q set mapagent.$1.enabled="$enabled"
|
||||
|
||||
echo $(mapagent_apply_wl_bsta $ifname $enabled) > /dev/null
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
|
||||
prio=$(config_foreach mapagent_get_priority bsta $bsta)
|
||||
#echo bsta $bsta has prio $prio > /dev/console
|
||||
|
||||
config_foreach mapagent_disable_lower_bk bsta $bsta $prio
|
||||
uci commit mapagent
|
||||
|
||||
# ubus call uci commit '{"config":"wireless"}'
|
||||
}
|
||||
|
||||
|
||||
bsta_use_link() {
|
||||
config_load mapagent
|
||||
|
||||
mapagent_disable_bk() {
|
||||
local bsta="$2"
|
||||
|
||||
config_get ifname $1 ifname
|
||||
config_get enabled $1 enabled
|
||||
|
||||
[ "$bsta" = "$ifname" ] && return
|
||||
|
||||
wpa_cli -i "$ifname" disconnect > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" disable_network 0 > /dev/null 2>&1
|
||||
wpa_cli -i "$ifname" save_config > /dev/null 2>&1
|
||||
}
|
||||
|
||||
local bsta=$1
|
||||
|
||||
config_foreach mapagent_disable_bk bsta $bsta
|
||||
}
|
||||
|
||||
bsta_swap_to_link() {
|
||||
bsta_disable_lower_priority $1
|
||||
bsta_use_link $1
|
||||
|
||||
wpa_cli -i "$1" enable_network 0 > /dev/null
|
||||
wpa_cli -i "$1" reconnect > /dev/null
|
||||
wpa_cli -i "$1" save_config > /dev/null
|
||||
}
|
||||
|
||||
set_uplink_backhaul_info() {
|
||||
local ul_1905id=$1
|
||||
local ul_mac=$2
|
||||
|
||||
json_load "$(cat $MAPFILE)"
|
||||
json_add_string "backhaul_device_id" "$ul_1905id"
|
||||
json_add_string "backhaul_macddr" "$ul_mac"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
set_uplink() {
|
||||
local type=$1
|
||||
local ifname=$2
|
||||
local hwaddr
|
||||
|
||||
hwaddr="$(ifconfig $ifname | grep -i hwaddr | awk '{print $5}' | awk '{print tolower($0)}')"
|
||||
|
||||
json_init
|
||||
json_add_string "type" "$type"
|
||||
json_add_string "ifname" "$ifname"
|
||||
json_add_string "macaddr" "$hwaddr"
|
||||
json_dump > "$MAPFILE"
|
||||
json_cleanup
|
||||
}
|
||||
|
||||
unset_uplink() {
|
||||
rm "$MAPFILE" > /dev/null 2>&1
|
||||
}
|
||||
|
||||
func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
wireless_teardown) brcm_wireless_teardown;;
|
||||
setup_network) brcm_setup_network;;
|
||||
setup_wireless) brcm_setup_wireless;;
|
||||
write_credentials) brcm_write_credentials;;
|
||||
sync_credentials) brcm_sync_credentials;;
|
||||
bsta_steer) bsta_steer $@;;
|
||||
set_network) brcm_set_network $@;;
|
||||
write_bsta_config) write_bsta_config $@;;
|
||||
teardown_iface) brcm_teardown_iface $@;;
|
||||
bsta_to_wireless) brcm_bsta_to_wireless $@;;
|
||||
sync_mapcontroller_from_wireless) sync_mapcontroller_from_wireless $@;;
|
||||
ts) ts_sub $@;;
|
||||
bsta_enable_all) bsta_enable_all $@;;
|
||||
bsta_disable_lower_priority) bsta_disable_lower_priority $@;;
|
||||
bsta_scan_on_enabled) bsta_scan_on_enabled $@;;
|
||||
bsta_use_link) bsta_use_link $@;;
|
||||
bsta_swap_to_link) bsta_swap_to_link $@;;
|
||||
set_uplink) set_uplink $@;;
|
||||
set_uplink_backhaul_info) set_uplink_backhaul_info $@;;
|
||||
unset_uplink) unset_uplink $@;;
|
||||
--help|help) usage;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
|
||||
381
map-agent/files/lib/wifi/traffic_separation
Executable file
381
map-agent/files/lib/wifi/traffic_separation
Executable file
@@ -0,0 +1,381 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions.sh
|
||||
|
||||
### Traffic Separation ###
|
||||
|
||||
ts_sub() {
|
||||
|
||||
ts_usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 [create|delete|populate]
|
||||
Traffic Separation related functions.
|
||||
create fh <iface> <vid> - create vlan device and rules for wifi fronthaul
|
||||
create bh <iface> <vid> <profile> - create vlan device and rules for wifi backhaul
|
||||
create eth <iface> <vid> <pbits> - create vlan device and rules for logical ethernet interface
|
||||
delete <iface> - delete vlan device
|
||||
populate eth <iface> <vid> - add secondary network rules for logical ethernet interface
|
||||
primary get <iface> - read primary VID for interface from driver (from Association Response frame IE)
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
_get_bridge() {
|
||||
local bridge=$(ip link show $1 | grep -o "master [^\s]*" | cut -d ' ' -f 2)
|
||||
echo $bridge
|
||||
}
|
||||
|
||||
ts_create() {
|
||||
|
||||
_create_vlan_dev() {
|
||||
iface=$1 # real iface
|
||||
vid=$2 # Vlan ID
|
||||
bridge="$(_get_bridge $iface)" # bridge iface is connected to
|
||||
vlan_dev=${iface}_vlan${vid} # name of vlan device to create
|
||||
|
||||
# remove interface from bridge if it is in one
|
||||
[ -n "$bridge" ] && brctl delif $bridge $iface &> /dev/null
|
||||
|
||||
# create vlan device
|
||||
vlanctl --mcast --if-create-name $iface $vlan_dev --if $iface --set-if-mode-rg
|
||||
|
||||
# bring the vlan device up and add back to bridge if it was in one
|
||||
[ -n "$bridge" ] && brctl addif $bridge $vlan_dev &> /dev/null
|
||||
ip link set dev $vlan_dev up
|
||||
|
||||
echo $vlan_dev
|
||||
}
|
||||
|
||||
ts_create_fh() {
|
||||
iface=$1 # fh iface
|
||||
vid=$2 # SSID specific (secondary) or primary vid
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
Adding FH device requires IFACE and VID.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
|
||||
# add rules
|
||||
# Note: removing these for now since these packets are read directly from the iface anyway
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x888e --set-rxif $vlan_dev --rule-append # incoming EAPOL
|
||||
# vlanctl --if $iface --rx --tags 0 --filter-ethertype 0x886c --set-rxif $vlan_dev --rule-append # incoming brcm
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --filter-vid $vid 0 --pop-tag --dscp2pbits 0 --rule-append
|
||||
}
|
||||
|
||||
# Note: Currently not used (will be needed for Profile 1)
|
||||
ts_create_bh() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
|
||||
# add rules
|
||||
case "$profile" in
|
||||
1 | profile_1 | profile1 | Profile_1 | Profile1)
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
;;
|
||||
2 | profile_2 | profile2 | Profile_2 | Profile2)
|
||||
vlanctl --if $iface --rx --tags 1 --set-rxif $vlan_dev --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-txif $vlan_dev --rule-append # note: already default
|
||||
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x893a --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing IEEE1905.1
|
||||
vlanctl --if $iface --tx --tags 0 --filter-ethertype 0x888e --filter-txif $vlan_dev --push-tag --set-vid $vid 0 --rule-append # note: outgoing EAPOL
|
||||
;;
|
||||
*)
|
||||
ts_delete $iface
|
||||
ts_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_create_bh_drv() {
|
||||
iface=$1 # bh iface
|
||||
vid=$2 # primary vid
|
||||
profile=$3 # agent profile (1 or 2)
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$profile" ] || {
|
||||
cat <<EOF
|
||||
Adding BH device requires IFACE, VID and PROFILE (1 or 2).
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
wl vlan_mode 0 &> /dev/null # make sure this is OFF, else driver won't handle vlan
|
||||
wl -i $iface down &> /dev/null
|
||||
wl -i $iface map_profile $profile &> /dev/null # only has effect on profile 2
|
||||
wl -i $iface map_8021q_settings $vid &> /dev/null # can only be set on bBSS (read-only on bSTA)
|
||||
wl -i $iface up &> /dev/null
|
||||
}
|
||||
|
||||
ts_create_eth() {
|
||||
|
||||
_ts_setup() {
|
||||
vlan_bridge=$1
|
||||
lan_bridge=$2
|
||||
vlan_dev=$3
|
||||
lan_dev=${vlan_dev}_lan
|
||||
|
||||
ip link show $vlan_dev &> /dev/null || ip link add $vlan_dev type veth peer name $lan_dev
|
||||
brctl addif $vlan_bridge $vlan_dev &> /dev/null
|
||||
brctl addif $lan_bridge $lan_dev &> /dev/null
|
||||
ip link set $vlan_dev up
|
||||
ip link set $lan_dev up
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # primary vid
|
||||
pbits=$3 # default pbits to apply
|
||||
vlan_bridge=$4 # name of ts subsystem bridge
|
||||
lan_bridge=$5 # name of node local bridge
|
||||
|
||||
[ -n "$iface" ] && [ -n "$vid" ] && [ -n "$pbits" ] && [ -n "$vlan_bridge" ] && [ -n "$lan_bridge" ] || {
|
||||
cat <<EOF
|
||||
Adding ETH device requires IFACE, VID, PBITS and name of vlan and lan bridges.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# create virtual eth device between bridges (if it doesn't exist))
|
||||
_ts_setup $vlan_bridge $lan_bridge $iface
|
||||
|
||||
# create vlan device
|
||||
vlan_dev=$(_create_vlan_dev $iface $vid)
|
||||
|
||||
# TODO: how to disable returning traffic back to incoming interface?
|
||||
|
||||
# add rules
|
||||
vlanctl --if $iface --rx --tags 0 --set-rxif $vlan_dev --push-tag --set-vid $vid 0 --set-pbits $pbits 0 --rule-append
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --pop-tag --rule-append
|
||||
}
|
||||
|
||||
ts_create_dhcp() {
|
||||
_br_setup() {
|
||||
local name=$1
|
||||
local sinkname=$2
|
||||
local vid=$3
|
||||
local diff=""
|
||||
|
||||
[ -z "$(uci -q get network.${name}_dev)" ] && {
|
||||
uci -q set network.${name}_dev="device"
|
||||
uci -q set network.${name}_dev.name="br-${name}"
|
||||
uci -q set network.${name}_dev.type="bridge"
|
||||
uci -q set network.${name}_dev.bridge_empty="1"
|
||||
uci -q add_list network.${name}_dev.ports="${sinkname}"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ -z "$(uci -q get network.${name})" ] && {
|
||||
uci -q set network.${name}="interface"
|
||||
uci -q set network.${name}.device="br-${name}"
|
||||
uci -q set network.${name}.is_lan="1"
|
||||
uci -q set network.${name}.proto="static"
|
||||
uci -q set network.${name}.ipaddr="192.168.${vid}.1"
|
||||
uci -q set network.${name}.netmask="255.255.255.0"
|
||||
|
||||
diff="1"
|
||||
}
|
||||
|
||||
[ "$diff" = "1" ] && {
|
||||
uci -q commit network
|
||||
ubus call network reload
|
||||
ubus -t 5 wait_for network.device
|
||||
}
|
||||
}
|
||||
|
||||
_dhcp_setup() {
|
||||
local name=$1
|
||||
|
||||
[ -n "$(uci -q get dhcp.${name})" ] && return
|
||||
|
||||
uci -q set dhcp.${name}=dhcp
|
||||
uci -q set dhcp.${name}.interface="${name}"
|
||||
uci -q set dhcp.${name}.start="100"
|
||||
uci -q set dhcp.${name}.limit="150"
|
||||
uci -q set dhcp.${name}.leasetime="1h"
|
||||
uci -q set dhcp.${name}.dhcpv4="server"
|
||||
uci -q set dhcp.${name}.dhcpv6="server"
|
||||
uci -q set dhcp.${name}.ra="server"
|
||||
uci -q set dhcp.${name}.ra_slaac="1"
|
||||
uci -q add_list dhcp.${name}.ra_flags="managed-config"
|
||||
uci -q add_list dhcp.${name}.ra_flags="other-config"
|
||||
|
||||
uci -q commit dhcp
|
||||
ubus call uci commit '{"config":"dhcp"}'
|
||||
}
|
||||
|
||||
_wan_setup() {
|
||||
local name=$1
|
||||
|
||||
config_load firewall
|
||||
|
||||
_process_zone() {
|
||||
local section=$1
|
||||
local sink=$2
|
||||
local name
|
||||
local exists=false
|
||||
|
||||
config_get name $section name
|
||||
|
||||
[ "$name" == "lan" ] || return
|
||||
|
||||
_process_list() {
|
||||
local value=$1
|
||||
|
||||
[ "$value" == "$sink" ] && exists=true && return 1
|
||||
}
|
||||
|
||||
config_list_foreach "$section" network _process_list
|
||||
|
||||
[ $exists = false ] && {
|
||||
uci -q add_list firewall.${section}.network="${sink}"
|
||||
uci -q commit firewall
|
||||
ubus call uci commit '{"config":"firewall"}'
|
||||
}
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
config_foreach _process_zone zone $name
|
||||
}
|
||||
|
||||
vid=$1 # primary vid
|
||||
|
||||
[ -n "$vid" ] || {
|
||||
cat <<EOF
|
||||
VID required to configure DHCP.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
br_dev=sink_vlan${vid} # name of vlan device to create
|
||||
|
||||
|
||||
ip l a sink1_vlan${vid} type veth peer name sink2_vlan${vid}
|
||||
vlanctl --mcast --if-create-name sink2_vlan${vid} sink3_vlan${vid} --if sink2_vlan${vid} --set-if-mode-rg
|
||||
vlanctl --if sink2_vlan${vid} --rx --tags 1 --filter-vid ${vid} 0 --set-rxif sink3_vlan${vid} --pop-tag --rule-append
|
||||
vlanctl --if sink2_vlan${vid} --tx --tags 0 --filter-txif sink3_vlan${vid} --push-tag --set-vid ${vid} 0 --rule-append
|
||||
ip l s sink1_vlan${vid} up
|
||||
ip l s sink2_vlan${vid} up
|
||||
ip l s sink3_vlan${vid} up
|
||||
|
||||
_br_setup $br_dev sink3_vlan${vid} $vid
|
||||
_dhcp_setup $br_dev
|
||||
_wan_setup $br_dev
|
||||
}
|
||||
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
case "$type" in
|
||||
fh) ts_create_fh $@;;
|
||||
# bh) ts_create_bh $@;;
|
||||
bh) ts_create_bh_drv $@;;
|
||||
eth) ts_create_eth $@;;
|
||||
dhcp) ts_create_dhcp $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_delete() {
|
||||
iface=$1
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 0
|
||||
vlan_dev=${path##*upper_}
|
||||
bridge="$(_get_bridge $vlan_dev)"
|
||||
|
||||
vlanctl --if-delete $vlan_dev # note: also removes rules and removes from bridge
|
||||
|
||||
brctl addif $bridge $iface &> /dev/null
|
||||
}
|
||||
|
||||
ts_populate() {
|
||||
local type=$1
|
||||
shift
|
||||
|
||||
[ "$type" == "eth" ] || {
|
||||
cat <<EOF
|
||||
Populating ETH rules requires IFACE and VID.
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
iface=$1 # Multi-AP Logical Ethernet Interface
|
||||
vid=$2 # secondary vid
|
||||
|
||||
path=$(ls -d /sys/class/net/${iface}/upper_*)
|
||||
[ -z "$path" ] && exit 1
|
||||
vlan_dev=${path##*upper_}
|
||||
|
||||
# add rules
|
||||
vlanctl --if $iface --rx --tags 1 --filter-vid $vid 0 --set-rxif $vlan_dev --rule-append # note: retain secondary vids
|
||||
vlanctl --if $iface --tx --tags 1 --filter-vid $vid 0 --filter-txif $vlan_dev --rule-append # note: already default
|
||||
}
|
||||
|
||||
ts_primary() {
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
get) vid=$(wl -i $1 map_8021q_settings); echo ${vid##* };;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
ts_unicast() {
|
||||
local mac=$1
|
||||
local iface=$2
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "$mac" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d "$mac" -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d "$mac" -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
ts_multicast() {
|
||||
local iface=$1
|
||||
|
||||
# TODO: improve?
|
||||
res=$(ebtables -t broute -L | grep -i "1:80:C2:00:00:13" | grep "$iface")
|
||||
[ -n "$res" ] && return
|
||||
|
||||
ebtables -t broute -D BROUTING -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -D BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
ebtables -t broute -I BROUTING -i "$iface" -d 01:80:C2:00:00:13 -p 0x893a -j DROP
|
||||
}
|
||||
|
||||
local func=$1
|
||||
shift
|
||||
|
||||
case "$func" in
|
||||
create) ts_create $@;;
|
||||
delete) ts_delete $@;;
|
||||
populate) ts_populate $@;;
|
||||
primary) ts_primary $@;;
|
||||
unicast) ts_unicast $@;;
|
||||
multicast) ts_multicast $@;;
|
||||
--help|help) ts_usage;;
|
||||
*) ts_usage; exit 1;;
|
||||
esac
|
||||
}
|
||||
@@ -5,16 +5,20 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=map-controller
|
||||
PKG_VERSION:=1.0.3
|
||||
PKG_VERSION:=5.4.5
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_SOURCE_VERSION:=f1b50ed876f14347480e9e131ac6de76922e131a
|
||||
PKG_SOURCE_VERSION:=99ef60cc1ef7c00706cd1053c17d8f6a429f52d4
|
||||
|
||||
PKG_LICENSE:=PROPRIETARY IOPSYS
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
||||
LOCAL_DEV=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=git@dev.iopsys.eu:iopsys/map-controller.git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-controller
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)_$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
@@ -22,7 +26,7 @@ define Package/map-controller
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=WiFi Multi-AP Controller (EasyMesh R2)
|
||||
DEPENDS:=+libuci +libubox +ubus +libmaputils
|
||||
DEPENDS:=+libuci +libubox +ubus +libeasy +libieee1905 +ieee1905 +map-plugin
|
||||
endef
|
||||
|
||||
define Package/map-controller/description
|
||||
@@ -42,8 +46,15 @@ MAKE_PATH:=src
|
||||
|
||||
define Package/map-controller/install
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(CP) ./files/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mapcontroller $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
ifeq ($(LOCAL_DEV),1)
|
||||
define Build/Prepare
|
||||
rsync -r --exclude=.* ~/git/map-controller/ $(PKG_BUILD_DIR)/
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(call BuildPackage,map-controller))
|
||||
|
||||
67
map-controller/files/etc/config/mapcontroller
Normal file
67
map-controller/files/etc/config/mapcontroller
Normal file
@@ -0,0 +1,67 @@
|
||||
config controller 'controller'
|
||||
option enabled '1'
|
||||
option registrar '5 2' #bands on which wps registrar supported
|
||||
option debug '6'
|
||||
option enable_sta_steer '0'
|
||||
option enable_bsta_steer '0'
|
||||
option primary_vid '1'
|
||||
option primary_pcp '0'
|
||||
|
||||
config interface 'lan'
|
||||
option 'dhcp'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net5'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'sae-mixed'
|
||||
option key '1234567890'
|
||||
option ssid 'map-net2'
|
||||
option vid '1'
|
||||
option type 'fronthaul'
|
||||
option network 'lan'
|
||||
|
||||
config ap
|
||||
option band '5'
|
||||
option encryption 'sae'
|
||||
option key '5555555555'
|
||||
option ssid 'map-bkhaul-5'
|
||||
option type 'backhaul'
|
||||
option disallow_bsta '1' # bitmap, 1 for disallow p1, 2 to disallow p2, 3 to disallow both (probably never applicable)
|
||||
option vid '1'
|
||||
option network 'lan'
|
||||
|
||||
config ap
|
||||
option band '2'
|
||||
option encryption 'sae'
|
||||
option key '2222222222'
|
||||
option ssid 'map-bkhaul-2'
|
||||
list disallow_bsta '0' # 0 or 1 profile-1 bSTA
|
||||
option vid '1'
|
||||
option type 'backhaul'
|
||||
option network 'lan'
|
||||
|
||||
config policy 'policy'
|
||||
list steer_exclude '00:11:22:33:44:55'
|
||||
list steer_exclude_btm '00:aa:bb:cc:dd:ee'
|
||||
option steer_policy '2' # 0, 1, 2 - see MultiAP spec
|
||||
option util_threshold '200' # channel-util as in BSS load
|
||||
option rcpi_threshold '30' # 0 - 220 valid range
|
||||
option report_scan '0' # 0 or 1 for independent scans
|
||||
option report_sta_assocfails '1' # 0 or 1 - stas assoc failure
|
||||
option report_sta_assocfails_rate '2' # reporting rate for STA assoc fails (attempts per minute)
|
||||
option report_metric_periodic '0' # 0, or 1 - 255 in secs
|
||||
option report_rcpi_threshold '0' # 0, or 1 - 220
|
||||
option report_util_threshold '0' # 0, or channel-util value
|
||||
option rcpi_hysteresis_margin '0' # 0, or > 0 - hysteresis margin
|
||||
option include_sta_stats '0' # sta stats in AP metric resp
|
||||
option include_sta_metric '0' # sta metric in AP metric resp
|
||||
option disallow_bsta_p1 '0' # 0 or 1 profile-1 bSTA
|
||||
option disallow_bsta_p2 '0' # 0 or 1 profile-2 bSTA
|
||||
63
map-controller/files/etc/init.d/mapcontroller
Executable file
63
map-controller/files/etc/init.d/mapcontroller
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=98
|
||||
STOP=20
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
handle_controller_select() {
|
||||
local section="$1"
|
||||
|
||||
config_get_bool local_ctrl "$section" local 0
|
||||
return 1
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local enabled
|
||||
|
||||
config_load "mapcontroller"
|
||||
config_get_bool enabled controller enabled 1
|
||||
[ "$enabled" -eq 0 ] && return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "/usr/sbin/mapcontroller" "-d"
|
||||
|
||||
if [ -f /etc/config/mapagent ]; then
|
||||
local local_ctrl=0
|
||||
|
||||
config_load "mapagent"
|
||||
config_foreach handle_controller_select controller_select
|
||||
[ "$local_ctrl" -eq 0 ] && procd_append_param command "-w"
|
||||
fi
|
||||
|
||||
procd_set_param respawn
|
||||
# procd_set_param stdout 1
|
||||
# procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers()
|
||||
{
|
||||
procd_add_reload_trigger "mapcontroller"
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
local enabled
|
||||
|
||||
config_load "mapcontroller"
|
||||
config_get_bool enabled controller enabled 1
|
||||
if [ "$enabled" -eq 0 ]; then
|
||||
stop
|
||||
# Start but without instance so reload trigger works.
|
||||
start
|
||||
return
|
||||
fi
|
||||
|
||||
pidof "mapcontroller" > /dev/null
|
||||
if [[ $? -ne 0 ]] ; then
|
||||
start
|
||||
return
|
||||
fi
|
||||
|
||||
procd_send_signal "mapcontroller"
|
||||
}
|
||||
@@ -6,14 +6,15 @@ include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=map-topology
|
||||
PKG_VERSION:=1.5.6
|
||||
PKG_VERSION:=3.2.0
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
PKG_SOURCE_VERSION:=8d008ef712227986263e9a2a1b188ce3a27e17f8
|
||||
PKG_SOURCE_VERSION:=d1fae1ff7a8bc8daea08799b9ffbdeb424903e54
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/map-topology.git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
|
||||
PKG_MIRROR_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
@@ -24,12 +25,14 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/map-topology
|
||||
CATEGORY:=Utilities
|
||||
DEPENDS:=+libubox +ubus +libpthread +libuci +libeasy \
|
||||
+libieee1905 +libavahi-nodbus-support
|
||||
+libieee1905 +map-plugin +libavahi-nodbus-support
|
||||
TITLE:=Utility to build topology of a multi-AP network
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include
|
||||
-I$(STAGING_DIR)/usr/include \
|
||||
-I$(STAGING_DIR)/usr/include/libnl3 \
|
||||
-D_GNU_SOURCE
|
||||
|
||||
define Package/map-topology/description
|
||||
Constructs network topology and show it as json structure over UBUS
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user