netlink.h 942 B

123456789101112131415161718192021222324252627282930313233
  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. #ifndef NETLINK_H
  15. #define NETLINK_H
  16. struct netlink_data;
  17. struct netlink_config {
  18. void *ctx;
  19. void (*newlink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf,
  20. size_t len);
  21. void (*dellink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf,
  22. size_t len);
  23. };
  24. struct netlink_data * netlink_init(struct netlink_config *cfg);
  25. void netlink_deinit(struct netlink_data *netlink);
  26. int netlink_send_oper_ifla(struct netlink_data *netlink, int ifindex,
  27. int linkmode, int operstate);
  28. #endif /* NETLINK_H */