Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
292535fe
Commit
292535fe
authored
8 years ago
by
Frédéric Leroy
Browse files
Options
Downloads
Patches
Plain Diff
refactor(conf2uedata.c): rewrite main() and add parse_config_file()
parent
804595d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
openair3/NAS/TOOLS/conf2uedata.c
+66
-67
66 additions, 67 deletions
openair3/NAS/TOOLS/conf2uedata.c
with
66 additions
and
67 deletions
openair3/NAS/TOOLS/conf2uedata.c
+
66
−
67
View file @
292535fe
...
...
@@ -8,21 +8,19 @@
char
*
make_filename
(
const
char
*
output_dir
,
const
char
*
filename
,
int
ueid
);
int
get_config_from_file
(
const
char
*
filename
,
config_t
*
config
);
int
parse_config_file
(
const
char
*
filename
);
int
main
(
int
argc
,
char
**
argv
)
{
int
rc
=
EXIT_SUCCESS
;
int
option
;
const
char
*
conf_file
=
NULL
;
while
((
option
=
getopt
(
argc
,
argv
,
options
))
!=
-
1
)
{
switch
(
option
)
{
case
'c'
:
parse_data
=
TRUE
;
conf_file
=
optarg
;
break
;
case
'o'
:
output_dir
=
optarg
;
output
=
TRUE
;
break
;
case
'h'
:
_display_usage
();
...
...
@@ -33,25 +31,28 @@ int main(int argc, char**argv) {
}
}
if
(
output
==
FALSE
&&
parse_data
==
TRUE
)
{
if
(
output
_dir
==
NULL
)
{
printf
(
"No output option found
\n
"
);
_display_usage
();
return
EXIT_FAILURE
;
}
if
(
output
==
TRUE
&&
parse_data
==
FALSE
)
{
if
(
conf_file
==
NULL
)
{
printf
(
"No Configuration file is given
\n
"
);
_display_usage
();
return
EXIT_FAILURE
;
}
if
(
parse_data
==
FALSE
&&
print_data
==
FALSE
)
{
printf
(
"No options found
\n
"
);
_display_usage
();
return
EXIT_FAILURE
;
if
(
parse_config_file
(
conf_file
)
==
EXIT_FAILURE
)
{
exit
(
EXIT_FAILURE
);
}
exit
(
EXIT_SUCCESS
);
}
if
(
parse_data
)
{
int
parse_config_file
(
const
char
*
filename
)
{
int
rc
=
EXIT_SUCCESS
;
int
ret
;
int
ue_nb
=
0
;
config_setting_t
*
root_setting
=
NULL
;
...
...
@@ -60,7 +61,7 @@ int main(int argc, char**argv) {
char
user
[
10
];
config_t
cfg
;
ret
=
get_config_from_file
(
conf_fil
e
,
&
cfg
);
ret
=
get_config_from_file
(
filenam
e
,
&
cfg
);
if
(
ret
==
EXIT_FAILURE
)
{
exit
(
1
);
}
...
...
@@ -113,9 +114,7 @@ int main(int argc, char**argv) {
_display_usim_data
(
i
);
}
config_destroy
(
&
cfg
);
}
exit
(
EXIT_SUCCESS
);
return
(
EXIT_SUCCESS
);
}
int
get_config_from_file
(
const
char
*
filename
,
config_t
*
config
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment