diff options
author | Ilya A. Evenbach <ievenbach@aurora.tech> | 2024-04-23 11:50:36 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-05-06 09:59:00 (GMT) |
commit | 1dbdc30a6b9f96355aadf69899f124480aa4d374 (patch) | |
tree | 12d4d24e2d09168dcb027924b424982450a34548 /include | |
parent | 18b74e08383b40f116902a2b9ebb93c8599a923f (diff) | |
download | libnl-1dbdc30a6b9f96355aadf69899f124480aa4d374.zip libnl-1dbdc30a6b9f96355aadf69899f124480aa4d374.tar.gz libnl-1dbdc30a6b9f96355aadf69899f124480aa4d374.tar.bz2 |
cache: allow to allocate cache manager with custom refill socket
Cache managers use two sockets: one for cache refill operation,
and another one for notifications.
In order to simulate NETLINK events by reading data from files,
we need to be able to overwrite callbacks for both sockets.
This new function allows us to set up refill socket any way we want.
It does have requirement that the refill socket be blocking.
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/cache.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/netlink/cache.h b/include/netlink/cache.h index abeeccb..faa61a7 100644 --- a/include/netlink/cache.h +++ b/include/netlink/cache.h @@ -140,12 +140,17 @@ extern struct nl_cache * __nl_cache_mngt_require(const char *); struct nl_cache_mngr; -#define NL_AUTO_PROVIDE 1 -#define NL_ALLOCATED_SOCK 2 /* For internal use only, do not use */ +#define NL_AUTO_PROVIDE 1 +#define NL_ALLOCATED_SOCK 2 /* For internal use only, do not use */ +#define NL_ALLOCATED_SYNC_SOCK 4 /* For internal use only, do not use */ extern int nl_cache_mngr_alloc(struct nl_sock *, int, int, struct nl_cache_mngr **); +extern int nl_cache_mngr_alloc_ex(struct nl_sock *, + struct nl_sock *, + int, int, + struct nl_cache_mngr **); extern int nl_cache_mngr_add(struct nl_cache_mngr *, const char *, change_func_t, |