]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_ext.c
bgpd: fix time truncation due to parameter type
[mirror_frr.git] / ospfd / ospf_ext.c
index 2d08eeece23427f715a674e24a366baf973198fb..1288686a1028e5bfe3f26699030280054d16cd97 100644 (file)
@@ -74,13 +74,14 @@ static struct ospf_ext_lp OspfEXT;
 
 /*
  * -----------------------------------------------------------------------
- * 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,
@@ -90,7 +91,8 @@ static int ospf_ext_link_new_if(struct interface *ifp);
 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,
@@ -112,7 +114,7 @@ int ospf_ext_init(void)
 {
        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;
@@ -214,7 +216,7 @@ void ospf_ext_finish(void)
 
 /*
  * ---------------------------------------------------------------------
- * Followings are control functions for Extended Prefix/Link Opaque LSA
+ * Following are control functions for Extended Prefix/Link Opaque LSA
  * parameters management.
  * ---------------------------------------------------------------------
  */
@@ -254,10 +256,10 @@ static uint32_t get_ext_link_instance_value(void)
 /* 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;
 
@@ -679,7 +681,7 @@ void ospf_ext_update_sr(bool enable)
 
 /*
  * -----------------------------------------------------------------------
- * Followings are callback functions against generic Opaque-LSAs handling
+ * Following are callback functions against generic Opaque-LSAs handling
  * -----------------------------------------------------------------------
  */
 
@@ -983,7 +985,7 @@ static int ospf_ext_pref_lsa_update(struct ospf_lsa *lsa)
 
 /*
  * -------------------------------------------------------
- * Followings are OSPF protocol processing functions for
+ * Following are OSPF protocol processing functions for
  * Extended Prefix/Link Opaque LSA
  * -------------------------------------------------------
  */
@@ -1711,7 +1713,7 @@ static void ospf_ext_lsa_schedule(struct ext_itf *exti, enum lsa_opcode op)
 
 /*
  * ------------------------------------
- * Followings are vty show functions.
+ * Following are vty show functions.
  * ------------------------------------
  */
 
@@ -1846,12 +1848,16 @@ static uint16_t show_vty_link_info(struct vty *vty, struct tlv_header *ext,
 }
 
 /* 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;
 
@@ -1932,12 +1938,16 @@ static uint16_t show_vty_pref_info(struct vty *vty, struct tlv_header *ext,
 }
 
 /* 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;