/*
* -----------------------------------------------------------------------
- * Followings are initialize/terminate functions for Extended Prefix/Link
+ * Following are initialize/terminate functions for Extended Prefix/Link
* Opaque LSA handling.
* -----------------------------------------------------------------------
*/
/* 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,
{
int rc = 0;
- memset(&OspfEXT, 0, sizeof(struct ospf_ext_lp));
+ memset(&OspfEXT, 0, sizeof(OspfEXT));
OspfEXT.enabled = false;
/* Only Area flooding is supported yet */
OspfEXT.scope = OSPF_OPAQUE_AREA_LSA;
/*
* ---------------------------------------------------------------------
- * Followings are control functions for Extended Prefix/Link Opaque LSA
+ * Following are control functions for Extended Prefix/Link Opaque LSA
* parameters management.
* ---------------------------------------------------------------------
*/
/* Lookup Extended Prefix/Links by ifp from OspfEXT struct iflist */
static struct ext_itf *lookup_ext_by_ifp(struct interface *ifp)
{
- struct listnode *node, *nnode;
+ struct listnode *node;
struct ext_itf *exti;
- for (ALL_LIST_ELEMENTS(OspfEXT.iflist, node, nnode, exti))
+ for (ALL_LIST_ELEMENTS_RO(OspfEXT.iflist, node, exti))
if (exti->ifp == ifp)
return exti;
/*
* -----------------------------------------------------------------------
- * Followings are callback functions against generic Opaque-LSAs handling
+ * Following are callback functions against generic Opaque-LSAs handling
* -----------------------------------------------------------------------
*/
/*
* -------------------------------------------------------
- * Followings are OSPF protocol processing functions for
+ * Following are OSPF protocol processing functions for
* Extended Prefix/Link Opaque LSA
* -------------------------------------------------------
*/
/*
* ------------------------------------
- * Followings are vty show functions.
+ * Following are vty show functions.
* ------------------------------------
*/
}
/* 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;