Skip to content
Snippets Groups Projects

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

Merged Amin Ben Romdhane requested to merge schema_dm into devel
1 file
+ 15
7
Compare changes
  • Side-by-side
  • Inline
+ 15
7
@@ -119,11 +119,11 @@ int cleanup()
int main(int argc, char **argv)
{
int ch;
int log_level = 7;
int ch, dm_type = 0;
int log_level = 7;
struct bbfdm_context bbfdm_ctx = {0};
while ((ch = getopt(argc, argv, "l:q:")) != -1) {
while ((ch = getopt(argc, argv, "dl:q:")) != -1) {
switch (ch) {
case 'l':
if (optarg) {
@@ -133,6 +133,9 @@ int main(int argc, char **argv)
if (log_level < 0 || log_level > 7)
log_level = 7;
break;
case 'd':
dm_type++;
break;
case 'q':
int num_of_q = get_no_of_q_per_port(argv[argc-1]);
printf("%d", num_of_q);
@@ -142,10 +145,15 @@ int main(int argc, char **argv)
}
}
memset(&bbfdm_ctx, 0, sizeof(struct bbfdm_context));
bbfdm_ubus_set_service_name(&bbfdm_ctx, "qosmngr");
bbfdm_ubus_set_log_level(log_level);
bbfdm_ubus_load_data_model(tDynamicObj);
memset(&bbfdm_ctx, 0, sizeof(struct bbfdm_context));
bbfdm_ubus_set_service_name(&bbfdm_ctx, "qosmngr");
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("qosmngr", LOG_PID|LOG_CONS, LOG_LOCAL1);
Loading