mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 20:50:28 +00:00
Compare commits
19 Commits
develop-aa
...
develop-si
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bbcf7cf03 | ||
|
|
6433c1f7d8 | ||
|
|
f395cb54da | ||
|
|
c0725ddc40 | ||
|
|
cae977837f | ||
|
|
d0e2938baa | ||
|
|
2253c554fb | ||
|
|
7c1bbb5770 | ||
|
|
fbaf8a62ca | ||
|
|
da5006914a | ||
|
|
63e7c17105 | ||
|
|
f8ee74deba | ||
|
|
2e310b8c95 | ||
|
|
83f0090917 | ||
|
|
18d05df012 | ||
|
|
0983181541 | ||
|
|
467384bc39 | ||
|
|
933e874ce6 | ||
|
|
3185d596ef |
208
LICENSE
208
LICENSE
@@ -1,200 +1,94 @@
|
||||
The OpenAirInterface Software Alliance (OSA)
|
||||
OAI Public License (Version 1.1)
|
||||
OAI PUBLIC LICENSE V1.0
|
||||
|
||||
LICENSE TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION OF OPENAIR 5G SOFTWARE.
|
||||
Copyright (C) 2016 OpenAirInterface Software Alliance, Inc. <http://www.openairinterface.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
1. Definitions.
|
||||
|
||||
“License” shall mean the terms and conditions for use, reproduction, and distribution set forth
|
||||
in this document.
|
||||
Definitions.
|
||||
“License” shall mean the terms and conditions for use, reproduction, and distribution set forth in this document.
|
||||
|
||||
“Licensor” shall mean the OpenAirInterface Software Alliance.
|
||||
|
||||
“Legal Entity” shall mean the union, at the time an acting entity joins the Alliance, of the
|
||||
acting entity and all other entities that control, are controlled by, or are under common control
|
||||
with that entity. For the purposes of this definition, “control” means (i) the power, direct or
|
||||
indirect, to cause the direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii)
|
||||
beneficial ownership of such entity.
|
||||
“Legal Entity” shall mean the union, at the time an acting entity joins the Alliance, of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, “control” means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
“You” (or “Your”) shall mean an individual or Legal Entity exercising permissions granted by
|
||||
this License.
|
||||
“You” (or “Your”) shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
“Source” form shall mean the preferred form for making modifications, including but not
|
||||
limited to software source code, documentation source, and configuration files.
|
||||
“Source” form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
“Object” form shall mean any form resulting from mechanical transformation or translation of
|
||||
a Source form, including but not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
“Object” form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
“OpenAirInterface Software Alliance” shall mean the endowment fund established at the
|
||||
initiative of Eurecom, an educational and research establishment located at Campus Sophia
|
||||
Tech, 450 Route des Chappes, 06410 Biot, France, which statutes were signed on 18
|
||||
November 2014.
|
||||
“OpenAirInterface Software Alliance” shall mean the endowment fund established at the initiative of Eurecom, an educational and research establishment located at Campus Sophia Tech, 450 Route des Chappes, 06410 Biot, France, which statutes were signed on 18 November 2014.
|
||||
|
||||
“Work” shall mean the work of authorship, whether in Source or Object form, made available
|
||||
under the License, as indicated by a copyright notice that is included in or attached to the
|
||||
work (an example is provided in the Appendix below).
|
||||
“ “Work” shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
“Derivative Works” shall mean any work, whether in Source or Object form, that is based on
|
||||
(or derived from) the Work and for which the editorial revisions, annotations, elaborations, or
|
||||
other modifications represent, as a whole, an original work of authorship. For the purposes of
|
||||
this License, Derivative Works shall not include works that remain separable from, or merely
|
||||
link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
“Derivative Works” shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
“Contribution” shall mean any work of authorship that is intentionally submitted to Licensor
|
||||
for inclusion in the Work by the copyright owner or by an individual or Legal Entity
|
||||
authorized to submit on behalf of the copyright owner. For the purposes of this definition,
|
||||
“submitted” means any form of electronic, , or written communication sent to the Licensor or
|
||||
its representatives, including but not limited to communication on electronic mailing lists,
|
||||
source code control systems, and issue tracking systems that are managed by, or on behalf of,
|
||||
the Licensor for the purpose of discussing and improving the Work
|
||||
“Contribution” shall mean any work of authorship that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, “submitted” means any form of electronic, , or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work “Contributor License Agreement” shall mean the agreement signed by any Contributor setting forth the terms and conditions applicable to its Contribution. “Contributor” shall mean any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
“Contributor License Agreement” shall mean the agreement signed by any Contributor setting
|
||||
forth the terms and conditions applicable to its Contribution.
|
||||
Grant of Copyright License.
|
||||
Subject to the terms and conditions of this License, Licensor and each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form
|
||||
|
||||
“Contributor” shall mean any individual or Legal Entity on behalf of whom a Contribution
|
||||
has been received by Licensor and subsequently incorporated within the Work.
|
||||
3. Grant of Patent License.
|
||||
|
||||
2. Grant of Copyright License.
|
||||
Subject to the terms and conditions of this License, Licensor and each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of, publicly display, publicly
|
||||
perform, and distribute the Work and such Derivative Works in Source or Object form
|
||||
3.1 Grant of Patent License for non-commercial purposes:
|
||||
|
||||
3. Grant of Patent License.
|
||||
Subject to the terms and conditions of this License, Licensor and each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, import, and otherwise transfer the Work, for non-commercial purposes, where such license applies only to those patent claims licensable by such Contributor or Licensor that are necessarily infringed by the Work and/or their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted.
|
||||
|
||||
3.1 Grant of Patent License for study, testing and research purposes:
|
||||
Subject to the terms and conditions of this License, Licensor and each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made, use, and otherwise
|
||||
transfer (excluding selling) the Work, solely for study, testing and research purposes, where
|
||||
such license applies only to those patent claims licensable by Licensor or such Contributor
|
||||
that are necessarily infringed respectively by the Work and/or the said Contributor
|
||||
Contribution(s) alone or by combination of their Contribution(s) with the Work to which
|
||||
such Contribution(s) was submitted (“Essential Patents”).
|
||||
3.2 Grant of Patent License for commercial purposes:
|
||||
|
||||
3.2 Grant of Patent License for purposes other than study and research:
|
||||
For purposes other than study, testing and research, and subject to the terms and conditions of
|
||||
this License, You commit to be prepared to negotiate a non-exclusive, non-transferable, non-
|
||||
assignable license of Essential Patents with each Contributor and/or the Licensor on Fair,
|
||||
Reasonable and Non-Discriminatory (“FRAND”) terms and conditions for the use of the
|
||||
Work or Contribution(s) incorporated within the Work.
|
||||
Licensor and/or each Contributor, by submitting a Contribution, will identify any of its known
|
||||
Essential Patent it owns related to the Work and/or its Contribution.
|
||||
For commercial purposes, and subject to the terms and conditions of this License, You commits to be prepared to negotiate a patent license with each Contributor and/or the Licensor on Fair, Reasonable and Non-Discriminatory (“FRAND”) terms and conditions for the Work or Contribution(s) incorporated within the Work.
|
||||
|
||||
Licensor and/or each Contributor, by submitting a Contribution, will identify any patent it owns related to the Work and/or its Contribution.
|
||||
|
||||
3.3 Patent Litigation
|
||||
If You institute patent litigation against any entity making use of the Work solely for study,
|
||||
testing and research purposes (including a cross-claim or counterclaim in a lawsuit) alleging
|
||||
that the Work or a Contribution incorporated within the Work constitutes direct or
|
||||
contributory patent infringement, then the patent licenses granted to You under section 3.1 of
|
||||
this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Sublicensing
|
||||
You may grant sublicenses under the licenses granted under sections 2 and 3.1 provided that
|
||||
the sublicense is subject to and inclusive of all the terms of and rights under this License to
|
||||
which the Work is or was distributed by the OpenAirInterface Software Alliance.
|
||||
If You institute patent litigation against any entity making non-commercial use of the Work (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
5. Redistribution
|
||||
Subject to terms and conditions set forth in sections 2 and 3, You may reproduce and
|
||||
distribute copies of the Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You meet the following
|
||||
conditions:
|
||||
4. Redistibution
|
||||
|
||||
1. You must give any other recipients of the Work or Derivative Works a copy of this
|
||||
License; and
|
||||
Subject to terms and conditions set forth in articles 2 and 3, You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
2. You must cause any modified files by You to carry prominent notices stating that You
|
||||
changed the files; and
|
||||
|
||||
3. You must retain, in the Source form of any Derivative Works that You distribute, all
|
||||
copyright, patent, trademark, and attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
4. If the Work includes a “NOTICE” text file as part of its distribution, then any Derivative
|
||||
Works that You distribute must include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not pertain to any part of the
|
||||
Derivative Works, in at least one of the following places: within a NOTICE text file
|
||||
distributed as part of the Derivative Works; within the Source form or documentation, if
|
||||
provided along with the Derivative Works; or, within a display generated by the Derivative
|
||||
Works, if and wherever such third-party notices normally appear. The contents of the
|
||||
NOTICE file are for informational purposes only and do not modify the License. You may
|
||||
add Your own attribution notices within Derivative Works that You distribute, alongside or as
|
||||
an addendum to the NOTICE text from the Work, provided that such additional attribution
|
||||
notices cannot be construed as modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide
|
||||
additional or different license terms and conditions for use, reproduction, or distribution of
|
||||
Your modifications, or for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with the conditions stated in
|
||||
this License.
|
||||
|
||||
6. Submission of Contributions.
|
||||
Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be
|
||||
under the terms and conditions of this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify the terms of any
|
||||
separate license agreement such as the Contributor License Agreement You may have
|
||||
executed with Licensor regarding such Contributions.
|
||||
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
7. Trademarks.
|
||||
This License does not grant permission to use the trade names, trademarks, service marks, or
|
||||
product names of the Licensor, except as required for reasonable and customary use in
|
||||
describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
2. You must cause any modified files by You to carry prominent notices stating that You changed the files; and
|
||||
|
||||
8. Disclaimer of Warranty.
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and
|
||||
each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including,
|
||||
without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
|
||||
responsible for determining the appropriateness of using or redistributing the Work and
|
||||
assume any risks associated with your exercise of permissions under this License.
|
||||
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
9. Limitation of Liability.
|
||||
In no event and under no legal theory, whether in tort (including negligence), contract, or
|
||||
otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or
|
||||
agreed to in writing, shall Licensor and any Contributor, as such, be liable to You for
|
||||
damages, including any direct, indirect, special, incidental, or consequential damages of any
|
||||
character arising as a result of this License or out of Your use or inability to use the Work
|
||||
(including but not limited to damages for loss of goodwill, work stoppage, computer failure or
|
||||
malfunction, or any and all other commercial damages or losses), even if such Contributor has
|
||||
been advised of the possibility of such damages.
|
||||
4. If the Work includes a “NOTICE” text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
10. Accepting Warranty or Additional Liability.
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to offer, and
|
||||
charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations
|
||||
and/or rights consistent with this License. However, in accepting such obligations, You may
|
||||
act only on Your own behalf and on Your sole responsibility, not on behalf of any other
|
||||
Contributor and/or the Licensor, and only if You agree to indemnify, defend, and hold each
|
||||
Contributor and/or the Licensor harmless for any liability incurred by, or claims asserted
|
||||
against, such Contributor and/or Licensor by reason of Your accepting any such warranty or
|
||||
additional liability.
|
||||
|
||||
11. Applicable law.
|
||||
The present license shall be governed by the laws of France.
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement such as the Contributor License Agreement You may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall Licensor and any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor and/or the Licensor,and only if You agree to indemnify, defend, and hold each Contributor and/or the Licensor harmless for any liability incurred by, or claims asserted against, such Contributor and/or Licensor by reason of Your accepting any such warranty or additional liability.
|
||||
|
||||
10. Applicable law. The present license shall be governed by the laws of France.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
1. APPENDIX: How to apply the PRESENT OPENAIR 5G License to your work
|
||||
To apply the present License to your work, attach the following boilerplate notice, with the
|
||||
fields enclosed by brackets “[]” replaced with your own identifying information. (Don’t
|
||||
include the brackets!) The text should be enclosed in the appropriate comment syntax for the
|
||||
file format. We also recommend that a file or class name and description of purpose be
|
||||
included on the same “printed page” as the copyright notice for easier identification within
|
||||
third-party archives.
|
||||
APPENDIX: How to apply the PRESENT OPENAIR 5G License to your work
|
||||
To apply the present License to your work, attach the following boilerplate notice, with the fields enclosed by brackets “[]” replaced with your own identifying information. (Don’t include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same “printed page” as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Licensed under the License terms and conditions for use, reproduction, and distribution of OPENAIR 5G software (the “License”);
|
||||
|
||||
Licensed under the License terms and conditions for use, reproduction, and distribution of
|
||||
OPENAIR 5G software (the “License”);
|
||||
you may not use this file except in compliance with the License.You may obtain a copy of the License at
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
|
||||
you may not use this file except in compliance with the License. You may obtain a copy of
|
||||
the License at
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the
|
||||
License is distributed on an “AS IS” BASIS,
|
||||
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.
|
||||
See the License for the specific language governing permissions and
|
||||
|
||||
limitations under the License.
|
||||
|
||||
@@ -43,4 +43,3 @@ v0.5.2 -> Last version with old code for oaisim (abstraction mode works)
|
||||
v0.6 -> RRH functionality, UE greatly improved, better TDD support,
|
||||
a lot of bugs fixed. WARNING: oaisim in PHY abstraction mode does not
|
||||
work, you need to use v0.5.2 for that.
|
||||
v0.6.1 -> Mostly bugfixes. This is the last version without NFAPI.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
When running lsusb, if you have:
|
||||
|
||||
Bus 001 Device 002: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)
|
||||
|
||||
You need to run:
|
||||
|
||||
usb_modeswitch -v 12d1 -p 14fe -M '55534243123456780000000000000011062000000100000000000000000000'
|
||||
|
||||
After what, running lsusb should give:
|
||||
|
||||
Bus 001 Device 004: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
|
||||
|
||||
Values of 'Bus' and 'Device' may differ of course.
|
||||
@@ -13,16 +13,6 @@ containing lines:
|
||||
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666"
|
||||
SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666"
|
||||
|
||||
To avoid NetworkManager to play with the bandrich, add also the line:
|
||||
|
||||
ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
|
||||
Maybe also add; , ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
to the two other lines.
|
||||
|
||||
Then run: udevadm control --reload-rules
|
||||
And: service network-manager restart
|
||||
|
||||
Change vendor_id/model_id/serial/interface num to match yours.
|
||||
Use lsusb -v to find values.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Active_eNBs = ( "eNB-Eurecom-LTEBox");
|
||||
Active_eNBs = ( "eNB_Eurecom_LTEBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
@@ -10,7 +10,7 @@ eNBs =
|
||||
|
||||
cell_type = "CELL_MACRO_ENB";
|
||||
|
||||
eNB_name = "eNB-Eurecom-LTEBox";
|
||||
eNB_name = "eNB_Eurecom_LTEBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = "1";
|
||||
|
||||
@@ -13,7 +13,7 @@ class connection:
|
||||
try:
|
||||
(pid, fd) = os.forkpty()
|
||||
except BaseException, e:
|
||||
log("ERROR: forkpty for '" + description + "': " + str(e))
|
||||
log("ERROR: forkpty for '" + description + "': " + e)
|
||||
(pid, fd) = (-1, -1)
|
||||
|
||||
if pid == -1:
|
||||
@@ -26,7 +26,7 @@ class connection:
|
||||
os.execvp('sshpass', ['sshpass', '-p', password,
|
||||
'ssh', user + '@' + host])
|
||||
except BaseException, e:
|
||||
log("ERROR: execvp for '" + description + "': " + str(e))
|
||||
log("ERROR: execvp for '" + description + "': " + e)
|
||||
log("ERROR: execvp failed for '" + description + "'")
|
||||
os._exit(1)
|
||||
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
@@ -42,6 +42,7 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
|
||||
|
||||
MSC_GEN="False"
|
||||
XFORMS="True"
|
||||
FLEXRAN_AGENT_SB_IF="True"
|
||||
PRINT_STATS="False"
|
||||
VCD_TIMING="False"
|
||||
DEADLINE_SCHEDULER_FLAG_USER="False"
|
||||
@@ -65,9 +66,7 @@ UE_AUTOTEST_TRACE="False"
|
||||
UE_DEBUG_TRACE="False"
|
||||
UE_TIMING_TRACE="False"
|
||||
DISABLE_LOG_X="False"
|
||||
USRP_REC_PLAY="False"
|
||||
BUILD_ECLIPSE=0
|
||||
UE_NAS_USE_TUN="False"
|
||||
trap handle_ctrl_c INT
|
||||
|
||||
function print_help() {
|
||||
@@ -100,12 +99,16 @@ Options
|
||||
Specify conf_nvram_path (default \"$conf_nvram_path\")
|
||||
--UE-gen-nvram [output path]
|
||||
Specify gen_nvram_path (default \"$gen_nvram_path\")
|
||||
--RRH
|
||||
Makes the RRH
|
||||
-a | --agent
|
||||
Enables agent for software-defined control of the eNB
|
||||
-r | --3gpp-release
|
||||
default is Rel14,
|
||||
Rel8 limits the implementation to 3GPP Release 8 version
|
||||
Rel10 limits the implementation to 3GPP Release 10 version
|
||||
-w | --hardware
|
||||
EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)
|
||||
EXMIMO, USRP, SKIQ, BLADERF, ETHERNET, LMSSDR, None (Default)
|
||||
Adds this RF board support (in external packages installation and in compilation)
|
||||
-t | --transport protocol
|
||||
ETHERNET , None
|
||||
@@ -155,10 +158,6 @@ Options
|
||||
Disable all LOG_* macros
|
||||
--build-eclipse
|
||||
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
|
||||
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
|
||||
@@ -197,14 +196,15 @@ function main() {
|
||||
GDB=1
|
||||
CMAKE_BUILD_TYPE="Debug"
|
||||
echo_info "Will Compile with gdb symbols and disable compiler optimization"
|
||||
CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug --trace-expand"
|
||||
CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug"
|
||||
shift;;
|
||||
--eNB)
|
||||
eNB=1
|
||||
echo_info "Will compile eNB"
|
||||
shift;;
|
||||
-a | --agent)
|
||||
echo_info "FlexRAN support is always compiled into the eNB"
|
||||
FLEXRAN_AGENT=1
|
||||
echo_info "Will compile eNB with agent support"
|
||||
shift;;
|
||||
--UE)
|
||||
UE=1
|
||||
@@ -216,6 +216,10 @@ function main() {
|
||||
--UE-gen-nvram)
|
||||
gen_nvram_path=$(readlink -f $2)
|
||||
shift 2;;
|
||||
--RRH)
|
||||
RRH=1
|
||||
echo_info "Will compile RRH"
|
||||
shift;;
|
||||
-r | --3gpp-release)
|
||||
REL=$2
|
||||
echo_info "Setting release to: $REL"
|
||||
@@ -223,7 +227,7 @@ function main() {
|
||||
-w | --hardware)
|
||||
HW="$2" #"${i#*=}"
|
||||
# Use OAI_USRP as the key word USRP is used inside UHD driver
|
||||
if [ "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "LMSSDR" -a "$HW" != "None" -a "$HW" != "EXMIMO" ] ; then
|
||||
if [ "$HW" != "SKIQ" -a "$HW" != "BLADERF" -a "$HW" != "USRP" -a "$HW" != "LMSSDR" -a "$HW" != "None" -a "$HW" != "EXMIMO" ] ; then
|
||||
echo_fatal "Unknown HW type $HW will exit..."
|
||||
else
|
||||
if [ "$HW" == "USRP" ] ; then
|
||||
@@ -232,6 +236,9 @@ function main() {
|
||||
if [ "$HW" == "BLADERF" ] ; then
|
||||
HW="OAI_BLADERF"
|
||||
fi
|
||||
if [ "$HW" == "SKIQ" ] ; then
|
||||
HW="OAI_SKIQ"
|
||||
fi
|
||||
if [ "$HW" == "LMSSDR" ] ; then
|
||||
HW="OAI_LMSSDR"
|
||||
fi
|
||||
@@ -341,19 +348,7 @@ function main() {
|
||||
BUILD_ECLIPSE=1
|
||||
CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"'
|
||||
echo_info "Enabling build eclipse project support"
|
||||
shift 1;;
|
||||
--build-telnetsrv)
|
||||
BUILD_TELNETSRV=1
|
||||
echo_info "Build embedded telnet server"
|
||||
shift ;;
|
||||
--usrp-recplay)
|
||||
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;;
|
||||
shift 1;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -366,13 +361,9 @@ 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
|
||||
# check validity of HW and TP parameters for RRH and eNB
|
||||
#########################################################
|
||||
# to be discussed
|
||||
|
||||
@@ -388,10 +379,20 @@ function main() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$RRH" = "1" ] ; then
|
||||
if [ "$TP" = "None" ] ; then
|
||||
echo_fatal "A transport protocol (e.g. -t ETHERNET) must be defined!"
|
||||
fi
|
||||
if [ "$HW" = "None" ] ; then
|
||||
echo_info "No radio head has been selected (HW set to $HW)"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo_info "RF HW set to $HW"
|
||||
#Now we set flags to enable deadline scheduler settings
|
||||
#By default: USRP: disable,
|
||||
#By default: BLADERF: enable,
|
||||
#By default: SKIQ: enable,
|
||||
#By default: EXMIMO: enable
|
||||
if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
|
||||
if [ "$HW" = "EXMIMO" ] ; then
|
||||
@@ -401,7 +402,9 @@ function main() {
|
||||
elif [ "$HW" = "OAI_USRP" ] ; then
|
||||
DEADLINE_SCHEDULER_FLAG_USER="False"
|
||||
elif [ "$HW" = "OAI_BLADERF" ] ; then
|
||||
DEADLINE_SCHEDULER_FLAG_USER="False"
|
||||
DEADLINE_SCHEDULER_FLAG_USER="False"
|
||||
elif [ "$HW" = "OAI_SKIQ" ] ; then
|
||||
DEADLINE_SCHEDULER_FLAG_USER="False"
|
||||
elif [ "$HW" = "OAI_LMSSDR" ] ; then
|
||||
DEADLINE_SCHEDULER_FLAG_USER="False"
|
||||
elif [ "$HW" = "None" ] ; then
|
||||
@@ -472,9 +475,18 @@ function main() {
|
||||
flash_firmware_bladerf
|
||||
fi
|
||||
fi
|
||||
echo_info "installing protobuf/protobuf-c for flexran agent support"
|
||||
install_protobuf_from_source
|
||||
install_protobuf_c_from_source
|
||||
if [ "$HW" == "OAI_SKIQ" ] ; then
|
||||
echo_info "installing packages for SKIQ support"
|
||||
check_install_skiq_driver
|
||||
if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
|
||||
install_usrp_uhd_driver
|
||||
fi
|
||||
fi
|
||||
if [ "$FLEXRAN_AGENT" == "1" ] ; then
|
||||
echo_info "installing protobuf/protobuf-c for flexran agent support"
|
||||
install_protobuf_from_source
|
||||
install_protobuf_c_from_source
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$INSTALL_OPTIONAL" = "1" ] ; then
|
||||
@@ -499,25 +511,12 @@ function main() {
|
||||
DIR=$OPENAIR_DIR/cmake_targets
|
||||
if [ "$NOS1" = "1" ] ; then
|
||||
lte_build_dir=lte_noS1_build_oai
|
||||
if [ "$eNB" = "1" ] ; then
|
||||
lte_exec=lte-softmodem-nos1
|
||||
fi
|
||||
if [ "$UE" = "1" ] ; then
|
||||
lte_exec=lte-uesoftmodem-nos1
|
||||
fi
|
||||
lte_exec=lte-softmodem-nos1
|
||||
else
|
||||
lte_build_dir=lte_build_oai
|
||||
if [ "$eNB" = "1" ] ; then
|
||||
lte_exec=lte-softmodem
|
||||
fi
|
||||
if [ "$UE" = "1" ] ; then
|
||||
lte_exec=lte-uesoftmodem
|
||||
fi
|
||||
lte_exec=lte-softmodem
|
||||
fi
|
||||
|
||||
# configuration module libraries, one currently available, using libconfig
|
||||
config_libconfig_shlib=params_libconfig
|
||||
|
||||
# first generate the CMakefile in the right directory
|
||||
if [ "$eNB" = "1" -o "$UE" = "1" -o "$HW" = "EXMIMO" ] ; then
|
||||
|
||||
@@ -532,6 +531,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
|
||||
if [ "$FLEXRAN_AGENT" = "1" ] ; then
|
||||
echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file
|
||||
fi
|
||||
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,7 +546,6 @@ function main() {
|
||||
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
|
||||
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then
|
||||
echo_info "Compiling UE S1 build : enabling Linux and NETLINK"
|
||||
echo "set (LINUX True )" >> $cmake_file
|
||||
@@ -552,7 +553,7 @@ function main() {
|
||||
fi
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$lte_build_dir/build
|
||||
eval $CMAKE_CMD
|
||||
eval $CMAKE_CMD
|
||||
fi
|
||||
|
||||
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
|
||||
@@ -561,14 +562,6 @@ function main() {
|
||||
$lte_build_dir $lte_exec \
|
||||
$lte_exec $dbin/$lte_exec.$REL
|
||||
|
||||
# mandatory shared lib
|
||||
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 \
|
||||
$lte_build_dir nasmesh \
|
||||
@@ -633,17 +626,12 @@ function main() {
|
||||
if [ "$SIMUS_PHY" = "1" ] ; then
|
||||
# lte unitary simulators compilation
|
||||
echo_info "Compiling unitary tests simulators"
|
||||
# TODO: fix: dlsim_tm4 pucchsim prachsim pdcchsim pbchsim mbmssim
|
||||
#simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
|
||||
simlist="dlsim ulsim"
|
||||
simlist="dlsim_tm4 dlsim ulsim pucchsim prachsim pdcchsim pbchsim mbmssim"
|
||||
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
|
||||
@@ -699,11 +687,13 @@ 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
|
||||
if [ "$FLEXRAN_AGENT" = "1" ] ; then
|
||||
echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file
|
||||
fi
|
||||
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 "set ( UE_NAS_USE_TUN $UE_NAS_USE_TUN )" >> $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
|
||||
@@ -712,12 +702,6 @@ function main() {
|
||||
compilations \
|
||||
$oaisim_build_dir $oaisim_exec \
|
||||
$oaisim_exec $dbin/$oaisim_exec.$REL
|
||||
compilations \
|
||||
$oaisim_build_dir $config_libconfig_shlib \
|
||||
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
|
||||
compilations \
|
||||
$oaisim_build_dir coding \
|
||||
libcoding.so $dbin/libcoding.so
|
||||
|
||||
if [ "$NOS1" != "1" ] ; then
|
||||
|
||||
@@ -786,6 +770,9 @@ function main() {
|
||||
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
|
||||
if [ "$FLEXRAN_AGENT" = "1" ] ; then
|
||||
echo "set ( FLEXRAN_AGENT_SB_IF $FLEXRAN_AGENT_SB_IF )" >> $cmake_file
|
||||
fi
|
||||
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
|
||||
@@ -799,20 +786,46 @@ function main() {
|
||||
# oaisim_mme $dbin/oaisim_mme.$REL
|
||||
fi
|
||||
|
||||
# Telnet server compilation
|
||||
# RRH compilation
|
||||
#####################
|
||||
if [ "$BUILD_TELNETSRV" = "1" ] ; then
|
||||
build_dir=$lte_build_dir
|
||||
compilations \
|
||||
$build_dir telnetsrv \
|
||||
libtelnetsrv.so $dbin/libtelnetsrv.so
|
||||
if [ "$RRH" = "1" ] ; then
|
||||
|
||||
fi
|
||||
rrh_exec=rrh_gw
|
||||
rrh_build_dir=rrh_gw
|
||||
|
||||
echo_info "Compiling $rrh_exec ..."
|
||||
|
||||
[ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build
|
||||
mkdir -p $DIR/$rrh_build_dir/build
|
||||
cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
|
||||
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
|
||||
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
|
||||
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( ENABLE_ITTI False )" >> $cmake_file
|
||||
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
|
||||
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
|
||||
echo 'set ( PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
|
||||
echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
|
||||
echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
|
||||
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$rrh_build_dir/build
|
||||
eval $CMAKE_CMD
|
||||
compilations \
|
||||
rrh_gw rrh_gw \
|
||||
rrh_gw $dbin/rrh_gw
|
||||
|
||||
fi
|
||||
|
||||
# build RF device and transport protocol libraries
|
||||
#####################################
|
||||
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
|
||||
if [ "$eNB" = "1" -o "$UE" = "1" -o "$RRH" = "1" ] ; then
|
||||
|
||||
build_dir=$lte_build_dir
|
||||
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
|
||||
build_dir=$lte_build_dir
|
||||
else
|
||||
build_dir=$rrh_build_dir
|
||||
fi
|
||||
|
||||
# build RF device libraries
|
||||
if [ "$HW" != "None" ] ; then
|
||||
@@ -829,9 +842,11 @@ function main() {
|
||||
ln -sf $dbin/liboai_exmimodevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to EXMIMO device library"
|
||||
elif [ "$HW" == "OAI_USRP" ] ; then
|
||||
compilations \
|
||||
$build_dir oai_usrpdevif \
|
||||
liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
|
||||
if [ -d "/usr/include/uhd" ] ; then
|
||||
compilations \
|
||||
$build_dir oai_usrpdevif \
|
||||
liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
|
||||
fi
|
||||
|
||||
ln -sf liboai_usrpdevif.so liboai_device.so
|
||||
ln -sf $dbin/liboai_usrpdevif.so.$REL $dbin/liboai_device.so
|
||||
@@ -843,9 +858,19 @@ function main() {
|
||||
liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL
|
||||
fi
|
||||
|
||||
ln -sf liboai_bladerfdevif.so liboai_device.so
|
||||
ln -sf $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to BLADERF device library"
|
||||
ln -s liboai_bladerfdevif.so liboai_device.so
|
||||
ln -s $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to BLADERF device library"
|
||||
elif [ "$HW" == "OAI_SKIQ" ] ; then
|
||||
if [ -f $SKIQ_SDK/sidekiq_core/inc ] ; then
|
||||
compilations \
|
||||
$build_dir oai_skiqdevif \
|
||||
liboai_skiqdevif.so $dbin/liboai_skiqdevif.so.$REL
|
||||
fi
|
||||
|
||||
ln -s liboai_skiqdevif.so liboai_device.so
|
||||
ln -s $dbin/liboai_skiqdevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to SIDEKIQ device library"
|
||||
elif [ "$HW" == "OAI_LMSSDR" ] ; then
|
||||
# if [ -f "/usr/include/libbladeRF.h" ] ; then
|
||||
compilations \
|
||||
|
||||
@@ -2,13 +2,17 @@ cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ASN_DEBUG False)
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( EMIT_ASN_DEBUG False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING True )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_SECURITY True )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
|
||||
@@ -17,6 +21,7 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U True)
|
||||
@@ -28,6 +33,7 @@ set ( DEADLINE_SCHEDULER False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False)
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX False )
|
||||
@@ -36,25 +42,38 @@ set ( NAS_MME False )
|
||||
set ( NAS_UE True )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU False )
|
||||
set ( OAISIM False )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "epc_test" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RRC_DEFAULT_RAB_IS_AM True)
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT True )
|
||||
|
||||
@@ -6,6 +6,9 @@ set(XFORMS True)
|
||||
set(ENABLE_ITTI False)
|
||||
set(DEBUG_PHY False)
|
||||
set(MU_RECIEVER False)
|
||||
set(RANDOM_BF False)
|
||||
set(PBS_SIM False)
|
||||
set(PERFECT_CE True)
|
||||
set(NAS_UE False)
|
||||
set(MESSAGE_CHART_GENERATOR False)
|
||||
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING True )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY True )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
@@ -16,6 +20,7 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U True)
|
||||
@@ -27,6 +32,7 @@ set ( DEADLINE_SCHEDULER False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False)
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX False )
|
||||
@@ -35,26 +41,40 @@ set ( NAS_MME False )
|
||||
set ( NAS_UE True )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RRC_DEFAULT_RAB_IS_AM True)
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 False )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP False )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST False )
|
||||
set ( ENABLE_PGM_TRANSPORT False )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False )
|
||||
@@ -17,6 +21,7 @@ set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE False )
|
||||
set ( EPC_BUILD True )
|
||||
set ( EXMIMO_IOT False )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME False )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U True)
|
||||
@@ -27,6 +32,7 @@ set ( LOG_NO_THREAD False )
|
||||
set ( DEADLINE_SCHEDULER False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX False )
|
||||
@@ -36,27 +42,42 @@ set ( NAS_NETLINK False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT False )
|
||||
set ( NO_RRM False )
|
||||
set ( OAI_EMU False )
|
||||
set ( OAISIM False )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK False )
|
||||
set ( OPENAIR1 False )
|
||||
set ( OPENAIR2 False )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE False )
|
||||
set ( PACKAGE_NAME "EPC" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PC_DSP False )
|
||||
set ( PC_TARGET False )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION False )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM False )
|
||||
set ( PUCCH False )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( UPDATE_RELEASE_9 True)
|
||||
set ( UPDATE_RELEASE_10 True)
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING False )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY False )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
@@ -15,6 +19,7 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U False)
|
||||
@@ -28,35 +33,51 @@ set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False )
|
||||
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
|
||||
set ( MESSAGE_CHART_GENERATOR_PHY False )
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX False )
|
||||
set ( NAS_ADDRESS_FIX True )
|
||||
set ( NAS_BUILT_IN_UE False)
|
||||
set ( NAS_MME False )
|
||||
set ( NAS_UE False )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_EMU False )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( DEBUG_PHY False )
|
||||
set ( DEBUG_PHY_PROC False)
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
|
||||
set ( ADDR_CONF False )
|
||||
set ( DEBUG_OMG False )
|
||||
set ( DISABLE_XER_PRINT False )
|
||||
set ( DRIVER2013 True )
|
||||
set ( EMOS False )
|
||||
set ( ENABLE_FXP True )
|
||||
set ( ENABLE_ITTI True )
|
||||
set ( ENABLE_NAS_UE_LOGGING True )
|
||||
set ( ENABLE_NEW_MULTICAST True )
|
||||
set ( ENABLE_PDCP_NETLINK_FIFO False )
|
||||
set ( ENABLE_PGM_TRANSPORT True )
|
||||
set ( ENABLE_RAL False )
|
||||
set ( ENABLE_SECURITY True )
|
||||
set ( ENABLE_STANDALONE_EPC False)
|
||||
@@ -17,6 +21,7 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( ENB_MODE True )
|
||||
set ( EXMIMO_IOT True )
|
||||
set ( HARD_RT False )
|
||||
set ( JUMBO_FRAME True )
|
||||
set ( LARGE_SCALE False )
|
||||
set ( LINK_ENB_PDCP_TO_GTPV1U True)
|
||||
@@ -28,6 +33,7 @@ set ( DEADLINE_SCHEDULER False )
|
||||
set ( MAC_CONTEXT 1 )
|
||||
set ( MAX_NUM_CCs 1 )
|
||||
set ( MESSAGE_CHART_GENERATOR False)
|
||||
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
|
||||
set ( MSG_PRINT False )
|
||||
set ( MU_RECEIVER False )
|
||||
set ( NAS_ADDRESS_FIX False )
|
||||
@@ -36,30 +42,44 @@ set ( NAS_MME False )
|
||||
set ( NAS_UE True )
|
||||
set ( NB_ANTENNAS_RX "2" )
|
||||
set ( NB_ANTENNAS_TX "2" )
|
||||
set ( NB_ANTENNAS_TXRX "2" )
|
||||
set ( NEW_FFT True )
|
||||
set ( NO_RRM True )
|
||||
set ( OAI_EMU True )
|
||||
set ( OAISIM True )
|
||||
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
|
||||
set ( OAI_NW_DRIVER_USE_NETLINK True )
|
||||
set ( OPENAIR1 True )
|
||||
set ( OPENAIR2 True )
|
||||
set ( OPENAIR_LTE True )
|
||||
set ( PACKAGE_NAME "oaisim" )
|
||||
set ( PBS_SIM False )
|
||||
set ( PDCP_USE_NETLINK True )
|
||||
set ( PC_DSP True )
|
||||
set ( PC_TARGET True )
|
||||
set ( PDCP_MSG_PRINT False )
|
||||
set ( PERFECT_CE False )
|
||||
set ( PHY_ABSTRACTION True )
|
||||
set ( PHY_CONTEXT False )
|
||||
set ( PHY_EMUL False )
|
||||
set ( PHYSIM True )
|
||||
set ( PUCCH True )
|
||||
set ( RANDOM_BF False )
|
||||
set ( RF_BOARD "False" )
|
||||
set ( RLC_STOP_ON_LOST_PDU False )
|
||||
set ( RRC_ASN1_VERSION "Rel10" )
|
||||
set ( RRC_DEFAULT_RAB_IS_AM True)
|
||||
set ( RRC_MSG_PRINT False )
|
||||
set ( RTAI False )
|
||||
set ( SECU False )
|
||||
set ( SMBV False )
|
||||
set ( SPECTRA False )
|
||||
set ( TEST_OMG False )
|
||||
|
||||
set ( TEST_S1C_MME True )
|
||||
|
||||
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
|
||||
set ( USE_MME "R10" )
|
||||
set ( USER_MODE True )
|
||||
set ( XER_PRINT False )
|
||||
set ( XFORMS False )
|
||||
|
||||
@@ -38,7 +38,7 @@ def outputHeaderToFile(f, filename):
|
||||
* 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
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
@@ -95,8 +95,6 @@ get_distribution_release() {
|
||||
check_supported_distribution() {
|
||||
local distribution=$(get_distribution_release)
|
||||
case "$distribution" in
|
||||
"ubuntu17.10") return 0 ;;
|
||||
"ubuntu17.04") return 0 ;;
|
||||
"ubuntu16.04") return 0 ;;
|
||||
"ubuntu14.04") return 0 ;;
|
||||
"fedora24") return 0 ;;
|
||||
@@ -210,7 +208,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 $(groups | cut -d" " -f1) --no-same-owner
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $USER --no-same-owner
|
||||
cd protobuf-3.3.0/
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
@@ -232,7 +230,6 @@ install_protobuf_c_from_source(){
|
||||
rm -rf /tmp/protobuf-c
|
||||
git clone https://github.com/protobuf-c/protobuf-c.git
|
||||
cd protobuf-c
|
||||
git checkout 2a46af42784abf86804d536f6e0122d47cfeea45
|
||||
./autogen.sh
|
||||
./configure
|
||||
echo "Compiling protobuf-c"
|
||||
@@ -249,14 +246,14 @@ install_usrp_uhd_driver_from_source(){
|
||||
cd /tmp
|
||||
echo "Downloading UHD driver"
|
||||
rm -rf /tmp/uhd
|
||||
git clone https://github.com/EttusResearch/uhd.git
|
||||
git clone git://github.com/EttusResearch/uhd.git
|
||||
cd uhd
|
||||
git checkout tags/release_003_010_001_001
|
||||
mkdir -p host/build
|
||||
cd host/build
|
||||
$CMAKE ../
|
||||
echo "Compiling UHD"
|
||||
make -j`nproc`
|
||||
make
|
||||
make test
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
@@ -277,11 +274,10 @@ check_install_usrp_uhd_driver(){
|
||||
$SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host
|
||||
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
$SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake
|
||||
$SUDO pip install requests
|
||||
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
|
||||
# until EPEL repo hasn't bumped UHD driver to >=3.10 in EPEL, build driver from source
|
||||
$SUDO $INSTALLER -y remove uhd uhd-devel uhd-firmware
|
||||
install_usrp_uhd_driver_from_source
|
||||
install_ursp_uhd_driver_from_source
|
||||
else
|
||||
$SUDO $INSTALLER -y install uhd uhd-devel uhd-firmware
|
||||
fi
|
||||
@@ -483,26 +479,16 @@ check_install_oai_software() {
|
||||
fi
|
||||
$SUDO $INSTALLER update -y
|
||||
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
local LAPACK_LIBNAME="liblapack.so"
|
||||
local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so"
|
||||
$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"
|
||||
# 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"
|
||||
;;
|
||||
"ubuntu17.04")
|
||||
specific_packages="libtasn1-6-dev castxml libgnutls28-dev libatlas-dev"
|
||||
;;
|
||||
"ubuntu17.10")
|
||||
specific_packages="libtasn1-6-dev castxml libgnutls28-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
specific_packages="libtasn1-6-dev"
|
||||
;;
|
||||
esac
|
||||
$SUDO apt-get install -y \
|
||||
@@ -518,6 +504,7 @@ check_install_oai_software() {
|
||||
texlive-latex-base \
|
||||
ethtool \
|
||||
flex \
|
||||
gccxml \
|
||||
gdb \
|
||||
git \
|
||||
graphviz \
|
||||
@@ -528,6 +515,7 @@ check_install_oai_software() {
|
||||
iptables \
|
||||
iptables-dev \
|
||||
libatlas-base-dev \
|
||||
libatlas-dev \
|
||||
libblas-dev \
|
||||
libconfig8-dev \
|
||||
libffi-dev \
|
||||
@@ -565,9 +553,11 @@ check_install_oai_software() {
|
||||
wget \
|
||||
libxpm-dev
|
||||
|
||||
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
|
||||
|
||||
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
|
||||
|
||||
$SUDO apt-get install -y nettle-dev nettle-bin
|
||||
|
||||
$SUDO apt-get install -y libgnutls-dev
|
||||
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
|
||||
if rpm -q epel-release > /dev/null; then
|
||||
@@ -645,8 +635,7 @@ check_install_oai_software() {
|
||||
lapack \
|
||||
lapack-devel \
|
||||
blas \
|
||||
blas-devel \
|
||||
libyaml-devel
|
||||
blas-devel
|
||||
fi
|
||||
|
||||
install_asn1c_from_source
|
||||
@@ -661,8 +650,6 @@ install_asn1c_from_source(){
|
||||
$SUDO rm -rf /tmp/asn1c
|
||||
GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
cd /tmp/asn1c
|
||||
cp /usr/share/misc/config.guess .
|
||||
cp /usr/share/misc/config.sub .
|
||||
./configure
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
# <file> <sha1sum of file (without line 4 which changes depending on the location of the files)> <patch to apply to file>
|
||||
|
||||
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"
|
||||
"SystemInformation-r8-IEs.h" 562e3c3aeb7c6d76d722f31bf24488a26e627f33 "fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff"
|
||||
)
|
||||
|
||||
RRC_Rel10=(
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
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;
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -5,7 +5,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -5,7 +5,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
@@ -44,11 +44,11 @@ load_module $OPENAIR_DIR/targets/bin/nasmesh.ko
|
||||
if [ "$1" = "eNB" ]; then
|
||||
echo "bring up oai0 interface for enb"
|
||||
sudo ifconfig oai0 10.0.1.1 netmask 255.255.255.0 broadcast 10.0.1.255
|
||||
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.2 -r 1
|
||||
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.1 -t 10.0.1.9 -r 1
|
||||
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
|
||||
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.2 -t 10.0.1.1 -r 1
|
||||
$OPENAIR_DIR/targets/bin/rb_tool -a -c0 -i0 -z0 -s 10.0.1.9 -t 10.0.1.1 -r 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -8,7 +8,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -4,7 +4,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.1 (the "License"); you may not use this file
|
||||
# * the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
# * except in compliance with the License.
|
||||
# * You may obtain a copy of the License at
|
||||
# *
|
||||
|
||||
@@ -1,166 +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
|
||||
*/
|
||||
|
||||
/*! \file common/config/cmdline/config_libconfig.c
|
||||
* \brief configuration module, command line parsing implementation
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "config_userapi.h"
|
||||
|
||||
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);
|
||||
return 0;
|
||||
} else { /* boolean value option without argument, set value to true*/
|
||||
tmpval = defbool;
|
||||
}
|
||||
}
|
||||
switch(cfgoptions->type)
|
||||
{
|
||||
case TYPE_STRING:
|
||||
if (cfgoptions->numelt == 0 ) {
|
||||
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval)+1);
|
||||
sprintf(*(cfgoptions->strptr), "%s",tmpval);
|
||||
} else {
|
||||
sprintf( (char *)(cfgoptions->strptr), "%s",tmpval);
|
||||
}
|
||||
printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval);
|
||||
optisset=1;
|
||||
break;
|
||||
|
||||
case TYPE_STRINGLIST:
|
||||
break;
|
||||
case TYPE_UINT32:
|
||||
case TYPE_INT32:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INT16:
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->iptr),sizeof(int32_t));
|
||||
config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0));
|
||||
optisset=1;
|
||||
break;
|
||||
case TYPE_UINT64:
|
||||
case TYPE_INT64:
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t));
|
||||
*(cfgoptions->i64ptr)=strtoll(tmpval,NULL,0);
|
||||
printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr));
|
||||
optisset=1;
|
||||
break;
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double));
|
||||
*(cfgoptions->dblptr) = strtof(tmpval,NULL);
|
||||
printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr));
|
||||
optisset=1;
|
||||
break;
|
||||
|
||||
case TYPE_IPV4ADDR:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr,"[CONFIG] command line, %s type %i not supported\n",cfgoptions->optname, cfgoptions->type);
|
||||
break;
|
||||
} /* switch on param type */
|
||||
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;
|
||||
char *pp;
|
||||
char *cfgpath;
|
||||
|
||||
j = (prefix ==NULL) ? 0 : strlen(prefix);
|
||||
cfgpath = malloc( j + MAX_OPTNAME_SIZE +1);
|
||||
if (cfgpath == NULL) {
|
||||
fprintf(stderr,"[CONFIG] %s %i malloc error, %s\n", __FILE__, __LINE__,strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
j=0;
|
||||
p++;
|
||||
c--;
|
||||
while (c > 0 && *p != NULL) {
|
||||
if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) {
|
||||
config_printhelp(cfgoptions,numoptions);
|
||||
}
|
||||
|
||||
if (*p[0] == '-') {
|
||||
for(int i=0;i<numoptions;i++) {
|
||||
if ( ( cfgoptions[i].paramflags & PARAMFLAG_DISABLECMDLINE) != 0) {
|
||||
continue;
|
||||
}
|
||||
if (prefix != NULL) {
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname);
|
||||
} else {
|
||||
sprintf(cfgpath,"%s",cfgoptions[i].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);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} /* for */
|
||||
} /* if (*p[0] == '-') */
|
||||
p++;
|
||||
c--;
|
||||
} /* fin du while */
|
||||
printf_cmdl("[CONFIG] %s %i options set from command line\n",((prefix == NULL) ? "":prefix),j);
|
||||
free(cfgpath);
|
||||
return j;
|
||||
} /* parse_cmdline*/
|
||||
|
||||
|
||||
|
||||
@@ -1,242 +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
|
||||
*/
|
||||
|
||||
/*! \file common/config/config_load_configmodule.c
|
||||
* \brief configuration module, load the shared library implementing the configuration module
|
||||
* \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 <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#define CONFIG_LOADCONFIG_MAIN
|
||||
#include "config_load_configmodule.h"
|
||||
#include "config_userapi.h"
|
||||
#define CONFIG_SHAREDLIBFORMAT "libparams_%s.so"
|
||||
|
||||
int load_config_sharedlib(configmodule_interface_t *cfgptr)
|
||||
{
|
||||
void *lib_handle;
|
||||
char fname[128];
|
||||
char libname[FILENAME_MAX];
|
||||
int st;
|
||||
|
||||
st=0;
|
||||
sprintf(libname,CONFIG_SHAREDLIBFORMAT,cfgptr->cfgmode);
|
||||
|
||||
lib_handle = dlopen(libname,RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
|
||||
if (!lib_handle) {
|
||||
fprintf(stderr,"[CONFIG] %s %d Error calling dlopen(%s): %s\n",__FILE__, __LINE__, libname,dlerror());
|
||||
st = -1;
|
||||
} else {
|
||||
sprintf (fname,"config_%s_init",cfgptr->cfgmode);
|
||||
cfgptr->init = dlsym(lib_handle,fname);
|
||||
|
||||
if (cfgptr->init == NULL ) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n",
|
||||
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
||||
} else {
|
||||
st=cfgptr->init(cfgptr->cfgP,cfgptr->num_cfgP);
|
||||
printf("[CONFIG] function %s returned %i\n",
|
||||
fname, st);
|
||||
}
|
||||
|
||||
sprintf (fname,"config_%s_get",cfgptr->cfgmode);
|
||||
cfgptr->get = dlsym(lib_handle,fname);
|
||||
if (cfgptr->get == NULL ) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n",
|
||||
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
||||
st = -1;
|
||||
}
|
||||
|
||||
sprintf (fname,"config_%s_getlist",cfgptr->cfgmode);
|
||||
cfgptr->getlist = dlsym(lib_handle,fname);
|
||||
if (cfgptr->getlist == NULL ) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n",
|
||||
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
||||
st = -1;
|
||||
}
|
||||
|
||||
sprintf (fname,"config_%s_end",cfgptr->cfgmode);
|
||||
cfgptr->end = dlsym(lib_handle,fname);
|
||||
if (cfgptr->getlist == NULL ) {
|
||||
printf("[CONFIG] %s %d no function %s for config mode %s\n",
|
||||
__FILE__, __LINE__,fname, cfgptr->cfgmode);
|
||||
}
|
||||
}
|
||||
|
||||
return st;
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* from here: interface implementtion of the configuration module */
|
||||
|
||||
|
||||
configmodule_interface_t *load_configmodule(int argc, char **argv)
|
||||
{
|
||||
char *cfgparam=NULL;
|
||||
char *modeparams=NULL;
|
||||
char *cfgmode=NULL;
|
||||
char *strtokctx=NULL;
|
||||
char *atoken;
|
||||
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' ) {
|
||||
tmpflags = CONFIG_HELP;
|
||||
}
|
||||
}
|
||||
optind=1;
|
||||
|
||||
/* look for the OAI_CONFIGMODULE environement variable */
|
||||
if ( cfgparam == NULL ) {
|
||||
cfgparam = getenv("OAI_CONFIGMODULE");
|
||||
}
|
||||
|
||||
/* default */
|
||||
if (cfgparam == NULL) {
|
||||
tmpflags = tmpflags | CONFIG_NOOOPT;
|
||||
cfgparam = DEFAULT_CFGMODE ":" DEFAULT_CFGFILENAME;
|
||||
}
|
||||
/* 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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
cfgptr = malloc(sizeof(configmodule_interface_t));
|
||||
memset(cfgptr,0,sizeof(configmodule_interface_t));
|
||||
|
||||
cfgptr->rtflags = cfgptr->rtflags | tmpflags;
|
||||
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) {
|
||||
/* look for debug level in the config parameters, it is commom to all config mode
|
||||
and will be removed frome the parameter array passed to the shared module */
|
||||
char *aptr;
|
||||
aptr=strcasestr(atoken,"dbgl");
|
||||
if (aptr != NULL) {
|
||||
cfgptr->rtflags = cfgptr->rtflags | strtol(aptr+4,NULL,0);
|
||||
|
||||
} else {
|
||||
cfgptr->cfgP[cfgptr->num_cfgP] = strdup(atoken);
|
||||
cfgptr->num_cfgP++;
|
||||
}
|
||||
atoken = strtok_r(NULL,":",&strtokctx);
|
||||
}
|
||||
|
||||
|
||||
printf("[CONFIG] get parameters from %s ",cfgmode);
|
||||
for (i=0;i<cfgptr->num_cfgP; i++) {
|
||||
printf("%s ",cfgptr->cfgP[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
|
||||
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;
|
||||
} 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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (modeparams != NULL) free(modeparams);
|
||||
if (cfgmode != NULL) free(cfgmode);
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) config_printhelp(Config_Params,CONFIG_PARAMLENGTH(Config_Params));
|
||||
return cfgptr;
|
||||
}
|
||||
|
||||
|
||||
/* 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]);
|
||||
}
|
||||
|
||||
|
||||
free(cfgptr);
|
||||
cfgptr=NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,107 +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
|
||||
*/
|
||||
|
||||
/*! \file common/config/config_load_configmodule.h
|
||||
* \brief: configuration module, include file to be used by the source code calling the
|
||||
* configuration module initialization
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef INCLUDE_CONFIG_LOADCONFIGMODULE_H
|
||||
#define INCLUDE_CONFIG_LOADCONFIGMODULE_H
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "common/config/config_paramdesc.h"
|
||||
#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 DEFAULT_CFGMODE "libconfig" // use libconfig file
|
||||
#define DEFAULT_CFGFILENAME "oai.conf" // default config file
|
||||
|
||||
/* rtflags bit position definitions */
|
||||
#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_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);
|
||||
typedef void(*configmodule_endfunc_t)(void);
|
||||
typedef struct configmodule_interface
|
||||
{
|
||||
int argc;
|
||||
char **argv;
|
||||
char *cfgmode;
|
||||
int num_cfgP;
|
||||
char *cfgP[CONFIG_MAX_OOPT_PARAMS];
|
||||
configmodule_initfunc_t init;
|
||||
configmodule_getfunc_t get;
|
||||
configmodule_getlistfunc_t getlist;
|
||||
configmodule_endfunc_t end;
|
||||
uint32_t numptrs;
|
||||
uint32_t rtflags;
|
||||
char *ptrs[CONFIG_MAX_ALLOCATEDPTRS];
|
||||
} configmodule_interface_t;
|
||||
|
||||
#ifdef CONFIG_LOADCONFIG_MAIN
|
||||
configmodule_interface_t *cfgptr=NULL;
|
||||
|
||||
static char config_helpstr [] = "\n lte-softmodem -O [config mode]<:dbg[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 ";
|
||||
|
||||
#define CONFIG_SECTIONNAME "config"
|
||||
#define CONFIGPARAM_DEBUGFLAGS_IDX 0
|
||||
|
||||
|
||||
static paramdef_t Config_Params[] = {
|
||||
/*-----------------------------------------------------------------------------------------------------------------------*/
|
||||
/* config parameters for config module */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------*/
|
||||
{"debugflags", config_helpstr, 0, uptr:NULL, defintval:0, TYPE_MASK, 0},
|
||||
};
|
||||
|
||||
#else
|
||||
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__ ); }
|
||||
|
||||
extern configmodule_interface_t *load_configmodule(int argc, char **argv);
|
||||
extern void end_configmodule(void);
|
||||
|
||||
#endif /* INCLUDE_CONFIG_LOADCONFIGMODULE_H */
|
||||
@@ -1,168 +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
|
||||
*/
|
||||
|
||||
/*! \file common/config/config_paramdesc.h
|
||||
* \brief configuration module, include file describing parameters, common to all implementations
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#ifndef INCLUDE_CONFIG_PARAMDESC_H
|
||||
#define INCLUDE_CONFIG_PARAMDESC_H
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define MAX_OPTNAME_SIZE 64
|
||||
|
||||
|
||||
|
||||
/* parameter flags definitions */
|
||||
/* Flags to be used by calling modules in their parameters definitions to modify config module behavior*/
|
||||
#define PARAMFLAG_MANDATORY (1 << 0) // parameter must be explicitely set, default value ignored
|
||||
#define PARAMFLAG_DISABLECMDLINE (1 << 1) // parameter cannot bet set from comand line
|
||||
#define PARAMFLAG_DONOTREAD (1 << 2) // parameter must be ignored in get function
|
||||
#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function
|
||||
#define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1
|
||||
|
||||
|
||||
/* Flags used by config modules to return info to calling modules and/or to for internal usage*/
|
||||
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module
|
||||
#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 **strptr;
|
||||
char **strlistptr;
|
||||
uint8_t *u8ptr;
|
||||
int8_t *i8ptr;
|
||||
uint16_t *u16ptr;
|
||||
int16_t *i16ptr;
|
||||
uint32_t *uptr;
|
||||
int32_t *iptr;
|
||||
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 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
|
||||
#define TYPE_UINT TYPE_UINT32
|
||||
#define TYPE_STRING 1
|
||||
#define TYPE_INT8 2
|
||||
#define TYPE_UINT8 3
|
||||
#define TYPE_INT16 4
|
||||
#define TYPE_UINT16 5
|
||||
#define TYPE_INT32 6
|
||||
#define TYPE_UINT32 7
|
||||
#define TYPE_INT64 8
|
||||
#define TYPE_UINT64 9
|
||||
#define TYPE_MASK 10
|
||||
#define TYPE_DOUBLE 16
|
||||
#define TYPE_IPV4ADDR 20
|
||||
|
||||
|
||||
#define TYPE_STRINGLIST 50
|
||||
#define TYPE_INTARRAY 51
|
||||
#define TYPE_UINTARRAY 52
|
||||
#define TYPE_LIST 55
|
||||
|
||||
#define ANY_IPV4ADDR_STRING "0.0.0.0"
|
||||
|
||||
typedef struct paramlist_def {
|
||||
char listname[MAX_OPTNAME_SIZE];
|
||||
paramdef_t **paramarray;
|
||||
int numelt ;
|
||||
} paramlist_def_t;
|
||||
|
||||
/* macro helpers for module users */
|
||||
#define CONFIG_PARAMLENGTH(A) (sizeof(A)/sizeof(paramdef_t))
|
||||
#endif /* INCLUDE_CONFIG_PARAMDESC_H */
|
||||
@@ -1,285 +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
|
||||
*/
|
||||
|
||||
/*! \file common/config/config_userapi.c
|
||||
* \brief configuration module, api implementation to access configuration parameters
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <dlfcn.h>
|
||||
#include "config_userapi.h"
|
||||
extern void exit_fun(const char* s); // lte-softmodem clean exit function
|
||||
|
||||
|
||||
configmodule_interface_t *config_get_if(void)
|
||||
{
|
||||
if (cfgptr == NULL) {
|
||||
fprintf(stderr,"[CONFIG] %s %d config module not initialized\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
return cfgptr;
|
||||
}
|
||||
|
||||
char * config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length)
|
||||
{
|
||||
|
||||
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 (*ptr == NULL) {
|
||||
*ptr = malloc(length);
|
||||
if ( *ptr != NULL) {
|
||||
memset(*ptr,0,length);
|
||||
if ( (cfgoptions->paramflags & PARAMFLAG_NOFREE) == 0) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = *ptr;
|
||||
config_get_if()->numptrs++;
|
||||
}
|
||||
} else {
|
||||
fprintf (stderr,"[CONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
return *ptr;
|
||||
}
|
||||
|
||||
void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val)
|
||||
{
|
||||
int tmpval=val;
|
||||
if ( ((cfgoptions->paramflags &PARAMFLAG_BOOL) != 0) && tmpval >1) {
|
||||
tmpval =1;
|
||||
}
|
||||
switch (cfgoptions->type) {
|
||||
case TYPE_UINT8:
|
||||
*(cfgoptions->u8ptr) = (uint8_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %u\n", fullname, (uint8_t)tmpval);
|
||||
break;
|
||||
case TYPE_INT8:
|
||||
*(cfgoptions->i8ptr) = (int8_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %i\n", fullname, (int8_t)tmpval);
|
||||
break;
|
||||
case TYPE_UINT16:
|
||||
*(cfgoptions->u16ptr) = (uint16_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %hu\n", fullname, (uint16_t)tmpval);
|
||||
break;
|
||||
case TYPE_INT16:
|
||||
*(cfgoptions->i16ptr) = (int16_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %hi\n", fullname, (int16_t)tmpval);
|
||||
break;
|
||||
case TYPE_UINT32:
|
||||
*(cfgoptions->uptr) = (uint32_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %u\n", fullname, (uint32_t)tmpval);
|
||||
break;
|
||||
case TYPE_MASK:
|
||||
*(cfgoptions->uptr) = *(cfgoptions->uptr) | (uint32_t)tmpval;
|
||||
printf_params("[CONFIG] %s: 0x%08x\n", fullname, (uint32_t)tmpval);
|
||||
break;
|
||||
case TYPE_INT32:
|
||||
*(cfgoptions->iptr) = (int32_t)tmpval;
|
||||
printf_params("[CONFIG] %s: %i\n", fullname, (int32_t)tmpval);
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr,"[CONFIG] %s %i type %i non integer parameter %s not assigned\n",__FILE__, __LINE__,cfgoptions->type,fullname);
|
||||
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++) {
|
||||
if ( params[i].helpstr != NULL) {
|
||||
printf("%s%s: %s",
|
||||
(strlen(params[i].optname) <= 1) ? "-" : "--",
|
||||
params[i].optname,
|
||||
params[i].helpstr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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: %i parameters with wrong value\n", -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;
|
||||
|
||||
if (CONFIG_ISFLAGSET(CONFIG_ABORT)) {
|
||||
fprintf(stderr,"[CONFIG] config_get skipped, config module not properly initialized\n");
|
||||
return ret;
|
||||
}
|
||||
configmodule_interface_t *cfgif = config_get_if();
|
||||
if (cfgif != NULL) {
|
||||
ret = config_get_if()->get(params, numparams,prefix);
|
||||
if (ret >= 0) {
|
||||
config_process_cmdline(params,numparams,prefix);
|
||||
config_execcheck(params,numparams,prefix);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int config_isparamset(paramdef_t *params,int paramidx)
|
||||
{
|
||||
if ((params[paramidx].paramflags & PARAMFLAG_PARAMSET) != 0) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -1,75 +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
|
||||
*/
|
||||
|
||||
/*! \file common/config/config_userapi.h
|
||||
* \brief: configuration module, include file to be used by the source code calling the
|
||||
* configuration module to access configuration parameters
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef INCLUDE_CONFIG_USERAPI_H
|
||||
#define INCLUDE_CONFIG_USERAPI_H
|
||||
#include "config_load_configmodule.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#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_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 void config_assign_processedint(paramdef_t *cfgoption, int val);
|
||||
extern void config_assign_int(paramdef_t *cfgoptions, char *fullname, int val);
|
||||
|
||||
/* 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);
|
||||
|
||||
#define CONFIG_GETCONFFILE (config_get_if()->cfgP[0])
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,413 +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
|
||||
*/
|
||||
/*! \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>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "config_libconfig.h"
|
||||
#include "config_libconfig_private.h"
|
||||
#include "../config_userapi.h"
|
||||
#include "errno.h"
|
||||
|
||||
#if ( LIBCONFIG_VER_MAJOR == 1 && LIBCONFIG_VER_MINOR < 5)
|
||||
#define config_setting_lookup config_lookup_from
|
||||
#endif
|
||||
|
||||
void config_libconfig_end(void );
|
||||
|
||||
int read_strlist(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath)
|
||||
{
|
||||
const char *str;
|
||||
int st;
|
||||
int numelt;
|
||||
|
||||
numelt=config_setting_length(setting);
|
||||
config_check_valptr(cfgoptions,(char **)&(cfgoptions->strlistptr), sizeof(char *) * numelt);
|
||||
st=0;
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
|
||||
int read_intarray(paramdef_t *cfgoptions,config_setting_t *setting, char *cfgpath)
|
||||
{
|
||||
|
||||
cfgoptions->numelt=config_setting_length(setting);
|
||||
|
||||
if (cfgoptions->numelt > 0) {
|
||||
cfgoptions->iptr=malloc(sizeof(int) * (cfgoptions->numelt));
|
||||
for (int i=0; i< cfgoptions->numelt && cfgoptions->iptr != NULL; i++) {
|
||||
cfgoptions->iptr[i]=config_setting_get_int_elem(setting,i);
|
||||
printf_params("[LIBCONFIG] %s[%i]: %i\n", cfgpath,i,cfgoptions->iptr[i]);
|
||||
} /* for loop on array element... */
|
||||
}
|
||||
return cfgoptions->numelt;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int config_libconfig_get(paramdef_t *cfgoptions,int numoptions, char *prefix )
|
||||
{
|
||||
|
||||
|
||||
config_setting_t *setting;
|
||||
char *str;
|
||||
int i,u;
|
||||
long long int llu;
|
||||
double dbl;
|
||||
int rst;
|
||||
int status=0;
|
||||
int notfound;
|
||||
int defval;
|
||||
int fatalerror=0;
|
||||
char *cfgpath; /* listname.[listindex].paramname */
|
||||
int numdefvals=0;
|
||||
|
||||
i = (prefix ==NULL) ? 0 : strlen(prefix);
|
||||
cfgpath = malloc( i+ MAX_OPTNAME_SIZE +1);
|
||||
if (cfgpath == NULL) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s %i malloc error, %s\n", __FILE__, __LINE__,strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
for(i=0;i<numoptions;i++) {
|
||||
|
||||
if (prefix != NULL) {
|
||||
sprintf(cfgpath,"%s.%s",prefix,cfgoptions[i].optname);
|
||||
} else {
|
||||
sprintf(cfgpath,"%s",cfgoptions[i].optname);
|
||||
}
|
||||
|
||||
if( (cfgoptions->paramflags & PARAMFLAG_DONOTREAD) != 0) {
|
||||
printf_params("[LIBCONFIG] %s.%s ignored\n", cfgpath,cfgoptions[i].optname );
|
||||
continue;
|
||||
}
|
||||
notfound=0;
|
||||
defval=0;
|
||||
switch(cfgoptions[i].type)
|
||||
{
|
||||
case TYPE_STRING:
|
||||
|
||||
printf("call config_lookup_string for '%s' %p\n", cfgpath, &(libconfig_privdata.cfg)); fflush(stdout);
|
||||
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",
|
||||
cfgpath,str,cfgoptions[i].numelt);
|
||||
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]), cfgoptions[i].strptr, strlen(str)+1);
|
||||
sprintf( *(cfgoptions[i].strptr) , "%s", str);
|
||||
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 );
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TYPE_STRINGLIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
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;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT8:
|
||||
case TYPE_INT8:
|
||||
case TYPE_UINT16:
|
||||
case TYPE_INT16:
|
||||
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_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;
|
||||
}
|
||||
}
|
||||
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)) {
|
||||
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)) );
|
||||
} else {
|
||||
*(cfgoptions[i].iptr) = llu;
|
||||
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;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TYPE_UINTARRAY:
|
||||
case TYPE_INTARRAY:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
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;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TYPE_DOUBLE:
|
||||
config_check_valptr(&(cfgoptions[i]), (char **)&(cfgoptions[i].dblptr),sizeof(double));
|
||||
if ( config_lookup_float(&(libconfig_privdata.cfg),cfgpath, &dbl)) {
|
||||
*(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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
|
||||
break;
|
||||
case TYPE_LIST:
|
||||
setting = config_setting_lookup (config_root_setting(&(libconfig_privdata.cfg)),cfgpath );
|
||||
if ( setting) {
|
||||
cfgoptions[i].numelt=config_setting_length(setting);
|
||||
} else {
|
||||
notfound=1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"[LIBCONFIG] %s type %i not supported\n", cfgpath,cfgoptions[i].type);
|
||||
fatalerror=1;
|
||||
break;
|
||||
} /* switch on param type */
|
||||
if( notfound == 1) {
|
||||
printf("[LIBCONFIG] %s not found in %s ", cfgpath,libconfig_privdata.configfile );
|
||||
if ( (cfgoptions[i].paramflags & PARAMFLAG_MANDATORY) != 0) {
|
||||
fatalerror=1;
|
||||
printf(" mandatory parameter missing\n");
|
||||
} else {
|
||||
printf("\n");
|
||||
}
|
||||
} else {
|
||||
if (defval == 1) {
|
||||
numdefvals++;
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSETDEF;
|
||||
} else {
|
||||
cfgoptions[i].paramflags = cfgoptions[i].paramflags | PARAMFLAG_PARAMSET;
|
||||
}
|
||||
status++;
|
||||
}
|
||||
} /* for loop on options */
|
||||
printf("[LIBCONFIG] %s: %i/%i parameters successfully set, (%i to default value)\n",
|
||||
((prefix == NULL)?"(root)":prefix),
|
||||
status,numoptions,numdefvals );
|
||||
if (fatalerror == 1) {
|
||||
fprintf(stderr,"[LIBCONFIG] fatal errors found when processing %s \n", libconfig_privdata.configfile );
|
||||
config_libconfig_end();
|
||||
end_configmodule();
|
||||
}
|
||||
free(cfgpath);
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_libconfig_getlist(paramlist_def_t *ParamList,
|
||||
paramdef_t *params, int numparams, char *prefix)
|
||||
{
|
||||
config_setting_t *setting;
|
||||
int i,j,status;
|
||||
char *listpath=NULL;
|
||||
char cfgpath[MAX_OPTNAME_SIZE*2 + 6]; /* prefix.listname.[listindex] */
|
||||
|
||||
if (prefix != NULL)
|
||||
{
|
||||
i=asprintf(&listpath ,"%s.%s",prefix,ParamList->listname);
|
||||
}
|
||||
else
|
||||
{
|
||||
i=asprintf(&listpath ,"%s",ParamList->listname);
|
||||
}
|
||||
setting = config_lookup(&(libconfig_privdata.cfg), listpath);
|
||||
if ( setting) {
|
||||
status = ParamList->numelt = config_setting_length(setting);
|
||||
printf_params("[LIBCONFIG] %i %s in config file %s \n",
|
||||
ParamList->numelt,listpath,libconfig_privdata.configfile );
|
||||
} else {
|
||||
printf("[LIBCONFIG] list %s not found in config file %s \n",
|
||||
listpath,libconfig_privdata.configfile );
|
||||
ParamList->numelt= 0;
|
||||
status = -1;
|
||||
}
|
||||
if (ParamList->numelt > 0 && params != NULL) {
|
||||
ParamList->paramarray = malloc(ParamList->numelt * sizeof(paramdef_t *));
|
||||
if ( ParamList->paramarray != NULL) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray);
|
||||
config_get_if()->numptrs++;
|
||||
} else {
|
||||
fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
for (i=0 ; i < ParamList->numelt ; i++) {
|
||||
ParamList->paramarray[i] = malloc(numparams * sizeof(paramdef_t));
|
||||
if ( ParamList->paramarray[i] != NULL) {
|
||||
config_get_if()->ptrs[config_get_if()->numptrs] = (char *)(ParamList->paramarray[i]);
|
||||
config_get_if()->numptrs++;
|
||||
} else {
|
||||
fprintf (stderr,"[LIBCONFIG] %s %d malloc error\n",__FILE__, __LINE__);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
memcpy(ParamList->paramarray[i], params, sizeof(paramdef_t)*numparams);
|
||||
for (j=0;j<numparams;j++) {
|
||||
ParamList->paramarray[i][j].strptr = NULL ;
|
||||
}
|
||||
sprintf(cfgpath,"%s.[%i]",listpath,i);
|
||||
config_libconfig_get(ParamList->paramarray[i], numparams, cfgpath );
|
||||
} /* for i... */
|
||||
} /* ParamList->numelt > 0 && params != NULL */
|
||||
if (listpath != NULL)
|
||||
free(listpath);
|
||||
return status;
|
||||
}
|
||||
|
||||
int config_libconfig_init(char *cfgP[], int numP)
|
||||
{
|
||||
config_init(&(libconfig_privdata.cfg));
|
||||
libconfig_privdata.configfile = strdup((char *)cfgP[0]);
|
||||
config_get_if()->numptrs=0;
|
||||
memset(config_get_if()->ptrs,0,sizeof(void *) * CONFIG_MAX_ALLOCATEDPTRS);
|
||||
|
||||
/* Read the file. If there is an error, report it and exit. */
|
||||
if(! config_read_file(&(libconfig_privdata.cfg), libconfig_privdata.configfile)) {
|
||||
fprintf(stderr,"[LIBCONFIG] %s %d file %s - %d - %s\n",__FILE__, __LINE__,
|
||||
libconfig_privdata.configfile, config_error_line(&(libconfig_privdata.cfg)),
|
||||
config_error_text(&(libconfig_privdata.cfg)));
|
||||
config_destroy(&(libconfig_privdata.cfg));
|
||||
printf( "\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void config_libconfig_end(void )
|
||||
{
|
||||
config_destroy(&(libconfig_privdata.cfg));
|
||||
if ( libconfig_privdata.configfile != NULL ) {
|
||||
free(libconfig_privdata.configfile);
|
||||
libconfig_privdata.configfile=NULL;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,39 +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
|
||||
*/
|
||||
|
||||
/*! \file common/config/libconfig/config_libconfig_private.h
|
||||
* \brief configuration module, include file for libconfig implementation
|
||||
* \author Francois TABURET
|
||||
* \date 2017
|
||||
* \version 0.1
|
||||
* \company NOKIA BellLabs France
|
||||
* \email: francois.taburet@nokia-bell-labs.com
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
static libconfig_privatedata_t libconfig_privdata;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,103 +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
|
||||
*/
|
||||
|
||||
/*! \file PHY/impl_defs_lte.h
|
||||
* \brief LTE Physical channel configuration and variable structure definitions
|
||||
* \author R. Knopp, F. Kaltenberger
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __RAN_CONTEXT_H__
|
||||
#define __RAN_CONTEXT_H__
|
||||
|
||||
#include <pthread.h>
|
||||
#include "COMMON/platform_constants.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
#include "RRC/LITE/defs.h"
|
||||
#include "flexran_agent_defs.h"
|
||||
|
||||
#include "gtpv1u.h"
|
||||
#include "NwGtpv1u.h"
|
||||
#include "NwGtpv1uMsg.h"
|
||||
#include "NwGtpv1uPrivate.h"
|
||||
#include "gtpv1u_eNB_defs.h"
|
||||
|
||||
#include "PHY/defs_L1_NB_IoT.h"
|
||||
#include "RRC/LITE/defs_NB_IoT.h"
|
||||
typedef struct {
|
||||
/// RAN context config file name
|
||||
char *config_file_name;
|
||||
/// Number of RRC instances in this node
|
||||
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
|
||||
int nb_RU;
|
||||
/// FlexRAN context variables
|
||||
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;
|
||||
/// 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
|
||||
struct RU_t_s **ru;
|
||||
/// Mask to indicate fronthaul setup status of RU (hard-limit to 64 RUs)
|
||||
uint64_t ru_mask;
|
||||
/// Mutex for protecting ru_mask
|
||||
pthread_mutex_t ru_mutex;
|
||||
/// condition variable for signaling setup completion of an RU
|
||||
pthread_cond_t ru_cond;
|
||||
} RAN_CONTEXT_t;
|
||||
|
||||
|
||||
#endif
|
||||
5
common/utils/T/.gitignore
vendored
5
common/utils/T/.gitignore
vendored
@@ -10,9 +10,4 @@ tracer/replay
|
||||
tracer/textlog
|
||||
tracer/vcd
|
||||
tracer/macpdu2wireshark
|
||||
tracer/ue
|
||||
tracer/to_vcd
|
||||
tracer/extract_input_subframe
|
||||
tracer/extract_output_subframe
|
||||
tracer/extract
|
||||
tracee/tracee
|
||||
|
||||
@@ -36,7 +36,7 @@ static void get_message(int s)
|
||||
int is_on;
|
||||
|
||||
if (read(s, &t, 1) != 1) QUIT("get_message fails");
|
||||
printf("T tracer: got mess %d\n", t);
|
||||
printf("got mess %d\n", t);
|
||||
switch (t) {
|
||||
case 0:
|
||||
/* toggle all those IDs */
|
||||
|
||||
@@ -29,10 +29,10 @@ 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 172
|
||||
|
||||
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_VARIABLES 131
|
||||
#define VCD_NUM_VARIABLES 118
|
||||
|
||||
/* first VCD function (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
|
||||
|
||||
@@ -16,31 +16,31 @@ ID = ENB_PHY_DL_TICK
|
||||
ID = ENB_PHY_DLSCH_UE_DCI
|
||||
DESC = eNodeB downlink UE specific DCI as sent by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS
|
||||
ID = ENB_PHY_DLSCH_UE_ACK
|
||||
DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = ENB_PHY_DLSCH_UE_NACK
|
||||
DESC = eNodeB downlink UE NACK as seen by the PHY layer in process_HARQ_feedback
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = ENB_PHY_ULSCH_UE_DCI
|
||||
DESC = eNodeB uplink UE specific DCI as sent by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE
|
||||
ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION
|
||||
DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top)
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = ENB_PHY_ULSCH_UE_ACK
|
||||
DESC = eNodeB uplink UE ACK as seen by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = ENB_PHY_ULSCH_UE_NACK
|
||||
DESC = eNodeB uplink UE NACK as seen by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = ENB_PHY_INPUT_SIGNAL
|
||||
DESC = eNodeB received signal in the time domain for a duration of 1ms
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
@@ -52,31 +52,31 @@ ID = ENB_PHY_OUTPUT_SIGNAL
|
||||
ID = ENB_PHY_UL_CHANNEL_ESTIMATE
|
||||
DESC = eNodeB channel estimation in the time domain
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,antenna : buffer,chest_t
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t
|
||||
ID = ENB_PHY_PUSCH_IQ
|
||||
DESC = eNodeB PUSCH received IQ data
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
|
||||
ID = ENB_PHY_PUCCH_1AB_IQ
|
||||
DESC = eNodeB PUCCH received IQ data
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,I : int,Q
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,I : int,Q
|
||||
ID = ENB_PHY_PUCCH_1_ENERGY
|
||||
DESC = eNodeB PUCCH 1 energy and threshold
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
|
||||
FORMAT = int,eNB_ID : int,rnti : int,frame : int,subframe : int,energy : int,threshold
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,energy : int,threshold
|
||||
ID = ENB_PHY_PHICH
|
||||
DESC = eNodeB PHICH
|
||||
GROUP = ALL:PHY:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid : int,NGROUP : int,NSF : int,ngroup : int,nseq : int,ACK : int,first_rb : int,n_DMRS
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,NGROUP : int,NSF : int,ngroup : int,nseq : int,ACK : int,first_rb : int,n_DMRS
|
||||
ID = ENB_PHY_MSG3_ALLOCATION
|
||||
DESC = eNodeB Msg3 allocation/reallocation
|
||||
GROUP = ALL:PHY:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,first_transmission : int,Msg3_frame : int,Msg3_subframe
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,first_transmission : int,Msg3_frame : int,Msg3_subframe
|
||||
ID = ENB_PHY_INITIATE_RA_PROCEDURE
|
||||
DESC = eNodeB initiates a random access procedure after detecting enough energy for one of the preambles
|
||||
GROUP = ALL:PHY:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,preamble : int,energy : int,delay
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,preamble : int,energy : int,delay
|
||||
|
||||
#MAC logs
|
||||
ID = ENB_MAC_UE_DL_SDU
|
||||
@@ -185,10 +185,6 @@ ID = ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST
|
||||
DESC = RRC connection reestablishment request
|
||||
GROUP = ALL:RRC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
|
||||
ID = ENB_RRC_CONNECTION_REESTABLISHMENT
|
||||
DESC = RRC connection reestablishment
|
||||
GROUP = ALL:RRC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
|
||||
ID = ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE
|
||||
DESC = RRC connection reestablishment complete
|
||||
GROUP = ALL:RRC:ENB
|
||||
@@ -838,27 +834,27 @@ ID = UE_PHY_DL_TICK
|
||||
ID = UE_PHY_DLSCH_UE_DCI
|
||||
DESC = UE downlink UE specific DCI as sent by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid : int,mcs : int,TBS
|
||||
ID = UE_PHY_DLSCH_UE_ACK
|
||||
DESC = UE downlink UE ACK as seen by the PHY layer in process_HARQ_feedback
|
||||
GROUP = ALL:PHY:GRAPHIC:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = UE_PHY_DLSCH_UE_NACK
|
||||
DESC = UE downlink UE NACK as seen by the PHY layer in process_HARQ_feedback
|
||||
GROUP = ALL:PHY:GRAPHIC:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = UE_PHY_ULSCH_UE_DCI
|
||||
DESC = UE uplink UE specific DCI as sent by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS
|
||||
ID = UE_PHY_ULSCH_UE_ACK
|
||||
DESC = UE uplink UE ACK as seen by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = UE_PHY_ULSCH_UE_NACK
|
||||
DESC = UE uplink UE NACK as seen by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,harq_pid
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
|
||||
ID = UE_PHY_INPUT_SIGNAL
|
||||
DESC = UE received signal in the time domain for a duration of 1ms
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
@@ -866,7 +862,7 @@ ID = UE_PHY_INPUT_SIGNAL
|
||||
ID = UE_PHY_DL_CHANNEL_ESTIMATE
|
||||
DESC = UE channel estimation in the time domain
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,chest_t
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t
|
||||
ID = UE_PHY_PDCCH_IQ
|
||||
DESC = UE PDCCH received IQ data
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
@@ -874,27 +870,27 @@ ID = UE_PHY_PDCCH_IQ
|
||||
ID = UE_PHY_PDCCH_ENERGY
|
||||
DESC = UE PDSCH 1 energy and threshold
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,pdcch_ch_level00 : int,pdcch_ch_level01 : int,pdcch_ch_level10: int,pdcch_ch_level11
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdcch_ch_level00 : int,pdcch_ch_level01 : int,pdcch_ch_level10: int,pdcch_ch_level11
|
||||
ID = UE_PHY_PDSCH_IQ
|
||||
DESC = UE PDSCH received IQ data
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
|
||||
ID = UE_PHY_PDSCH_ENERGY
|
||||
DESC = UE PDSCH 1 energy and threshold
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,pdsch_ch_level00 : int,pdsch_ch_level01 : int,pdsch_ch_level10: int,pdsch_ch_level11
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,pdsch_ch_level00 : int,pdsch_ch_level01 : int,pdsch_ch_level10: int,pdsch_ch_level11
|
||||
ID = UE_PHY_PUSCH_TX_POWER
|
||||
DESC = UE PUSCH tx power
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,p0_pusch : int,ampl: int,g_pusch: int,pl: int,nb_rb
|
||||
FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pusch : int,ampl: int,g_pusch: int,pl: int,nb_rb
|
||||
ID = UE_PHY_PUCCH_TX_POWER
|
||||
DESC = UE PDSCH 1 energy and threshold
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,p0_pucch : int,ampl: int,g_pucch: int,pl
|
||||
FORMAT = int,eNB_ID : int,UE_id : int,frame : int,subframe : int,p0_pucch : int,ampl: int,g_pucch: int,pl
|
||||
ID = UE_PHY_MEAS
|
||||
DESC = UE PHY measurements
|
||||
GROUP = ALL:PHY:GRAPHIC:HEAVY:UE
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rsrp : int,rssi : int,snr: int,rx_power: int,noise_power: int,w_cqi: int,freq_offset
|
||||
FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,rsrp : int,rssi : int,snr: int,rx_power: int,noise_power: int,w_cqi: int,freq_offset
|
||||
|
||||
#for debug/test - not used
|
||||
ID = first
|
||||
@@ -962,38 +958,6 @@ ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_ENB
|
||||
DESC = VCD variable SUBFRAME_NUMBER_RX1_ENB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_TX0_RU
|
||||
DESC = VCD variable FRAME_NUMBER_TX0_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_TX1_RU
|
||||
DESC = VCD variable FRAME_NUMBER_TX1_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_RX0_RU
|
||||
DESC = VCD variable FRAME_NUMBER_RX0_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_FRAME_NUMBER_RX1_RU
|
||||
DESC = VCD variable FRAME_NUMBER_RX1_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX0_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_TX0_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX1_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_TX1_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX0_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_RX0_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX1_RU
|
||||
DESC = VCD variable SUBFRAME_NUMBER_RX1_RU
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_RUNTIME_TX_ENB
|
||||
DESC = VCD variable RUNTIME_TX_ENB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
@@ -1086,14 +1050,6 @@ ID = VCD_VARIABLE_TRX_TST
|
||||
DESC = VCD variable TRX_TST
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_TRX_TS_UE
|
||||
DESC = VCD variable TRX_TS_UE
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_TRX_TST_UE
|
||||
DESC = VCD variable TRX_TST_UE
|
||||
GROUP = ALL:VCD:UE:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
ID = VCD_VARIABLE_TRX_WRITE_FLAGS
|
||||
DESC = VCD variable TRX_WRITE_FLAGS
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
@@ -1442,18 +1398,6 @@ 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
|
||||
|
||||
@@ -1469,14 +1413,6 @@ ID = VCD_FUNCTION_TRX_WRITE
|
||||
DESC = VCD function TRX_WRITE
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_TRX_READ_UE
|
||||
DESC = VCD function TRX_READ_UE
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_TRX_WRITE_UE
|
||||
DESC = VCD function TRX_WRITE_UE
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_TRX_READ_IF
|
||||
DESC = VCD function TRX_READ_IF
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
@@ -1629,28 +1565,12 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_TX1
|
||||
DESC = VCD function PHY_PROCEDURES_ENB_TX1
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPRX
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPRX
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_RX_COMMON
|
||||
DESC = VCD function PHY_PROCEDURES_ENB_RX_COMMON
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPRX1
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPRX1
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM1
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM1
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC1
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC1
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_RX_COMMON1
|
||||
DESC = VCD function PHY_PROCEDURES_ENB_RX_COMMON1
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_RX_UESPEC
|
||||
@@ -1661,6 +1581,10 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_RX_UESPEC1
|
||||
DESC = VCD function PHY_PROCEDURES_ENB_RX_UESPEC1
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_ENB_SLOT_FEP
|
||||
DESC = VCD function ENB_SLOT_FEP
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_UE_TX
|
||||
DESC = VCD function PHY_PROCEDURES_UE_TX
|
||||
GROUP = ALL:VCD:UE:VCD_FUNCTION
|
||||
@@ -1857,10 +1781,6 @@ ID = VCD_FUNCTION_PHY_ENB_PRACH_RX
|
||||
DESC = VCD function PHY_ENB_PRACH_RX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_RU_PRACH_RX
|
||||
DESC = VCD function PHY_RU_PRACH_RX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PHY_ENB_PDCCH_TX
|
||||
DESC = VCD function PHY_ENB_PDCCH_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
@@ -2173,39 +2093,3 @@ ID = VCD_FUNCTION_TRX_DECOMPR_IF
|
||||
DESC = VCD function TRX_DECOMPR_IF
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_NFAPI
|
||||
DESC = VCD function NFAPI
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_GENERATE_PCFICH
|
||||
DESC = VCD function GENERATE_PCFICH
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_GENERATE_DCI0
|
||||
DESC = VCD function GENERATE_DCI0
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_GENERATE_DLSCH
|
||||
DESC = VCD function GENERATE_DLSCH
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_GENERATE_PHICH
|
||||
DESC = VCD function GENERATE_PHICH
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PDCCH_SCRAMBLING
|
||||
DESC = VCD function PDCCH_SCRAMBLING
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PDCCH_MODULATION
|
||||
DESC = VCD function PDCCH_MODULATION
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PDCCH_INTERLEAVING
|
||||
DESC = VCD function PDCCH_INTERLEAVING
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
ID = VCD_FUNCTION_PDCCH_TX
|
||||
DESC = VCD function PDCCH_TX
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
|
||||
@@ -63,7 +63,7 @@ static int get_connection(char *addr, int port)
|
||||
socklen_t alen;
|
||||
int s, t;
|
||||
|
||||
printf("T tracer: waiting for connection on %s:%d\n", addr, port);
|
||||
printf("waiting for connection on %s:%d\n", addr, port);
|
||||
|
||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (s == -1) { perror("socket"); exit(1); }
|
||||
@@ -82,7 +82,7 @@ static int get_connection(char *addr, int port)
|
||||
if (t == -1) { perror("accept"); exit(1); }
|
||||
close(s);
|
||||
|
||||
printf("T tracer: connected\n");
|
||||
printf("connected\n");
|
||||
|
||||
return t;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ process:
|
||||
while (size) {
|
||||
int l = write(f->socket_remote, b, size);
|
||||
if (l <= 0) {
|
||||
printf("T tracer: forward error\n");
|
||||
printf("forward error\n");
|
||||
close(f->socket_remote);
|
||||
f->socket_remote = -1;
|
||||
break;
|
||||
@@ -268,7 +268,7 @@ static void *forwarder(int port, int s)
|
||||
f->memusage = 0;
|
||||
f->last_warning_memusage = 0;
|
||||
|
||||
printf("T tracer: waiting for remote tracer on port %d\n", port);
|
||||
printf("waiting for remote tracer on port %d\n", port);
|
||||
|
||||
f->remote_port = port;
|
||||
f->socket_remote = get_connection("0.0.0.0", port);
|
||||
@@ -305,7 +305,7 @@ static void forward(void *_forwarder, char *buf, int size)
|
||||
if (f->memusage > f->last_warning_memusage &&
|
||||
f->memusage - f->last_warning_memusage > 100000000) {
|
||||
f->last_warning_memusage += 100000000;
|
||||
printf("T tracer: WARNING: memory usage is over %"PRIu64"MB\n",
|
||||
printf("WARNING: memory usage is over %"PRIu64"MB\n",
|
||||
f->last_warning_memusage / 1000000);
|
||||
} else
|
||||
if (f->memusage < f->last_warning_memusage &&
|
||||
|
||||
@@ -3,11 +3,10 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I.
|
||||
|
||||
#CFLAGS += -O3 -ffast-math -fomit-frame-pointer
|
||||
|
||||
LIBS=-lm
|
||||
XLIBS=-lX11 -lpng -lXft
|
||||
LIBS=-lX11 -lm -lpng -lXft
|
||||
|
||||
all: record replay extract_config textlog enb ue vcd macpdu2wireshark \
|
||||
extract_input_subframe extract_output_subframe to_vcd extract
|
||||
extract_input_subframe
|
||||
|
||||
record: utils.o record.o database.o config.o
|
||||
$(CC) $(CFLAGS) -o record $^ $(LIBS)
|
||||
@@ -22,36 +21,25 @@ extract_input_subframe: extract_input_subframe.o database.o event.o utils.o \
|
||||
config.o
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
extract_output_subframe: extract_output_subframe.o database.o event.o utils.o \
|
||||
config.o
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
extract: extract.o database.o event.o utils.o config.o
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
textlog: utils.o textlog.o database.o event.o handler.o config.o \
|
||||
event_selector.o view/view.a gui/gui.a logger/logger.a \
|
||||
filter/filter.a
|
||||
$(CC) $(CFLAGS) -o textlog $^ $(LIBS) $(XLIBS)
|
||||
$(CC) $(CFLAGS) -o textlog $^ $(LIBS)
|
||||
|
||||
enb: utils.o enb.o database.o event.o handler.o config.o \
|
||||
event_selector.o view/view.a gui/gui.a logger/logger.a \
|
||||
filter/filter.a
|
||||
$(CC) $(CFLAGS) -o enb $^ $(LIBS) $(XLIBS)
|
||||
$(CC) $(CFLAGS) -o enb $^ $(LIBS)
|
||||
|
||||
ue: utils.o ue.o database.o event.o handler.o config.o \
|
||||
event_selector.o view/view.a gui/gui.a logger/logger.a \
|
||||
filter/filter.a
|
||||
$(CC) $(CFLAGS) -o ue $^ $(LIBS) $(XLIBS)
|
||||
$(CC) $(CFLAGS) -o ue $^ $(LIBS)
|
||||
|
||||
vcd: utils.o vcd.o database.o event.o handler.o config.o \
|
||||
event_selector.o view/view.a gui/gui.a logger/logger.a \
|
||||
filter/filter.a
|
||||
$(CC) $(CFLAGS) -o vcd $^ $(LIBS) $(XLIBS)
|
||||
|
||||
to_vcd: to_vcd.o database.o event.o handler.o utils.o config.o \
|
||||
logger/logger.a filter/filter.a
|
||||
$(CC) $(CFLAGS) -o to_vcd $^ $(LIBS)
|
||||
$(CC) $(CFLAGS) -o vcd $^ $(LIBS)
|
||||
|
||||
macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
|
||||
config.o
|
||||
@@ -77,7 +65,6 @@ filter/filter.a:
|
||||
clean:
|
||||
rm -f *.o core tracer_remote textlog enb ue vcd record replay
|
||||
rm -f extract_config macpdu2wireshark extract_input_subframe
|
||||
rm -f extract_output_subframe to_vcd extract
|
||||
cd gui && make clean
|
||||
cd view && make clean
|
||||
cd logger && make clean
|
||||
|
||||
@@ -17,44 +17,6 @@
|
||||
#include "openair_logo.h"
|
||||
#include "config.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* conversion from rnti to "ue_id" (which does not really exists) */
|
||||
/* the idea is to assign an ue_id to an rnti as soon as we get an event */
|
||||
/* for the rnti */
|
||||
/****************************************************************************/
|
||||
|
||||
int ue_id[65536];
|
||||
int next_ue_id;
|
||||
|
||||
void reset_ue_ids(void)
|
||||
{
|
||||
int i;
|
||||
printf("resetting known UEs\n");
|
||||
for (i = 0; i < 65536; i++) ue_id[i] = -1;
|
||||
ue_id[65535] = 0;
|
||||
ue_id[65534] = 1; /* HACK: to be removed */
|
||||
ue_id[2] = 2; /* this supposes RA RNTI = 2, very openair specific */
|
||||
next_ue_id = 3;
|
||||
}
|
||||
|
||||
int ue_id_from_rnti(void *_priv, int rnti)
|
||||
{
|
||||
if (rnti < 0) rnti = 65534; /* HACK, to be removed */
|
||||
|
||||
if (rnti < 0 || rnti > 65535) { printf("bad rnti %d\n", rnti); exit(1); }
|
||||
/* rnti not seen yet? give it a new ue_id */
|
||||
if (ue_id[rnti] == -1) {
|
||||
ue_id[rnti] = next_ue_id;
|
||||
next_ue_id++;
|
||||
}
|
||||
return ue_id[rnti];
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* end of rnti->ue_id conversion */
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
typedef struct {
|
||||
view *phyview;
|
||||
view *macview;
|
||||
@@ -63,7 +25,6 @@ typedef struct {
|
||||
view *rrcview;
|
||||
view *legacy;
|
||||
widget *current_ue_label;
|
||||
widget *current_ue_button;
|
||||
widget *prev_ue_button;
|
||||
widget *next_ue_button;
|
||||
widget *pusch_iq_ue_xy_plot;
|
||||
@@ -97,7 +58,6 @@ typedef struct {
|
||||
enb_gui *e;
|
||||
int ue; /* what UE is displayed in the UE specific views */
|
||||
void *database;
|
||||
int nb_rb;
|
||||
} enb_data;
|
||||
|
||||
void is_on_changed(void *_d)
|
||||
@@ -125,6 +85,27 @@ connection_dies:
|
||||
if (pthread_mutex_unlock(&d->lock)) abort();
|
||||
}
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
printf(
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
" -on <GROUP or ID> turn log ON for given GROUP or ID\n"
|
||||
" -off <GROUP or ID> turn log OFF for given GROUP or ID\n"
|
||||
" -ON turn all logs ON\n"
|
||||
" -OFF turn all logs OFF\n"
|
||||
" note: you may pass several -on/-off/-ON/-OFF,\n"
|
||||
" they will be processed in order\n"
|
||||
" by default, all is off\n"
|
||||
" -ip <host> connect to given IP address (default %s)\n"
|
||||
" -p <port> connect to given port (default %d)\n"
|
||||
" -debug-gui activate GUI debug logs\n",
|
||||
DEFAULT_REMOTE_IP,
|
||||
DEFAULT_REMOTE_PORT
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void *gui_thread(void *_g)
|
||||
{
|
||||
gui *g = _g;
|
||||
@@ -135,15 +116,11 @@ static void *gui_thread(void *_g)
|
||||
static filter *ticktime_filter(void *database, char *event, int i, int ue)
|
||||
{
|
||||
/* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0" */
|
||||
/* we get the UE_id from the rnti */
|
||||
return
|
||||
filter_and(
|
||||
filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)),
|
||||
filter_and(
|
||||
filter_eq(
|
||||
filter_evfun(database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(database, event, "rnti")),
|
||||
filter_int(ue)),
|
||||
filter_eq(filter_evarg(database, event, "UE_id"), filter_int(ue)),
|
||||
filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0))));
|
||||
}
|
||||
|
||||
@@ -171,28 +148,23 @@ static void set_current_ue(gui *g, enb_data *e, int ue)
|
||||
|
||||
logger_set_filter(e->e->pusch_iq_ue_logger,
|
||||
filter_eq(
|
||||
filter_evfun(e->database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(e->database, "ENB_PHY_PUSCH_IQ", "rnti")),
|
||||
filter_evarg(e->database, "ENB_PHY_PUSCH_IQ", "UE_ID"),
|
||||
filter_int(ue)));
|
||||
logger_set_filter(e->e->ul_estimate_ue_logger,
|
||||
filter_eq(
|
||||
filter_evfun(e->database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(e->database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "rnti")),
|
||||
filter_evarg(e->database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "UE_ID"),
|
||||
filter_int(ue)));
|
||||
logger_set_filter(e->e->pucch1_energy_ue_threshold_logger,
|
||||
filter_eq(
|
||||
filter_evfun(e->database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "rnti")),
|
||||
filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"),
|
||||
filter_int(ue)));
|
||||
logger_set_filter(e->e->pucch1_energy_ue_energy_logger,
|
||||
filter_eq(
|
||||
filter_evfun(e->database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "rnti")),
|
||||
filter_evarg(e->database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"),
|
||||
filter_int(ue)));
|
||||
logger_set_filter(e->e->pucch_iq_ue_logger,
|
||||
filter_eq(
|
||||
filter_evfun(e->database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(e->database, "ENB_PHY_PUCCH_1AB_IQ", "rnti")),
|
||||
filter_evarg(e->database, "ENB_PHY_PUCCH_1AB_IQ", "UE_ID"),
|
||||
filter_int(ue)));
|
||||
for (i = 0; i < 8; i++) {
|
||||
logger_set_filter(e->e->dl_dci_logger[i],
|
||||
@@ -213,13 +185,11 @@ static void set_current_ue(gui *g, enb_data *e, int ue)
|
||||
}
|
||||
logger_set_filter(e->e->dl_mcs_logger,
|
||||
filter_eq(
|
||||
filter_evfun(e->database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(e->database, "ENB_PHY_DLSCH_UE_DCI", "rnti")),
|
||||
filter_evarg(e->database, "ENB_PHY_DLSCH_UE_DCI", "UE_id"),
|
||||
filter_int(ue)));
|
||||
logger_set_filter(e->e->ul_mcs_logger,
|
||||
filter_eq(
|
||||
filter_evfun(e->database, ue_id_from_rnti, NULL,
|
||||
filter_evarg(e->database, "ENB_PHY_ULSCH_UE_DCI", "rnti")),
|
||||
filter_evarg(e->database, "ENB_PHY_ULSCH_UE_DCI", "UE_id"),
|
||||
filter_int(ue)));
|
||||
}
|
||||
|
||||
@@ -231,15 +201,12 @@ static void click(void *private, gui *g,
|
||||
enb_data *ed = private;
|
||||
enb_gui *e = ed->e;
|
||||
int ue = ed->ue;
|
||||
int do_reset = 0;
|
||||
|
||||
if (button != 1) return;
|
||||
if (w == e->prev_ue_button) { ue--; if (ue < 0) ue = 0; }
|
||||
if (w == e->next_ue_button) ue++;
|
||||
if (w == e->current_ue_button) do_reset = 1;
|
||||
|
||||
if (pthread_mutex_lock(&ed->lock)) abort();
|
||||
if (do_reset) reset_ue_ids();
|
||||
if (ue != ed->ue) {
|
||||
set_current_ue(g, ed, ue);
|
||||
ed->ue = ue;
|
||||
@@ -281,12 +248,10 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
|
||||
widget_add_child(g, col, logo, -1);
|
||||
w = new_container(g, HORIZONTAL);
|
||||
widget_add_child(g, col, w, -1);
|
||||
/* TODO: use button widget, not label widget */
|
||||
w2 = new_label(g, "");
|
||||
widget_add_child(g, w, w2, -1);
|
||||
label_set_clickable(g, w2, 1);
|
||||
e->current_ue_button = w2;
|
||||
e->current_ue_label = w2;
|
||||
/* TODO: use button widget, not label widget */
|
||||
w2 = new_label(g, " [prev UE] ");
|
||||
widget_add_child(g, w, w2, -1);
|
||||
label_set_clickable(g, w2, 1);
|
||||
@@ -299,14 +264,14 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
|
||||
|
||||
input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20);
|
||||
widget_add_child(g, line, input_signal_plot, -1);
|
||||
xy_plot_set_range(g, input_signal_plot, 0, 7680*10 * ed->nb_rb/25, 20, 70);
|
||||
xy_plot_set_range(g, input_signal_plot, 0, 7680*10, 20, 70);
|
||||
input_signal_log = new_framelog(h, database,
|
||||
"ENB_PHY_INPUT_SIGNAL", "subframe", "rxdata");
|
||||
/* a skip value of 10 means to process 1 frame over 10, that is
|
||||
* more or less 10 frames per second
|
||||
*/
|
||||
framelog_set_skip(input_signal_log, 10);
|
||||
input_signal_view = new_view_xy(7680*10 * ed->nb_rb/25, 10,
|
||||
input_signal_view = new_view_xy(7680*10, 10,
|
||||
g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE);
|
||||
logger_add_view(input_signal_log, input_signal_view);
|
||||
|
||||
@@ -624,8 +589,7 @@ static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database,
|
||||
container_set_child_growable(g, top_container, text, 1);
|
||||
e->legacy = new_view_textlist(10000, 10, g, text);
|
||||
|
||||
set_current_ue(g, ed, ed->ue);
|
||||
register_notifier(g, "click", e->current_ue_button, click, ed);
|
||||
set_current_ue(g, ed, 0);
|
||||
register_notifier(g, "click", e->prev_ue_button, click, ed);
|
||||
register_notifier(g, "click", e->next_ue_button, click, ed);
|
||||
}
|
||||
@@ -646,28 +610,6 @@ void view_add_log(view *v, char *log, event_handler *h, void *database,
|
||||
on_off(database, log, is_on, 1);
|
||||
}
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
printf(
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
" -rb <RBs> setup for this number of RBs (default 25)\n"
|
||||
" -on <GROUP or ID> turn log ON for given GROUP or ID\n"
|
||||
" -off <GROUP or ID> turn log OFF for given GROUP or ID\n"
|
||||
" -ON turn all logs ON\n"
|
||||
" -OFF turn all logs OFF\n"
|
||||
" note: you may pass several -on/-off/-ON/-OFF,\n"
|
||||
" they will be processed in order\n"
|
||||
" by default, all is off\n"
|
||||
" -ip <host> connect to given IP address (default %s)\n"
|
||||
" -p <port> connect to given port (default %d)\n"
|
||||
" -debug-gui activate GUI debug logs\n",
|
||||
DEFAULT_REMOTE_IP,
|
||||
DEFAULT_REMOTE_PORT
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
extern int volatile gui_logd;
|
||||
@@ -686,10 +628,6 @@ int main(int n, char **v)
|
||||
enb_gui eg;
|
||||
enb_data enb_data;
|
||||
|
||||
reset_ue_ids();
|
||||
|
||||
enb_data.nb_rb = 25;
|
||||
|
||||
/* write on a socket fails if the other end is closed and we get SIGPIPE */
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
|
||||
|
||||
@@ -700,8 +638,6 @@ int main(int n, char **v)
|
||||
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||
if (!strcmp(v[i], "-d"))
|
||||
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-rb"))
|
||||
{ if (i > n-2) usage(); enb_data.nb_rb = atoi(v[++i]); continue; }
|
||||
if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-p"))
|
||||
{ if (i > n-2) usage(); port = atoi(v[++i]); continue; }
|
||||
@@ -717,11 +653,6 @@ int main(int n, char **v)
|
||||
usage();
|
||||
}
|
||||
|
||||
switch (enb_data.nb_rb) {
|
||||
case 25: case 50: case 100: break;
|
||||
default: printf("ERROR, bad value for -rb (%d)\n", enb_data.nb_rb); exit(1);
|
||||
}
|
||||
|
||||
if (database_filename == NULL) {
|
||||
printf("ERROR: provide a database file (-d)\n");
|
||||
exit(1);
|
||||
@@ -740,7 +671,7 @@ int main(int n, char **v)
|
||||
g = gui_init();
|
||||
new_thread(gui_thread, g);
|
||||
|
||||
enb_data.ue = 3;
|
||||
enb_data.ue = 0;
|
||||
enb_data.e = ⪚
|
||||
enb_data.database = database;
|
||||
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include "database.h"
|
||||
#include "event.h"
|
||||
#include "config.h"
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
printf(
|
||||
"usage: [options] <file> <event> <buffer name>\n"
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
" -o <output file> this option is mandatory\n"
|
||||
" -f <name> <value> field 'name' of 'event' has to match 'value'\n"
|
||||
" type of 'name' must be int\n"
|
||||
" (you can use several -f options)\n"
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int get_filter_arg(database_event_format *f, char *field, char *type)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < f->count; i++)
|
||||
if (!strcmp(f->name[i], field)) {
|
||||
if (strcmp(f->type[i], type)) break;
|
||||
return i;
|
||||
}
|
||||
printf("bad field %s, check that it exists and has type '%s'\n",field,type);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *database_filename = NULL;
|
||||
void *database;
|
||||
int i;
|
||||
int input_event_id;
|
||||
database_event_format f;
|
||||
char *file = NULL;
|
||||
char *output_file = NULL;
|
||||
FILE *out;
|
||||
int fd;
|
||||
char *event_name = NULL;
|
||||
char *buffer_name = NULL;
|
||||
char *filter[n];
|
||||
int filter_arg[n];
|
||||
int filter_value[n];
|
||||
int filter_count = 0;
|
||||
int buffer_arg;
|
||||
int found;
|
||||
|
||||
for (i = 1; i < n; i++) {
|
||||
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||
if (!strcmp(v[i], "-d"))
|
||||
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-o"))
|
||||
{ if (i > n-2) usage(); output_file = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-f")) { if (i>n-3) usage();
|
||||
filter[filter_count] = v[++i];
|
||||
filter_value[filter_count++] = atoi(v[++i]);
|
||||
continue;
|
||||
}
|
||||
if (file == NULL) { file = v[i]; continue; }
|
||||
if (event_name == NULL) { event_name = v[i]; continue; }
|
||||
if (buffer_name == NULL) { buffer_name = v[i]; continue; }
|
||||
usage();
|
||||
}
|
||||
if (file == NULL || event_name == NULL || buffer_name == NULL) usage();
|
||||
|
||||
if (database_filename == NULL) {
|
||||
printf("ERROR: provide a database file (-d)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (output_file == NULL) {
|
||||
printf("gimme -o <output file>, thanks\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
out = fopen(output_file, "w"); if(out==NULL){perror(output_file);exit(1);}
|
||||
|
||||
database = parse_database(database_filename);
|
||||
|
||||
load_config_file(database_filename);
|
||||
|
||||
input_event_id = event_id_from_name(database, event_name);
|
||||
f = get_format(database, input_event_id);
|
||||
|
||||
buffer_arg = get_filter_arg(&f, buffer_name, "buffer");
|
||||
|
||||
for (i = 0; i < filter_count; i++)
|
||||
filter_arg[i] = get_filter_arg(&f, filter[i], "int");
|
||||
|
||||
fd = open(file, O_RDONLY);
|
||||
if (fd == -1) { perror(file); exit(1); }
|
||||
|
||||
found = 0;
|
||||
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(fd, v, database);
|
||||
if (e.type == -1) break;
|
||||
if (e.type != input_event_id) continue;
|
||||
for (i = 0; i < filter_count; i++)
|
||||
if (filter_value[i] != e.e[filter_arg[i]].i)
|
||||
break;
|
||||
if (i != filter_count)
|
||||
continue;
|
||||
if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1)
|
||||
{ perror(output_file); exit(1); }
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (found == 0) printf("ERROR: event not found\n");
|
||||
|
||||
fclose(out);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -12,9 +12,7 @@ void usage(void)
|
||||
"usage: [options] <file> <frame> <subframe>\n"
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
" -o <output file> this option is mandatory\n"
|
||||
" -v verbose\n"
|
||||
" -c <number of subframes> default to 1\n"
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
@@ -27,23 +25,15 @@ int main(int n, char **v)
|
||||
int input_event_id;
|
||||
database_event_format f;
|
||||
char *file = NULL;
|
||||
char *output_file = NULL;
|
||||
FILE *out;
|
||||
int fd;
|
||||
int frame = -1, subframe = -1;
|
||||
int frame_arg, subframe_arg, buffer_arg;
|
||||
int verbose = 0;
|
||||
int number_of_subframes = 1;
|
||||
int processed_subframes = 0;
|
||||
|
||||
for (i = 1; i < n; i++) {
|
||||
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||
if (!strcmp(v[i], "-d"))
|
||||
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-o"))
|
||||
{ if (i > n-2) usage(); output_file = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-c"))
|
||||
{ if (i > n-2) usage(); number_of_subframes = atoi(v[++i]); continue; }
|
||||
if (!strcmp(v[i], "-v")) { verbose = 1; continue; }
|
||||
if (file == NULL) { file = v[i]; continue; }
|
||||
if (frame == -1) { frame = atoi(v[i]); continue; }
|
||||
@@ -57,19 +47,6 @@ int main(int n, char **v)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (number_of_subframes < 1) {
|
||||
printf("bad value for option -c, must be at least 1 and is %d\n",
|
||||
number_of_subframes);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (output_file == NULL) {
|
||||
printf("gimme -o <output file>, thanks\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
out = fopen(output_file, "w"); if(out==NULL){perror(output_file);exit(1);}
|
||||
|
||||
database = parse_database(database_filename);
|
||||
|
||||
load_config_file(database_filename);
|
||||
@@ -122,22 +99,11 @@ 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++;
|
||||
number_of_subframes--;
|
||||
if (!number_of_subframes) {
|
||||
if (fclose(out)) perror(output_file);
|
||||
printf("%d subframes dumped\n", processed_subframes);
|
||||
return 0;
|
||||
}
|
||||
subframe++;
|
||||
if (subframe == 10) { subframe = 0; frame=(frame+1)%1024; }
|
||||
fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, stdout);
|
||||
fflush(stdout);
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("frame %d subframe %d not found\n", frame, subframe);
|
||||
printf("%d subframes dumped\n", processed_subframes);
|
||||
fclose(out);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,158 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include "database.h"
|
||||
#include "event.h"
|
||||
#include "config.h"
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
printf(
|
||||
"usage: [options] <file> <frame> <subframe> <number of subframes>\n"
|
||||
" the program dumps 'number of subframes' subframes starting\n"
|
||||
" at 'frame:suubframe'\n"
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
" -o <output file> output to file (default: stdout)\n"
|
||||
" -v verbose\n"
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *database_filename = NULL;
|
||||
void *database;
|
||||
int i;
|
||||
int output_event_id;
|
||||
database_event_format f;
|
||||
char *file = NULL;
|
||||
int fd;
|
||||
int frame = -1, subframe = -1;
|
||||
int number_of_subframes = -1;
|
||||
int frame_arg, subframe_arg, buffer_arg;
|
||||
int verbose = 0;
|
||||
char *out_filename = NULL;
|
||||
FILE *out;
|
||||
|
||||
for (i = 1; i < n; i++) {
|
||||
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||
if (!strcmp(v[i], "-d"))
|
||||
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-o"))
|
||||
{ if (i > n-2) usage(); out_filename = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-v")) { verbose = 1; continue; }
|
||||
if (file == NULL) { file = v[i]; continue; }
|
||||
if (frame == -1) { frame = atoi(v[i]); continue; }
|
||||
if (subframe == -1) { subframe = atoi(v[i]); continue; }
|
||||
if (number_of_subframes == -1) {number_of_subframes=atoi(v[i]);continue;}
|
||||
usage();
|
||||
}
|
||||
if (file == NULL || frame == -1 || subframe == -1 ||
|
||||
number_of_subframes == -1) usage();
|
||||
|
||||
if (database_filename == NULL) {
|
||||
printf("ERROR: provide a database file (-d)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (out_filename == NULL) out = stdout;
|
||||
else {
|
||||
out = fopen(out_filename, "w");
|
||||
if (out == NULL) { perror(out_filename); exit(1); }
|
||||
}
|
||||
|
||||
database = parse_database(database_filename);
|
||||
|
||||
load_config_file(database_filename);
|
||||
|
||||
output_event_id = event_id_from_name(database, "ENB_PHY_OUTPUT_SIGNAL");
|
||||
f = get_format(database, output_event_id);
|
||||
|
||||
frame_arg = subframe_arg = buffer_arg = -1;
|
||||
for (i = 0; i < f.count; i++) {
|
||||
if (!strcmp(f.name[i], "frame")) {
|
||||
if (frame_arg != -1) goto err;
|
||||
if (strcmp(f.type[i], "int")) goto err;
|
||||
frame_arg = i;
|
||||
}
|
||||
if (!strcmp(f.name[i], "subframe")) {
|
||||
if (subframe_arg != -1) goto err;
|
||||
if (strcmp(f.type[i], "int")) goto err;
|
||||
subframe_arg = i;
|
||||
}
|
||||
if (!strcmp(f.name[i], "txdata")) {
|
||||
if (buffer_arg != -1) goto err;
|
||||
if (strcmp(f.type[i], "buffer")) goto err;
|
||||
buffer_arg = i;
|
||||
}
|
||||
continue;
|
||||
err:
|
||||
printf("cannot deal with ENB_PHY_OUTPUT_SIGNAL from database file\n");
|
||||
exit(1);
|
||||
}
|
||||
if (frame_arg == -1 || subframe_arg == -1 || buffer_arg == -1) goto err;
|
||||
|
||||
fd = open(file, O_RDONLY);
|
||||
if (fd == -1) { perror(file); exit(1); }
|
||||
|
||||
int last_frame = -1;
|
||||
int last_subframe = -1;
|
||||
int subframe_written = 0;
|
||||
while (1) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(fd, v, database);
|
||||
if (e.type == -1) break;
|
||||
if (e.type != output_event_id) continue;
|
||||
if (verbose)
|
||||
printf("found output frame %d subframe %d size %d\n",
|
||||
e.e[frame_arg].i, e.e[subframe_arg].i, e.e[buffer_arg].bsize);
|
||||
if (!(last_frame != -1 ||
|
||||
(frame == e.e[frame_arg].i && subframe == e.e[subframe_arg].i)))
|
||||
continue;
|
||||
frame = e.e[frame_arg].i;
|
||||
subframe = e.e[subframe_arg].i;
|
||||
if (last_frame != -1) {
|
||||
if (frame*10+subframe != (last_frame*10+last_subframe + 1) % 10240) {
|
||||
printf("error: discontinuity, not what you want...\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
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);
|
||||
if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1) {
|
||||
perror(out_filename);
|
||||
exit(1);
|
||||
}
|
||||
subframe_written++;
|
||||
if (subframe_written != number_of_subframes)
|
||||
continue;
|
||||
|
||||
/* done */
|
||||
fflush(out);
|
||||
if (out_filename != NULL) {
|
||||
if (fclose(out)) perror(out_filename);
|
||||
}
|
||||
if (verbose)
|
||||
printf("%d subframes written\n", subframe_written);
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("error with input file, %d subframe written\n", subframe_written);
|
||||
fflush(out);
|
||||
if (out_filename != NULL) {
|
||||
if (fclose(out)) perror(out_filename);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -10,8 +10,6 @@ struct filter {
|
||||
struct { struct filter *a, *b; } op2;
|
||||
int v;
|
||||
struct { int event_type; int arg_index; } evarg;
|
||||
struct { int (*fun)(void *priv, int v); void *priv;
|
||||
struct filter *x; } evfun;
|
||||
} v;
|
||||
|
||||
int (*eval)(struct filter *this, event e);
|
||||
@@ -54,11 +52,6 @@ int eval_evarg(struct filter *f, event e)
|
||||
return e.e[f->v.evarg.arg_index].i;
|
||||
}
|
||||
|
||||
int eval_evfun(struct filter *f, event e)
|
||||
{
|
||||
return f->v.evfun.fun(f->v.evfun.priv, f->v.evfun.x->eval(f->v.evfun.x, e));
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* free memory functions */
|
||||
/****************************************************************************/
|
||||
@@ -70,12 +63,6 @@ void free_op2(struct filter *f)
|
||||
free(f);
|
||||
}
|
||||
|
||||
void free_evfun(struct filter *f)
|
||||
{
|
||||
free_filter(f->v.evfun.x);
|
||||
free(f);
|
||||
}
|
||||
|
||||
void free_noop(struct filter *f)
|
||||
{
|
||||
free(f);
|
||||
@@ -148,19 +135,6 @@ filter *filter_evarg(void *database, char *event_name, char *varname)
|
||||
return ret;
|
||||
}
|
||||
|
||||
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
|
||||
void *priv, filter *x)
|
||||
{
|
||||
struct filter *ret = calloc(1, sizeof(struct filter));
|
||||
if (ret == NULL) abort();
|
||||
ret->eval = eval_evfun;
|
||||
ret->free = free_evfun;
|
||||
ret->v.evfun.fun = fun;
|
||||
ret->v.evfun.priv = priv;
|
||||
ret->v.evfun.x = x;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void free_filter(filter *_f)
|
||||
{
|
||||
struct filter *f;
|
||||
|
||||
@@ -9,8 +9,6 @@ filter *filter_and(filter *a, filter *b);
|
||||
filter *filter_eq(filter *a, filter *b);
|
||||
filter *filter_int(int v);
|
||||
filter *filter_evarg(void *database, char *event_name, char *varname);
|
||||
filter *filter_evfun(void *database, int (*fun)(void *priv, int v),
|
||||
void *priv, filter *x);
|
||||
|
||||
int filter_eval(filter *f, event e);
|
||||
|
||||
|
||||
@@ -1,302 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include "database.h"
|
||||
#include "utils.h"
|
||||
#include "handler.h"
|
||||
#include "config.h"
|
||||
#include "logger/logger.h"
|
||||
#include "view/view.h"
|
||||
|
||||
typedef struct {
|
||||
char *event;
|
||||
char *arg;
|
||||
char *vcd_name;
|
||||
int boolean;
|
||||
} vcd_vars;
|
||||
|
||||
/****************************************************************************/
|
||||
/* VCD file handling begin */
|
||||
/****************************************************************************/
|
||||
|
||||
FILE *out;
|
||||
|
||||
uint64_t start_time;
|
||||
int start_time_inited;
|
||||
|
||||
void vcd_init(char *file)
|
||||
{
|
||||
out = fopen(file, "w"); if (out == NULL) { perror(file); exit(1); }
|
||||
}
|
||||
|
||||
void vcd_write_header(vcd_vars *v, int n)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (fprintf(out,
|
||||
"$date\n"
|
||||
" January, 1, 1970.\n"
|
||||
"$end\n"
|
||||
"$version\n"
|
||||
" to_vcd\n"
|
||||
"$end\n"
|
||||
"$timescale 1ns $end\n"
|
||||
"$scope module logic $end\n") <= 0) abort();
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (fprintf(out, "$var wire %d %s %s $end\n",
|
||||
v[i].boolean ? 1 : 64,
|
||||
v[i].vcd_name, v[i].vcd_name) <= 0) abort();
|
||||
|
||||
if (fprintf(out,
|
||||
"$upscope $end\n"
|
||||
"$enddefinitions $end\n"
|
||||
"$dumpvars\n") <= 0) abort();
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
if (v[i].boolean) {
|
||||
if (fprintf(out, "0%s\n", v[i].vcd_name) <= 0) abort();
|
||||
} else {
|
||||
if (fprintf(out, "b0 %s\n", v[i].vcd_name) <= 0) abort();
|
||||
}
|
||||
|
||||
if (fprintf(out,
|
||||
"$end\n") <= 0) abort();
|
||||
|
||||
}
|
||||
|
||||
void vcd_end(void)
|
||||
{
|
||||
if (fclose(out)) { perror("error closing VCD file"); exit(1); }
|
||||
}
|
||||
|
||||
char *b64(uint64_t val)
|
||||
{
|
||||
static char v[65];
|
||||
char *s = &v[64];
|
||||
*s = 0;
|
||||
if (val == 0) { s--; *s = '0'; return s; }
|
||||
while (val) {
|
||||
s--;
|
||||
*s = val&1 ? '1' : '0';
|
||||
val >>= 1;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
void vcd_dump(char *v)
|
||||
{
|
||||
uint64_t h, m, s, ns;
|
||||
char t;
|
||||
uint64_t val;
|
||||
uint64_t time;
|
||||
char var[256];
|
||||
if (sscanf(v, "%"SCNu64":%"SCNu64":%"SCNu64".%"SCNu64": %c %"SCNu64" %s",
|
||||
&h, &m, &s, &ns, &t, &val, var) != 7)
|
||||
goto err;
|
||||
time = h*60*60*1000000000 +
|
||||
m*60*1000000000 +
|
||||
s*1000000000 +
|
||||
ns;
|
||||
if (!start_time_inited) {
|
||||
start_time = time;
|
||||
start_time_inited = 1;
|
||||
}
|
||||
if (fprintf(out, "#%"PRIu64"\n", time - start_time) <= 0) abort();
|
||||
switch (t) {
|
||||
case 'b': if (fprintf(out, "%d%s\n", val!=0, var) <= 0) abort(); break;
|
||||
case 'l': if (fprintf(out, "b%s %s\n", b64(val), var) <= 0) abort(); break;
|
||||
default: goto err;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
printf("bad vcd_dump line '%s'\n", v);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* VCD file handling end */
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
/* vcd view start */
|
||||
/****************************************************************************/
|
||||
|
||||
struct vcd_view {
|
||||
view common;
|
||||
};
|
||||
|
||||
static void vcd_view_clear(view *this)
|
||||
{
|
||||
/* nothing */
|
||||
}
|
||||
|
||||
static void vcd_view_append(view *_this, char *s)
|
||||
{
|
||||
vcd_dump(s);
|
||||
}
|
||||
|
||||
static view *new_view_vcd(void)
|
||||
{
|
||||
struct vcd_view *ret = calloc(1, sizeof(struct vcd_view));
|
||||
if (ret == NULL) abort();
|
||||
ret->common.clear = vcd_view_clear;
|
||||
ret->common.append = (void (*)(view *, ...))vcd_view_append;
|
||||
return (view *)ret;
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* vcd view end */
|
||||
/****************************************************************************/
|
||||
|
||||
void activate_traces(int socket, int number_of_events, int *is_on)
|
||||
{
|
||||
char t = 1;
|
||||
if (socket_send(socket, &t, 1) == -1 ||
|
||||
socket_send(socket, &number_of_events, sizeof(int)) == -1 ||
|
||||
socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
|
||||
abort();
|
||||
}
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
printf(
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
" -o <output file> this option is mandatory\n"
|
||||
" -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",
|
||||
DEFAULT_REMOTE_IP,
|
||||
DEFAULT_REMOTE_PORT
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int run = 1;
|
||||
static int socket = -1;
|
||||
|
||||
void force_stop(int x)
|
||||
{
|
||||
printf("\ngently quit...\n");
|
||||
close(socket);
|
||||
socket = -1;
|
||||
run = 0;
|
||||
}
|
||||
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *output_filename = NULL;
|
||||
char *database_filename = NULL;
|
||||
void *database;
|
||||
char *ip = DEFAULT_REMOTE_IP;
|
||||
int port = DEFAULT_REMOTE_PORT;
|
||||
int *is_on;
|
||||
int number_of_events;
|
||||
int i;
|
||||
vcd_vars vars[n];
|
||||
int nvars = 0;
|
||||
view *vcd_view;
|
||||
event_handler *h;
|
||||
logger *textlog;
|
||||
|
||||
/* write on a socket fails if the other end is closed and we get SIGPIPE */
|
||||
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
|
||||
|
||||
for (i = 1; i < n; i++) {
|
||||
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
|
||||
if (!strcmp(v[i], "-d"))
|
||||
{ if (i > n-2) usage(); database_filename = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-o"))
|
||||
{ if (i > n-2) usage(); output_filename = v[++i]; continue; }
|
||||
if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
|
||||
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;
|
||||
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;
|
||||
continue;
|
||||
}
|
||||
usage();
|
||||
}
|
||||
|
||||
if (output_filename == NULL) {
|
||||
printf("ERROR; provide an output file (-o)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (database_filename == NULL) {
|
||||
printf("ERROR: provide a database file (-d)\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
database = parse_database(database_filename);
|
||||
|
||||
load_config_file(database_filename);
|
||||
|
||||
number_of_events = number_of_ids(database);
|
||||
is_on = calloc(number_of_events, sizeof(int));
|
||||
if (is_on == NULL) abort();
|
||||
|
||||
h = new_handler(database);
|
||||
|
||||
/* create the view */
|
||||
vcd_view = new_view_vcd();
|
||||
|
||||
/* 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();
|
||||
sprintf(format, "%c [%s] %s",
|
||||
vars[i].boolean ? 'b' : 'l',
|
||||
vars[i].arg,
|
||||
vars[i].vcd_name);
|
||||
textlog = new_textlog(h, database, vars[i].event, format);
|
||||
logger_add_view(textlog, vcd_view);
|
||||
on_off(database, vars[i].event, is_on, 1);
|
||||
}
|
||||
|
||||
socket = connect_to(ip, port);
|
||||
|
||||
/* activate selected traces */
|
||||
activate_traces(socket, number_of_events, is_on);
|
||||
|
||||
vcd_init(output_filename);
|
||||
vcd_write_header(vars, nvars);
|
||||
|
||||
/* exit on ctrl+c and ctrl+z */
|
||||
if (signal(SIGQUIT, force_stop) == SIG_ERR) abort();
|
||||
if (signal(SIGINT, force_stop) == SIG_ERR) abort();
|
||||
if (signal(SIGTSTP, force_stop) == SIG_ERR) abort();
|
||||
|
||||
/* read messages */
|
||||
while (run) {
|
||||
char v[T_BUFFER_MAX];
|
||||
event e;
|
||||
e = get_event(socket, v, database);
|
||||
if (e.type == -1) { printf("disconnected? let's quit gently\n"); break; }
|
||||
handle_event(h, e);
|
||||
}
|
||||
|
||||
vcd_end();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -31,6 +31,10 @@
|
||||
#include <sys/epoll.h>
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
#ifdef RTAI
|
||||
# include <rtai_shm.h>
|
||||
#endif
|
||||
|
||||
#if !defined(TRUE)
|
||||
#define TRUE 1
|
||||
#endif
|
||||
@@ -41,6 +45,11 @@
|
||||
#include "intertask_interface.h"
|
||||
#include "intertask_interface_dump.h"
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
# include "memory_pools.h"
|
||||
# include "vcd_signal_dumper.h"
|
||||
#endif
|
||||
|
||||
#if T_TRACER
|
||||
#include "T.h"
|
||||
#endif
|
||||
@@ -55,6 +64,14 @@
|
||||
#include "signals.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifdef RTAI
|
||||
# include <rtai.h>
|
||||
# include <rtai_fifos.h>
|
||||
# define FIFO_PRINTF_MAX_STRING_SIZE 1000
|
||||
# define FIFO_PRINTF_NO 62
|
||||
# define FIFO_PRINTF_SIZE 65536
|
||||
#endif
|
||||
|
||||
/* ITTI DEBUG groups */
|
||||
#define ITTI_DEBUG_POLL (1<<0)
|
||||
#define ITTI_DEBUG_SEND (1<<1)
|
||||
@@ -66,14 +83,21 @@
|
||||
|
||||
const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS);
|
||||
|
||||
/* Don't flush if using RTAI */
|
||||
#ifdef RTAI
|
||||
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) rt_log_debug (x, ##args); } while(0);
|
||||
#else
|
||||
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) {fprintf(stdout, "[ITTI][D]"x, ##args); fflush (stdout);} } while(0);
|
||||
#endif
|
||||
#define ITTI_ERROR(x, args...) do { fprintf(stdout, "[ITTI][E]"x, ##args); fflush (stdout); } while(0);
|
||||
|
||||
/* Global message size */
|
||||
#define MESSAGE_SIZE(mESSAGEiD) (sizeof(MessageHeader) + itti_desc.messages_info[mESSAGEiD].size)
|
||||
|
||||
|
||||
extern int emulate_rf;
|
||||
#ifdef RTAI
|
||||
# define ITTI_MEM_PAGE_SIZE (1024)
|
||||
# define ITTI_MEM_SIZE (16 * 1024 * 1024)
|
||||
#endif
|
||||
|
||||
typedef enum task_state_s {
|
||||
TASK_STATE_NOT_CONFIGURED, TASK_STATE_STARTING, TASK_STATE_READY, TASK_STATE_ENDED, TASK_STATE_MAX,
|
||||
@@ -113,11 +137,13 @@ typedef struct thread_desc_s {
|
||||
|
||||
int epoll_nb_events;
|
||||
|
||||
//#ifdef RTAI
|
||||
/* Flag to mark real time thread */
|
||||
unsigned real_time;
|
||||
|
||||
/* Counter to indicate that messages are pending for the thread */
|
||||
/* Counter to indicate from RTAI threads that messages are pending for the thread */
|
||||
unsigned messages_pending;
|
||||
//#endif
|
||||
} thread_desc_t;
|
||||
|
||||
typedef struct task_desc_s {
|
||||
@@ -149,6 +175,17 @@ typedef struct itti_desc_s {
|
||||
volatile uint32_t created_tasks;
|
||||
volatile uint32_t ready_tasks;
|
||||
volatile int wait_tasks;
|
||||
#ifdef RTAI
|
||||
pthread_t rt_relay_thread;
|
||||
#endif
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
memory_pools_handle_t memory_pools_handle;
|
||||
|
||||
uint64_t vcd_poll_msg;
|
||||
uint64_t vcd_receive_msg;
|
||||
uint64_t vcd_send_msg;
|
||||
#endif
|
||||
} itti_desc_t;
|
||||
|
||||
static itti_desc_t itti_desc;
|
||||
@@ -157,8 +194,19 @@ void *itti_malloc(task_id_t origin_task_id, task_id_t destination_task_id, ssize
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
ptr = memory_pools_allocate (itti_desc.memory_pools_handle, size, origin_task_id, destination_task_id);
|
||||
|
||||
if (ptr == NULL) {
|
||||
char *statistics = memory_pools_statistics (itti_desc.memory_pools_handle);
|
||||
|
||||
ITTI_ERROR (" Memory pools statistics:\n%s", statistics);
|
||||
free (statistics);
|
||||
}
|
||||
|
||||
#else
|
||||
ptr = malloc (size);
|
||||
if (ptr) memset(ptr,0,size);
|
||||
#endif
|
||||
|
||||
AssertFatal (ptr != NULL, "Memory allocation of %d bytes failed (%d -> %d)!\n", (int) size, origin_task_id, destination_task_id);
|
||||
|
||||
@@ -170,7 +218,13 @@ int itti_free(task_id_t task_id, void *ptr)
|
||||
int result = EXIT_SUCCESS;
|
||||
AssertFatal (ptr != NULL, "Trying to free a NULL pointer (%d)!\n", task_id);
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
result = memory_pools_free (itti_desc.memory_pools_handle, ptr, task_id);
|
||||
|
||||
AssertError (result == EXIT_SUCCESS, {}, "Failed to free memory at %p (%d)!\n", ptr, task_id);
|
||||
#else
|
||||
free (ptr);
|
||||
#endif
|
||||
|
||||
return (result);
|
||||
}
|
||||
@@ -226,6 +280,27 @@ static task_id_t itti_get_current_task_id(void)
|
||||
return TASK_UNKNOWN;
|
||||
}
|
||||
|
||||
#ifdef RTAI
|
||||
static void rt_log_debug(char *format, ...)
|
||||
{
|
||||
task_id_t task_id;
|
||||
va_list args;
|
||||
char log_buffer[FIFO_PRINTF_MAX_STRING_SIZE];
|
||||
int len;
|
||||
|
||||
task_id = itti_get_current_task_id ();
|
||||
len = snprintf(log_buffer, FIFO_PRINTF_MAX_STRING_SIZE-1, "[ITTI][D][%s]", itti_get_task_name(task_id));
|
||||
va_start(args, format);
|
||||
len += vsnprintf(&log_buffer[len], FIFO_PRINTF_MAX_STRING_SIZE-1-len, format, args);
|
||||
va_end (args);
|
||||
|
||||
if (task_id != TASK_UNKNOWN)
|
||||
fwrite(log_buffer, len, 1, stdout);
|
||||
else
|
||||
rtf_put (FIFO_PRINTF_NO, log_buffer, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
void itti_update_lte_time(uint32_t frame, uint8_t slot)
|
||||
{
|
||||
itti_desc.lte_time.frame = frame;
|
||||
@@ -282,6 +357,10 @@ MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, MessagesIds m
|
||||
|
||||
AssertFatal (message_id < itti_desc.messages_id_max, "Message id (%d) is out of range (%d)!\n", message_id, itti_desc.messages_id_max);
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_ALLOC_MSG, size);
|
||||
#endif
|
||||
|
||||
if (origin_task_id == TASK_UNKNOWN) {
|
||||
/* Try to identify real origin task ID */
|
||||
origin_task_id = itti_get_current_task_id();
|
||||
@@ -293,6 +372,10 @@ MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, MessagesIds m
|
||||
temp->ittiMsgHeader.originTaskId = origin_task_id;
|
||||
temp->ittiMsgHeader.ittiMsgSize = size;
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_ALLOC_MSG, 0);
|
||||
#endif
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
@@ -310,107 +393,11 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
|
||||
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 0
|
||||
/* itti dump is disabled */
|
||||
itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name,
|
||||
sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize);
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,
|
||||
__sync_or_and_fetch (&itti_desc.vcd_send_msg, 1L << destination_task_id));
|
||||
#endif
|
||||
|
||||
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",
|
||||
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);
|
||||
|
||||
@@ -429,13 +416,15 @@ int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance
|
||||
/* Increment the global message number */
|
||||
message_number = itti_increment_message_number ();
|
||||
|
||||
#if 0
|
||||
/* itti dump is disabled */
|
||||
itti_dump_queue_message (origin_task_id, message_number, message, itti_desc.messages_info[message_id].name,
|
||||
sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize);
|
||||
#endif
|
||||
|
||||
if (destination_task_id != TASK_UNKNOWN) {
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
|
||||
|
||||
memory_pools_set_info (itti_desc.memory_pools_handle, message, 1, destination_task_id);
|
||||
#endif
|
||||
|
||||
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",
|
||||
@@ -465,10 +454,20 @@ int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance
|
||||
|
||||
/* Enqueue message in destination task queue */
|
||||
if (lfds611_queue_enqueue(itti_desc.tasks[destination_task_id].message_queue, new) == 0) {
|
||||
itti_free(origin_task_id, new);
|
||||
return -1;
|
||||
AssertFatal(0, "Error: lfds611_queue_enqueue returns 0, queue is full, exiting\n");
|
||||
}
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
|
||||
#endif
|
||||
|
||||
#ifdef RTAI
|
||||
|
||||
if (itti_desc.threads[TASK_GET_THREAD_ID(origin_task_id)].real_time) {
|
||||
/* This is a RT task, increase destination task messages pending counter */
|
||||
__sync_fetch_and_add (&itti_desc.threads[destination_thread_id].messages_pending, 1);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* Only use event fd for tasks, subtasks will pool the queue */
|
||||
if (TASK_GET_PARENT_TASK_ID(destination_task_id) == TASK_UNKNOWN) {
|
||||
@@ -496,6 +495,11 @@ int itti_try_send_msg_to_task(task_id_t destination_task_id, instance_t instance
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,
|
||||
__sync_and_and_fetch (&itti_desc.vcd_send_msg, ~(1L << destination_task_id)));
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -618,6 +622,7 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t
|
||||
read_ret = read (itti_desc.threads[thread_id].task_event_fd, &sem_counter, sizeof(sem_counter));
|
||||
AssertFatal (read_ret == sizeof(sem_counter), "Read from task message FD (%d) failed (%d/%d)!\n", thread_id, (int) read_ret, (int) sizeof(sem_counter));
|
||||
|
||||
|
||||
if (lfds611_queue_dequeue (itti_desc.tasks[task_id].message_queue, (void **) &message) == 0) {
|
||||
/* No element in list -> this should not happen */
|
||||
AssertFatal (0, "No message in queue for task %d while there are %d events and some for the messages queue!\n", task_id, epoll_ret);
|
||||
@@ -625,12 +630,9 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t
|
||||
|
||||
AssertFatal(message != NULL, "Message from message queue is NULL!\n");
|
||||
*received_msg = message->msg;
|
||||
|
||||
|
||||
result = itti_free (ITTI_MSG_ORIGIN_ID(*received_msg), message);
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
|
||||
|
||||
/* Mark that the event has been processed */
|
||||
itti_desc.threads[thread_id].events[i].events &= ~EPOLLIN;
|
||||
return;
|
||||
@@ -640,9 +642,17 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t
|
||||
|
||||
void itti_receive_msg(task_id_t task_id, MessageDef **received_msg)
|
||||
{
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
|
||||
__sync_and_and_fetch (&itti_desc.vcd_receive_msg, ~(1L << task_id)));
|
||||
#endif
|
||||
|
||||
itti_receive_msg_internal_event_fd(task_id, 0, received_msg);
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
|
||||
__sync_or_and_fetch (&itti_desc.vcd_receive_msg, 1L << task_id));
|
||||
#endif
|
||||
}
|
||||
|
||||
void itti_poll_msg(task_id_t task_id, MessageDef **received_msg)
|
||||
@@ -651,6 +661,11 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg)
|
||||
|
||||
*received_msg = NULL;
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG,
|
||||
__sync_or_and_fetch (&itti_desc.vcd_poll_msg, 1L << task_id));
|
||||
#endif
|
||||
|
||||
{
|
||||
struct message_list_s *message;
|
||||
|
||||
@@ -667,6 +682,10 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg)
|
||||
ITTI_DEBUG(ITTI_DEBUG_POLL, " No message in queue[(%u:%s)]\n", task_id, itti_get_task_name(task_id));
|
||||
}
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG,
|
||||
__sync_and_and_fetch (&itti_desc.vcd_poll_msg, ~(1L << task_id)));
|
||||
#endif
|
||||
}
|
||||
|
||||
int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *args_p)
|
||||
@@ -698,6 +717,7 @@ int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *ar
|
||||
return 0;
|
||||
}
|
||||
|
||||
//#ifdef RTAI
|
||||
void itti_set_task_real_time(task_id_t task_id)
|
||||
{
|
||||
thread_id_t thread_id = TASK_GET_THREAD_ID(task_id);
|
||||
@@ -706,6 +726,7 @@ void itti_set_task_real_time(task_id_t task_id)
|
||||
|
||||
itti_desc.threads[thread_id].real_time = TRUE;
|
||||
}
|
||||
//#endif
|
||||
|
||||
void itti_wait_ready(int wait_tasks)
|
||||
{
|
||||
@@ -727,15 +748,21 @@ 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);
|
||||
|
||||
#if 0
|
||||
/* itti dump is disabled */
|
||||
/* Register the thread in itti dump */
|
||||
itti_dump_thread_use_ring_buffer();
|
||||
#endif
|
||||
|
||||
/* Mark the thread as using LFDS queue */
|
||||
lfds611_queue_use(itti_desc.tasks[task_id].message_queue);
|
||||
|
||||
#ifdef 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 ++;
|
||||
|
||||
@@ -748,19 +775,15 @@ void itti_mark_task_ready(task_id_t task_id)
|
||||
|
||||
void itti_exit_task(void)
|
||||
{
|
||||
task_id_t task_id = itti_get_current_task_id();
|
||||
thread_id_t thread_id = TASK_GET_THREAD_ID(task_id);
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
task_id_t task_id = itti_get_current_task_id();
|
||||
|
||||
if (task_id > TASK_UNKNOWN) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
|
||||
__sync_and_and_fetch (&itti_desc.vcd_receive_msg, ~(1L << task_id)));
|
||||
}
|
||||
#endif
|
||||
|
||||
itti_desc.threads[thread_id].task_state = TASK_STATE_NOT_CONFIGURED;
|
||||
itti_desc.created_tasks--;
|
||||
ITTI_DEBUG(ITTI_DEBUG_EXIT, "Thread for task %s (%d) exits\n", itti_get_task_name(task_id), task_id);
|
||||
#endif
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
@@ -776,6 +799,45 @@ void itti_terminate_tasks(task_id_t task_id)
|
||||
pthread_exit (NULL);
|
||||
}
|
||||
|
||||
#ifdef RTAI
|
||||
static void *itti_rt_relay_thread(void *arg)
|
||||
{
|
||||
thread_id_t thread_id;
|
||||
unsigned pending_messages;
|
||||
|
||||
while (itti_desc.running) {
|
||||
usleep (200); // Poll for messages a little more than 2 time by slot to get a small latency between RT and other tasks
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD, VCD_FUNCTION_IN);
|
||||
#endif
|
||||
|
||||
/* Checks for all non real time tasks if they have pending messages */
|
||||
for (thread_id = THREAD_FIRST; thread_id < itti_desc.thread_max; thread_id++) {
|
||||
if ((itti_desc.threads[thread_id].task_state == TASK_STATE_READY)
|
||||
&& (itti_desc.threads[thread_id].real_time == FALSE)) {
|
||||
pending_messages = __sync_fetch_and_and (&itti_desc.threads[thread_id].messages_pending, 0);
|
||||
|
||||
if (pending_messages > 0) {
|
||||
ssize_t write_ret;
|
||||
eventfd_t sem_counter = pending_messages;
|
||||
|
||||
/* Call to write for an event fd must be of 8 bytes */
|
||||
write_ret = write (itti_desc.threads[thread_id].task_event_fd, &sem_counter, sizeof(sem_counter));
|
||||
DevCheck(write_ret == sizeof(sem_counter), write_ret, sem_counter, thread_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD, VCD_FUNCTION_OUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -856,17 +918,47 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i
|
||||
ITTI_DEBUG(ITTI_DEBUG_EVEN_FD, " Successfully subscribed fd %d for thread %d\n",
|
||||
itti_desc.threads[thread_id].task_event_fd, thread_id);
|
||||
|
||||
#ifdef RTAI
|
||||
itti_desc.threads[thread_id].real_time = FALSE;
|
||||
itti_desc.threads[thread_id].messages_pending = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
itti_desc.running = 1;
|
||||
itti_desc.wait_tasks = 0;
|
||||
itti_desc.created_tasks = 0;
|
||||
itti_desc.ready_tasks = 0;
|
||||
#if 0
|
||||
/* itti dump is disabled */
|
||||
itti_dump_init (messages_definition_xml, dump_file_name);
|
||||
#ifdef RTAI
|
||||
/* Start RT relay thread */
|
||||
DevAssert(pthread_create (&itti_desc.rt_relay_thread, NULL, itti_rt_relay_thread, NULL) >= 0);
|
||||
|
||||
rt_global_heap_open();
|
||||
#endif
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
itti_desc.memory_pools_handle = memory_pools_create (5);
|
||||
memory_pools_add_pool (itti_desc.memory_pools_handle, 1000 + ITTI_QUEUE_MAX_ELEMENTS, 50);
|
||||
memory_pools_add_pool (itti_desc.memory_pools_handle, 1000 + (2 * ITTI_QUEUE_MAX_ELEMENTS), 100);
|
||||
memory_pools_add_pool (itti_desc.memory_pools_handle, 10000, 1000);
|
||||
memory_pools_add_pool (itti_desc.memory_pools_handle, 400, 20050);
|
||||
memory_pools_add_pool (itti_desc.memory_pools_handle, 100, 30050);
|
||||
|
||||
{
|
||||
char *statistics = memory_pools_statistics (itti_desc.memory_pools_handle);
|
||||
|
||||
ITTI_DEBUG(ITTI_DEBUG_MP_STATISTICS, " Memory pools statistics:\n%s", statistics);
|
||||
free (statistics);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
itti_desc.vcd_poll_msg = 0;
|
||||
itti_desc.vcd_receive_msg = 0;
|
||||
itti_desc.vcd_send_msg = 0;
|
||||
#endif
|
||||
|
||||
itti_dump_init (messages_definition_xml, dump_file_name);
|
||||
|
||||
CHECK_INIT_RETURN(timer_init ());
|
||||
|
||||
return 0;
|
||||
@@ -927,15 +1019,21 @@ void itti_wait_tasks_end(void)
|
||||
|
||||
itti_desc.running = 0;
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
{
|
||||
char *statistics = memory_pools_statistics (itti_desc.memory_pools_handle);
|
||||
|
||||
ITTI_DEBUG(ITTI_DEBUG_MP_STATISTICS, " Memory pools statistics:\n%s", statistics);
|
||||
free (statistics);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ready_tasks > 0) {
|
||||
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Some threads are still running, force exit\n");
|
||||
exit (0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* itti dump is disabled */
|
||||
itti_dump_exit();
|
||||
#endif
|
||||
}
|
||||
|
||||
void itti_send_terminate_message(task_id_t task_id)
|
||||
|
||||
@@ -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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -27,6 +27,10 @@
|
||||
|
||||
#include <sys/epoll.h>
|
||||
|
||||
#ifdef RTAI
|
||||
# include <rtai_sem.h>
|
||||
#endif
|
||||
|
||||
#ifndef INTERTASK_INTERFACE_H_
|
||||
#define INTERTASK_INTERFACE_H_
|
||||
|
||||
@@ -108,18 +112,6 @@ 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
|
||||
@@ -163,10 +155,12 @@ int itti_create_task(task_id_t task_id,
|
||||
void *(*start_routine) (void *),
|
||||
void *args_p);
|
||||
|
||||
//#ifdef RTAI
|
||||
/** \brief Mark the task as a real time task
|
||||
* \param task_id task to mark as real time
|
||||
**/
|
||||
void itti_set_task_real_time(task_id_t task_id);
|
||||
//#endif
|
||||
|
||||
/** \brief Indicates to ITTI if newly created tasks should wait for all tasks to be ready
|
||||
* \param wait_tasks non 0 to make new created tasks to wait, 0 to let created tasks to run
|
||||
|
||||
@@ -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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -51,14 +51,23 @@
|
||||
#include "intertask_interface.h"
|
||||
#include "intertask_interface_dump.h"
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
#include "vcd_signal_dumper.h"
|
||||
#endif
|
||||
|
||||
#if T_TRACER
|
||||
#include "T.h"
|
||||
#endif
|
||||
|
||||
static const int itti_dump_debug = 0; // 0x8 | 0x4 | 0x2;
|
||||
|
||||
#ifdef RTAI
|
||||
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) rt_printk("[ITTI_DUMP][D]"x, ##args); } \
|
||||
while(0)
|
||||
#else
|
||||
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) fprintf(stdout, "[ITTI_DUMP][D]"x, ##args); } \
|
||||
while(0)
|
||||
#endif
|
||||
#define ITTI_DUMP_ERROR(x, args...) do { fprintf(stdout, "[ITTI_DUMP][E]"x, ##args); } \
|
||||
while(0)
|
||||
|
||||
@@ -90,8 +99,13 @@ typedef struct itti_desc_s {
|
||||
|
||||
int nb_connected;
|
||||
|
||||
#ifndef RTAI
|
||||
/* Event fd used to notify new messages (semaphore) */
|
||||
int event_fd;
|
||||
#else
|
||||
unsigned long messages_in_queue __attribute__((aligned(8)));
|
||||
#endif
|
||||
|
||||
int itti_listen_socket;
|
||||
|
||||
itti_client_desc_t itti_clients[ITTI_DUMP_MAX_CON];
|
||||
@@ -180,7 +194,9 @@ static int itti_dump_fwrite_message(itti_dump_queue_item_t *message)
|
||||
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);
|
||||
// #if !defined(RTAI)
|
||||
fflush (dump_file);
|
||||
// #endif
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -264,6 +280,10 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
|
||||
int overwrite_flag;
|
||||
AssertFatal (new != NULL, "Message to queue is NULL!\n");
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
|
||||
#endif
|
||||
|
||||
new->message_type = message_type;
|
||||
new->message_size = message_size;
|
||||
|
||||
@@ -283,6 +303,9 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
|
||||
lfds611_ringbuffer_put_write_element(itti_dump_queue.itti_message_queue, new_queue_element);
|
||||
|
||||
if (overwrite_flag == 0) {
|
||||
#ifdef RTAI
|
||||
__sync_fetch_and_add (&itti_dump_queue.messages_in_queue, 1);
|
||||
#else
|
||||
{
|
||||
ssize_t write_ret;
|
||||
eventfd_t sem_counter = 1;
|
||||
@@ -291,18 +314,25 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
|
||||
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));
|
||||
}
|
||||
#endif
|
||||
// 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);
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void itti_dump_socket_exit(void)
|
||||
{
|
||||
#ifndef RTAI
|
||||
close(itti_dump_queue.event_fd);
|
||||
#endif
|
||||
close(itti_dump_queue.itti_listen_socket);
|
||||
|
||||
/* Leave the thread as we detected end signal */
|
||||
@@ -316,6 +346,10 @@ static int itti_dump_flush_ring_buffer(int flush_all)
|
||||
int j;
|
||||
int consumer;
|
||||
|
||||
#ifdef RTAI
|
||||
unsigned long number_of_messages;
|
||||
#endif
|
||||
|
||||
/* Check if there is a least one consumer */
|
||||
consumer = 0;
|
||||
|
||||
@@ -331,6 +365,18 @@ static int itti_dump_flush_ring_buffer(int flush_all)
|
||||
}
|
||||
|
||||
if (consumer > 0) {
|
||||
#ifdef RTAI
|
||||
number_of_messages = itti_dump_queue.messages_in_queue;
|
||||
|
||||
ITTI_DUMP_DEBUG(0x4, "%lu elements in queue\n", number_of_messages);
|
||||
|
||||
if (number_of_messages == 0) {
|
||||
return (consumer);
|
||||
}
|
||||
|
||||
__sync_sub_and_fetch(&itti_dump_queue.messages_in_queue, number_of_messages);
|
||||
#endif
|
||||
|
||||
do {
|
||||
/* Acquire the ring element */
|
||||
lfds611_ringbuffer_get_read_element(itti_dump_queue.itti_message_queue, &element);
|
||||
@@ -373,6 +419,9 @@ static int itti_dump_flush_ring_buffer(int flush_all)
|
||||
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
|
||||
}
|
||||
} while(flush_all
|
||||
#ifdef RTAI
|
||||
&& --number_of_messages
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
@@ -429,6 +478,9 @@ static void *itti_dump_socket(void *arg_p)
|
||||
struct sockaddr_in servaddr; /* socket address structure */
|
||||
|
||||
struct timeval *timeout_p = NULL;
|
||||
#ifdef RTAI
|
||||
struct timeval timeout;
|
||||
#endif
|
||||
|
||||
ITTI_DUMP_DEBUG(0x2, " Creating TCP dump socket on port %u\n", ITTI_PORT);
|
||||
|
||||
@@ -484,11 +536,15 @@ static void *itti_dump_socket(void *arg_p)
|
||||
/* Add the listener */
|
||||
FD_SET(itti_listen_socket, &read_set);
|
||||
|
||||
#ifndef RTAI
|
||||
/* 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;
|
||||
#else
|
||||
max_sd = itti_listen_socket;
|
||||
#endif
|
||||
|
||||
itti_dump_queue.itti_listen_socket = itti_listen_socket;
|
||||
|
||||
@@ -501,7 +557,14 @@ static void *itti_dump_socket(void *arg_p)
|
||||
int i;
|
||||
|
||||
memcpy(&working_set, &read_set, sizeof(read_set));
|
||||
#ifdef RTAI
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 100000;
|
||||
|
||||
timeout_p = &timeout;
|
||||
#else
|
||||
timeout_p = NULL;
|
||||
#endif
|
||||
|
||||
/* No timeout: select blocks till a new event has to be handled
|
||||
* on sd's.
|
||||
@@ -529,6 +592,8 @@ static void *itti_dump_socket(void *arg_p)
|
||||
if (FD_ISSET(i, &working_set)) {
|
||||
desc_ready -= 1;
|
||||
|
||||
#ifndef RTAI
|
||||
|
||||
if (i == itti_dump_queue.event_fd) {
|
||||
/* Notification of new element to dump from other tasks */
|
||||
eventfd_t sem_counter;
|
||||
@@ -548,6 +613,7 @@ static void *itti_dump_socket(void *arg_p)
|
||||
if (itti_dump_running) {
|
||||
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
|
||||
usleep(100 * 1000);
|
||||
#ifndef RTAI
|
||||
{
|
||||
ssize_t write_ret;
|
||||
|
||||
@@ -556,6 +622,7 @@ static void *itti_dump_socket(void *arg_p)
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
itti_dump_socket_exit();
|
||||
}
|
||||
@@ -563,6 +630,7 @@ static void *itti_dump_socket(void *arg_p)
|
||||
ITTI_DUMP_DEBUG(0x1, " Write element to file\n");
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
if (i == itti_listen_socket) {
|
||||
do {
|
||||
client_socket = accept(itti_listen_socket, NULL, NULL);
|
||||
@@ -651,9 +719,21 @@ int itti_dump_queue_message(task_id_t sender_task,
|
||||
AssertFatal (message_name != NULL, "Message name is NULL!\n");
|
||||
AssertFatal (message_p != NULL, "Message is NULL!\n");
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
|
||||
#endif
|
||||
new = itti_malloc(sender_task, TASK_MAX, sizeof(itti_dump_queue_item_t));
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
|
||||
#endif
|
||||
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
|
||||
#endif
|
||||
new->data = itti_malloc(sender_task, TASK_MAX, message_size);
|
||||
#if defined(OAI_EMU) || defined(RTAI)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
|
||||
#endif
|
||||
|
||||
memcpy(new->data, message_p, message_size);
|
||||
new->data_size = message_size;
|
||||
@@ -711,6 +791,9 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
|
||||
AssertFatal (0, " Failed to create ring buffer!\n");
|
||||
}
|
||||
|
||||
#ifdef RTAI
|
||||
itti_dump_queue.messages_in_queue = 0;
|
||||
#else
|
||||
itti_dump_queue.event_fd = eventfd(0, EFD_SEMAPHORE);
|
||||
|
||||
if (itti_dump_queue.event_fd == -1) {
|
||||
@@ -718,6 +801,8 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
|
||||
AssertFatal (0, "eventfd failed: %s!\n", strerror(errno));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
itti_dump_queue.nb_connected = 0;
|
||||
|
||||
for(i = 0; i < ITTI_DUMP_MAX_CON; i++) {
|
||||
|
||||
@@ -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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (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.1 (the "License"); you may not use this file
|
||||
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user