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