Home | History | Annotate | Download | only in drivers

Lines Matching defs:netlink

2  * Netlink helper functions for driver wrappers
14 #include "netlink.h"
23 static void netlink_receive_link(struct netlink_data *netlink,
30 cb(netlink->cfg->ctx, NLMSG_DATA(h),
38 struct netlink_data *netlink = eloop_ctx;
52 wpa_printf(MSG_INFO, "netlink: recvfrom failed: %s",
61 netlink_receive_link(netlink, netlink->cfg->newlink_cb,
65 netlink_receive_link(netlink, netlink->cfg->dellink_cb,
74 wpa_printf(MSG_DEBUG, "netlink: %d extra bytes in the end of "
75 "netlink message", left);
93 struct netlink_data *netlink;
96 netlink = os_zalloc(sizeof(*netlink));
97 if (netlink == NULL)
100 netlink->sock = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
101 if (netlink->sock < 0) {
102 wpa_printf(MSG_ERROR, "netlink: Failed to open netlink "
104 netlink_deinit(netlink);
111 if (bind(netlink->sock, (struct sockaddr *) &local, sizeof(local)) < 0)
113 wpa_printf(MSG_ERROR, "netlink: Failed to bind netlink "
115 netlink_deinit(netlink);
119 eloop_register_read_sock(netlink->sock, netlink_receive, netlink,
122 netlink->cfg = cfg;
124 return netlink;
128 void netlink_deinit(struct netlink_data *netlink)
130 if (netlink == NULL)
132 if (netlink->sock >= 0) {
133 eloop_unregister_read_sock(netlink->sock);
134 close(netlink->sock);
136 os_free(netlink->cfg);
137 os_free(netlink);
169 int netlink_send_oper_ifla(struct netlink_data *netlink, int ifindex,
216 wpa_printf(MSG_DEBUG, "netlink: Operstate: ifindex=%d linkmode=%d (%s), operstate=%d (%s)",
220 ret = send(netlink->sock, &req, req.hdr.nlmsg_len, 0);
222 wpa_printf(MSG_DEBUG, "netlink: Sending operstate IFLA "