Loading...
Searching...
No Matches
mnl.h File Reference
`#include <osmocom/core/select.h>`
`#include <libmnl/libmnl.h>`

Go to the source code of this file.

## Data Structures

struct | osmo_mnl
| osmocom wrapper around libmnl abstraction of netlink socket More...

## Functions

struct osmo_mnl * | osmo_mnl_init (void *ctx, int bus, unsigned int groups, mnl_cb_t mnl_cb, void *priv)
| create an osmocom-wrapped limnl netlink socket.
void | osmo_mnl_destroy (struct osmo_mnl *omnl)
| destroy an existing osmocom-wrapped mnl netlink socket: Unregister + close + free.

## Function Documentation

## osmo_mnl_destroy()

void osmo_mnl_destroy | ( | struct osmo_mnl * | omnl | ) |

destroy an existing osmocom-wrapped mnl netlink socket: Unregister + close + free.

Parameters

  [in] | omnl | osmo_mnl socket previously returned by osmo_mnl_init()

References osmo_fd_unregister(), and subsys.

## osmo_mnl_init()

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

create an osmocom-wrapped limnl netlink socket.

\parma[in] ctx talloc context from which to allocate

Parameters

  [in] | bus | netlink socket bus ID (see NETLINK_* constants)
  [in] | groups | groups of messages to bind/subscribe to
  [in] | mnl_cb | callback function called for each incoming message
  [in] | priv | opaque private user data

Returns
  newly-allocated osmo_mnl or NULL in case of error.

References DLGLOBAL, LOGL_ERROR, LOGP, osmo_mnl::mnl_cb, OSMO_FD_READ, osmo_fd_register(), osmo_fd_setup(), osmo_mnl_fd_cb(), osmo_mnl::priv, and subsys.