mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-19 23:50:30 +00:00
Compare commits
641 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e04b8241dc | ||
|
|
1cbd60e9c8 | ||
|
|
43ffecb1a1 | ||
|
|
9126c88294 | ||
|
|
19a01f6cb0 | ||
|
|
1752c92980 | ||
|
|
35ff61118f | ||
|
|
07d1610602 | ||
|
|
15f7ae91be | ||
|
|
d885eb5bc2 | ||
|
|
2bccdeb556 | ||
|
|
4080cfd81f | ||
|
|
ad32a8c923 | ||
|
|
9db654d61b | ||
|
|
d688c99843 | ||
|
|
409b3d5c20 | ||
|
|
50815ab6bf | ||
|
|
37a097cc35 | ||
|
|
c95b84e9d0 | ||
|
|
9766eaa1bf | ||
|
|
b6c42575d8 | ||
|
|
67796d8420 | ||
|
|
a867e4ebcc | ||
|
|
2ac9b4ff96 | ||
|
|
ceaac8dffb | ||
|
|
434a0a7d81 | ||
|
|
5bc579f05c | ||
|
|
d1dd00b08e | ||
|
|
9e8ad4923b | ||
|
|
86c199e3f7 | ||
|
|
75711a8b77 | ||
|
|
4b4ded0c27 | ||
|
|
eec9f293b1 | ||
|
|
71978e71e3 | ||
|
|
cba9d69b4d | ||
|
|
621b73938d | ||
|
|
c3e4f68609 | ||
|
|
6c23bdec60 | ||
|
|
30509955c2 | ||
|
|
b85cbddeec | ||
|
|
5798b17737 | ||
|
|
c30a2fa607 | ||
|
|
ddcab3a6cf | ||
|
|
d45fcd6fc2 | ||
|
|
aa00a4734a | ||
|
|
fe70d33002 | ||
|
|
ec0b924852 | ||
|
|
b04ef7e289 | ||
|
|
a2a00d2205 | ||
|
|
f911895b11 | ||
|
|
2e609df339 | ||
|
|
af2877cf59 | ||
|
|
6b38334767 | ||
|
|
a87a4638b0 | ||
|
|
a787da5d83 | ||
|
|
bd5a8535f1 | ||
|
|
e83a7fca5f | ||
|
|
072cf56720 | ||
|
|
acff8016ba | ||
|
|
11c4cb9b33 | ||
|
|
a385af0109 | ||
|
|
1961fd7f20 | ||
|
|
006fced248 | ||
|
|
0f94c3487d | ||
|
|
8cbe7cf6af | ||
|
|
76f15d6249 | ||
|
|
71c8d6b93f | ||
|
|
ad867af7a0 | ||
|
|
340a885036 | ||
|
|
ccdf1aff7a | ||
|
|
70b838ff38 | ||
|
|
86180447e7 | ||
|
|
d05ec7e826 | ||
|
|
320551124c | ||
|
|
d89009becf | ||
|
|
42c3e6066c | ||
|
|
b1d0287327 | ||
|
|
e7ea9e7611 | ||
|
|
d89dbb4882 | ||
|
|
87f2185431 | ||
|
|
c836ef28f4 | ||
|
|
759bd813ac | ||
|
|
5198703a6f | ||
|
|
3539761c28 | ||
|
|
a3e9c48006 | ||
|
|
eb030b6a29 | ||
|
|
b033317286 | ||
|
|
0071fb6173 | ||
|
|
a247907d3a | ||
|
|
df1e5b21c8 | ||
|
|
759c134276 | ||
|
|
b4ed5f1d2e | ||
|
|
e161c30c75 | ||
|
|
10944d4a43 | ||
|
|
ee8c4e8996 | ||
|
|
3c3e928fb6 | ||
|
|
e8ea2f10cc | ||
|
|
240c429956 | ||
|
|
000f5e80ea | ||
|
|
69d9c0f7c3 | ||
|
|
b2821c1f53 | ||
|
|
a9f583cd83 | ||
|
|
647ed85345 | ||
|
|
1d765027fe | ||
|
|
0dfcff7504 | ||
|
|
fe7ba1e641 | ||
|
|
b9f9e24928 | ||
|
|
b783554d4d | ||
|
|
0517367a6e | ||
|
|
2d49ed99ed | ||
|
|
053ccd6b06 | ||
|
|
719762ccab | ||
|
|
9276a4ae07 | ||
|
|
230acb9e88 | ||
|
|
494348e2f0 | ||
|
|
80db773737 | ||
|
|
b4be5a4460 | ||
|
|
bfecc0110b | ||
|
|
823c838d21 | ||
|
|
4f52f5a748 | ||
|
|
204488f879 | ||
|
|
2b74085b21 | ||
|
|
2e3b588477 | ||
|
|
6468f32c3b | ||
|
|
4078b57313 | ||
|
|
668c2d8d9b | ||
|
|
f3b5f5433c | ||
|
|
d9bf7c8c6b | ||
|
|
912e579100 | ||
|
|
d76ac32759 | ||
|
|
21fd147cd8 | ||
|
|
45599fe4a2 | ||
|
|
edec2f6c5f | ||
|
|
3cdad2d031 | ||
|
|
fcd4aba0de | ||
|
|
12a4de374c | ||
|
|
e5d8179b76 | ||
|
|
ab451412de | ||
|
|
dd22040da2 | ||
|
|
3289526cde | ||
|
|
934373e1d9 | ||
|
|
0a9225082f | ||
|
|
70e9b3ef7f | ||
|
|
c3d1aac90a | ||
|
|
9696e229c1 | ||
|
|
7f2459ed09 | ||
|
|
5a808cb1ca | ||
|
|
d0926ec041 | ||
|
|
ecfad451d8 | ||
|
|
27892e0935 | ||
|
|
e63ff57137 | ||
|
|
f0bb6f8e5d | ||
|
|
9f299e77e6 | ||
|
|
08e0571cb5 | ||
|
|
94611edefe | ||
|
|
fa56147570 | ||
|
|
8b833dfe99 | ||
|
|
a92fbe7c6e | ||
|
|
6e28bfe6eb | ||
|
|
71dacd442d | ||
|
|
c8bff02efa | ||
|
|
25d36e3a5b | ||
|
|
c0e2a0105b | ||
|
|
a6551640e5 | ||
|
|
7a5c40c130 | ||
|
|
9f85621977 | ||
|
|
545435370f | ||
|
|
d8560bba2b | ||
|
|
c64c5b25fb | ||
|
|
348d9aaade | ||
|
|
948df46d55 | ||
|
|
467eb9203e | ||
|
|
76ff65862a | ||
|
|
4a523a394d | ||
|
|
d789166d4c | ||
|
|
142fa8f4da | ||
|
|
cbed24fc2b | ||
|
|
76282a84b8 | ||
|
|
107e256170 | ||
|
|
b016bc229a | ||
|
|
923817d863 | ||
|
|
27a62710cd | ||
|
|
b34e6d4537 | ||
|
|
1231aa98a1 | ||
|
|
fb4d10c83a | ||
|
|
74d1853ef6 | ||
|
|
e595ec7c73 | ||
|
|
2ac3c5832a | ||
|
|
89344c5dab | ||
|
|
854247d265 | ||
|
|
20db2d2f77 | ||
|
|
29ffb11693 | ||
|
|
5df3d10dd6 | ||
|
|
edebdf8698 | ||
|
|
59b31dbb2d | ||
|
|
c221af02db | ||
|
|
b6fd23caaf | ||
|
|
53ca36d244 | ||
|
|
45cf2e1b8b | ||
|
|
4dfaf50977 | ||
|
|
b04ff22645 | ||
|
|
b65af94d47 | ||
|
|
0c445bedda | ||
|
|
d579a74e54 | ||
|
|
9adf1999db | ||
|
|
2f639e45b6 | ||
|
|
68f0027830 | ||
|
|
4ba4d43aa6 | ||
|
|
437bd9cbe1 | ||
|
|
2e389d61a0 | ||
|
|
0fb553916b | ||
|
|
a7db85a6c2 | ||
|
|
0b405e3d2b | ||
|
|
49829f6928 | ||
|
|
6f6c90cba8 | ||
|
|
f9f7e7c5af | ||
|
|
4c92d6785e | ||
|
|
cce51f69bc | ||
|
|
dde219c81b | ||
|
|
86802258dd | ||
|
|
6cd761589e | ||
|
|
e84fd27ec1 | ||
|
|
5c6ad3142d | ||
|
|
e4a7318877 | ||
|
|
0915a0e66b | ||
|
|
c88284da05 | ||
|
|
076781915f | ||
|
|
9b51d61276 | ||
|
|
e4a772965a | ||
|
|
346e8fb719 | ||
|
|
bc691f05c5 | ||
|
|
c2ad982b76 | ||
|
|
f1ddab49dc | ||
|
|
74c7d3efc4 | ||
|
|
6416c6d4ea | ||
|
|
432ad112c5 | ||
|
|
ee91f661fb | ||
|
|
6742d6f471 | ||
|
|
acbd1f1f7d | ||
|
|
79de529592 | ||
|
|
8dd9cf3c86 | ||
|
|
c3c6284b83 | ||
|
|
b91a763065 | ||
|
|
71f0135a89 | ||
|
|
293110e2cc | ||
|
|
897de9f8e2 | ||
|
|
7e00727ce7 | ||
|
|
b40215665a | ||
|
|
fa8b42c0d5 | ||
|
|
16b7faaafa | ||
|
|
eb363157c6 | ||
|
|
f097cca7a5 | ||
|
|
9edcd9b961 | ||
|
|
c5c66eeb4a | ||
|
|
3fd2470533 | ||
|
|
a3329b562c | ||
|
|
f5239e0905 | ||
|
|
8471bd14e2 | ||
|
|
18bd37f913 | ||
|
|
fb054e6523 | ||
|
|
b036b18afe | ||
|
|
4b943d4b7b | ||
|
|
b66b872928 | ||
|
|
ed49592754 | ||
|
|
14740aec74 | ||
|
|
c652a883ff | ||
|
|
ab32cefbe2 | ||
|
|
91db46b6ba | ||
|
|
a37c29eb80 | ||
|
|
17c761afbe | ||
|
|
44210a0a88 | ||
|
|
81ac396187 | ||
|
|
fadba8a1ed | ||
|
|
843e7c8fc4 | ||
|
|
a34dc257aa | ||
|
|
ff604660fe | ||
|
|
8bec50653f | ||
|
|
c6e8419839 | ||
|
|
f55bd83d55 | ||
|
|
003c4b6cb0 | ||
|
|
dc76ce82f3 | ||
|
|
677ad4298c | ||
|
|
4fdbfc31ee | ||
|
|
f9aac56e84 | ||
|
|
343bbbac68 | ||
|
|
1038590489 | ||
|
|
96b1d47552 | ||
|
|
a42e2de0e0 | ||
|
|
7e10daaf14 | ||
|
|
bdda76430f | ||
|
|
0ffd0ffe18 | ||
|
|
f7b3ea03a3 | ||
|
|
689f98ea9d | ||
|
|
de1996ec3e | ||
|
|
11a1dd090c | ||
|
|
24c669f394 | ||
|
|
38363b10e3 | ||
|
|
5fcc9a6106 | ||
|
|
351ca5e726 | ||
|
|
7da4367cb7 | ||
|
|
68479fa4f8 | ||
|
|
db7b1f5903 | ||
|
|
899f50456e | ||
|
|
02aeb1c16d | ||
|
|
ad46183e23 | ||
|
|
bb6d116551 | ||
|
|
7807e677e7 | ||
|
|
54a36ff54d | ||
|
|
dc9b0fa53a | ||
|
|
f488673e80 | ||
|
|
11d9a286c1 | ||
|
|
0928f049bb | ||
|
|
f254107b24 | ||
|
|
a3e1a24947 | ||
|
|
f2db393923 | ||
|
|
f1cd05c1e0 | ||
|
|
6f4ee013d2 | ||
|
|
f994140a3c | ||
|
|
c73cada3f4 | ||
|
|
727b368df3 | ||
|
|
57eef276cb | ||
|
|
880d768729 | ||
|
|
52cf61de97 | ||
|
|
6cb04bb43a | ||
|
|
e4c44dd0a9 | ||
|
|
ea784f2b4b | ||
|
|
55ed45df8d | ||
|
|
30427be126 | ||
|
|
ebbc7fadd0 | ||
|
|
2160f8758c | ||
|
|
0604e146ff | ||
|
|
e7a221278c | ||
|
|
a60ac11320 | ||
|
|
596736afae | ||
|
|
c14dd7ffbb | ||
|
|
7576e3fa52 | ||
|
|
68b86d5f6f | ||
|
|
83b2f1c01c | ||
|
|
a3f5e632ea | ||
|
|
c5b3aaa2dd | ||
|
|
9a8ea23f9f | ||
|
|
20fd63b1e2 | ||
|
|
ef5ff53ecf | ||
|
|
0889d79969 | ||
|
|
861d06e855 | ||
|
|
c8267c2cf9 | ||
|
|
e2a1b98658 | ||
|
|
fad303fe37 | ||
|
|
2bf209e469 | ||
|
|
7813e898ba | ||
|
|
e2741d2b3d | ||
|
|
e35921cf96 | ||
|
|
72529e6c3a | ||
|
|
22da1eac0c | ||
|
|
aca606f90d | ||
|
|
fd2e093412 | ||
|
|
c03650fdc7 | ||
|
|
33b652c5df | ||
|
|
5c23af773a | ||
|
|
184d51c6ea | ||
|
|
79eb6eb4d2 | ||
|
|
6e7db95981 | ||
|
|
17dda7bd70 | ||
|
|
9cff72959a | ||
|
|
1043313175 | ||
|
|
b0798357b9 | ||
|
|
a8ab765fe5 | ||
|
|
675fd0af4e | ||
|
|
fa4a9a0cb9 | ||
|
|
a1a60dc19a | ||
|
|
5d06a1cabd | ||
|
|
afcdb1e6a9 | ||
|
|
7b4298a637 | ||
|
|
e29d500db6 | ||
|
|
1f446432f6 | ||
|
|
86599d47a9 | ||
|
|
bf678f7fb0 | ||
|
|
68fdd19cb7 | ||
|
|
597890ab61 | ||
|
|
b27984349d | ||
|
|
658aa00119 | ||
|
|
a32857885a | ||
|
|
b7a8889741 | ||
|
|
aca800dae9 | ||
|
|
7b0231f926 | ||
|
|
03232d30c2 | ||
|
|
b458c09841 | ||
|
|
8b1416b862 | ||
|
|
c5310874fa | ||
|
|
43382defec | ||
|
|
5e4f0a924d | ||
|
|
f8f149fd1b | ||
|
|
b58ecfc5d8 | ||
|
|
8b44c8bfb6 | ||
|
|
7ced1a2eb1 | ||
|
|
901c0da013 | ||
|
|
dcf3b235f5 | ||
|
|
ef719e7945 | ||
|
|
ac7cbf17e2 | ||
|
|
551f32cc20 | ||
|
|
0ab2b2b261 | ||
|
|
7bc1434733 | ||
|
|
cf45997110 | ||
|
|
eee7673893 | ||
|
|
be816fab6f | ||
|
|
fb4752a2cf | ||
|
|
3d8a21636a | ||
|
|
0f5470b913 | ||
|
|
9fa001c3c5 | ||
|
|
dbddecb775 | ||
|
|
1846c56d54 | ||
|
|
6d21972e43 | ||
|
|
8f86f38d58 | ||
|
|
5646b07870 | ||
|
|
1272cabb35 | ||
|
|
ff3c929ecf | ||
|
|
3288a6bbe4 | ||
|
|
f15b446469 | ||
|
|
b79e6bfb10 | ||
|
|
16cb7eba64 | ||
|
|
3a0d9339dc | ||
|
|
e7bca7fdac | ||
|
|
5fdc3077db | ||
|
|
9c47c860bc | ||
|
|
d54d415125 | ||
|
|
1854826053 | ||
|
|
e7a60fc992 | ||
|
|
2c83775087 | ||
|
|
8824d20cd3 | ||
|
|
846268fdd3 | ||
|
|
318e4a345e | ||
|
|
eaa3f533a5 | ||
|
|
3fe90157e6 | ||
|
|
89201888e3 | ||
|
|
d393814772 | ||
|
|
dad93fe297 | ||
|
|
6d2158f37a | ||
|
|
ece0996946 | ||
|
|
bf13e67b55 | ||
|
|
fe95f0f478 | ||
|
|
71a98a977e | ||
|
|
dbe3208302 | ||
|
|
f1f3b8a0a8 | ||
|
|
3da8cac59b | ||
|
|
8d90eda600 | ||
|
|
d943cd281d | ||
|
|
6295e57331 | ||
|
|
445524bc87 | ||
|
|
b2cc1252c6 | ||
|
|
2505f15eab | ||
|
|
485b7fc060 | ||
|
|
e56ae69bc3 | ||
|
|
e7cfe377db | ||
|
|
92bb82eb2b | ||
|
|
cd103f7c3d | ||
|
|
00f234029a | ||
|
|
727e29e3c0 | ||
|
|
3e99c7aa97 | ||
|
|
71e7f9713a | ||
|
|
da50d68b06 | ||
|
|
b04f3b54a4 | ||
|
|
45302792ee | ||
|
|
963805820c | ||
|
|
5a61f9944c | ||
|
|
1a8d81ba57 | ||
|
|
d45572446c | ||
|
|
f58d4aa05f | ||
|
|
8a89a16fde | ||
|
|
45655197eb | ||
|
|
957cdbab48 | ||
|
|
bcaabe513f | ||
|
|
822416e9e2 | ||
|
|
54cf2d9aef | ||
|
|
ac95f89aa5 | ||
|
|
23f5628735 | ||
|
|
4924b18ebd | ||
|
|
8cace6537e | ||
|
|
307e2f299a | ||
|
|
2f8dc35583 | ||
|
|
26d68e9c5e | ||
|
|
7f03a6e32a | ||
|
|
57a9156f88 | ||
|
|
1f9a6c1369 | ||
|
|
7d8d1588c3 | ||
|
|
4b02d81839 | ||
|
|
95f677f735 | ||
|
|
3d1b8a9cef | ||
|
|
af6ca15020 | ||
|
|
c9f89db89b | ||
|
|
87fb55c792 | ||
|
|
dab82a2705 | ||
|
|
5808ce3934 | ||
|
|
9f31d41b44 | ||
|
|
699bbcb80f | ||
|
|
0504659eb8 | ||
|
|
4b39203763 | ||
|
|
cb4dc53042 | ||
|
|
2d975ca61b | ||
|
|
2f4c21ced3 | ||
|
|
1008080e31 | ||
|
|
5d91a36ebc | ||
|
|
59623646cf | ||
|
|
497a3275c6 | ||
|
|
56a32a22d4 | ||
|
|
869b9a5c6f | ||
|
|
19509f08eb | ||
|
|
ea3aecf486 | ||
|
|
a53e22c294 | ||
|
|
c80246a9a5 | ||
|
|
2194bc8564 | ||
|
|
e6be94eca2 | ||
|
|
bf601fce71 | ||
|
|
de35844c42 | ||
|
|
d82ebce55b | ||
|
|
897d3c49df | ||
|
|
4c0a8f88f9 | ||
|
|
1ba0155944 | ||
|
|
7b9422a8c5 | ||
|
|
831ce2e910 | ||
|
|
5eac636b34 | ||
|
|
ebecb55733 | ||
|
|
c641f334bb | ||
|
|
19a2b37c75 | ||
|
|
5a461002a1 | ||
|
|
bba24dc2fa | ||
|
|
2974c20c69 | ||
|
|
dcdda7ba35 | ||
|
|
4898d609e6 | ||
|
|
0684f6dda1 | ||
|
|
1bc258a729 | ||
|
|
593ebc4732 | ||
|
|
9ba0355000 | ||
|
|
89b261efe5 | ||
|
|
8fffe90dbe | ||
|
|
0efa1185f3 | ||
|
|
e8300aa944 | ||
|
|
367e076347 | ||
|
|
5c76360c2d | ||
|
|
f9f20c7300 | ||
|
|
5ece3937d4 | ||
|
|
4387070cda | ||
|
|
9c820805fa | ||
|
|
10d7599d08 | ||
|
|
069ce49e9c | ||
|
|
3ea62dbdee | ||
|
|
ba8a111ea1 | ||
|
|
d42ddeac56 | ||
|
|
863c469d35 | ||
|
|
5f028730cd | ||
|
|
f0e10b0d89 | ||
|
|
ef4aee1e28 | ||
|
|
0dcc3dceaf | ||
|
|
664d1a4b5f | ||
|
|
098a177d6f | ||
|
|
dedd3c6344 | ||
|
|
b7e2a90ef4 | ||
|
|
3efaa38394 | ||
|
|
260a2a7d3d | ||
|
|
d9d28e3209 | ||
|
|
1547a45eae | ||
|
|
0105373cdc | ||
|
|
b44c83ef46 | ||
|
|
23b5b6ac20 | ||
|
|
13c8931bf2 | ||
|
|
a6db17ffcd | ||
|
|
da94f64c95 | ||
|
|
573c703cd2 | ||
|
|
30d5f151c3 | ||
|
|
5d199f4500 | ||
|
|
70371e124d | ||
|
|
2efaf51280 | ||
|
|
b67c169145 | ||
|
|
38eacea022 | ||
|
|
70da4b5902 | ||
|
|
f59a509ec7 | ||
|
|
f0376d1b4f | ||
|
|
dea858849e | ||
|
|
cfec3ffd56 | ||
|
|
3e550e02ef | ||
|
|
6acfbe21e1 | ||
|
|
aebb015981 | ||
|
|
d6dfd5f82f | ||
|
|
1471846030 | ||
|
|
296ea0571c | ||
|
|
ac7c131baf | ||
|
|
cb14cd7bf9 | ||
|
|
c6169f0fd3 | ||
|
|
f459f811f5 | ||
|
|
04fe22d8e2 | ||
|
|
d8c8503234 | ||
|
|
7d782a4a46 | ||
|
|
f6911c934b | ||
|
|
61128d7737 | ||
|
|
eb610af36b | ||
|
|
b3ab7bc58f | ||
|
|
67c37417b6 | ||
|
|
52a3053ac0 | ||
|
|
764d6fc068 | ||
|
|
baf5926a67 | ||
|
|
d69390c273 | ||
|
|
1c1a01adfd | ||
|
|
d1f7346c08 | ||
|
|
cabb4561d5 | ||
|
|
da47348373 | ||
|
|
9c4f9caa08 | ||
|
|
90476be196 | ||
|
|
663b1d8b7b | ||
|
|
409eadc937 | ||
|
|
7c27e09fcd | ||
|
|
22e7b1e6da | ||
|
|
79b11d6b93 | ||
|
|
d82a0d900d | ||
|
|
7ac9d2ab81 | ||
|
|
741c87c0d9 | ||
|
|
3651852e16 | ||
|
|
9f1828be32 | ||
|
|
9c87e73b2d | ||
|
|
f5678be960 | ||
|
|
2407b4afe6 | ||
|
|
d174e15ac8 | ||
|
|
22911600a8 | ||
|
|
ac0d39af37 | ||
|
|
6b99b1b1e4 | ||
|
|
8950c6ddd3 | ||
|
|
69e90fa6cb | ||
|
|
ad859ddf5e | ||
|
|
81177a8a73 | ||
|
|
29bc996641 | ||
|
|
3f6c5430a2 | ||
|
|
8d5dc07a15 | ||
|
|
34bc087707 | ||
|
|
c8420152de | ||
|
|
caef8c6e56 | ||
|
|
c84ddacd00 | ||
|
|
ecee5edcce | ||
|
|
ccba43e2f0 | ||
|
|
85ce7de775 | ||
|
|
2466f16ec3 | ||
|
|
5487c709b1 | ||
|
|
2dc1a602c6 | ||
|
|
23c54b8db4 |
357
ci-scripts/Jenkinsfile-gitlab
Normal file
357
ci-scripts/Jenkinsfile-gitlab
Normal file
@@ -0,0 +1,357 @@
|
||||
#!/bin/groovy
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
// Abstraction function to send social media messages:
|
||||
// like on Slack or Mattermost
|
||||
def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) {
|
||||
if (params.pipelineUsesSlack != null) {
|
||||
if (params.pipelineUsesSlack) {
|
||||
slackSend channel: pipeChannel, color: pipeColor, message: pipeMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def doRedHatBuild = false
|
||||
def FDD_Band7_B210_Status
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label 'bellatrix'
|
||||
}
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
timestamps()
|
||||
gitLabConnection('OAI GitLab')
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Build eNb-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test-FDD-Band7"])
|
||||
ansiColor('xterm')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage ("Verify Parameters") {
|
||||
steps {
|
||||
script {
|
||||
echo '\u2705 \u001B[32mVerify Parameters\u001B[0m'
|
||||
def allParametersPresent = true
|
||||
|
||||
if (params.RedHatRemoteServer == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.RedHatRemoteCredentials == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.RedHatWorkingPath == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (allParametersPresent) {
|
||||
echo "Performing Red Hat Build"
|
||||
doRedHatBuild = true
|
||||
} else {
|
||||
doRedHatBuild = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Verify Guidelines") {
|
||||
steps {
|
||||
echo "Git URL is ${GIT_URL}"
|
||||
echo "GitLab Act is ${env.gitlabActionType}"
|
||||
script {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
// GitLab-Jenkins plugin integration is lacking to perform the merge by itself
|
||||
// Doing it manually --> it may have merge conflicts
|
||||
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
sh "zip -r -qq localZip.zip ."
|
||||
|
||||
// Running astyle options on the list of modified files by the merge request
|
||||
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
|
||||
sh "./ci-scripts/checkCodingFormattingRules.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
|
||||
def res=readFile('./oai_rules_result.txt').trim();
|
||||
if ("0".equals(res)) {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): All Changed files in Merge Request follow OAI Formatting Rules"
|
||||
addGitLabMRComment comment: message
|
||||
} else {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
|
||||
addGitLabMRComment comment: message
|
||||
}
|
||||
} else {
|
||||
echo "Git Branch is ${GIT_BRANCH}"
|
||||
echo "Git Commit is ${GIT_COMMIT}"
|
||||
|
||||
sh "zip -r -qq localZip.zip ."
|
||||
// Running astyle options on all C/H files in the repository
|
||||
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
|
||||
sh "./ci-scripts/checkCodingFormattingRules.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI"
|
||||
addGitLabMRComment comment: message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- cppcheck") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- enb-usrp") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- basic-sim") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- phy-sim") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- enb-ethernet") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- ue-ethernet") {
|
||||
steps {
|
||||
sh "./ci-scripts/createVM.sh --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Variant Builds") {
|
||||
parallel {
|
||||
stage ("Analysis with cppcheck") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Analysis with cppcheck") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNb-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNb-USRP") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build basic simulator") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build basic-sim") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build physical simulators") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build phy-sim") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNb-ethernet") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNb-ethernet") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build UE-ethernet") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build UE-ethernet") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNb-USRP on Red Hat") {
|
||||
when {
|
||||
expression {doRedHatBuild}
|
||||
}
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNb-USRP-CentOS") {
|
||||
script {
|
||||
try {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.RedHatRemoteCredentials}", usernameVariable: 'RH_Username', passwordVariable: 'RH_Password']
|
||||
]) {
|
||||
sh "./ci-scripts/buildOnRH.sh --workspace $WORKSPACE --job-name ${JOB_NAME} --build-id ${BUILD_ID} --remote-host ${params.RedHatRemoteServer} --remote-path ${params.RedHatWorkingPath} --remote-user-name ${RH_Username} --remote-password ${RH_Password}"
|
||||
}
|
||||
} catch (Exception e) {
|
||||
echo "Red Hat build failed not an error now"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
dir ('archives') {
|
||||
sh "zip -r -qq vm_build_logs.zip basic_sim enb_usrp phy_sim cppcheck enb_eth ue_eth red_hat"
|
||||
}
|
||||
if(fileExists('archives/vm_build_logs.zip')) {
|
||||
archiveArtifacts artifacts: 'archives/vm_build_logs.zip'
|
||||
}
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
sh "./ci-scripts/checkAddedWarnings.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
|
||||
def res=readFile('./oai_warning_files.txt').trim();
|
||||
if ("0".equals(res)) {
|
||||
echo "No issues w/ warnings/errors in this merge request"
|
||||
} else {
|
||||
def fileList=readFile('./oai_warning_files_list.txt').trim();
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some modified files in Merge Request MAY have INTRODUCED WARNINGS (" + fileList + ")"
|
||||
addGitLabMRComment comment: message
|
||||
}
|
||||
} else {
|
||||
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
|
||||
}
|
||||
if(fileExists('build_results.html')) {
|
||||
archiveArtifacts artifacts: 'build_results.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Variant Tests") {
|
||||
parallel {
|
||||
stage ("Test physical simulators") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Test phy-sim") {
|
||||
sh "./ci-scripts/runTestOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test basic simulator") {
|
||||
steps {
|
||||
//gitlabCommitStatus(name: "Test basic-sim") {
|
||||
sh "./ci-scripts/runTestOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
//}
|
||||
}
|
||||
}
|
||||
stage ("Test FDD - Band 7 - B210") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Test-FDD-Band7") {
|
||||
script {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
FDD_Band7_B210_Status = build job: 'eNB-CI-FDD-Band7-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
|
||||
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
|
||||
booleanParam(name: 'eNB_mergeRequest', value: true)
|
||||
]
|
||||
} else {
|
||||
FDD_Band7_B210_Status = build job: 'eNB-CI-FDD-Band7-B210',
|
||||
parameters: [
|
||||
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
|
||||
string(name: 'eNB_Branch', value: String.valueOf(GIT_BRANCH)),
|
||||
string(name: 'eNB_CommitID', value: String.valueOf(GIT_COMMIT)),
|
||||
booleanParam(name: 'eNB_mergeRequest', value: false)
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
copyArtifacts(projectName: 'eNB-CI-FDD-Band7-B210',
|
||||
filter: 'test_results*.html',
|
||||
selector: specific("${FDD_Band7_B210_Status.number}"))
|
||||
if (fileExists('test_results-eNB-CI-FDD-Band7-B210.html')) {
|
||||
archiveArtifacts artifacts: 'test_results-eNB-CI-FDD-Band7-B210.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
dir ('archives') {
|
||||
sh "if [ -d */test ]; then zip -r -qq vm_tests_logs.zip */test ; fi"
|
||||
}
|
||||
if(fileExists('archives/vm_tests_logs.zip')) {
|
||||
archiveArtifacts artifacts: 'archives/vm_tests_logs.zip'
|
||||
archiveArtifacts artifacts: 'archives/*/test/results_autotests*.xml'
|
||||
archiveArtifacts artifacts: 'archives/*/test/*.xsl'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Destroy all Virtual Machines") {
|
||||
steps {
|
||||
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
// Stage destroy may not be run if error in previous stage
|
||||
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
success {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")"
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
echo "This is a MERGE event"
|
||||
addGitLabMRComment comment: message
|
||||
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
|
||||
sendSocialMediaMessage('ci-enb', 'good', message2)
|
||||
} else {
|
||||
sendSocialMediaMessage('ci-enb', 'good', message)
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
echo "This is a MERGE event"
|
||||
addGitLabMRComment comment: message
|
||||
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
|
||||
sendSocialMediaMessage('ci-enb', 'danger', message2)
|
||||
} else {
|
||||
sendSocialMediaMessage('ci-enb', 'danger', message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
479
ci-scripts/Jenkinsfile-tmp-ran
Normal file
479
ci-scripts/Jenkinsfile-tmp-ran
Normal file
@@ -0,0 +1,479 @@
|
||||
#!/bin/groovy
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
// Template Jenkins Declarative Pipeline script to run Test w/ RF HW
|
||||
|
||||
// Location of the python executor node shall be in the same subnet as the others servers
|
||||
def pythonExecutor = params.pythonExecutor
|
||||
|
||||
// Location of the test XML file to be run
|
||||
def testXMLFile = params.pythonTestXmlFile
|
||||
|
||||
// Name of the test stage
|
||||
def testStageName = params.pipelineTestStageName
|
||||
|
||||
// Terminate Status
|
||||
def termUE = 0
|
||||
def termENB = 1
|
||||
def termSPGW = 2
|
||||
def termMME = 3
|
||||
def termHSS = 4
|
||||
def termStatusArray = new Boolean[termHSS + 1]
|
||||
termStatusArray[termUE] = false
|
||||
termStatusArray[termENB] = false
|
||||
termStatusArray[termSPGW] = false
|
||||
termStatusArray[termMME] = false
|
||||
termStatusArray[termHSS] = false
|
||||
|
||||
// Global Parameters. Normally they should be populated when the master job
|
||||
// triggers the slave job with parameters
|
||||
def eNB_Repository
|
||||
def eNB_Branch
|
||||
def eNB_CommitID
|
||||
def eNB_AllowMergeRequestProcess = false
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label pythonExecutor
|
||||
}
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
timestamps()
|
||||
ansiColor('xterm')
|
||||
}
|
||||
// the following parameter options are commented out so it shows the ones
|
||||
// that you SHALL have to run the job.
|
||||
// You can use them as template
|
||||
/*
|
||||
parameters {
|
||||
//node-test parameters
|
||||
string(name: 'pythonExecutor', defaultValue: 'nodea', description: 'Node where the pipeline - python scripts will be executed')
|
||||
string(name: 'pythonTestXmlFile', defaultValue: 'enb_usrpB210_band7_50PRB.xml', description: 'Location of the Test XML to be run')
|
||||
string(name: 'pipelineTestStageName', defaultValue: 'Test COTS-UE - OAI eNB - LTEBOX EPC', description: 'Naming of the Test Stage')
|
||||
booleanParam(name: 'pipelineZipsConsoleLog', defaultValue: 'True', description: 'If true, the pipeline script retrieves the job console log, zips it and archives it as artifact')
|
||||
|
||||
//eNB parameters
|
||||
string(name: 'eNB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of eNB')
|
||||
credentials(name: 'eNB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for eNB')
|
||||
string(name: 'eNB_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of eNB source code')
|
||||
|
||||
//EPC parameters
|
||||
string(name: 'EPC_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of EPC')
|
||||
string(name: 'EPC_Type', defaultValue: 'ltebox', description: 'EPC type: OAI or ltebox')
|
||||
credentials(name: 'EPC_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for EPC')
|
||||
string(name: 'EPC_SourceCodePath', defaultValue: '/tmp/CI-enb', description: 'Full path of EPC source code')
|
||||
|
||||
//ADB server parameters
|
||||
string(name: 'ADB_IPAddress', defaultValue: '192.168.XX.XX', description: 'IP Address of ADB server')
|
||||
credentials(name: 'ADB_Credentials', defaultValue: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', credentialType: "Username with password", required: true, description: 'Credentials for ADB')
|
||||
}
|
||||
*/
|
||||
|
||||
stages {
|
||||
stage ("Verify Parameters") {
|
||||
steps {
|
||||
script {
|
||||
echo '\u2705 \u001B[32mVerify Parameters\u001B[0m'
|
||||
def allParametersPresent = true
|
||||
|
||||
// It is already to late to check it
|
||||
if (params.pythonExecutor != null) {
|
||||
echo "eNB CI executor node : ${pythonExecutor}"
|
||||
}
|
||||
// If not present picking a default XML file
|
||||
if (params.pythonTestXmlFile == null) {
|
||||
// picking default
|
||||
testXMLFile = 'xml_files/enb_usrpB210_band7_50PRB.xml'
|
||||
} else {
|
||||
echo "Test XML file : ${testXMLFile}"
|
||||
}
|
||||
// If not present picking a default Stage Name
|
||||
if (params.pipelineTestStageName == null) {
|
||||
// picking default
|
||||
testStageName = 'Template Test Stage'
|
||||
}
|
||||
|
||||
if (params.eNB_IPAddress == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.eNB_SourceCodePath == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.eNB_Credentials == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
// the following 4 parameters should be pushed by the master trigger
|
||||
// if not present, take the job GIT variables (used for developing)
|
||||
if (params.eNB_Repository == null) {
|
||||
eNB_Repository = env.GIT_URL
|
||||
} else {
|
||||
eNB_Repository = params.eNB_Repository
|
||||
}
|
||||
echo "eNB_Repository : ${eNB_Repository}"
|
||||
if (params.eNB_Branch == null) {
|
||||
eNB_Branch = env.GIT_BRANCH
|
||||
} else {
|
||||
eNB_Branch = params.eNB_Branch
|
||||
}
|
||||
echo "eNB_Branch : ${eNB_Branch}"
|
||||
if (params.eNB_CommitID == null) {
|
||||
eNB_CommitID = env.GIT_COMMIT
|
||||
} else {
|
||||
eNB_CommitID = params.eNB_CommitID
|
||||
}
|
||||
echo "eNB_CommitID : ${eNB_CommitID}"
|
||||
if (params.eNB_mergeRequest != null) {
|
||||
eNB_AllowMergeRequestProcess = params.eNB_mergeRequest
|
||||
}
|
||||
|
||||
if (params.EPC_IPAddress == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.EPC_Type == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.EPC_SourceCodePath == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.EPC_Credentials == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
|
||||
if (params.ADB_IPAddress == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.ADB_Credentials == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
|
||||
if (allParametersPresent) {
|
||||
echo "All parameters are present"
|
||||
} else {
|
||||
echo "Some parameters are missing"
|
||||
sh "./ci-scripts/fail.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build and Test") {
|
||||
steps {
|
||||
script {
|
||||
dir ('ci-scripts') {
|
||||
try {
|
||||
echo "\u2705 \u001B[32m${testStageName}\u001B[0m"
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'],
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'],
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
|
||||
]) {
|
||||
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --EPCIPAddress=${params.EPC_IPAddress} --EPCType=${params.EPC_Type} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --XMLTestFile=${testXMLFile}"
|
||||
}
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Terminate") {
|
||||
parallel {
|
||||
stage('Terminate UE') {
|
||||
steps {
|
||||
echo '\u2705 \u001B[32mTerminate UE\u001B[0m'
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateUE --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password}"
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
termStatusArray[termUE] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Terminate eNB') {
|
||||
steps {
|
||||
echo '\u2705 \u001B[32mTerminate eNB\u001B[0m'
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateeNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}"
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
termStatusArray[termENB] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Terminate SPGW') {
|
||||
steps {
|
||||
echo '\u2705 \u001B[32mTerminate SPGW\u001B[0m'
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
termStatusArray[termSPGW] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Terminate MME') {
|
||||
steps {
|
||||
echo '\u2705 \u001B[32mTerminate MME\u001B[0m'
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
termStatusArray[termMME] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Terminate HSS') {
|
||||
steps {
|
||||
echo '\u2705 \u001B[32mTerminate HSS\u001B[0m'
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
termStatusArray[termHSS] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection') {
|
||||
parallel {
|
||||
stage('Log Collection (eNB - Build)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (eNB - Build)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectBuild --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (eNB - Build)\u001B[0m'
|
||||
sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("build.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "build.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (eNB - Run)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (eNB - Run)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollecteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (eNB - Run)\u001B[0m'
|
||||
sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/enb.log.zip ./enb.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("enb.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "enb.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
if(fileExists("ci-scripts/test_results.html")) {
|
||||
sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html"
|
||||
sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's#TEMPLATE_BUILD_ID#${BUILD_ID}#' test_results-${JOB_NAME}.html"
|
||||
archiveArtifacts "test_results-${JOB_NAME}.html"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (SPGW)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (SPGW)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (SPGW)\u001B[0m'
|
||||
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/spgw.log.zip ./spgw.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("spgw.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "spgw.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (MME)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (MME)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (MME)\u001B[0m'
|
||||
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/mme.log.zip ./mme.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("mme.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "mme.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (HSS)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (HSS)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (HSS)\u001B[0m'
|
||||
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/hss.log.zip ./hss.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("hss.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "hss.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (Ping)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (Ping)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectPing --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (Ping)\u001B[0m'
|
||||
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/ping.log.zip ./ping.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("ping.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "ping.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (Iperf)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (Iperf)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectIperf --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=${params.EPC_SourceCodePath} --EPCType=${params.EPC_Type}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (Iperf)\u001B[0m'
|
||||
sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/scripts/iperf.log.zip ./iperf.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("iperf.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "iperf.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
if (params.pipelineZipsConsoleLog != null) {
|
||||
if (params.pipelineZipsConsoleLog) {
|
||||
echo "Archiving Jenkins console log"
|
||||
sh "wget --no-check-certificate --no-proxy ${env.JENKINS_URL}/job/${env.JOB_NAME}/${env.BUILD_ID}/consoleText -O consoleText.log || true"
|
||||
sh "zip -m consoleText.log.${env.BUILD_ID}.zip consoleText.log || true"
|
||||
if(fileExists("consoleText.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "consoleText.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Making sure that we really shutdown every thing before leaving
|
||||
failure {
|
||||
script {
|
||||
if (!termStatusArray[termUE]) {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateUE --ADBIPAddress=${params.ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password}"
|
||||
}
|
||||
}
|
||||
if (!termStatusArray[termENB]) {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateeNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}"
|
||||
}
|
||||
}
|
||||
if (!termStatusArray[termSPGW]) {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
|
||||
}
|
||||
}
|
||||
if (!termStatusArray[termMME]) {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
|
||||
}
|
||||
}
|
||||
if (!termStatusArray[termHSS]) {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=TerminateHSS --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
20
ci-scripts/astyle-options.txt
Normal file
20
ci-scripts/astyle-options.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# OAI is using a style that is similar to the Google style
|
||||
--style=google
|
||||
# long options can be written without the preceding '--'
|
||||
# Convert tabs to spaces
|
||||
convert-tabs
|
||||
# Indentation is 2 spaces
|
||||
indent=spaces=2
|
||||
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
|
||||
indent-switches
|
||||
# Indent C++ comments beginning in column one.
|
||||
indent-col1-comments
|
||||
# Pad empty lines around header blocks
|
||||
break-blocks
|
||||
delete-empty-lines
|
||||
# Attach a pointer or reference operator (*, &, or ^) to the variable name (right)
|
||||
align-pointer=name
|
||||
# The code line length is 200 characters/columns
|
||||
max-code-length=200
|
||||
break-after-logical
|
||||
lineend=linux
|
||||
209
ci-scripts/buildOnRH.sh
Executable file
209
ci-scripts/buildOnRH.sh
Executable file
@@ -0,0 +1,209 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI RedHat Build Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " buildOnRH.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --workspace #### OR -ws ####"
|
||||
echo " Specify the workspace."
|
||||
echo ""
|
||||
echo " --remote-host #### OR -rh ####"
|
||||
echo " Specify the RedHat remote server."
|
||||
echo ""
|
||||
echo " --remote-user-name #### OR -ru ####"
|
||||
echo " Specify the RedHat remote server username."
|
||||
echo ""
|
||||
echo " --remote-password #### OR -rp ####"
|
||||
echo " Specify the RedHat remote server password."
|
||||
echo ""
|
||||
echo " --remote-path #### OR -ra ####"
|
||||
echo " Specify the RedHat remote server path to work on."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ] || [ $# -gt 14 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RH_HOST=XX
|
||||
RH_USER=XX
|
||||
RH_PASSWD=XX
|
||||
RH_PATH=XX
|
||||
JOB_NAME=XX
|
||||
BUILD_ID=XX
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-ws|--workspace)
|
||||
JENKINS_WKSP="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-rh|--remote-host)
|
||||
RH_HOST="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-ru|--remote-user-name)
|
||||
RH_USER="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-rp|--remote-password)
|
||||
RH_PASSWD="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-ra|--remote-path)
|
||||
RH_PATH="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -f $JENKINS_WKSP/localZip.zip ]
|
||||
then
|
||||
echo "Missing localZip.zip file!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ] || [ "$RH_HOST" == "XX" ] || [ "$RH_USER" == "XX" ] || [ "$RH_PASSWD" == "XX" ] || [ "$RH_PATH" == "XX" ]
|
||||
then
|
||||
echo "Missing options"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "Copying GIT repo into RedHat Server"
|
||||
echo "############################################################"
|
||||
echo "rm -Rf ${RH_PATH}" >> rh-cmd.txt
|
||||
echo "mkdir -p ${RH_PATH}" >> rh-cmd.txt
|
||||
|
||||
sshpass -p ${RH_PASSWD} ssh -o 'StrictHostKeyChecking no' ${RH_USER}@${RH_HOST} < rh-cmd.txt
|
||||
rm -f rh-cmd.txt
|
||||
|
||||
echo "############################################################"
|
||||
echo "Running install and build script on RedHat Server"
|
||||
echo "############################################################"
|
||||
sshpass -p ${RH_PASSWD} scp -o 'StrictHostKeyChecking no' $JENKINS_WKSP/localZip.zip ${RH_USER}@${RH_HOST}:${RH_PATH}
|
||||
|
||||
echo "cd ${RH_PATH}" > rh-cmd.txt
|
||||
echo "unzip -qq localZip.zip" >> rh-cmd.txt
|
||||
echo "source oaienv" >> rh-cmd.txt
|
||||
echo "cd cmake_targets" >> rh-cmd.txt
|
||||
echo "mkdir -p log" >> rh-cmd.txt
|
||||
echo "./build_oai -I -w USRP --eNB > log/install-build.txt 2>&1" >> rh-cmd.txt
|
||||
sshpass -p ${RH_PASSWD} ssh -o 'StrictHostKeyChecking no' ${RH_USER}@${RH_HOST} < rh-cmd.txt
|
||||
|
||||
rm -f rh-cmd.txt
|
||||
|
||||
echo "############################################################"
|
||||
echo "Creating a tmp folder to store results and artifacts"
|
||||
echo "############################################################"
|
||||
if [ ! -d $JENKINS_WKSP/archives ]
|
||||
then
|
||||
mkdir -p $JENKINS_WKSP/archives
|
||||
fi
|
||||
|
||||
ARCHIVES_LOC=$JENKINS_WKSP/archives/red_hat
|
||||
if [ ! -d $ARCHIVES_LOC ]
|
||||
then
|
||||
mkdir -p $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
sshpass -p ${RH_PASSWD} scp -o 'StrictHostKeyChecking no' ${RH_USER}@${RH_HOST}:${RH_PATH}/cmake_targets/log/*.txt $ARCHIVES_LOC
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking build status"
|
||||
echo "############################################################"
|
||||
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
|
||||
LOG_FILES=`ls $ARCHIVES_LOC/*.txt`
|
||||
STATUS=0
|
||||
NB_FOUND_FILES=0
|
||||
|
||||
for FULLFILE in $LOG_FILES
|
||||
do
|
||||
if [[ $FULLFILE == *"$LOG_PATTERN"* ]]
|
||||
then
|
||||
filename=$(basename -- "$FULLFILE")
|
||||
PASS_PATTERN=`echo $filename | sed -e "s#$LOG_PATTERN##"`
|
||||
LOCAL_STAT=`egrep -c "Built target $PASS_PATTERN" $FULLFILE`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
NB_FOUND_FILES=$((NB_FOUND_FILES + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi
|
||||
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "STATUS seems OK"
|
||||
else
|
||||
echo "STATUS failed?"
|
||||
fi
|
||||
exit $STATUS
|
||||
393
ci-scripts/buildOnVM.sh
Executable file
393
ci-scripts/buildOnVM.sh
Executable file
@@ -0,0 +1,393 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI VM Build Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo " Requirements:"
|
||||
echo " -- uvtool uvtool-libvirt apt-cacher"
|
||||
echo " -- xenial image already synced"
|
||||
echo " Default:"
|
||||
echo " -- eNB with USRP"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " buildOnVM.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --workspace #### OR -ws ####"
|
||||
echo " Specify the workspace."
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo " Specify the variant to build."
|
||||
echo ""
|
||||
echo " --keep-vm-alive OR -k"
|
||||
echo " Keep the VM alive after the build."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function variant_usage {
|
||||
echo "OAI VM Build Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ] || [ $# -gt 9 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VM_TEMPLATE=ci-
|
||||
JOB_NAME=XX
|
||||
BUILD_ID=XX
|
||||
VM_NAME=ci-enb-usrp
|
||||
VM_MEMORY=2048
|
||||
ARCHIVES_LOC=enb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--eNB -w USRP"
|
||||
KEEP_VM_ALIVE=0
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-ws|--workspace)
|
||||
JENKINS_WKSP="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-k|--keep-vm-alive)
|
||||
KEEP_VM_ALIVE=1
|
||||
shift
|
||||
;;
|
||||
-v1)
|
||||
VM_NAME=ci-enb-usrp
|
||||
ARCHIVES_LOC=enb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--eNB -w USRP"
|
||||
shift
|
||||
;;
|
||||
-v2)
|
||||
VM_NAME=ci-basic-sim
|
||||
ARCHIVES_LOC=basic_sim
|
||||
LOG_PATTERN=basic_simulator
|
||||
NB_PATTERN_FILES=2
|
||||
BUILD_OPTIONS="--basic-simulator"
|
||||
shift
|
||||
;;
|
||||
-v3)
|
||||
VM_NAME=ci-phy-sim
|
||||
ARCHIVES_LOC=phy_sim
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=3
|
||||
BUILD_OPTIONS="--phy_simulators"
|
||||
shift
|
||||
;;
|
||||
-v4)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
ARCHIVES_LOC=cppcheck
|
||||
LOG_PATTERN=cppcheck.xml
|
||||
NB_PATTERN_FILES=1
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2"
|
||||
shift
|
||||
;;
|
||||
-v7)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
ARCHIVES_LOC=enb_eth
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=6
|
||||
BUILD_OPTIONS="--eNB -t ETHERNET --noS1"
|
||||
shift
|
||||
;;
|
||||
-v8)
|
||||
VM_NAME=ci-ue-ethernet
|
||||
ARCHIVES_LOC=ue_eth
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=6
|
||||
BUILD_OPTIONS="--UE -t ETHERNET --noS1"
|
||||
shift
|
||||
;;
|
||||
--variant)
|
||||
variant="$2"
|
||||
case $variant in
|
||||
enb-usrp)
|
||||
VM_NAME=ci-enb-usrp
|
||||
ARCHIVES_LOC=enb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--eNB -w USRP"
|
||||
;;
|
||||
basic-sim)
|
||||
VM_NAME=ci-basic-sim
|
||||
ARCHIVES_LOC=basic_sim
|
||||
LOG_PATTERN=basic_simulator
|
||||
NB_PATTERN_FILES=2
|
||||
BUILD_OPTIONS="--basic-simulator"
|
||||
;;
|
||||
phy-sim)
|
||||
VM_NAME=ci-phy-sim
|
||||
ARCHIVES_LOC=phy_sim
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=3
|
||||
BUILD_OPTIONS="--phy_simulators"
|
||||
;;
|
||||
cppcheck)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
ARCHIVES_LOC=cppcheck
|
||||
LOG_PATTERN=cppcheck.xml
|
||||
NB_PATTERN_FILES=1
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2"
|
||||
;;
|
||||
enb-ethernet)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
ARCHIVES_LOC=enb_eth
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=6
|
||||
BUILD_OPTIONS="--eNB -t ETHERNET --noS1"
|
||||
;;
|
||||
ue-ethernet)
|
||||
VM_NAME=ci-ue-ethernet
|
||||
ARCHIVES_LOC=ue_eth
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=6
|
||||
BUILD_OPTIONS="--UE -t ETHERNET --noS1"
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "Syntax Error: Invalid Variant option -> $variant"
|
||||
echo ""
|
||||
variant_usage
|
||||
exit 1
|
||||
esac
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -f $JENKINS_WKSP/localZip.zip ]
|
||||
then
|
||||
echo "Missing localZip.zip file!"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f /etc/apt/apt.conf.d/01proxy ]
|
||||
then
|
||||
echo "Missing /etc/apt/apt.conf.d/01proxy file!"
|
||||
echo "Is apt-cacher installed and configured?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ]
|
||||
then
|
||||
VM_TEMPLATE=ci-
|
||||
else
|
||||
VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}-
|
||||
fi
|
||||
|
||||
VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"`
|
||||
VM_CMDS=${VM_NAME}_cmds.txt
|
||||
ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC}
|
||||
|
||||
echo "VM_NAME = $VM_NAME"
|
||||
echo "VM_CMD_FILE = $VM_CMDS"
|
||||
echo "JENKINS_WKSP = $JENKINS_WKSP"
|
||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
||||
|
||||
IS_VM_ALIVE=`uvt-kvm list | grep -c $VM_NAME`
|
||||
|
||||
if [ $IS_VM_ALIVE -eq 0 ]
|
||||
then
|
||||
echo "############################################################"
|
||||
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
|
||||
echo "############################################################"
|
||||
uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu 4 --unsafe-caching --template ci-scripts/template-host.xml
|
||||
fi
|
||||
|
||||
echo "Waiting for VM to be started"
|
||||
uvt-kvm wait $VM_NAME --insecure
|
||||
|
||||
VM_IP_ADDR=`uvt-kvm ip $VM_NAME`
|
||||
echo "$VM_NAME has for IP addr = $VM_IP_ADDR"
|
||||
|
||||
echo "############################################################"
|
||||
echo "Copying GIT repo into VM ($VM_NAME)"
|
||||
echo "############################################################"
|
||||
scp -o StrictHostKeyChecking=no localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu
|
||||
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
|
||||
|
||||
echo "############################################################"
|
||||
echo "Running install and build script on VM ($VM_NAME)"
|
||||
echo "############################################################"
|
||||
echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
then
|
||||
echo "echo \"sudo apt-get --yes --quiet install zip cppcheck \"" >> $VM_CMDS
|
||||
echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS
|
||||
echo "sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS
|
||||
else
|
||||
echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS
|
||||
echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS
|
||||
echo "sudo apt-get --yes install zip subversion libboost-dev >> zip-install.txt 2>&1" >> $VM_CMDS
|
||||
fi
|
||||
echo "mkdir tmp" >> $VM_CMDS
|
||||
echo "cd tmp" >> $VM_CMDS
|
||||
echo "echo \"unzip -qq -DD ../localZip.zip\"" >> $VM_CMDS
|
||||
echo "unzip -qq -DD ../localZip.zip" >> $VM_CMDS
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
then
|
||||
echo "mkdir cmake_targets/log" >> $VM_CMDS
|
||||
echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS
|
||||
echo "echo \"cppcheck $BUILD_OPTIONS . \"" >> $VM_CMDS
|
||||
echo "cppcheck $BUILD_OPTIONS . 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt" >> $VM_CMDS
|
||||
else
|
||||
echo "echo \"source oaienv\"" >> $VM_CMDS
|
||||
echo "source oaienv" >> $VM_CMDS
|
||||
echo "cd cmake_targets/" >> $VM_CMDS
|
||||
echo "mkdir log" >> $VM_CMDS
|
||||
echo "cp /home/ubuntu/zip-install.txt log" >> $VM_CMDS
|
||||
echo "echo \"./build_oai -I $BUILD_OPTIONS \"" >> $VM_CMDS
|
||||
echo "./build_oai -I $BUILD_OPTIONS > log/install-build.txt 2>&1" >> $VM_CMDS
|
||||
fi
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS
|
||||
|
||||
echo "############################################################"
|
||||
echo "Creating a tmp folder to store results and artifacts"
|
||||
echo "############################################################"
|
||||
if [ ! -d $JENKINS_WKSP/archives ]
|
||||
then
|
||||
mkdir $JENKINS_WKSP/archives
|
||||
fi
|
||||
|
||||
if [ ! -d $ARCHIVES_LOC ]
|
||||
then
|
||||
mkdir $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt $ARCHIVES_LOC
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
then
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.xml $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
if [ $KEEP_VM_ALIVE -eq 0 ]
|
||||
then
|
||||
echo "############################################################"
|
||||
echo "Destroying VM"
|
||||
echo "############################################################"
|
||||
uvt-kvm destroy $VM_NAME
|
||||
ssh-keygen -R $VM_IP_ADDR
|
||||
fi
|
||||
rm -f $VM_CMDS
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking build status"
|
||||
echo "############################################################"
|
||||
|
||||
LOG_FILES=`ls $ARCHIVES_LOC/*.txt $ARCHIVES_LOC/*.xml`
|
||||
STATUS=0
|
||||
NB_FOUND_FILES=0
|
||||
|
||||
for FULLFILE in $LOG_FILES
|
||||
do
|
||||
if [[ $FULLFILE == *"$LOG_PATTERN"* ]]
|
||||
then
|
||||
filename=$(basename -- "$FULLFILE")
|
||||
if [ "$LOG_PATTERN" == ".Rel14.txt" ]
|
||||
then
|
||||
PASS_PATTERN=`echo $filename | sed -e "s#$LOG_PATTERN##"`
|
||||
fi
|
||||
if [ "$LOG_PATTERN" == "basic_simulator" ]
|
||||
then
|
||||
PASS_PATTERN="lte-"
|
||||
fi
|
||||
if [ "$LOG_PATTERN" == "cppcheck.xml" ]
|
||||
then
|
||||
PASS_PATTERN="results version"
|
||||
LOCAL_STAT=`egrep -c "$PASS_PATTERN" $FULLFILE`
|
||||
else
|
||||
LOCAL_STAT=`egrep -c "Built target $PASS_PATTERN" $FULLFILE`
|
||||
fi
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
NB_FOUND_FILES=$((NB_FOUND_FILES + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi
|
||||
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "STATUS seems OK"
|
||||
else
|
||||
echo "STATUS failed?"
|
||||
fi
|
||||
exit $STATUS
|
||||
144
ci-scripts/checkAddedWarnings.sh
Executable file
144
ci-scripts/checkAddedWarnings.sh
Executable file
@@ -0,0 +1,144 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI Warning Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " checkAddedWarnings.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -ne 4 ] && [ $# -ne 1 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
checker=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ $checker -ne 3 ]
|
||||
then
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo ""
|
||||
echo "Syntax Error: missing option"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Merge request scenario
|
||||
|
||||
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
|
||||
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
|
||||
|
||||
echo " ---- Checking the modified files by the merge request ----"
|
||||
echo ""
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo "Merged Commit is : $MERGE_COMMMIT"
|
||||
echo "Target Init is : $TARGET_INIT_COMMIT"
|
||||
|
||||
# Retrieve the list of modified files since the latest develop commit
|
||||
MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
|
||||
NB_WARNINGS_FILES=0
|
||||
|
||||
# Retrieve list of warnings
|
||||
LIST_WARNING_FILES=`egrep "error:|warning:" archives/*/*.Rel14.txt archives/*/basic_simulator_*txt | egrep -v "jobserver unavailable|Clock skew detected.|flexran.proto" | sed -e "s#^.*/home/ubuntu/tmp/##" -e "s#^.*/tmp/CI-eNB/##" -e "s#common/utils/.*/itti#common/utils/itti#" | awk -F ":" '{print $1}' | sort | uniq`
|
||||
|
||||
echo ""
|
||||
echo "List of files that have been modified by the Merge Request AND"
|
||||
echo " that have compilation warnings/errors"
|
||||
echo "--------------------------------------------------------------------"
|
||||
declare -a ARRAYNAME
|
||||
|
||||
for FULLFILE in $MODIFIED_FILES
|
||||
do
|
||||
filename=$(basename -- "$FULLFILE")
|
||||
EXT="${filename##*.}"
|
||||
if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
|
||||
then
|
||||
for WARNING_FILE in $LIST_WARNING_FILES
|
||||
do
|
||||
if [ $FULLFILE = $WARNING_FILE ]
|
||||
then
|
||||
echo $WARNING_FILE
|
||||
ARRAYNAME[$NB_WARNINGS_FILES]=$WARNING_FILE
|
||||
NB_WARNINGS_FILES=$((NB_WARNINGS_FILES + 1))
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "NB Files impacted by warnings/errors in Merge Request: $NB_WARNINGS_FILES"
|
||||
echo $NB_WARNINGS_FILES > oai_warning_files.txt
|
||||
echo ${ARRAYNAME[*]} > oai_warning_files_list.txt
|
||||
|
||||
exit 0
|
||||
141
ci-scripts/checkCodingFormattingRules.sh
Executable file
141
ci-scripts/checkCodingFormattingRules.sh
Executable file
@@ -0,0 +1,141 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI Coding / Formatting Guideline Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " Requirement: astyle shall be installed"
|
||||
echo ""
|
||||
echo " By default (no options) the complete repository will be checked"
|
||||
echo " In case of merge request, provided source and target branch,"
|
||||
echo " the script will check only the modified files"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " checkCodingFormattingRules.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -ne 4 ] && [ $# -ne 1 ] && [ $# -ne 0 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo " ---- Checking the whole repository ----"
|
||||
echo ""
|
||||
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.c *.h | grep -c Formatted `
|
||||
echo "Nb Files that do NOT follow OAI rules: $NB_FILES_TO_FORMAT"
|
||||
echo $NB_FILES_TO_FORMAT > ./oai_rules_result.txt
|
||||
exit 0
|
||||
fi
|
||||
|
||||
checker=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ $checker -ne 3 ]
|
||||
then
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo ""
|
||||
echo "Syntax Error: missing option"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Merge request scenario
|
||||
|
||||
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
|
||||
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
|
||||
|
||||
echo " ---- Checking the modified files by the merge request ----"
|
||||
echo ""
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo "Merged Commit is : $MERGE_COMMMIT"
|
||||
echo "Target Init is : $TARGET_INIT_COMMIT"
|
||||
|
||||
# Retrieve the list of modified files since the latest develop commit
|
||||
MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
|
||||
NB_TO_FORMAT=0
|
||||
for FULLFILE in $MODIFIED_FILES
|
||||
do
|
||||
echo $FULLFILE
|
||||
filename=$(basename -- "$FULLFILE")
|
||||
EXT="${filename##*.}"
|
||||
if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
|
||||
then
|
||||
TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted `
|
||||
NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
|
||||
fi
|
||||
done
|
||||
echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
|
||||
echo $NB_TO_FORMAT > ./oai_rules_result.txt
|
||||
|
||||
exit 0
|
||||
256
ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf
Normal file
256
ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf
Normal file
@@ -0,0 +1,256 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "92";
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_eNODEB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 100;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
pbch_repetition = "FALSE";
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
//Parameters for SIB18
|
||||
rxPool_sc_CP_Len = "normal";
|
||||
rxPool_sc_Period = "sf40";
|
||||
rxPool_data_CP_Len = "normal";
|
||||
rxPool_ResourceConfig_prb_Num = 20;
|
||||
rxPool_ResourceConfig_prb_Start = 5;
|
||||
rxPool_ResourceConfig_prb_End = 44;
|
||||
rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
rxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
/* rxPool_dataHoppingConfig_hoppingParameter = 0;
|
||||
rxPool_dataHoppingConfig_numSubbands = "ns1";
|
||||
rxPool_dataHoppingConfig_rbOffset = 0;
|
||||
rxPool_commTxResourceUC-ReqAllowed = "TRUE";
|
||||
*/
|
||||
// Parameters for SIB19
|
||||
discRxPool_cp_Len = "normal"
|
||||
discRxPool_discPeriod = "rf32"
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRepetition = 2;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Start = 3;
|
||||
discRxPool_ResourceConfig_prb_End = 21;
|
||||
discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 115;
|
||||
eNB_instances = [0];
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
FLEXRAN_INTERFACE_NAME = "lo";
|
||||
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
|
||||
FLEXRAN_PORT = 2210;
|
||||
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
256
ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
Normal file
256
ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf
Normal file
@@ -0,0 +1,256 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "92";
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_eNODEB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 25;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
pbch_repetition = "FALSE";
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -25;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
//Parameters for SIB18
|
||||
rxPool_sc_CP_Len = "normal";
|
||||
rxPool_sc_Period = "sf40";
|
||||
rxPool_data_CP_Len = "normal";
|
||||
rxPool_ResourceConfig_prb_Num = 20;
|
||||
rxPool_ResourceConfig_prb_Start = 5;
|
||||
rxPool_ResourceConfig_prb_End = 44;
|
||||
rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
rxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
/* rxPool_dataHoppingConfig_hoppingParameter = 0;
|
||||
rxPool_dataHoppingConfig_numSubbands = "ns1";
|
||||
rxPool_dataHoppingConfig_rbOffset = 0;
|
||||
rxPool_commTxResourceUC-ReqAllowed = "TRUE";
|
||||
*/
|
||||
// Parameters for SIB19
|
||||
discRxPool_cp_Len = "normal"
|
||||
discRxPool_discPeriod = "rf32"
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRepetition = 2;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Start = 3;
|
||||
discRxPool_ResourceConfig_prb_End = 21;
|
||||
discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 115;
|
||||
eNB_instances = [0];
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
FLEXRAN_INTERFACE_NAME = "lo";
|
||||
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
|
||||
FLEXRAN_PORT = 2210;
|
||||
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
256
ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf
Normal file
256
ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf
Normal file
@@ -0,0 +1,256 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
eNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
eNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
mobile_country_code = "208";
|
||||
|
||||
mobile_network_code = "92";
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_eNODEB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "FDD";
|
||||
tdd_config = 3;
|
||||
tdd_config_s = 0;
|
||||
prefix_type = "NORMAL";
|
||||
eutra_band = 7;
|
||||
downlink_frequency = 2685000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 50;
|
||||
Nid_cell_mbsfn = 0;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
pbch_repetition = "FALSE";
|
||||
prach_root = 0;
|
||||
prach_config_index = 0;
|
||||
prach_high_speed = "DISABLE";
|
||||
prach_zero_correlation = 1;
|
||||
prach_freq_offset = 2;
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -27;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
pusch_enable64QAM = "DISABLE";
|
||||
pusch_hoppingMode = "interSubFrame";
|
||||
pusch_hoppingOffset = 0;
|
||||
pusch_groupHoppingEnabled = "ENABLE";
|
||||
pusch_groupAssignment = 0;
|
||||
pusch_sequenceHoppingEnabled = "DISABLE";
|
||||
pusch_nDMRS1 = 1;
|
||||
phich_duration = "NORMAL";
|
||||
phich_resource = "ONESIXTH";
|
||||
srs_enable = "DISABLE";
|
||||
/* srs_BandwidthConfig =;
|
||||
srs_SubframeConfig =;
|
||||
srs_ackNackST =;
|
||||
srs_MaxUpPts =;*/
|
||||
|
||||
pusch_p0_Nominal = -96;
|
||||
pusch_alpha = "AL1";
|
||||
pucch_p0_Nominal = -104;
|
||||
msg3_delta_Preamble = 6;
|
||||
pucch_deltaF_Format1 = "deltaF2";
|
||||
pucch_deltaF_Format1b = "deltaF3";
|
||||
pucch_deltaF_Format2 = "deltaF0";
|
||||
pucch_deltaF_Format2a = "deltaF0";
|
||||
pucch_deltaF_Format2b = "deltaF0";
|
||||
|
||||
rach_numberOfRA_Preambles = 64;
|
||||
rach_preamblesGroupAConfig = "DISABLE";
|
||||
/*
|
||||
rach_sizeOfRA_PreamblesGroupA = ;
|
||||
rach_messageSizeGroupA = ;
|
||||
rach_messagePowerOffsetGroupB = ;
|
||||
*/
|
||||
rach_powerRampingStep = 4;
|
||||
rach_preambleInitialReceivedTargetPower = -108;
|
||||
rach_preambleTransMax = 10;
|
||||
rach_raResponseWindowSize = 10;
|
||||
rach_macContentionResolutionTimer = 48;
|
||||
rach_maxHARQ_Msg3Tx = 4;
|
||||
|
||||
pcch_default_PagingCycle = 128;
|
||||
pcch_nB = "oneT";
|
||||
bcch_modificationPeriodCoeff = 2;
|
||||
ue_TimersAndConstants_t300 = 1000;
|
||||
ue_TimersAndConstants_t301 = 1000;
|
||||
ue_TimersAndConstants_t310 = 1000;
|
||||
ue_TimersAndConstants_t311 = 10000;
|
||||
ue_TimersAndConstants_n310 = 20;
|
||||
ue_TimersAndConstants_n311 = 1;
|
||||
ue_TransmissionMode = 1;
|
||||
|
||||
//Parameters for SIB18
|
||||
rxPool_sc_CP_Len = "normal";
|
||||
rxPool_sc_Period = "sf40";
|
||||
rxPool_data_CP_Len = "normal";
|
||||
rxPool_ResourceConfig_prb_Num = 20;
|
||||
rxPool_ResourceConfig_prb_Start = 5;
|
||||
rxPool_ResourceConfig_prb_End = 44;
|
||||
rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
rxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
/* rxPool_dataHoppingConfig_hoppingParameter = 0;
|
||||
rxPool_dataHoppingConfig_numSubbands = "ns1";
|
||||
rxPool_dataHoppingConfig_rbOffset = 0;
|
||||
rxPool_commTxResourceUC-ReqAllowed = "TRUE";
|
||||
*/
|
||||
// Parameters for SIB19
|
||||
discRxPool_cp_Len = "normal"
|
||||
discRxPool_discPeriod = "rf32"
|
||||
discRxPool_numRetx = 1;
|
||||
discRxPool_numRepetition = 2;
|
||||
discRxPool_ResourceConfig_prb_Num = 5;
|
||||
discRxPool_ResourceConfig_prb_Start = 3;
|
||||
discRxPool_ResourceConfig_prb_End = 21;
|
||||
discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
|
||||
discRxPool_ResourceConfig_offsetIndicator_choice = 0;
|
||||
discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
ENB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
phy_test_mode = 0;
|
||||
puSch10xSnr = 200;
|
||||
puCch10xSnr = 200;
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 115;
|
||||
eNB_instances = [0];
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_CONTROLLER :
|
||||
{
|
||||
FLEXRAN_ENABLED = "no";
|
||||
FLEXRAN_INTERFACE_NAME = "lo";
|
||||
FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
|
||||
FLEXRAN_PORT = 2210;
|
||||
FLEXRAN_CACHE = "/mnt/oai_agent_cache";
|
||||
FLEXRAN_AWAIT_RECONF = "no";
|
||||
};
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
191
ci-scripts/createVM.sh
Executable file
191
ci-scripts/createVM.sh
Executable file
@@ -0,0 +1,191 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI VM Creation script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo " Requirements:"
|
||||
echo " -- uvtool uvtool-libvirt apt-cacher"
|
||||
echo " -- xenial image already synced"
|
||||
echo " Default:"
|
||||
echo " -- eNB with USRP"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " createVM.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo " Specify the variant to build."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function variant_usage {
|
||||
echo "OAI VM Build Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ] || [ $# -gt 6 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VM_TEMPLATE=ci-
|
||||
JOB_NAME=XX
|
||||
BUILD_ID=XX
|
||||
VM_NAME=ci-enb-usrp
|
||||
VM_MEMORY=2048
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-v1)
|
||||
VM_NAME=ci-enb-usrp
|
||||
shift
|
||||
;;
|
||||
-v2)
|
||||
VM_NAME=ci-basic-sim
|
||||
shift
|
||||
;;
|
||||
-v3)
|
||||
VM_NAME=ci-phy-sim
|
||||
shift
|
||||
;;
|
||||
-v4)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
shift
|
||||
;;
|
||||
-v7)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
shift
|
||||
;;
|
||||
-v8)
|
||||
VM_NAME=ci-ue-ethernet
|
||||
shift
|
||||
;;
|
||||
--variant)
|
||||
variant="$2"
|
||||
case $variant in
|
||||
enb-usrp)
|
||||
VM_NAME=ci-enb-usrp
|
||||
;;
|
||||
basic-sim)
|
||||
VM_NAME=ci-basic-sim
|
||||
;;
|
||||
phy-sim)
|
||||
VM_NAME=ci-phy-sim
|
||||
;;
|
||||
cppcheck)
|
||||
VM_NAME=ci-cppcheck
|
||||
VM_MEMORY=4096
|
||||
;;
|
||||
enb-ethernet)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
;;
|
||||
ue-ethernet)
|
||||
VM_NAME=ci-ue-ethernet
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "Syntax Error: Invalid Variant option -> $variant"
|
||||
echo ""
|
||||
variant_usage
|
||||
exit 1
|
||||
esac
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ]
|
||||
then
|
||||
VM_TEMPLATE=ci-
|
||||
else
|
||||
VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}-
|
||||
fi
|
||||
|
||||
VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"`
|
||||
VM_CMDS=${VM_NAME}_cmds.txt
|
||||
|
||||
echo "VM_NAME = $VM_NAME"
|
||||
echo "VM_MEMORY = $VM_MEMORY MBytes"
|
||||
|
||||
echo "############################################################"
|
||||
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
|
||||
echo "############################################################"
|
||||
uvt-kvm create $VM_NAME release=xenial --memory $VM_MEMORY --cpu 4 --unsafe-caching --template ci-scripts/template-host.xml
|
||||
echo "Waiting for VM to be started"
|
||||
uvt-kvm wait $VM_NAME --insecure
|
||||
|
||||
VM_IP_ADDR=`uvt-kvm ip $VM_NAME`
|
||||
echo "$VM_NAME has for IP addr = $VM_IP_ADDR"
|
||||
exit 0
|
||||
101
ci-scripts/destroyAllRunningVM.sh
Executable file
101
ci-scripts/destroyAllRunningVM.sh
Executable file
@@ -0,0 +1,101 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI VM Destroy script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " destroyAllRunningVM.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -gt 4 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VM_TEMPLATE=ci-
|
||||
JOB_NAME=XX
|
||||
BUILD_ID=XX
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ]
|
||||
then
|
||||
VM_TEMPLATE=ci-
|
||||
else
|
||||
VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}-
|
||||
fi
|
||||
|
||||
LIST_CI_VM=`uvt-kvm list | grep $VM_TEMPLATE`
|
||||
|
||||
for CI_VM in $LIST_CI_VM
|
||||
do
|
||||
VM_IP_ADDR=`uvt-kvm ip $CI_VM`
|
||||
echo "VM to destroy: $CI_VM -- IP $VM_IP_ADDR"
|
||||
uvt-kvm destroy $CI_VM
|
||||
ssh-keygen -R $VM_IP_ADDR
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
113
ci-scripts/doGitLabMerge.sh
Executable file
113
ci-scripts/doGitLabMerge.sh
Executable file
@@ -0,0 +1,113 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "OAI GitLab merge request applying script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo ""
|
||||
echo " doGitLabMerge.sh [OPTIONS] [MANDATORY_OPTIONS]"
|
||||
echo ""
|
||||
echo "Mandatory Options:"
|
||||
echo "------------------"
|
||||
echo ""
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --src-commit #### OR -sc ####"
|
||||
echo " Specify the source commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --target-commit #### OR -tc ####"
|
||||
echo " Specify the target commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -ne 8 ] && [ $# -ne 1 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
checker=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-sc|--src-commit)
|
||||
SOURCE_COMMIT_ID="$2"
|
||||
let "checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "checker|=0x4"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tc|--target-commit)
|
||||
TARGET_COMMIT_ID="$2"
|
||||
let "checker|=0x8"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Source Commit ID is : $SOURCE_COMMIT_ID"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo "Target Commit ID is : $TARGET_COMMIT_ID"
|
||||
|
||||
if [ $checker -ne 15 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing option"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git config user.email "jenkins@openairinterface.org"
|
||||
git config user.name "OAI Jenkins"
|
||||
|
||||
git checkout -f $SOURCE_COMMIT_ID
|
||||
|
||||
git merge --ff $TARGET_COMMIT_ID -m "Temporary merge for CI"
|
||||
|
||||
STATUS=`git status | egrep -c "You have unmerged paths.|fix conflicts"`
|
||||
if [ $STATUS -ne 0 ]
|
||||
then
|
||||
echo "There are merge conflicts.. Cannot perform further build tasks"
|
||||
STATUS=-1
|
||||
fi
|
||||
exit $STATUS
|
||||
23
ci-scripts/fail.sh
Executable file
23
ci-scripts/fail.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
exit -1
|
||||
1433
ci-scripts/main.py
Normal file
1433
ci-scripts/main.py
Normal file
File diff suppressed because it is too large
Load Diff
592
ci-scripts/reportBuildLocally.sh
Executable file
592
ci-scripts/reportBuildLocally.sh
Executable file
@@ -0,0 +1,592 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI Local Build Report script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo ""
|
||||
echo " reportBuildLocally.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
echo "Job Options:"
|
||||
echo "------------"
|
||||
echo ""
|
||||
echo " --git-url #### OR -gu ####"
|
||||
echo " Specify the URL of the GIT Repository."
|
||||
echo ""
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --trigger merge-request OR -mr"
|
||||
echo " --trigger push OR -pu"
|
||||
echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
|
||||
echo ""
|
||||
echo "Merge-Request Options:"
|
||||
echo "----------------------"
|
||||
echo ""
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --src-commit #### OR -sc ####"
|
||||
echo " Specify the source commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --target-commit #### OR -tc ####"
|
||||
echo " Specify the target commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo "Push Options:"
|
||||
echo "----------------------"
|
||||
echo ""
|
||||
echo " --branch #### OR -br ####"
|
||||
echo " Specify the branch of the push event."
|
||||
echo ""
|
||||
echo " --commit #### OR -co ####"
|
||||
echo " Specify the commit ID (SHA-1) of the push event."
|
||||
echo ""
|
||||
echo ""
|
||||
}
|
||||
|
||||
function trigger_usage {
|
||||
echo "OAI Local Build Report script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " --trigger merge-request OR -mr"
|
||||
echo " --trigger push OR -pu"
|
||||
echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function details_table {
|
||||
echo " <h4>$1</h4>" >> $3
|
||||
|
||||
echo " <table border = \"1\">" >> $3
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> $3
|
||||
echo " <th>File</th>" >> $3
|
||||
echo " <th>Line Number</th>" >> $3
|
||||
echo " <th>Status</th>" >> $3
|
||||
echo " <th>Message</th>" >> $3
|
||||
echo " </tr>" >> $3
|
||||
|
||||
LIST_MESSAGES=`egrep "error:|warning:" $2 | egrep -v "jobserver unavailable|Clock skew detected.|flexran.proto"`
|
||||
COMPLETE_MESSAGE="start"
|
||||
for MESSAGE in $LIST_MESSAGES
|
||||
do
|
||||
if [[ $MESSAGE == *"/home/ubuntu/tmp"* ]]
|
||||
then
|
||||
FILENAME=`echo $MESSAGE | sed -e "s#^/home/ubuntu/tmp/##" -e "s#^.*/tmp/CI-eNB/##" | awk -F ":" '{print $1}'`
|
||||
LINENB=`echo $MESSAGE | awk -F ":" '{print $2}'`
|
||||
if [ "$COMPLETE_MESSAGE" != "start" ]
|
||||
then
|
||||
COMPLETE_MESSAGE=`echo $COMPLETE_MESSAGE | sed -e "s#‘#'#g" -e "s#’#'#g"`
|
||||
echo " <td>$COMPLETE_MESSAGE</td>" >> $3
|
||||
echo " </tr>" >> $3
|
||||
fi
|
||||
echo " <tr>" >> $3
|
||||
echo " <td>$FILENAME</td>" >> $3
|
||||
echo " <td>$LINENB</td>" >> $3
|
||||
else
|
||||
if [[ $MESSAGE == *"warning:"* ]] || [[ $MESSAGE == *"error:"* ]]
|
||||
then
|
||||
MSGTYPE=`echo $MESSAGE | sed -e "s#:##g"`
|
||||
echo " <td>$MSGTYPE</td>" >> $3
|
||||
COMPLETE_MESSAGE=""
|
||||
else
|
||||
COMPLETE_MESSAGE=$COMPLETE_MESSAGE" "$MESSAGE
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$COMPLETE_MESSAGE" != "start" ]
|
||||
then
|
||||
COMPLETE_MESSAGE=`echo $COMPLETE_MESSAGE | sed -e "s#‘#'#g" -e "s#’#'#g"`
|
||||
echo " <td>$COMPLETE_MESSAGE</td>" >> $3
|
||||
echo " </tr>" >> $3
|
||||
fi
|
||||
echo " </table>" >> $3
|
||||
}
|
||||
|
||||
function summary_table_header {
|
||||
echo " <h3>$1</h3>" >> ./build_results.html
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Element</th>" >> ./build_results.html
|
||||
echo " <th>Status</th>" >> ./build_results.html
|
||||
echo " <th>Nb Errors</th>" >> ./build_results.html
|
||||
echo " <th>Nb Warnings</th>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function summary_table_row {
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >$1</th>" >> ./build_results.html
|
||||
if [ -f $2 ]
|
||||
then
|
||||
STATUS=`egrep -c "$3" $2`
|
||||
if [ $STATUS -eq 1 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</th>" >> ./build_results.html
|
||||
fi
|
||||
NB_ERRORS=`egrep -c "error:" $2`
|
||||
if [ $NB_ERRORS -eq 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >$NB_ERRORS</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >$NB_ERRORS</th>" >> ./build_results.html
|
||||
fi
|
||||
NB_WARNINGS=`egrep "warning:" $2 | egrep -v "jobserver unavailable|Clock skew detected.|flexran.proto" | egrep -c "warning:"`
|
||||
if [ $NB_WARNINGS -eq 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >$NB_WARNINGS</th>" >> ./build_results.html
|
||||
else
|
||||
if [ $NB_WARNINGS -gt 20 ]
|
||||
then
|
||||
echo " <td bgcolor = \"red\" >$NB_WARNINGS</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"orange\" >$NB_WARNINGS</th>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
if [ $NB_ERRORS -ne 0 ] || [ $NB_WARNINGS -ne 0 ]
|
||||
then
|
||||
details_table "$1" $2 $4
|
||||
fi
|
||||
else
|
||||
echo " <td bgcolor = \"lightgray\" >Unknown</th>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightgray\" >--</th>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightgray\" >--</th>" >> ./build_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function summary_table_footer {
|
||||
echo " </table>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function sca_summary_table_header {
|
||||
echo " <h3>$1</h3>" >> ./build_results.html
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Error / Warning Type</th>" >> ./build_results.html
|
||||
echo " <th>Nb Errors</th>" >> ./build_results.html
|
||||
echo " <th>Nb Warnings</th>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo "0" > ccp_error_cnt.txt
|
||||
}
|
||||
|
||||
function sca_summary_table_row {
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >$2</td>" >> ./build_results.html
|
||||
if [ -f $1 ]
|
||||
then
|
||||
NB_ERRORS=`egrep "severity=\"error\"" $1 | egrep -c "id=\"$3\""`
|
||||
echo " <td>$NB_ERRORS</td>" >> ./build_results.html
|
||||
echo " <td>N/A</td>" >> ./build_results.html
|
||||
if [ -f ccp_error_cnt.txt ]
|
||||
then
|
||||
TOTAL_ERRORS=`cat ccp_error_cnt.txt`
|
||||
TOTAL_ERRORS=$((TOTAL_ERRORS + NB_ERRORS))
|
||||
echo $TOTAL_ERRORS > ccp_error_cnt.txt
|
||||
fi
|
||||
else
|
||||
echo " <td>Unknown</td>" >> ./build_results.html
|
||||
echo " <td>Unknown</td>" >> ./build_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function sca_summary_table_footer {
|
||||
if [ -f $1 ]
|
||||
then
|
||||
NB_ERRORS=`egrep -c "severity=\"error\"" $1`
|
||||
NB_WARNINGS=`egrep -c "severity=\"warning\"" $1`
|
||||
if [ -f ccp_error_cnt.txt ]
|
||||
then
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Others</td>" >> ./build_results.html
|
||||
TOTAL_ERRORS=`cat ccp_error_cnt.txt`
|
||||
TOTAL_ERRORS=$((NB_ERRORS - TOTAL_ERRORS))
|
||||
echo " <td>$TOTAL_ERRORS</td>" >> ./build_results.html
|
||||
echo " <td>$NB_WARNINGS</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
rm -f ccp_error_cnt.txt
|
||||
fi
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Total</th>" >> ./build_results.html
|
||||
echo " <th>$NB_ERRORS</th>" >> ./build_results.html
|
||||
echo " <th>$NB_WARNINGS</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Total</th>" >> ./build_results.html
|
||||
echo " <th>Unknown</th>" >> ./build_results.html
|
||||
echo " <th>Unknown</th>" >> ./build_results.html
|
||||
if [ -f ccp_error_cnt.txt ]
|
||||
then
|
||||
rm -f ccp_error_cnt.txt
|
||||
fi
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <p>Full details in zipped artifact (cppcheck/cppcheck.xml) </p>" >> ./build_results.html
|
||||
echo " <p>Graphical Interface tool : <code>cppcheck-gui -l cppcheck/cppcheck.xml</code> </p>" >> ./build_results.html
|
||||
}
|
||||
|
||||
jb_checker=0
|
||||
mr_checker=0
|
||||
pu_checker=0
|
||||
MR_TRIG=0
|
||||
PU_TRIG=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-gu|--git-url)
|
||||
GIT_URL="$2"
|
||||
let "jb_checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
let "jb_checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
let "jb_checker|=0x4"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
--trigger)
|
||||
TRIG="$2"
|
||||
case $TRIG in
|
||||
merge-request)
|
||||
MR_TRIG=1
|
||||
;;
|
||||
push)
|
||||
PU_TRIG=1
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "Syntax Error: Invalid Trigger option -> $TRIG"
|
||||
echo ""
|
||||
trigger_usage
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
let "jb_checker|=0x8"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-mr)
|
||||
MR_TRIG=1
|
||||
let "jb_checker|=0x8"
|
||||
shift
|
||||
;;
|
||||
-pu)
|
||||
PU_TRIG=1
|
||||
let "jb_checker|=0x8"
|
||||
shift
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "mr_checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-sc|--src-commit)
|
||||
SOURCE_COMMIT_ID="$2"
|
||||
let "mr_checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "mr_checker|=0x4"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tc|--target-commit)
|
||||
TARGET_COMMIT_ID="$2"
|
||||
let "mr_checker|=0x8"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-br|--branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "pu_checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-co|--commit)
|
||||
SOURCE_COMMIT_ID="$2"
|
||||
let "pu_checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
if [ $jb_checker -ne 15 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing job information."
|
||||
# TODO : list missing info
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $PU_TRIG -eq 1 ] && [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: trigger action incoherent."
|
||||
echo ""
|
||||
trigger_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $PU_TRIG -eq 1 ]
|
||||
then
|
||||
if [ $pu_checker -ne 3 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing push information."
|
||||
# TODO : list missing info
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
if [ $mr_checker -ne 15 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing merge-request information."
|
||||
# TODO : list missing info
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "<!DOCTYPE html>" > ./build_results.html
|
||||
echo "<html class=\"no-js\" lang=\"en-US\">" >> ./build_results.html
|
||||
echo "<head>" >> ./build_results.html
|
||||
echo " <title>Build Results for $JOB_NAME job build #$BUILD_ID</title>" >> ./build_results.html
|
||||
echo " <base href = \"http://www.openairinterface.org/\" />" >> ./build_results.html
|
||||
echo "</head>" >> ./build_results.html
|
||||
echo "<body>" >> ./build_results.html
|
||||
echo " <table style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
|
||||
echo " <tr style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
|
||||
echo " <td style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
|
||||
echo " <a href=\"http://www.openairinterface.org/\">" >> ./build_results.html
|
||||
echo " <img src=\"/wp-content/uploads/2016/03/cropped-oai_final_logo2.png\" alt=\"\" border=\"none\" height=50 width=150>" >> ./build_results.html
|
||||
echo " </img>" >> ./build_results.html
|
||||
echo " </a>" >> ./build_results.html
|
||||
echo " </td>" >> ./build_results.html
|
||||
echo " <td style=\"border-collapse: collapse; border: none; vertical-align: center;\">" >> ./build_results.html
|
||||
echo " <b><font size = \"6\">Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID</font></b>" >> ./build_results.html
|
||||
echo " </td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >GIT Repository</td>" >> ./build_results.html
|
||||
echo " <td>$GIT_URL</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Job Trigger</td>" >> ./build_results.html
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td>Push Event</td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td>Merge-Request</td>" >> ./build_results.html; fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
if [ $PU_TRIG -eq 1 ]
|
||||
then
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Branch</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_BRANCH</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Commit ID</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
fi
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Source Branch</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_BRANCH</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Source Commit ID</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Target Branch</td>" >> ./build_results.html
|
||||
echo " <td>$TARGET_BRANCH</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Target Commit ID</td>" >> ./build_results.html
|
||||
echo " <td>$TARGET_COMMIT_ID</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
fi
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <h2>Build Summary</h2>" >> ./build_results.html
|
||||
|
||||
if [ -f ./oai_rules_result.txt ]
|
||||
then
|
||||
echo " <h3>OAI Coding / Formatting Guidelines Check</h3>" >> ./build_results.html
|
||||
echo " <table border = "1">" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Result:</td>" >> ./build_results.html
|
||||
NB_FILES=`cat ./oai_rules_result.txt`
|
||||
if [ $NB_FILES = "0" ]
|
||||
then
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All files in repository follow OAI rules. </td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All modified files in Merge-Request follow OAI rules.</td>" >> ./build_results.html; fi
|
||||
else
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES files in repository DO NOT follow OAI rules. </td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES modified files in Merge-Request DO NOT follow OAI rules.</td>" >> ./build_results.html; fi
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
fi
|
||||
|
||||
echo " <h2>Ubuntu 16.04 LTS -- Summary</h2>" >> ./build_results.html
|
||||
|
||||
sca_summary_table_header "OAI Static Code Analysis with CPPCHECK"
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized variable" uninitvar
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized struct member" uninitStructMember
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory leak" memleak
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory is freed twice" doubleFree
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Resource leak" resourceLeak
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Possible null pointer dereference" nullPointer
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Array access out of bounds" arrayIndexOutOfBounds
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Buffer is accessed out of bounds" bufferAccessOutOfBounds
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Expression depends on order of evaluation of side effects" unknownEvaluationOrder
|
||||
sca_summary_table_footer ./archives/cppcheck/cppcheck.xml
|
||||
|
||||
summary_table_header "OAI Build eNB -- USRP option"
|
||||
summary_table_row "LTE SoftModem - Release 14" ./archives/enb_usrp/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/enb_usrp/coding.Rel14.txt "Built target coding" ./enb_usrp_row2.html
|
||||
summary_table_row "OAI USRP device if - Release 14" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_row4.html
|
||||
summary_table_footer
|
||||
|
||||
summary_table_header "OAI Build basic simulator option"
|
||||
summary_table_row "Basic Simulator eNb - Release 14" ./archives/basic_sim/basic_simulator_enb.txt "Built target lte-softmodem" ./basic_sim_row1.html
|
||||
summary_table_row "Basic Simulator UE - Release 14" ./archives/basic_sim/basic_simulator_ue.txt "Built target lte-uesoftmodem" ./basic_sim_row2.html
|
||||
summary_table_row "Conf 2 UE data - Release 14" ./archives/basic_sim/conf2uedata.Rel14.txt "Built target conf2uedata" ./basic_sim_row3.html
|
||||
summary_table_footer
|
||||
|
||||
summary_table_header "OAI Build Physical simulators option"
|
||||
summary_table_row "DL Simulator - Release 14" ./archives/phy_sim/dlsim.Rel14.txt "Built target dlsim" ./phy_sim_row1.html
|
||||
summary_table_row "UL Simulator - Release 14" ./archives/phy_sim/ulsim.Rel14.txt "Built target ulsim" ./phy_sim_row2.html
|
||||
summary_table_row "Coding - Release 14" ./archives/phy_sim/coding.Rel14.txt "Built target coding" ./phy_sim_row3.html
|
||||
summary_table_footer
|
||||
|
||||
summary_table_header "OAI Build eNB -- ETHERNET transport option"
|
||||
summary_table_row "LTE SoftModem w/o S1 - Release 14" ./archives/enb_eth/lte-softmodem-nos1.Rel14.txt "Built target lte-softmodem" ./enb_eth_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/enb_eth/coding.Rel14.txt "Built target coding" ./enb_eth_row2.html
|
||||
summary_table_row "OAI ETHERNET transport - Release 14" ./archives/enb_eth/oai_eth_transpro.Rel14.txt "Built target oai_eth_transpro" ./enb_eth_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_eth/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_eth_row4.html
|
||||
summary_table_row "RB Tools - Release 14" ./archives/enb_eth/rb_tool.Rel14.txt "Built target rb_tool" ./enb_eth_row5.html
|
||||
summary_table_row "NAS Mesh - Release 14" ./archives/enb_eth/nasmesh.Rel14.txt "Built target nasmesh" ./enb_eth_row6.html
|
||||
summary_table_footer
|
||||
|
||||
summary_table_header "OAI Build UE -- ETHERNET transport option"
|
||||
summary_table_row "LTE UE SoftModem w/o S1 - Release 14" ./archives/ue_eth/lte-uesoftmodem-nos1.Rel14.txt "Built target lte-uesoftmodem" ./ue_eth_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/ue_eth/coding.Rel14.txt "Built target coding" ./ue_eth_row2.html
|
||||
summary_table_row "OAI ETHERNET transport - Release 14" ./archives/ue_eth/oai_eth_transpro.Rel14.txt "Built target oai_eth_transpro" ./ue_eth_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/ue_eth/params_libconfig.Rel14.txt "Built target params_libconfig" ./ue_eth_row4.html
|
||||
summary_table_row "RB Tools - Release 14" ./archives/ue_eth/rb_tool.Rel14.txt "Built target rb_tool" ./ue_eth_row5.html
|
||||
summary_table_row "NAS Mesh - Release 14" ./archives/ue_eth/nasmesh.Rel14.txt "Built target nasmesh" ./ue_eth_row6.html
|
||||
summary_table_footer
|
||||
|
||||
echo " <h2>Red Hat (CentOS Linux release 7.4.1708) -- Summary</h2>" >> ./build_results.html
|
||||
|
||||
summary_table_header "Red Hat -- OAI Build eNB -- USRP option"
|
||||
summary_table_row "LTE SoftModem - Release 14" ./archives/red_hat/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_rh_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/red_hat/coding.Rel14.txt "Built target coding" ./enb_usrp_rh_row2.html
|
||||
summary_table_row "OAI USRP device if - Release 14" ./archives/red_hat/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_rh_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/red_hat/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_rh_row4.html
|
||||
summary_table_footer
|
||||
|
||||
echo " <h3>Details</h3>" >> ./build_results.html
|
||||
|
||||
for DETAILS_TABLE in `ls ./enb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./basic_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./phy_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./enb_eth_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./ue_eth_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./enb_usrp_rh_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
rm -f ./enb_usrp_row*.html ./basic_sim_row*.html ./phy_sim_row*.html ./enb_eth_row*.html ./ue_eth_row*.html ./enb_usrp_rh_row*.html
|
||||
|
||||
echo "</body>" >> ./build_results.html
|
||||
echo "</html>" >> ./build_results.html
|
||||
|
||||
exit 0
|
||||
318
ci-scripts/runTestOnVM.sh
Executable file
318
ci-scripts/runTestOnVM.sh
Executable file
@@ -0,0 +1,318 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
# * contributor license agreements. See the NOTICE file distributed with
|
||||
# * this work for additional information regarding copyright ownership.
|
||||
# * The OpenAirInterface Software Alliance licenses this file to You under
|
||||
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
# * http://www.openairinterface.org/?page_id=698
|
||||
# *
|
||||
# * Unless required by applicable law or agreed to in writing, software
|
||||
# * distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# * See the License for the specific language governing permissions and
|
||||
# * limitations under the License.
|
||||
# *-------------------------------------------------------------------------------
|
||||
# * For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
# * contact@openairinterface.org
|
||||
# */
|
||||
|
||||
function usage {
|
||||
echo "OAI VM Test Run script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo " Default:"
|
||||
echo " -- eNB with USRP"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " runTestOnVM.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --workspace #### OR -ws ####"
|
||||
echo " Specify the workspace."
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo " Specify the variant to build."
|
||||
echo ""
|
||||
echo " --keep-vm-alive OR -k"
|
||||
echo " Keep the VM alive after the build."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function variant_usage {
|
||||
echo "OAI VM Test Run script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant enb-ethernet OR -v7"
|
||||
echo " --variant ue-ethernet OR -v8"
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ] || [ $# -gt 9 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VM_TEMPLATE=ci-
|
||||
JOB_NAME=XX
|
||||
BUILD_ID=XX
|
||||
VM_NAME=ci-enb-usrp
|
||||
ARCHIVES_LOC=enb_usrp/test
|
||||
KEEP_VM_ALIVE=0
|
||||
RUN_OPTIONS="none"
|
||||
STATUS=0
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-ws|--workspace)
|
||||
JENKINS_WKSP="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-k|--keep-vm-alive)
|
||||
KEEP_VM_ALIVE=1
|
||||
shift
|
||||
;;
|
||||
-v1)
|
||||
VM_NAME=ci-enb-usrp
|
||||
shift
|
||||
;;
|
||||
-v2)
|
||||
VM_NAME=ci-basic-sim
|
||||
shift
|
||||
;;
|
||||
-v3)
|
||||
VM_NAME=ci-phy-sim
|
||||
RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b"
|
||||
ARCHIVES_LOC=phy_sim/test
|
||||
shift
|
||||
;;
|
||||
-v4)
|
||||
VM_NAME=ci-cppcheck
|
||||
shift
|
||||
;;
|
||||
-v7)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
shift
|
||||
;;
|
||||
-v8)
|
||||
VM_NAME=ci-ue-ethernet
|
||||
shift
|
||||
;;
|
||||
--variant)
|
||||
variant="$2"
|
||||
case $variant in
|
||||
enb-usrp)
|
||||
VM_NAME=ci-enb-usrp
|
||||
;;
|
||||
basic-sim)
|
||||
VM_NAME=ci-basic-sim
|
||||
;;
|
||||
phy-sim)
|
||||
VM_NAME=ci-phy-sim
|
||||
RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b"
|
||||
ARCHIVES_LOC=phy_sim/test
|
||||
;;
|
||||
cppcheck)
|
||||
VM_NAME=ci-cppcheck
|
||||
;;
|
||||
enb-ethernet)
|
||||
VM_NAME=ci-enb-ethernet
|
||||
;;
|
||||
ue-ethernet)
|
||||
VM_NAME=ci-ue-ethernet
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "Syntax Error: Invalid Variant option -> $variant"
|
||||
echo ""
|
||||
variant_usage
|
||||
exit 1
|
||||
esac
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ]
|
||||
then
|
||||
VM_TEMPLATE=ci-
|
||||
else
|
||||
VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}-
|
||||
fi
|
||||
|
||||
VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"`
|
||||
VM_CMDS=${VM_NAME}_cmds.txt
|
||||
ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC}
|
||||
|
||||
echo "VM_NAME = $VM_NAME"
|
||||
echo "VM_CMD_FILE = $VM_CMDS"
|
||||
echo "JENKINS_WKSP = $JENKINS_WKSP"
|
||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||
|
||||
echo "############################################################"
|
||||
echo "Waiting for VM to be started"
|
||||
echo "############################################################"
|
||||
uvt-kvm wait $VM_NAME --insecure
|
||||
|
||||
VM_IP_ADDR=`uvt-kvm ip $VM_NAME`
|
||||
echo "$VM_NAME has for IP addr = $VM_IP_ADDR"
|
||||
|
||||
if [ "$RUN_OPTIONS" == "none" ]
|
||||
then
|
||||
echo "No run on VM testing for this variant currently"
|
||||
else
|
||||
|
||||
echo "############################################################"
|
||||
echo "Running test script on VM ($VM_NAME)"
|
||||
echo "############################################################"
|
||||
echo "echo \"sudo apt-get --yes --quiet install bc \"" > $VM_CMDS
|
||||
echo "sudo apt-get update > bc-install.txt 2>&1" >> $VM_CMDS
|
||||
echo "sudo apt-get --yes install bc >> bc-install.txt 2>&1" >> $VM_CMDS
|
||||
echo "cd tmp" >> $VM_CMDS
|
||||
echo "echo \"source oaienv\"" >> $VM_CMDS
|
||||
echo "source oaienv" >> $VM_CMDS
|
||||
echo "echo \"cd cmake_targets/autotests\"" >> $VM_CMDS
|
||||
echo "cd cmake_targets/autotests" >> $VM_CMDS
|
||||
echo "echo \"rm -Rf log\"" >> $VM_CMDS
|
||||
echo "rm -Rf log" >> $VM_CMDS
|
||||
echo "$RUN_OPTIONS" | sed -e 's@"@\\"@g' -e 's@^@echo "@' -e 's@$@"@' >> $VM_CMDS
|
||||
echo "$RUN_OPTIONS" >> $VM_CMDS
|
||||
echo "cp /home/ubuntu/bc-install.txt log" >> $VM_CMDS
|
||||
echo "cd log" >> $VM_CMDS
|
||||
echo "zip -r -qq tmp.zip *.* 0*" >> $VM_CMDS
|
||||
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS
|
||||
|
||||
echo "############################################################"
|
||||
echo "Creating a tmp folder to store results and artifacts"
|
||||
echo "############################################################"
|
||||
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
rm -Rf $ARCHIVES_LOC
|
||||
fi
|
||||
mkdir --parents $ARCHIVES_LOC
|
||||
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/autotests/log/tmp.zip $ARCHIVES_LOC
|
||||
pushd $ARCHIVES_LOC
|
||||
unzip -qq -DD tmp.zip
|
||||
rm tmp.zip
|
||||
if [ -f results_autotests.xml ]
|
||||
then
|
||||
FUNCTION=`echo $VM_NAME | sed -e "s@$VM_TEMPLATE@@"`
|
||||
NEW_NAME=`echo "results_autotests.xml" | sed -e "s@results_autotests@results_autotests-$FUNCTION@"`
|
||||
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $NEW_NAME
|
||||
echo "<?xml-stylesheet type=\"text/xsl\" href=\"$FUNCTION.xsl\" ?>" >> $NEW_NAME
|
||||
cat results_autotests.xml >> $NEW_NAME
|
||||
sed -e "s@TEMPLATE@$FUNCTION@" $JENKINS_WKSP/ci-scripts/template.xsl > $FUNCTION.xsl
|
||||
#mv results_autotests.xml $NEW_NAME
|
||||
rm results_autotests.xml
|
||||
fi
|
||||
popd
|
||||
|
||||
if [ $KEEP_VM_ALIVE -eq 0 ]
|
||||
then
|
||||
echo "############################################################"
|
||||
echo "Destroying VM"
|
||||
echo "############################################################"
|
||||
uvt-kvm destroy $VM_NAME
|
||||
ssh-keygen -R $VM_IP_ADDR
|
||||
fi
|
||||
rm -f $VM_CMDS
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking build status"
|
||||
echo "############################################################"
|
||||
|
||||
LOG_FILES=`ls $ARCHIVES_LOC/results_autotests*.xml`
|
||||
NB_FOUND_FILES=0
|
||||
NB_RUNS=0
|
||||
NB_FAILURES=0
|
||||
|
||||
for FULLFILE in $LOG_FILES
|
||||
do
|
||||
TESTSUITES=`egrep "testsuite errors" $FULLFILE`
|
||||
for TESTSUITE in $TESTSUITES
|
||||
do
|
||||
if [[ "$TESTSUITE" == *"tests="* ]]
|
||||
then
|
||||
RUNS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" `
|
||||
NB_RUNS=$((NB_RUNS + RUNS))
|
||||
fi
|
||||
if [[ "$TESTSUITE" == *"failures="* ]]
|
||||
then
|
||||
FAILS=`echo $TESTSUITE | awk 'BEGIN{FS="="}{print $2}END{}' | sed -e "s@'@@g" `
|
||||
NB_FAILURES=$((NB_FAILURES + FAILS))
|
||||
fi
|
||||
done
|
||||
NB_FOUND_FILES=$((NB_FOUND_FILES + 1))
|
||||
done
|
||||
|
||||
echo "NB_FOUND_FILES = $NB_FOUND_FILES"
|
||||
echo "NB_RUNS = $NB_RUNS"
|
||||
echo "NB_FAILURES = $NB_FAILURES"
|
||||
|
||||
if [ $NB_FOUND_FILES -eq 0 ]; then STATUS=-1; fi
|
||||
if [ $NB_RUNS -eq 0 ]; then STATUS=-1; fi
|
||||
if [ $NB_FAILURES -ne 0 ]; then STATUS=-1; fi
|
||||
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "STATUS seems OK"
|
||||
else
|
||||
echo "STATUS failed?"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
exit $STATUS
|
||||
27
ci-scripts/template-host.xml
Normal file
27
ci-scripts/template-host.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<domain type='kvm'>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<cpu mode='host-passthrough'>
|
||||
</cpu>
|
||||
<devices>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
<model type='virtio'/>
|
||||
</interface>
|
||||
<serial type='pty'>
|
||||
<source path='/dev/pts/3'/>
|
||||
<target port='0'/>
|
||||
</serial>
|
||||
<graphics type='vnc' autoport='yes' listen='127.0.0.1'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
</graphics>
|
||||
<video/>
|
||||
</devices>
|
||||
</domain>
|
||||
65
ci-scripts/template.xsl
Normal file
65
ci-scripts/template.xsl
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="html" version="4" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
|
||||
<!-- main body -->
|
||||
<xsl:template match="/">
|
||||
<html>
|
||||
<body>
|
||||
<h3>TEMPLATE Results Summary</h3>
|
||||
<table border="1">
|
||||
<tr bgcolor="lightcyan">
|
||||
<!--Header only so select first row to get headers-->
|
||||
<th>Hostname</th>
|
||||
<th>Nb Tests</th>
|
||||
<th>Failures</th>
|
||||
<th>Timestamp</th>
|
||||
</tr>
|
||||
<!--Get all the other rows-->
|
||||
<xsl:for-each select="testsuites/testsuite">
|
||||
<tr>
|
||||
<td>
|
||||
<xsl:value-of select="@hostname"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@tests"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@failures"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@timestamp"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
<h4>Details</h4>
|
||||
<table border="1">
|
||||
<tr bgcolor="lightcyan">
|
||||
<!--Header only so select first row to get headers-->
|
||||
<th>Test Name</th>
|
||||
<th>Result</th>
|
||||
<th>Time</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
<!--Get all the other rows-->
|
||||
<xsl:for-each select="testsuites/testsuite/testcase">
|
||||
<tr>
|
||||
<td>
|
||||
<xsl:value-of select="@name"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@RESULT"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@time"/>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@description"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:for-each>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
244
ci-scripts/xml_files/enb_usrp210_band7.xml
Normal file
244
ci-scripts/xml_files/enb_usrp210_band7.xml
Normal file
@@ -0,0 +1,244 @@
|
||||
<!--
|
||||
|
||||
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The OpenAirInterface Software Alliance licenses this file to You under
|
||||
the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.openairinterface.org/?page_id=698
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
contact@openairinterface.org
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<TestCaseRequestedList>010101 050101 060101 070101 040101 030101 040301 040501 040601 040602 040603 040604 040605 040641 040401 040201 030201 030111 040301 040511 040611 040612 040613 040614 040615 040651 040401 040201 030201 030121 040301 040521 040621 040622 040623 040661 040401 040201 030201 </TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="010101">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w USRP -x -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030101">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030111">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band7/10MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030121">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band7/20MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.100PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030201">
|
||||
<class>Terminate_eNB</class>
|
||||
<desc>Terminate eNB</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040101">
|
||||
<class>Initialize_UE</class>
|
||||
<desc>Initialize UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040201">
|
||||
<class>Terminate_UE</class>
|
||||
<desc>Terminate UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040301">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040401">
|
||||
<class>Detach_UE</class>
|
||||
<desc>Detach UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040501">
|
||||
<class>Ping</class>
|
||||
<desc>ping (5MHz - 20 sec)</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040511">
|
||||
<class>Ping</class>
|
||||
<desc>ping (10MHz - 20 sec)</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040521">
|
||||
<class>Ping</class>
|
||||
<desc>ping (20MHz - 20 sec)</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040601">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/6Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 6M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040602">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/13Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 13M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040603">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 15M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040604">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040605">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(60 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>unbalanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040641">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - UL/9Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 9M -t 60 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040611">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/10Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 10M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040612">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/20Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 20M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040613">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/30Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 30M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040614">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/30Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 30M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040615">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - DL/30Mbps/UDP)(60 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 30M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>unbalanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040651">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (10MHz - UL/20Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 20M -t 60 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040621">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/20Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 20M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040622">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/40Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 40M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040623">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/70Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 70M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040624">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/70Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040624">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - DL/70Mbps/UDP)(60 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 70M -t 60 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>unbalanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040661">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (20MHz - UL/20Mbps/UDP)(60 sec)</desc>
|
||||
<iperf_args>-u -b 20M -t 60 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050101">
|
||||
<class>Initialize_HSS</class>
|
||||
<desc>Initialize HSS</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="060101">
|
||||
<class>Initialize_MME</class>
|
||||
<desc>Initialize MME</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070101">
|
||||
<class>Initialize_SPGW</class>
|
||||
<desc>Initialize SPGW</desc>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
65
ci-scripts/xml_files/enb_usrpB210_band7_50PRB.xml
Normal file
65
ci-scripts/xml_files/enb_usrpB210_band7_50PRB.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<!--
|
||||
|
||||
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The OpenAirInterface Software Alliance licenses this file to You under
|
||||
the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.openairinterface.org/?page_id=698
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
contact@openairinterface.org
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<TestCaseRequestedList>030101 040101 040301 040501 040401 040201 030201</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="030101">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band1/5MHz/info)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.50PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030201">
|
||||
<class>Terminate_eNB</class>
|
||||
<desc>Terminate eNB</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040101">
|
||||
<class>Initialize_UE</class>
|
||||
<desc>Initialize UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040201">
|
||||
<class>Terminate_UE</class>
|
||||
<desc>Terminate UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040301">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040401">
|
||||
<class>Detach_UE</class>
|
||||
<desc>Detach UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040501">
|
||||
<class>Ping</class>
|
||||
<desc>ping (20 sec)</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
142
ci-scripts/xml_files/test_case_list_template.xml
Normal file
142
ci-scripts/xml_files/test_case_list_template.xml
Normal file
@@ -0,0 +1,142 @@
|
||||
<!--
|
||||
|
||||
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The OpenAirInterface Software Alliance licenses this file to You under
|
||||
the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.openairinterface.org/?page_id=698
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
contact@openairinterface.org
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<TestCaseRequestedList>010101 050101 060101 070101 030101 030201 050201 070201 060201</TestCaseRequestedList>
|
||||
<TestCaseExclusionList>010102 030102 030103 030104 030105 030106</TestCaseExclusionList>
|
||||
|
||||
<!-- eNB class command references -->
|
||||
|
||||
<testCase id="010101">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w USRP -x -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="010102">
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build eNB (USRP)</desc>
|
||||
<Build_eNB_args>-w BLADERF -x -c --eNB</Build_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030101">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band1/5MHz/info)</desc>
|
||||
<Initialize_eNB_args>-O enb.band7.tm1.50PRB.usrpb210.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030102">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band1/10MHz/info)</desc>
|
||||
<Initialize_eNB_args>-O 10M.band1.FDD.info.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030103">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band1/20MHz/info)</desc>
|
||||
<Initialize_eNB_args>-O 20M.band1.FDD.info.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030104">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (TDD/Band38/5MHz/info)</desc>
|
||||
<Initialize_eNB_args>-O 5M.band38.TDD.info.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030105">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (TDD/Band38/10MHz/info)</desc>
|
||||
<Initialize_eNB_args>-O 10M.band38.TDD.info.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030106">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (TDD/Band38/20MHz/info)</desc>
|
||||
<Initialize_eNB_args>-O 20M.band38.TDD.info.conf</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030201">
|
||||
<class>Terminate_eNB</class>
|
||||
<desc>Terminate eNB</desc>
|
||||
</testCase>
|
||||
|
||||
<!-- UE class command references -->
|
||||
|
||||
<testCase id="040101">
|
||||
<class>Initialize_UE</class>
|
||||
<desc>Initialize UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040201">
|
||||
<class>Terminate_UE</class>
|
||||
<desc>Terminate UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040301">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040401">
|
||||
<class>Detach_UE</class>
|
||||
<desc>Detach UE</desc>
|
||||
</testCase>
|
||||
|
||||
|
||||
<testCase id="040701">
|
||||
<class>Reboot_UE</class>
|
||||
<desc>Reboot UE</desc>
|
||||
</testCase>
|
||||
|
||||
<!-- EPC class command references -->
|
||||
|
||||
<testCase id="050101">
|
||||
<class>Initialize_HSS</class>
|
||||
<desc>Initialize HSS</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050201">
|
||||
<class>Terminate_HSS</class>
|
||||
<desc>Terminate HSS</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="060101">
|
||||
<class>Initialize_MME</class>
|
||||
<desc>Initialize MME</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="060201">
|
||||
<class>Terminate_MME</class>
|
||||
<desc>Terminate MME</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070101">
|
||||
<class>Initialize_SPGW</class>
|
||||
<desc>Initialize SPGW</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070201">
|
||||
<class>Terminate_SPGW</class>
|
||||
<desc>Terminate SPGW</desc>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -175,10 +175,10 @@ function test_compile() {
|
||||
fi
|
||||
if [ "$result" == "1" ]; then
|
||||
echo_success "$test_case_name.${tags} PASSED"
|
||||
xUnit_success "compilation" "$test_case_name.$tags" "PASS" "$result_string" "$xmlfile_testcase"
|
||||
xUnit_success "compilation" "$test_case_name.$tags" "PASS" "$result_string" "$xmlfile_testcase" ""
|
||||
else
|
||||
echo_error "$test_case_name.${tags} FAILED"
|
||||
xUnit_fail "compilation" "$test_case_name.$tags" "FAIL" "$result_string" "$xmlfile_testcase"
|
||||
xUnit_fail "compilation" "$test_case_name.$tags" "FAIL" "$result_string" "$xmlfile_testcase" ""
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -200,6 +200,8 @@ function test_compile() {
|
||||
#\param $14 -> tags to help identify the test case for readability in output xml file
|
||||
#\param $15 => password for the user to run certain commands as sudo
|
||||
#\param $16 => test config file params to be modified
|
||||
#\param $17 => bypass flag if main_exec if available
|
||||
#\param $18 -> desc to help identify the test case for readability in output xml file
|
||||
|
||||
function test_compile_and_run() {
|
||||
xUnit_start
|
||||
@@ -221,6 +223,8 @@ function test_compile_and_run() {
|
||||
tags=${14}
|
||||
mypassword=${15}
|
||||
test_config_file=${16}
|
||||
bypass_compile=${17}
|
||||
desc=${18}
|
||||
|
||||
build_dir=$tdir/$1/build
|
||||
#exec_file=$build_dir/$6
|
||||
@@ -231,8 +235,6 @@ function test_compile_and_run() {
|
||||
rm -fr $log_dir
|
||||
mkdir -p $log_dir
|
||||
|
||||
rm -fr $OPENAIR_DIR/cmake_targets/log
|
||||
|
||||
echo "" > $temp_exec_log
|
||||
echo "" > $log_file
|
||||
#echo "log_dir = $log_dir"
|
||||
@@ -243,6 +245,7 @@ function test_compile_and_run() {
|
||||
#echo "pre_exec_file = $pre_exec_file"
|
||||
#echo "nruns = $nruns"
|
||||
echo "class = $class"
|
||||
#echo "desc = $desc"
|
||||
|
||||
#compile_prog_array=()
|
||||
#read -a compile_prog_array <<<"$compile_prog"
|
||||
@@ -253,11 +256,19 @@ function test_compile_and_run() {
|
||||
|
||||
tags_array=()
|
||||
read -a tags_array <<<"$tags"
|
||||
desc_array=()
|
||||
readarray -t desc_array <<<"$desc"
|
||||
|
||||
main_exec_args_array=()
|
||||
readarray -t main_exec_args_array <<< "$exec_args"
|
||||
|
||||
|
||||
REAL_MAIN_EXEC=`eval "echo $main_exec"`
|
||||
if [ "$bypass_compile" == "1" ] && [ -f $REAL_MAIN_EXEC ]
|
||||
then
|
||||
echo "Bypassing compilation for $main_exec"
|
||||
else
|
||||
rm -fr $OPENAIR_DIR/cmake_targets/log
|
||||
|
||||
#for search_expr in "${compile_prog_array[@]}"
|
||||
#do
|
||||
echo "Compiling test case $test_case_name Log file = $log_file"
|
||||
@@ -283,6 +294,7 @@ function test_compile_and_run() {
|
||||
}>> $log_file 2>&1
|
||||
echo "</COMPILATION LOG>" >> $log_file 2>&1
|
||||
#done
|
||||
fi
|
||||
|
||||
#process the test case if it is that of execution
|
||||
if [ "$class" == "execution" ]; then
|
||||
@@ -291,6 +303,7 @@ function test_compile_and_run() {
|
||||
do
|
||||
global_result=1
|
||||
result_string=""
|
||||
PROPER_DESC=`echo ${desc_array[$tags_array_index]} | sed -e "s@^.*lsim.*est case.*(Test@Test@" -e "s@^ *(@@" -e "s/),$//"`
|
||||
|
||||
for (( run_index=1; run_index <= $nruns; run_index++ ))
|
||||
do
|
||||
@@ -359,16 +372,16 @@ function test_compile_and_run() {
|
||||
|
||||
if [ "$result_string" == "" ]; then
|
||||
echo_error "execution $test_case_name.$compile_prog.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL"
|
||||
xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase"
|
||||
xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" "$PROPER_DESC"
|
||||
else
|
||||
if [ "$global_result" == "0" ]; then
|
||||
echo_error "execution $test_case_name.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = FAIL"
|
||||
xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase"
|
||||
xUnit_fail "execution" "$test_case_name.${tags_array[$tags_array_index]}" "FAIL" "$result_string" "$xmlfile_testcase" "$PROPER_DESC"
|
||||
fi
|
||||
|
||||
if [ "$global_result" == "1" ]; then
|
||||
echo_success "execution $test_case_name.${tags_array[$tags_array_index]} Run_Result = \"$result_string\" Result = PASS "
|
||||
xUnit_success "execution" "$test_case_name.${tags_array[$tags_array_index]}" "PASS" "$result_string" "$xmlfile_testcase"
|
||||
xUnit_success "execution" "$test_case_name.${tags_array[$tags_array_index]}" "PASS" "$result_string" "$xmlfile_testcase" "$PROPER_DESC"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -393,10 +406,18 @@ Options
|
||||
Run test cases in a group. For example, ./run_exec_autotests "0101* 010102"
|
||||
-p
|
||||
Use password for logging
|
||||
-np | --no-password
|
||||
No need for a password
|
||||
-q | --quiet
|
||||
Quiet mode; eliminate informational messages and comment prompts.
|
||||
-b | --bypass-compile
|
||||
Bypass compilation of main-exec if already present
|
||||
'
|
||||
}
|
||||
|
||||
function main () {
|
||||
QUIET=0
|
||||
BYPASS_COMPILE=0
|
||||
RUN_GROUP=0
|
||||
SET_PASSWORD=0
|
||||
passwd=""
|
||||
@@ -419,6 +440,16 @@ until [ -z "$1" ]
|
||||
SET_PASSWORD=1
|
||||
passwd=$2
|
||||
shift 2;;
|
||||
-np|--no-password)
|
||||
SET_PASSWORD=1
|
||||
shift ;;
|
||||
-q|--quiet)
|
||||
QUIET=1
|
||||
shift ;;
|
||||
-b|--bypass-compile)
|
||||
BYPASS_COMPILE=1
|
||||
echo "bypass option ON"
|
||||
shift ;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -449,15 +480,15 @@ xml_conf="$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml"
|
||||
|
||||
test_case_list=`xmlstarlet sel -T -t -m /testCaseList/testCase -s A:N:- "@id" -v "@id" -n $xml_conf`
|
||||
test_case_excl_list=`xmlstarlet sel -t -v "/testCaseList/TestCaseExclusionList" $xml_conf`
|
||||
echo "Test Case Exclusion List = $test_case_excl_list "
|
||||
if [ $QUIET -eq 0 ]; then echo "Test Case Exclusion List = $test_case_excl_list "; fi
|
||||
|
||||
test_case_excl_list=`sed "s/\+/\*/g" <<< "$test_case_excl_list" ` # Replace + with * for bash string substituion
|
||||
|
||||
read -a test_case_excl_array <<< "$test_case_excl_list"
|
||||
|
||||
echo "test_case_list = $test_case_list"
|
||||
if [ $QUIET -eq 0 ]; then echo "test_case_list = $test_case_list"; fi
|
||||
|
||||
echo "Test Case Exclusion List = $test_case_excl_list \n"
|
||||
if [ $QUIET -eq 0 ]; then echo "Test Case Exclusion List = $test_case_excl_list \n"; fi
|
||||
|
||||
readarray -t test_case_array <<<"$test_case_list"
|
||||
|
||||
@@ -484,7 +515,7 @@ for search_expr in "${test_case_array[@]}"
|
||||
do
|
||||
if [[ $search_expr == $search_excl ]];then
|
||||
flag_run_test_case=0
|
||||
echo_info "Test case $search_expr match found in test case excl group. Will skip the test case for execution..."
|
||||
if [ $QUIET -eq 0 ]; then echo_info "Test case $search_expr match found in test case excl group. Will skip the test case for execution..."; fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
@@ -533,8 +564,8 @@ for search_expr in "${test_case_array[@]}"
|
||||
|
||||
search_array_true=()
|
||||
|
||||
IFS=\" #set the shell's field separator
|
||||
set -f #don't try to glob
|
||||
IFS=\" #set the shell field separator
|
||||
set -f #dont try to glob
|
||||
#set -- $search_expr_true #split on $IFS
|
||||
for i in $search_expr_true
|
||||
do echo "i = $i"
|
||||
@@ -548,10 +579,10 @@ for search_expr in "${test_case_array[@]}"
|
||||
#echo "arg1 = ${search_array_true[0]}"
|
||||
#echo " arg2 = ${search_array_true[1]}"
|
||||
if [ "$class" == "compilation" ]; then
|
||||
test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
|
||||
test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$desc"
|
||||
elif [ "$class" == "execution" ]; then
|
||||
echo \'passwd\' | $SUDO killall -q oaisim_nos1
|
||||
test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" "$test_config_file"
|
||||
test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" "$test_config_file" "$BYPASS_COMPILE" "$desc"
|
||||
else
|
||||
echo "Unexpected class of test case...Skipping the test case $name ...."
|
||||
fi
|
||||
|
||||
@@ -955,21 +955,21 @@
|
||||
<compile_prog_args> --phy_simulators -c </compile_prog_args>
|
||||
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
|
||||
<pre_exec_args></pre_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/cmake_targets/lte-simulators/build/dlsim</main_exec>
|
||||
<main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
|
||||
-m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70
|
||||
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
|
||||
-m14 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70
|
||||
-m15 -gG -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30
|
||||
-m14 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O30
|
||||
-m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70
|
||||
-m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70
|
||||
-m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70
|
||||
-m26 -gF -s17.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -O70
|
||||
-m26 -gF -s17.3 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1600 -O70
|
||||
-m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O70
|
||||
-m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O70
|
||||
-m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O70</main_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/targets/bin/dlsim.Rel14</main_exec>
|
||||
<main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
|
||||
-m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O60
|
||||
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
|
||||
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O60
|
||||
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O25
|
||||
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O25
|
||||
-m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O60
|
||||
-m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O60
|
||||
-m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
|
||||
-m26 -gF -s17.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -O60
|
||||
-m26 -gF -s17.3 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1600 -O60
|
||||
-m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O60
|
||||
-m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O60
|
||||
-m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O60</main_exec_args>
|
||||
<tags>dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.TM2_test1 dlsim.TM2_test1b</tags>
|
||||
<search_expr_true>"passed"</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
@@ -989,13 +989,13 @@
|
||||
<compile_prog_args> --phy_simulators -c </compile_prog_args>
|
||||
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
|
||||
<pre_exec_args></pre_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/cmake_targets/lte-simulators/build/ulsim</main_exec>
|
||||
<main_exec_args> -B25 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B25 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B50 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B50 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B100 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L
|
||||
-B100 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 -L</main_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/targets/bin/ulsim.Rel14</main_exec>
|
||||
<main_exec_args> -B25 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70
|
||||
-B25 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70
|
||||
-B50 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70
|
||||
-B50 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70
|
||||
-B100 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70
|
||||
-B100 -m16 -y1 -gN -x1 -s12 -w1.0 -e.1 -P -n500 -O70 </main_exec_args>
|
||||
<tags>ulsim.test1 ulsim.test2 ulsim.test3 ulsim.test4 ulsim.test5 ulsim.test6</tags>
|
||||
<search_expr_true>"passed"</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -24;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -49,7 +49,7 @@ eNBs =
|
||||
pucch_delta_shift = 1;
|
||||
pucch_nRB_CQI = 0;
|
||||
pucch_nCS_AN = 0;
|
||||
pucch_n1_AN = 32;
|
||||
pucch_n1_AN = 0;
|
||||
pdsch_referenceSignalPower = -29;
|
||||
pdsch_p_b = 0;
|
||||
pusch_n_SB = 1;
|
||||
|
||||
@@ -42,6 +42,7 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
|
||||
|
||||
MSC_GEN="False"
|
||||
XFORMS="True"
|
||||
UE_EXPANSION="False"
|
||||
PRINT_STATS="False"
|
||||
VCD_TIMING="False"
|
||||
DEADLINE_SCHEDULER_FLAG_USER="False"
|
||||
@@ -57,7 +58,7 @@ CFLAGS_PROCESSOR_USER=""
|
||||
RUN_GROUP=0
|
||||
TEST_CASE_GROUP=""
|
||||
BUILD_DOXYGEN=0
|
||||
T_TRACER="False"
|
||||
T_TRACER="True"
|
||||
DISABLE_HARDWARE_DEPENDENCY="False"
|
||||
CMAKE_BUILD_TYPE=""
|
||||
CMAKE_CMD="$CMAKE"
|
||||
@@ -67,6 +68,8 @@ UE_TIMING_TRACE="False"
|
||||
DISABLE_LOG_X="False"
|
||||
USRP_REC_PLAY="False"
|
||||
BUILD_ECLIPSE=0
|
||||
UE_NAS_USE_TUN="False"
|
||||
BASIC_SIMULATOR=0
|
||||
trap handle_ctrl_c INT
|
||||
|
||||
function print_help() {
|
||||
@@ -109,8 +112,6 @@ Options
|
||||
-t | --transport protocol
|
||||
ETHERNET , None
|
||||
Adds this trasport protocol support in compilation
|
||||
--oaisim
|
||||
Makes the oaisim simulator. Hardware will be defaulted to \"None\".
|
||||
--phy_simulators
|
||||
Makes the unitary tests Layer 1 simulators
|
||||
--core_simulators
|
||||
@@ -122,12 +123,12 @@ Options
|
||||
-V | --vcd
|
||||
Adds a debgging facility to the binary files: GUI with major internal synchronization events
|
||||
-x | --xforms
|
||||
Adds a software oscilloscope feature to the produced binaries. If oaisim, then enable PRINT_STATS.
|
||||
Adds a software oscilloscope feature to the produced binaries.
|
||||
--install-system-files
|
||||
Install OpenArInterface required files in Linux system
|
||||
(will ask root password)
|
||||
--noS1
|
||||
Compiles oaisim or lte-softmodem without S1 interface, using direct link to IP instead
|
||||
Compiles lte-softmodem without S1 interface, using direct link to IP instead
|
||||
--verbose-compile
|
||||
Shows detailed compilation instructions in makefile
|
||||
--cflags_processor
|
||||
@@ -140,8 +141,8 @@ Options
|
||||
Enable deadline scheduler of Linux kernel (>=3.14.x).
|
||||
--disable-cpu-affinity
|
||||
Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads
|
||||
--T-tracer
|
||||
Enables the T tracer.
|
||||
--disable-T-Tracer
|
||||
Disables the T tracer.
|
||||
--disable-hardware-dependency
|
||||
Disable HW dependency during installation
|
||||
--ue-autotest-trace
|
||||
@@ -156,12 +157,14 @@ Options
|
||||
Build eclipse project files. Paths are auto corrected by fixprj.sh
|
||||
--usrp-recplay
|
||||
Build for I/Q record-playback modes
|
||||
--ue-nas-use-tun
|
||||
Use TUN devices for the UEs instead of ue_ip.ko
|
||||
--basic-simulator
|
||||
Generates a basic [1 UE + 1 eNB + no channel] simulator.
|
||||
See targets/ARCH/tcp_bridge/README.tcp_bridge_oai for documentation.
|
||||
Usage (first build):
|
||||
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
|
||||
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
|
||||
NI/ETTUS B201 + COTS UE : ./build_oai -I --eNB -x --install-system-files -w USRP
|
||||
Usage (Regular):
|
||||
oaisim : ./build_oai --oaisim -x
|
||||
Eurecom EXMIMO + OAI ENB : ./build_oai --eNB -x
|
||||
NI/ETTUS B201 + OAI ENB : ./build_oai --eNB -x -w USRP"
|
||||
}
|
||||
@@ -207,8 +210,12 @@ function main() {
|
||||
UE=1
|
||||
echo_info "Will compile UE"
|
||||
shift;;
|
||||
--mu)
|
||||
UE_EXPANSION="True"
|
||||
echo_info "Will compile with UE_EXPANSION"
|
||||
shift;;
|
||||
--UE-conf-nvram)
|
||||
conf_nvram_path=$(readlink -f "$1")
|
||||
conf_nvram_path=$(readlink -f $2)
|
||||
shift 2;;
|
||||
--UE-gen-nvram)
|
||||
gen_nvram_path=$(readlink -f $2)
|
||||
@@ -243,10 +250,6 @@ function main() {
|
||||
echo_info "Setting transport protocol to: $TP"
|
||||
fi
|
||||
shift 2;;
|
||||
--oaisim)
|
||||
oaisim=1
|
||||
echo_info "Will compile oaisim and drivers nasmesh, ..."
|
||||
shift;;
|
||||
--phy_simulators)
|
||||
SIMUS_PHY=1
|
||||
echo_info "Will compile dlsim, ulsim, ..."
|
||||
@@ -306,9 +309,9 @@ function main() {
|
||||
CPU_AFFINITY_FLAG_USER="False"
|
||||
echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
|
||||
shift 1;;
|
||||
--T-tracer)
|
||||
T_TRACER="True"
|
||||
echo_info "Enabling the T tracer"
|
||||
--disable-T-Tracer)
|
||||
T_TRACER="False"
|
||||
echo_info "Disabling the T tracer"
|
||||
shift 1;;
|
||||
--disable-hardware-dependency)
|
||||
echo_info "Disabling hardware dependency for compiling software"
|
||||
@@ -347,6 +350,14 @@ function main() {
|
||||
USRP_REC_PLAY="True"
|
||||
echo_info "Enabling USRP record playback mode"
|
||||
shift 1;;
|
||||
--ue-nas-use-tun)
|
||||
UE_NAS_USE_TUN="True"
|
||||
echo_info "Enabling UE NAS TUN device usage instead of ue_ip.ko"
|
||||
shift 1;;
|
||||
--basic-simulator)
|
||||
BASIC_SIMULATOR=1
|
||||
echo_info "Compiling the basic simulator"
|
||||
shift 1;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -359,7 +370,11 @@ function main() {
|
||||
|
||||
CMAKE_CMD="$CMAKE_CMD .."
|
||||
echo_info "CMAKE_CMD=$CMAKE_CMD"
|
||||
|
||||
if [ "$eNB" = "1" ] && [ "$UE" = "1" ]; then
|
||||
echo_error "Cannot build UE and eNB on one build_oai execution"
|
||||
echo_error "use 2 build_oai invocations"
|
||||
exit
|
||||
fi
|
||||
#########################################################
|
||||
# check validity of HW and TP parameters for eNB
|
||||
#########################################################
|
||||
@@ -471,16 +486,6 @@ function main() {
|
||||
check_install_additional_tools
|
||||
fi
|
||||
|
||||
if [ "$oaisim" = "1" ] ; then
|
||||
#to be discussed
|
||||
# there is no RF device transport protocol
|
||||
HW="None"
|
||||
TP="ETHERNET"
|
||||
|
||||
if [ "$XFORMS" == "True" ] ; then
|
||||
PRINT_STATS="True"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo_info "3. building the compilation directives ..."
|
||||
@@ -488,12 +493,24 @@ function main() {
|
||||
DIR=$OPENAIR_DIR/cmake_targets
|
||||
if [ "$NOS1" = "1" ] ; then
|
||||
lte_build_dir=lte_noS1_build_oai
|
||||
lte_exec=lte-softmodem-nos1
|
||||
if [ "$eNB" = "1" ] ; then
|
||||
lte_exec=lte-softmodem-nos1
|
||||
fi
|
||||
if [ "$UE" = "1" ] ; then
|
||||
lte_exec=lte-uesoftmodem-nos1
|
||||
fi
|
||||
else
|
||||
lte_build_dir=lte_build_oai
|
||||
lte_exec=lte-softmodem
|
||||
if [ "$eNB" = "1" ] ; then
|
||||
lte_exec=lte-softmodem
|
||||
fi
|
||||
if [ "$UE" = "1" ] ; then
|
||||
lte_exec=lte-uesoftmodem
|
||||
fi
|
||||
fi
|
||||
if [ "$T_TRACER" = "False" ] ; then
|
||||
lte_build_dir=${lte_build_dir}_noLOG
|
||||
fi
|
||||
|
||||
# configuration module libraries, one currently available, using libconfig
|
||||
config_libconfig_shlib=params_libconfig
|
||||
|
||||
@@ -511,6 +528,9 @@ function main() {
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file
|
||||
# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
|
||||
@@ -544,6 +564,9 @@ function main() {
|
||||
compilations \
|
||||
$lte_build_dir $config_libconfig_shlib \
|
||||
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
|
||||
compilations \
|
||||
$lte_build_dir coding \
|
||||
libcoding.so $dbin/libcoding.so
|
||||
|
||||
if [ "$NOS1" = "1" ] ; then
|
||||
compilations \
|
||||
@@ -609,12 +632,17 @@ function main() {
|
||||
if [ "$SIMUS_PHY" = "1" ] ; then
|
||||
# lte unitary simulators compilation
|
||||
echo_info "Compiling unitary tests simulators"
|
||||
simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
|
||||
# TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
|
||||
#simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
|
||||
simlist="dlsim ulsim"
|
||||
for f in $simlist ; do
|
||||
compilations \
|
||||
lte-simulators $f \
|
||||
$f $dbin/$f.$REL
|
||||
done
|
||||
compilations \
|
||||
lte-simulators coding \
|
||||
libcoding.so $dbin/libcoding.so
|
||||
fi
|
||||
|
||||
# Core simulators
|
||||
@@ -652,131 +680,15 @@ function main() {
|
||||
cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
|
||||
fi
|
||||
|
||||
# oaisim compilation
|
||||
###############
|
||||
if [ "$oaisim" = "1" ] ; then
|
||||
dconf=$OPENAIR_DIR/targets/bin
|
||||
if [ "$NOS1" = "1" ] ; then
|
||||
oaisim_build_dir=oaisim_noS1_build_oai
|
||||
oaisim_exec=oaisim_nos1
|
||||
else
|
||||
oaisim_build_dir=oaisim_build_oai
|
||||
oaisim_exec=oaisim
|
||||
fi
|
||||
|
||||
echo_info "Compiling $oaisim_exec ($oaisim_build_dir)"
|
||||
cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt
|
||||
cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
|
||||
mkdir -p $DIR/$oaisim_build_dir/build
|
||||
cd $DIR/$oaisim_build_dir/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
$oaisim_build_dir $oaisim_exec \
|
||||
$oaisim_exec $dbin/$oaisim_exec.$REL
|
||||
|
||||
if [ "$NOS1" != "1" ] ; then
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/at_commands/build
|
||||
echo_info "Compiling at_nas_ue"
|
||||
mkdir -p $DIR/at_commands/build
|
||||
cd $DIR/at_commands/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
at_commands at_nas_ue \
|
||||
at_nas_ue $dbin/at_nas_ue
|
||||
|
||||
# ue_ip driver compilation
|
||||
echo_info "Compiling UE specific part (ue_ip driver and usim tools)"
|
||||
compilations \
|
||||
oaisim_build_oai ue_ip \
|
||||
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
|
||||
mkdir -p $DIR/nas_sim_tools/build
|
||||
cd $DIR/nas_sim_tools/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
nas_sim_tools usim \
|
||||
usim $dbin/usim
|
||||
compilations \
|
||||
nas_sim_tools nvram \
|
||||
nvram $dbin/nvram
|
||||
compilations \
|
||||
nas_sim_tools conf2uedata \
|
||||
conf2uedata $dbin/conf2uedata
|
||||
|
||||
# generate USIM data
|
||||
if [ -f $dbin/conf2uedata ]; then
|
||||
install_nas_tools $conf_nvram_path $gen_nvram_path
|
||||
else
|
||||
echo_warning "not generated UE NAS files: binaries not found"
|
||||
fi
|
||||
else
|
||||
|
||||
compilations \
|
||||
$oaisim_build_dir rb_tool \
|
||||
rb_tool $dbin/rb_tool
|
||||
|
||||
# nasmesh driver compilation
|
||||
compilations \
|
||||
$oaisim_build_dir nasmesh \
|
||||
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
|
||||
|
||||
#oai_nw_drv
|
||||
#compilations \
|
||||
# $oaisim_build_dir oai_nw_drv \
|
||||
# CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko
|
||||
fi
|
||||
|
||||
if [ "$TP" == "ETHERNET" ] ; then
|
||||
compilations \
|
||||
$oaisim_build_dir oai_eth_transpro \
|
||||
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
|
||||
ln -sf liboai_eth_transpro.so liboai_transpro.so
|
||||
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
|
||||
echo_info "liboai_transpro.so is linked with ETHERNET library"
|
||||
fi
|
||||
|
||||
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
|
||||
cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
|
||||
#mkdir -p $DIR/oaisim_mme_build_oai/build
|
||||
#cd $DIR/oaisim_mme_build_oai/build
|
||||
#eval $CMAKE_CMD
|
||||
#compilations \
|
||||
# oaisim_mme_build_oai oaisim_mme \
|
||||
# oaisim_mme $dbin/oaisim_mme.$REL
|
||||
fi
|
||||
|
||||
# Telnet server compilation
|
||||
#####################
|
||||
if [ "$BUILD_TELNETSRV" = "1" ] ; then
|
||||
|
||||
telnetsrv_build_dir=telnetsrv
|
||||
mkdir -p $DIR/$telnetsrv_build_dir/build
|
||||
cd $DIR/$telnetsrv_build_dir/build
|
||||
echo_info "Compiling telnet server library ..."
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/$telnetsrv_build_dir
|
||||
cmake_file=$OPENAIR_DIR/common/utils/$telnetsrv_build_dir/CMakeLists.txt
|
||||
cd $DIR/$telnetsrv_build_dir/build
|
||||
eval "$CMAKE_CMD $OPENAIR_DIR/common/utils/$telnetsrv_build_dir/"
|
||||
make
|
||||
build_dir=$lte_build_dir
|
||||
compilations \
|
||||
$build_dir telnetsrv \
|
||||
libtelnetsrv.so $dbin/libtelnetsrv.so
|
||||
|
||||
fi
|
||||
# build RF device and transport protocol libraries
|
||||
@@ -890,6 +802,124 @@ fi
|
||||
else
|
||||
echo_info "10. Bypassing the Tests ..."
|
||||
fi
|
||||
|
||||
# basic simulator
|
||||
#####################
|
||||
if [ "$BASIC_SIMULATOR" = "1" ]; then
|
||||
echo_info "Build basic simulator"
|
||||
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/basic_simulator
|
||||
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/nas_sim_tools/build
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/enb
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/basic_simulator/ue
|
||||
mkdir -p $OPENAIR_DIR/cmake_targets/nas_sim_tools/build
|
||||
|
||||
# enb
|
||||
|
||||
cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/enb/CMakeLists.txt
|
||||
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file
|
||||
echo "set ( TRANSP_PRO \"None\")" >> $cmake_file
|
||||
echo "set(PACKAGE_NAME \"simulator_enb\")" >> $cmake_file
|
||||
echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file
|
||||
echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file
|
||||
echo "set ( T_TRACER \"True\" )" >> $cmake_file
|
||||
echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file
|
||||
echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file
|
||||
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
|
||||
echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file
|
||||
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
|
||||
echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file
|
||||
|
||||
echo_info "Build eNB"
|
||||
echo_info "logs are in $dlog/basic_simulator_enb.txt"
|
||||
set +e
|
||||
{
|
||||
cd $OPENAIR_DIR/cmake_targets/basic_simulator/enb
|
||||
cmake .
|
||||
make -j`nproc` lte-softmodem
|
||||
make -j`nproc` coding params_libconfig tcp_bridge_oai
|
||||
ln -sf libtcp_bridge_oai.so liboai_device.so
|
||||
cd ../..
|
||||
} > $dlog/basic_simulator_enb.txt 2>&1
|
||||
set -e
|
||||
if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/lte-softmodem -a \
|
||||
-s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libcoding.so -a \
|
||||
-s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libparams_libconfig.so -a \
|
||||
-s $OPENAIR_DIR/cmake_targets/basic_simulator/enb/libtcp_bridge_oai.so ] ; then
|
||||
echo_success "eNB compiled"
|
||||
check_warnings "$dlog/basic_simulator_enb.txt"
|
||||
else
|
||||
echo_error "eNB compilation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ue
|
||||
|
||||
echo_info "Compile conf2uedata"
|
||||
cd $OPENAIR_DIR/cmake_targets/nas_sim_tools/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
nas_sim_tools conf2uedata \
|
||||
conf2uedata $dbin/conf2uedata
|
||||
|
||||
cmake_file=$OPENAIR_DIR/cmake_targets/basic_simulator/ue/CMakeLists.txt
|
||||
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
|
||||
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( XFORMS $XFORMS )" >> $cmake_file
|
||||
echo "set ( RF_BOARD \"OAI_USRP\")" >> $cmake_file
|
||||
echo "set ( TRANSP_PRO \"None\")" >> $cmake_file
|
||||
echo "set(PACKAGE_NAME \"simulator_ue\")" >> $cmake_file
|
||||
echo "set (DEADLINE_SCHEDULER \"False\" )" >> $cmake_file
|
||||
echo "set (CPU_AFFINITY \"False\" )" >> $cmake_file
|
||||
echo "set ( T_TRACER \"True\" )" >> $cmake_file
|
||||
echo "set (UE_AUTOTEST_TRACE $UE_AUTOTEST_TRACE)" >> $cmake_file
|
||||
echo "set (UE_DEBUG_TRACE $UE_DEBUG_TRACE)" >> $cmake_file
|
||||
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
|
||||
echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file
|
||||
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
|
||||
echo "set (LINUX True )" >> $cmake_file
|
||||
echo "set (PDCP_USE_NETLINK True )" >> $cmake_file
|
||||
echo "set (BASIC_SIMULATOR \"True\" )" >> $cmake_file
|
||||
echo "set (UE_NAS_USE_TUN \"True\" )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)' >> $cmake_file
|
||||
|
||||
echo_info "Build UE"
|
||||
echo_info "logs are in $dlog/basic_simulator_ue.txt"
|
||||
set +e
|
||||
{
|
||||
cd $OPENAIR_DIR/cmake_targets/basic_simulator/ue
|
||||
cmake .
|
||||
make -j`nproc` lte-uesoftmodem
|
||||
make -j`nproc` coding params_libconfig tcp_bridge_oai
|
||||
ln -sf libtcp_bridge_oai.so liboai_device.so
|
||||
cd ../..
|
||||
} > $dlog/basic_simulator_ue.txt 2>&1
|
||||
set -e
|
||||
if [ -s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/lte-uesoftmodem -a \
|
||||
-s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libcoding.so -a \
|
||||
-s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libparams_libconfig.so -a \
|
||||
-s $OPENAIR_DIR/cmake_targets/basic_simulator/ue/libtcp_bridge_oai.so ] ; then
|
||||
echo_success "UE compiled"
|
||||
check_warnings "$dlog/basic_simulator_ue.txt"
|
||||
else
|
||||
echo_error "UE compilation failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo_info "Generate UE SIM data"
|
||||
$OPENAIR_DIR/targets/bin/conf2uedata -c $OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o $OPENAIR_DIR/cmake_targets/basic_simulator/ue
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -8,5 +8,5 @@ set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
set(RRC_ASN1_VERSION "Rel14")
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
|
||||
|
||||
@@ -56,7 +56,7 @@ white='\E[37m'
|
||||
reset_color='\E[00m'
|
||||
COLORIZE=1
|
||||
|
||||
cecho() {
|
||||
cecho() {
|
||||
# Color-echo
|
||||
# arg1 = message
|
||||
# arg2 = color
|
||||
@@ -95,6 +95,7 @@ get_distribution_release() {
|
||||
check_supported_distribution() {
|
||||
local distribution=$(get_distribution_release)
|
||||
case "$distribution" in
|
||||
"ubuntu18.04") return 0 ;;
|
||||
"ubuntu17.10") return 0 ;;
|
||||
"ubuntu17.04") return 0 ;;
|
||||
"ubuntu16.04") return 0 ;;
|
||||
@@ -146,10 +147,10 @@ clean_kernel() {
|
||||
clean_all_files() {
|
||||
set_openair_env
|
||||
dir=$OPENAIR_DIR/cmake_targets
|
||||
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
|
||||
rm -rf $dir/log $OPENAIR_DIR/targets/bin/*
|
||||
rm -rf $dir/lte_build_oai $dir/lte-simulators/build
|
||||
rm -rf $dir/oaisim_build_oai/build $dir/oaisim_build_oai/CMakeLists.txt
|
||||
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
|
||||
rm -rf $dir/autotests/bin $dir/autotests/log $dir/autotests/*/build
|
||||
}
|
||||
|
||||
###################################
|
||||
@@ -210,7 +211,7 @@ install_protobuf_from_source(){
|
||||
#cd protobuf-2.6.1/
|
||||
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
|
||||
wget https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $USER --no-same-owner
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $(groups | cut -d" " -f1) --no-same-owner
|
||||
cd protobuf-3.3.0/
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
@@ -267,11 +268,26 @@ check_install_usrp_uhd_driver(){
|
||||
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
#first we remove old installation
|
||||
$SUDO apt-get remove -y uhd || true
|
||||
$SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y
|
||||
$SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y || true
|
||||
v=$(lsb_release -cs)
|
||||
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
|
||||
#The new USRP repository
|
||||
$SUDO add-apt-repository ppa:ettusresearch/uhd -y
|
||||
# The new USRP repository
|
||||
# Raphael Defosseux: Adding a loop on adding PPA because in CI the gpg key retrieve may
|
||||
# timeout due to proxy / network latencies in Eurecom on VM
|
||||
echo_info "\nAdding PPA repository ettusresearch/uhd\n"
|
||||
x=0
|
||||
while [ $x -le 5 ]
|
||||
do
|
||||
if $SUDO add-apt-repository ppa:ettusresearch/uhd -y
|
||||
then
|
||||
echo_info "add-apt-repository successful\n"
|
||||
break
|
||||
else
|
||||
echo_info "add-apt-repository failed, retrying...\n"
|
||||
sleep 30
|
||||
fi
|
||||
x=$((x + 1))
|
||||
done
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev
|
||||
$SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host
|
||||
@@ -336,7 +352,7 @@ check_install_bladerf_driver(){
|
||||
fi
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
|
||||
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
install_bladerf_driver_from_source
|
||||
else
|
||||
@@ -357,7 +373,7 @@ check_install_lmssdr_driver(){
|
||||
echo_error "lmssdr support implies installing lmssdr drivers and tools" \
|
||||
" from sources. check:"
|
||||
echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/"
|
||||
echo_fatal "Cannot compile lmssdr device"
|
||||
echo_fatal "Cannot compile lmssdr device"
|
||||
fi
|
||||
|
||||
|
||||
@@ -454,7 +470,7 @@ check_install_additional_tools (){
|
||||
python2-matplotlib"
|
||||
fi
|
||||
$SUDO $INSTALLER install -y $PACKAGE_LIST
|
||||
|
||||
|
||||
$SUDO rm -fr /opt/ssh
|
||||
$SUDO GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh
|
||||
|
||||
@@ -488,19 +504,24 @@ check_install_oai_software() {
|
||||
$SUDO apt install -y software-properties-common
|
||||
case "$(get_distribution_release)" in
|
||||
"ubuntu14.04")
|
||||
specific_packages="libtasn1-3-dev gccxml libgnutls-dev libatlas-dev"
|
||||
specific_packages="libtasn1-3-dev libgnutls-dev libatlas-dev iproute libconfig8-dev"
|
||||
# For iperf3
|
||||
$SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe"
|
||||
$SUDO apt-get update
|
||||
;;
|
||||
"ubuntu16.04")
|
||||
specific_packages="libtasn1-6-dev gccxml libgnutls-dev libatlas-dev"
|
||||
specific_packages="libtasn1-6-dev libgnutls-dev libatlas-dev iproute libconfig8-dev"
|
||||
;;
|
||||
"ubuntu17.04")
|
||||
specific_packages="libtasn1-6-dev castxml libgnutls28-dev libatlas-dev"
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev libatlas-dev iproute libconfig8-dev"
|
||||
;;
|
||||
"ubuntu17.10")
|
||||
specific_packages="libtasn1-6-dev castxml libgnutls28-dev"
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute libconfig8-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
;;
|
||||
"ubuntu18.04")
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
;;
|
||||
@@ -524,12 +545,12 @@ check_install_oai_software() {
|
||||
gtkwave \
|
||||
guile-2.0-dev \
|
||||
iperf \
|
||||
iproute \
|
||||
iptables \
|
||||
iptables-dev \
|
||||
libatlas-base-dev \
|
||||
libblas-dev \
|
||||
libconfig8-dev \
|
||||
liblapack-dev\
|
||||
liblapacke-dev\
|
||||
libffi-dev \
|
||||
libforms-bin \
|
||||
libforms-dev \
|
||||
@@ -576,14 +597,11 @@ check_install_oai_software() {
|
||||
echo "EPEL repos not present. Installing them."
|
||||
$SUDO $INSTALLER install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||
fi
|
||||
$SUDO $INSTALLER install -y python-epdb
|
||||
$SUDO $INSTALLER install -y gccxml
|
||||
$SUDO $INSTALLER install -y python-epdb vim-common
|
||||
else
|
||||
$SUDO $INSTALLER install -y mscgen pydb
|
||||
# Fedora repos already contain gccxml's successor castxml.
|
||||
$SUDO $INSTALLER install -y castxml
|
||||
fi
|
||||
|
||||
|
||||
$SUDO $INSTALLER install -y \
|
||||
autoconf \
|
||||
automake \
|
||||
@@ -659,8 +677,14 @@ install_asn1c_from_source(){
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
|
||||
(
|
||||
$SUDO rm -rf /tmp/asn1c
|
||||
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
# GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
cd /tmp/asn1c
|
||||
# better to use a given commit than a branch in case the branch
|
||||
# is updated and requires modifications in the source of OAI
|
||||
#git checkout velichkov_s1ap_plus_option_group
|
||||
git checkout ec830d70bbb014b769810355a2f321a91ccd8a58
|
||||
autoreconf -iv
|
||||
./configure
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
@@ -670,7 +694,7 @@ install_asn1c_from_source(){
|
||||
}
|
||||
|
||||
#################################################
|
||||
# 2. compile
|
||||
# 2. compile
|
||||
################################################
|
||||
|
||||
install_nas_tools() {
|
||||
@@ -699,7 +723,7 @@ set_openair_env(){
|
||||
[ -f "/.$fullpath" ] || fullpath=`readlink -f $PWD/$fullpath`
|
||||
openair_path=${fullpath%/cmake_targets/*}
|
||||
openair_path=${openair_path%/targets/*}
|
||||
openair_path=${openair_path%/openair[123]/*}
|
||||
openair_path=${openair_path%/openair[123]/*}
|
||||
export OPENAIR_DIR=$openair_path
|
||||
export OPENAIR1_DIR=$openair_path/openair1
|
||||
export OPENAIR2_DIR=$openair_path/openair2
|
||||
@@ -716,7 +740,7 @@ ppid=$$
|
||||
arraycounter=1
|
||||
echo_info "** Trapped CTRL-C. Killing all subprocesses now..."
|
||||
echo_info "** Calling sync now..."
|
||||
sync
|
||||
sync
|
||||
while true
|
||||
do
|
||||
FORLOOP=FALSE
|
||||
@@ -734,7 +758,7 @@ do
|
||||
arraycounter=`expr $arraycounter - 1`
|
||||
## We want to kill child process id first and then parent id's
|
||||
while [ $arraycounter -ne 0 ]
|
||||
do
|
||||
do
|
||||
echo "first we send ctrl-c to program"
|
||||
$SUDO kill -INT "${procid[$arraycounter]}"
|
||||
sleep 5
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
RRC_Rel14=(
|
||||
"SystemInformation-r8-IEs.h" 4df485c5ddf2540eca271876cdc512caa19b0890 "fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff"
|
||||
"SystemInformation-NB-r13-IEs.h" 6d91332d5c39205819b06e5e36efe62ff8e5b33b "fix_asn1.data/RRC.rel14/SystemInformation-NB-r13-IEs.h.diff"
|
||||
)
|
||||
|
||||
RRC_Rel10=(
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
48a49,70
|
||||
> struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member {
|
||||
> SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_PR present;
|
||||
> union SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_u {
|
||||
> SystemInformationBlockType2_NB_r13_t sib2_r13;
|
||||
> SystemInformationBlockType3_NB_r13_t sib3_r13;
|
||||
> SystemInformationBlockType4_NB_r13_t sib4_r13;
|
||||
> SystemInformationBlockType5_NB_r13_t sib5_r13;
|
||||
> SystemInformationBlockType14_NB_r13_t sib14_r13;
|
||||
> SystemInformationBlockType16_NB_r13_t sib16_r13;
|
||||
> /*
|
||||
> * This type is extensible,
|
||||
> * possible extensions are below.
|
||||
> */
|
||||
> SystemInformationBlockType15_NB_r14_t sib15_v1430;
|
||||
> SystemInformationBlockType20_NB_r14_t sib20_v1430;
|
||||
> SystemInformationBlockType22_NB_r14_t sib22_v1430;
|
||||
> } choice;
|
||||
>
|
||||
> /* Context for parsing across buffer boundaries */
|
||||
> asn_struct_ctx_t _asn_ctx;
|
||||
> };
|
||||
>
|
||||
52,72c74
|
||||
< A_SEQUENCE_OF(struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member {
|
||||
< SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_PR present;
|
||||
< union SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member_u {
|
||||
< SystemInformationBlockType2_NB_r13_t sib2_r13;
|
||||
< SystemInformationBlockType3_NB_r13_t sib3_r13;
|
||||
< SystemInformationBlockType4_NB_r13_t sib4_r13;
|
||||
< SystemInformationBlockType5_NB_r13_t sib5_r13;
|
||||
< SystemInformationBlockType14_NB_r13_t sib14_r13;
|
||||
< SystemInformationBlockType16_NB_r13_t sib16_r13;
|
||||
< /*
|
||||
< * This type is extensible,
|
||||
< * possible extensions are below.
|
||||
< */
|
||||
< SystemInformationBlockType15_NB_r14_t sib15_v1430;
|
||||
< SystemInformationBlockType20_NB_r14_t sib20_v1430;
|
||||
< SystemInformationBlockType22_NB_r14_t sib22_v1430;
|
||||
< } choice;
|
||||
<
|
||||
< /* Context for parsing across buffer boundaries */
|
||||
< asn_struct_ctx_t _asn_ctx;
|
||||
< } ) list;
|
||||
---
|
||||
> A_SEQUENCE_OF(struct SystemInformation_NB_r13_IEs__sib_TypeAndInfo_r13__Member) list;
|
||||
@@ -48,7 +48,7 @@ if [ "$1" = "eNB" ]; then
|
||||
else
|
||||
if [ "$1" = "UE" ]; then
|
||||
echo "bring up oai0 interface for UE"
|
||||
sudo ifconfig oai0 10.0.1.9 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
sudo ifconfig oai0 10.0.1.2 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.2 -t 10.0.1.1 -r 1
|
||||
fi
|
||||
fi
|
||||
|
||||
0
cmake_targets/tools/init_nas_s1
Normal file → Executable file
0
cmake_targets/tools/init_nas_s1
Normal file → Executable file
@@ -26,15 +26,17 @@ xUnit_start() {
|
||||
# \param $3 testcase result
|
||||
# \param $4 run result
|
||||
# \param $5 XML file local to test case for storing its own results
|
||||
# \param $6 proper description
|
||||
xUnit_fail() {
|
||||
class=$1
|
||||
test_case=$2
|
||||
result=$3
|
||||
run_result=$4
|
||||
xmlfile_testcase=$5
|
||||
desc=$6
|
||||
currtime=$(date +%s.%N)
|
||||
time=$(echo "$currtime - $XUNIT_START" | bc -l)
|
||||
xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
|
||||
xml="<testcase classname='$class' name='$test_case' description='$desc' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
|
||||
echo -e "$xml" >> "$xmlfile_testcase"
|
||||
XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
|
||||
XUNIT_FAILED=$((XUNIT_FAILED+1))
|
||||
@@ -48,15 +50,17 @@ xUnit_fail() {
|
||||
# \param $3 testcase result
|
||||
# \param $4 run result
|
||||
# \param $5 XML file local to test case for storing its own results
|
||||
# \param $6 proper description
|
||||
xUnit_success() {
|
||||
class=$1
|
||||
test_case=$2
|
||||
result=$3
|
||||
run_result=$4
|
||||
xmlfile_testcase=$5
|
||||
desc=$6
|
||||
currtime=$(date +%s.%N)
|
||||
time=$(echo "$currtime - $XUNIT_START" | bc -l)
|
||||
xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
|
||||
xml="<testcase classname='$class' name='$test_case' description='$desc' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
|
||||
echo -e $xml >> $xmlfile_testcase
|
||||
XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
|
||||
XUNIT_SUCCESS=$((XUNIT_SUCCESS+1))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -29,18 +29,50 @@
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include "config_userapi.h"
|
||||
|
||||
|
||||
void parse_stringlist(paramdef_t *cfgoptions, char *val)
|
||||
{
|
||||
char *atoken;
|
||||
char *tokctx;
|
||||
char *tmpval=strdup(val);
|
||||
int numelt=0;
|
||||
|
||||
cfgoptions->numelt=0;
|
||||
|
||||
atoken=strtok_r(tmpval, ",",&tokctx);
|
||||
while(atoken != NULL) {
|
||||
numelt++ ;
|
||||
atoken=strtok_r(NULL, ",",&tokctx);
|
||||
}
|
||||
free(tmpval);
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
|
||||
cfgoptions->numelt=numelt;
|
||||
|
||||
atoken=strtok_r(val, ",",&tokctx);
|
||||
for( int i=0; i<cfgoptions->numelt && atoken != NULL ; i++) {
|
||||
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(atoken)+1);
|
||||
sprintf(cfgoptions->strlistptr[i],"%s",atoken);
|
||||
printf_params("[LIBCONFIG] %s[%i]: %s\n", cfgoptions->optname,i,cfgoptions->strlistptr[i]);
|
||||
atoken=strtok_r(NULL, ",",&tokctx);
|
||||
}
|
||||
cfgoptions->numelt=numelt;
|
||||
}
|
||||
|
||||
int processoption(paramdef_t *cfgoptions, char *value)
|
||||
{
|
||||
char *tmpval = value;
|
||||
int optisset=0;
|
||||
char defbool[2]="1";
|
||||
|
||||
|
||||
if ( value == NULL) {
|
||||
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
|
||||
fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
|
||||
@@ -63,6 +95,7 @@ char defbool[2]="1";
|
||||
break;
|
||||
|
||||
case TYPE_STRINGLIST:
|
||||
parse_stringlist(cfgoptions,tmpval);
|
||||
break;
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
@@ -103,15 +136,15 @@ char defbool[2]="1";
|
||||
if (optisset == 1) {
|
||||
cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET;
|
||||
}
|
||||
|
||||
return optisset;
|
||||
}
|
||||
|
||||
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
|
||||
{
|
||||
char **p = config_get_if()->argv;
|
||||
|
||||
|
||||
int c = config_get_if()->argc;
|
||||
int j;
|
||||
int i,j;
|
||||
char *pp;
|
||||
char *cfgpath;
|
||||
|
||||
@@ -122,42 +155,74 @@ char *cfgpath;
|
||||
return -1;
|
||||
}
|
||||
|
||||
j=0;
|
||||
p++;
|
||||
c--;
|
||||
while (c > 0 && *p != NULL) {
|
||||
if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) {
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
j = 0;
|
||||
i = 0;
|
||||
while (c > 0 ) {
|
||||
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
|
||||
/* first check help options, either --help, -h or --help_<section> */
|
||||
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
|
||||
char *tokctx;
|
||||
pp=strtok_r(oneargv, "_",&tokctx);
|
||||
if (pp == NULL || strcasecmp(pp,config_get_if()->argv[i] ) == 0 ) {
|
||||
if( prefix == NULL) {
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
if ( ! ( CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP)))
|
||||
exit_fun("[CONFIG] Exiting after displaying help\n");
|
||||
}
|
||||
} else {
|
||||
pp=strtok_r(NULL, " ",&tokctx);
|
||||
if ( prefix != NULL && pp != NULL && strncasecmp(prefix,pp,strlen(pp)) == 0 ) {
|
||||
printf ("Help for %s section:\n",prefix);
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
if ( ! (CONFIG_ISFLAGSET(CONFIG_NOEXITONHELP))) {
|
||||
fprintf(stderr,"[CONFIG] %s %i section %s:", __FILE__, __LINE__, prefix);
|
||||
exit_fun(" Exiting after displaying help\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (*p[0] == '-') {
|
||||
for(int i=0;i<numoptions;i++) {
|
||||
if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) {
|
||||
/* now, check for non help options */
|
||||
if (oneargv[0] == '-') {
|
||||
for(int n=0;n<numoptions;n++) {
|
||||
if ( ( cfgoptions[n].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (prefix != NULL) {
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname);
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[n].optname);
|
||||
} else {
|
||||
sprintf(cfgpath,"%s",cfgoptions[i].optname);
|
||||
sprintf(cfgpath,"%s",cfgoptions[n].optname);
|
||||
}
|
||||
|
||||
if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) ||
|
||||
((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) {
|
||||
pp = *(p+1);
|
||||
if ( ( pp != NULL ) && (c>1) && (pp[0]!= '-') ) {
|
||||
|
||||
j += processoption(&(cfgoptions[i]), pp);
|
||||
} else {
|
||||
j += processoption(&(cfgoptions[i]), NULL);
|
||||
}
|
||||
if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */
|
||||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) {
|
||||
char *valptr=NULL;
|
||||
int ret;
|
||||
if (c > 0) {
|
||||
pp = config_get_if()->argv[i+1];
|
||||
if (pp != NULL ) {
|
||||
ret = strlen(pp);
|
||||
if (ret > 0 ) {
|
||||
if (pp[0] != '-')
|
||||
valptr=pp;
|
||||
else if ( ret > 1 && pp[0] == '-' && isdigit(pp[1]) )
|
||||
valptr=pp;
|
||||
}
|
||||
}
|
||||
}
|
||||
j += processoption(&(cfgoptions[n]), valptr);
|
||||
if ( valptr != NULL ) {
|
||||
i++;
|
||||
c--;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} /* for */
|
||||
} /* if (*p[0] == '-') */
|
||||
p++;
|
||||
} /* for n... */
|
||||
} /* if (oneargv[0] == '-') */
|
||||
free(oneargv);
|
||||
i++;
|
||||
c--;
|
||||
} /* fin du while */
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "":prefix),j);
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "(root)":prefix),j);
|
||||
free(cfgpath);
|
||||
return j;
|
||||
} /* parse_cmdline*/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -97,7 +97,77 @@ int st;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* from here: interface implementtion of the configuration module */
|
||||
int nooptfunc(void) {
|
||||
return 0;
|
||||
};
|
||||
|
||||
int config_cmdlineonly_getlist(paramlist_def_t *ParamList,
|
||||
paramdef_t *params, int numparams, char *prefix)
|
||||
{
|
||||
ParamList->numelt = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int config_cmdlineonly_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
{
|
||||
int defval;
|
||||
int fatalerror=0;
|
||||
int numdefvals=0;
|
||||
|
||||
|
||||
for(int i=0;i<numoptions;i++) {
|
||||
defval=0;
|
||||
switch(cfgoptions[i].type) {
|
||||
case TYPE_STRING:
|
||||
defval=config_setdefault_string(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_STRINGLIST:
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
defval=config_setdefault_int(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
defval=config_setdefault_double(&(cfgoptions[i]), prefix);
|
||||
break;
|
||||
case TYPE_IPV4ADDR:
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]), prefix);
|
||||
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"[CONFIG] %s.%s type %i not supported\n",prefix, cfgoptions[i].optname,cfgoptions[i].type);
|
||||
fatalerror=1;
|
||||
break;
|
||||
} /* switch on param type */
|
||||
if (defval == 1) {
|
||||
numdefvals++;
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF;
|
||||
}
|
||||
} /* for loop on options */
|
||||
printf("[CONFIG] %s: %i/%i parameters successfully set \n",
|
||||
((prefix == NULL)?"(root)":prefix),
|
||||
numdefvals,numoptions );
|
||||
if (fatalerror == 1) {
|
||||
fprintf(stderr,"[CONFIG] fatal errors found when assigning %s parameters \n",
|
||||
prefix);
|
||||
}
|
||||
return numdefvals;
|
||||
}
|
||||
|
||||
configmodule_interface_t *load_configmodule(int argc, char **argv)
|
||||
{
|
||||
@@ -110,17 +180,19 @@ uint32_t tmpflags=0;
|
||||
int i;
|
||||
|
||||
/* first parse the command line to look for the -O option */
|
||||
opterr=0;
|
||||
for (i = 0;i<argc;i++) {
|
||||
if (strlen(argv[i]) < 2) continue;
|
||||
if ( argv[i][1] == 'O' && i < (argc -1)) {
|
||||
cfgparam = argv[i+1];
|
||||
}
|
||||
if ( argv[i][1] == 'h' ) {
|
||||
if ( strstr(argv[i], "help_config") != NULL ) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
exit(0);
|
||||
}
|
||||
if ( (strcmp(argv[i]+1, "h") == 0) || (strstr(argv[i]+1, "help_") != NULL ) ) {
|
||||
tmpflags = CONFIG_HELP;
|
||||
}
|
||||
}
|
||||
optind=1;
|
||||
|
||||
/* look for the OAI_CONFIGMODULE environement variable */
|
||||
if ( cfgparam == NULL ) {
|
||||
@@ -129,21 +201,25 @@ int i;
|
||||
|
||||
/* default */
|
||||
if (cfgparam == NULL) {
|
||||
tmpflags = tmpflags | CONFIG_NOOOPT;
|
||||
cfgparam = DEFAULT_CFGMODE ":" DEFAULT_CFGFILENAME;
|
||||
}
|
||||
tmpflags = tmpflags | CONFIG_NOOOPT;
|
||||
if (strstr(argv[0],"uesoftmodem") == NULL) {
|
||||
cfgparam = CONFIG_LIBCONFIGFILE ":" DEFAULT_CFGFILENAME;
|
||||
} else {
|
||||
cfgparam = CONFIG_CMDLINEONLY ":dbgl0" ;
|
||||
}
|
||||
}
|
||||
|
||||
/* parse the config parameters to set the config source */
|
||||
i = sscanf(cfgparam,"%m[^':']:%ms",&cfgmode,&modeparams);
|
||||
if (i< 0) {
|
||||
fprintf(stderr,"[CONFIG] %s, %d, sscanf error parsing config source %s: %s\n", __FILE__, __LINE__,cfgparam, strerror(errno));
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
modeparams = strdup(DEFAULT_CFGFILENAME);
|
||||
exit(-1);
|
||||
}
|
||||
else if ( i == 1 ) {
|
||||
/* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig
|
||||
with one parameter, the path to the configuration file */
|
||||
modeparams=cfgmode;
|
||||
cfgmode=strdup(DEFAULT_CFGMODE);
|
||||
cfgmode=strdup(CONFIG_LIBCONFIGFILE);
|
||||
}
|
||||
|
||||
cfgptr = malloc(sizeof(configmodule_interface_t));
|
||||
@@ -153,7 +229,6 @@ int i;
|
||||
cfgptr->argc = argc;
|
||||
cfgptr->argv = argv;
|
||||
cfgptr->cfgmode=strdup(cfgmode);
|
||||
|
||||
cfgptr->num_cfgP=0;
|
||||
atoken=strtok_r(modeparams,":",&strtokctx);
|
||||
while ( cfgptr->num_cfgP< CONFIG_MAX_OOPT_PARAMS && atoken != NULL) {
|
||||
@@ -176,46 +251,70 @@ int i;
|
||||
for (i=0;i<cfgptr->num_cfgP; i++) {
|
||||
printf("%s ",cfgptr->cfgP[i]);
|
||||
}
|
||||
printf("\n");
|
||||
printf(", debug flags: 0x%08x\n",cfgptr->rtflags);
|
||||
|
||||
|
||||
i=load_config_sharedlib(cfgptr);
|
||||
if (i< 0) {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module %s couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
|
||||
cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT;
|
||||
if (strstr(cfgparam,CONFIG_CMDLINEONLY) == NULL) {
|
||||
i=load_config_sharedlib(cfgptr);
|
||||
if (i == 0) {
|
||||
printf("[CONFIG] config module %s loaded\n",cfgmode);
|
||||
Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags);
|
||||
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module \"%s\" couldn't be loaded\n", __FILE__, __LINE__,cfgmode);
|
||||
cfgptr->rtflags = cfgptr->rtflags | CONFIG_HELP | CONFIG_ABORT;
|
||||
}
|
||||
} else {
|
||||
printf("[CONFIG] config module %s loaded\n",cfgmode);
|
||||
Config_Params[CONFIGPARAM_DEBUGFLAGS_IDX].uptr=&(cfgptr->rtflags);
|
||||
config_get(Config_Params,CONFIG_PARAMLENGTH(Config_Params), CONFIG_SECTIONNAME );
|
||||
cfgptr->init = (configmodule_initfunc_t)nooptfunc;
|
||||
cfgptr->get = config_cmdlineonly_get;
|
||||
cfgptr->getlist = config_cmdlineonly_getlist;
|
||||
cfgptr->end = (configmodule_endfunc_t)nooptfunc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (modeparams != NULL) free(modeparams);
|
||||
if (cfgmode != NULL) free(cfgmode);
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
// exit(-1);
|
||||
}
|
||||
return cfgptr;
|
||||
}
|
||||
|
||||
void end_configmodule()
|
||||
|
||||
/* free memory allocated when reading parameters */
|
||||
/* config module could be initialized again after this call */
|
||||
void end_configmodule(void)
|
||||
{
|
||||
if (cfgptr != NULL) {
|
||||
if (cfgptr->end != NULL) {
|
||||
printf ("[CONFIG] calling config module end function...\n");
|
||||
cfgptr->end();
|
||||
}
|
||||
|
||||
printf ("[CONFIG] free %u config value pointers\n",cfgptr->numptrs);
|
||||
for(int i=0; i<cfgptr->numptrs ; i++) {
|
||||
if (cfgptr->ptrs[i] != NULL) {
|
||||
free(cfgptr->ptrs[i]);
|
||||
cfgptr->ptrs[i]=NULL;
|
||||
}
|
||||
}
|
||||
cfgptr->numptrs=0;
|
||||
}
|
||||
}
|
||||
|
||||
/* free all memory used by config module */
|
||||
/* should be called only at program exit */
|
||||
void free_configmodule(void)
|
||||
{
|
||||
if (cfgptr != NULL) {
|
||||
end_configmodule();
|
||||
if( cfgptr->cfgmode != NULL) free(cfgptr->cfgmode);
|
||||
printf ("[CONFIG] free %u config parameter pointers\n",cfgptr->num_cfgP);
|
||||
for (int i=0; i<cfgptr->num_cfgP; i++) {
|
||||
if ( cfgptr->cfgP[i] != NULL) free(cfgptr->cfgP[i]);
|
||||
}
|
||||
printf ("[CONFIG] free %u config value pointers\n",cfgptr->numptrs);
|
||||
for(int i=0; i<cfgptr->numptrs ; i++) {
|
||||
if (cfgptr->ptrs[i] != NULL) {
|
||||
free(cfgptr->ptrs[i]);
|
||||
}
|
||||
cfgptr->ptrs[i]=NULL;
|
||||
}
|
||||
|
||||
|
||||
free(cfgptr);
|
||||
cfgptr=NULL;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -40,15 +40,20 @@
|
||||
#define CONFIG_MAX_OOPT_PARAMS 10 // maximum number of parameters in the -O option (-O <cfgmode>:P1:P2...
|
||||
#define CONFIG_MAX_ALLOCATEDPTRS 1024 // maximum number of parameters that can be dynamicaly allocated in the config module
|
||||
|
||||
/* default values for configuration module parameters */
|
||||
#define CONFIG_LIBCONFIGFILE "libconfig" // use libconfig file
|
||||
#define CONFIG_CMDLINEONLY "cmdline" // use only command line options
|
||||
#define DEFAULT_CFGFILENAME "oai.conf" // default config file
|
||||
|
||||
/* rtflags bit position definitions */
|
||||
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
|
||||
#define CONFIG_DEBUGPTR 2 // print memory allocation/free debug messages
|
||||
#define CONFIG_DEBUGCMDLINE 4 // print command line processing messages
|
||||
#define CONFIG_HELP 8 // print help message
|
||||
#define CONFIG_ABORT 16 // config failed,abort execution
|
||||
#define CONFIG_NOOOPT 32 // no -O option found when parsing command line
|
||||
|
||||
|
||||
#define CONFIG_PRINTPARAMS 1 // print parameters values while processing
|
||||
#define CONFIG_DEBUGPTR (1<<1) // print memory allocation/free debug messages
|
||||
#define CONFIG_DEBUGCMDLINE (1<<2) // print command line processing messages
|
||||
#define CONFIG_NOABORTONCHKF (1<<3) // disable abort execution when parameter checking function fails
|
||||
#define CONFIG_NOEXITONHELP (1<<19) // do not exit after printing help
|
||||
#define CONFIG_HELP (1<<20) // print help message
|
||||
#define CONFIG_ABORT (1<<21) // config failed,abort execution
|
||||
#define CONFIG_NOOOPT (1<<22) // no -O option found when parsing command line
|
||||
typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP);
|
||||
typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix);
|
||||
typedef int(*configmodule_getlistfunc_t)(paramlist_def_t *, paramdef_t *,int numparams, char *prefix);
|
||||
@@ -72,7 +77,7 @@ typedef struct configmodule_interface
|
||||
#ifdef CONFIG_LOADCONFIG_MAIN
|
||||
configmodule_interface_t *cfgptr=NULL;
|
||||
|
||||
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbg[debugflags]> \n \
|
||||
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbgl[debugflags]> \n \
|
||||
debugflags can also be defined in the config_libconfig section of the config file\n \
|
||||
debugflags: mask, 1->print parameters, 2->print memory allocations debug messages\n \
|
||||
4->print command line processing debug messages\n ";
|
||||
@@ -94,9 +99,9 @@ extern configmodule_interface_t *cfgptr;
|
||||
#endif
|
||||
|
||||
|
||||
#define printf_params(...) if ( (cfgptr->rtflags & CONFIG_PRINTPARAMS) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_ptrs(...) if ( (cfgptr->rtflags & CONFIG_DEBUGPTR) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_cmdl(...) if ( (cfgptr->rtflags & CONFIG_DEBUGCMDLINE) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_params(...) if ( (cfgptr->rtflags & (CONFIG_PRINTPARAMS)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_ptrs(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGPTR)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
#define printf_cmdl(...) if ( (cfgptr->rtflags & (CONFIG_DEBUGCMDLINE)) != 0 ) { printf ( __VA_ARGS__ ); }
|
||||
|
||||
extern configmodule_interface_t *load_configmodule(int argc, char **argv);
|
||||
extern void end_configmodule(void);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -55,16 +55,61 @@
|
||||
#define PARAMFLAG_PARAMSET (1 << 16) // parameter has been explicitely set in get functions
|
||||
#define PARAMFLAG_PARAMSETDEF (1 << 17) // parameter has been set to default value in get functions
|
||||
|
||||
|
||||
/* checkedparam_t is possibly used in paramdef_t for specific parameter value validation */
|
||||
#define CONFIG_MAX_NUMCHECKVAL 20
|
||||
typedef struct paramdef paramdef_t;
|
||||
typedef union checkedparam {
|
||||
struct {
|
||||
int (*f1)(paramdef_t *param); /* check an integer against a list of authorized values */
|
||||
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values */
|
||||
int num_okintval; /* number of valid values in the checkingval array */
|
||||
} s1;
|
||||
struct {
|
||||
int (*f1a)(paramdef_t *param); /* check an integer against a list of authorized values and set param value */
|
||||
/* to the corresponding item in setintval array (mainly for RRC params) */
|
||||
int okintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store possible values in config file */
|
||||
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
|
||||
int num_okintval; /* number of valid values in the checkingval array */
|
||||
} s1a;
|
||||
struct {
|
||||
int (*f2)(paramdef_t *param); /* check an integer against an authorized range, defined by its min and max value */
|
||||
int okintrange[CONFIG_MAX_NUMCHECKVAL]; /* integer array, store min and max values */
|
||||
|
||||
} s2;
|
||||
struct {
|
||||
int (*f3)(paramdef_t *param); /* check a string against a list of authorized values */
|
||||
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
|
||||
int num_okstrval; /* number of valid values in the checkingval array */
|
||||
} s3;
|
||||
struct {
|
||||
int (*f3a)(paramdef_t *param); /* check a string against a list of authorized values and set param value */
|
||||
/* to the corresponding item in setintval array (mainly for RRC params) */
|
||||
char *okstrval[CONFIG_MAX_NUMCHECKVAL]; /* string array, store possible values */
|
||||
int setintval[CONFIG_MAX_NUMCHECKVAL]; /* integer array, values set in the paramdef structure */
|
||||
int num_okstrval; /* number of valid values in the checkingval array */
|
||||
} s3a;
|
||||
struct {
|
||||
int (*f4)(paramdef_t *param); /* generic check function, no arguments but the param description */
|
||||
|
||||
} s4;
|
||||
struct {
|
||||
void (*checkfunc)(void) ;
|
||||
} s5;
|
||||
} checkedparam_t;
|
||||
|
||||
/* paramdef is used to describe a parameter, array of paramdef_t strustures is used as the main parameter in */
|
||||
/* config apis used to retrieve parameters values */
|
||||
typedef struct paramdef
|
||||
{
|
||||
char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */
|
||||
char *helpstr; /* help string */
|
||||
unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */
|
||||
union { /* pointer to the parameter value, completed by the config module */
|
||||
char optname[MAX_OPTNAME_SIZE]; /* parameter name, can be used as long command line option */
|
||||
char *helpstr; /* help string */
|
||||
unsigned int paramflags; /* value is a "ored" combination of above PARAMFLAG_XXXX values */
|
||||
union { /* pointer to the parameter value, completed by the config module */
|
||||
char **strptr;
|
||||
char **strlistptr;
|
||||
uint8_t *u8ptr;
|
||||
char *i8ptr;
|
||||
int8_t *i8ptr;
|
||||
uint16_t *u16ptr;
|
||||
int16_t *i16ptr;
|
||||
uint32_t *uptr;
|
||||
@@ -72,18 +117,21 @@ typedef struct paramdef
|
||||
uint64_t *u64ptr;
|
||||
int64_t *i64ptr;
|
||||
double *dblptr;
|
||||
void *voidptr;
|
||||
} ;
|
||||
union { /* default parameter value, to be used when PARAMFLAG_MANDATORY is not specified */
|
||||
char *defstrval;
|
||||
char **defstrlistval;
|
||||
uint32_t defuintval;
|
||||
int defintval;
|
||||
uint64_t defint64val;
|
||||
int *defintarrayval;
|
||||
double defdblval;
|
||||
char *defstrval;
|
||||
char **defstrlistval;
|
||||
uint32_t defuintval;
|
||||
int defintval;
|
||||
uint64_t defint64val;
|
||||
int *defintarrayval;
|
||||
double defdblval;
|
||||
} ;
|
||||
char type; /* parameter value type, as listed below as TYPE_XXXX macro */
|
||||
int numelt; /* number of elements in a list or array parameters or max size of string value */
|
||||
checkedparam_t *chkPptr; /* possible pointer to the structure containing the info used to check parameter values */
|
||||
int *processedvalue; /* used to store integer values computed from string original value */
|
||||
} paramdef_t;
|
||||
|
||||
#define TYPE_INT TYPE_INT32
|
||||
@@ -100,7 +148,10 @@ typedef struct paramdef
|
||||
#define TYPE_MASK 10
|
||||
#define TYPE_DOUBLE 16
|
||||
#define TYPE_IPV4ADDR 20
|
||||
#define TYPE_LASTSCALAR 25
|
||||
|
||||
#define PARAM_ISLISTORARRAY(P) (P->type > TYPE_LASTSCALAR )
|
||||
#define PARAM_ISSCALAR(P) (P->type < TYPE_LASTSCALAR )
|
||||
|
||||
#define TYPE_STRINGLIST 50
|
||||
#define TYPE_INTARRAY 51
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -35,7 +35,10 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "config_userapi.h"
|
||||
extern void exit_fun(const char* s); // lte-softmodem clean exit function
|
||||
|
||||
|
||||
configmodule_interface_t *config_get_if(void)
|
||||
@@ -49,17 +52,37 @@ configmodule_interface_t *config_get_if(void)
|
||||
|
||||
char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
|
||||
{
|
||||
|
||||
if (ptr == NULL ) {
|
||||
ptr = malloc(sizeof(char *));
|
||||
if (ptr != NULL) {
|
||||
*ptr=NULL;
|
||||
cfgoptions->strptr=ptr;
|
||||
if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) == 0) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)ptr;
|
||||
config_get_if()->numptrs++;
|
||||
}
|
||||
} else {
|
||||
fprintf(stderr, "[CONFIG] %s %d option %s, cannot allocate pointer: %s \n",
|
||||
__FILE__, __LINE__, cfgoptions->optname, strerror(errno));
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
printf_ptrs("[CONFIG] %s ptr: 0x%08lx requested size: %i\n",cfgoptions->optname,(uintptr_t)(ptr),length);
|
||||
if(cfgoptions->numelt > 0) { /* already allocated */
|
||||
return *ptr;
|
||||
if(cfgoptions->numelt > 0 && PARAM_ISSCALAR(cfgoptions) ) { /* already allocated */
|
||||
if (*ptr != NULL) {
|
||||
return *ptr;
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s %d option %s, definition error: value pointer is NULL, declared as %i bytes allocated\n",
|
||||
__FILE__, __LINE__,cfgoptions->optname, cfgoptions->numelt);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (*ptr == NULL) {
|
||||
*ptr = malloc(length);
|
||||
if ( *ptr != NULL) {
|
||||
memset(*ptr,0,length);
|
||||
if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) != 0) {
|
||||
if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) == 0) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = *ptr;
|
||||
config_get_if()->numptrs++;
|
||||
}
|
||||
@@ -74,7 +97,7 @@ char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
|
||||
void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val)
|
||||
{
|
||||
int tmpval=val;
|
||||
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >1) {
|
||||
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >0) {
|
||||
tmpval =1;
|
||||
}
|
||||
switch (cfgoptions->type) {
|
||||
@@ -111,7 +134,29 @@ int tmpval=val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
void config_assign_processedint(paramdef_t *cfgoption, int val) {
|
||||
cfgoption->processedvalue = malloc(sizeof(int));
|
||||
if ( cfgoption->processedvalue != NULL) {
|
||||
*(cfgoption->processedvalue) = val;
|
||||
} else {
|
||||
fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
int config_get_processedint(paramdef_t *cfgoption) {
|
||||
int ret;
|
||||
if ( cfgoption->processedvalue != NULL) {
|
||||
ret=*(cfgoption->processedvalue);
|
||||
free( cfgoption->processedvalue);
|
||||
cfgoption->processedvalue=NULL;
|
||||
printf_params("[CONFIG] %s: set from %s to %i\n",cfgoption->optname, *(cfgoption->strptr), ret);
|
||||
} else {
|
||||
fprintf (stderr,"[CONFIG] %s %d %s has no processed integer availablle\n",__FILE__, __LINE__, cfgoption->optname);
|
||||
ret=0;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
void config_printhelp(paramdef_t *params,int numparams)
|
||||
{
|
||||
for (int i=0 ; i<numparams ; i++) {
|
||||
@@ -124,13 +169,33 @@ void config_printhelp(paramdef_t *params,int numparams)
|
||||
}
|
||||
}
|
||||
|
||||
int config_execcheck(paramdef_t *params,int numparams, char *prefix)
|
||||
{
|
||||
int st=0;
|
||||
|
||||
for (int i=0 ; i<numparams ; i++) {
|
||||
if ( params[i].chkPptr == NULL) {
|
||||
continue;
|
||||
}
|
||||
if (params[i].chkPptr->s4.f4 != NULL) {
|
||||
st += params[i].chkPptr->s4.f4(&(params[i]));
|
||||
}
|
||||
}
|
||||
if (st != 0) {
|
||||
fprintf(stderr,"[CONFIG] config_execcheck: section %s %i parameters with wrong value\n", prefix, -st);
|
||||
if ( CONFIG_ISFLAGSET(CONFIG_NOABORTONCHKF) == 0) {
|
||||
exit_fun("exit because configuration failed\n");
|
||||
}
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
int config_get(paramdef_t *params,int numparams, char *prefix)
|
||||
{
|
||||
int ret= -1;
|
||||
|
||||
printf("numparams:%d prefix:%s\n", numparams, prefix);
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n");
|
||||
fprintf(stderr,"[CONFIG] config_get, section %s skipped, config module not properly initialized\n",prefix);
|
||||
return ret;
|
||||
}
|
||||
configmodule_interface_t *cfgif = config_get_if();
|
||||
@@ -138,6 +203,7 @@ configmodule_interface_t *cfgif = config_get_if();
|
||||
ret = config_get_if()->get(params, numparams,prefix);
|
||||
if (ret >= 0) {
|
||||
config_process_cmdline(params,numparams,prefix);
|
||||
config_execcheck(params,numparams,prefix);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -153,6 +219,201 @@ int config_isparamset(paramdef_t *params,int paramidx)
|
||||
}
|
||||
}
|
||||
|
||||
int config_getparamval_fromparamdefidx(paramdef_t *cfgoptions,int paramidx) {
|
||||
void print_intvalueerror(paramdef_t *param, char *fname, int *okval, int numokval) {
|
||||
fprintf(stderr,"[CONFIG] %s: %s: %i invalid value, authorized values:\n ",
|
||||
fname,param->optname, (int)*(param->uptr));
|
||||
for ( int i=0; i<numokval ; i++) {
|
||||
fprintf(stderr, " %i",okval[i]);
|
||||
}
|
||||
fprintf(stderr, " \n");
|
||||
}
|
||||
|
||||
int config_check_intval(paramdef_t *param)
|
||||
{
|
||||
if ( param == NULL ){
|
||||
fprintf(stderr,"[CONFIG] config_check_intval: NULL param argument\n");
|
||||
return -1;
|
||||
}
|
||||
for ( int i=0; i<param->chkPptr->s1.num_okintval ; i++) {
|
||||
if( *(param->uptr) == param->chkPptr->s1.okintval[i] ) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
print_intvalueerror(param,"config_check_intval", param->chkPptr->s1.okintval,param->chkPptr->s1.num_okintval);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_check_modify_integer(paramdef_t *param)
|
||||
{
|
||||
|
||||
for (int i=0; i < param->chkPptr->s1a.num_okintval ; i++) {
|
||||
if (*(param->uptr) == param->chkPptr->s1a.okintval[i] ) {
|
||||
printf_params("[CONFIG] %s: read value %i, set to %i\n",param->optname,*(param->uptr),param->chkPptr->s1a.setintval [i]);
|
||||
*(param->uptr) = param->chkPptr->s1a.setintval [i];
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
print_intvalueerror(param,"config_check_modify_integer", param->chkPptr->s1a.okintval,param->chkPptr->s1a.num_okintval);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_check_intrange(paramdef_t *param)
|
||||
{
|
||||
if( *(param->iptr) >= param->chkPptr->s2.okintrange[0] && *(param->iptr) <= param->chkPptr->s2.okintrange[1] ) {
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr,"[CONFIG] config_check_intrange: %s: %i invalid value, authorized range: %i %i\n",
|
||||
param->optname, (int)*(param->uptr), param->chkPptr->s2.okintrange[0], param->chkPptr->s2.okintrange[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void print_strvalueerror(paramdef_t *param, char *fname, char **okval, int numokval) {
|
||||
fprintf(stderr,"[CONFIG] %s: %s: %s invalid value, authorized values:\n ",
|
||||
fname,param->optname, *(param->strptr));
|
||||
for ( int i=0; i<numokval ; i++) {
|
||||
fprintf(stderr, " %s",okval[i]);
|
||||
}
|
||||
fprintf(stderr, " \n");
|
||||
}
|
||||
|
||||
int config_check_strval(paramdef_t *param)
|
||||
{
|
||||
if ( param == NULL ){
|
||||
fprintf(stderr,"[CONFIG] config_check_strval: NULL param argument\n");
|
||||
return -1;
|
||||
}
|
||||
for ( int i=0; i<param->chkPptr->s3.num_okstrval ; i++) {
|
||||
if( strcasecmp(*(param->strptr),param->chkPptr->s3.okstrval[i] ) == 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
print_strvalueerror(param, "config_check_strval", param->chkPptr->s3.okstrval, param->chkPptr->s3.num_okstrval);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_checkstr_assign_integer(paramdef_t *param)
|
||||
{
|
||||
|
||||
|
||||
for (int i=0; i < param->chkPptr->s3a.num_okstrval ; i++) {
|
||||
if (strcasecmp(*(param->strptr),param->chkPptr->s3a.okstrval[i] ) == 0) {
|
||||
config_assign_processedint(param, param->chkPptr->s3a.setintval[i]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
print_strvalueerror(param, "config_check_strval", param->chkPptr->s3a.okstrval, param->chkPptr->s3a.num_okstrval);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int config_setdefault_string(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
if( cfgoptions->defstrval != NULL) {
|
||||
status=1;
|
||||
|
||||
if (cfgoptions->numelt == 0 ) {
|
||||
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
|
||||
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(cfgoptions->defstrval)+1);
|
||||
sprintf(*(cfgoptions->strptr), "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, *(cfgoptions->strptr));
|
||||
} else {
|
||||
sprintf((char *)*(cfgoptions->strptr), "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (char *)*(cfgoptions->strptr));
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
if( cfgoptions->defstrlistval != NULL) {
|
||||
cfgoptions->strlistptr=cfgoptions->defstrlistval;
|
||||
status=1;
|
||||
for(int j=0; j<cfgoptions->numelt; j++)
|
||||
printf_params("[CONFIG] %s.%s[%i] set to default value %s\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname,j, cfgoptions->strlistptr[j]);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_int(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, (char **)(&(cfgoptions->iptr)),sizeof(int32_t));
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
config_assign_int(cfgoptions,cfgoptions->optname,cfgoptions->defintval);
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s.%s set to default value\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(long long));
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->u64ptr)=cfgoptions->defuintval;
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s.%s set to default value %llu\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (long long unsigned)(*(cfgoptions->u64ptr)));
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
if( cfgoptions->defintarrayval != NULL) {
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->iptr), sizeof(int32_t*));
|
||||
cfgoptions->iptr=cfgoptions->defintarrayval;
|
||||
status=1;
|
||||
for (int j=0; j<cfgoptions->numelt ; j++) {
|
||||
printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname ,j,(int)cfgoptions->iptr[j]);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_setdefault_double(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double));
|
||||
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions->u64ptr)=cfgoptions->defdblval;
|
||||
status=1;
|
||||
printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname , *(cfgoptions->dblptr));
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr)
|
||||
{
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->uptr), sizeof(int));
|
||||
int rst=inet_pton(AF_INET, ipv4addr ,cfgoptions->uptr );
|
||||
if (rst == 1 && *(cfgoptions->uptr) > 0) {
|
||||
printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr);
|
||||
return 1;
|
||||
} else {
|
||||
if ( strncmp(ipv4addr,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
|
||||
printf_params("[CONFIG] %s:%s (INADDR_ANY) \n",cfgoptions->optname,ipv4addr);
|
||||
*cfgoptions->uptr=INADDR_ANY;
|
||||
return 1;
|
||||
} else {
|
||||
fprintf(stderr,"[CONFIG] %s not valid for %s \n", ipv4addr, cfgoptions->optname);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix)
|
||||
{
|
||||
int status = 0;
|
||||
|
||||
if (cfgoptions->defstrval != NULL) {
|
||||
status = config_assign_ipv4addr(cfgoptions, cfgoptions->defstrval);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -38,24 +38,49 @@
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#define DEFAULT_CFGFILENAME "oaisoftmodem.conf"
|
||||
#define DEFAULT_CFGMODE "libconfig"
|
||||
/* get rid of "exit_fun undeclared" warning */
|
||||
extern void exit_fun(const char* s);
|
||||
|
||||
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
|
||||
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
|
||||
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
|
||||
#define CONFIG_ISFLAGSET(P) ( (config_get_if()==NULL) ? 0 : !!(config_get_if()->rtflags & P))
|
||||
|
||||
#define CONFIG_SETRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags |= P; }
|
||||
#define CONFIG_CLEARRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags &= (~P); }
|
||||
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
|
||||
/* utility functions, to be used by configuration module and/or configuration libraries */
|
||||
extern configmodule_interface_t *config_get_if(void);
|
||||
extern char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
|
||||
extern void config_printhelp(paramdef_t *,int numparams);
|
||||
extern int config_process_cmdline(paramdef_t *params,int numparams, char *prefix);
|
||||
extern int config_get(paramdef_t *params,int numparams, char *prefix);
|
||||
extern int config_isparamset(paramdef_t *params,int paramidx);
|
||||
extern void config_assign_processedint(paramdef_t *cfgoption, int val);
|
||||
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
|
||||
extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix);
|
||||
extern int config_getparamval_fromparamdefidx(paramdef_t *cfgoptions,int paramidx);
|
||||
extern int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr);
|
||||
|
||||
/* apis to get parameters, to be used by oai modules, at configuration time */
|
||||
extern int config_get(paramdef_t *params,int numparams, char *prefix);
|
||||
#define config_getlist config_get_if()->getlist
|
||||
|
||||
/* apis to retrieve parameters info after calling get or getlist functions */
|
||||
extern int config_isparamset(paramdef_t *params,int paramidx);
|
||||
extern int config_get_processedint(paramdef_t *cfgoption);
|
||||
|
||||
/* functions to be used in parameters definition, to check parameters values */
|
||||
extern int config_check_intval(paramdef_t *param);
|
||||
extern int config_check_modify_integer(paramdef_t *param);
|
||||
extern int config_check_intrange(paramdef_t *param);
|
||||
extern int config_check_strval(paramdef_t *param);
|
||||
extern int config_checkstr_assign_integer(paramdef_t *param);
|
||||
|
||||
/* functions to set a parameter to its default value */
|
||||
extern int config_setdefault_string(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_stringlist(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_int(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_int64(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_double(paramdef_t *cfgoptions, char *prefix);
|
||||
extern int config_setdefault_ipv4addr(paramdef_t *cfgoptions, char *prefix);
|
||||
|
||||
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -1,3 +1,33 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
/*! \file common/config/libconfig/config_libconfig.c
|
||||
* \brief: implementation libconfig configuration library
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include <libconfig.h>
|
||||
|
||||
@@ -21,21 +51,23 @@ int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath
|
||||
{
|
||||
const char *str;
|
||||
int st;
|
||||
int numelt;
|
||||
|
||||
cfgoptions->numelt=config_setting_length(setting);
|
||||
cfgoptions->strlistptr=malloc(sizeof(char *) * (cfgoptions->numelt));
|
||||
numelt=config_setting_length(setting);
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
|
||||
st=0;
|
||||
for (int i=0; i< cfgoptions->numelt && cfgoptions->strlistptr != NULL; i++) {
|
||||
for (int i=0; i< numelt ; i++) {
|
||||
str=config_setting_get_string_elem(setting,i);
|
||||
if (str==NULL) {
|
||||
printf("[LIBCONFIG] %s%i not found in config file\n", cfgoptions->optname,i);
|
||||
} else {
|
||||
cfgoptions->strlistptr[i]=malloc(strlen(str)+1);
|
||||
config_check_valptr(cfgoptions,&(cfgoptions->strlistptr[i]),strlen(str)+1);
|
||||
sprintf(cfgoptions->strlistptr[i],"%s",str);
|
||||
st++;
|
||||
printf_params("[LIBCONFIG] %s%i: %s\n", cfgpath,i,cfgoptions->strlistptr[i]);
|
||||
}
|
||||
}
|
||||
cfgoptions->numelt=numelt;
|
||||
return st;
|
||||
}
|
||||
|
||||
@@ -97,7 +129,6 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
switch(cfgoptions[i].type)
|
||||
{
|
||||
case TYPE_STRING:
|
||||
|
||||
if ( config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
if ( cfgoptions[i].numelt > 0 && str != NULL && strlen(str) >= cfgoptions[i].numelt ) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s: %s exceeds maximum length of %i bytes, value truncated\n",
|
||||
@@ -105,30 +136,16 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
str[strlen(str)-1] = 0;
|
||||
}
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
// config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(str)+1);
|
||||
sprintf( *(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,*(cfgoptions[i].strptr) );
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,*(cfgoptions[i].strptr) );
|
||||
} else {
|
||||
sprintf( (char *)(cfgoptions[i].strptr) , "%s", str);
|
||||
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,(char *)cfgoptions[i].strptr );
|
||||
printf_params("[LIBCONFIG] %s: \"%s\"\n", cfgpath,(char *)cfgoptions[i].strptr );
|
||||
}
|
||||
} else {
|
||||
if( cfgoptions[i].defstrval != NULL) {
|
||||
defval=1;
|
||||
|
||||
if (cfgoptions[i].numelt == 0 ) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].strptr)), sizeof(char *));
|
||||
config_check_valptr(&(cfgoptions[i]), cfgoptions[i].strptr, strlen(cfgoptions[i].defstrval)+1);
|
||||
sprintf(*(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
|
||||
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, *(cfgoptions[i].strptr));
|
||||
} else {
|
||||
sprintf((char *)(cfgoptions[i].strptr), "%s",cfgoptions[i].defstrval);
|
||||
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, (char *)cfgoptions[i].strptr);
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_string(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_STRINGLIST:
|
||||
@@ -136,14 +153,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
if ( setting != NULL) {
|
||||
read_strlist(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
if( cfgoptions[i].defstrlistval != NULL) {
|
||||
cfgoptions[i].strlistptr=cfgoptions[i].defstrlistval;
|
||||
defval=1;
|
||||
for(int j=0; j<cfgoptions[i].numelt; j++)
|
||||
printf_params("[LIBCONFIG] %s%i set to default value %s\n", cfgpath,j, cfgoptions[i].strlistptr[j]);
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_stringlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT8:
|
||||
@@ -153,23 +163,17 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_MASK:
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int32_t));
|
||||
if ( config_lookup_int(&(libconfig_privdata.cfg),cfgpath, &u)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)(&(cfgoptions[i].iptr)),sizeof(int32_t));
|
||||
config_assign_int(&(cfgoptions[i]),cfgpath,u);
|
||||
} else {
|
||||
if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
config_assign_int(&(cfgoptions[i]),cfgpath,cfgoptions[i].defintval);
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value\n", cfgpath);
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_int(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long));
|
||||
if ( config_lookup_int64(&(libconfig_privdata.cfg),cfgpath, &llu)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].i64ptr),sizeof(long long));
|
||||
if(cfgoptions[i].type==TYPE_UINT64) {
|
||||
*(cfgoptions[i].u64ptr) = (uint64_t)llu;
|
||||
printf_params("[LIBCONFIG] %s: %llu\n", cfgpath,(long long unsigned)(*(cfgoptions[i].u64ptr)) );
|
||||
@@ -178,13 +182,7 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
printf_params("[LIBCONFIG] %s: %lli\n", cfgpath,(long long unsigned)(*(cfgoptions[i].i64ptr)) );
|
||||
}
|
||||
} else {
|
||||
if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions[i].u64ptr)=cfgoptions[i].defuintval;
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value %llu\n", cfgpath, (long long unsigned)(*(cfgoptions[i].u64ptr)));
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_int64(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINTARRAY:
|
||||
@@ -193,57 +191,28 @@ int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
if ( setting != NULL) {
|
||||
read_intarray(&cfgoptions[i],setting,cfgpath);
|
||||
} else {
|
||||
if( cfgoptions[i].defintarrayval != NULL) {
|
||||
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].iptr), sizeof(int32_t*));
|
||||
cfgoptions[i].iptr=cfgoptions[i].defintarrayval;
|
||||
defval=1;
|
||||
for (int j=0; j<cfgoptions[i].numelt ; j++) {
|
||||
printf_params("[LIBCONFIG] %s[%i] set to default value %i\n", cfgpath,j,(int)cfgoptions[i].iptr[j]);
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_intlist(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double));
|
||||
if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) {
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double));
|
||||
*(cfgoptions[i].dblptr) = dbl;
|
||||
printf_params("[LIBCONFIG] %s: %lf\n", cfgpath,*(cfgoptions[i].dblptr) );
|
||||
} else {
|
||||
if( ((cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) == 0)) {
|
||||
*(cfgoptions[i].u64ptr)=cfgoptions[i].defdblval;
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value %lf\n", cfgpath, *(cfgoptions[i].dblptr));
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
defval=config_setdefault_double(&(cfgoptions[i]),prefix);
|
||||
}
|
||||
break;
|
||||
case TYPE_IPV4ADDR:
|
||||
config_check_valptr(&(cfgoptions[i]),(char **)&(cfgoptions[i].uptr), sizeof(int));
|
||||
if ( !config_lookup_string(&(libconfig_privdata.cfg),cfgpath, (const char **)&str)) {
|
||||
str=cfgoptions[i].defstrval;
|
||||
defval=1;
|
||||
printf_params("[LIBCONFIG] %s set to default value %s\n", cfgpath, str);
|
||||
}
|
||||
if (str != NULL) {
|
||||
rst=inet_pton(AF_INET, str,cfgoptions[i].uptr );
|
||||
if (rst == 1 && *(cfgoptions[i].uptr) > 0) {
|
||||
printf_params("[LIBCONFIG] %s: %s\n", cfgpath,str );
|
||||
} else {
|
||||
if ( strncmp(str,ANY_IPV4ADDR_STRING,sizeof(ANY_IPV4ADDR_STRING)) == 0) {
|
||||
printf_params("[LIBCONFIG] %s:%s (INADDR_ANY) \n",cfgpath,str);
|
||||
*cfgoptions[i].uptr=INADDR_ANY;
|
||||
} else {
|
||||
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
|
||||
fatalerror=1;
|
||||
}
|
||||
defval=config_setdefault_ipv4addr(&(cfgoptions[i]),prefix);
|
||||
} else {
|
||||
rst=config_assign_ipv4addr(cfgoptions, str);
|
||||
if (rst < 0) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s not valid for %s \n", str, cfgpath);
|
||||
fatalerror=1;
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case TYPE_LIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
@@ -374,6 +343,7 @@ void config_libconfig_end(void )
|
||||
config_destroy(&(libconfig_privdata.cfg));
|
||||
if ( libconfig_privdata.configfile != NULL ) {
|
||||
free(libconfig_privdata.configfile);
|
||||
libconfig_privdata.configfile=NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -35,11 +35,11 @@
|
||||
|
||||
#include <pthread.h>
|
||||
#include "COMMON/platform_constants.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/defs_eNB.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
#include "RRC/LITE/defs.h"
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
#include "gtpv1u.h"
|
||||
@@ -48,6 +48,8 @@
|
||||
#include "NwGtpv1uPrivate.h"
|
||||
#include "gtpv1u_eNB_defs.h"
|
||||
|
||||
#include "PHY/defs_L1_NB_IoT.h"
|
||||
#include "RRC/LTE/defs_NB_IoT.h"
|
||||
typedef struct {
|
||||
/// RAN context config file name
|
||||
char *config_file_name;
|
||||
@@ -55,12 +57,18 @@ typedef struct {
|
||||
int nb_inst;
|
||||
/// Number of Component Carriers per instance in this node
|
||||
int *nb_CC;
|
||||
/// Number of NB_IoT instances in this node
|
||||
int nb_nb_iot_rrc_inst;
|
||||
/// Number of MACRLC instances in this node
|
||||
int nb_macrlc_inst;
|
||||
/// Number of NB_IoT MACRLC instances in this node
|
||||
int nb_nb_iot_macrlc_inst;
|
||||
/// Number of component carriers per instance in this node
|
||||
int *nb_mac_CC;
|
||||
/// Number of L1 instances in this node
|
||||
int nb_L1_inst;
|
||||
/// Number of NB_IoT L1 instances in this node
|
||||
int nb_nb_iot_L1_inst;
|
||||
/// Number of Component Carriers per instance in this node
|
||||
int *nb_L1_CC;
|
||||
/// Number of RU instances in this node
|
||||
@@ -69,10 +77,16 @@ typedef struct {
|
||||
flexran_agent_info_t **flexran;
|
||||
/// eNB context variables
|
||||
struct PHY_VARS_eNB_s ***eNB;
|
||||
/// NB_IoT L1 context variables
|
||||
struct PHY_VARS_eNB_NB_IoT_s **L1_NB_IoT;
|
||||
/// RRC context variables
|
||||
struct eNB_RRC_INST_s **rrc;
|
||||
/// RRC context variables
|
||||
/// NB_IoT RRC context variables
|
||||
//struct eNB_RRC_INST_NB_IoT_s **nb_iot_rrc;
|
||||
/// MAC context variables
|
||||
struct eNB_MAC_INST_s **mac;
|
||||
/// NB_IoT MAC context variables
|
||||
struct eNB_MAC_INST_NB_IoT_s **nb_iot_mac;
|
||||
/// GTPu descriptor
|
||||
gtpv1u_data_t *gtpv1u_data_g;
|
||||
/// RU descriptors. These describe what each radio unit is supposed to do and contain the necessary functions for fronthaul interfaces
|
||||
|
||||
707
common/utils/LOG/log.c
Normal file
707
common/utils/LOG/log.c
Normal file
@@ -0,0 +1,707 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file log.c
|
||||
* \brief log implementaion
|
||||
* \author Navid Nikaein
|
||||
* \date 2009 - 2014
|
||||
* \version 0.5
|
||||
* @ingroup util
|
||||
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE /* required for pthread_getname_np */
|
||||
//#define LOG_TEST 1
|
||||
|
||||
#define COMPONENT_LOG
|
||||
#define COMPONENT_LOG_IF
|
||||
#include <ctype.h>
|
||||
#define LOG_MAIN
|
||||
#include "log.h"
|
||||
#include "vcd_signal_dumper.h"
|
||||
#include "assertions.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
# include "intertask_interface.h"
|
||||
#endif
|
||||
|
||||
# include <pthread.h>
|
||||
# include <string.h>
|
||||
#include <linux/prctl.h>
|
||||
#include "common/config/config_userapi.h"
|
||||
// main log variables
|
||||
|
||||
|
||||
|
||||
|
||||
mapping log_level_names[] = {
|
||||
{"error", OAILOG_ERR},
|
||||
{"file", OAILOG_FILE},
|
||||
{"warn", OAILOG_WARNING},
|
||||
{"info", OAILOG_INFO},
|
||||
{"debug", OAILOG_DEBUG},
|
||||
{"trace", OAILOG_TRACE},
|
||||
{NULL, -1}
|
||||
};
|
||||
|
||||
mapping log_options[] = {
|
||||
{"nocolor", FLAG_NOCOLOR },
|
||||
{"level", FLAG_LEVEL },
|
||||
{"thread", FLAG_THREAD },
|
||||
{NULL,-1}
|
||||
};
|
||||
|
||||
|
||||
mapping log_maskmap[] = {
|
||||
{"prach", DEBUG_PRACH},
|
||||
{"RU", DEBUG_RU},
|
||||
{"LTEESTIM", DEBUG_LTEESTIM},
|
||||
{"ctrlsocket", DEBUG_CTRLSOCKET},
|
||||
{"UE_PHYPROC", DEBUG_UE_PHYPROC},
|
||||
{"UE_TIMING", UE_TIMING},
|
||||
{NULL,-1}
|
||||
};
|
||||
|
||||
char *log_level_highlight_start[] = {LOG_RED, LOG_GREEN, LOG_ORANGE, "", LOG_BLUE, LOG_CYBL}; /*!< \brief Optional start-format strings for highlighting */
|
||||
char *log_level_highlight_end[] = {LOG_RESET,LOG_RESET,LOG_RESET,LOG_RESET, LOG_RESET,LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
|
||||
|
||||
|
||||
int write_file_matlab(const char *fname,const char *vname,void *data,int length,int dec,char format)
|
||||
{
|
||||
|
||||
FILE *fp=NULL;
|
||||
int i;
|
||||
|
||||
if (data == NULL)
|
||||
return -1;
|
||||
//printf("Writing %d elements of type %d to %s\n",length,format,fname);
|
||||
|
||||
|
||||
if (format == 10 || format ==11 || format == 12 || format == 13 || format == 14) {
|
||||
fp = fopen(fname,"a+");
|
||||
} else if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14) {
|
||||
fp = fopen(fname,"w+");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (fp== NULL) {
|
||||
printf("[OPENAIR][FILE OUTPUT] Cannot open file %s\n",fname);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (format != 10 && format !=11 && format != 12 && format != 13 && format != 14)
|
||||
fprintf(fp,"%s = [",vname);
|
||||
|
||||
|
||||
switch (format) {
|
||||
case 0: // real 16-bit
|
||||
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((short *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1: // complex 16-bit
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
fprintf(fp,"%d + j*(%d)\n",((short *)data)[i],((short *)data)[i+1]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 2: // real 32-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((int *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 3: // complex 32-bit
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
fprintf(fp,"%d + j*(%d)\n",((int *)data)[i],((int *)data)[i+1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4: // real 8-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((char *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5: // complex 8-bit
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
fprintf(fp,"%d + j*(%d)\n",((char *)data)[i],((char *)data)[i+1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6: // real 64-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%lld\n",((long long*)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 7: // real double
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%g\n",((double *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 8: // complex double
|
||||
for (i=0; i<length<<1; i+=2*dec) {
|
||||
fprintf(fp,"%g + j*(%g)\n",((double *)data)[i], ((double *)data)[i+1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 9: // real unsigned 8-bit
|
||||
for (i=0; i<length; i+=dec) {
|
||||
fprintf(fp,"%d\n",((unsigned char *)data)[i]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 10 : // case eren 16 bit complex :
|
||||
|
||||
for (i=0; i<length<<1; i+=(2*dec)) {
|
||||
|
||||
if((i < 2*(length-1)) && (i > 0))
|
||||
fprintf(fp,"%d + j*(%d),",((short *)data)[i],((short *)data)[i+1]);
|
||||
else if (i == 2*(length-1))
|
||||
fprintf(fp,"%d + j*(%d);",((short *)data)[i],((short *)data)[i+1]);
|
||||
else if (i == 0)
|
||||
fprintf(fp,"\n%d + j*(%d),",((short *)data)[i],((short *)data)[i+1]);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 11 : //case eren 16 bit real for channel magnitudes:
|
||||
for (i=0; i<length; i+=dec) {
|
||||
|
||||
if((i <(length-1))&& (i > 0))
|
||||
fprintf(fp,"%d,",((short *)data)[i]);
|
||||
else if (i == (length-1))
|
||||
fprintf(fp,"%d;",((short *)data)[i]);
|
||||
else if (i == 0)
|
||||
fprintf(fp,"\n%d,",((short *)data)[i]);
|
||||
}
|
||||
|
||||
printf("\n eren: length :%d",length);
|
||||
break;
|
||||
|
||||
case 12 : // case eren for log2_maxh real unsigned 8 bit
|
||||
fprintf(fp,"%d \n",((unsigned char *)&data)[0]);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (format != 10 && format !=11 && format !=12 && format != 13 && format != 15) {
|
||||
fprintf(fp,"];\n");
|
||||
fclose(fp);
|
||||
return(0);
|
||||
} else if (format == 10 || format ==11 || format == 12 || format == 13 || format == 15) {
|
||||
fclose(fp);
|
||||
return(0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* get log parameters from configuration file */
|
||||
void log_getconfig(log_t *g_log) {
|
||||
char *gloglevel = NULL;
|
||||
int level;
|
||||
|
||||
|
||||
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
|
||||
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
|
||||
paramdef_t logparams_debug[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
paramdef_t logparams_matlab[sizeof(log_maskmap)/sizeof(mapping)];
|
||||
|
||||
int ret = config_get( logparams_defaults,sizeof(logparams_defaults)/sizeof(paramdef_t),CONFIG_STRING_LOG_PREFIX);
|
||||
if (ret <0) {
|
||||
fprintf(stderr,"[LOG] init aborted, configuration couldn't be performed");
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i=0; i<logparams_defaults[LOG_OPTIONS_IDX].numelt ; i++) {
|
||||
for(int j=0; log_options[j].name != NULL ; j++) {
|
||||
if (strcmp(logparams_defaults[LOG_OPTIONS_IDX].strlistptr[i],log_options[j].name) == 0) {
|
||||
g_log->flag = g_log->flag | log_options[j].value;
|
||||
break;
|
||||
} else if (log_options[j+1].name == NULL){
|
||||
fprintf(stderr,"Unknown log option: %s\n",logparams_defaults[LOG_OPTIONS_IDX].strlistptr[i]);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* build the parameter array for setting per component log level and infile options */
|
||||
memset(logparams_level, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS);
|
||||
memset(logparams_logfile, 0, sizeof(paramdef_t)*MAX_LOG_PREDEF_COMPONENTS);
|
||||
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
|
||||
if(g_log->log_component[i].name == NULL) {
|
||||
g_log->log_component[i].name = malloc(16);
|
||||
sprintf((char *)g_log->log_component[i].name,"comp%i?",i);
|
||||
logparams_logfile[i].paramflags = PARAMFLAG_DONOTREAD;
|
||||
logparams_level[i].paramflags = PARAMFLAG_DONOTREAD;
|
||||
}
|
||||
sprintf(logparams_level[i].optname, LOG_CONFIG_LEVEL_FORMAT, g_log->log_component[i].name);
|
||||
sprintf(logparams_logfile[i].optname, LOG_CONFIG_LOGFILE_FORMAT, g_log->log_component[i].name);
|
||||
/* workaround: all log options in existing configuration files use lower case component names
|
||||
where component names include uppercase char in log.h.... */
|
||||
for (int j=0 ; j<strlen(logparams_level[i].optname); j++)
|
||||
logparams_level[i].optname[j] = tolower(logparams_level[i].optname[j]);
|
||||
for (int j=0 ; j<strlen(logparams_level[i].optname); j++)
|
||||
logparams_logfile[i].optname[j] = tolower(logparams_logfile[i].optname[j]);
|
||||
/* */
|
||||
logparams_level[i].defstrval = gloglevel;
|
||||
logparams_logfile[i].defuintval = 0;
|
||||
logparams_logfile[i].numelt = 0;
|
||||
logparams_level[i].numelt = 0;
|
||||
logparams_level[i].type = TYPE_STRING;
|
||||
logparams_logfile[i].type = TYPE_UINT;
|
||||
|
||||
logparams_logfile[i].paramflags = logparams_logfile[i].paramflags|PARAMFLAG_BOOL;
|
||||
}
|
||||
/* read the per component parameters */
|
||||
config_get( logparams_level, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_logfile, MAX_LOG_PREDEF_COMPONENTS,CONFIG_STRING_LOG_PREFIX);
|
||||
/* now set the log levels and infile option, according to what we read */
|
||||
for (int i=MIN_LOG_COMPONENTS; i < MAX_LOG_PREDEF_COMPONENTS; i++) {
|
||||
level = map_str_to_int(log_level_names, *(logparams_level[i].strptr));
|
||||
set_log(i, level,1);
|
||||
if (*(logparams_logfile[i].uptr) == 1)
|
||||
set_component_filelog(i);
|
||||
}
|
||||
|
||||
/* build then read the debug and matlab parameter array */
|
||||
for (int i=0;log_maskmap[i].name != NULL ; i++) {
|
||||
sprintf(logparams_debug[i].optname, LOG_CONFIG_DEBUG_FORMAT, log_maskmap[i].name);
|
||||
sprintf(logparams_matlab[i].optname, LOG_CONFIG_MATLAB_FORMAT, log_maskmap[i].name);
|
||||
logparams_debug[i].defuintval = 0;
|
||||
logparams_debug[i].type = TYPE_UINT;
|
||||
logparams_debug[i].paramflags = PARAMFLAG_BOOL;
|
||||
logparams_debug[i].uptr = NULL;
|
||||
logparams_debug[i].chkPptr = NULL;
|
||||
logparams_debug[i].numelt = 0;
|
||||
logparams_matlab[i].defuintval = 0;
|
||||
logparams_matlab[i].type = TYPE_UINT;
|
||||
logparams_matlab[i].paramflags = PARAMFLAG_BOOL;
|
||||
logparams_matlab[i].uptr = NULL;
|
||||
logparams_matlab[i].chkPptr = NULL;
|
||||
logparams_matlab[i].numelt = 0;
|
||||
}
|
||||
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
config_get( logparams_matlab,(sizeof(log_maskmap)/sizeof(mapping)) - 1 ,CONFIG_STRING_LOG_PREFIX);
|
||||
/* set the debug mask according to the debug parameters values */
|
||||
for (int i=0; log_maskmap[i].name != NULL ; i++) {
|
||||
if (*(logparams_debug[i].uptr) )
|
||||
g_log->debug_mask = g_log->debug_mask | log_maskmap[i].value;
|
||||
if (*(logparams_matlab[i].uptr) )
|
||||
g_log->matlab_mask = g_log->matlab_mask | log_maskmap[i].value;
|
||||
}
|
||||
}
|
||||
|
||||
int register_log_component(char *name, char *fext, int compidx)
|
||||
{
|
||||
int computed_compidx=compidx;
|
||||
|
||||
if (strlen(fext) > 3) {
|
||||
fext[3]=0; /* limit log file extension to 3 chars */
|
||||
}
|
||||
if (compidx < 0) { /* this is not a pre-defined component */
|
||||
for (int i = MAX_LOG_PREDEF_COMPONENTS; i< MAX_LOG_COMPONENTS; i++) {
|
||||
if (g_log->log_component[i].name == NULL) {
|
||||
computed_compidx=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (computed_compidx >= 0 && computed_compidx <MAX_LOG_COMPONENTS) {
|
||||
g_log->log_component[computed_compidx].name = strdup(name);
|
||||
g_log->log_component[computed_compidx].level = LOG_ERR;
|
||||
g_log->log_component[computed_compidx].interval = 1;
|
||||
g_log->log_component[computed_compidx].stream = NULL;
|
||||
g_log->log_component[computed_compidx].filelog = 0;
|
||||
g_log->log_component[computed_compidx].filelog_name = malloc(strlen(name)+16);/* /tmp/<name>.%s rounded to ^2 */
|
||||
sprintf(g_log->log_component[computed_compidx].filelog_name,"/tmp/%s.%s",name,fext);
|
||||
} else {
|
||||
fprintf(stderr,"{LOG} %s %d Couldn't register componemt %s\n",__FILE__,__LINE__,name);
|
||||
}
|
||||
return computed_compidx;
|
||||
}
|
||||
|
||||
int logInit (void)
|
||||
{
|
||||
int i;
|
||||
g_log = calloc(1, sizeof(log_t));
|
||||
|
||||
if (g_log == NULL) {
|
||||
perror ("cannot allocated memory for log generation module \n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
memset(g_log,0,sizeof(log_t));
|
||||
|
||||
|
||||
|
||||
register_log_component("PHY","log",PHY);
|
||||
register_log_component("MAC","log",MAC);
|
||||
register_log_component("OPT","log",OPT);
|
||||
register_log_component("RLC","log",RLC);
|
||||
register_log_component("PDCP","log",PDCP);
|
||||
register_log_component("RRC","log",RRC);
|
||||
register_log_component("OMG","csv",OMG);
|
||||
register_log_component("OTG","log",OTG);
|
||||
register_log_component("OTG_LATENCY","dat",OTG_LATENCY);
|
||||
register_log_component("OTG_LATENCY_BG","dat",OTG_LATENCY_BG);
|
||||
register_log_component("OTG_GP","dat",OTG_GP);
|
||||
register_log_component("OTG_GP_BG","dat",OTG_GP_BG);
|
||||
register_log_component("OTG_JITTER","dat",OTG_JITTER);
|
||||
register_log_component("OCG","",OCG);
|
||||
register_log_component("PERF","",PERF);
|
||||
register_log_component("OIP","",OIP);
|
||||
register_log_component("CLI","",CLI);
|
||||
register_log_component("MSC","log",MSC);
|
||||
register_log_component("OCM","log",OCM);
|
||||
register_log_component("HW","",HW);
|
||||
register_log_component("OSA","",OSA);
|
||||
register_log_component("eRAL","",RAL_ENB);
|
||||
register_log_component("mRAL","",RAL_UE);
|
||||
register_log_component("ENB_APP","log",ENB_APP);
|
||||
register_log_component("FLEXRAN_AGENT","log",FLEXRAN_AGENT);
|
||||
register_log_component("TMR","",TMR);
|
||||
register_log_component("USIM","txt",USIM);
|
||||
register_log_component("SIM","txt",SIM);
|
||||
|
||||
/* following log component are used for the localization*/
|
||||
register_log_component("LOCALIZE","log",LOCALIZE);
|
||||
register_log_component("NAS","log",NAS);
|
||||
register_log_component("UDP","",UDP_);
|
||||
|
||||
|
||||
register_log_component("GTPV1U","",GTPU);
|
||||
|
||||
|
||||
register_log_component("S1AP","",S1AP);
|
||||
|
||||
|
||||
register_log_component("SCTP","",SCTP);
|
||||
register_log_component("RRH","",RRH);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
g_log->level2string[OAILOG_ERR] = "E"; // ERROR
|
||||
g_log->level2string[OAILOG_WARNING] = "W"; // WARNING
|
||||
g_log->level2string[OAILOG_INFO] = "I"; //INFO
|
||||
g_log->level2string[OAILOG_DEBUG] = "D"; // DEBUG
|
||||
g_log->level2string[OAILOG_FILE] = "F"; // file
|
||||
g_log->level2string[OAILOG_TRACE] = "T"; // TRACE
|
||||
|
||||
|
||||
g_log->onlinelog = 1; //online log file
|
||||
g_log->filelog = 0;
|
||||
|
||||
|
||||
|
||||
g_log->filelog_name = "/tmp/openair.log";
|
||||
|
||||
log_getconfig(g_log);
|
||||
|
||||
|
||||
// could put a loop here to check for all comps
|
||||
for (i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
|
||||
if (g_log->log_component[i].filelog == 1 ) {
|
||||
g_log->log_component[i].stream = fopen(g_log->log_component[i].filelog_name,"w");
|
||||
g_log->log_component[i].fwrite = vfprintf;
|
||||
} else if (g_log->log_component[i].filelog == 1 ) {
|
||||
g_log->log_component[i].stream = fopen(g_log->filelog_name,"w");
|
||||
g_log->log_component[i].fwrite = vfprintf;
|
||||
} else if (g_log->onlinelog == 1 ) {
|
||||
g_log->log_component[i].stream = stdout;
|
||||
g_log->log_component[i].fwrite = vfprintf;
|
||||
}
|
||||
}
|
||||
|
||||
// set all unused component items to 0, they are for non predefined components
|
||||
for (i=MAX_LOG_PREDEF_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
|
||||
memset(&(g_log->log_component[i]),0,sizeof(log_component_t));
|
||||
}
|
||||
printf("log init done\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
char *log_getthreadname(char *threadname, int bufsize) {
|
||||
|
||||
int rt = pthread_getname_np(pthread_self(), threadname,bufsize) ;
|
||||
if (rt == 0)
|
||||
{
|
||||
return threadname;
|
||||
} else {
|
||||
return "thread?";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void logRecord_mt(const char *file, const char *func, int line, int comp, int level, const char* format, ... )
|
||||
{
|
||||
|
||||
char threadname[PR_SET_NAME];
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
va_list args;
|
||||
|
||||
va_start(args, format);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
snprintf(log_buffer, MAX_LOG_TOTAL , "%s%s[%s]%s %s %s",
|
||||
log_level_highlight_end[level],
|
||||
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
|
||||
g_log->log_component[comp].name,
|
||||
( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:""),
|
||||
( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""),
|
||||
format);
|
||||
|
||||
g_log->log_component[comp].fwrite(g_log->log_component[comp].stream,log_buffer, args);
|
||||
va_end(args);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int set_log(int component, int level, int interval)
|
||||
{
|
||||
/* Checking parameters */
|
||||
DevCheck((component >= MIN_LOG_COMPONENTS) && (component < MAX_LOG_COMPONENTS),
|
||||
component, MIN_LOG_COMPONENTS, MAX_LOG_COMPONENTS);
|
||||
DevCheck((level < NUM_LOG_LEVEL) && (level >= OAILOG_ERR), level, NUM_LOG_LEVEL,
|
||||
OAILOG_ERR);
|
||||
DevCheck((interval >= 0) && (interval <= 0xFF), interval, 0, 0xFF);
|
||||
|
||||
g_log->log_component[component].level = level;
|
||||
|
||||
|
||||
g_log->log_component[component].interval = interval;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void set_glog(int level)
|
||||
{
|
||||
for (int c=0; c< MAX_LOG_COMPONENTS; c++ ) {
|
||||
g_log->log_component[c].level = level;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void set_glog_onlinelog(int enable)
|
||||
{
|
||||
g_log->onlinelog = enable;
|
||||
}
|
||||
void set_glog_filelog(int enable)
|
||||
{
|
||||
g_log->filelog = enable;
|
||||
}
|
||||
|
||||
void set_component_filelog(int comp)
|
||||
{
|
||||
if (g_log->log_component[comp].filelog == 0) {
|
||||
g_log->log_component[comp].filelog = 1;
|
||||
|
||||
if (g_log->log_component[comp].stream == NULL) {
|
||||
g_log->log_component[comp].stream = fopen(g_log->log_component[comp].filelog_name,"w");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* for the two functions below, the passed array must have a final entry
|
||||
* with string value NULL
|
||||
*/
|
||||
/* map a string to an int. Takes a mapping array and a string as arg */
|
||||
int map_str_to_int(mapping *map, const char *str)
|
||||
{
|
||||
while (1) {
|
||||
if (map->name == NULL) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (!strcmp(map->name, str)) {
|
||||
return(map->value);
|
||||
}
|
||||
|
||||
map++;
|
||||
}
|
||||
}
|
||||
|
||||
/* map an int to a string. Takes a mapping array and a value */
|
||||
char *map_int_to_str(mapping *map, int val)
|
||||
{
|
||||
while (1) {
|
||||
if (map->name == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (map->value == val) {
|
||||
return map->name;
|
||||
}
|
||||
|
||||
map++;
|
||||
}
|
||||
}
|
||||
|
||||
int is_newline( char *str, int size)
|
||||
{
|
||||
int i;
|
||||
|
||||
for ( i = 0; i < size; i++ ) {
|
||||
if ( str[i] == '\n' ) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get all the way to here, there must not have been a newline! */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void logClean (void)
|
||||
{
|
||||
int i;
|
||||
LOG_I(PHY,"\n");
|
||||
|
||||
|
||||
|
||||
|
||||
for (i=MIN_LOG_COMPONENTS; i < MAX_LOG_COMPONENTS; i++) {
|
||||
if (g_log->log_component[i].stream != NULL) {
|
||||
fclose(g_log->log_component[i].stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef LOG_TEST
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
logInit();
|
||||
|
||||
|
||||
test_log();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int test_log(void)
|
||||
{
|
||||
LOG_ENTER(MAC); // because the default level is DEBUG
|
||||
LOG_I(EMU, "1 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "1 debug MAC \n");
|
||||
LOG_W(MAC, "1 warning MAC \n");
|
||||
|
||||
set_log(EMU, OAILOG_INFO, FLAG_ONLINE);
|
||||
set_log(MAC, OAILOG_WARNING, 0);
|
||||
|
||||
LOG_I(EMU, "2 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_E(MAC, "2 error MAC\n");
|
||||
LOG_D(MAC, "2 debug MAC \n");
|
||||
LOG_W(MAC, "2 warning MAC \n");
|
||||
LOG_I(MAC, "2 info MAC \n");
|
||||
|
||||
|
||||
set_log(MAC, OAILOG_NOTICE, 1);
|
||||
|
||||
LOG_ENTER(MAC);
|
||||
LOG_I(EMU, "3 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "3 debug MAC \n");
|
||||
LOG_W(MAC, "3 warning MAC \n");
|
||||
LOG_I(MAC, "3 info MAC \n");
|
||||
|
||||
set_log(MAC, LOG_DEBUG,1);
|
||||
set_log(EMU, LOG_DEBUG,1);
|
||||
|
||||
LOG_ENTER(MAC);
|
||||
LOG_I(EMU, "4 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "4 debug MAC \n");
|
||||
LOG_W(MAC, "4 warning MAC \n");
|
||||
LOG_I(MAC, "4 info MAC \n");
|
||||
|
||||
|
||||
set_log(MAC, LOG_DEBUG,0);
|
||||
set_log(EMU, LOG_DEBUG,0);
|
||||
|
||||
LOG_I(LOG, "5 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "5 debug MAC \n");
|
||||
LOG_W(MAC, "5 warning MAC \n");
|
||||
LOG_I(MAC, "5 info MAC \n");
|
||||
|
||||
|
||||
set_log(MAC, LOG_TRACE,0X07F);
|
||||
set_log(EMU, LOG_TRACE,0X07F);
|
||||
|
||||
LOG_ENTER(MAC);
|
||||
LOG_I(LOG, "6 Starting OAI logs version %s Build date: %s on %s\n",
|
||||
BUILD_VERSION, BUILD_DATE, BUILD_HOST);
|
||||
LOG_D(MAC, "6 debug MAC \n");
|
||||
LOG_W(MAC, "6 warning MAC \n");
|
||||
LOG_I(MAC, "6 info MAC \n");
|
||||
LOG_EXIT(MAC);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
@@ -52,7 +52,7 @@
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
||||
#include "T.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -73,8 +73,7 @@ extern "C" {
|
||||
* @ingroup _macro
|
||||
* @brief the macros that describe the maximum length of LOG
|
||||
* @{*/
|
||||
#define MAX_LOG_ITEM 100 /*!< \brief the maximum length of a LOG item, what is LOG_ITEM ??? */
|
||||
#define MAX_LOG_INFO 1000 /*!< \brief the maximum length of a log */
|
||||
|
||||
#define MAX_LOG_TOTAL 1500 /*!< \brief the maximum length of a log */
|
||||
/* @}*/
|
||||
|
||||
@@ -82,17 +81,15 @@ extern "C" {
|
||||
* @ingroup _macro
|
||||
* @brief LOG defines 9 levels of messages for users. Importance of these levels decrease gradually from 0 to 8
|
||||
* @{*/
|
||||
# define LOG_EMERG 0 /*!< \brief system is unusable */
|
||||
# define LOG_ALERT 1 /*!< \brief action must be taken immediately */
|
||||
# define LOG_CRIT 2 /*!< \brief critical conditions */
|
||||
# define LOG_ERR 3 /*!< \brief error conditions */
|
||||
# define LOG_WARNING 4 /*!< \brief warning conditions */
|
||||
# define LOG_NOTICE 5 /*!< \brief normal but significant condition */
|
||||
# define LOG_INFO 6 /*!< \brief informational */
|
||||
# define LOG_DEBUG 7 /*!< \brief debug-level messages */
|
||||
# define LOG_FILE 8 /*!< \brief message sequence chart -level */
|
||||
# define LOG_TRACE 9 /*!< \brief trace-level messages */
|
||||
#define NUM_LOG_LEVEL 10 /*!< \brief the number of message levels users have with LOG */
|
||||
|
||||
# define OAILOG_ERR 0 /*!< \brief critical error conditions, impact on "must have" fuctinalities */
|
||||
# define OAILOG_FILE 1 /*!< \brief important informational messages, but everything OK */
|
||||
# define OAILOG_WARNING 2 /*!< \brief warning conditions, shouldn't happen but doesn't impact "must have" functionalities */
|
||||
# define OAILOG_INFO 3 /*!< \brief informational messages most people don't need, shouldn't impact real-time behavior */
|
||||
# define OAILOG_DEBUG 4 /*!< \brief first level debug-level messages, for developers , may impact real-time behavior */
|
||||
# define OAILOG_TRACE 5 /*!< \brief second level debug-level messages, for developers ,likely impact real-time behavior*/
|
||||
|
||||
#define NUM_LOG_LEVEL 6 /*!< \brief the number of message levels users have with LOG */
|
||||
/* @}*/
|
||||
|
||||
|
||||
@@ -103,7 +100,7 @@ extern "C" {
|
||||
|
||||
/* .log_format = 0x13 uncolored standard messages
|
||||
* .log_format = 0x93 colored standard messages */
|
||||
|
||||
/* keep white space in first position; switching it to 0 allows colors to be disabled*/
|
||||
#define LOG_RED "\033[1;31m" /*!< \brief VT100 sequence for bold red foreground */
|
||||
#define LOG_GREEN "\033[32m" /*!< \brief VT100 sequence for green foreground */
|
||||
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
|
||||
@@ -117,40 +114,43 @@ extern "C" {
|
||||
* @ingroup _macro
|
||||
* @brief Macros used to write lines (local/remote) in syslog.conf
|
||||
* @{*/
|
||||
#define LOG_LOCAL 0x01
|
||||
#define LOG_REMOTE 0x02
|
||||
|
||||
#define FLAG_COLOR 0x001 /*!< \brief defaults */
|
||||
#define FLAG_PID 0x002 /*!< \brief defaults */
|
||||
#define FLAG_COMP 0x004
|
||||
#define FLAG_THREAD 0x008 /*!< \brief all : 255/511 */
|
||||
#define FLAG_LEVEL 0x010
|
||||
#define FLAG_FUNCT 0x020
|
||||
#define FLAG_FILE_LINE 0x040
|
||||
#define FLAG_TIME 0x100
|
||||
|
||||
#define LOG_NONE 0x00
|
||||
#define LOG_LOW 0x5
|
||||
#define LOG_MED 0x15
|
||||
#define LOG_HIGH 0x35
|
||||
#define LOG_FULL 0x75
|
||||
|
||||
#define OAI_OK 0 /*!< \brief all ok */
|
||||
#define OAI_ERR 1 /*!< \brief generic error */
|
||||
#define OAI_ERR_READ_ONLY 2 /*!< \brief tried to write to read-only item */
|
||||
#define OAI_ERR_NOTFOUND 3 /*!< \brief something wasn't found */
|
||||
/* @}*/
|
||||
|
||||
|
||||
//static char *log_level_highlight_start[] = {LOG_RED, LOG_RED, LOG_RED, LOG_RED, LOG_BLUE, "", "", "", LOG_GREEN}; /*!< \brief Optional start-format strings for highlighting */
|
||||
#define FLAG_NOCOLOR 0x0001 /*!< \brief use colors in log messages, depending on level */
|
||||
#define FLAG_THREAD 0x0008 /*!< \brief display thread name in log messages */
|
||||
#define FLAG_LEVEL 0x0010 /*!< \brief display log level in log messages */
|
||||
#define FLAG_FUNCT 0x0020
|
||||
#define FLAG_FILE_LINE 0x0040
|
||||
#define FLAG_TIME 0x0100
|
||||
|
||||
#define SET_LOG_OPTION(O) g_log->flag = (g_log->flag | O)
|
||||
#define CLEAR_LOG_OPTION(O) g_log->flag = (g_log->flag & (~O))
|
||||
|
||||
/** @defgroup macros to identify a debug entity
|
||||
* @ingroup each macro is a bit mask where the unique bit set identifies an entity to be debugged
|
||||
* it allows to dynamically activate or not blocks of code
|
||||
* @brief
|
||||
* @{*/
|
||||
#define DEBUG_PRACH (1<<0)
|
||||
#define DEBUG_RU (1<<1)
|
||||
#define DEBUG_UE_PHYPROC (1<<2)
|
||||
#define DEBUG_LTEESTIM (1<<3)
|
||||
#define DEBUG_CTRLSOCKET (1<<10)
|
||||
#define UE_TIMING (1<<20)
|
||||
|
||||
#define SET_LOG_DEBUG(O) g_log->debug_mask = (g_log->debug_mask | O)
|
||||
#define CLEAR_LOG_DEBUG(O) g_log->debug_mask = (g_log->debug_mask & (~O))
|
||||
|
||||
#define SET_LOG_MATLAB(O) g_log->matlab_mask = (g_log->matlab_mask | O)
|
||||
#define CLEAR_LOG_MATLAB(O) g_log->matlab_mask = (g_log->matlab_mask & (~O))
|
||||
|
||||
|
||||
//static char *log_level_highlight_end[] = {LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, LOG_RESET, "", "", "", LOG_RESET}; /*!< \brief Optional end-format strings for highlighting */
|
||||
|
||||
typedef enum {
|
||||
MIN_LOG_COMPONENTS = 0,
|
||||
PHY = MIN_LOG_COMPONENTS,
|
||||
MAC,
|
||||
EMU,
|
||||
SIM,
|
||||
OCG,
|
||||
OMG,
|
||||
OPT,
|
||||
@@ -185,63 +185,47 @@ typedef enum {
|
||||
LOCALIZE,
|
||||
RRH,
|
||||
X2AP,
|
||||
MAX_LOG_COMPONENTS,
|
||||
LOADER,
|
||||
MAX_LOG_PREDEF_COMPONENTS,
|
||||
}
|
||||
comp_name_t;
|
||||
|
||||
//#define msg printf
|
||||
#define MAX_LOG_DYNALLOC_COMPONENTS 20
|
||||
#define MAX_LOG_COMPONENTS (MAX_LOG_PREDEF_COMPONENTS + MAX_LOG_DYNALLOC_COMPONENTS)
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *name; /*!< \brief string name of item */
|
||||
int value; /*!< \brief integer value of mapping */
|
||||
} mapping;
|
||||
|
||||
typedef int(*log_write_func_t)(FILE *stream, const char *format, va_list ap );
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
int level;
|
||||
int flag;
|
||||
int interval;
|
||||
int fd;
|
||||
int filelog;
|
||||
char *filelog_name;
|
||||
|
||||
const char *name;
|
||||
int level;
|
||||
int flag;
|
||||
int interval;
|
||||
int filelog;
|
||||
char *filelog_name;
|
||||
FILE *stream;
|
||||
log_write_func_t fwrite;
|
||||
/* SR: make the log buffer component relative */
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
char log_buffer[MAX_LOG_TOTAL];
|
||||
} log_component_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned int remote_ip;
|
||||
unsigned int audit_ip;
|
||||
int remote_level;
|
||||
int facility;
|
||||
int audit_facility;
|
||||
int format;
|
||||
} log_config_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
log_component_t log_component[MAX_LOG_COMPONENTS];
|
||||
log_config_t config;
|
||||
char* level2string[NUM_LOG_LEVEL];
|
||||
int level;
|
||||
int onlinelog;
|
||||
int flag;
|
||||
int syslog;
|
||||
int filelog;
|
||||
char* filelog_name;
|
||||
uint64_t debug_mask;
|
||||
uint64_t matlab_mask;
|
||||
} log_t;
|
||||
|
||||
typedef struct LOG_params {
|
||||
const char *file;
|
||||
const char *func;
|
||||
int line;
|
||||
int comp;
|
||||
int level;
|
||||
const char *format;
|
||||
char l_buff_info [MAX_LOG_INFO];
|
||||
int len;
|
||||
} LOG_params;
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
typedef enum log_instance_type_e {
|
||||
@@ -254,102 +238,129 @@ void log_set_instance_type (log_instance_type_t instance);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef LOG_MAIN
|
||||
log_t *g_log;
|
||||
#else
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern log_t *g_log;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/*--- INCLUDES ---------------------------------------------------------------*/
|
||||
# include "log_if.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (void);
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
int set_comp_log(int component, int level, int verbosity, int interval);
|
||||
|
||||
int set_log(int component, int level, int interval);
|
||||
void set_glog(int level, int verbosity);
|
||||
void set_log_syslog(int enable);
|
||||
void set_glog(int level);
|
||||
|
||||
void set_glog_onlinelog(int enable);
|
||||
void set_glog_filelog(int enable);
|
||||
|
||||
void set_component_filelog(int comp);
|
||||
|
||||
int map_str_to_int(mapping *map, const char *str);
|
||||
char *map_int_to_str(mapping *map, int val);
|
||||
void logClean (void);
|
||||
int is_newline( char *str, int size);
|
||||
void *log_thread_function(void * list);
|
||||
|
||||
/** @defgroup _logIt logIt function
|
||||
* @ingroup _macro
|
||||
* @brief Macro used to call tr_log_full_ex with file, function and line information
|
||||
* @{*/
|
||||
#ifdef LOG_NO_THREAD
|
||||
#define logIt(component, level, format, args...) logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
|
||||
#else //default
|
||||
#define logIt(component, level, format, args...) logRecord(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args)
|
||||
#endif
|
||||
int register_log_component(char *name, char *fext, int compidx);
|
||||
|
||||
/* @}*/
|
||||
|
||||
/*!\fn int32_t write_file_matlab(const char *fname, const char *vname, void *data, int length, int dec, char format);
|
||||
\brief Write output file from signal data
|
||||
@param fname output file name
|
||||
@param vname output vector name (for MATLAB/OCTAVE)
|
||||
@param data point to data
|
||||
@param length length of data vector to output
|
||||
@param dec decimation level
|
||||
@param format data format (0 = real 16-bit, 1 = complex 16-bit,2 real 32-bit, 3 complex 32-bit,4 = real 8-bit, 5 = complex 8-bit)
|
||||
*/
|
||||
int32_t write_file_matlab(const char *fname, const char *vname, void *data, int length, int dec, char format);
|
||||
|
||||
/*----------------macro definitions for reading log configuration from the config module */
|
||||
#define CONFIG_STRING_LOG_PREFIX "log_config"
|
||||
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY "global_log_verbosity"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE "global_log_online"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_INFILE "global_log_infile"
|
||||
#define LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS "global_log_options"
|
||||
|
||||
#define LOG_CONFIG_LEVEL_FORMAT "%s_log_level"
|
||||
#define LOG_CONFIG_VERBOSITY_FORMAT "%s_log_verbosity"
|
||||
#define LOG_CONFIG_LOGFILE_FORMAT "%s_log_infile"
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOG_CONFIG_DEBUG_FORMAT "%s_debug"
|
||||
#define LOG_CONFIG_MATLAB_FORMAT "%s_matlab"
|
||||
|
||||
#define LOG_CONFIG_HELP_OPTIONS " list of comma separated options to enable log module behavior. Available options: \n"\
|
||||
" nocolor: disable color usage in log messages\n"\
|
||||
" level: add log level indication in log messages\n"\
|
||||
" thread: add threads names in log messages\n"
|
||||
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOG globalconfiguration parameters */
|
||||
/* optname help paramflags XXXptr defXXXval type numelt */
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOG_GLOBALPARAMS_DESC { \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, NULL, 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,NULL, 0, strptr:(char **)&glogverbo, defstrval:log_verbosity_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, NULL, 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0, }, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_INFILE, NULL, 0, iptr:&(g_log->filelog), defintval:0, TYPE_INT, 0, }, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(g_log->onlinelog), defintval:1, TYPE_INT, 0}, \
|
||||
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \
|
||||
}
|
||||
|
||||
#define LOG_OPTIONS_IDX 2
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/** @defgroup _debugging debugging macros
|
||||
* @ingroup _macro
|
||||
* @brief Macro used to call logIt function with different message levels
|
||||
* @{*/
|
||||
|
||||
// debugging macros
|
||||
# if T_TRACER
|
||||
# include "T.h"
|
||||
# define LOG_I(c, x...) T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x))
|
||||
# define LOG_W(c, x...) T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x))
|
||||
# define LOG_E(c, x...) T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x))
|
||||
# define LOG_D(c, x...) T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x))
|
||||
# define LOG_T(c, x...) T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x))
|
||||
# define LOG_G(c, x...) /* */
|
||||
# define LOG_A(c, x...) /* */
|
||||
# define LOG_C(c, x...) /* */
|
||||
# define LOG_N(c, x...) /* */
|
||||
// debugging macros(g_log->log_component[component].interval?logRecord_mt(__FILE__, __FUNCTION__, __LINE__, component, level, format, ##args):(void)0)
|
||||
# if T_TRACER
|
||||
/* per component, level dependant macros */
|
||||
# define LOG_I(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} else { T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_W(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} else { T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_E(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} else { T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_D(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} else { T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_T(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} else { T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x)) ;}} while (0)
|
||||
# define LOG_F(c, x...) do { if (T_stdout) { if( g_log->log_component[c].level >= OAILOG_FILE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_FILE, x) ;}} while (0) /* */
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, F...) do { if (T_stdout) { logRecord_mt(__FILE__, __FUNCTION__, __LINE__,COMP, LVL, F) ;}} while (0) /* */
|
||||
/* bitmask dependant macros, to isolate debugging code */
|
||||
# define LOG_DEBUG_BEGIN(D) if (g_log->debug_mask & D) {
|
||||
# define LOG_DEBUG_END }
|
||||
/* bitmask dependant macros, to generate matlab files */
|
||||
# define LOG_M_BEGIN(D) if (g_log->matlab_mask & D) {
|
||||
# define LOG_M_END }
|
||||
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)/* */
|
||||
/* define variable only used in LOG macro's */
|
||||
# define LOG_VAR(A,B) A B
|
||||
# else /* T_TRACER: remove all debugging and tracing messages, except errors */
|
||||
# define LOG_I(c, x...) /* */
|
||||
# define LOG_W(c, x...) /* */
|
||||
# define LOG_E(c, x...) /* */
|
||||
# define LOG_D(c, x...) /* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
# define LOG_F(c, x...) /* */
|
||||
# else /* T_TRACER */
|
||||
# if DISABLE_LOG_X
|
||||
# define LOG_I(c, x...) /* */
|
||||
# define LOG_W(c, x...) /* */
|
||||
# define LOG_E(c, x...) /* */
|
||||
# define LOG_D(c, x...) /* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
# define LOG_G(c, x...) /* */
|
||||
# define LOG_A(c, x...) /* */
|
||||
# define LOG_C(c, x...) /* */
|
||||
# define LOG_N(c, x...) /* */
|
||||
# define LOG_F(c, x...) /* */
|
||||
# else /*DISABLE_LOG_X*/
|
||||
# define LOG_G(c, x...) logIt(c, LOG_EMERG, x)
|
||||
# define LOG_A(c, x...) logIt(c, LOG_ALERT, x)
|
||||
# define LOG_C(c, x...) logIt(c, LOG_CRIT, x)
|
||||
# define LOG_E(c, x...) logIt(c, LOG_ERR, x)
|
||||
# define LOG_W(c, x...) logIt(c, LOG_WARNING, x)
|
||||
# define LOG_N(c, x...) logIt(c, LOG_NOTICE, x)
|
||||
# define LOG_I(c, x...) logIt(c, LOG_INFO, x)
|
||||
# define LOG_D(c, x...) logIt(c, LOG_DEBUG, x)
|
||||
# define LOG_F(c, x...) logIt(c, LOG_FILE, x) // log to a file, useful for the MSC chart generation
|
||||
# define LOG_T(c, x...) logIt(c, LOG_TRACE, x)
|
||||
# endif /*DISABLE_LOG_X*/
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
|
||||
# define LOG_DEBUG_BEGIN(D) if (0) {
|
||||
# define LOG_DEBUG_END }
|
||||
# define LOG_M_BEGIN(D) if (0) {
|
||||
# define LOG_M_END }
|
||||
# define LOG_M(file, vector, data, len, dec, format)
|
||||
# define LOG_VAR(A,B)
|
||||
# endif /* T_TRACER */
|
||||
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
|
||||
#define LOG_USEDINLOG_VAR(A,B) __attribute__((unused)) A B
|
||||
|
||||
/* unfiltered macros, usefull for simulators or messages at init time, before log is configured */
|
||||
#define LOG_UM(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
|
||||
|
||||
#define LOG_UI(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)
|
||||
/* @}*/
|
||||
|
||||
|
||||
@@ -363,9 +374,9 @@ void *log_thread_function(void * list);
|
||||
/* @}*/
|
||||
|
||||
static __inline__ uint64_t rdtsc(void) {
|
||||
uint64_t a, d;
|
||||
uint32_t a, d;
|
||||
__asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
|
||||
return (d<<32) | a;
|
||||
return (((uint64_t)d)<<32) | ((uint64_t)a);
|
||||
}
|
||||
|
||||
#define DEBUG_REALTIME 1
|
||||
@@ -23,12 +23,8 @@
|
||||
|
||||
extern log_t *g_log;
|
||||
|
||||
#if !defined(LOG_NO_THREAD)
|
||||
extern LOG_params log_list[2000];
|
||||
extern pthread_mutex_t log_lock;
|
||||
extern pthread_cond_t log_notify;
|
||||
extern int log_shutdown;
|
||||
#endif
|
||||
|
||||
extern mapping log_level_names[];
|
||||
extern mapping log_verbosity_names[];
|
||||
extern mapping log_options[];
|
||||
extern mapping log_maskmap[];
|
||||
|
||||
@@ -89,9 +89,6 @@ const char* eurecomVariablesNames[] = {
|
||||
"subframe_TX1_UE",
|
||||
"subframe_RX0_UE",
|
||||
"subframe_RX1_UE",
|
||||
"missed_slot_enb",
|
||||
"daq_mbox",
|
||||
"rx_offset_mbox",
|
||||
"ue_rx_offset",
|
||||
"diff2",
|
||||
"hw_subframe",
|
||||
@@ -191,6 +188,9 @@ const char* eurecomVariablesNames[] = {
|
||||
"ue0_trx_write_ns",
|
||||
"ue0_trx_read_ns_missing",
|
||||
"ue0_trx_write_ns_missing",
|
||||
"enb_thread_rxtx_CPUID",
|
||||
"ru_thread_CPUID",
|
||||
"ru_thread_tx_CPUID"
|
||||
};
|
||||
|
||||
const char* eurecomFunctionsNames[] = {
|
||||
@@ -219,7 +219,10 @@ const char* eurecomFunctionsNames[] = {
|
||||
"ue_lock_mutex_rxtx_for_cnt_decrement1",
|
||||
"ue_lock_mutex_rxtx_for_cnt_increment0",
|
||||
"ue_lock_mutex_rxtx_for_cnt_increment1",
|
||||
|
||||
/* simulation signals */
|
||||
"do_DL_sig",
|
||||
"do_UL_sig",
|
||||
"UE_trx_read",
|
||||
/* RRH signals */
|
||||
"eNB_tx",
|
||||
"eNB_rx",
|
||||
@@ -65,9 +65,6 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX1_UE,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_UE,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX1_UE,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_MISSED_SLOTS_ENB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_DAQ_MBOX,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_UE_OFFSET_MBOX,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_UE_RX_OFFSET,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_DIFF,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME,
|
||||
@@ -167,6 +164,9 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_READ_NS_MISSING,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_UE0_TRX_WRITE_NS_MISSING,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_ENB_THREAD_RXTX,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_CPUID_RU_THREAD_TX,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_END
|
||||
} vcd_signal_dump_variables;
|
||||
|
||||
@@ -196,7 +196,10 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_DECREMENT1,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT0,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1,
|
||||
|
||||
/* SIMULATION signals */
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_DL_SIGNAL,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_UE_TRX_READ,
|
||||
/* RRH signals */
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX,
|
||||
@@ -444,28 +447,13 @@ extern int ouput_vcd;
|
||||
|
||||
#include "T.h"
|
||||
|
||||
#define VCD_SIGNAL_DUMPER_INIT(x) /* nothing */
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE() /* nothing */
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER() /* nothing */
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val) T_VCD_VARIABLE(var, val)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val) T_VCD_FUNCTION(var, val)
|
||||
|
||||
#else /* T_TRACER */
|
||||
|
||||
#if defined(ENABLE_VCD)
|
||||
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT) vcd_signal_dumper_init(aRgUmEnT)
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE() vcd_signal_dumper_close()
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER() vcd_signal_dumper_create_header()
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_variable_by_name(vAr1,vAr2)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_function_by_name(vAr1,vAr2)
|
||||
#else
|
||||
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT)
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE()
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER()
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2)
|
||||
#endif
|
||||
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val)
|
||||
|
||||
#endif /* T_TRACER */
|
||||
|
||||
#endif /* !defined (VCD_SIGNAL_DUMPER_H_) */
|
||||
@@ -13,7 +13,7 @@ $(GENIDS): $(GENIDS_OBJS)
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
T_messages.txt.h: T_messages.txt
|
||||
xxd -i T_messages.txt > T_messages.txt.h
|
||||
xxd -i T_messages.txt T_messages.txt.h
|
||||
|
||||
T_IDs.h: $(GENIDS) T_messages.txt
|
||||
./$(GENIDS) T_messages.txt T_IDs.h
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
#define QUIT(x) do { \
|
||||
printf("T tracer: QUIT: %s\n", x); \
|
||||
exit(1); \
|
||||
@@ -17,6 +19,7 @@
|
||||
/* array used to activate/disactivate a log */
|
||||
static int T_IDs[T_NUMBER_OF_IDS];
|
||||
int *T_active = T_IDs;
|
||||
int T_stdout;
|
||||
|
||||
static int T_socket;
|
||||
|
||||
@@ -88,7 +91,7 @@ static void new_thread(void *(*f)(void *), void *data)
|
||||
|
||||
/* defined in local_tracer.c */
|
||||
void T_local_tracer_main(int remote_port, int wait_for_tracer,
|
||||
int local_socket);
|
||||
int local_socket, char *shm_file);
|
||||
|
||||
/* We monitor the tracee and the local tracer processes.
|
||||
* When one dies we forcefully kill the other.
|
||||
@@ -113,6 +116,9 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork)
|
||||
int s;
|
||||
int T_shm_fd;
|
||||
int child1, child2;
|
||||
char shm_file[128];
|
||||
|
||||
sprintf(shm_file, "/%s%d", T_SHM_FILENAME, getpid());
|
||||
|
||||
if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair))
|
||||
{ perror("socketpair"); abort(); }
|
||||
@@ -122,7 +128,8 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork)
|
||||
child1 = fork(); if (child1 == -1) abort();
|
||||
if (child1 == 0) {
|
||||
close(socket_pair[1]);
|
||||
T_local_tracer_main(remote_port, wait_for_tracer, socket_pair[0]);
|
||||
T_local_tracer_main(remote_port, wait_for_tracer, socket_pair[0],
|
||||
shm_file);
|
||||
exit(0);
|
||||
}
|
||||
close(socket_pair[0]);
|
||||
@@ -142,14 +149,33 @@ void T_init(int remote_port, int wait_for_tracer, int dont_fork)
|
||||
T_socket = s;
|
||||
|
||||
/* setup shared memory */
|
||||
T_shm_fd = shm_open(T_SHM_FILENAME, O_RDWR /*| O_SYNC*/, 0666);
|
||||
shm_unlink(T_SHM_FILENAME);
|
||||
if (T_shm_fd == -1) { perror(T_SHM_FILENAME); abort(); }
|
||||
T_shm_fd = shm_open(shm_file, O_RDWR /*| O_SYNC*/, 0666);
|
||||
shm_unlink(shm_file);
|
||||
if (T_shm_fd == -1) { perror(shm_file); abort(); }
|
||||
T_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t),
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, T_shm_fd, 0);
|
||||
if (T_cache == NULL)
|
||||
{ perror(T_SHM_FILENAME); abort(); }
|
||||
if (T_cache == MAP_FAILED)
|
||||
{ perror(shm_file); abort(); }
|
||||
close(T_shm_fd);
|
||||
|
||||
new_thread(T_receive_thread, NULL);
|
||||
}
|
||||
|
||||
void T_Config_Init(void)
|
||||
{
|
||||
int T_port; /* by default we wait for the tracer */
|
||||
int T_nowait; /* default port to listen to to wait for the tracer */
|
||||
int T_dont_fork; /* default is to fork, see 'T_init' to understand */
|
||||
|
||||
paramdef_t ttraceparams[] = CMDLINE_TTRACEPARAMS_DESC ;
|
||||
|
||||
/* for a cleaner config file, TTracer params should be defined in a specific section... */
|
||||
config_get( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),TTRACER_CONFIG_PREFIX);
|
||||
|
||||
/* compatibility: look for TTracer command line options in root section */
|
||||
config_process_cmdline( ttraceparams,sizeof(ttraceparams)/sizeof(paramdef_t),NULL);
|
||||
|
||||
if (T_stdout == 0) {
|
||||
T_init(T_port, 1-T_nowait, T_dont_fork);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
/* T message IDs */
|
||||
#include "T_IDs.h"
|
||||
|
||||
#define T_ACTIVE_STDOUT 2
|
||||
/* known type - this is where you add new types */
|
||||
|
||||
#define T_INT(x) int, (x)
|
||||
@@ -94,12 +95,12 @@ struct T_header;
|
||||
#define T_ID(x) ((struct T_header *)(uintptr_t)(x))
|
||||
|
||||
/* T macro tricks */
|
||||
|
||||
extern int T_stdout;
|
||||
#define TN(...) TN_N(__VA_ARGS__,33,32,31,30,29,28,27,26,25,24,23,22,21,\
|
||||
20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
|
||||
#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\
|
||||
n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
|
||||
#define T(...) TN(__VA_ARGS__)
|
||||
#define T(...) do { if (T_stdout == 0) TN(__VA_ARGS__); } while (0)
|
||||
|
||||
/* type used to send arbitrary buffer data */
|
||||
typedef struct {
|
||||
@@ -109,6 +110,16 @@ typedef struct {
|
||||
|
||||
extern volatile int *T_freelist_head;
|
||||
extern T_cache_t *T_cache;
|
||||
extern int *T_active;
|
||||
/* When running the basic simulator, we may fill the T cache too fast.
|
||||
* Let's not crash if it's full, just wait.
|
||||
*/
|
||||
#if BASIC_SIMULATOR
|
||||
# define T_BASIC_SIMULATOR_WAIT \
|
||||
while (T_cache[T_LOCAL_slot].busy) usleep(100)
|
||||
#else
|
||||
# define T_BASIC_SIMULATOR_WAIT /* */
|
||||
#endif
|
||||
|
||||
/* used at header of Tn, allocates buffer */
|
||||
#define T_LOCAL_DATA \
|
||||
@@ -118,6 +129,7 @@ extern T_cache_t *T_cache;
|
||||
T_LOCAL_slot = __sync_fetch_and_add(T_freelist_head, 1) \
|
||||
& (T_CACHE_SIZE - 1); \
|
||||
(void)__sync_fetch_and_and(T_freelist_head, T_CACHE_SIZE - 1); \
|
||||
T_BASIC_SIMULATOR_WAIT; \
|
||||
if (T_cache[T_LOCAL_slot].busy) { \
|
||||
printf("%s:%d:%s: T cache is full - consider increasing its size\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__); \
|
||||
@@ -140,50 +152,6 @@ extern T_cache_t *T_cache;
|
||||
abort(); \
|
||||
}
|
||||
|
||||
#if 0
|
||||
#define T_PUT(type, var, argnum) \
|
||||
do { \
|
||||
if (T_LOCAL_size + sizeof(var) > T_BUFFER_MAX) { \
|
||||
printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
|
||||
", consider increasing T_BUFFER_MAX (%d)\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
|
||||
abort(); \
|
||||
} \
|
||||
memcpy(T_LOCAL_buf + T_LOCAL_size, &var, sizeof(var)); \
|
||||
T_LOCAL_size += sizeof(var); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define T_PROCESS(x, argnum) \
|
||||
do { \
|
||||
T_PUT(typeof(x), x, argnum); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define T_PROCESS(x, argnum) \
|
||||
do { \
|
||||
if (__builtin_types_compatible_p(typeof(x), int)) \
|
||||
{ T_PUT(int, (intptr_t)(x), argnum); printf("int\n"); } \
|
||||
else if (__builtin_types_compatible_p(typeof(x), short)) \
|
||||
{ T_PUT(short, (intptr_t)(x), argnum); printf("short\n"); } \
|
||||
else if (__builtin_types_compatible_p(typeof(x), float)) \
|
||||
{ T_PUT(float, (x), argnum); printf("float\n"); } \
|
||||
else if (__builtin_types_compatible_p(typeof(x), char *)) \
|
||||
{ T_PUT(char *, (char *)(intptr_t)(x), argnum); printf("char *\n"); } \
|
||||
else if (__builtin_types_compatible_p(typeof(x), float *)) \
|
||||
{ T_PUT(float *, (float *)(intptr_t)(x), argnum); printf("float *\n"); } \
|
||||
else if (__builtin_types_compatible_p(typeof(x), void *)) \
|
||||
{ T_PUT(void *, (void *)(intptr_t)(x), argnum); printf("void *\n"); } \
|
||||
else { \
|
||||
printf("%s:%d:%s: unsupported type for argument %d in T macro\n", \
|
||||
__FILE__, __LINE__, __FUNCTION__, argnum); \
|
||||
abort(); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/* we have 4 versions of T_HEADER:
|
||||
* - bad quality C++ version with time
|
||||
* - good quality C version with time
|
||||
@@ -597,10 +565,30 @@ extern T_cache_t *T_cache;
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
extern int *T_active;
|
||||
|
||||
#define CONFIG_HLP_TPORT "tracer port\n"
|
||||
#define CONFIG_HLP_NOTWAIT "don't wait for tracer, start immediately\n"
|
||||
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
|
||||
#define CONFIG_HLP_STDOUT "print log messges on console\n"
|
||||
|
||||
|
||||
#define TTRACER_CONFIG_PREFIX "TTracer"
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* configuration parameters for TTRACE utility */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_TTRACEPARAMS_DESC { \
|
||||
{"T_port", CONFIG_HLP_TPORT, 0, iptr:&T_port, defintval:2021, TYPE_INT, 0}, \
|
||||
{"T_nowait", CONFIG_HLP_NOTWAIT, PARAMFLAG_BOOL, iptr:&T_nowait, defintval:0, TYPE_INT, 0}, \
|
||||
{"T_dont_fork", CONFIG_HLP_TNOFORK, PARAMFLAG_BOOL, iptr:&T_dont_fork, defintval:0, TYPE_INT, 0}, \
|
||||
{"T_stdout", CONFIG_HLP_STDOUT, PARAMFLAG_BOOL, iptr:&T_stdout, defintval:1, TYPE_INT, 0}, \
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* log on stdout */
|
||||
void T_init(int remote_port, int wait_for_tracer, int dont_fork);
|
||||
|
||||
void T_Config_Init(void);
|
||||
#else /* T_TRACER */
|
||||
|
||||
/* if T_TRACER is not defined or is 0, the T is deactivated */
|
||||
|
||||
@@ -8,10 +8,20 @@
|
||||
#define T_MAX_ARGS 16
|
||||
|
||||
/* maximum size of a message - increase if needed */
|
||||
#define T_BUFFER_MAX (1024*64)
|
||||
#if BASIC_SIMULATOR
|
||||
/* let's have 100 RBs functional for the basic simulator */
|
||||
# define T_BUFFER_MAX (1024*64*2)
|
||||
#else
|
||||
# define T_BUFFER_MAX (1024*64)
|
||||
#endif
|
||||
|
||||
/* size of the local cache for messages (must be pow(2,something)) */
|
||||
#define T_CACHE_SIZE (8192 * 2)
|
||||
#if BASIC_SIMULATOR
|
||||
/* we don't need much space for the basic simulator */
|
||||
# define T_CACHE_SIZE 1024
|
||||
#else
|
||||
# define T_CACHE_SIZE (8192 * 2)
|
||||
#endif
|
||||
|
||||
/* maximum number of bytes a message can contain */
|
||||
#ifdef T_SEND_TIME
|
||||
@@ -29,7 +39,7 @@ typedef struct {
|
||||
#define T_SHM_FILENAME "/T_shm_segment"
|
||||
|
||||
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_FUNCTIONS 187
|
||||
#define VCD_NUM_FUNCTIONS 190
|
||||
|
||||
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_VARIABLES 128
|
||||
|
||||
@@ -749,7 +749,26 @@ ID = LEGACY_OSA_TRACE
|
||||
DESC = OSA legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
|
||||
ID = LEGACY_SIM_INFO
|
||||
DESC = SIM legacy logs - info level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_INFO:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_ERROR
|
||||
DESC = SIM legacy logs - error level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_ERROR:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_WARNING
|
||||
DESC = SIM legacy logs - warning level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_WARNING:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_DEBUG
|
||||
DESC = SIM legacy logs - debug level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_DEBUG:LEGACY
|
||||
FORMAT = string,log
|
||||
ID = LEGACY_SIM_TRACE
|
||||
DESC = SIM legacy logs - trace level
|
||||
GROUP = ALL:LEGACY_SIM:LEGACY_GROUP_TRACE:LEGACY
|
||||
FORMAT = string,log
|
||||
# this is a bad hack but I won't fix (function util_print_hex_octets
|
||||
# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
|
||||
# does funky things with the LOG_x macros but we work on the C pre-processor
|
||||
@@ -1034,18 +1053,6 @@ ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_UE
|
||||
DESC = VCD variable SUBFRAME_NUMBER_RX1_UE
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_MISSED_SLOTS_ENB
|
||||
DESC = VCD variable MISSED_SLOTS_ENB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_DAQ_MBOX
|
||||
DESC = VCD variable DAQ_MBOX
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_UE_OFFSET_MBOX
|
||||
DESC = VCD variable UE_OFFSET_MBOX
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_UE_RX_OFFSET
|
||||
DESC = VCD variable UE_RX_OFFSET
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
@@ -1442,6 +1449,18 @@ ID = VCD_VARIABLE_UE0_TRX_WRITE_NS_MISSING
|
||||
DESC = VCD variable UE0_TRX_WRITE_NS_MISSING
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_CPUID_ENB_THREAD_RXTX
|
||||
DESC = VCD variable CPUID_ENB_THREAD_RXTX
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_CPUID_RU_THREAD
|
||||
DESC = VCD variable CPUID_RU_THREAD
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_CPUID_RU_THREAD_TX
|
||||
DESC = VCD variable CPUID_RU_THREAD_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
|
||||
#functions
|
||||
|
||||
@@ -1541,6 +1560,18 @@ ID = VCD_FUNCTION_UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1
|
||||
DESC = VCD function UE_LOCK_MUTEX_RXTX_FOR_CNT_INCREMENT1
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_SIM_DO_DL_SIGNAL
|
||||
DESC = VCD function SIM_DO_DL_SIGNAL
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_SIM_DO_UL_SIGNAL
|
||||
DESC = VCD function SIM_DO_UL_SIGNAL
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_SIM_UE_TRX_READ
|
||||
DESC = VCD function SIM_UE_TRX_READ
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_eNB_TX
|
||||
DESC = VCD function eNB_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
|
||||
@@ -300,6 +300,20 @@ static void forward(void *_forwarder, char *buf, int size)
|
||||
if (f->tail != NULL) f->tail->next = new;
|
||||
f->tail = new;
|
||||
|
||||
#if BASIC_SIMULATOR
|
||||
/* When runnng the basic simulator, the tracer may be too slow.
|
||||
* Let's not take too much memory in the tracee and
|
||||
* wait if there is too much data to send. 200MB is
|
||||
* arbitrary.
|
||||
*/
|
||||
while (f->memusage > 200 * 1024 * 1024) {
|
||||
if (pthread_cond_signal(&f->cond)) abort();
|
||||
if (pthread_mutex_unlock(&f->lock)) abort();
|
||||
usleep(1000);
|
||||
if (pthread_mutex_lock(&f->lock)) abort();
|
||||
}
|
||||
#endif /* BASIC_SIMULATOR */
|
||||
|
||||
f->memusage += size+4;
|
||||
/* warn every 100MB */
|
||||
if (f->memusage > f->last_warning_memusage &&
|
||||
@@ -326,17 +340,17 @@ static void wait_message(void)
|
||||
while (T_local_cache[T_busylist_head].busy == 0) usleep(1000);
|
||||
}
|
||||
|
||||
static void init_shm(void)
|
||||
static void init_shm(char *shm_file)
|
||||
{
|
||||
int i;
|
||||
int s = shm_open(T_SHM_FILENAME, O_RDWR | O_CREAT /*| O_SYNC*/, 0666);
|
||||
if (s == -1) { perror(T_SHM_FILENAME); abort(); }
|
||||
int s = shm_open(shm_file, O_RDWR | O_CREAT /*| O_SYNC*/, 0666);
|
||||
if (s == -1) { perror(shm_file); abort(); }
|
||||
if (ftruncate(s, T_CACHE_SIZE * sizeof(T_cache_t)))
|
||||
{ perror(T_SHM_FILENAME); abort(); }
|
||||
{ perror(shm_file); abort(); }
|
||||
T_local_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t),
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, s, 0);
|
||||
if (T_local_cache == NULL)
|
||||
{ perror(T_SHM_FILENAME); abort(); }
|
||||
if (T_local_cache == MAP_FAILED)
|
||||
{ perror(shm_file); abort(); }
|
||||
close(s);
|
||||
|
||||
/* let's garbage the memory to catch some potential problems
|
||||
@@ -347,26 +361,30 @@ static void init_shm(void)
|
||||
}
|
||||
|
||||
void T_local_tracer_main(int remote_port, int wait_for_tracer,
|
||||
int local_socket)
|
||||
int local_socket, char *shm_file)
|
||||
{
|
||||
int s;
|
||||
int port = remote_port;
|
||||
int dont_wait = wait_for_tracer ? 0 : 1;
|
||||
void *f;
|
||||
|
||||
printf("local tracer starting\n");
|
||||
/* write on a socket fails if the other end is closed and we get SIGPIPE */
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR){
|
||||
printf("local tracer received SIGPIPE\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
init_shm();
|
||||
init_shm(shm_file);
|
||||
s = local_socket;
|
||||
|
||||
printf("local tracer starting step 2\n");
|
||||
if (dont_wait) {
|
||||
char t = 2;
|
||||
printf("local tracer in no wait mode \n");
|
||||
if (write(s, &t, 1) != 1) abort();
|
||||
}
|
||||
|
||||
printf("local tracer starting step 3\n");
|
||||
f = forwarder(port, s);
|
||||
|
||||
printf("local tracer main loop.... \n");
|
||||
/* read messages */
|
||||
while (1) {
|
||||
wait_message();
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "gui/gui.h"
|
||||
#include "filter/filter.h"
|
||||
#include "utils.h"
|
||||
#include "../T_defs.h"
|
||||
#include "event_selector.h"
|
||||
#include "openair_logo.h"
|
||||
#include "config.h"
|
||||
@@ -875,6 +874,8 @@ int main(int n, char **v)
|
||||
if (pthread_mutex_init(&enb_data.lock, NULL)) abort();
|
||||
setup_event_selector(g, database, is_on, is_on_changed, &enb_data);
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
restart:
|
||||
clear_remote_config();
|
||||
enb_data.socket = connect_to(ip, port);
|
||||
@@ -884,9 +885,8 @@ restart:
|
||||
|
||||
/* read messages */
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(enb_data.socket, v, database);
|
||||
e = get_event(enb_data.socket, &ebuf, database);
|
||||
if (e.type == -1) goto restart;
|
||||
if (pthread_mutex_lock(&enb_data.lock)) abort();
|
||||
handle_event(h, e);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
event get_event(int socket, char *event_buffer, void *database)
|
||||
event get_event(int socket, OBUF *event_buffer, void *database)
|
||||
{
|
||||
#ifdef T_SEND_TIME
|
||||
struct timespec t;
|
||||
@@ -29,17 +29,23 @@ again:
|
||||
#endif
|
||||
if (fullread(socket, &type, sizeof(int)) == -1) goto read_error;
|
||||
length -= sizeof(int);
|
||||
if (fullread(socket, event_buffer, length) == -1) goto read_error;
|
||||
if (event_buffer->omaxsize < length) {
|
||||
event_buffer->omaxsize = (length + 65535) & ~65535;
|
||||
event_buffer->obuf = realloc(event_buffer->obuf, event_buffer->omaxsize);
|
||||
if (event_buffer->obuf == NULL) { printf("out of memory\n"); exit(1); }
|
||||
}
|
||||
if (fullread(socket, event_buffer->obuf, length) == -1) goto read_error;
|
||||
event_buffer->osize = length;
|
||||
|
||||
if (type == -1) append_received_config_chunk(event_buffer, length);
|
||||
if (type == -1) append_received_config_chunk(event_buffer->obuf, length);
|
||||
if (type == -2) verify_config();
|
||||
|
||||
if (type == -1 || type == -2) goto again;
|
||||
|
||||
#ifdef T_SEND_TIME
|
||||
return new_event(t, type, length, event_buffer, database);
|
||||
return new_event(t, type, length, event_buffer->obuf, database);
|
||||
#else
|
||||
return new_event(type, length, event_buffer, database);
|
||||
return new_event(type, length, event_buffer->obuf, database);
|
||||
#endif
|
||||
|
||||
read_error:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef _EVENT_H_
|
||||
#define _EVENT_H_
|
||||
|
||||
#include "utils.h"
|
||||
#include "../T_defs.h"
|
||||
#ifdef T_SEND_TIME
|
||||
#include <time.h>
|
||||
@@ -37,7 +38,7 @@ typedef struct {
|
||||
int ecount;
|
||||
} event;
|
||||
|
||||
event get_event(int s, char *v, void *d);
|
||||
event get_event(int s, OBUF *v, void *d);
|
||||
|
||||
#ifdef T_SEND_TIME
|
||||
event new_event(struct timespec sending_time, int type,
|
||||
|
||||
@@ -99,10 +99,11 @@ int main(int n, char **v)
|
||||
|
||||
found = 0;
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(fd, v, database);
|
||||
e = get_event(fd, &ebuf, database);
|
||||
if (e.type == -1) break;
|
||||
if (e.type != input_event_id) continue;
|
||||
for (i = 0; i < filter_count; i++)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "utils.h"
|
||||
#include "../T_defs.h"
|
||||
|
||||
void usage(void)
|
||||
@@ -35,14 +36,22 @@ int main(int n, char **v)
|
||||
in = fopen(input_filename, "r");
|
||||
if (in == NULL) { perror(input_filename); abort(); }
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
while (1) {
|
||||
int type;
|
||||
int32_t length;
|
||||
char v[T_BUFFER_MAX];
|
||||
char *v;
|
||||
int vpos = 0;
|
||||
|
||||
/* read event from file */
|
||||
if (fread(&length, 4, 1, in) != 1) break;
|
||||
if (ebuf.omaxsize < length) {
|
||||
ebuf.omaxsize = (length + 65535) & ~65535;
|
||||
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
|
||||
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
|
||||
}
|
||||
v = ebuf.obuf;
|
||||
memcpy(v+vpos, &length, 4);
|
||||
vpos += 4;
|
||||
#ifdef T_SEND_TIME
|
||||
|
||||
@@ -104,11 +104,12 @@ err:
|
||||
fd = open(file, O_RDONLY);
|
||||
if (fd == -1) { perror(file); exit(1); }
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
/* get wanted frame/subframe */
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(fd, v, database);
|
||||
e = get_event(fd, &ebuf, database);
|
||||
if (e.type == -1) break;
|
||||
if (e.type != input_event_id) continue;
|
||||
if (verbose)
|
||||
@@ -116,12 +117,7 @@ err:
|
||||
e.e[frame_arg].i, e.e[subframe_arg].i, e.e[buffer_arg].bsize);
|
||||
if (!(frame == e.e[frame_arg].i && subframe == e.e[subframe_arg].i))
|
||||
continue;
|
||||
#if 0
|
||||
for (i = 0; i < e.e[buffer_arg].bsize/2; i++) {
|
||||
short *x = e.e[buffer_arg].b;
|
||||
x[i] *= 14;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1)
|
||||
{ perror(output_file); exit(1); }
|
||||
processed_subframes++;
|
||||
|
||||
@@ -100,10 +100,12 @@ err:
|
||||
int last_frame = -1;
|
||||
int last_subframe = -1;
|
||||
int subframe_written = 0;
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(fd, v, database);
|
||||
e = get_event(fd, &ebuf, database);
|
||||
if (e.type == -1) break;
|
||||
if (e.type != output_event_id) continue;
|
||||
if (verbose)
|
||||
@@ -122,12 +124,6 @@ err:
|
||||
}
|
||||
last_frame = frame;
|
||||
last_subframe = subframe;
|
||||
#if 0
|
||||
for (i = 0; i < e.e[buffer_arg].bsize/2; i++) {
|
||||
short *x = e.e[buffer_arg].b;
|
||||
x[i] *= 14;
|
||||
}
|
||||
#endif
|
||||
if (verbose)
|
||||
printf("save output frame %d subframe %d size %d\n",
|
||||
e.e[frame_arg].i, e.e[subframe_arg].i, e.e[buffer_arg].bsize);
|
||||
|
||||
@@ -22,13 +22,7 @@ int main(void)
|
||||
widget_add_child(g, c1, c2, 0);
|
||||
|
||||
plot = new_xy_plot(g, 100, 100, "xy plot test", 30);
|
||||
#if 0
|
||||
c2 = new_container(g, HORIZONTAL);
|
||||
widget_add_child(g, c2, plot, -1);
|
||||
widget_add_child(g, c1, c2, -1);
|
||||
#else
|
||||
widget_add_child(g, c1, plot, -1);
|
||||
#endif
|
||||
|
||||
tlcol = new_color(g, "#ddf");
|
||||
tl = new_textlist(g, 300, 10, tlcol);
|
||||
|
||||
@@ -124,20 +124,6 @@ x_window *x_create_window(x_connection *_x, int width, int height,
|
||||
|
||||
XMapWindow(x->d, ret->w);
|
||||
|
||||
#if 0
|
||||
/* wait for window to be mapped */
|
||||
LOGD("wait for map\n");
|
||||
while (1) {
|
||||
XEvent ev;
|
||||
//XWindowEvent(x->d, ret->w, StructureNotifyMask, &ev);
|
||||
XWindowEvent(x->d, ret->w, ExposureMask, &ev);
|
||||
LOGD("got ev %d\n", ev.type);
|
||||
//if (ev.type == MapNotify) break;
|
||||
if (ev.type == Expose) break;
|
||||
}
|
||||
LOGD("XXX create connection %p window %p (win id %d pixmap %d) w h %d %d\n", x, ret, (int)ret->w, (int)ret->p, width, height);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -265,14 +251,6 @@ void x_events(gui *_gui)
|
||||
ev.xbutton.button, 1);
|
||||
}
|
||||
break;
|
||||
#if 0
|
||||
case MapNotify:
|
||||
if ((w = find_x_window(g, ev.xmap.window)) != NULL) {
|
||||
struct x_window *xw = w->x;
|
||||
xw->repaint = 1;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
default: if (gui_logd) WARN("TODO: X event type %d\n", ev.type); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,165 +7,6 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#if 0
|
||||
/* this version behaves differently when you resize the XY plot. Say
|
||||
* you increase the size. The old (smaller) view is put at the center
|
||||
* of the new view. Everything inside keeps the same size/aspect ratio.
|
||||
* The other version below resizes the old view so that it fully occupies
|
||||
* the new view. It may introduce aspect ratio changes, but usage seems
|
||||
* to suggest it's a better behaviour.
|
||||
*/
|
||||
static void paint(gui *_gui, widget *_this)
|
||||
{
|
||||
struct gui *g = _gui;
|
||||
struct xy_plot_widget *this = _this;
|
||||
int wanted_plot_width, allocated_plot_width;
|
||||
int wanted_plot_height, allocated_plot_height;
|
||||
float pxsize;
|
||||
float ticdist;
|
||||
float tic;
|
||||
float ticstep;
|
||||
int k, kmin, kmax;
|
||||
float allocated_xmin, allocated_xmax;
|
||||
float allocated_ymin, allocated_ymax;
|
||||
float center;
|
||||
int i;
|
||||
int n;
|
||||
|
||||
# define FLIP(v) (-(v) + allocated_plot_height-1)
|
||||
|
||||
LOGD("PAINT xy plot xywh %d %d %d %d\n", this->common.x, this->common.y, this->common.width, this->common.height);
|
||||
|
||||
//x_draw_rectangle(g->x, g->xwin, 1, this->common.x, this->common.y, this->common.width, this->common.height);
|
||||
|
||||
wanted_plot_width = this->wanted_width;
|
||||
allocated_plot_width = this->common.width - this->vrule_width;
|
||||
wanted_plot_height = this->wanted_height;
|
||||
allocated_plot_height = this->common.height - this->label_height * 2;
|
||||
|
||||
/* plot zone */
|
||||
/* TODO: refine height - height of hrule text may be != from label */
|
||||
x_draw_rectangle(g->x, g->xwin, 1,
|
||||
this->common.x + this->vrule_width,
|
||||
this->common.y,
|
||||
this->common.width - this->vrule_width -1, /* -1 to see right border */
|
||||
this->common.height - this->label_height * 2);
|
||||
|
||||
/* horizontal tics */
|
||||
pxsize = (this->xmax - this->xmin) / wanted_plot_width;
|
||||
ticdist = 100;
|
||||
tic = floor(log10(ticdist * pxsize));
|
||||
ticstep = powf(10, tic);
|
||||
center = (this->xmax + this->xmin) / 2;
|
||||
allocated_xmin = center - ((this->xmax - this->xmin) *
|
||||
allocated_plot_width / wanted_plot_width) / 2;
|
||||
allocated_xmax = center + ((this->xmax - this->xmin) *
|
||||
allocated_plot_width / wanted_plot_width) / 2;
|
||||
/* adjust tic if too tight */
|
||||
LOGD("pre x ticstep %g\n", ticstep);
|
||||
while (1) {
|
||||
if (ticstep / (allocated_xmax - allocated_xmin)
|
||||
* (allocated_plot_width - 1) > 40) break;
|
||||
ticstep *= 2;
|
||||
}
|
||||
LOGD("post x ticstep %g\n", ticstep);
|
||||
LOGD("xmin/max %g %g width wanted allocated %d %d alloc xmin/max %g %g ticstep %g\n", this->xmin, this->xmax, wanted_plot_width, allocated_plot_width, allocated_xmin, allocated_xmax, ticstep);
|
||||
kmin = ceil(allocated_xmin / ticstep);
|
||||
kmax = floor(allocated_xmax / ticstep);
|
||||
for (k = kmin; k <= kmax; k++) {
|
||||
/*
|
||||
(k * ticstep - allocated_xmin) / (allocated_max - allocated_xmin) =
|
||||
(x - 0) / (allocated_plot_width-1 - 0)
|
||||
*/
|
||||
char v[64];
|
||||
int vwidth, dummy;
|
||||
int x = (k * ticstep - allocated_xmin) /
|
||||
(allocated_xmax - allocated_xmin) *
|
||||
(allocated_plot_width - 1);
|
||||
x_draw_line(g->x, g->xwin, FOREGROUND_COLOR,
|
||||
this->common.x + this->vrule_width + x,
|
||||
this->common.y + this->common.height - this->label_height * 2,
|
||||
this->common.x + this->vrule_width + x,
|
||||
this->common.y + this->common.height - this->label_height * 2 - 5);
|
||||
sprintf(v, "%g", k * ticstep);
|
||||
x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy);
|
||||
x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR,
|
||||
this->common.x + this->vrule_width + x - vwidth/2,
|
||||
this->common.y + this->common.height - this->label_height * 2 +
|
||||
this->label_baseline,
|
||||
v);
|
||||
LOGD("tic k %d val %g x %d\n", k, k * ticstep, x);
|
||||
}
|
||||
|
||||
/* vertical tics */
|
||||
pxsize = (this->ymax - this->ymin) / wanted_plot_height;
|
||||
ticdist = 30;
|
||||
tic = floor(log10(ticdist * pxsize));
|
||||
ticstep = powf(10, tic);
|
||||
center = (this->ymax + this->ymin) / 2;
|
||||
allocated_ymin = center - ((this->ymax - this->ymin) *
|
||||
allocated_plot_height / wanted_plot_height) / 2;
|
||||
allocated_ymax = center + ((this->ymax - this->ymin) *
|
||||
allocated_plot_height / wanted_plot_height) / 2;
|
||||
/* adjust tic if too tight */
|
||||
LOGD("pre y ticstep %g\n", ticstep);
|
||||
while (1) {
|
||||
if (ticstep / (allocated_ymax - allocated_ymin)
|
||||
* (allocated_plot_height - 1) > 20) break;
|
||||
ticstep *= 2;
|
||||
}
|
||||
LOGD("post y ticstep %g\n", ticstep);
|
||||
LOGD("ymin/max %g %g height wanted allocated %d %d alloc ymin/max %g %g ticstep %g\n", this->ymin, this->ymax, wanted_plot_height, allocated_plot_height, allocated_ymin, allocated_ymax, ticstep);
|
||||
kmin = ceil(allocated_ymin / ticstep);
|
||||
kmax = floor(allocated_ymax / ticstep);
|
||||
for (k = kmin; k <= kmax; k++) {
|
||||
char v[64];
|
||||
int vwidth, dummy;
|
||||
int y = (k * ticstep - allocated_ymin) /
|
||||
(allocated_ymax - allocated_ymin) *
|
||||
(allocated_plot_height - 1);
|
||||
sprintf(v, "%g", k * ticstep);
|
||||
x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy);
|
||||
x_draw_line(g->x, g->xwin, FOREGROUND_COLOR,
|
||||
this->common.x + this->vrule_width,
|
||||
this->common.y + FLIP(y),
|
||||
this->common.x + this->vrule_width + 5,
|
||||
this->common.y + FLIP(y));
|
||||
x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR,
|
||||
this->common.x + this->vrule_width - vwidth - 2,
|
||||
this->common.y + FLIP(y) - this->label_height/2+this->label_baseline,
|
||||
v);
|
||||
}
|
||||
|
||||
/* label at bottom, in the middle */
|
||||
x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR,
|
||||
this->common.x + (this->common.width - this->label_width) / 2,
|
||||
this->common.y + this->common.height - this->label_height
|
||||
+ this->label_baseline,
|
||||
this->label);
|
||||
|
||||
for (n = 0; n < this->nplots; n++) {
|
||||
/* points */
|
||||
float ax, bx, ay, by;
|
||||
ax = (allocated_plot_width-1) / (allocated_xmax - allocated_xmin);
|
||||
bx = -ax * allocated_xmin;
|
||||
ay = (allocated_plot_height-1) / (allocated_ymax - allocated_ymin);
|
||||
by = -ay * allocated_ymin;
|
||||
for (i = 0; i < this->plots[n].npoints; i++) {
|
||||
int x, y;
|
||||
x = ax * this->plots[n].x[i] + bx;
|
||||
y = ay * this->plots[n].y[i] + by;
|
||||
if (x >= 0 && x < allocated_plot_width &&
|
||||
y >= 0 && y < allocated_plot_height)
|
||||
x_add_point(g->x,
|
||||
this->common.x + this->vrule_width + x,
|
||||
this->common.y + FLIP(y));
|
||||
}
|
||||
x_plot_points(g->x, g->xwin, this->plots[n].color);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void paint(gui *_gui, widget *_this)
|
||||
{
|
||||
struct gui *g = _gui;
|
||||
|
||||
@@ -73,17 +73,22 @@ int main(int n, char **v)
|
||||
socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
|
||||
abort();
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
char dump[10][T_BUFFER_MAX];
|
||||
event dump_ev[10];
|
||||
FILE *z = fopen("/tmp/dd", "w"); if (z == NULL) abort();
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
char *v;
|
||||
event e;
|
||||
e = get_event(socket, v, database);
|
||||
e = get_event(socket, &ebuf, database);
|
||||
v = ebuf.obuf;
|
||||
if (e.type == -1) break;
|
||||
if (e.type == ev_input) {
|
||||
int sf = e.e[2].i;
|
||||
memcpy(dump[sf], v, T_BUFFER_MAX);
|
||||
if (ebuf.osize > T_BUFFER_MAX)
|
||||
{ printf("event size too big\n"); exit(1); }
|
||||
memcpy(dump[sf], ebuf.obuf, ebuf.osize);
|
||||
dump_ev[sf] = e;
|
||||
printf("input %d/%d\n", e.e[1].i, sf);
|
||||
if (fwrite(dump_ev[sf].e[4].b, dump_ev[sf].e[4].bsize, 1, z) != 1) abort();
|
||||
|
||||
@@ -84,11 +84,12 @@ int main(int n, char **v)
|
||||
socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
|
||||
abort();
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
int on_off;
|
||||
e = get_event(socket, v, database);
|
||||
e = get_event(socket, &ebuf, database);
|
||||
if (e.type == -1) break;
|
||||
if (e.type != ev_fun)
|
||||
{ printf("unhandled event %d\n", e.type); continue; }
|
||||
|
||||
@@ -20,42 +20,6 @@ struct iqlog {
|
||||
int max_length;
|
||||
};
|
||||
|
||||
#if 0
|
||||
/* this function passes all received IQ samples to the views */
|
||||
static void _event(void *p, event e)
|
||||
{
|
||||
struct iqlog *l = p;
|
||||
int i;
|
||||
void *buffer;
|
||||
int bsize;
|
||||
int nsamples;
|
||||
|
||||
if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
|
||||
return;
|
||||
|
||||
buffer = e.e[l->buffer_arg].b;
|
||||
bsize = e.e[l->buffer_arg].bsize;
|
||||
|
||||
nsamples = bsize / (2*sizeof(int16_t));
|
||||
|
||||
if (nsamples > l->max_length) {
|
||||
l->i = realloc(l->i, nsamples * sizeof(float));
|
||||
if (l->i == NULL) abort();
|
||||
l->q = realloc(l->q, nsamples * sizeof(float));
|
||||
if (l->q == NULL) abort();
|
||||
l->max_length = nsamples;
|
||||
}
|
||||
|
||||
for (i = 0; i < nsamples; i++) {
|
||||
l->i[i] = ((int16_t *)buffer)[i*2];
|
||||
l->q[i] = ((int16_t *)buffer)[i*2+1];
|
||||
}
|
||||
|
||||
for (i = 0; i < l->common.vsize; i++)
|
||||
l->common.v[i]->append(l->common.v[i], l->i, l->q, nsamples);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void _event(void *p, event e)
|
||||
{
|
||||
struct iqlog *l = p;
|
||||
|
||||
@@ -246,11 +246,12 @@ int main(int n, char **v)
|
||||
|
||||
new_thread(receiver, &d);
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
/* read messages */
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(in, v, database);
|
||||
e = get_event(in, &ebuf, database);
|
||||
if (e.type == -1) break;
|
||||
if (!(e.type == ul_id || e.type == dl_id)) continue;
|
||||
handle_event(h, e);
|
||||
|
||||
@@ -56,176 +56,6 @@
|
||||
#define SC_RNTI 9
|
||||
#define G_RNTI 10
|
||||
|
||||
#if 0
|
||||
typedef enum mac_lte_oob_event {
|
||||
ltemac_send_preamble,
|
||||
ltemac_send_sr,
|
||||
ltemac_sr_failure
|
||||
} mac_lte_oob_event;
|
||||
|
||||
typedef enum mac_lte_dl_retx {
|
||||
dl_retx_no,
|
||||
dl_retx_yes,
|
||||
dl_retx_unknown
|
||||
} mac_lte_dl_retx;
|
||||
|
||||
typedef enum mac_lte_crc_status {
|
||||
crc_fail = 0,
|
||||
crc_success = 1,
|
||||
crc_high_code_rate = 2,
|
||||
crc_pdsch_lost = 3,
|
||||
crc_duplicate_nonzero_rv = 4,
|
||||
crc_false_dci = 5
|
||||
} mac_lte_crc_status;
|
||||
|
||||
typedef enum mac_lte_carrier_id {
|
||||
carrier_id_primary,
|
||||
carrier_id_secondary_1,
|
||||
carrier_id_secondary_2,
|
||||
carrier_id_secondary_3,
|
||||
carrier_id_secondary_4
|
||||
} mac_lte_carrier_id;
|
||||
|
||||
typedef enum mac_lte_ce_mode {
|
||||
no_ce_mode = 0,
|
||||
ce_mode_a = 1,
|
||||
ce_mode_b = 2
|
||||
} mac_lte_ce_mode;
|
||||
|
||||
typedef enum mac_lte_nb_mode {
|
||||
no_nb_mode = 0,
|
||||
nb_mode = 1
|
||||
} mac_lte_nb_mode;
|
||||
|
||||
/* Context info attached to each LTE MAC frame */
|
||||
typedef struct mac_lte_info
|
||||
{
|
||||
/* Needed for decode */
|
||||
guint8 radioType;
|
||||
guint8 direction;
|
||||
guint8 rntiType;
|
||||
|
||||
/* Extra info to display */
|
||||
guint16 rnti;
|
||||
guint16 ueid;
|
||||
|
||||
/* Timing info */
|
||||
guint16 sysframeNumber;
|
||||
guint16 subframeNumber;
|
||||
|
||||
/* Optional field. More interesting for TDD (FDD is always -4 subframeNumber) */
|
||||
gboolean subframeNumberOfGrantPresent;
|
||||
guint16 subframeNumberOfGrant;
|
||||
|
||||
/* Flag set only if doing PHY-level data test - i.e. there may not be a
|
||||
well-formed MAC PDU so just show as raw data */
|
||||
gboolean isPredefinedData;
|
||||
|
||||
/* Length of DL PDU or UL grant size in bytes */
|
||||
guint16 length;
|
||||
|
||||
/* 0=newTx, 1=first-retx, etc */
|
||||
guint8 reTxCount;
|
||||
guint8 isPHICHNACK; /* FALSE=PDCCH retx grant, TRUE=PHICH NACK */
|
||||
|
||||
/* UL only. Indicates if the R10 extendedBSR-Sizes parameter is set */
|
||||
gboolean isExtendedBSRSizes;
|
||||
|
||||
/* UL only. Indicates if the R10 simultaneousPUCCH-PUSCH parameter is set for PCell */
|
||||
gboolean isSimultPUCCHPUSCHPCell;
|
||||
|
||||
/* UL only. Indicates if the R10 extendedBSR-Sizes parameter is set for PSCell */
|
||||
gboolean isSimultPUCCHPUSCHPSCell;
|
||||
|
||||
/* Status of CRC check. For UE it is DL only. For eNodeB it is UL
|
||||
only. For an analyzer, it is present for both DL and UL. */
|
||||
gboolean crcStatusValid;
|
||||
mac_lte_crc_status crcStatus;
|
||||
|
||||
/* Carrier ID */
|
||||
mac_lte_carrier_id carrierId;
|
||||
|
||||
/* DL only. Is this known to be a retransmission? */
|
||||
mac_lte_dl_retx dl_retx;
|
||||
|
||||
/* DL only. CE mode to be used for RAR decoding */
|
||||
mac_lte_ce_mode ceMode;
|
||||
|
||||
/* DL and UL. NB-IoT mode of the UE */
|
||||
mac_lte_nb_mode nbMode;
|
||||
|
||||
/* More Physical layer info (see direction above for which side of union to use) */
|
||||
union {
|
||||
struct mac_lte_ul_phy_info
|
||||
{
|
||||
guint8 present; /* Remaining UL fields are present and should be displayed */
|
||||
guint8 modulation_type;
|
||||
guint8 tbs_index;
|
||||
guint8 resource_block_length;
|
||||
guint8 resource_block_start;
|
||||
guint8 harq_id;
|
||||
gboolean ndi;
|
||||
} ul_info;
|
||||
struct mac_lte_dl_phy_info
|
||||
{
|
||||
guint8 present; /* Remaining DL fields are present and should be displayed */
|
||||
guint8 dci_format;
|
||||
guint8 resource_allocation_type;
|
||||
guint8 aggregation_level;
|
||||
guint8 mcs_index;
|
||||
guint8 redundancy_version_index;
|
||||
guint8 resource_block_length;
|
||||
guint8 harq_id;
|
||||
gboolean ndi;
|
||||
guint8 transport_block; /* 0..1 */
|
||||
} dl_info;
|
||||
} detailed_phy_info;
|
||||
|
||||
/* Relating to out-of-band events */
|
||||
/* N.B. dissector will only look to these fields if length is 0... */
|
||||
mac_lte_oob_event oob_event;
|
||||
guint8 rapid;
|
||||
guint8 rach_attempt_number;
|
||||
#define MAX_SRs 20
|
||||
guint16 number_of_srs;
|
||||
guint16 oob_ueid[MAX_SRs];
|
||||
guint16 oob_rnti[MAX_SRs];
|
||||
} mac_lte_info;
|
||||
|
||||
|
||||
typedef struct mac_lte_tap_info {
|
||||
/* Info from context */
|
||||
guint16 rnti;
|
||||
guint16 ueid;
|
||||
guint8 rntiType;
|
||||
guint8 isPredefinedData;
|
||||
gboolean crcStatusValid;
|
||||
mac_lte_crc_status crcStatus;
|
||||
guint8 direction;
|
||||
|
||||
guint8 isPHYRetx;
|
||||
guint16 ueInTTI;
|
||||
|
||||
nstime_t mac_lte_time;
|
||||
|
||||
/* Number of bytes (which part is used depends upon context settings) */
|
||||
guint32 single_number_of_bytes;
|
||||
guint32 bytes_for_lcid[11];
|
||||
guint32 sdus_for_lcid[11];
|
||||
guint8 number_of_rars;
|
||||
guint8 number_of_paging_ids;
|
||||
|
||||
/* Number of padding bytes includes padding subheaders and trailing padding */
|
||||
guint16 padding_bytes;
|
||||
guint16 raw_length;
|
||||
} mac_lte_tap_info;
|
||||
|
||||
|
||||
/* Accessor function to check if a frame was considered to be ReTx */
|
||||
int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction);
|
||||
|
||||
#endif
|
||||
|
||||
/*****************************************************************/
|
||||
/* UDP framing format */
|
||||
/* ----------------------- */
|
||||
@@ -309,82 +139,3 @@ int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction);
|
||||
continues until the end of the frame) */
|
||||
#define MAC_LTE_PAYLOAD_TAG 0x01
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
/* Type to store parameters for configuring LCID->RLC channel settings for DRB */
|
||||
/* Some are optional, and may not be seen (e.g. on reestablishment) */
|
||||
typedef struct drb_mapping_t
|
||||
{
|
||||
guint16 ueid; /* Mandatory */
|
||||
guint8 drbid; /* Mandatory */
|
||||
gboolean lcid_present;
|
||||
guint8 lcid; /* Part of LogicalChannelConfig - optional */
|
||||
gboolean rlcMode_present;
|
||||
guint8 rlcMode; /* Part of RLC config - optional */
|
||||
gboolean rlc_ul_ext_li_field; /* Part of RLC config - optional */
|
||||
gboolean rlc_dl_ext_li_field; /* Part of RLC config - optional */
|
||||
gboolean rlc_ul_ext_am_sn; /* Part of RLC config - optional */
|
||||
gboolean rlc_dl_ext_am_sn; /* Part of RLC config - optional */
|
||||
gboolean um_sn_length_present;
|
||||
guint8 um_sn_length; /* Part of RLC config - optional */
|
||||
gboolean ul_priority_present;
|
||||
guint8 ul_priority; /* Part of LogicalChannelConfig - optional */
|
||||
gboolean pdcp_sn_size_present;
|
||||
guint8 pdcp_sn_size; /* Part of pdcp-Config - optional */
|
||||
} drb_mapping_t;
|
||||
|
||||
|
||||
/* Set details of an LCID -> drb channel mapping. To be called from
|
||||
configuration protocol (e.g. RRC) */
|
||||
void set_mac_lte_channel_mapping(drb_mapping_t *drb_mapping);
|
||||
|
||||
|
||||
/* Dedicated DRX config. Used to verify that a sensible config is given.
|
||||
Also, beginning to configure MAC with this config and (optionally) show
|
||||
DRX config and state (cycles/timers) attached to each UL/DL PDU! */
|
||||
typedef struct drx_config_t {
|
||||
gboolean configured;
|
||||
guint32 frameNum;
|
||||
guint32 previousFrameNum;
|
||||
|
||||
guint32 onDurationTimer;
|
||||
guint32 inactivityTimer;
|
||||
guint32 retransmissionTimer;
|
||||
guint32 longCycle;
|
||||
guint32 cycleOffset;
|
||||
/* Optional Short cycle */
|
||||
gboolean shortCycleConfigured;
|
||||
guint32 shortCycle;
|
||||
guint32 shortCycleTimer;
|
||||
} drx_config_t;
|
||||
|
||||
/* Functions to set/release up dedicated DRX config */
|
||||
void set_mac_lte_drx_config(guint16 ueid, drx_config_t *drx_config, packet_info *pinfo);
|
||||
void set_mac_lte_drx_config_release(guint16 ueid, packet_info *pinfo);
|
||||
|
||||
/* RRC can tell this dissector which RAPIDs are Group A, Group A&B */
|
||||
void set_mac_lte_rapid_ranges(guint groupA, guint all_RA);
|
||||
|
||||
/* RRC can indicate whether extended BSR sizes are used */
|
||||
void set_mac_lte_extended_bsr_sizes(guint16 ueid, gboolean use_ext_bsr_sizes, packet_info *pinfo);
|
||||
|
||||
/* RRC can indicate whether simultaneous PUCCH/PUSCH is used */
|
||||
typedef enum {
|
||||
SIMULT_PUCCH_PUSCH_PCELL = 0,
|
||||
SIMULT_PUCCH_PUSCH_PSCELL
|
||||
} simult_pucch_pusch_cell_type;
|
||||
void set_mac_lte_simult_pucch_pusch(guint16 ueid, simult_pucch_pusch_cell_type cell_type, gboolean use_simult_pucch_pusch, packet_info *pinfo);
|
||||
|
||||
/* Functions to be called from outside this module (e.g. in a plugin, where mac_lte_info
|
||||
isn't available) to get/set per-packet data */
|
||||
WS_DLL_PUBLIC
|
||||
mac_lte_info *get_mac_lte_proto_data(packet_info *pinfo);
|
||||
WS_DLL_PUBLIC
|
||||
void set_mac_lte_proto_data(packet_info *pinfo, mac_lte_info *p_mac_lte_info);
|
||||
|
||||
/* Function to attempt to populate p_mac_lte_info using framing definition above */
|
||||
gboolean dissect_mac_lte_context_fields(struct mac_lte_info *p_mac_lte_info, tvbuff_t *tvb,
|
||||
gint *p_offset);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -123,14 +123,22 @@ int main(int n, char **v)
|
||||
if (signal(SIGINT, force_stop) == SIG_ERR) abort();
|
||||
if (signal(SIGTSTP, force_stop) == SIG_ERR) abort();
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
/* read messages */
|
||||
while (run) {
|
||||
int type;
|
||||
int32_t length;
|
||||
char v[T_BUFFER_MAX];
|
||||
char *v;
|
||||
int vpos = 0;
|
||||
|
||||
if (fullread(socket, &length, 4) == -1) goto read_error;
|
||||
if (ebuf.omaxsize < length) {
|
||||
ebuf.omaxsize = (length + 65535) & ~65535;
|
||||
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
|
||||
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
|
||||
}
|
||||
v = ebuf.obuf;
|
||||
memcpy(v+vpos, &length, 4);
|
||||
vpos += 4;
|
||||
#ifdef T_SEND_TIME
|
||||
|
||||
@@ -136,14 +136,22 @@ int main(int n, char **v)
|
||||
|
||||
new_thread(get_message_thread, &socket);
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
while (1) {
|
||||
int type;
|
||||
int32_t length;
|
||||
char v[T_BUFFER_MAX];
|
||||
char *v;
|
||||
int vpos = 0;
|
||||
|
||||
/* read event from file */
|
||||
if (fread(&length, 4, 1, in) != 1) break;
|
||||
if (ebuf.omaxsize < length) {
|
||||
ebuf.omaxsize = (length + 65535) & ~65535;
|
||||
ebuf.obuf = realloc(ebuf.obuf, ebuf.omaxsize);
|
||||
if (ebuf.obuf == NULL) { printf("out of memory\n"); exit(1); }
|
||||
}
|
||||
v = ebuf.obuf;
|
||||
memcpy(v+vpos, &length, 4);
|
||||
vpos += 4;
|
||||
#ifdef T_SEND_TIME
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "view/view.h"
|
||||
#include "gui/gui.h"
|
||||
#include "utils.h"
|
||||
#include "../T_defs.h"
|
||||
#include "event_selector.h"
|
||||
#include "config.h"
|
||||
|
||||
@@ -182,11 +181,12 @@ int main(int n, char **v)
|
||||
/* send the first message - activate selected traces */
|
||||
is_on_changed(&textlog_data);
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
/* read messages */
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(textlog_data.socket, v, database);
|
||||
e = get_event(textlog_data.socket, &ebuf, database);
|
||||
if (e.type == -1) abort();
|
||||
handle_event(h, e);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,8 @@ void usage(void)
|
||||
" -ip <host> connect to given IP address (default %s)\n"
|
||||
" -p <port> connect to given port (default %d)\n"
|
||||
" -b <event> <arg> <vcd name> trace as binary (0 off, anything else on)\n"
|
||||
" -l <event> <arg> <vcd name> trace as uint64_t\n",
|
||||
" -l <event> <arg> <vcd name> trace as uint64_t\n"
|
||||
" -vcd trace all VCD variables and functions\n",
|
||||
DEFAULT_REMOTE_IP,
|
||||
DEFAULT_REMOTE_PORT
|
||||
);
|
||||
@@ -192,6 +193,20 @@ void force_stop(int x)
|
||||
run = 0;
|
||||
}
|
||||
|
||||
vcd_vars *add_var(vcd_vars *vars, int nvars,
|
||||
char *event, char *arg, char *vcd_name, int is_boolean)
|
||||
{
|
||||
if (nvars % 64 == 0) {
|
||||
vars = realloc(vars, (nvars+64) * sizeof(vcd_vars));
|
||||
if (vars == NULL) abort();
|
||||
}
|
||||
vars[nvars].event = event;
|
||||
vars[nvars].arg = arg;
|
||||
vars[nvars].vcd_name = vcd_name;
|
||||
vars[nvars].boolean = is_boolean;
|
||||
return vars;
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *output_filename = NULL;
|
||||
@@ -202,11 +217,12 @@ int main(int n, char **v)
|
||||
int *is_on;
|
||||
int number_of_events;
|
||||
int i;
|
||||
vcd_vars vars[n];
|
||||
vcd_vars *vars = NULL;
|
||||
int nvars = 0;
|
||||
view *vcd_view;
|
||||
event_handler *h;
|
||||
logger *textlog;
|
||||
int all_vcd = 0;
|
||||
|
||||
/* write on a socket fails if the other end is closed and we get SIGPIPE */
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
|
||||
@@ -221,19 +237,22 @@ int main(int n, char **v)
|
||||
if (!strcmp(v[i], "-p"))
|
||||
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; }
|
||||
if (!strcmp(v[i], "-b")) { if(i>n-4)usage();
|
||||
vars[nvars].event = v[++i];
|
||||
vars[nvars].arg = v[++i];
|
||||
vars[nvars].vcd_name = v[++i];
|
||||
vars[nvars++].boolean = 1;
|
||||
char *event = v[++i];
|
||||
char *arg = v[++i];
|
||||
char *vcd_name = v[++i];
|
||||
vars = add_var(vars, nvars, event, arg, vcd_name, 1);
|
||||
nvars++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(v[i], "-l")) { if(i>n-4)usage();
|
||||
vars[nvars].event = v[++i];
|
||||
vars[nvars].arg = v[++i];
|
||||
vars[nvars].vcd_name = v[++i];
|
||||
vars[nvars++].boolean = 0;
|
||||
char *event = v[++i];
|
||||
char *arg = v[++i];
|
||||
char *vcd_name = v[++i];
|
||||
vars = add_var(vars, nvars, event, arg, vcd_name, 0);
|
||||
nvars++;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(v[i], "-vcd")) { all_vcd = 1; continue; }
|
||||
usage();
|
||||
}
|
||||
|
||||
@@ -260,11 +279,32 @@ int main(int n, char **v)
|
||||
/* create the view */
|
||||
vcd_view = new_view_vcd();
|
||||
|
||||
if (all_vcd) {
|
||||
/* activate all VCD traces */
|
||||
for (i = 0; i < number_of_events; i++) {
|
||||
int is_boolean;
|
||||
int prefix_length;
|
||||
char *name = event_name_from_id(database, i);
|
||||
char *var_prefix = "VCD_VARIABLE_";
|
||||
char *fun_prefix = "VCD_FUNCTION_";
|
||||
if (!strncmp(name, var_prefix, strlen(var_prefix))) {
|
||||
prefix_length = strlen(var_prefix);
|
||||
is_boolean = 0;
|
||||
} else if (!strncmp(name, fun_prefix, strlen(fun_prefix))) {
|
||||
prefix_length = strlen(fun_prefix);
|
||||
is_boolean = 1;
|
||||
} else
|
||||
continue;
|
||||
vars = add_var(vars, nvars,
|
||||
name, "value", name+prefix_length, is_boolean);
|
||||
nvars++;
|
||||
}
|
||||
}
|
||||
|
||||
/* setup traces */
|
||||
for (i = 0; i < nvars; i++) {
|
||||
char format[256];
|
||||
if (strlen(vars[i].arg) > 256-3) abort();
|
||||
if (strlen(vars[i].vcd_name) > 256-1) abort();
|
||||
if (strlen(vars[i].arg) + strlen(vars[i].vcd_name) > 256-16) abort();
|
||||
sprintf(format, "%c [%s] %s",
|
||||
vars[i].boolean ? 'b' : 'l',
|
||||
vars[i].arg,
|
||||
@@ -287,11 +327,12 @@ int main(int n, char **v)
|
||||
if (signal(SIGINT, force_stop) == SIG_ERR) abort();
|
||||
if (signal(SIGTSTP, force_stop) == SIG_ERR) abort();
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
/* read messages */
|
||||
while (run) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(socket, v, database);
|
||||
e = get_event(socket, &ebuf, database);
|
||||
if (e.type == -1) { printf("disconnected? let's quit gently\n"); break; }
|
||||
handle_event(h, e);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "gui/gui.h"
|
||||
#include "filter/filter.h"
|
||||
#include "utils.h"
|
||||
#include "../T_defs.h"
|
||||
#include "event_selector.h"
|
||||
#include "openair_logo.h"
|
||||
#include "config.h"
|
||||
@@ -854,6 +853,8 @@ int main(int n, char **v)
|
||||
if (pthread_mutex_init(&ue_data.lock, NULL)) abort();
|
||||
setup_event_selector(g, database, is_on, is_on_changed, &ue_data);
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
restart:
|
||||
clear_remote_config();
|
||||
ue_data.socket = connect_to(ip, port);
|
||||
@@ -863,9 +864,8 @@ restart:
|
||||
|
||||
/* read messages */
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(ue_data.socket, v, database);
|
||||
e = get_event(ue_data.socket, &ebuf, database);
|
||||
if (e.type == -1) goto restart;
|
||||
if (pthread_mutex_lock(&ue_data.lock)) abort();
|
||||
handle_event(h, e);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "view/view.h"
|
||||
#include "gui/gui.h"
|
||||
#include "utils.h"
|
||||
#include "../T_defs.h"
|
||||
#include "event_selector.h"
|
||||
#include "config.h"
|
||||
|
||||
@@ -188,11 +187,12 @@ int main(int n, char **v)
|
||||
/* send the first message - activate selected traces */
|
||||
is_on_changed(&vcd_data);
|
||||
|
||||
OBUF ebuf = { osize: 0, omaxsize: 0, obuf: NULL };
|
||||
|
||||
/* read messages */
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(vcd_data.socket, v, database);
|
||||
e = get_event(vcd_data.socket, &ebuf, database);
|
||||
if (e.type == -1) abort();
|
||||
handle_event(h, e);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ hash_table_t *hashtable_create(const hash_size_t sizeP, hash_size_t (*hashfuncP)
|
||||
* Cleanup
|
||||
* The hashtable_destroy() walks through the linked lists for each possible hash value, and releases the elements. It also releases the nodes array and the hash_table_t.
|
||||
*/
|
||||
hashtable_rc_t hashtable_destroy(hash_table_t * const hashtblP)
|
||||
hashtable_rc_t hashtable_destroy(hash_table_t * hashtblP)
|
||||
{
|
||||
hash_size_t n;
|
||||
hash_node_t *node, *oldnode;
|
||||
@@ -117,6 +117,7 @@ hashtable_rc_t hashtable_destroy(hash_table_t * const hashtblP)
|
||||
}
|
||||
free(hashtblP->nodes);
|
||||
free(hashtblP);
|
||||
hashtblP=NULL;
|
||||
return HASH_TABLE_OK;
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#ifndef ASSERTIONS_H_
|
||||
#define ASSERTIONS_H_
|
||||
|
||||
void output_log_mem(void);
|
||||
#define _Assert_Exit_ \
|
||||
{ \
|
||||
fprintf(stderr, "\nExiting execution\n"); \
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
#include "assertions.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "intertask_interface_dump.h"
|
||||
|
||||
#if T_TRACER
|
||||
#include "T.h"
|
||||
@@ -72,6 +71,9 @@ const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS);
|
||||
/* Global message size */
|
||||
#define MESSAGE_SIZE(mESSAGEiD) (sizeof(MessageHeader) + itti_desc.messages_info[mESSAGEiD].size)
|
||||
|
||||
|
||||
extern int emulate_rf;
|
||||
|
||||
typedef enum task_state_s {
|
||||
TASK_STATE_NOT_CONFIGURED, TASK_STATE_STARTING, TASK_STATE_READY, TASK_STATE_ENDED, TASK_STATE_MAX,
|
||||
} task_state_t;
|
||||
@@ -325,19 +327,113 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
|
||||
/* Increment the global message number */
|
||||
message_number = itti_increment_message_number ();
|
||||
|
||||
itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name,
|
||||
sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize);
|
||||
|
||||
if (destination_task_id != TASK_UNKNOWN) {
|
||||
|
||||
if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED) {
|
||||
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), ended destination task!\n",
|
||||
if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED ||
|
||||
itti_desc.threads[destination_thread_id].task_state == TASK_STATE_NOT_CONFIGURED) {
|
||||
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), unconfigured or ended destination task!\n",
|
||||
itti_desc.messages_info[message_id].name,
|
||||
message_number,
|
||||
priority,
|
||||
itti_get_task_name(origin_task_id),
|
||||
destination_task_id,
|
||||
itti_get_task_name(destination_task_id));
|
||||
} else {
|
||||
if(!emulate_rf){
|
||||
/* We cannot send a message if the task is not running */
|
||||
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
|
||||
"Task %s Cannot send message %s (%d) to thread %d, it is not in ready state (%d)!\n",
|
||||
itti_get_task_name(origin_task_id),
|
||||
itti_desc.messages_info[message_id].name,
|
||||
message_id,
|
||||
destination_thread_id,
|
||||
itti_desc.threads[destination_thread_id].task_state);
|
||||
}
|
||||
|
||||
/* Allocate new list element */
|
||||
new = (message_list_t *) itti_malloc (origin_task_id, destination_task_id, sizeof(struct message_list_s));
|
||||
|
||||
/* Fill in members */
|
||||
new->msg = message;
|
||||
new->message_number = message_number;
|
||||
new->message_priority = priority;
|
||||
|
||||
/* Enqueue message in destination task queue */
|
||||
if (lfds611_queue_enqueue(itti_desc.tasks[destination_task_id].message_queue, new) == 0) {
|
||||
AssertFatal(0, "Error: lfds611_queue_enqueue returns 0, queue is full, exiting\n");
|
||||
}
|
||||
|
||||
{
|
||||
/* Only use event fd for tasks, subtasks will pool the queue */
|
||||
if (TASK_GET_PARENT_TASK_ID(destination_task_id) == TASK_UNKNOWN) {
|
||||
ssize_t write_ret;
|
||||
eventfd_t sem_counter = 1;
|
||||
|
||||
/* Call to write for an event fd must be of 8 bytes */
|
||||
write_ret = write (itti_desc.threads[destination_thread_id].task_event_fd, &sem_counter, sizeof(sem_counter));
|
||||
AssertFatal (write_ret == sizeof(sem_counter), "Write to task message FD (%d) failed (%d/%d)\n",
|
||||
destination_thread_id, (int) write_ret, (int) sizeof(sem_counter));
|
||||
}
|
||||
}
|
||||
|
||||
ITTI_DEBUG(ITTI_DEBUG_SEND, " Message %s, number %lu with priority %d successfully sent from %s to queue (%u:%s)\n",
|
||||
itti_desc.messages_info[message_id].name,
|
||||
message_number,
|
||||
priority,
|
||||
itti_get_task_name(origin_task_id),
|
||||
destination_task_id,
|
||||
itti_get_task_name(destination_task_id));
|
||||
}
|
||||
} else {
|
||||
/* This is a debug message to TASK_UNKNOWN, we can release safely release it */
|
||||
int result = itti_free(origin_task_id, message);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* same as itti_send_msg_to_task but returns -1 in case of failure instead of crashing */
|
||||
/* TODO: this is a hack - the whole logic needs a proper rework. */
|
||||
/* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */
|
||||
int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance, MessageDef *message)
|
||||
{
|
||||
thread_id_t destination_thread_id;
|
||||
task_id_t origin_task_id;
|
||||
message_list_t *new;
|
||||
uint32_t priority;
|
||||
message_number_t message_number;
|
||||
uint32_t message_id;
|
||||
|
||||
AssertFatal (message != NULL, "Message is NULL!\n");
|
||||
AssertFatal (destination_task_id < itti_desc.task_max, "Destination task id (%d) is out of range (%d)\n", destination_task_id, itti_desc.task_max);
|
||||
|
||||
destination_thread_id = TASK_GET_THREAD_ID(destination_task_id);
|
||||
message->ittiMsgHeader.destinationTaskId = destination_task_id;
|
||||
message->ittiMsgHeader.instance = instance;
|
||||
message->ittiMsgHeader.lte_time.frame = itti_desc.lte_time.frame;
|
||||
message->ittiMsgHeader.lte_time.slot = itti_desc.lte_time.slot;
|
||||
message_id = message->ittiMsgHeader.messageId;
|
||||
AssertFatal (message_id < itti_desc.messages_id_max, "Message id (%d) is out of range (%d)!\n", message_id, itti_desc.messages_id_max);
|
||||
|
||||
origin_task_id = ITTI_MSG_ORIGIN_ID(message);
|
||||
|
||||
priority = itti_get_message_priority (message_id);
|
||||
|
||||
/* Increment the global message number */
|
||||
message_number = itti_increment_message_number ();
|
||||
|
||||
if (destination_task_id != TASK_UNKNOWN) {
|
||||
|
||||
if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED ||
|
||||
itti_desc.threads[destination_thread_id].task_state == TASK_STATE_NOT_CONFIGURED) {
|
||||
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), unconfigured or ended destination task!\n",
|
||||
itti_desc.messages_info[message_id].name,
|
||||
message_number,
|
||||
priority,
|
||||
itti_get_task_name(origin_task_id),
|
||||
destination_task_id,
|
||||
itti_get_task_name(destination_task_id));
|
||||
} else {
|
||||
/* We cannot send a message if the task is not running */
|
||||
AssertFatal (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_READY,
|
||||
@@ -358,7 +454,8 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
|
||||
|
||||
/* Enqueue message in destination task queue */
|
||||
if (lfds611_queue_enqueue(itti_desc.tasks[destination_task_id].message_queue, new) == 0) {
|
||||
AssertFatal(0, "Error: lfds611_queue_enqueue returns 0, queue is full, exiting\n");
|
||||
itti_free(origin_task_id, new);
|
||||
return -1;
|
||||
}
|
||||
|
||||
{
|
||||
@@ -619,12 +716,18 @@ void itti_mark_task_ready(task_id_t task_id)
|
||||
|
||||
AssertFatal (thread_id < itti_desc.thread_max, "Thread id (%d) is out of range (%d)!\n", thread_id, itti_desc.thread_max);
|
||||
|
||||
/* Register the thread in itti dump */
|
||||
itti_dump_thread_use_ring_buffer();
|
||||
|
||||
/* Mark the thread as using LFDS queue */
|
||||
lfds611_queue_use(itti_desc.tasks[task_id].message_queue);
|
||||
|
||||
#if defined(UE_EXPANSION) || defined(RTAI)
|
||||
/* Assign low priority to created threads */
|
||||
{
|
||||
struct sched_param sched_param;
|
||||
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
|
||||
sched_setscheduler(0, SCHED_FIFO, &sched_param);
|
||||
}
|
||||
#endif
|
||||
|
||||
itti_desc.threads[thread_id].task_state = TASK_STATE_READY;
|
||||
itti_desc.ready_tasks ++;
|
||||
|
||||
@@ -666,7 +769,7 @@ void itti_terminate_tasks(task_id_t task_id)
|
||||
}
|
||||
|
||||
int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_id_max, const task_info_t *tasks_info,
|
||||
const message_info_t *messages_info, const char * const messages_definition_xml, const char * const dump_file_name)
|
||||
const message_info_t *messages_info)
|
||||
{
|
||||
task_id_t task_id;
|
||||
thread_id_t thread_id;
|
||||
@@ -751,8 +854,6 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i
|
||||
itti_desc.wait_tasks = 0;
|
||||
itti_desc.created_tasks = 0;
|
||||
itti_desc.ready_tasks = 0;
|
||||
itti_dump_init (messages_definition_xml, dump_file_name);
|
||||
|
||||
CHECK_INIT_RETURN(timer_init ());
|
||||
|
||||
return 0;
|
||||
@@ -817,8 +918,6 @@ void itti_wait_tasks_end(void)
|
||||
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Some threads are still running, force exit\n");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
itti_dump_exit();
|
||||
}
|
||||
|
||||
void itti_send_terminate_message(task_id_t task_id)
|
||||
|
||||
@@ -108,6 +108,18 @@ int itti_send_broadcast_message(MessageDef *message_p);
|
||||
**/
|
||||
int itti_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message);
|
||||
|
||||
/* TODO: this is a hack. Almost no caller of itti_send_msg_to_task checks
|
||||
* the return value so it has been changed to crash the program in case
|
||||
* of failure instead of returning -1 as the documentation above says.
|
||||
* The RLC UM code may receive too much data when doing UDP at a higher
|
||||
* throughput than the link allows and so for this specific case we need
|
||||
* a version that actually returns -1 on failure.
|
||||
*
|
||||
* This needs to be cleaned at some point.
|
||||
*/
|
||||
/* look for HACK_RLC_UM_LIMIT for others places related to the hack. Please do not remove this comment. */
|
||||
int itti_try_send_msg_to_task(task_id_t task_id, instance_t instance, MessageDef *message);
|
||||
|
||||
/** \brief Add a new fd to monitor.
|
||||
* NOTE: it is up to the user to read data associated with the fd
|
||||
* \param task_id Task ID of the receiving task
|
||||
|
||||
@@ -1,790 +0,0 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/** @brief Intertask Interface Signal Dumper
|
||||
* Allows users to connect their itti_analyzer to this process and dump
|
||||
* signals exchanged between tasks.
|
||||
* @author Sebastien Roux <sebastien.roux@eurecom.fr>
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE // required for pthread_setname_np()
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <error.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/types.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
#include "assertions.h"
|
||||
#include "liblfds611.h"
|
||||
|
||||
#include "itti_types.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "intertask_interface_dump.h"
|
||||
|
||||
#if T_TRACER
|
||||
#include "T.h"
|
||||
#endif
|
||||
|
||||
static const int itti_dump_debug = 0; // 0x8 | 0x4 | 0x2;
|
||||
|
||||
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) fprintf(stdout, "[ITTI_DUMP][D]"x, ##args); } \
|
||||
while(0)
|
||||
#define ITTI_DUMP_ERROR(x, args...) do { fprintf(stdout, "[ITTI_DUMP][E]"x, ##args); } \
|
||||
while(0)
|
||||
|
||||
|
||||
typedef struct itti_dump_queue_item_s {
|
||||
MessageDef *data;
|
||||
uint32_t data_size;
|
||||
uint32_t message_number;
|
||||
uint32_t message_type;
|
||||
uint32_t message_size;
|
||||
} itti_dump_queue_item_t;
|
||||
|
||||
typedef struct {
|
||||
int sd;
|
||||
uint32_t last_message_number;
|
||||
} itti_client_desc_t;
|
||||
|
||||
typedef struct itti_desc_s {
|
||||
/* Asynchronous thread that write to file/accept new clients */
|
||||
pthread_t itti_acceptor_thread;
|
||||
pthread_attr_t attr;
|
||||
|
||||
/* List of messages to dump.
|
||||
* NOTE: we limit the size of this queue to retain only the last exchanged
|
||||
* messages. The size can be increased by setting up the ITTI_QUEUE_MAX_ELEMENTS
|
||||
* in mme_default_values.h or by putting a custom in the configuration file.
|
||||
*/
|
||||
struct lfds611_ringbuffer_state *itti_message_queue;
|
||||
|
||||
int nb_connected;
|
||||
|
||||
/* Event fd used to notify new messages (semaphore) */
|
||||
int event_fd;
|
||||
int itti_listen_socket;
|
||||
|
||||
itti_client_desc_t itti_clients[ITTI_DUMP_MAX_CON];
|
||||
} itti_desc_t;
|
||||
|
||||
typedef struct {
|
||||
itti_socket_header_t socket_header;
|
||||
|
||||
itti_signal_header_t signal_header;
|
||||
|
||||
/* Message payload is added here, this struct is used as an header */
|
||||
} itti_dump_message_t;
|
||||
|
||||
typedef struct {
|
||||
itti_socket_header_t socket_header;
|
||||
} itti_statistic_message_t;
|
||||
|
||||
static const itti_message_types_t itti_dump_xml_definition_end = ITTI_DUMP_XML_DEFINITION_END;
|
||||
static const itti_message_types_t itti_dump_message_type_end = ITTI_DUMP_MESSAGE_TYPE_END;
|
||||
|
||||
static itti_desc_t itti_dump_queue;
|
||||
static FILE *dump_file = NULL;
|
||||
static int itti_dump_running = 1;
|
||||
|
||||
static volatile uint32_t pending_messages = 0;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static int itti_dump_send_message(int sd, itti_dump_queue_item_t *message)
|
||||
{
|
||||
itti_dump_message_t *new_message;
|
||||
ssize_t bytes_sent = 0, total_sent = 0;
|
||||
uint8_t *data_ptr;
|
||||
|
||||
/* Allocate memory for message header and payload */
|
||||
size_t size = sizeof(itti_dump_message_t) + message->data_size + sizeof(itti_message_types_t);
|
||||
|
||||
AssertFatal (sd > 0, "Socket descriptor (%d) is invalid!\n", sd);
|
||||
AssertFatal (message != NULL, "Message is NULL!\n");
|
||||
|
||||
new_message = malloc(size);
|
||||
AssertFatal (new_message != NULL, "New message allocation failed!\n");
|
||||
|
||||
/* Preparing the header */
|
||||
new_message->socket_header.message_size = size;
|
||||
new_message->socket_header.message_type = ITTI_DUMP_MESSAGE_TYPE;
|
||||
/* Adds message number in unsigned decimal ASCII format */
|
||||
snprintf(new_message->signal_header.message_number_char, sizeof(new_message->signal_header.message_number_char),
|
||||
MESSAGE_NUMBER_CHAR_FORMAT, message->message_number);
|
||||
new_message->signal_header.message_number_char[sizeof(new_message->signal_header.message_number_char) - 1] = '\n';
|
||||
/* Appends message payload */
|
||||
memcpy(&new_message[1], message->data, message->data_size);
|
||||
|
||||
memcpy(((void *) &new_message[1]) + message->data_size, &itti_dump_message_type_end, sizeof(itti_message_types_t));
|
||||
|
||||
data_ptr = (uint8_t *)&new_message[0];
|
||||
|
||||
do {
|
||||
bytes_sent = send(sd, &data_ptr[total_sent], size - total_sent, 0);
|
||||
|
||||
if (bytes_sent < 0) {
|
||||
ITTI_DUMP_ERROR("[%d] Failed to send %zu bytes to socket (%d:%s)\n",
|
||||
sd, size, errno, strerror(errno));
|
||||
free(new_message);
|
||||
return -1;
|
||||
}
|
||||
|
||||
total_sent += bytes_sent;
|
||||
} while (total_sent != size);
|
||||
|
||||
free(new_message);
|
||||
return total_sent;
|
||||
}
|
||||
|
||||
static int itti_dump_fwrite_message(itti_dump_queue_item_t *message)
|
||||
{
|
||||
itti_dump_message_t new_message_header;
|
||||
|
||||
if ((dump_file != NULL) && (message != NULL)) {
|
||||
|
||||
new_message_header.socket_header.message_size = message->message_size + sizeof(itti_dump_message_t) + sizeof(itti_message_types_t);
|
||||
new_message_header.socket_header.message_type = message->message_type;
|
||||
snprintf(new_message_header.signal_header.message_number_char, sizeof(new_message_header.signal_header.message_number_char),
|
||||
MESSAGE_NUMBER_CHAR_FORMAT, message->message_number);
|
||||
new_message_header.signal_header.message_number_char[sizeof(new_message_header.signal_header.message_number_char) - 1] = '\n';
|
||||
|
||||
fwrite (&new_message_header, sizeof(itti_dump_message_t), 1, dump_file);
|
||||
fwrite (message->data, message->data_size, 1, dump_file);
|
||||
fwrite (&itti_dump_message_type_end, sizeof(itti_message_types_t), 1, dump_file);
|
||||
fflush (dump_file);
|
||||
return (1);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int itti_dump_send_xml_definition(const int sd, const char *message_definition_xml,
|
||||
const uint32_t message_definition_xml_length)
|
||||
{
|
||||
itti_socket_header_t *itti_dump_message;
|
||||
/* Allocate memory for message header and payload */
|
||||
size_t itti_dump_message_size;
|
||||
ssize_t bytes_sent = 0, total_sent = 0;
|
||||
uint8_t *data_ptr;
|
||||
|
||||
AssertFatal (sd > 0, "Socket descriptor (%d) is invalid!\n", sd);
|
||||
AssertFatal (message_definition_xml != NULL, "Message definition XML is NULL!\n");
|
||||
|
||||
itti_dump_message_size = sizeof(itti_socket_header_t) + message_definition_xml_length + sizeof(itti_message_types_t);
|
||||
|
||||
itti_dump_message = calloc(1, itti_dump_message_size);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, "[%d] Sending XML definition message of size %zu to observer peer\n",
|
||||
sd, itti_dump_message_size);
|
||||
|
||||
itti_dump_message->message_size = itti_dump_message_size;
|
||||
itti_dump_message->message_type = ITTI_DUMP_XML_DEFINITION;
|
||||
|
||||
/* Copying message definition */
|
||||
memcpy (&itti_dump_message[1], message_definition_xml, message_definition_xml_length);
|
||||
memcpy (((void *) &itti_dump_message[1]) + message_definition_xml_length, &itti_dump_xml_definition_end, sizeof(itti_message_types_t));
|
||||
|
||||
data_ptr = (uint8_t *)&itti_dump_message[0];
|
||||
|
||||
do {
|
||||
bytes_sent = send(sd, &data_ptr[total_sent], itti_dump_message_size - total_sent, 0);
|
||||
|
||||
if (bytes_sent < 0) {
|
||||
ITTI_DUMP_ERROR("[%d] Failed to send %zu bytes to socket (%d:%s)\n",
|
||||
sd, itti_dump_message_size, errno, strerror(errno));
|
||||
free(itti_dump_message);
|
||||
return -1;
|
||||
}
|
||||
|
||||
total_sent += bytes_sent;
|
||||
} while (total_sent != itti_dump_message_size);
|
||||
|
||||
free(itti_dump_message);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void itti_dump_user_data_delete_function(void *user_data, void *user_state)
|
||||
{
|
||||
(void)user_state; // UNUSED
|
||||
|
||||
if (user_data != NULL) {
|
||||
itti_dump_queue_item_t *item;
|
||||
task_id_t task_id;
|
||||
int result;
|
||||
|
||||
item = (itti_dump_queue_item_t *)user_data;
|
||||
|
||||
if (item->data != NULL) {
|
||||
task_id = ITTI_MSG_ORIGIN_ID(item->data);
|
||||
result = itti_free(task_id, item->data);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
} else {
|
||||
task_id = TASK_UNKNOWN;
|
||||
}
|
||||
|
||||
result = itti_free(task_id, item);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
}
|
||||
|
||||
static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t message_size,
|
||||
uint32_t message_type)
|
||||
{
|
||||
struct lfds611_freelist_element *new_queue_element = NULL;
|
||||
int overwrite_flag;
|
||||
AssertFatal (new != NULL, "Message to queue is NULL!\n");
|
||||
|
||||
new->message_type = message_type;
|
||||
new->message_size = message_size;
|
||||
|
||||
ITTI_DUMP_DEBUG (0x1, " itti_dump_enqueue_message: lfds611_ringbuffer_get_write_element\n");
|
||||
new_queue_element = lfds611_ringbuffer_get_write_element (itti_dump_queue.itti_message_queue, &new_queue_element, &overwrite_flag);
|
||||
|
||||
if (overwrite_flag != 0) {
|
||||
// no free element available: overwrite a non read one => data loss!
|
||||
void *old = NULL;
|
||||
|
||||
lfds611_freelist_get_user_data_from_element(new_queue_element, &old);
|
||||
ITTI_DUMP_DEBUG (0x4, " overwrite_flag set, freeing old data %p %p\n", new_queue_element, old);
|
||||
itti_dump_user_data_delete_function (old, NULL);
|
||||
}
|
||||
|
||||
lfds611_freelist_set_user_data_in_element(new_queue_element, new);
|
||||
lfds611_ringbuffer_put_write_element(itti_dump_queue.itti_message_queue, new_queue_element);
|
||||
|
||||
if (overwrite_flag == 0) {
|
||||
{
|
||||
ssize_t write_ret;
|
||||
eventfd_t sem_counter = 1;
|
||||
|
||||
/* Call to write for an event fd must be of 8 bytes */
|
||||
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
|
||||
AssertFatal (write_ret == sizeof(sem_counter), "Write to dump event failed (%d/%d)!\n", (int) write_ret, (int) sizeof(sem_counter));
|
||||
}
|
||||
// add one to pending_messages, atomically
|
||||
__sync_fetch_and_add (&pending_messages, 1);
|
||||
}
|
||||
|
||||
ITTI_DUMP_DEBUG (0x2, " Added element to queue %p %p, pending %u, type %u\n", new_queue_element, new, pending_messages, message_type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void itti_dump_socket_exit(void)
|
||||
{
|
||||
close(itti_dump_queue.event_fd);
|
||||
close(itti_dump_queue.itti_listen_socket);
|
||||
|
||||
/* Leave the thread as we detected end signal */
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
static int itti_dump_flush_ring_buffer(int flush_all)
|
||||
{
|
||||
struct lfds611_freelist_element *element = NULL;
|
||||
void *user_data;
|
||||
int j;
|
||||
int consumer;
|
||||
|
||||
/* Check if there is a least one consumer */
|
||||
consumer = 0;
|
||||
|
||||
if (dump_file != NULL) {
|
||||
consumer = 1;
|
||||
} else {
|
||||
for (j = 0; j < ITTI_DUMP_MAX_CON; j++) {
|
||||
if (itti_dump_queue.itti_clients[j].sd > 0) {
|
||||
consumer = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (consumer > 0) {
|
||||
do {
|
||||
/* Acquire the ring element */
|
||||
lfds611_ringbuffer_get_read_element(itti_dump_queue.itti_message_queue, &element);
|
||||
|
||||
// subtract one from pending_messages, atomically
|
||||
__sync_fetch_and_sub (&pending_messages, 1);
|
||||
|
||||
if (element == NULL) {
|
||||
if (flush_all != 0) {
|
||||
flush_all = 0;
|
||||
} else {
|
||||
AssertFatal (0, "Dump event with no data!\n");
|
||||
}
|
||||
} else {
|
||||
/* Retrieve user part of the message */
|
||||
lfds611_freelist_get_user_data_from_element(element, &user_data);
|
||||
|
||||
ITTI_DUMP_DEBUG (0x2, " removed element from queue %p %p, pending %u\n", element, user_data, pending_messages);
|
||||
|
||||
if (((itti_dump_queue_item_t *)user_data)->message_type == ITTI_DUMP_EXIT_SIGNAL) {
|
||||
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
|
||||
itti_dump_socket_exit();
|
||||
}
|
||||
|
||||
/* Write message to file */
|
||||
itti_dump_fwrite_message((itti_dump_queue_item_t *)user_data);
|
||||
|
||||
/* Send message to remote analyzer */
|
||||
for (j = 0; j < ITTI_DUMP_MAX_CON; j++) {
|
||||
if (itti_dump_queue.itti_clients[j].sd > 0) {
|
||||
itti_dump_send_message(itti_dump_queue.itti_clients[j].sd,
|
||||
(itti_dump_queue_item_t *)user_data);
|
||||
}
|
||||
}
|
||||
|
||||
itti_dump_user_data_delete_function (user_data, NULL);
|
||||
lfds611_freelist_set_user_data_in_element(element, NULL);
|
||||
|
||||
/* We have finished with this element, reinsert it in the ring buffer */
|
||||
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
|
||||
}
|
||||
} while(flush_all
|
||||
);
|
||||
}
|
||||
|
||||
return (consumer);
|
||||
}
|
||||
|
||||
static int itti_dump_handle_new_connection(int sd, const char *xml_definition, uint32_t xml_definition_length)
|
||||
{
|
||||
if (itti_dump_queue.nb_connected < ITTI_DUMP_MAX_CON) {
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < ITTI_DUMP_MAX_CON; i++) {
|
||||
/* Let's find a place to store the new client */
|
||||
if (itti_dump_queue.itti_clients[i].sd == -1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Found place to store new connection: %d\n", i);
|
||||
|
||||
AssertFatal (i < ITTI_DUMP_MAX_CON, "No more connection available (%d/%d) for socked %d!\n", i, ITTI_DUMP_MAX_CON, sd);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Socket %d accepted\n", sd);
|
||||
|
||||
/* Send the XML message definition */
|
||||
if (itti_dump_send_xml_definition(sd, xml_definition, xml_definition_length) < 0) {
|
||||
AssertError (0, {}, "Failed to send XML definition!\n");
|
||||
close (sd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
itti_dump_queue.itti_clients[i].sd = sd;
|
||||
itti_dump_queue.nb_connected++;
|
||||
} else {
|
||||
ITTI_DUMP_DEBUG(0x2, " Socket %d rejected\n", sd);
|
||||
/* We have reached max number of users connected...
|
||||
* Reject the connection.
|
||||
*/
|
||||
close (sd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void *itti_dump_socket(void *arg_p)
|
||||
{
|
||||
uint32_t message_definition_xml_length;
|
||||
char *message_definition_xml;
|
||||
int rc;
|
||||
int itti_listen_socket, max_sd;
|
||||
int on = 1;
|
||||
fd_set read_set, working_set;
|
||||
struct sockaddr_in servaddr; /* socket address structure */
|
||||
|
||||
struct timeval *timeout_p = NULL;
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Creating TCP dump socket on port %u\n", ITTI_PORT);
|
||||
|
||||
message_definition_xml = (char *)arg_p;
|
||||
AssertFatal (message_definition_xml != NULL, "Message definition XML is NULL!\n");
|
||||
|
||||
message_definition_xml_length = strlen(message_definition_xml) + 1;
|
||||
|
||||
if ((itti_listen_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
|
||||
ITTI_DUMP_ERROR(" ocket creation failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
/* Allow socket reuse */
|
||||
rc = setsockopt(itti_listen_socket, SOL_SOCKET, SO_REUSEADDR,
|
||||
(char *)&on, sizeof(on));
|
||||
|
||||
if (rc < 0) {
|
||||
ITTI_DUMP_ERROR(" setsockopt SO_REUSEADDR failed (%d:%s)\n", errno, strerror(errno));
|
||||
close(itti_listen_socket);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
/* Set socket to be non-blocking.
|
||||
* NOTE: sockets accepted will inherit this option.
|
||||
*/
|
||||
rc = ioctl(itti_listen_socket, FIONBIO, (char *)&on);
|
||||
|
||||
if (rc < 0) {
|
||||
ITTI_DUMP_ERROR(" ioctl FIONBIO (non-blocking) failed (%d:%s)\n", errno, strerror(errno));
|
||||
close(itti_listen_socket);
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
memset(&servaddr, 0, sizeof(servaddr));
|
||||
servaddr.sin_family = AF_INET;
|
||||
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
servaddr.sin_port = htons(ITTI_PORT);
|
||||
|
||||
if (bind(itti_listen_socket, (struct sockaddr *) &servaddr,
|
||||
sizeof(servaddr)) < 0) {
|
||||
ITTI_DUMP_ERROR(" Bind failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
if (listen(itti_listen_socket, 5) < 0) {
|
||||
ITTI_DUMP_ERROR(" Listen failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
FD_ZERO(&read_set);
|
||||
|
||||
/* Add the listener */
|
||||
FD_SET(itti_listen_socket, &read_set);
|
||||
|
||||
/* Add the event fd */
|
||||
FD_SET(itti_dump_queue.event_fd, &read_set);
|
||||
|
||||
/* Max of both sd */
|
||||
max_sd = itti_listen_socket > itti_dump_queue.event_fd ? itti_listen_socket : itti_dump_queue.event_fd;
|
||||
|
||||
itti_dump_queue.itti_listen_socket = itti_listen_socket;
|
||||
|
||||
/* Loop waiting for incoming connects or for incoming data
|
||||
* on any of the connected sockets.
|
||||
*/
|
||||
while (1) {
|
||||
int desc_ready;
|
||||
int client_socket = -1;
|
||||
int i;
|
||||
|
||||
memcpy(&working_set, &read_set, sizeof(read_set));
|
||||
timeout_p = NULL;
|
||||
|
||||
/* No timeout: select blocks till a new event has to be handled
|
||||
* on sd's.
|
||||
*/
|
||||
rc = select(max_sd + 1, &working_set, NULL, NULL, timeout_p);
|
||||
|
||||
if (rc < 0) {
|
||||
ITTI_DUMP_ERROR(" select failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
} else if (rc == 0) {
|
||||
/* Timeout */
|
||||
if (itti_dump_flush_ring_buffer(1) == 0) {
|
||||
if (itti_dump_running) {
|
||||
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
|
||||
usleep(100 * 1000);
|
||||
} else {
|
||||
itti_dump_socket_exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
desc_ready = rc;
|
||||
|
||||
for (i = 0; i <= max_sd && desc_ready > 0; i++) {
|
||||
if (FD_ISSET(i, &working_set)) {
|
||||
desc_ready -= 1;
|
||||
|
||||
if (i == itti_dump_queue.event_fd) {
|
||||
/* Notification of new element to dump from other tasks */
|
||||
eventfd_t sem_counter;
|
||||
ssize_t read_ret;
|
||||
|
||||
/* Read will always return 1 for kernel versions > 2.6.30 */
|
||||
read_ret = read (itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
|
||||
|
||||
if (read_ret < 0) {
|
||||
ITTI_DUMP_ERROR(" Failed read for semaphore: %s\n", strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
AssertFatal (read_ret == sizeof(sem_counter), "Failed to read from dump event FD (%d/%d)!\n", (int) read_ret, (int) sizeof(sem_counter));
|
||||
|
||||
if (itti_dump_flush_ring_buffer(0) == 0) {
|
||||
if (itti_dump_running) {
|
||||
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
|
||||
usleep(100 * 1000);
|
||||
{
|
||||
ssize_t write_ret;
|
||||
|
||||
sem_counter = 1;
|
||||
/* Call to write for an event fd must be of 8 bytes */
|
||||
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
|
||||
AssertFatal (write_ret == sizeof(sem_counter), "Failed to write to dump event FD (%d/%d)!\n", (int) write_ret, (int) sem_counter);
|
||||
}
|
||||
} else {
|
||||
itti_dump_socket_exit();
|
||||
}
|
||||
} else {
|
||||
ITTI_DUMP_DEBUG(0x1, " Write element to file\n");
|
||||
}
|
||||
} else
|
||||
if (i == itti_listen_socket) {
|
||||
do {
|
||||
client_socket = accept(itti_listen_socket, NULL, NULL);
|
||||
|
||||
if (client_socket < 0) {
|
||||
if (errno == EWOULDBLOCK || errno == EAGAIN) {
|
||||
/* No more new connection */
|
||||
ITTI_DUMP_DEBUG(0x2, " No more new connection\n");
|
||||
continue;
|
||||
} else {
|
||||
ITTI_DUMP_ERROR(" accept failed (%d:%s)\n", errno, strerror(errno));
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (itti_dump_handle_new_connection(client_socket, message_definition_xml,
|
||||
message_definition_xml_length) == 0) {
|
||||
/* The socket has been accepted.
|
||||
* We have to update the set to include this new sd.
|
||||
*/
|
||||
FD_SET(client_socket, &read_set);
|
||||
|
||||
if (client_socket > max_sd)
|
||||
max_sd = client_socket;
|
||||
}
|
||||
} while(client_socket != -1);
|
||||
} else {
|
||||
/* For now the MME itti dumper should not receive data
|
||||
* other than connection oriented (CLOSE).
|
||||
*/
|
||||
uint8_t j;
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Socket %d disconnected\n", i);
|
||||
|
||||
/* Close the socket and update info related to this connection */
|
||||
close(i);
|
||||
|
||||
for (j = 0; j < ITTI_DUMP_MAX_CON; j++) {
|
||||
if (itti_dump_queue.itti_clients[j].sd == i)
|
||||
break;
|
||||
}
|
||||
|
||||
/* In case we don't find the matching sd in list of known
|
||||
* connections -> assert.
|
||||
*/
|
||||
AssertFatal (j < ITTI_DUMP_MAX_CON, "Connection index not found (%d/%d) for socked %d!\n", j, ITTI_DUMP_MAX_CON, i);
|
||||
|
||||
/* Re-initialize the socket to -1 so we can accept new
|
||||
* incoming connections.
|
||||
*/
|
||||
itti_dump_queue.itti_clients[j].sd = -1;
|
||||
itti_dump_queue.itti_clients[j].last_message_number = 0;
|
||||
itti_dump_queue.nb_connected--;
|
||||
|
||||
/* Remove the socket from the FD set and update the max sd */
|
||||
FD_CLR(i, &read_set);
|
||||
|
||||
if (i == max_sd) {
|
||||
if (itti_dump_queue.nb_connected == 0) {
|
||||
/* No more new connection max_sd = itti_listen_socket */
|
||||
max_sd = itti_listen_socket;
|
||||
} else {
|
||||
while (FD_ISSET(max_sd, &read_set) == 0) {
|
||||
max_sd -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int itti_dump_queue_message(task_id_t sender_task,
|
||||
message_number_t message_number,
|
||||
MessageDef *message_p,
|
||||
const char *message_name,
|
||||
const uint32_t message_size)
|
||||
{
|
||||
if (itti_dump_running) {
|
||||
itti_dump_queue_item_t *new;
|
||||
|
||||
AssertFatal (message_name != NULL, "Message name is NULL!\n");
|
||||
AssertFatal (message_p != NULL, "Message is NULL!\n");
|
||||
|
||||
new = itti_malloc(sender_task, TASK_MAX, sizeof(itti_dump_queue_item_t));
|
||||
|
||||
new->data = itti_malloc(sender_task, TASK_MAX, message_size);
|
||||
|
||||
memcpy(new->data, message_p, message_size);
|
||||
new->data_size = message_size;
|
||||
new->message_number = message_number;
|
||||
|
||||
itti_dump_enqueue_message(new, message_size, ITTI_DUMP_MESSAGE_TYPE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This function should be called by each thread that will use the ring buffer */
|
||||
void itti_dump_thread_use_ring_buffer(void)
|
||||
{
|
||||
lfds611_ringbuffer_use(itti_dump_queue.itti_message_queue);
|
||||
}
|
||||
|
||||
int itti_dump_init(const char * const messages_definition_xml, const char * const dump_file_name)
|
||||
{
|
||||
int i, ret;
|
||||
struct sched_param scheduler_param;
|
||||
|
||||
scheduler_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
|
||||
|
||||
if (dump_file_name != NULL) {
|
||||
dump_file = fopen(dump_file_name, "wb");
|
||||
|
||||
if (dump_file == NULL) {
|
||||
ITTI_DUMP_ERROR(" can not open dump file \"%s\" (%d:%s)\n", dump_file_name, errno, strerror(errno));
|
||||
} else {
|
||||
/* Output the XML to file */
|
||||
uint32_t message_size = strlen(messages_definition_xml) + 1;
|
||||
itti_socket_header_t header;
|
||||
|
||||
header.message_size = sizeof(itti_socket_header_t) + message_size + sizeof(itti_message_types_t);
|
||||
header.message_type = ITTI_DUMP_XML_DEFINITION;
|
||||
|
||||
fwrite (&header, sizeof(itti_socket_header_t), 1, dump_file);
|
||||
fwrite (messages_definition_xml, message_size, 1, dump_file);
|
||||
fwrite (&itti_dump_xml_definition_end, sizeof(itti_message_types_t), 1, dump_file);
|
||||
fflush (dump_file);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&itti_dump_queue, 0, sizeof(itti_desc_t));
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Creating new ring buffer for itti dump of %u elements\n",
|
||||
ITTI_QUEUE_MAX_ELEMENTS);
|
||||
|
||||
if (lfds611_ringbuffer_new(&itti_dump_queue.itti_message_queue,
|
||||
ITTI_QUEUE_MAX_ELEMENTS,
|
||||
NULL,
|
||||
NULL) != 1) {
|
||||
/* Always assert on this condition */
|
||||
AssertFatal (0, " Failed to create ring buffer!\n");
|
||||
}
|
||||
|
||||
itti_dump_queue.event_fd = eventfd(0, EFD_SEMAPHORE);
|
||||
|
||||
if (itti_dump_queue.event_fd == -1) {
|
||||
/* Always assert on this condition */
|
||||
AssertFatal (0, "eventfd failed: %s!\n", strerror(errno));
|
||||
}
|
||||
|
||||
itti_dump_queue.nb_connected = 0;
|
||||
|
||||
for(i = 0; i < ITTI_DUMP_MAX_CON; i++) {
|
||||
itti_dump_queue.itti_clients[i].sd = -1;
|
||||
itti_dump_queue.itti_clients[i].last_message_number = 0;
|
||||
}
|
||||
|
||||
/* initialized with default attributes */
|
||||
ret = pthread_attr_init(&itti_dump_queue.attr);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_attr_init failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
ret = pthread_attr_setschedpolicy(&itti_dump_queue.attr, SCHED_FIFO);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_attr_setschedpolicy (SCHED_IDLE) failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
ret = pthread_attr_setschedparam(&itti_dump_queue.attr, &scheduler_param);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_attr_setschedparam failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
ret = pthread_create(&itti_dump_queue.itti_acceptor_thread, &itti_dump_queue.attr,
|
||||
&itti_dump_socket, (void *)messages_definition_xml);
|
||||
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_create failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
|
||||
pthread_setname_np( itti_dump_queue.itti_acceptor_thread, "ITTI acceptor" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void itti_dump_exit(void)
|
||||
{
|
||||
void *arg;
|
||||
itti_dump_queue_item_t *new;
|
||||
|
||||
new = itti_malloc(TASK_UNKNOWN, TASK_UNKNOWN, sizeof(itti_dump_queue_item_t));
|
||||
memset(new, 0, sizeof(itti_dump_queue_item_t));
|
||||
|
||||
/* Set a flag to stop recording message */
|
||||
itti_dump_running = 0;
|
||||
|
||||
/* Send the exit signal to other thread */
|
||||
itti_dump_enqueue_message(new, 0, ITTI_DUMP_EXIT_SIGNAL);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " waiting for dumper thread to finish\n");
|
||||
|
||||
/* wait for the thread to terminate */
|
||||
pthread_join(itti_dump_queue.itti_acceptor_thread, &arg);
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " dumper thread correctly exited\n");
|
||||
|
||||
if (dump_file != NULL) {
|
||||
/* Synchronise file and then close it */
|
||||
fclose(dump_file);
|
||||
dump_file = NULL;
|
||||
}
|
||||
|
||||
if (itti_dump_queue.itti_message_queue) {
|
||||
lfds611_ringbuffer_delete(itti_dump_queue.itti_message_queue,
|
||||
itti_dump_user_data_delete_function, NULL);
|
||||
}
|
||||
}
|
||||
@@ -41,10 +41,6 @@
|
||||
|
||||
#ifndef CHECK_PROTOTYPE_ONLY
|
||||
|
||||
const char * const messages_definition_xml = {
|
||||
#include "messages_xml.h"
|
||||
};
|
||||
|
||||
/* Map task id to printable name. */
|
||||
const task_info_t tasks_info[] = {
|
||||
{0, TASK_UNKNOWN, 0, 0, "TASK_UNKNOWN"},
|
||||
@@ -71,8 +67,7 @@ const message_info_t messages_info[] = {
|
||||
* \param messages_info Pointer on messages information as created by this include file
|
||||
**/
|
||||
int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_id_max, const task_info_t *tasks_info,
|
||||
const message_info_t *messages_info, const char * const messages_definition_xml,
|
||||
const char * const dump_file_name);
|
||||
const message_info_t *messages_info);
|
||||
|
||||
#endif /* INTERTASK_INTERFACE_INIT_H_ */
|
||||
/* @} */
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
#include "log.h"
|
||||
|
||||
#if defined (LOG_D) && defined (LOG_E)
|
||||
# define SIG_DEBUG(x, args...) LOG_D(EMU, x, ##args)
|
||||
# define SIG_ERROR(x, args...) LOG_E(EMU, x, ##args)
|
||||
# define SIG_DEBUG(x, args...) LOG_D(RRC, x, ##args)
|
||||
# define SIG_ERROR(x, args...) LOG_E(RRC, x, ##args)
|
||||
#endif
|
||||
|
||||
#ifndef SIG_DEBUG
|
||||
|
||||
@@ -740,25 +740,6 @@ int xml_parse_buffer(char *xml_buffer, const int size) {
|
||||
return xml_parse_doc(doc);
|
||||
}
|
||||
|
||||
#if 0 /* Not used anymore */
|
||||
int xml_parse_file(const char *filename) {
|
||||
xmlDocPtr doc; /* the resulting document tree */
|
||||
|
||||
if (filename == NULL) {
|
||||
return RC_NULL_POINTER;
|
||||
}
|
||||
|
||||
doc = xmlReadFile (filename, NULL, 0);
|
||||
|
||||
if (doc == NULL) {
|
||||
ui_notification_dialog(GTK_MESSAGE_ERROR, FALSE, "parse messages format definition", "Failed to parse file \"%s\"", filename);
|
||||
return RC_FAIL;
|
||||
}
|
||||
|
||||
return xml_parse_doc(doc);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int update_filters() {
|
||||
types_t *types;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -34,9 +34,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <dlfcn.h>
|
||||
#include "openair1/PHY/defs.h"
|
||||
#include "openair1/PHY/defs_common.h"
|
||||
#define LOAD_MODULE_SHLIB_MAIN
|
||||
|
||||
#include "common/config/config_userapi.h"
|
||||
@@ -44,68 +45,162 @@
|
||||
void loader_init(void) {
|
||||
paramdef_t LoaderParams[] = LOADER_PARAMS_DESC;
|
||||
|
||||
|
||||
loader_data.mainexec_buildversion = PACKAGE_VERSION;
|
||||
int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),LOADER_CONFIG_PREFIX);
|
||||
if (ret <0) {
|
||||
fprintf(stderr,"[LOADER] configuration couldn't be performed");
|
||||
printf("[LOADER] configuration couldn't be performed via config module, parameters set to default values\n");
|
||||
if (loader_data.shlibpath == NULL) {
|
||||
loader_data.shlibpath=DEFAULT_PATH;
|
||||
}
|
||||
return;
|
||||
}
|
||||
loader_data.maxshlibs = DEFAULT_MAXSHLIBS;
|
||||
}
|
||||
loader_data.shlibs = malloc(loader_data.maxshlibs * sizeof(loader_shlibdesc_t));
|
||||
if(loader_data.shlibs == NULL) {
|
||||
fprintf(stderr,"[LOADER] %s %d memory allocation error %s\n",__FILE__, __LINE__,strerror(errno));
|
||||
exit_fun("[LOADER] unrecoverable error");
|
||||
}
|
||||
memset(loader_data.shlibs,0,loader_data.maxshlibs * sizeof(loader_shlibdesc_t));
|
||||
}
|
||||
|
||||
/* build the full shared lib name from the module name */
|
||||
char *loader_format_shlibpath(char *modname)
|
||||
{
|
||||
|
||||
char *tmpstr;
|
||||
char *shlibpath =NULL;
|
||||
char *shlibversion=NULL;
|
||||
char *cfgprefix;
|
||||
paramdef_t LoaderParams[] ={{"shlibpath", NULL, 0, strptr:&shlibpath, defstrval:NULL, TYPE_STRING, 0},
|
||||
{"shlibversion", NULL, 0, strptr:&shlibversion, defstrval:"", TYPE_STRING, 0}};
|
||||
|
||||
int ret;
|
||||
|
||||
|
||||
|
||||
|
||||
/* looks for specific path for this module in the config file */
|
||||
/* specific value for a module path and version is located in a modname subsection of the loader section */
|
||||
/* shared lib name is formatted as lib<module name><module version>.so */
|
||||
cfgprefix = malloc(sizeof(LOADER_CONFIG_PREFIX)+strlen(modname)+16);
|
||||
if (cfgprefix == NULL) {
|
||||
fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
|
||||
exit_fun("[LOADER] unrecoverable error");
|
||||
} else {
|
||||
sprintf(cfgprefix,LOADER_CONFIG_PREFIX ".%s",modname);
|
||||
int ret = config_get( LoaderParams,sizeof(LoaderParams)/sizeof(paramdef_t),cfgprefix);
|
||||
if (ret <0) {
|
||||
fprintf(stderr,"[LOADER] %s %d couldn't retrieve config from section %s\n",__FILE__, __LINE__,cfgprefix);
|
||||
}
|
||||
}
|
||||
/* no specific path, use loader default shared lib path */
|
||||
if (shlibpath == NULL) {
|
||||
shlibpath = loader_data.shlibpath ;
|
||||
}
|
||||
/* no specific shared lib version */
|
||||
if (shlibversion == NULL) {
|
||||
shlibversion = "" ;
|
||||
}
|
||||
/* alloc memory for full module shared lib file name */
|
||||
tmpstr = malloc(strlen(shlibpath)+strlen(modname)+strlen(shlibversion)+16);
|
||||
if (tmpstr == NULL) {
|
||||
fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
|
||||
exit_fun("[LOADER] unrecoverable error");
|
||||
}
|
||||
if(shlibpath[0] != 0) {
|
||||
ret=sprintf(tmpstr,"%s/",shlibpath);
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
sprintf(tmpstr+ret,"lib%s%s.so",modname,shlibversion);
|
||||
|
||||
|
||||
return tmpstr;
|
||||
}
|
||||
|
||||
int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
|
||||
{
|
||||
void *lib_handle;
|
||||
initfunc_t fpi;
|
||||
char *tmpstr;
|
||||
checkverfunc_t fpc;
|
||||
getfarrayfunc_t fpg;
|
||||
char *shlib_path;
|
||||
char *afname=NULL;
|
||||
int ret=0;
|
||||
|
||||
if (loader_data.shlibpath == NULL) {
|
||||
loader_init();
|
||||
}
|
||||
tmpstr = malloc(strlen(loader_data.shlibpath)+strlen(modname)+16);
|
||||
if (tmpstr == NULL) {
|
||||
fprintf(stderr,"[LOADER] %s %d malloc error loading module %s, %s\n",__FILE__, __LINE__, modname, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(loader_data.shlibpath[0] != 0) {
|
||||
ret=sprintf(tmpstr,"%s/",loader_data.shlibpath);
|
||||
}
|
||||
if(strstr(modname,".so") == NULL) {
|
||||
sprintf(tmpstr+ret,"lib%s.so",modname);
|
||||
} else {
|
||||
sprintf(tmpstr+ret,"%s",modname);
|
||||
}
|
||||
shlib_path = loader_format_shlibpath(modname);
|
||||
|
||||
ret = 0;
|
||||
lib_handle = dlopen(tmpstr, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL);
|
||||
lib_handle = dlopen(shlib_path, RTLD_LAZY|RTLD_NODELETE|RTLD_GLOBAL);
|
||||
if (!lib_handle) {
|
||||
fprintf(stderr,"[LOADER] library %s is not loaded: %s\n", tmpstr,dlerror());
|
||||
fprintf(stderr,"[LOADER] library %s is not loaded: %s\n", shlib_path,dlerror());
|
||||
ret = -1;
|
||||
} else {
|
||||
printf("[LOADER] library %s uccessfully loaded loaded\n", tmpstr);
|
||||
sprintf(tmpstr,"%s_autoinit",modname);
|
||||
fpi = dlsym(lib_handle,tmpstr);
|
||||
printf("[LOADER] library %s successfully loaded\n", shlib_path);
|
||||
afname=malloc(strlen(modname)+15);
|
||||
sprintf(afname,"%s_checkbuildver",modname);
|
||||
fpc = dlsym(lib_handle,afname);
|
||||
if (fpc != NULL ){
|
||||
int chkver_ret = fpc(loader_data.mainexec_buildversion, &(loader_data.shlibs[loader_data.numshlibs].shlib_buildversion));
|
||||
if (chkver_ret < 0) {
|
||||
fprintf(stderr,"[LOADER] %s %d lib %s, version mismatch",__FILE__, __LINE__, modname);
|
||||
exit_fun("[LOADER] unrecoverable error");
|
||||
}
|
||||
}
|
||||
sprintf(afname,"%s_autoinit",modname);
|
||||
fpi = dlsym(lib_handle,afname);
|
||||
|
||||
if (fpi != NULL )
|
||||
{
|
||||
if (fpi != NULL ) {
|
||||
fpi();
|
||||
}
|
||||
}
|
||||
|
||||
if (farray != NULL) {
|
||||
loader_data.shlibs[loader_data.numshlibs].funcarray=malloc(numf*sizeof(loader_shlibfunc_t));
|
||||
loader_data.shlibs[loader_data.numshlibs].numfunc=0;
|
||||
for (int i=0; i<numf; i++) {
|
||||
farray[i].fptr = dlsym(lib_handle,farray[i].fname);
|
||||
if (farray[i].fptr == NULL ) {
|
||||
fprintf(stderr,"[LOADER] %s %d %s function not found %s\n",__FILE__, __LINE__, dlerror(),farray[i].fname);
|
||||
ret= -1;
|
||||
}
|
||||
ret= -1;
|
||||
} else { /* farray[i].fptr == NULL */
|
||||
loader_data.shlibs[loader_data.numshlibs].funcarray[i].fname=strdup(farray[i].fname);
|
||||
loader_data.shlibs[loader_data.numshlibs].funcarray[i].fptr = farray[i].fptr;
|
||||
loader_data.shlibs[loader_data.numshlibs].numfunc++;
|
||||
}/* farray[i].fptr != NULL */
|
||||
} /* for int i... */
|
||||
} /* farray ! NULL */
|
||||
}
|
||||
} else { /* farray ! NULL */
|
||||
sprintf(afname,"%s_getfarray",modname);
|
||||
fpg = dlsym(lib_handle,afname);
|
||||
if (fpg != NULL ) {
|
||||
loader_data.shlibs[loader_data.numshlibs].numfunc = fpg(&(loader_data.shlibs[loader_data.numshlibs].funcarray));
|
||||
}
|
||||
} /* farray ! NULL */
|
||||
loader_data.shlibs[loader_data.numshlibs].name=strdup(modname);
|
||||
loader_data.shlibs[loader_data.numshlibs].thisshlib_path=strdup(shlib_path);
|
||||
|
||||
(loader_data.numshlibs)++;
|
||||
} /* lib_handle != NULL */
|
||||
|
||||
if (tmpstr != NULL) free(tmpstr);
|
||||
if ( shlib_path!= NULL) free(shlib_path);
|
||||
if ( afname!= NULL) free(afname);
|
||||
if (lib_handle != NULL) dlclose(lib_handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void * get_shlibmodule_fptr(char *modname, char *fname)
|
||||
{
|
||||
for (int i=0; i<loader_data.numshlibs && loader_data.shlibs[i].name != NULL; i++) {
|
||||
if ( strcmp(loader_data.shlibs[i].name, modname) == 0) {
|
||||
for (int j =0; j<loader_data.shlibs[i].numfunc ; j++) {
|
||||
if (strcmp(loader_data.shlibs[i].funcarray[j].fname, fname) == 0) {
|
||||
return loader_data.shlibs[i].funcarray[j].fptr;
|
||||
}
|
||||
} /* for j loop on module functions*/
|
||||
}
|
||||
} /* for i loop on modules */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -33,33 +33,60 @@
|
||||
#define LOAD_SHLIB_H
|
||||
|
||||
|
||||
typedef int(*initfunc_t)(void);
|
||||
|
||||
typedef struct {
|
||||
char *shlibpath;
|
||||
}loader_data_t;
|
||||
|
||||
typedef struct {
|
||||
char *fname;
|
||||
int (*fptr)(void);
|
||||
}loader_shlibfunc_t;
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
char *shlib_version; //
|
||||
char *shlib_buildversion;
|
||||
char *thisshlib_path;
|
||||
uint32_t numfunc;
|
||||
loader_shlibfunc_t *funcarray;
|
||||
}loader_shlibdesc_t;
|
||||
|
||||
typedef struct {
|
||||
char *mainexec_buildversion;
|
||||
char *shlibpath;
|
||||
uint32_t maxshlibs;
|
||||
uint32_t numshlibs;
|
||||
loader_shlibdesc_t *shlibs;
|
||||
}loader_data_t;
|
||||
|
||||
/* function type of functions which may be implemented by a module */
|
||||
/* 1: init function, called when loading, if found in the shared lib */
|
||||
typedef int(*initfunc_t)(void);
|
||||
/* 2: version checking function, called when loading, if it returns -1, trigger main exec abort */
|
||||
typedef int(*checkverfunc_t)(char * mainexec_version, char ** shlib_version);
|
||||
/* 3: get function array function, called when loading when a module doesn't provide */
|
||||
/* the function array when calling load_module_shlib (farray param NULL) */
|
||||
typedef int(*getfarrayfunc_t)(loader_shlibfunc_t **funcarray);
|
||||
|
||||
#ifdef LOAD_MODULE_SHLIB_MAIN
|
||||
#define LOADER_CONFIG_PREFIX "loader"
|
||||
#define DEFAULT_PATH ""
|
||||
#define DEFAULT_PATH ""
|
||||
#define DEFAULT_MAXSHLIBS 10
|
||||
loader_data_t loader_data;
|
||||
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOADER parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*--------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* LOADER parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define LOADER_PARAMS_DESC { \
|
||||
{"shlibpath", NULL, 0, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0} \
|
||||
{"shlibpath", NULL, PARAMFLAG_NOFREE, strptr:(char **)&(loader_data.shlibpath), defstrval:DEFAULT_PATH, TYPE_STRING, 0}, \
|
||||
{"maxshlibs", NULL, 0, uptr:&(loader_data.maxshlibs), defintval:DEFAULT_MAXSHLIBS, TYPE_UINT32, 0}, \
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------------------*/
|
||||
#else
|
||||
#else /* LOAD_MODULE_SHLIB_MAIN */
|
||||
extern int load_module_shlib(char *modname, loader_shlibfunc_t *farray, int numf);
|
||||
#endif
|
||||
extern void * get_shlibmodule_fptr(char *modname, char *fname);
|
||||
extern loader_data_t loader_data;
|
||||
#endif /* LOAD_MODULE_SHLIB_MAIN */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
IF(DEFINED ENV{OPENAIR_DIR})
|
||||
message("...using oai source files in $ENV{OPENAIR_DIR}")
|
||||
ELSE()
|
||||
message("OPENAIR_DIR is not defined. You must run \"source oaienv\" from the oai root dir")
|
||||
# exit early
|
||||
return()
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
||||
set(OPENAIR_DIR $ENV{OPENAIR_DIR})
|
||||
set(APPROOT ${OPENAIR_DIR}/common/utils/telnetsrv )
|
||||
set(OPENAIR_BUILD_DIR $ENV{OPENAIR_DIR}/cmake_targets)
|
||||
set(OPENAIR1_DIR $ENV{OPENAIR1_DIR})
|
||||
set(OPENAIR2_DIR $ENV{OPENAIR2_DIR})
|
||||
set(OPENAIR3_DIR $ENV{OPENAIR3_DIR})
|
||||
set(OPENAIR_PHY_DIR $ENV{OPENAIR1_DIR}/PHY)
|
||||
set(OPENAIR_TARGET_DIR $ENV{OPENAIR_DIR}/targets)
|
||||
set(OPENAIR_COMMONUTILS_DIR $ENV{OPENAIR_DIR}/common/utils)
|
||||
set(OPENAIR2_COMMON_DIR $ENV{OPENAIR_DIR}/openair2/COMMON)
|
||||
set(OPENAIR_ASN1INC ${OPENAIR_BUILD_DIR}/lte_build_oai/build/CMakeFiles/Rel14)
|
||||
set(OPENAIR_NFAPIINC $ENV{NFAPI_DIR} )
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX $ENV{OPENAIR_TARGETS})
|
||||
|
||||
add_definitions (-DRel14 -DCMAKER -DENABLE_ITTI -DENABLE_NAS_UE_LOGGING -DENABLE_SECURITY -DENABLE_USE_CPU_EXECUTION_TIME -DENABLE_USE_MME -DENABLE_VCD -DENB_AGENT -DENB_MODE -DETHERNET=1 -DEXMIMO_IOT -DJUMBO_FRAME -DLINK_ENB_PDCP_TO_GTPV1U -DLOG_NO_THREAD -DMAC_CONTEXT -DMAX_NUM_CCs=1 -DNAS_BUILT_IN_UE -DNAS_UE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DNO_RRM -DNone=1 -DOAI_NW_DRIVER_USE_NETLINK -DOPENAIR2 -DOPENAIR_LTE -DPHYSIM -DPHY_CONTEXT -DRel10=1 -DS1AP_VERSION=R10 -DTRACE_RLC_MUTEX -DX2AP_VERSION=R11 -DXFORMS -mavx2 -msse4.1 -mssse3)
|
||||
add_compile_options( -fPIC -march=native -Ofast)
|
||||
|
||||
include_directories( ./ ${OPENAIR_COMMON_DIR} ${OPENAIR_DIR} ${OPENAIR1_DIR} ${OPENAIR2_DIR} ${OPENAIR2_COMMON_DIR} ${OPENAIR2_DIR}/UTIL/LOG
|
||||
${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_COMMONUTILS_DIR}/hashtable ${OPENAIR_COMMONUTILS_DIR} ${OPENAIR_ASN1INC}
|
||||
${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0 ${OPENAIR_COMMONUTILS_DIR}/msc ${OPENAIR_COMMONUTILS_DIR}/itti ${OPENAIR_COMMONUTILS_DIR}/hashtable ${OPENAIR_COMMONUTILS_DIR} ${OPENAIR_ASN1INC}
|
||||
${OPENAIR2_DIR}/LAYER2/RLC ${OPENAIR2_DIR}/UTIL/LISTS ${OPENAIR2_DIR}/UTIL/MEM ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0
|
||||
${OPENAIR2_DIR}/LAYER2/RLC/TM_v9.3.0 ${OPENAIR2_DIR}/RRC/LITE ${OPENAIR_TARGET_DIR}/COMMON ${OPENAIR_TARGET_DIR}/ARCH/COMMON
|
||||
${OPENAIR3_DIR}/NAS/COMMON/API/NETWORK ${OPENAIR3_DIR}/NAS/COMMON/EMM/MSG/ ${OPENAIR3_DIR}/NAS/COMMON/IES/ ${OPENAIR3_DIR}/NAS/COMMON/UTIL
|
||||
${OPENAIR3_DIR}/NAS/COMMON/ESM/MSG/ ${OPENAIR3_DIR}/GTPV1-U ${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/shared ${OPENAIR3_DIR}/GTPV1-U/nw-gtpv1u/include
|
||||
${OPENAIR3_DIR}/UTILS ${OPENAIR_NFAPIINC})
|
||||
|
||||
set(TELNETSRV_SOURCE
|
||||
${APPROOT}/telnetsrv.c
|
||||
${APPROOT}/telnetsrv_phycmd.c
|
||||
${APPROOT}/telnetsrv_proccmd.c
|
||||
)
|
||||
|
||||
#set(TELNETSRV_ETHDEVCMD_SOURCE
|
||||
# ${APPROOT}/telnetsrv/telnetsrv_ethdevcmd.c
|
||||
# )
|
||||
|
||||
|
||||
|
||||
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
|
||||
#add_library(telnetsrv_ethdevcmd MODULE ${TELNETSRV_ETHDEVCMD_SOURCE} )
|
||||
|
||||
|
||||
install(TARGETS telnetsrv DESTINATION bin)
|
||||
|
||||
if (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
|
||||
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/lte_build_oai/build)
|
||||
endif (EXISTS "${OPENAIR_BUILD_DIR}/lte_build_oai/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/lte_build_oai/build")
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user