5 * Copyright (C) 2011-2012 Intel Corporation. All rights reserved.
6 * Copyright (C) 2013 BMW Car IT GbmH.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License version 2.1 as published by the Free Software Foundation.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 typedef void (*netlink_debug_func_t) (const char *str, void *user_data);
28 typedef void (*netlink_command_func_t) (unsigned int error,
29 uint16_t type, const void *data,
30 uint32_t len, void *user_data);
31 typedef void (*netlink_notify_func_t) (uint16_t type, const void *data,
32 uint32_t len, void *user_data);
33 typedef void (*netlink_destroy_func_t) (void *user_data);
37 struct netlink_info *netlink_new(int protocol);
38 void netlink_destroy(struct netlink_info *netlink);
40 unsigned int netlink_send(struct netlink_info *netlink,
41 uint16_t type, uint16_t flags, const void *data,
42 uint32_t len, netlink_command_func_t function,
43 void *user_data, netlink_destroy_func_t destroy);
44 bool netlink_cancel(struct netlink_info *netlink, unsigned int id);
46 unsigned int netlink_register(struct netlink_info *netlink,
47 uint32_t group, netlink_notify_func_t function,
48 void *user_data, netlink_destroy_func_t destroy);
49 bool netlink_unregister(struct netlink_info *netlink, unsigned int id);
51 bool netlink_set_debug(struct netlink_info *netlink,
52 netlink_debug_func_t function,
53 void *user_data, netlink_destroy_func_t destroy);