diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2016-12-07 12:25:24 +0100 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2016-12-09 17:36:25 +0100 |
commit | 19df7279f77cc4513ccd63ce19596a7af7a95f23 (patch) | |
tree | 9b4f388e7b5b79704ef7418d1749fe4d1d7396f3 /bgpd | |
parent | Merge branch 'fixes/command' (diff) | |
download | frr-19df7279f77cc4513ccd63ce19596a7af7a95f23.tar.xz frr-19df7279f77cc4513ccd63ce19596a7af7a95f23.zip |
bgpd: add qobj registrations
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/bgpd.c | 15 | ||||
-rw-r--r-- | bgpd/bgpd.h | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 6d479e102..5ed630b49 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -78,6 +78,10 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #include "bgpd/bgp_bfd.h" #include "bgpd/bgp_memory.h" +DEFINE_QOBJ_TYPE(bgp_master) +DEFINE_QOBJ_TYPE(bgp) +DEFINE_QOBJ_TYPE(peer) + /* BGP process wide configuration. */ static struct bgp_master bgp_master; @@ -1018,6 +1022,8 @@ peer_free (struct peer *peer) { assert (peer->status == Deleted); + QOBJ_UNREG (peer); + /* this /ought/ to have been done already through bgp_stop earlier, * but just to be sure.. */ @@ -1201,6 +1207,7 @@ peer_new (struct bgp *bgp) sp = getservbyname ("bgp", "tcp"); peer->port = (sp == NULL) ? BGP_PORT_DEFAULT : ntohs (sp->s_port); + QOBJ_REG (peer, peer); return peer; } @@ -2917,6 +2924,8 @@ bgp_create (as_t *as, const char *name, enum bgp_instance_type inst_type) bgp->wpkt_quanta = BGP_WRITE_PACKET_MAX; bgp->coalesce_time = BGP_DEFAULT_SUBGROUP_COALESCE_TIME; + QOBJ_REG (bgp, bgp); + update_bgp_group_init(bgp); return bgp; } @@ -3233,6 +3242,8 @@ bgp_free (struct bgp *bgp) afi_t afi; safi_t safi; + QOBJ_UNREG (bgp); + list_delete (bgp->group); list_delete (bgp->peer); @@ -7481,6 +7492,8 @@ bgp_master_init (void) /* Enable multiple instances by default. */ bgp_option_set (BGP_OPT_MULTIPLE_INSTANCE); + + QOBJ_REG (bm, bgp_master); } /* @@ -7582,6 +7595,8 @@ bgp_terminate (void) struct listnode *node, *nnode; struct listnode *mnode, *mnnode; + QOBJ_UNREG (bm); + /* Close the listener sockets first as this prevents peers from attempting * to reconnect on receiving the peer unconfig message. In the presence * of a large number of peers this will ensure that no peer is left with diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 510082fdc..86fa207b6 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -21,6 +21,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA #ifndef _QUAGGA_BGPD_H #define _QUAGGA_BGPD_H +#include "qobj.h" #include "lib/json.h" #include "vrf.h" @@ -120,7 +121,10 @@ struct bgp_master struct thread *t_rmap_update; /* Handle route map updates */ u_int32_t rmap_update_timer; /* Route map update timer */ #define RMAP_DEFAULT_UPDATE_TIMER 5 /* disabled by default */ + + QOBJ_FIELDS }; +DECLARE_QOBJ_TYPE(bgp_master) /* BGP route-map structure. */ struct bgp_rmap @@ -356,7 +360,10 @@ struct bgp struct rfapi_cfg *rfapi_cfg; struct rfapi *rfapi; #endif + + QOBJ_FIELDS }; +DECLARE_QOBJ_TYPE(bgp) #define BGP_ROUTE_ADV_HOLD(bgp) (bgp->main_peers_update_hold) @@ -879,7 +886,10 @@ u_char last_reset_cause[BGP_MAX_PACKET_SIZE]; /* hostname and domainname advertised by host */ char *hostname; char *domainname; + + QOBJ_FIELDS }; +DECLARE_QOBJ_TYPE(peer) /* Check if suppress start/restart of sessions to peer. */ #define BGP_PEER_START_SUPPRESSED(P) \ |