}
}
-void ospf_apiserver_show_info(struct vty *vty, struct ospf_lsa *lsa)
+void ospf_apiserver_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct opaque_lsa {
struct lsa_header header;
struct opaque_lsa *olsa;
int opaquelen;
+ if (json)
+ return;
+
olsa = (struct opaque_lsa *)lsa->data;
if (VALID_OPAQUE_INFO_LEN(lsa->data))
extern void ospf_apiserver_config_write_router(struct vty *vty);
extern void ospf_apiserver_config_write_if(struct vty *vty,
struct interface *ifp);
-extern void ospf_apiserver_show_info(struct vty *vty, struct ospf_lsa *lsa);
+extern void ospf_apiserver_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
extern int ospf_ospf_apiserver_lsa_originator(void *arg);
extern struct ospf_lsa *ospf_apiserver_lsa_refresher(struct ospf_lsa *lsa);
extern void ospf_apiserver_flush_opaque_lsa(struct ospf_apiserver *apiserv,
*/
/* Extended Prefix Opaque LSA related callback functions */
-static void ospf_ext_pref_show_info(struct vty *vty, struct ospf_lsa *lsa);
+static void ospf_ext_pref_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
static int ospf_ext_pref_lsa_originate(void *arg);
static struct ospf_lsa *ospf_ext_pref_lsa_refresh(struct ospf_lsa *lsa);
static void ospf_ext_pref_lsa_schedule(struct ext_itf *exti,
static int ospf_ext_link_del_if(struct interface *ifp);
static void ospf_ext_ism_change(struct ospf_interface *oi, int old_status);
static void ospf_ext_link_nsm_change(struct ospf_neighbor *nbr, int old_status);
-static void ospf_ext_link_show_info(struct vty *vty, struct ospf_lsa *lsa);
+static void ospf_ext_link_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
static int ospf_ext_link_lsa_originate(void *arg);
static struct ospf_lsa *ospf_ext_link_lsa_refresh(struct ospf_lsa *lsa);
static void ospf_ext_link_lsa_schedule(struct ext_itf *exti,
}
/* Extended Link TLVs */
-static void ospf_ext_link_show_info(struct vty *vty, struct ospf_lsa *lsa)
+static void ospf_ext_link_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct lsa_header *lsah = lsa->data;
struct tlv_header *tlvh;
uint16_t length = 0, sum = 0;
+ if (json)
+ return;
+
/* Initialize TLV browsing */
length = lsa->size - OSPF_LSA_HEADER_SIZE;
}
/* Extended Prefix TLVs */
-static void ospf_ext_pref_show_info(struct vty *vty, struct ospf_lsa *lsa)
+static void ospf_ext_pref_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct lsa_header *lsah = lsa->data;
struct tlv_header *tlvh;
uint16_t length = 0, sum = 0;
+ if (json)
+ return;
+
/* Initialize TLV browsing */
length = lsa->size - OSPF_LSA_HEADER_SIZE;
"Router is in the process of graceful restart",
};
-static void show_ospf_grace_lsa_info(struct vty *vty, struct ospf_lsa *lsa);
+static void show_ospf_grace_lsa_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
static bool ospf_check_change_in_rxmt_list(struct ospf_neighbor *nbr);
static unsigned int ospf_enable_rtr_hash_key(const void *data)
* Returns:
* Nothing.
*/
-static void show_ospf_grace_lsa_info(struct vty *vty, struct ospf_lsa *lsa)
+static void show_ospf_grace_lsa_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct lsa_header *lsah = NULL;
struct tlv_header *tlvh = NULL;
uint16_t length = 0;
int sum = 0;
+ if (json)
+ return;
+
lsah = (struct lsa_header *)lsa->data;
if (lsa->size <= OSPF_LSA_HEADER_SIZE) {
void (*config_write_router)(struct vty *vty);
void (*config_write_if)(struct vty *vty, struct interface *ifp);
void (*config_write_debug)(struct vty *vty);
- void (*show_opaque_info)(struct vty *vty, struct ospf_lsa *lsa);
+ void (*show_opaque_info)(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
int (*lsa_originator)(void *arg);
struct ospf_lsa *(*lsa_refresher)(struct ospf_lsa *lsa);
int (*new_lsa_hook)(struct ospf_lsa *lsa);
void (*config_write_router)(struct vty *vty),
void (*config_write_if)(struct vty *vty, struct interface *ifp),
void (*config_write_debug)(struct vty *vty),
- void (*show_opaque_info)(struct vty *vty, struct ospf_lsa *lsa),
+ void (*show_opaque_info)(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa),
int (*lsa_originator)(void *arg),
struct ospf_lsa *(*lsa_refresher)(struct ospf_lsa *lsa),
int (*new_lsa_hook)(struct ospf_lsa *lsa),
/* Call individual output functions. */
if ((functab = ospf_opaque_functab_lookup(lsa)) != NULL)
if (functab->show_opaque_info != NULL)
- (*functab->show_opaque_info)(vty, lsa);
+ (*functab->show_opaque_info)(vty, json, lsa);
return;
}
void (*config_write_router)(struct vty *vty),
void (*config_write_if)(struct vty *vty, struct interface *ifp),
void (*config_write_debug)(struct vty *vty),
- void (*show_opaque_info)(struct vty *vty, struct ospf_lsa *lsa),
+ void (*show_opaque_info)(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa),
int (*lsa_originator)(void *arg),
struct ospf_lsa *(*lsa_refresher)(struct ospf_lsa *lsa),
int (*new_lsa_hook)(struct ospf_lsa *lsa),
static void ospf_router_info_ism_change(struct ospf_interface *oi,
int old_status);
static void ospf_router_info_config_write_router(struct vty *vty);
-static void ospf_router_info_show_info(struct vty *vty, struct ospf_lsa *lsa);
+static void ospf_router_info_show_info(struct vty *vty,
+ struct json_object *json,
+ struct ospf_lsa *lsa);
static int ospf_router_info_lsa_originate(void *arg);
static struct ospf_lsa *ospf_router_info_lsa_refresh(struct ospf_lsa *lsa);
static void ospf_router_info_lsa_schedule(struct ospf_ri_area_info *ai,
return TLV_SIZE(tlvh);
}
-static void ospf_router_info_show_info(struct vty *vty, struct ospf_lsa *lsa)
+static void ospf_router_info_show_info(struct vty *vty,
+ struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct lsa_header *lsah = lsa->data;
struct tlv_header *tlvh;
uint16_t length = 0, sum = 0;
+ if (json)
+ return;
+
/* Initialize TLV browsing */
length = lsa->size - OSPF_LSA_HEADER_SIZE;
static void ospf_mpls_te_ism_change(struct ospf_interface *oi, int old_status);
static void ospf_mpls_te_nsm_change(struct ospf_neighbor *nbr, int old_status);
static void ospf_mpls_te_config_write_router(struct vty *vty);
-static void ospf_mpls_te_show_info(struct vty *vty, struct ospf_lsa *lsa);
+static void ospf_mpls_te_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa);
static int ospf_mpls_te_lsa_originate_area(void *arg);
static int ospf_mpls_te_lsa_inter_as_as(void *arg);
static int ospf_mpls_te_lsa_inter_as_area(void *arg);
return sum;
}
-static void ospf_mpls_te_show_info(struct vty *vty, struct ospf_lsa *lsa)
+static void ospf_mpls_te_show_info(struct vty *vty, struct json_object *json,
+ struct ospf_lsa *lsa)
{
struct lsa_header *lsah = lsa->data;
struct tlv_header *tlvh, *next;
uint16_t (*subfunc)(struct vty * vty, struct tlv_header * tlvh,
uint16_t subtotal, uint16_t total) = NULL;
+ if (json)
+ return;
+
sum = 0;
total = lsa->size - OSPF_LSA_HEADER_SIZE;