arg.asnotation = bgp_get_asnotation(bgp_lookup_by_vrf_id(VRF_DEFAULT));
if (!group) {
- if (!json)
+ if (json)
+ vty_json(vty, json);
+ else
vty_out(vty, "Cannot find a connected group.\n");
return;
}
arg.asnotation = bgp_get_asnotation(bgp_lookup_by_vrf_id(VRF_DEFAULT));
if (!group) {
- if (!json)
+ if (json)
+ vty_json(vty, json);
+ else
vty_out(vty, "Cannot find a connected group.\n");
return;
}
{
struct json_object *json = NULL;
+ if (uj)
+ json = json_object_new_object();
+
if (!is_synchronized()) {
- if (!uj)
+ if (uj)
+ vty_json(vty, json);
+ else
vty_out(vty, "No connection to RPKI cache server.\n");
return CMD_WARNING;
}
- if (uj)
- json = json_object_new_object();
-
print_prefix_table(vty, json);
return CMD_SUCCESS;
}
{
struct json_object *json = NULL;
+ if (uj)
+ json = json_object_new_object();
+
if (!is_synchronized()) {
- if (!uj)
+ if (uj)
+ vty_json(vty, json);
+ else
vty_out(vty, "No Connection to RPKI cache server.\n");
return CMD_WARNING;
}
- if (uj)
- json = json_object_new_object();
-
print_prefix_table_by_asn(vty, by_asn, json);
return CMD_SUCCESS;
}
json_object *json_records = NULL;
enum asnotation_mode asnotation;
+ if (uj)
+ json = json_object_new_object();
+
if (!is_synchronized()) {
- if (!uj)
+ if (uj)
+ vty_json(vty, json);
+ else
vty_out(vty, "No Connection to RPKI cache server.\n");
return CMD_WARNING;
}
memcpy(addr_str, prefix_str, addr_len);
if (lrtr_ip_str_to_addr(addr_str, &addr) != 0) {
- if (!json)
+ if (json)
+ vty_json(vty, json);
+ else
vty_out(vty, "Invalid IP prefix\n");
return CMD_WARNING;
}
if (pfx_table_validate_r(rtr_config->pfx_table, &matches, &match_count,
asn, &addr, prefix->prefixlen,
&result) != PFX_SUCCESS) {
- if (!json)
+ if (json)
+ vty_json(vty, json);
+ else
vty_out(vty, "Prefix lookup failed\n");
return CMD_WARNING;
}
- if (uj)
- json = json_object_new_object();
if (!json) {
vty_out(vty, "%-40s %s %s\n", "Prefix", "Prefix Length",