diff options
author | Maria Matejka <mq@ucw.cz> | 2022-01-24 15:48:18 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-02-03 10:30:33 +0100 |
commit | d37513a372b0d5b133f59293af185ec831e2456f (patch) | |
tree | ef710a0adcc81bbf725b4a39e0fd3ae50df3117e /nest/iface.h | |
parent | c651cef737c7c7578c26bd787c0abd3c364bf4b8 (diff) |
Neighbors: Locking and asynchronous notifications
Diffstat (limited to 'nest/iface.h')
-rw-r--r-- | nest/iface.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 */ |