summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink/netlink-internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-internal.h')
-rw-r--r--src/libsystemd/sd-netlink/netlink-internal.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-internal.h b/src/libsystemd/sd-netlink/netlink-internal.h
index dd4fa9d2af..98de4f0a83 100644
--- a/src/libsystemd/sd-netlink/netlink-internal.h
+++ b/src/libsystemd/sd-netlink/netlink-internal.h
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
-
#include <linux/netlink.h>
#include "sd-netlink.h"
@@ -20,7 +19,6 @@
struct reply_callback {
sd_netlink_message_handler_t callback;
- void *userdata;
usec_t timeout;
uint64_t serial;
unsigned prioq_idx;
@@ -29,11 +27,34 @@ struct reply_callback {
struct match_callback {
sd_netlink_message_handler_t callback;
uint16_t type;
- void *userdata;
LIST_FIELDS(struct match_callback, match_callbacks);
};
+typedef enum NetlinkSlotType {
+ NETLINK_REPLY_CALLBACK,
+ NETLINK_MATCH_CALLBACK,
+ _NETLINK_SLOT_INVALID = -1,
+} NetlinkSlotType;
+
+struct sd_netlink_slot {
+ unsigned n_ref;
+ sd_netlink *netlink;
+ void *userdata;
+ sd_netlink_destroy_t destroy_callback;
+ NetlinkSlotType type:2;
+
+ bool floating:1;
+ char *description;
+
+ LIST_FIELDS(sd_netlink_slot, slots);
+
+ union {
+ struct reply_callback reply_callback;
+ struct match_callback match_callback;
+ };
+};
+
struct sd_netlink {
RefCount n_ref;
@@ -69,6 +90,8 @@ struct sd_netlink {
LIST_HEAD(struct match_callback, match_callbacks);
+ LIST_HEAD(sd_netlink_slot, slots);
+
pid_t original_pid;
sd_event_source *io_event_source;