if (inst) // user passed instance ID
{
if (!ospf_lookup_instance(strtoul(argv[2]->arg, NULL, 10)))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
}
int type = 0;
if (inst) // user passed instance ID
{
if (!ospf_lookup_instance(strtoul(argv[3]->arg, NULL, 10)))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
}
int type = 0;
if (inst) // user passed instance ID
{
if (!ospf_lookup_instance(strtoul(argv[2]->arg, NULL, 10)))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
}
if (vty->node == CONFIG_NODE) {
if (inst) // user passed instance ID
{
if (!ospf_lookup_instance(strtoul(argv[3]->arg, NULL, 10)))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
}
if (vty->node == CONFIG_NODE) {
instance = strtoul(argv[idx_number]->arg, NULL, 10);
if (!ospf_lookup_instance(instance))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
return no_debug_ospf_nsm_common(vty, 5, argc, argv);
}
instance = strtoul(argv[idx_number]->arg, NULL, 10);
if (!ospf_lookup_instance(instance))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
return debug_ospf_lsa_common(vty, 4, argc, argv);
}
instance = strtoul(argv[idx_number]->arg, NULL, 10);
if (!ospf_lookup_instance(instance))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
return no_debug_ospf_lsa_common(vty, 5, argc, argv);
}
instance = strtoul(argv[idx_number]->arg, NULL, 10);
if (!ospf_lookup_instance(instance))
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
return debug_ospf_zebra_common(vty, 4, argc, argv);
}
if (argc > 3)
instance = strtoul(argv[3]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL)
- return CMD_SUCCESS;
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
ospf_finish(ospf);
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return (show_ip_ospf_common(vty, ospf, uj));
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
if (uj)
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_neighbor_common(vty, ospf, uj);
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_neighbor_all_common(vty, ospf, uj);
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_neighbor_int_common(vty, ospf, 1, argv, uj);
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_neighbor_id_common(vty, ospf, 1, argv, uj);
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_neighbor_detail_common(vty, ospf, uj);
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_neighbor_detail_all_common(vty, ospf, uj);
u_char uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_neighbor_int_detail_common(vty, ospf, 1, argv, uj);
if (argv_find(argv, argc, "(1-65535)", &idx)) {
instance = strtoul(argv[idx]->arg, NULL, 10);
ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
} else {
ospf = ospf_lookup();
}
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return (show_ip_ospf_database_common(vty, ospf, 1, argc, argv));
if (argv_find(argv, argc, "(1-65535)", &idx)) {
instance = strtoul(argv[idx]->arg, NULL, 10);
ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
} else
ospf = ospf_lookup();
ospf = ospf_lookup();
ospf->if_ospf_cli_count--;
}
- return CMD_SUCCESS;
+ return CMD_NOT_MY_INSTANCE;
}
ret = str2area_id(areaid, &area_id, &format);
if (argv_find(argv, argc, "(1-65535)", &idx))
instance = strtol(argv[idx]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL)
- return CMD_SUCCESS;
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
argv_find(argv, argc, "area", &idx);
u_short instance = 0;
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_border_routers_common(vty, ospf);
u_short instance = 0;
instance = strtoul(argv[idx_number]->arg, NULL, 10);
- if ((ospf = ospf_lookup_instance(instance)) == NULL
- || !ospf->oi_running)
+ ospf = ospf_lookup_instance(instance);
+ if (ospf == NULL)
+ return CMD_NOT_MY_INSTANCE;
+
+ if (!ospf->oi_running)
return CMD_SUCCESS;
return show_ip_ospf_route_common(vty, ospf);