Netlink communication between hostapd and hostap,nl80211

Pavel Roskin proski
Fri Apr 3 09:28:01 PDT 2009


On Fri, 2009-04-03 at 16:13 +0800, Kerht wrote:
> Hi
> I am puzzling about hte netlink usage in hostapd.
> I saw below code in hostapd:
> static int hostap_send_mgmt_frame(void *priv, const void *msg, size_t len,
>                   int flags)
> {
>     struct hostap_driver_data *drv = priv;
>     struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) msg;
>     int res;
> 
>     /* Request TX callback */
>     hdr->frame_control |= host_to_le16(BIT(1));
>     res = send(drv->sock, msg, len, flags);
>     hdr->frame_control &= ~host_to_le16(BIT(1));
> 
>     return res;
> }
> 
> Then I did not find which part of hostap or nl80211 can handle this "sned".

send() is a libc function.  Run "info send" to read about it.

> It seems the msg is not in generic netlink format.
> Isn't it?

It's not.  It's just sending data through a socket.  driver_hostap.c
doesn't use netlink.  driver_nl80211.c does.

-- 
Regards,
Pavel Roskin



More information about the Hostap mailing list