diff options
Diffstat (limited to 'bgpd/bgp_notification.c')
-rw-r--r-- | bgpd/bgp_notification.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/bgpd/bgp_notification.c b/bgpd/bgp_notification.c index bd52d516..392289d0 100644 --- a/bgpd/bgp_notification.c +++ b/bgpd/bgp_notification.c @@ -73,6 +73,18 @@ bgp_notify_new(bgp_nom_code_t code, bgp_nom_subcode_t subcode, } ; /*------------------------------------------------------------------------------ + * Free notification structure + * + * Does nothing if there is no structure. + */ +extern void +bgp_notify_free(bgp_notify notification) +{ + if (notification != NULL) + XFREE(MTYPE_BGP_NOTIFY, notification) ; +} ; + +/*------------------------------------------------------------------------------ * Duplicate existing notification (if any) */ extern bgp_notify @@ -94,7 +106,19 @@ bgp_notify_dup(bgp_notify notification) } ; /*------------------------------------------------------------------------------ - * Set notification (if any) + * Unset pointer to notification and free any existing notification structure. + * + * Does nothing if there is no structure. + */ +extern void +bgp_notify_unset(bgp_notify* p_notification) +{ + if (*p_notification != NULL) + XFREE(MTYPE_BGP_NOTIFY, *p_notification) ; /* sets *p_notification NULL */ +} ; + +/*------------------------------------------------------------------------------ + * Set pointer to notification * * Frees any existing notification at the destination. * @@ -109,7 +133,7 @@ bgp_notify_set(bgp_notify* p_dst, bgp_notify src) } ; /*------------------------------------------------------------------------------ - * Set notification (if any) to a *copy* of the source. + * Set pointer to notification to a *copy* of the source. * * Frees any existing notification at the destination. */ @@ -120,7 +144,7 @@ bgp_notify_set_dup(bgp_notify* p_dst, bgp_notify src) } ; /*------------------------------------------------------------------------------ - * Set notification (if any) and set source pointer NULL + * Set pointer to notification and unset source pointer * * Frees any existing notification at the destination. * @@ -134,18 +158,6 @@ bgp_notify_set_mov(bgp_notify* p_dst, bgp_notify* p_src) *p_src = NULL ; } ; -/*------------------------------------------------------------------------------ - * Free notification structure - * - * Does nothing if there is no structure. - */ -extern void -bgp_notify_free(bgp_notify* p_notification) -{ - if (*p_notification != NULL) - XFREE(MTYPE_BGP_NOTIFY, *p_notification) ; /* sets *p_notification NULL */ -} ; - /*============================================================================== * Append data to given notification * |