2019-03-07 16:17:34 +00:00
|
|
|
/*
|
|
|
|
* BIRD Internet Routing Daemon -- Notificators and Listeners
|
|
|
|
*
|
|
|
|
* (c) 2019 Maria Matejka <mq@jmq.cz>
|
|
|
|
*
|
|
|
|
* Can be freely distributed and used under the terms of the GNU GPL.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nest/bird.h"
|
|
|
|
#include "lib/resource.h"
|
|
|
|
#include "nest/notify.h"
|
|
|
|
|
2019-03-11 21:23:20 +00:00
|
|
|
LISTENER_DECL(void);
|
2019-03-07 16:17:34 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
listener_unsubscribe(resource *r)
|
|
|
|
{
|
2019-03-11 21:23:20 +00:00
|
|
|
LISTENER(void) *L = (LISTENER(void) *) r;
|
2019-03-07 16:17:34 +00:00
|
|
|
rem_node(&(L->n));
|
|
|
|
CALL(L->unsubscribe, L->self);
|
|
|
|
}
|
|
|
|
|
2019-03-11 21:23:20 +00:00
|
|
|
struct resclass listener_class = {
|
2019-03-07 16:17:34 +00:00
|
|
|
.name = "Listener",
|
2019-03-11 21:23:20 +00:00
|
|
|
.size = sizeof(LISTENER(void)),
|
2019-03-07 16:17:34 +00:00
|
|
|
.free = listener_unsubscribe,
|
|
|
|
.dump = NULL,
|
|
|
|
.lookup = NULL,
|
|
|
|
.memsize = NULL,
|
|
|
|
};
|