bgpd/ospfd: resolve warnings for bgp/ospf json commit

Signed-off-by: Don Slice <dslice@cumulusnetwork.com>
This commit is contained in:
Don Slice 2018-08-30 15:54:46 +00:00
parent 9f049418bc
commit 94d4c685c5
7 changed files with 42 additions and 33 deletions

View File

@ -140,8 +140,10 @@ extern int bgp_damp_decay(time_t, int);
extern void bgp_config_write_damp(struct vty *);
extern void bgp_damp_info_vty(struct vty *, struct bgp_info *,
json_object *json_path);
extern const char *bgp_damp_reuse_time_vty(struct vty *, struct bgp_info *,
char *, size_t, bool, json_object *);
extern const char *bgp_damp_reuse_time_vty(struct vty *vty,
struct bgp_info *binfo,
char *timebuf, size_t len,
bool use_json, json_object *json);
extern int bgp_show_dampening_parameters(struct vty *vty, afi_t, safi_t);
#endif /* _QUAGGA_BGP_DAMP_H */

View File

@ -86,8 +86,8 @@ struct graceful_restart_af {
extern int bgp_open_option_parse(struct peer *, uint8_t, int *);
extern void bgp_open_capability(struct stream *, struct peer *);
extern void bgp_capability_vty_out(struct vty *, struct peer *, bool,
json_object *);
extern void bgp_capability_vty_out(struct vty *vty, struct peer *peer,
bool use_json, json_object *json_neigh);
extern as_t peek_for_as4_capability(struct peer *, uint8_t);
#endif /* _QUAGGA_BGP_OPEN_H */

View File

@ -435,8 +435,9 @@ extern void route_vty_out(struct vty *, struct prefix *, struct bgp_info *, int,
safi_t, json_object *);
extern void route_vty_out_tag(struct vty *, struct prefix *, struct bgp_info *,
int, safi_t, json_object *);
extern void route_vty_out_tmp(struct vty *, struct prefix *, struct attr *,
safi_t, bool, json_object *);
extern void route_vty_out_tmp(struct vty *vty, struct prefix *p,
struct attr *attr, safi_t safi, bool use_json,
json_object *json_ar);
extern void route_vty_out_overlay(struct vty *vty, struct prefix *p,
struct bgp_info *binfo, int display,
json_object *json);

View File

@ -10744,7 +10744,7 @@ static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp,
}
if (type != show_peer && !nbr_output && !use_json)
vty_out(vty, "%% No BGP neighbors found \n");
vty_out(vty, "%% No BGP neighbors found\n");
if (use_json) {
vty_out(vty, "%s\n", json_object_to_json_string_ext(
@ -11045,13 +11045,12 @@ static int bgp_show_route_leak_vty(struct vty *vty, const char *name, afi_t afi,
json_object_free(json);
return CMD_WARNING;
} else {
}
/* Provide context for the block */
json_object_string_add(json, "vrf",
name ? name : "default");
json_object_string_add(json, "vrf", name ? name : "default");
json_object_string_add(json, "afiSafi",
afi_safi_print(afi, safi));
}
if (!CHECK_FLAG(bgp->af_flags[afi][safi],
BGP_CONFIG_VRF_TO_VRF_IMPORT)) {

View File

@ -1513,7 +1513,8 @@ extern struct peer *peer_create(union sockunion *, const char *, struct bgp *,
struct peer_group *);
extern struct peer *peer_create_accept(struct bgp *);
extern void peer_xfer_config(struct peer *dst, struct peer *src);
extern char *peer_uptime(time_t, char *, size_t, bool, json_object *);
extern char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
json_object *json);
extern int bgp_config_write(struct vty *);

View File

@ -72,6 +72,7 @@ extern struct stream *prefix_bgp_orf_entry(struct stream *,
uint8_t, uint8_t);
extern int prefix_bgp_orf_set(char *, afi_t, struct orf_prefix *, int, int);
extern void prefix_bgp_orf_remove_all(afi_t, char *);
extern int prefix_bgp_show_prefix_list(struct vty *, afi_t, char *, bool);
extern int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
bool use_json);
#endif /* _QUAGGA_PLIST_H */

View File

@ -3263,6 +3263,7 @@ DEFUN (show_ip_ospf,
if (vrf_name) {
bool ospf_output = FALSE;
use_vrf = 1;
if (all_vrf) {
for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
@ -3288,7 +3289,7 @@ DEFUN (show_ip_ospf,
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -3302,7 +3303,7 @@ DEFUN (show_ip_ospf,
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -3965,7 +3966,7 @@ DEFUN (show_ip_ospf_interface,
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else if (!ospf)
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return ret;
}
@ -3977,7 +3978,7 @@ DEFUN (show_ip_ospf_interface,
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -3994,7 +3995,7 @@ DEFUN (show_ip_ospf_interface,
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -6339,6 +6340,7 @@ DEFUN (show_ip_ospf_database_max,
if (vrf_name) {
bool ospf_output = FALSE;
use_vrf = 1;
if (all_vrf) {
for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
@ -6354,7 +6356,7 @@ DEFUN (show_ip_ospf_database_max,
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
ret = (show_ip_ospf_database_common(
@ -6365,7 +6367,7 @@ DEFUN (show_ip_ospf_database_max,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -6429,7 +6431,7 @@ DEFUN (show_ip_ospf_instance_database,
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if ((ospf == NULL) || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -6440,7 +6442,7 @@ DEFUN (show_ip_ospf_instance_database,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -6473,7 +6475,7 @@ DEFUN (show_ip_ospf_instance_database_max,
return CMD_NOT_MY_INSTANCE;
if (!ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -6565,7 +6567,7 @@ DEFUN (show_ip_ospf_instance_database_type_adv_router,
if (ospf == NULL)
return CMD_NOT_MY_INSTANCE;
if (!ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -6578,6 +6580,7 @@ DEFUN (show_ip_ospf_instance_database_type_adv_router,
if (vrf_name) {
bool ospf_output = FALSE;
use_vrf = 1;
if (all_vrf) {
for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
@ -6592,7 +6595,7 @@ DEFUN (show_ip_ospf_instance_database_type_adv_router,
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if ((ospf == NULL) || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -6603,7 +6606,7 @@ DEFUN (show_ip_ospf_instance_database_type_adv_router,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -9345,6 +9348,7 @@ DEFUN (show_ip_ospf_border_routers,
if (vrf_name) {
bool ospf_output = FALSE;
use_vrf = 1;
if (all_vrf) {
for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
@ -9356,11 +9360,11 @@ DEFUN (show_ip_ospf_border_routers,
}
if (!ospf_output)
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -9371,7 +9375,7 @@ DEFUN (show_ip_ospf_border_routers,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -9487,6 +9491,7 @@ DEFUN (show_ip_ospf_route,
if (vrf_name) {
bool ospf_output = FALSE;
use_vrf = 1;
if (all_vrf) {
for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
@ -9514,7 +9519,7 @@ DEFUN (show_ip_ospf_route,
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}
@ -9528,7 +9533,7 @@ DEFUN (show_ip_ospf_route,
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
} else
vty_out(vty, "%% OSPF instance not found \n");
vty_out(vty, "%% OSPF instance not found\n");
return CMD_SUCCESS;
}