summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2018-09-01 05:05:30 +0200
committerGitHub <noreply@github.com>2018-09-01 05:05:30 +0200
commit1fbd4e382aaf654dcb13d27bec1f7c6c145b533f (patch)
tree4ebd49e15f6714986c2e9bb7994528ba24f5d9ac /zebra
parentMerge pull request #2913 from opensourcerouting/non-recursive-prep (diff)
parentbgpd: convert from conditional operator to if-then for json changes (diff)
downloadfrr-1fbd4e382aaf654dcb13d27bec1f7c6c145b533f.tar.xz
frr-1fbd4e382aaf654dcb13d27bec1f7c6c145b533f.zip
Merge pull request #2945 from dslicenc/bgp-ospf-json
bgpd/ospfd: make bgp and ospf json response a bit more consistent
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_mpls.c4
-rw-r--r--zebra/zebra_mpls.h4
-rw-r--r--zebra/zebra_vty.c45
-rw-r--r--zebra/zebra_vxlan.c37
-rw-r--r--zebra/zebra_vxlan.h36
5 files changed, 60 insertions, 66 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index f7283aed3..8f48cc519 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -2698,7 +2698,7 @@ void zebra_mpls_lsp_schedule(struct zebra_vrf *zvrf)
* (VTY command handler).
*/
void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
- mpls_label_t label, uint8_t use_json)
+ mpls_label_t label, bool use_json)
{
struct hash *lsp_table;
zebra_lsp_t *lsp;
@@ -2729,7 +2729,7 @@ void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
* Display MPLS label forwarding table (VTY command handler).
*/
void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
- uint8_t use_json)
+ bool use_json)
{
char buf[BUFSIZ];
json_object *json = NULL;
diff --git a/zebra/zebra_mpls.h b/zebra/zebra_mpls.h
index 65204a67d..86bee129c 100644
--- a/zebra/zebra_mpls.h
+++ b/zebra/zebra_mpls.h
@@ -349,13 +349,13 @@ void zebra_mpls_lsp_schedule(struct zebra_vrf *zvrf);
* (VTY command handler).
*/
void zebra_mpls_print_lsp(struct vty *vty, struct zebra_vrf *zvrf,
- mpls_label_t label, uint8_t use_json);
+ mpls_label_t label, bool use_json);
/*
* Display MPLS label forwarding table (VTY command handler).
*/
void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf,
- uint8_t use_json);
+ bool use_json);
/*
* Display MPLS LSP configuration of all static LSPs (VTY command handler).
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 4f1d5cf6d..de08e323a 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -55,7 +55,7 @@
extern int allow_delete;
static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
- safi_t safi, bool use_fib, uint8_t use_json,
+ safi_t safi, bool use_fib, bool use_json,
route_tag_t tag,
const struct prefix *longer_prefix_p,
bool supernets_only, int type,
@@ -135,7 +135,7 @@ DEFUN (show_ip_rpf,
"Display RPF information for multicast source\n"
JSON_STR)
{
- int uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
return do_show_ip_route(vty, VRF_DEFAULT_NAME, AFI_IP, SAFI_MULTICAST,
false, uj, 0, NULL, false, 0, 0);
}
@@ -760,8 +760,7 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
bool use_fib, route_tag_t tag,
const struct prefix *longer_prefix_p,
bool supernets_only, int type,
- unsigned short ospf_instance_id,
- uint8_t use_json)
+ unsigned short ospf_instance_id, bool use_json)
{
struct route_node *rn;
struct route_entry *re;
@@ -850,7 +849,7 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf,
}
static int do_show_ip_route(struct vty *vty, const char *vrf_name, afi_t afi,
- safi_t safi, bool use_fib, uint8_t use_json,
+ safi_t safi, bool use_fib, bool use_json,
route_tag_t tag,
const struct prefix *longer_prefix_p,
bool supernets_only, int type,
@@ -1723,7 +1722,7 @@ DEFUN (show_vrf_vni,
struct zebra_vrf *zvrf;
json_object *json = NULL;
json_object *json_vrfs = NULL;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (uj) {
json = json_object_new_object();
@@ -1759,7 +1758,7 @@ DEFUN (show_evpn_global,
"EVPN\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
zebra_vxlan_print_evpn(vty, uj);
return CMD_SUCCESS;
@@ -1774,7 +1773,7 @@ DEFUN (show_evpn_vni,
JSON_STR)
{
struct zebra_vrf *zvrf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
zebra_vxlan_print_vnis(vty, zvrf, uj);
@@ -1792,7 +1791,7 @@ DEFUN (show_evpn_vni_vni,
{
struct zebra_vrf *zvrf;
vni_t vni;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
vni = strtoul(argv[3]->arg, NULL, 10);
zvrf = vrf_info_lookup(VRF_DEFAULT);
@@ -1814,7 +1813,7 @@ DEFUN (show_evpn_rmac_vni_mac,
{
vni_t l3vni = 0;
struct ethaddr mac;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
if (!prefix_str2mac(argv[6]->arg, &mac)) {
@@ -1836,7 +1835,7 @@ DEFUN (show_evpn_rmac_vni,
JSON_STR)
{
vni_t l3vni = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
zebra_vxlan_print_rmacs_l3vni(vty, l3vni, uj);
@@ -1854,7 +1853,7 @@ DEFUN (show_evpn_rmac_vni_all,
"All VNIs\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
zebra_vxlan_print_rmacs_all_l3vni(vty, uj);
@@ -1875,7 +1874,7 @@ DEFUN (show_evpn_nh_vni_ip,
{
vni_t l3vni;
struct ipaddr ip;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
if (str2ipaddr(argv[6]->arg, &ip) != 0) {
@@ -1899,7 +1898,7 @@ DEFUN (show_evpn_nh_vni,
JSON_STR)
{
vni_t l3vni;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
l3vni = strtoul(argv[4]->arg, NULL, 10);
zebra_vxlan_print_nh_l3vni(vty, l3vni, uj);
@@ -1917,7 +1916,7 @@ DEFUN (show_evpn_nh_vni_all,
"All VNIs\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
zebra_vxlan_print_nh_all_l3vni(vty, uj);
@@ -1936,7 +1935,7 @@ DEFUN (show_evpn_mac_vni,
{
struct zebra_vrf *zvrf;
vni_t vni;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
zvrf = vrf_info_lookup(VRF_DEFAULT);
@@ -1955,7 +1954,7 @@ DEFUN (show_evpn_mac_vni_all,
JSON_STR)
{
struct zebra_vrf *zvrf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
zebra_vxlan_print_macs_all_vni(vty, zvrf, uj);
@@ -1976,7 +1975,7 @@ DEFUN (show_evpn_mac_vni_all_vtep,
{
struct zebra_vrf *zvrf;
struct in_addr vtep_ip;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!inet_aton(argv[6]->arg, &vtep_ip)) {
if (!uj)
@@ -2030,7 +2029,7 @@ DEFUN (show_evpn_mac_vni_vtep,
struct zebra_vrf *zvrf;
vni_t vni;
struct in_addr vtep_ip;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
if (!inet_aton(argv[6]->arg, &vtep_ip)) {
@@ -2056,7 +2055,7 @@ DEFUN (show_evpn_neigh_vni,
{
struct zebra_vrf *zvrf;
vni_t vni;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
zvrf = vrf_info_lookup(VRF_DEFAULT);
@@ -2075,7 +2074,7 @@ DEFUN (show_evpn_neigh_vni_all,
JSON_STR)
{
struct zebra_vrf *zvrf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
zvrf = vrf_info_lookup(VRF_DEFAULT);
zebra_vxlan_print_neigh_all_vni(vty, zvrf, uj);
@@ -2097,7 +2096,7 @@ DEFUN (show_evpn_neigh_vni_neigh,
struct zebra_vrf *zvrf;
vni_t vni;
struct ipaddr ip;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
if (str2ipaddr(argv[6]->arg, &ip) != 0) {
@@ -2125,7 +2124,7 @@ DEFUN (show_evpn_neigh_vni_vtep,
struct zebra_vrf *zvrf;
vni_t vni;
struct in_addr vtep_ip;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
vni = strtoul(argv[4]->arg, NULL, 10);
if (!inet_aton(argv[6]->arg, &vtep_ip)) {
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index b0fc0a39b..9aced13a4 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -4057,8 +4057,7 @@ void zebra_vxlan_evpn_vrf_route_del(vrf_id_t vrf_id,
}
void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
- struct ethaddr *rmac,
- uint8_t use_json)
+ struct ethaddr *rmac, bool use_json)
{
zebra_l3vni_t *zl3vni = NULL;
zebra_mac_t *zrmac = NULL;
@@ -4102,8 +4101,7 @@ void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
}
}
-void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni,
- uint8_t use_json)
+void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
{
zebra_l3vni_t *zl3vni;
uint32_t num_rmacs;
@@ -4147,7 +4145,7 @@ void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t l3vni,
}
}
-void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, uint8_t use_json)
+void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json)
{
struct zebra_ns *zns = NULL;
json_object *json = NULL;
@@ -4184,7 +4182,7 @@ void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, uint8_t use_json)
}
void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
- struct ipaddr *ip, uint8_t use_json)
+ struct ipaddr *ip, bool use_json)
{
zebra_l3vni_t *zl3vni = NULL;
zebra_neigh_t *n = NULL;
@@ -4228,7 +4226,7 @@ void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
}
}
-void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, uint8_t use_json)
+void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, bool use_json)
{
uint32_t num_nh;
struct nh_walk_ctx wctx;
@@ -4272,7 +4270,7 @@ void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t l3vni, uint8_t use_json)
}
}
-void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json)
+void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json)
{
struct zebra_ns *zns = NULL;
json_object *json = NULL;
@@ -4309,7 +4307,7 @@ void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json)
/*
* Display L3 VNI information (VTY command handler).
*/
-void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, uint8_t use_json)
+void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json)
{
void *args[2];
json_object *json = NULL;
@@ -4382,7 +4380,7 @@ void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf,
* Display Neighbors for a VNI (VTY command handler).
*/
void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, uint8_t use_json)
+ vni_t vni, bool use_json)
{
zebra_vni_t *zvni;
uint32_t num_neigh;
@@ -4438,7 +4436,7 @@ void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
* Display neighbors across all VNIs (VTY command handler).
*/
void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
- uint8_t use_json)
+ bool use_json)
{
json_object *json = NULL;
void *args[2];
@@ -4467,7 +4465,7 @@ void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
*/
void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
struct zebra_vrf *zvrf, vni_t vni,
- struct ipaddr *ip, uint8_t use_json)
+ struct ipaddr *ip, bool use_json)
{
zebra_vni_t *zvni;
zebra_neigh_t *n;
@@ -4509,7 +4507,7 @@ void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
*/
void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
vni_t vni, struct in_addr vtep_ip,
- uint8_t use_json)
+ bool use_json)
{
zebra_vni_t *zvni;
uint32_t num_neigh;
@@ -4551,7 +4549,7 @@ void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
* Display MACs for a VNI (VTY command handler).
*/
void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, uint8_t use_json)
+ vni_t vni, bool use_json)
{
zebra_vni_t *zvni;
uint32_t num_macs;
@@ -4606,7 +4604,7 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
* Display MACs for all VNIs (VTY command handler).
*/
void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
- uint8_t use_json)
+ bool use_json)
{
struct mac_walk_ctx wctx;
json_object *json = NULL;
@@ -4636,8 +4634,7 @@ void zebra_vxlan_print_macs_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
*/
void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf,
- struct in_addr vtep_ip,
- uint8_t use_json)
+ struct in_addr vtep_ip, bool use_json)
{
struct mac_walk_ctx wctx;
json_object *json = NULL;
@@ -4693,7 +4690,7 @@ void zebra_vxlan_print_specific_mac_vni(struct vty *vty, struct zebra_vrf *zvrf,
*/
void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
vni_t vni, struct in_addr vtep_ip,
- uint8_t use_json)
+ bool use_json)
{
zebra_vni_t *zvni;
uint32_t num_macs;
@@ -4743,7 +4740,7 @@ void zebra_vxlan_print_macs_vni_vtep(struct vty *vty, struct zebra_vrf *zvrf,
* Display VNI information (VTY command handler).
*/
void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf, vni_t vni,
- uint8_t use_json)
+ bool use_json)
{
json_object *json = NULL;
void *args[2];
@@ -4831,7 +4828,7 @@ void zebra_vxlan_print_evpn(struct vty *vty, uint8_t uj)
* Display VNI hash table (VTY command handler).
*/
void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
- uint8_t use_json)
+ bool use_json)
{
json_object *json = NULL;
struct zebra_ns *zns = NULL;
diff --git a/zebra/zebra_vxlan.h b/zebra/zebra_vxlan.h
index 2732ef72e..6b2b57371 100644
--- a/zebra/zebra_vxlan.h
+++ b/zebra/zebra_vxlan.h
@@ -68,53 +68,51 @@ extern int zebra_vxlan_vrf_enable(struct zebra_vrf *zvrf);
extern int zebra_vxlan_vrf_disable(struct zebra_vrf *zvrf);
extern int zebra_vxlan_vrf_delete(struct zebra_vrf *zvrf);
extern void zebra_vxlan_print_specific_nh_l3vni(struct vty *vty, vni_t l3vni,
- struct ipaddr *ip, uint8_t uj);
+ struct ipaddr *ip, bool uj);
extern void zebra_vxlan_print_evpn(struct vty *vty, uint8_t uj);
extern void zebra_vxlan_print_specific_rmac_l3vni(struct vty *vty, vni_t l3vni,
struct ethaddr *rmac,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, uint8_t use_json);
+ vni_t vni, bool use_json);
extern void zebra_vxlan_print_macs_all_vni(struct vty *vty,
struct zebra_vrf *zvrf,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_macs_all_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf,
struct in_addr vtep_ip,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_specific_mac_vni(struct vty *vty,
struct zebra_vrf *zvrf,
vni_t vni, struct ethaddr *mac);
extern void zebra_vxlan_print_macs_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf, vni_t vni,
struct in_addr vtep_ip,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_neigh_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, uint8_t use_json);
+ vni_t vni, bool use_json);
extern void zebra_vxlan_print_neigh_all_vni(struct vty *vty,
struct zebra_vrf *zvrf,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_specific_neigh_vni(struct vty *vty,
struct zebra_vrf *zvrf,
vni_t vni, struct ipaddr *ip,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_neigh_vni_vtep(struct vty *vty,
struct zebra_vrf *zvrf, vni_t vni,
struct in_addr vtep_ip,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_vni(struct vty *vty, struct zebra_vrf *zvrf,
- vni_t vni, uint8_t use_json);
+ vni_t vni, bool use_json);
extern void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
- uint8_t use_json);
+ bool use_json);
extern void zebra_vxlan_print_rmacs_l3vni(struct vty *vty, vni_t vni,
- uint8_t use_json);
-extern void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty,
- uint8_t use_json);
+ bool use_json);
+extern void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json);
extern void zebra_vxlan_print_nh_l3vni(struct vty *vty, vni_t vni,
- uint8_t use_json);
-extern void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, uint8_t use_json);
-extern void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni,
- uint8_t use_json);
+ bool use_json);
+extern void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json);
+extern void zebra_vxlan_print_l3vni(struct vty *vty, vni_t vni, bool use_json);
extern void zebra_vxlan_print_vrf_vni(struct vty *vty, struct zebra_vrf *zvrf,
json_object *json_vrfs);
extern int zebra_vxlan_add_del_gw_macip(struct interface *ifp, struct prefix *p,