netlink.h 741 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Netlink helper functions for driver wrappers
  3. * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef NETLINK_H
  9. #define NETLINK_H
  10. struct netlink_data;
  11. struct ifinfomsg;
  12. struct netlink_config {
  13. void *ctx;
  14. void (*newlink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf,
  15. size_t len);
  16. void (*dellink_cb)(void *ctx, struct ifinfomsg *ifi, u8 *buf,
  17. size_t len);
  18. };
  19. struct netlink_data * netlink_init(struct netlink_config *cfg);
  20. void netlink_deinit(struct netlink_data *netlink);
  21. int netlink_send_oper_ifla(struct netlink_data *netlink, int ifindex,
  22. int linkmode, int operstate);
  23. #endif /* NETLINK_H */