netlink.h revision 8d520ff1dc2da35cdca849e982051b86468016d8
1/*
2 * Netlink helper functions for driver wrappers
3 * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
11 *
12 * See README and COPYING for more details.
13 */
14
15#ifndef NETLINK_H
16#define NETLINK_H
17
18struct netlink_data;
19struct ifinfomsg;
20
21struct netlink_config {
22	void *ctx;
23	void (*newlink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf,
24			   size_t len);
25	void (*dellink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf,
26			   size_t len);
27};
28
29struct netlink_data * netlink_init(struct netlink_config *cfg);
30void netlink_deinit(struct netlink_data *netlink);
31int netlink_send_oper_ifla(struct netlink_data *netlink, int ifindex,
32			   int linkmode, int operstate);
33
34#endif /* NETLINK_H */
35