]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd/ospfd: resolve warnings for bgp/ospf json commit
authorDon Slice <dslice@cumulusnetworks.com>
Thu, 30 Aug 2018 15:54:46 +0000 (15:54 +0000)
committerDon Slice <dslice@cumulusnetworks.com>
Thu, 30 Aug 2018 15:54:46 +0000 (15:54 +0000)
Signed-off-by: Don Slice <dslice@cumulusnetwork.com>
bgpd/bgp_damp.h
bgpd/bgp_open.h
bgpd/bgp_route.h
bgpd/bgp_vty.c
bgpd/bgpd.h
lib/plist.h
ospfd/ospf_vty.c

index 77e4cd3e844693af87b6836a09b6f82dd4fdb3d5..8326bae697731b55ef76097423b40a8c199594ec 100644 (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 */
index fd899bf4c2b83c5953ea2c4686ec8b9a495465b2..0fc321bdf3a6af89a31d291d64f4bbfc7667a2ea 100644 (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 */
index c4f3ad1120f80a061ae1e8caaf70392c0fc9b010..476bb3aa0508d3586bad6223cca95271ffdeacab 100644 (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);
index 381cd0e09c6bc643c62f0db51482dc6bcc5c4d2c..77c6167e249365be4484caec9002bb9e52806b0b 100644 (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,14 +11045,13 @@ 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, "afiSafi",
-                                              afi_safi_print(afi, safi));
                }
 
+               /* Provide context for the block */
+               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)) {
                        json_object_string_add(json, "importFromVrfs", "none");
index 06a7968c5b00c5165a9fc15c51144f350edc61c4..8a997413901c0cc0f46d03889a867ab44ac6553e 100644 (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 *);
 
index 7933b8a921e6aabc4827a941907b5259052d7f2a..8a4fa8d3ce6cf4c60e47c66ed82ceada80970961 100644 (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 */
index 8785e6f4aaf198028dcc1b5b82030c1b429bc560..f596662aa6945ba1f9c3bfafcfccc57bca0c264a 100644 (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;
                }