Skip to content

Commit 4256379

Browse files
committed
sd-netlink: introduce netlink_get_reply_callback_count()
1 parent 4db7cb3 commit 4256379

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/libsystemd/sd-netlink/netlink-util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,5 +107,7 @@ int rtattr_read_nexthop(const struct rtnexthop *rtnh, size_t size, int family, O
107107

108108
void netlink_seal_message(sd_netlink *nl, sd_netlink_message *m);
109109

110+
size_t netlink_get_reply_callback_count(sd_netlink *nl);
111+
110112
/* TODO: to be exported later */
111113
int sd_netlink_sendv(sd_netlink *nl, sd_netlink_message **messages, size_t msgcnt, uint32_t **ret_serial);

src/libsystemd/sd-netlink/sd-netlink.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,12 @@ static int timeout_compare(const void *a, const void *b) {
458458
return CMP(x->timeout, y->timeout);
459459
}
460460

461+
size_t netlink_get_reply_callback_count(sd_netlink *nl) {
462+
assert(nl);
463+
464+
return hashmap_size(nl->reply_callbacks);
465+
}
466+
461467
int sd_netlink_call_async(
462468
sd_netlink *nl,
463469
sd_netlink_slot **ret_slot,

0 commit comments

Comments
 (0)