]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd, ospf6d: add qobj registrations
authorDavid Lamparter <equinox@opensourcerouting.org>
Wed, 7 Dec 2016 12:25:38 +0000 (13:25 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 9 Dec 2016 16:36:25 +0000 (17:36 +0100)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ospf6d/ospf6_interface.c
ospf6d/ospf6_interface.h
ospf6d/ospf6_top.c
ospf6d/ospf6_top.h
ospfd/ospf_interface.c
ospfd/ospf_interface.h
ospfd/ospfd.c
ospfd/ospfd.h

index 74c9ac739fc8f9f235a076a2ddb0a8354b9a2ce1..dd63f00c7ee05788e1489b6dfd4e72117e5e1afd 100644 (file)
@@ -46,6 +46,7 @@
 #include "ospf6_bfd.h"
 
 DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names")
+DEFINE_QOBJ_TYPE(ospf6_interface)
 
 unsigned char conf_debug_ospf6_interface = 0;
 
@@ -212,6 +213,8 @@ ospf6_interface_create (struct interface *ifp)
       oi->ifmtu = iobuflen;
     }
 
+  QOBJ_REG (oi, ospf6_interface);
+
   oi->lsupdate_list = ospf6_lsdb_create (oi);
   oi->lsack_list = ospf6_lsdb_create (oi);
   oi->lsdb = ospf6_lsdb_create (oi);
@@ -238,6 +241,8 @@ ospf6_interface_delete (struct ospf6_interface *oi)
   struct listnode *node, *nnode;
   struct ospf6_neighbor *on;
 
+  QOBJ_UNREG (oi);
+
   for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on))
       ospf6_neighbor_delete (on);
   
index 3e09bfb9301610e35d27102127f0ed467a03b24c..179477a634d2d18e49bd66c0e893768ecffe702c 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef OSPF6_INTERFACE_H
 #define OSPF6_INTERFACE_H
 
+#include "qobj.h"
 #include "if.h"
 
 /* Debug option */
@@ -116,7 +117,10 @@ struct ospf6_interface
 
   /* BFD information */
   void *bfd_info;
+
+  QOBJ_FIELDS
 };
+DECLARE_QOBJ_TYPE(ospf6_interface)
 
 /* interface state */
 #define OSPF6_INTERFACE_NONE             0
index 16fb012ea95d9b07394eae61c9450eb973ae2d2e..238053231a894fad2795afd7892716e97de3685f 100644 (file)
@@ -49,6 +49,8 @@
 #include "ospf6_spf.h"
 #include "ospf6d.h"
 
+DEFINE_QOBJ_TYPE(ospf6)
+
 /* global ospf6d variable */
 struct ospf6 *ospf6;
 
@@ -159,6 +161,7 @@ ospf6_create (void)
 
   /* Enable "log-adjacency-changes" */
   SET_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
+  QOBJ_REG (o, ospf6);
 
   return o;
 }
@@ -169,6 +172,7 @@ ospf6_delete (struct ospf6 *o)
   struct listnode *node, *nnode;
   struct ospf6_area *oa;
 
+  QOBJ_UNREG (o);
   ospf6_disable (ospf6);
 
   for (ALL_LIST_ELEMENTS (o->area_list, node, nnode, oa))
index 8985eeaa287e75524fdb314122cae9b250ec204d..42a4d124838bef68b0458f23a4c825a051a4d130 100644 (file)
@@ -22,6 +22,7 @@
 #ifndef OSPF6_TOP_H
 #define OSPF6_TOP_H
 
+#include "qobj.h"
 #include "routemap.h"
 
 /* OSPFv3 top level data structure */
@@ -93,7 +94,10 @@ struct ospf6
   u_char distance_external;
 
   struct route_table *distance_table;
+
+  QOBJ_FIELDS
 };
+DECLARE_QOBJ_TYPE(ospf6)
 
 #define OSPF6_DISABLED    0x01
 #define OSPF6_STUB_ROUTER 0x02
index 8440765579697487297822318d58aa04725daf5c..936ec69666b80e8d4653780b6755510d73a277b4 100644 (file)
@@ -51,6 +51,7 @@
 #include "ospfd/ospf_snmp.h"
 #endif /* HAVE_SNMP */
 
+DEFINE_QOBJ_TYPE(ospf_interface)
 
 int
 ospf_if_get_output_cost (struct ospf_interface *oi)
@@ -246,7 +247,8 @@ ospf_if_new (struct ospf *ospf, struct interface *ifp, struct prefix *p)
   ospf_opaque_type9_lsa_init (oi);
 
   oi->ospf = ospf;
-  
+  QOBJ_REG (oi, ospf_interface);
+
   return oi;
 }
 
@@ -307,6 +309,8 @@ ospf_if_free (struct ospf_interface *oi)
 
   ospf_opaque_type9_lsa_term (oi);
 
+  QOBJ_UNREG (oi);
+
   /* Free Pseudo Neighbour */
   ospf_nbr_delete (oi->nbr_self);
   
index 7a74288bff1fd307404a0d3a1437c9401870b1da..bd51bbf422a5c617415b629e39e475de06ea16de 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef _ZEBRA_OSPF_INTERFACE_H
 #define _ZEBRA_OSPF_INTERFACE_H
 
+#include "qobj.h"
 #include "ospfd/ospf_packet.h"
 #include "ospfd/ospf_spf.h"
 
@@ -228,7 +229,10 @@ struct ospf_interface
   u_int32_t state_change;      /* Number of status change. */
 
   u_int32_t full_nbrs;
+
+  QOBJ_FIELDS
 };
+DECLARE_QOBJ_TYPE(ospf_interface)
 
 /* Prototypes. */
 extern char *ospf_if_name (struct ospf_interface *);
index 1a7691c5293c9cbe29aafb85dd48b07500495264..b7542c2a8b8d6b71b7539f3206fc4993eddfc351 100644 (file)
@@ -55,6 +55,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include "ospfd/ospf_ase.h"
 
 
+DEFINE_QOBJ_TYPE(ospf)
 
 /* OSPF process wide configuration. */
 static struct ospf_master ospf_master;
@@ -292,6 +293,8 @@ ospf_new (u_short instance)
   
   /* Enable "log-adjacency-changes" */
   SET_FLAG(new->config, OSPF_LOG_ADJACENCY_CHANGES);
+  QOBJ_REG (new, ospf);
+
   return new;
 }
 
@@ -505,6 +508,8 @@ ospf_finish_final (struct ospf *ospf)
   int i;
   u_short instance = 0;
 
+  QOBJ_UNREG (ospf);
+
   ospf_opaque_type11_lsa_term (ospf);
   
   /* be nice if this worked, but it doesn't */
index 41a7a30d85ccf8ffc1bdbc2795d5e008d4d4cb47..a9e3efeeabf717b62ccf6c774cb20248bb70aba9 100644 (file)
@@ -24,6 +24,7 @@
 #define _ZEBRA_OSPFD_H
 
 #include <zebra.h>
+#include "qobj.h"
 #include "libospf.h"
 
 #include "filter.h"
@@ -302,7 +303,10 @@ struct ospf
   u_int32_t if_ospf_cli_count;
 
   struct route_table *distance_table;
+
+  QOBJ_FIELDS
 };
+DECLARE_QOBJ_TYPE(ospf)
 
 /* OSPF area structure. */
 struct ospf_area