Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ethmngr
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HAL
ethmngr
Commits
503b72e0
Verified
Commit
503b72e0
authored
1 month ago
by
Amin Ben Romdhane
Committed by
IOPSYS Dev
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Add support for displaying the schema data model with '-d' option
parent
48b45d54
Branches
devel
No related tags found
1 merge request
!34
Add support for displaying the schema data model with '-d' option
Pipeline
#206256
passed
1 month ago
Stage: static_code_analysis
Stage: functional_test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ethmngr.c
+13
-4
13 additions, 4 deletions
src/ethmngr.c
with
13 additions
and
4 deletions
src/ethmngr.c
+
13
−
4
View file @
503b72e0
...
...
@@ -252,22 +252,26 @@ static void ethmngr_usage(char *prog)
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
"options:
\n
"
);
fprintf
(
stderr
,
" -l <log level> As per syslog, 0 to 7
\n
"
);
fprintf
(
stderr
,
" -d <schema dm> Display the schema data model supported by micro-service
\n
"
);
fprintf
(
stderr
,
" -h <help> To print this help menu
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
ch
;
int
ch
,
dm_type
=
0
;
int
log_level
=
6
;
// default LOG_INFO
while
((
ch
=
getopt
(
argc
,
argv
,
"hl:"
))
!=
-
1
)
{
while
((
ch
=
getopt
(
argc
,
argv
,
"h
d
l:"
))
!=
-
1
)
{
switch
(
ch
)
{
case
'l'
:
log_level
=
(
int
)
strtoul
(
optarg
,
NULL
,
10
);
if
(
log_level
<
0
||
log_level
>
7
)
log_level
=
6
;
break
;
case
'd'
:
dm_type
++
;
break
;
case
'h'
:
ethmngr_usage
(
argv
[
0
]);
exit
(
0
);
...
...
@@ -276,13 +280,18 @@ int main(int argc, char **argv)
}
}
openlog
(
"ethmngr"
,
LOG_PID
|
LOG_CONS
|
LOG_NDELAY
,
LOG_LOCAL1
);
memset
(
&
bbfdm_ctx
,
0
,
sizeof
(
struct
bbfdm_context
));
bbfdm_ubus_set_service_name
(
&
bbfdm_ctx
,
"ethmngr"
);
bbfdm_ubus_set_log_level
(
log_level
);
bbfdm_ubus_load_data_model
(
tDynamicObj
);
if
(
dm_type
>
0
)
{
int
res
=
bbfdm_print_data_model_schema
(
&
bbfdm_ctx
,
dm_type
);
exit
(
res
);
}
openlog
(
"ethmngr"
,
LOG_PID
|
LOG_CONS
|
LOG_NDELAY
,
LOG_LOCAL1
);
if
(
bbfdm_ubus_regiter_init
(
&
bbfdm_ctx
))
goto
out
;
...
...
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