/*
* bgp_bfd_show_info - Show the peer BFD information.
*/
-void bgp_bfd_show_info(struct vty *vty, struct peer *peer, uint8_t use_json,
+void bgp_bfd_show_info(struct vty *vty, struct peer *peer, bool use_json,
json_object *json_neigh)
{
bfd_show_info(vty, (struct bfd_info *)peer->bfd_info,
extern void bgp_bfd_peer_config_write(struct vty *vty, struct peer *peer,
char *addr);
-extern void bgp_bfd_show_info(struct vty *vty, struct peer *peer,
- uint8_t use_json, json_object *json_neigh);
+extern void bgp_bfd_show_info(struct vty *vty, struct peer *peer, bool use_json,
+ json_object *json_neigh);
extern int bgp_bfd_is_peer_multihop(struct peer *peer);
}
static const char *bgp_get_reuse_time(unsigned int penalty, char *buf,
- size_t len, uint8_t use_json,
+ size_t len, bool use_json,
json_object *json)
{
time_t reuse_time = 0;
}
const char *bgp_damp_reuse_time_vty(struct vty *vty, struct bgp_info *binfo,
- char *timebuf, size_t len, uint8_t use_json,
+ char *timebuf, size_t len, bool use_json,
json_object *json)
{
struct bgp_damp_info *bdi;
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, uint8_t,
- json_object *);
+ char *, size_t, bool, json_object *);
extern int bgp_show_dampening_parameters(struct vty *vty, afi_t, safi_t);
#endif /* _QUAGGA_BGP_DAMP_H */
static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
enum bgp_show_type type, void *output_arg,
- int option, uint8_t use_json)
+ int option, bool use_json)
{
afi_t afi = AFI_L2VPN;
struct bgp *bgp;
union sockunion su;
struct peer *peer;
int ret;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
argv_find(argv, argc, "A.B.C.D", &idx_ipv4);
union sockunion su;
struct peer *peer;
struct prefix_rd prd;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community);
argv_find(argv, argc, "A.B.C.D", &idx_ipv4);
int ret;
struct peer *peer;
union sockunion su;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
argv_find(argv, argc, "A.B.C.D", &idx_ipv4);
struct peer *peer;
struct prefix_rd prd;
union sockunion su;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
argv_find(argv, argc, "ASN:NN_OR_IP-ADDRESS:NN", &idx_ext_community);
argv_find(argv, argc, "A.B.C.D", &idx_ipv4);
struct bgp *bgp_def;
vni_t vni;
int idx = 0;
- uint8_t uj = 0;
+ bool uj = false;
json_object *json = NULL;
uint32_t num_l2vnis = 0;
uint32_t num_l3vnis = 0;
JSON_STR)
{
int idx = 0;
- uint8_t uj = 0;
+ bool uj = false;
esi_t esi;
json_object *json = NULL;
struct bgp *bgp = NULL;
JSON_STR)
{
int idx_vrf = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
char *vrf = NULL;
if (argv_find(argv, argc, "vrf", &idx_vrf))
struct bgp *bgp;
int type_idx = 0;
int type = 0;
- uint8_t uj = 0;
+ bool uj = false;
json_object *json = NULL;
uj = use_json(argc, argv);
int type = 0;
int rd_idx = 0;
int type_idx = 0;
- int uj = 0;
+ bool uj = false;
json_object *json = NULL;
bgp = bgp_get_default();
int rd_idx = 0;
int mac_idx = 0;
int ip_idx = 0;
- int uj = 0;
+ bool uj = false;
json_object *json = NULL;
memset(&mac, 0, sizeof(struct ethaddr));
"ESI ID\n"
JSON_STR)
{
- int uj = 0;
+ bool uj = false;
esi_t esi;
struct bgp *bgp = NULL;
json_object *json = NULL;
struct in_addr vtep_ip;
int type = 0;
int idx = 0;
- int uj = 0;
+ bool uj = false;
json_object *json = NULL;
bgp = bgp_get_default();
struct ethaddr mac;
struct ipaddr ip;
int idx = 0;
- int uj = 0;
+ bool uj = false;
json_object *json = NULL;
bgp = bgp_get_default();
int ret;
struct in_addr orig_ip;
int idx = 0;
- int uj = 0;
+ bool uj = false;
json_object *json = NULL;
bgp = bgp_get_default();
struct bgp *bgp;
struct in_addr vtep_ip;
int idx = 0;
- int uj = 0;
+ bool uj = false;
json_object *json = NULL;
bgp = bgp_get_default();
"Show vrf import route target\n"
JSON_STR)
{
- uint8_t uj = 0;
+ bool uj = false;
struct bgp *bgp_def = NULL;
json_object *json = NULL;
JSON_STR)
{
struct bgp *bgp;
- uint8_t uj = 0;
+ bool uj = false;
json_object *json = NULL;
bgp = bgp_get_default();
json_object *json_vnis = NULL;
json_object *json_export_rts = NULL;
json_object *json_import_rts = NULL;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (uj) {
json = json_object_new_object();
int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd,
enum bgp_show_type type, void *output_arg, int tags,
- uint8_t use_json)
+ bool use_json)
{
struct bgp *bgp;
struct bgp_table *table;
union sockunion su;
struct peer *peer;
int ret;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
afi_t afi;
int idx = 0;
union sockunion su;
struct peer *peer;
struct prefix_rd prd;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
afi_t afi;
int idx = 0;
int ret;
struct peer *peer;
union sockunion su;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
afi_t afi;
int idx = 0;
struct peer *peer;
struct prefix_rd prd;
union sockunion su;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
afi_t afi;
int idx = 0;
int *index, afi_t *afi);
extern int bgp_show_mpls_vpn(struct vty *vty, afi_t afi, struct prefix_rd *prd,
enum bgp_show_type type, void *output_arg,
- int tags, uint8_t use_json);
+ int tags, bool use_json);
extern void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, struct bgp *bgp_vrf,
struct bgp_info *info_vrf);
Next, if we send capability to the peer we want to set my capabilty
inforation at each peer. */
-void bgp_capability_vty_out(struct vty *vty, struct peer *peer,
- uint8_t use_json, json_object *json_neigh)
+void bgp_capability_vty_out(struct vty *vty, struct peer *peer, bool use_json,
+ json_object *json_neigh)
{
char *pnt;
char *end;
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 *, uint8_t,
+extern void bgp_capability_vty_out(struct vty *, struct peer *, bool,
json_object *);
extern as_t peek_for_as4_capability(struct peer *, uint8_t);
/* called from terminal list command */
void route_vty_out_tmp(struct vty *vty, struct prefix *p, struct attr *attr,
- safi_t safi, uint8_t use_json, json_object *json_ar)
+ safi_t safi, bool use_json, json_object *json_ar)
{
json_object *json_status = NULL;
json_object *json_net = NULL;
/* dampening route */
static void damp_route_vty_out(struct vty *vty, struct prefix *p,
struct bgp_info *binfo, int display, safi_t safi,
- uint8_t use_json, json_object *json)
+ bool use_json, json_object *json)
{
struct attr *attr;
int len;
/* flap route */
static void flap_route_vty_out(struct vty *vty, struct prefix *p,
struct bgp_info *binfo, int display, safi_t safi,
- uint8_t use_json, json_object *json)
+ bool use_json, json_object *json)
{
struct attr *attr;
struct bgp_damp_info *bdi;
afi_t afi, safi_t safi, enum bgp_show_type type);
static int bgp_show_community(struct vty *vty, struct bgp *bgp,
const char *comstr, int exact, afi_t afi,
- safi_t safi, uint8_t use_json);
+ safi_t safi, bool use_json);
static int bgp_show_table(struct vty *vty, struct bgp *bgp, safi_t safi,
struct bgp_table *table, enum bgp_show_type type,
- void *output_arg, uint8_t use_json, char *rd,
+ void *output_arg, bool use_json, char *rd,
int is_last, unsigned long *output_cum,
unsigned long *total_cum,
unsigned long *json_header_depth)
int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
struct bgp_table *table, struct prefix_rd *prd_match,
- enum bgp_show_type type, void *output_arg,
- uint8_t use_json)
+ enum bgp_show_type type, void *output_arg, bool use_json)
{
struct bgp_node *rn, *next;
unsigned long output_cum = 0;
return CMD_SUCCESS;
}
static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
- enum bgp_show_type type, void *output_arg, uint8_t use_json)
+ enum bgp_show_type type, void *output_arg, bool use_json)
{
struct bgp_table *table;
unsigned long json_header_depth = 0;
}
static void bgp_show_all_instances_routes_vty(struct vty *vty, afi_t afi,
- safi_t safi, uint8_t use_json)
+ safi_t safi, bool use_json)
{
struct listnode *node, *nnode;
struct bgp *bgp;
int is_first = 1;
+ bool route_output = false;
if (use_json)
vty_out(vty, "{\n");
for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp)) {
+ route_output = true;
if (use_json) {
if (!is_first)
vty_out(vty, ",\n");
if (use_json)
vty_out(vty, "}\n");
+ else if (!route_output)
+ vty_out(vty, "%% BGP instance not found\n");
}
/* Header of detailed BGP route information */
struct bgp_table *rib, const char *ip_str,
afi_t afi, safi_t safi,
struct prefix_rd *prd, int prefix_check,
- enum bgp_path_type pathtype,
- uint8_t use_json)
+ enum bgp_path_type pathtype, bool use_json)
{
int ret;
int header;
static int bgp_show_route(struct vty *vty, struct bgp *bgp, const char *ip_str,
afi_t afi, safi_t safi, struct prefix_rd *prd,
int prefix_check, enum bgp_path_type pathtype,
- uint8_t use_json)
+ bool use_json)
{
if (!bgp) {
bgp = bgp_get_default();
safi = bgp_vty_safi_from_str(argv[idx]->text);
}
- int uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct bgp *bgp = bgp_lookup_by_name(vrf);
if (bgp == NULL) {
safi = bgp_vty_safi_from_str(argv[idx]->text);
}
- int uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct bgp *bgp = bgp_lookup_by_name(vrf);
if (bgp == NULL) {
int idx = 0;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
+ &bgp, false);
if (!idx)
return CMD_WARNING;
int idx = 0;
int idx_community_type = 0;
int exact_match = 0;
+ bool uj = use_json(argc, argv);
+
+ if (uj)
+ argc--;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
+ &bgp, uj);
if (!idx)
return CMD_WARNING;
- int uj = use_json(argc, argv);
- if (uj)
- argc--;
-
if (argv_find(argv, argc, "cidr-only", &idx))
return bgp_show(vty, bgp, afi, safi, bgp_show_type_cidr_only,
NULL, uj);
char *prefix = NULL;
struct bgp *bgp = NULL;
enum bgp_path_type path_type;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 0;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
+ &bgp, uj);
if (!idx)
return CMD_WARNING;
int idx = 0;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
+ &bgp, false);
if (!idx)
return CMD_WARNING;
afi_t afi = AFI_IP;
safi_t safi = SAFI_UNICAST;
struct bgp *bgp = NULL;
-
int idx = 0;
- bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
- if (!idx)
- return CMD_WARNING;
+ bool uj = use_json(argc, argv);
- int uj = use_json(argc, argv);
if (uj)
argc--;
+ bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
+ &bgp, uj);
+ if (!idx)
+ return CMD_WARNING;
+
bgp_show_all_instances_routes_vty(vty, afi, safi, uj);
return CMD_SUCCESS;
}
static int bgp_show_community(struct vty *vty, struct bgp *bgp,
const char *comstr, int exact, afi_t afi,
- safi_t safi, uint8_t use_json)
+ safi_t safi, bool use_json)
{
struct community *com;
int ret = 0;
}
static struct peer *peer_lookup_in_view(struct vty *vty, struct bgp *bgp,
- const char *ip_str, uint8_t use_json)
+ const char *ip_str, bool use_json)
{
int ret;
struct peer *peer;
}
static int bgp_peer_counts(struct vty *vty, struct peer *peer, afi_t afi,
- safi_t safi, uint8_t use_json)
+ safi_t safi, bool use_json)
{
struct peer_pcounts pcounts = {.peer = peer};
unsigned int i;
struct peer *peer;
int idx = 0;
struct bgp *bgp = NULL;
+ bool uj = use_json(argc, argv);
+
+ if (uj)
+ argc--;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
+ &bgp, uj);
if (!idx)
return CMD_WARNING;
- int uj = use_json(argc, argv);
- if (uj)
- argc--;
-
argv_find(argv, argc, "neighbors", &idx);
peer = peer_lookup_in_view(vty, bgp, argv[idx + 1]->arg, uj);
if (!peer)
{
int idx_peer = 6;
struct peer *peer;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
peer = peer_lookup_in_view(vty, NULL, argv[idx_peer]->arg, uj);
if (!peer)
static void show_adj_route(struct vty *vty, struct peer *peer, afi_t afi,
safi_t safi, enum bgp_show_adj_route_type type,
- const char *rmap_name, uint8_t use_json,
+ const char *rmap_name, bool use_json,
json_object *json)
{
struct bgp_table *table;
static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi,
safi_t safi, enum bgp_show_adj_route_type type,
- const char *rmap_name, uint8_t use_json)
+ const char *rmap_name, bool use_json)
{
json_object *json = NULL;
struct bgp *bgp = NULL;
struct peer *peer;
enum bgp_show_adj_route_type type = bgp_show_adj_route_advertised;
-
int idx = 0;
- bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
- if (!idx)
- return CMD_WARNING;
-
- int uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (uj)
argc--;
+ bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
+ &bgp, uj);
+ if (!idx)
+ return CMD_WARNING;
+
/* neighbors <A.B.C.D|X:X::X:X|WORD> */
argv_find(argv, argc, "neighbors", &idx);
peerstr = argv[++idx]->arg;
argv_find(argv, argc, "neighbors", &idx);
peerstr = argv[++idx]->arg;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
ret = str2sockunion(peerstr, &su);
if (ret < 0) {
static int bgp_show_neighbor_route(struct vty *vty, struct peer *peer,
afi_t afi, safi_t safi,
- enum bgp_show_type type, uint8_t use_json)
+ enum bgp_show_type type, bool use_json)
{
/* labeled-unicast routes live in the unicast table */
if (safi == SAFI_LABELED_UNICAST)
safi_t safi = SAFI_UNICAST;
struct bgp *bgp = NULL;
int idx = 0;
+ bool uj = use_json(argc, argv);
+
+ if (uj)
+ argc--;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
+ &bgp, uj);
if (!idx)
return CMD_WARNING;
- return bgp_show(vty, bgp, afi, safi,
- bgp_show_type_detail, NULL, use_json(argc, argv));
+ return bgp_show(vty, bgp, afi, safi, bgp_show_type_detail, NULL, uj);
}
DEFUN (show_ip_bgp_neighbor_routes,
safi_t safi = SAFI_UNICAST;
struct peer *peer;
enum bgp_show_type sh_type = bgp_show_type_neighbor;
-
int idx = 0;
+ bool uj = use_json(argc, argv);
+
+ if (uj)
+ argc--;
bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi,
- &bgp);
+ &bgp, uj);
if (!idx)
return CMD_WARNING;
- int uj = use_json(argc, argv);
- if (uj)
- argc--;
-
/* neighbors <A.B.C.D|X:X::X:X|WORD> */
argv_find(argv, argc, "neighbors", &idx);
peerstr = argv[++idx]->arg;
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, uint8_t, json_object *);
+ safi_t, bool, json_object *);
extern void route_vty_out_overlay(struct vty *vty, struct prefix *p,
struct bgp_info *binfo, int display,
json_object *json);
extern int bgp_show_table_rd(struct vty *vty, struct bgp *bgp, safi_t safi,
struct bgp_table *table, struct prefix_rd *prd,
enum bgp_show_type type, void *output_arg,
- uint8_t use_json);
+ bool use_json);
#endif /* _QUAGGA_BGP_ROUTE_H */
int show_adj_route_vpn(struct vty *vty, struct peer *peer,
struct prefix_rd *prd, afi_t afi, safi_t safi,
- uint8_t use_json)
+ bool use_json)
{
struct bgp *bgp;
struct bgp_table *table;
extern int show_adj_route_vpn(struct vty *vty, struct peer *peer,
struct prefix_rd *prd, afi_t afi, safi_t safi,
- uint8_t use_json);
+ bool use_json);
#endif /* _QUAGGA_BGP_VPN_H */
int bgp_vty_find_and_parse_afi_safi_bgp(struct vty *vty,
struct cmd_token **argv, int argc,
int *idx, afi_t *afi, safi_t *safi,
- struct bgp **bgp)
+ struct bgp **bgp, bool use_json)
{
char *vrf_name = NULL;
else {
*bgp = bgp_lookup_by_name(vrf_name);
if (!*bgp) {
- vty_out(vty,
- "View/Vrf specified is unknown: %s\n",
- vrf_name);
+ use_json
+ ? vty_out(vty, "{}\n")
+ : vty_out(vty,
+ "View/Vrf specified is unknown: %s\n",
+ vrf_name);
*idx = 0;
return 0;
}
} else {
*bgp = bgp_get_default();
if (!*bgp) {
- vty_out(vty, "Unable to find default BGP instance\n");
+ use_json
+ ? vty_out(vty, "{}\n")
+ : vty_out(vty,
+ "Unable to find default BGP instance\n");
*idx = 0;
return 0;
}
struct list *inst = bm->bgp;
struct listnode *node;
struct bgp *bgp;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
json_object *json_vrfs = NULL;
int count = 0;
/* Show BGP peer's summary information. */
static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi,
- uint8_t use_json, json_object *json)
+ bool use_json, json_object *json)
{
struct peer *peer;
struct listnode *node, *nnode;
}
static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi,
- int safi, uint8_t use_json,
+ int safi, bool use_json,
json_object *json)
{
int is_first = 1;
int afi_wildcard = (afi == AFI_MAX);
int safi_wildcard = (safi == SAFI_MAX);
int is_wildcard = (afi_wildcard || safi_wildcard);
- bool json_output = false;
+ bool nbr_output = false;
if (use_json && is_wildcard)
vty_out(vty, "{\n");
safi = 1; /* SAFI_UNICAST */
while (safi < SAFI_MAX) {
if (bgp_afi_safi_peer_exists(bgp, afi, safi)) {
- json_output = true;
+ nbr_output = true;
if (is_wildcard) {
/*
* So limit output to those afi/safi
if (use_json && is_wildcard)
vty_out(vty, "}\n");
- else if (use_json && !json_output)
- vty_out(vty, "{}\n");
+ else if (!nbr_output)
+ use_json ? vty_out(vty, "{}\n")
+ : vty_out(vty, "%% No BGP neighbors found\n");
}
static void bgp_show_all_instances_summary_vty(struct vty *vty, afi_t afi,
- safi_t safi, uint8_t use_json)
+ safi_t safi, bool use_json)
{
struct listnode *node, *nnode;
struct bgp *bgp;
json_object *json = NULL;
int is_first = 1;
+ bool nbr_output = false;
if (use_json)
vty_out(vty, "{\n");
for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp)) {
+ nbr_output = true;
if (use_json) {
json = json_object_new_object();
if (use_json)
vty_out(vty, "}\n");
+ else if (!nbr_output)
+ vty_out(vty, "%% BGP instance not found\n");
}
int bgp_show_summary_vty(struct vty *vty, const char *name, afi_t afi,
- safi_t safi, uint8_t use_json)
+ safi_t safi, bool use_json)
{
struct bgp *bgp;
bgp = bgp_lookup_by_name(name);
if (!bgp) {
- if (use_json)
- vty_out(vty, "{}\n");
- else
- vty_out(vty,
- "%% No such BGP instance exist\n");
+ use_json
+ ? vty_out(vty, "{}\n")
+ : vty_out(vty,
+ "%% BGP instance not found\n");
return CMD_WARNING;
}
if (bgp)
bgp_show_summary_afi_safi(vty, bgp, afi, safi, use_json, NULL);
+ else {
+ use_json ? vty_out(vty, "{}\n")
+ : vty_out(vty, "%% No such BGP instance exist\n");
+ return CMD_WARNING;
+ }
return CMD_SUCCESS;
}
argv_find_and_parse_safi(argv, argc, &idx, &safi);
}
- int uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
return bgp_show_summary_vty(vty, vrf, afi, safi, uj);
}
afi_t afi, safi_t safi,
uint16_t adv_smcap, uint16_t adv_rmcap,
uint16_t rcv_smcap, uint16_t rcv_rmcap,
- uint8_t use_json, json_object *json_pref)
+ bool use_json, json_object *json_pref)
{
/* Send-Mode */
if (CHECK_FLAG(p->af_cap[afi][safi], adv_smcap)
}
static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
- safi_t safi, uint8_t use_json,
+ safi_t safi, bool use_json,
json_object *json_neigh)
{
struct bgp_filter *filter;
}
}
-static void bgp_show_peer(struct vty *vty, struct peer *p, uint8_t use_json,
+static void bgp_show_peer(struct vty *vty, struct peer *p, bool use_json,
json_object *json)
{
struct bgp *bgp;
static int bgp_show_neighbor(struct vty *vty, struct bgp *bgp,
enum show_type type, union sockunion *su,
- const char *conf_if, uint8_t use_json,
+ const char *conf_if, bool use_json,
json_object *json)
{
struct listnode *node, *nnode;
struct peer *peer;
int find = 0;
+ bool nbr_output = false;
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer)) {
if (!CHECK_FLAG(peer->flags, PEER_FLAG_CONFIG_NODE))
switch (type) {
case show_all:
bgp_show_peer(vty, peer, use_json, json);
+ nbr_output = true;
break;
case show_peer:
if (conf_if) {
vty_out(vty, "%% No such neighbor in this view/vrf\n");
}
+ if (type != show_peer && !nbr_output && !use_json)
+ vty_out(vty, "%% No BGP neighbors found \n");
+
if (use_json) {
vty_out(vty, "%s\n", json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
static void bgp_show_all_instances_neighbors_vty(struct vty *vty,
enum show_type type,
const char *ip_str,
- uint8_t use_json)
+ bool use_json)
{
struct listnode *node, *nnode;
struct bgp *bgp;
union sockunion su;
json_object *json = NULL;
int ret, is_first = 1;
+ bool nbr_output = false;
if (use_json)
vty_out(vty, "{\n");
for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp)) {
+ nbr_output = true;
if (use_json) {
if (!(json = json_object_new_object())) {
flog_err(
if (use_json)
vty_out(vty, "}\n");
+ else if (!nbr_output)
+ vty_out(vty, "%% BGP instance not found\n");
}
static int bgp_show_neighbor_vty(struct vty *vty, const char *name,
enum show_type type, const char *ip_str,
- uint8_t use_json)
+ bool use_json)
{
int ret;
struct bgp *bgp;
if (!bgp) {
if (use_json) {
json = json_object_new_object();
- json_object_boolean_true_add(
- json, "bgpNoSuchInstance");
vty_out(vty, "%s\n",
json_object_to_json_string_ext(
json,
json_object_free(json);
} else
vty_out(vty,
- "%% No such BGP instance exist\n");
+ "%% BGP instance not found\n");
return CMD_WARNING;
}
json);
}
json_object_free(json);
+ } else {
+ use_json ? vty_out(vty, "{}\n")
+ : vty_out(vty, "%% BGP instance not found\n");
}
return CMD_SUCCESS;
char *sh_arg = NULL;
enum show_type sh_type;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 0;
return CMD_SUCCESS;
}
-static int bgp_show_route_leak_vty(struct vty *vty, const char *name,
- afi_t afi, safi_t safi, uint8_t use_json)
+static int bgp_show_route_leak_vty(struct vty *vty, const char *name, afi_t afi,
+ safi_t safi, bool use_json)
{
struct bgp *bgp;
struct listnode *node;
json = json_object_new_object();
- /* 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));
-
bgp = name ? bgp_lookup_by_name(name) : bgp_get_default();
if (!bgp) {
- json_object_boolean_true_add(json,
- "bgpNoSuchInstance");
vty_out(vty, "%s\n",
json_object_to_json_string_ext(
json,
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));
}
if (!CHECK_FLAG(bgp->af_flags[afi][safi],
afi_t afi = AFI_MAX;
safi_t safi = SAFI_MAX;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 0;
/* show [ip] bgp */
bgp = name ? bgp_lookup_by_name(name) : bgp_get_default();
if (!bgp) {
- vty_out(vty, "%% No such BGP instance exists\n");
+ vty_out(vty, "%% BGP instance not found\n");
return CMD_WARNING;
}
extern int bgp_vty_find_and_parse_afi_safi_bgp(struct vty *vty,
struct cmd_token **argv,
int argc, int *idx, afi_t *afi,
- safi_t *safi, struct bgp **bgp);
+ safi_t *safi, struct bgp **bgp,
+ bool use_json);
extern int bgp_show_summary_vty(struct vty *vty, const char *name, afi_t afi,
- safi_t safi, uint8_t use_json);
+ safi_t safi, bool use_json);
extern void bgp_vpn_policy_config_write_afi(struct vty *vty, struct bgp *bgp,
afi_t afi);
#endif /* _QUAGGA_BGP_VTY_H */
}
/* Display peer uptime.*/
-char *peer_uptime(time_t uptime2, char *buf, size_t len, uint8_t use_json,
+char *peer_uptime(time_t uptime2, char *buf, size_t len, bool use_json,
json_object *json)
{
time_t uptime1, epoch_tbuf;
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, uint8_t, json_object *);
+extern char *peer_uptime(time_t, char *, size_t, bool, json_object *);
extern int bgp_config_write(struct vty *);
* bfd_show_param - Show the BFD parameter information.
*/
void bfd_show_param(struct vty *vty, struct bfd_info *bfd_info, int bfd_tag,
- int extra_space, uint8_t use_json, json_object *json_obj)
+ int extra_space, bool use_json, json_object *json_obj)
{
json_object *json_bfd = NULL;
* bfd_show_status - Show the BFD status information.
*/
static void bfd_show_status(struct vty *vty, struct bfd_info *bfd_info,
- int bfd_tag, int extra_space, uint8_t use_json,
+ int bfd_tag, int extra_space, bool use_json,
json_object *json_bfd)
{
char time_buf[32];
* bfd_show_info - Show the BFD information.
*/
void bfd_show_info(struct vty *vty, struct bfd_info *bfd_info, int multihop,
- int extra_space, uint8_t use_json, json_object *json_obj)
+ int extra_space, bool use_json, json_object *json_obj)
{
json_object *json_bfd = NULL;
const char *bfd_get_status_str(int status);
extern void bfd_show_param(struct vty *vty, struct bfd_info *bfd_info,
- int bfd_tag, int extra_space, uint8_t use_json,
+ int bfd_tag, int extra_space, bool use_json,
json_object *json_obj);
extern void bfd_show_info(struct vty *vty, struct bfd_info *bfd_info,
- int multihop, int extra_space, uint8_t use_json,
+ int multihop, int extra_space, bool use_json,
json_object *json_obj);
extern void bfd_client_sendmsg(struct zclient *zclient, int command);
* is the *last* keyword on the line no matter
* what.
*/
-int use_json(const int argc, struct cmd_token *argv[])
+bool use_json(const int argc, struct cmd_token *argv[])
{
if (argc == 0)
- return 0;
+ return false;
if (argv[argc - 1]->arg && strmatch(argv[argc - 1]->text, "json"))
- return 1;
+ return true;
- return 0;
+ return false;
}
void json_object_string_add(struct json_object *obj, const char *key,
#include "command.h"
-extern int use_json(const int argc, struct cmd_token *argv[]);
+extern bool use_json(const int argc, struct cmd_token *argv[]);
extern void json_object_string_add(struct json_object *obj, const char *key,
const char *s);
extern void json_object_int_add(struct json_object *obj, const char *key,
/* return prefix count */
int prefix_bgp_show_prefix_list(struct vty *vty, afi_t afi, char *name,
- uint8_t use_json)
+ bool use_json)
{
struct prefix_list *plist;
struct prefix_list_entry *pentry;
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 *, uint8_t);
+extern int prefix_bgp_show_prefix_list(struct vty *, afi_t, char *, bool);
#endif /* _QUAGGA_PLIST_H */
* ospf_bfd_show_info - Show BFD info structure
*/
void ospf_bfd_show_info(struct vty *vty, void *bfd_info, json_object *json_obj,
- uint8_t use_json, int param_only)
+ bool use_json, int param_only)
{
if (param_only)
bfd_show_param(vty, (struct bfd_info *)bfd_info, 1, 0, use_json,
* ospf_bfd_interface_show - Show the interface BFD configuration.
*/
void ospf_bfd_interface_show(struct vty *vty, struct interface *ifp,
- json_object *json_interface_sub, uint8_t use_json)
+ json_object *json_interface_sub, bool use_json)
{
struct ospf_if_params *params;
extern void ospf_bfd_interface_show(struct vty *vty, struct interface *ifp,
json_object *json_interface_sub,
- uint8_t use_json);
+ bool use_json);
extern void ospf_bfd_info_nbr_create(struct ospf_interface *oi,
struct ospf_neighbor *nbr);
extern void ospf_bfd_show_info(struct vty *vty, void *bfd_info,
- json_object *json_obj, uint8_t use_json,
+ json_object *json_obj, bool use_json,
int param_only);
extern void ospf_bfd_info_free(void **bfd_info);
const char *ospf_shortcut_mode_descr_str[] = {"Default", "Enabled", "Disabled"};
static void show_ip_ospf_area(struct vty *vty, struct ospf_area *area,
- json_object *json_areas, uint8_t use_json)
+ json_object *json_areas, bool use_json)
{
json_object *json_area = NULL;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
char *vrf_name = NULL;
bool all_vrf = FALSE;
/* vrf input is provided could be all or specific vrf*/
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)
continue;
+ ospf_output = TRUE;
ret = show_ip_ospf_common(vty, ospf, json,
use_vrf);
}
json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
- }
+ } else if (!ospf_output)
+ vty_out(vty, "%% OSPF instance not found\n");
return ret;
}
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if ((ospf == NULL) || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found \n");
+
return CMD_SUCCESS;
}
} else {
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
/* Display default ospf (instance 0) info */
if (ospf == NULL || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found \n");
+
return CMD_SUCCESS;
}
}
int idx_number = 3;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int ret = CMD_SUCCESS;
json_object *json = NULL;
static void show_ip_ospf_interface_sub(struct vty *vty, struct ospf *ospf,
struct interface *ifp,
json_object *json_interface_sub,
- uint8_t use_json)
+ bool use_json)
{
int is_up;
struct ospf_neighbor *nbr;
static int show_ip_ospf_interface_common(struct vty *vty, struct ospf *ospf,
char *intf_name, uint8_t use_vrf,
- json_object *json, uint8_t use_json)
+ json_object *json, bool use_json)
{
struct interface *ifp;
struct vrf *vrf = vrf_lookup_by_id(ospf->vrf_id);
static void show_ip_ospf_interface_traffic_sub(struct vty *vty,
struct ospf_interface *oi,
json_object *json_interface_sub,
- uint8_t use_json)
+ bool use_json)
{
if (use_json) {
json_object_int_add(json_interface_sub, "ifIndex",
/* OSPFv2 Packet Counters */
static int show_ip_ospf_interface_traffic_common(
struct vty *vty, struct ospf *ospf, char *intf_name, json_object *json,
- int display_once, uint8_t use_vrf, uint8_t use_json)
+ int display_once, uint8_t use_vrf, bool use_json)
{
struct vrf *vrf = NULL;
struct interface *ifp = NULL;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
char *vrf_name = NULL, *intf_name = NULL;
bool all_vrf = FALSE;
json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
- }
+ } else if (!ospf)
+ vty_out(vty, "%% OSPF instance not found \n");
return ret;
}
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found \n");
+
return CMD_SUCCESS;
}
ret = show_ip_ospf_interface_common(vty, ospf, intf_name,
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found \n");
+
return CMD_SUCCESS;
}
ret = show_ip_ospf_interface_common(vty, ospf, intf_name,
int idx_intf = 0;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
char *intf_name = NULL;
int ret = CMD_SUCCESS;
json_object *json = NULL;
bool all_vrf = FALSE;
int inst = 0;
int idx_vrf = 0, idx_intf = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
int ret = CMD_SUCCESS;
int display_once = 0;
static void show_ip_ospf_neighbor_sub(struct vty *vty,
struct ospf_interface *oi,
- json_object *json, uint8_t use_json)
+ json_object *json, bool use_json)
{
struct route_node *rn;
struct ospf_neighbor *nbr, *prev_nbr = NULL;
}
static int show_ip_ospf_neighbor_common(struct vty *vty, struct ospf *ospf,
- json_object *json, uint8_t use_json,
+ json_object *json, bool use_json,
uint8_t use_vrf)
{
struct ospf_interface *oi;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
char *vrf_name = NULL;
bool all_vrf = FALSE;
json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
- }
+ } else if (!ospf)
+ vty_out(vty, "OSPF instance not found\n");
return ret;
}
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found\n");
+
return CMD_SUCCESS;
}
} else {
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found\n");
+
return CMD_SUCCESS;
}
}
int idx_number = 3;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
int ret = CMD_SUCCESS;
}
static int show_ip_ospf_neighbor_all_common(struct vty *vty, struct ospf *ospf,
- json_object *json, uint8_t use_json,
+ json_object *json, bool use_json,
uint8_t use_vrf)
{
struct listnode *node;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
char *vrf_name = NULL;
bool all_vrf = FALSE;
int idx_number = 3;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
int ret = CMD_SUCCESS;
static int show_ip_ospf_neighbor_int_common(struct vty *vty, struct ospf *ospf,
int arg_base,
struct cmd_token **argv,
- uint8_t use_json, uint8_t use_vrf)
+ bool use_json, uint8_t use_vrf)
{
struct interface *ifp;
struct route_node *rn;
{
struct ospf *ospf;
int idx_ifname = 4;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
int ret = CMD_SUCCESS;
struct interface *ifp = NULL;
int idx_ifname = 5;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!uj)
show_ip_ospf_neighbour_header(vty);
static void show_ip_ospf_nbr_nbma_detail_sub(struct vty *vty,
struct ospf_interface *oi,
struct ospf_nbr_nbma *nbr_nbma,
- uint8_t use_json,
- json_object *json)
+ bool use_json, json_object *json)
{
char timebuf[OSPF_TIME_DUMP_SIZE];
json_object *json_sub = NULL;
static void show_ip_ospf_neighbor_detail_sub(struct vty *vty,
struct ospf_interface *oi,
struct ospf_neighbor *nbr,
- json_object *json,
- uint8_t use_json)
+ json_object *json, bool use_json)
{
char timebuf[OSPF_TIME_DUMP_SIZE];
json_object *json_sub = NULL;
static int show_ip_ospf_neighbor_id_common(struct vty *vty, struct ospf *ospf,
int arg_base,
struct cmd_token **argv,
- uint8_t use_json, uint8_t use_vrf)
+ bool use_json, uint8_t use_vrf)
{
struct listnode *node;
struct ospf_neighbor *nbr;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
int ret = CMD_SUCCESS;
int idx_router_id = 5;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
ospf = ospf_lookup_instance(instance);
static int show_ip_ospf_neighbor_detail_common(struct vty *vty,
struct ospf *ospf,
- json_object *json,
- uint8_t use_json,
+ json_object *json, bool use_json,
uint8_t use_vrf)
{
struct ospf_interface *oi;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
char *vrf_name = NULL;
bool all_vrf = FALSE;
int idx_number = 3;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
int ret = CMD_SUCCESS;
static int show_ip_ospf_neighbor_detail_all_common(struct vty *vty,
struct ospf *ospf,
json_object *json,
- uint8_t use_json,
+ bool use_json,
uint8_t use_vrf)
{
struct listnode *node;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
char *vrf_name = NULL;
bool all_vrf = FALSE;
int idx_number = 3;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
int ret = CMD_SUCCESS;
struct ospf *ospf,
int arg_base,
struct cmd_token **argv,
- uint8_t use_json)
+ bool use_json)
{
struct ospf_interface *oi;
struct interface *ifp;
JSON_STR)
{
struct ospf *ospf;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct listnode *node = NULL;
int ret = CMD_SUCCESS;
+ bool ospf_output = FALSE;
for (ALL_LIST_ELEMENTS_RO(om->ospf, node, ospf)) {
if (!ospf->oi_running)
continue;
+ ospf_output = TRUE;
ret = show_ip_ospf_neighbor_int_detail_common(vty, ospf, 0,
argv, uj);
}
+ if (!ospf_output)
+ vty_out(vty, "%% OSPF instance not found\n");
+
return ret;
}
int idx_ifname = 5;
struct ospf *ospf;
unsigned short instance = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
instance = strtoul(argv[idx_number]->arg, NULL, 10);
ospf = ospf_lookup_instance(instance);
OSPF_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
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)
continue;
+ ospf_output = TRUE;
ret = show_ip_ospf_database_common(
vty, ospf, idx_vrf ? 2 : 0, argc, argv,
use_vrf);
}
+
+ if (!ospf_output)
+ vty_out(vty, "%% OSPF instance not found\n");
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
- if (ospf == NULL || !ospf->oi_running)
+ if (ospf == NULL || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
ret = (show_ip_ospf_database_common(
vty, ospf, idx_vrf ? 2 : 0, argc, argv,
use_vrf));
} else {
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
- if (ospf == NULL || !ospf->oi_running)
+ if (ospf == NULL || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
+
ret = show_ip_ospf_database_common(vty, ospf, 0, argc, argv,
use_vrf);
}
}
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
- if ((ospf == NULL) || !ospf->oi_running)
+ if ((ospf == NULL) || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
+
ret = (show_ip_ospf_database_common(
vty, ospf, idx ? 2 : 0, argc, argv, use_vrf));
}
} else {
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
- if (ospf == NULL || !ospf->oi_running)
+ if (ospf == NULL || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
+
ret = (show_ip_ospf_database_common(vty, ospf, 0, argc, argv,
use_vrf));
}
if (ospf == NULL)
return CMD_NOT_MY_INSTANCE;
- if (!ospf->oi_running)
+ if (!ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
return show_ip_ospf_database_common(vty, ospf, 1, argc, argv, 0);
}
ospf = ospf_lookup_instance(instance);
if (ospf == NULL)
return CMD_NOT_MY_INSTANCE;
- if (!ospf->oi_running)
+ if (!ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
+
return (show_ip_ospf_database_type_adv_router_common(
vty, ospf, idx ? 1 : 0, argc, argv, use_vrf));
}
OSPF_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
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)
continue;
+ ospf_output = TRUE;
ret = show_ip_ospf_database_type_adv_router_common(
vty, ospf, idx ? 1 : 0, argc, argv,
use_vrf);
}
+ if (!ospf_output)
+ vty_out(vty, "%% OSPF instance not found\n");
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
- if ((ospf == NULL) || !ospf->oi_running)
+ if ((ospf == NULL) || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
+
ret = show_ip_ospf_database_type_adv_router_common(
vty, ospf, idx ? 1 : 0, argc, argv, use_vrf);
}
} else {
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
- if (ospf == NULL || !ospf->oi_running)
+ if (ospf == NULL || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
+
ret = show_ip_ospf_database_type_adv_router_common(
vty, ospf, idx ? 1 : 0, argc, argv, use_vrf);
}
OSPF_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
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)
continue;
+ ospf_output = TRUE;
ret = show_ip_ospf_border_routers_common(
vty, ospf, use_vrf);
}
+
+ if (!ospf_output)
+ vty_out(vty, "%% OSPF instance not found \n");
} else {
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
- if (ospf == NULL || !ospf->oi_running)
+ if (ospf == NULL || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
ret = show_ip_ospf_border_routers_common(vty, ospf,
use_vrf);
} else {
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
- if (ospf == NULL || !ospf->oi_running)
+ if (ospf == NULL || !ospf->oi_running) {
+ vty_out(vty, "%% OSPF instance not found \n");
return CMD_SUCCESS;
+ }
+
ret = show_ip_ospf_border_routers_common(vty, ospf, use_vrf);
}
int inst = 0;
int idx_vrf = 0;
uint8_t use_vrf = 0;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
if (uj)
/* vrf input is provided could be all or specific vrf*/
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)
continue;
+ ospf_output = TRUE;
ret = show_ip_ospf_route_common(vty, ospf, json,
use_vrf);
}
vty_out(vty, "%s\n",
json_object_to_json_string(json));
json_object_free(json);
- }
+ } else if (!ospf_output)
+ vty_out(vty, "%% OSPF instance not found\n");
return ret;
}
ospf = ospf_lookup_by_inst_name(inst, vrf_name);
if (ospf == NULL || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found \n");
+
return CMD_SUCCESS;
}
} else {
/* Display default ospf (instance 0) info */
ospf = ospf_lookup_by_vrf_id(VRF_DEFAULT);
if (ospf == NULL || !ospf->oi_running) {
- if (uj)
+ if (uj) {
+ vty_out(vty, "%s\n",
+ json_object_to_json_string_ext(
+ json, JSON_C_TO_STRING_PRETTY));
json_object_free(json);
+ } else
+ vty_out(vty, "%% OSPF instance not found \n");
+
return CMD_SUCCESS;
}
}
"Show OSPF VRFs \n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
json_object *json = NULL;
json_object *json_vrfs = NULL;
struct ospf *ospf = NULL;
* pim_bfd_show_info - Show BFD info structure
*/
void pim_bfd_show_info(struct vty *vty, void *bfd_info, json_object *json_obj,
- uint8_t use_json, int param_only)
+ bool use_json, int param_only)
{
if (param_only)
bfd_show_param(vty, (struct bfd_info *)bfd_info, 1, 0, use_json,
void pim_bfd_init(void);
void pim_bfd_write_config(struct vty *vty, struct interface *ifp);
void pim_bfd_show_info(struct vty *vty, void *bfd_info, json_object *json_obj,
- uint8_t use_json, int param_only);
+ bool use_json, int param_only);
void pim_bfd_if_param_set(struct interface *ifp, uint32_t min_rx,
uint32_t min_tx, uint8_t detect_mult, int defaults);
int pim_bfd_reg_dereg_all_nbr(struct interface *ifp, int command);
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
JSON_STR)
{
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
VRF_CMD_HELP_STR
"IGMP static join information\n")
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
IGMP_GROUP_STR
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
JSON_STR)
{
int idx = 6;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM interface join information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
JSON_STR)
{
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
const char *group = NULL;
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
const char *src_or_group = NULL;
const char *group = NULL;
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM upstream information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM RP information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM cached source rpf information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
VRF_CMD_HELP_STR
"Multicast global information\n")
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
"Fill in Assumed data\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
bool fill = false;
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
"Fill in Assumed data\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 4;
struct vrf *vrf;
bool first = true;
VRF_CMD_HELP_STR
"Route and packet count data\n")
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"MSDP mesh-group information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
"MSDP mesh-group information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
"peer ip address\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
JSON_STR)
{
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
"Detailed output\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
"Detailed output\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
"group ip\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
int idx = 2;
"group ip\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
int idx = 2;
* (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;
* 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;
* (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).
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,
"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);
}
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;
}
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,
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();
"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;
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);
{
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);
{
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)) {
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);
"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);
{
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) {
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);
"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);
{
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);
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);
{
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)
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)) {
{
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);
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);
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) {
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)) {
}
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;
}
}
-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;
}
}
-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;
}
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;
}
}
-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;
}
}
-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;
/*
* 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;
* 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;
* 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];
*/
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;
*/
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;
* 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;
* 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;
*/
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;
*/
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;
* 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];
* 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;
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,