diff options
author | Chris Hall <GMCH@hestia.halldom.com> | 2010-01-08 16:15:10 +0000 |
---|---|---|
committer | Chris Hall <GMCH@hestia.halldom.com> | 2010-01-08 16:15:10 +0000 |
commit | 6e8c7923b6f25b7fc4ef47876fcdd82473b29280 (patch) | |
tree | 5c0d02cadf77d7dde6276fba40de1767c89f8174 /bgpd/bgp_notification.c | |
parent | 6b5024b3c14b0acf5d4ec05f7ea78a7323c96d59 (diff) | |
download | quagga-6e8c7923b6f25b7fc4ef47876fcdd82473b29280.tar.bz2 quagga-6e8c7923b6f25b7fc4ef47876fcdd82473b29280.tar.xz |
Further work-in-progress.
modified: bgpd/Makefile.am
modified: bgpd/bgp_common.h
modified: bgpd/bgp_connection.c
modified: bgpd/bgp_connection.h
modified: bgpd/bgp_engine.c
modified: bgpd/bgp_fsm.c
modified: bgpd/bgp_fsm.h
new file: bgpd/bgp_msg_write.c
new file: bgpd/bgp_msg_write.h
modified: bgpd/bgp_notification.c
modified: bgpd/bgp_notification.h
modified: bgpd/bgp_session.c
modified: bgpd/bgp_session.h
modified: lib/sockunion.h
Diffstat (limited to 'bgpd/bgp_notification.c')
-rw-r--r-- | bgpd/bgp_notification.c | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/bgpd/bgp_notification.c b/bgpd/bgp_notification.c index 49165626..3f6ecad9 100644 --- a/bgpd/bgp_notification.c +++ b/bgpd/bgp_notification.c @@ -91,6 +91,11 @@ bgp_notify_dup(bgp_notify notification) /*------------------------------------------------------------------------------ * Set notification (if any) + * + * Frees any existing notification at the destination. + * + * NB: copies the source pointer -- so must be clear about responsibility + * for the notification structure. */ extern void bgp_notify_set(bgp_notify* p_dst, bgp_notify src) @@ -100,7 +105,9 @@ bgp_notify_set(bgp_notify* p_dst, bgp_notify src) } ; /*------------------------------------------------------------------------------ - * Set notification (if any) + * Set notification (if any) to a *copy* of the source. + * + * Frees any existing notification at the destination. */ extern void bgp_notify_set_dup(bgp_notify* p_dst, bgp_notify src) @@ -109,19 +116,30 @@ bgp_notify_set_dup(bgp_notify* p_dst, bgp_notify src) } ; /*------------------------------------------------------------------------------ - * Free notification structure + * Set notification (if any) and set source pointer NULL * - * Does nothing if there is no structure. + * Frees any existing notification at the destination. * - * Returns: NULL + * NB: responsibility for the notification structure passes to the destination. */ -extern bgp_notify -bgp_notify_free(bgp_notify notification) +extern void +bgp_notify_set_mov(bgp_notify* p_dst, bgp_notify* p_src) { - if (notification != NULL) - XFREE(MTYPE_BGP_NOTIFY, notification) ; + bgp_notify_free(*p_dst) ; + *p_dst = *p_src ; + *p_src = NULL ; +} ; - return 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 */ } ; /*============================================================================== |