In the future, the kernel will use unicast messages instead of
multicast to send upcalls. As a result, we need to be able to
tell it where to direct the traffic. This adds a function to expose
the Netlink pid of a socket so it can be included in messages to the
kernel.
{
poll_fd_wait(sock->fd, events);
}
+
+/* Returns the PID associated with this socket. */
+uint32_t
+nl_sock_pid(const struct nl_sock *sock)
+{
+ return sock->pid;
+}
\f
/* Miscellaneous. */
void nl_sock_wait(const struct nl_sock *, short int events);
+uint32_t nl_sock_pid(const struct nl_sock *);
+
/* Table dumping. */
struct nl_dump {
struct nl_sock *sock; /* Socket being dumped. */