}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void igmp_show_interfaces_single(struct pim_instance *pim,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- } else {
- if (!found_ifname)
- vty_out(vty, "%% No such interface\n");
- }
+ if (uj)
+ vty_json(vty, json);
+ else if (!found_ifname)
+ vty_out(vty, "%% No such interface\n");
}
static void igmp_show_interface_join(struct pim_instance *pim, struct vty *vty,
} /* for (iflist) */
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_interfaces_single(struct pim_instance *pim,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- } else {
- if (!found_ifname)
- vty_out(vty, "%% No such interface\n");
- }
+ if (uj)
+ vty_json(vty, json);
+ else if (!found_ifname)
+ vty_out(vty, "%% No such interface\n");
}
static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty,
rx_stats.unsupported);
json_object_object_add(json, ifname ? ifname : "global",
json_row);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
} else {
vty_out(vty, "IGMP RX statistics\n");
vty_out(vty, "Interface : %s\n",
pim_ifp->pim_ifstat_bsm_tx);
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_interface_traffic_single(struct pim_instance *pim,
pim_ifp->pim_ifstat_bsm_tx);
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- } else {
- if (!found_ifname)
- vty_out(vty, "%% No such interface\n");
- }
+ if (uj)
+ vty_json(vty, json);
+ else if (!found_ifname)
+ vty_out(vty, "%% No such interface\n");
}
static void pim_show_join_helper(struct vty *vty, struct pim_interface *pim_ifp,
} /* scan interface channels */
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_neighbors_single(struct pim_instance *pim, struct vty *vty,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- } else {
- {
- if (!found_neighbor)
- vty_out(vty,
- "%% No such interface or neighbor\n");
- }
- }
+ if (uj)
+ vty_json(vty, json);
+ else if (!found_neighbor)
+ vty_out(vty, "%% No such interface or neighbor\n");
}
static void pim_show_state(struct pim_instance *pim, struct vty *vty,
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- } else {
+ if (uj)
+ vty_json(vty, json);
+ else
vty_out(vty, "\n");
- }
}
static void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_neighbors_secondary(struct pim_instance *pim,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_channel_helper(struct pim_instance *pim,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_join_desired_helper(struct pim_instance *pim,
json, uj);
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_upstream_rpf(struct pim_instance *pim, struct vty *vty,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void show_rpf_refresh_stats(struct vty *vty, struct pim_instance *pim,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
struct pnc_cache_walk_data {
fragment++;
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
/*Display the group-rp mappings */
vty_out(vty, "\n");
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
/* pim statistics - just adding only bsm related now.
vty_out(vty, "\n");
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void clear_pim_statistics(struct pim_instance *pim)
} /* scan igmp groups */
} /* scan interfaces */
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void igmp_show_group_retransmission(struct pim_instance *pim,
vty_out(vty, "Last BSM seen: %s\n", last_bsm_seen);
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void clear_igmp_interfaces(struct pim_instance *pim)
router->mlag_stats.msg.vxlan_updates);
json_object_object_add(json, "connStats", json_stat);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
return CMD_SUCCESS;
}
src_str, grp_str, json);
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_mlag_up_vrf(struct vrf *vrf, struct vty *vty, bool uj)
? "n" : "y");
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_mlag_help_string(struct vty *vty, bool uj)
}
}
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_cmd_show_ip_multicast_helper(struct pim_instance *pim,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
DEFPY (show_ip_mroute,
for (ALL_LIST_ELEMENTS_RO(pim->static_routes, node, sr))
show_mroute_count_per_channel_oil(&sr->c_oil, json, vty);
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
DEFUN (show_ip_mroute_count,
show_mroute_summary(vrf->info, vty, json);
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
return CMD_SUCCESS;
}
json_object_object_add(json, vrf->name, json_vrf);
}
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
return CMD_SUCCESS;
}
json_object *json;
json = json_object_new_object();
json_object_string_add(json, "ssmGroups", range_str);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
} else
vty_out(vty, "SSM group range : %s\n", range_str);
}
json_object *json;
json = json_object_new_object();
json_object_string_add(json, "groupType", type_str);
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
} else
vty_out(vty, "Group type : %s\n", type_str);
}
SLIST_FOREACH (mg, &pim->msdp.mglist, mg_entry)
ip_msdp_show_mesh_group(vty, mg, json);
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
return CMD_SUCCESS;
}
ip_msdp_show_mesh_group(vty, mg, vrf_json);
}
- if (uj) {
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
+
return CMD_SUCCESS;
}
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void ip_msdp_show_peers_detail(struct pim_instance *pim, struct vty *vty,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
DEFUN (show_ip_msdp_peer_detail,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void ip_msdp_show_sa_entry_detail(struct pim_msdp_sa *sa,
json);
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
DEFUN (show_ip_msdp_sa_detail,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void ip_msdp_show_sa_sg(struct pim_instance *pim, struct vty *vty,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
DEFUN (show_ip_msdp_sa_sg,
cwd.json = json;
hash_iterate(pim->vxlan.sg_hash, pim_show_vxlan_sg_hash_entry, &cwd);
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_vxlan_sg_match_addr(struct pim_instance *pim,
cwd.addr_match = true;
hash_iterate(pim->vxlan.sg_hash, pim_show_vxlan_sg_hash_entry, &cwd);
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
static void pim_show_vxlan_sg_one(struct pim_instance *pim,
}
}
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
DEFUN (show_ip_pim_vxlan_sg,
for (ALL_LIST_ELEMENTS_RO(pim_vxlan_p->work_list, node, vxlan_sg))
pim_show_vxlan_sg_entry(vxlan_sg, &cwd);
- if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
- }
+ if (uj)
+ vty_json(vty, json);
}
DEFUN_HIDDEN (show_ip_pim_vxlan_sg_work,