aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/mnl.h
blob: 11c835301b50dff3d3f5ba92b16f17c31c3ce97b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*! \file select.h
 *  libmnl integration
 */
#pragma once

#include <osmocom/core/select.h>
#include <libmnl/libmnl.h>

/*! osmocom wrapper around libmnl abstraction of netlink socket */
struct osmo_mnl {
	/*! osmo-wrapped netlink file descriptor */
	struct osmo_fd ofd;
	/*! libmnl socket abstraction */
	struct mnl_socket *mnls;
	/*! call-back called for received netlink messages */
	mnl_cb_t mnl_cb;
	/*! opaque data provided by user */
	void *priv;
};

struct osmo_mnl *osmo_mnl_init(void *ctx, int bus, unsigned int groups, mnl_cb_t mnl_cb, void *priv);
void osmo_mnl_destroy(struct osmo_mnl *omnl);