Skip to content
Snippets Groups Projects
Commit 0fb67869 authored by Amin Ben Romdhane's avatar Amin Ben Romdhane
Browse files

Add support for displaying the schema data model with '-d' option

parent 52fd3d1b
No related branches found
No related tags found
1 merge request!42Add support for displaying the schema data model with '-d' option
Pipeline #206263 passed
...@@ -119,11 +119,11 @@ int cleanup() ...@@ -119,11 +119,11 @@ int cleanup()
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int ch; int ch, dm_type = 0;
int log_level = 7; int log_level = 7;
struct bbfdm_context bbfdm_ctx = {0}; struct bbfdm_context bbfdm_ctx = {0};
while ((ch = getopt(argc, argv, "l:q:")) != -1) { while ((ch = getopt(argc, argv, "dl:q:")) != -1) {
switch (ch) { switch (ch) {
case 'l': case 'l':
if (optarg) { if (optarg) {
...@@ -133,6 +133,9 @@ int main(int argc, char **argv) ...@@ -133,6 +133,9 @@ int main(int argc, char **argv)
if (log_level < 0 || log_level > 7) if (log_level < 0 || log_level > 7)
log_level = 7; log_level = 7;
break; break;
case 'd':
dm_type++;
break;
case 'q': case 'q':
int num_of_q = get_no_of_q_per_port(argv[argc-1]); int num_of_q = get_no_of_q_per_port(argv[argc-1]);
printf("%d", num_of_q); printf("%d", num_of_q);
...@@ -142,10 +145,15 @@ int main(int argc, char **argv) ...@@ -142,10 +145,15 @@ int main(int argc, char **argv)
} }
} }
memset(&bbfdm_ctx, 0, sizeof(struct bbfdm_context)); memset(&bbfdm_ctx, 0, sizeof(struct bbfdm_context));
bbfdm_ubus_set_service_name(&bbfdm_ctx, "qosmngr"); bbfdm_ubus_set_service_name(&bbfdm_ctx, "qosmngr");
bbfdm_ubus_set_log_level(log_level); bbfdm_ubus_set_log_level(log_level);
bbfdm_ubus_load_data_model(tDynamicObj); bbfdm_ubus_load_data_model(tDynamicObj);
if (dm_type > 0) {
int res = bbfdm_print_data_model_schema(&bbfdm_ctx, dm_type);
exit(res);
}
openlog("qosmngr", LOG_PID|LOG_CONS, LOG_LOCAL1); openlog("qosmngr", LOG_PID|LOG_CONS, LOG_LOCAL1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment