From d37513a372b0d5b133f59293af185ec831e2456f Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Mon, 24 Jan 2022 15:48:18 +0100 Subject: Neighbors: Locking and asynchronous notifications --- nest/iface.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'nest/iface.h') diff --git a/nest/iface.h b/nest/iface.h index b3dcc408..5deb5432 100644 --- a/nest/iface.h +++ b/nest/iface.h @@ -9,10 +9,20 @@ #ifndef _BIRD_IFACE_H_ #define _BIRD_IFACE_H_ +#include "lib/event.h" #include "lib/lists.h" #include "lib/ip.h" +#include "lib/locking.h" +DEFINE_DOMAIN(attrs); extern list global_iface_list; +extern DOMAIN(attrs) iface_domain; + +#define IFACE_LEGACY_ACCESS ASSERT_DIE(birdloop_inside(&main_birdloop)) + +#define IFACE_LOCK LOCK_DOMAIN(attrs, iface_domain) +#define IFACE_UNLOCK UNLOCK_DOMAIN(attrs, iface_domain) +#define ASSERT_IFACE_LOCKED ASSERT_DIE(DOMAIN_IS_LOCKED(attrs, iface_domain)) struct proto; struct pool; @@ -131,6 +141,7 @@ typedef struct neighbor { struct ifa *ifa; /* Ifa on related iface */ struct iface *iface; /* Interface it's connected to */ struct iface *ifreq; /* Requested iface, NULL for any */ + struct event event; /* Notification event */ struct proto *proto; /* Protocol this belongs to */ void *data; /* Protocol-specific data */ uint aux; /* Protocol-specific data */ -- cgit v1.2.3