2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-25 15:07:05 +00:00

notifiers: Create and destroy nln_notifiers.

This patch changes the interface of netlink-notifier and
rtnetlink-link.  Now nln_notifiers are allocated and destroyed by
the module instead of passed in by callers.  This allows the
definition of nln_notifier to be hidden, and generally cleans up
the code.
This commit is contained in:
Ethan Jackson
2011-09-15 11:21:23 -07:00
parent 18a2378164
commit 2ee6545f2b
8 changed files with 81 additions and 62 deletions

View File

@@ -23,6 +23,8 @@
#include "list.h"
struct nln;
struct nln_notifier;
struct nlattr;
struct ofpbuf;
@@ -37,18 +39,12 @@ typedef void nln_notify_func(const void *change, void *aux);
* should be parsed into 'change' as specified in nln_create(). */
typedef bool nln_parse_func(struct ofpbuf *buf, void *change);
struct nln_notifier {
struct list node;
nln_notify_func *cb;
void *aux;
};
struct nln *nln_create(int protocol, int multicast_group, nln_parse_func *,
void *change);
void nln_destroy(struct nln *);
int nln_notifier_register(struct nln *, struct nln_notifier *,
nln_notify_func *, void *aux);
void nln_notifier_unregister(struct nln *, struct nln_notifier *);
struct nln_notifier *nln_notifier_create(struct nln *, nln_notify_func *,
void *aux);
void nln_notifier_destroy(struct nln_notifier *);
void nln_run(struct nln *);
void nln_wait(struct nln *);
#endif /* netlink-notifier.h */