Open robotwxy opened 6 years ago
genl_family_rcv_msg() 所有的genl消息都會經過這裡進行處理
libnl
Af_netlink.c/h is for Netlink message sending and receiving: netlink_sendmsg() to kernel; Genetlink.c/h Netlink.h are for Genl message receiving and sending: genlmsg_unicast() to user; NL80211.c/h store the cmd and ops; 8192cd_cfg80211.c the realtek_cfg80211_ops implement the cfg ops interface;
how to extract the cmd from sk_buff struct sk_buff skb; struct nlmsghdr nlh; struct genlmsghdr *gnlh; nlh = nlmsg_hdr(skb); gnlh=nlmsg_data(nlh); printk("send 19 netlink to %d, cmd:%s\n", dst_portid,commands[gnlh->cmd]);
//cmd to string static const char commands[NL80211_CMD_MAX + 1] = { /
OnAssocReq() ->event_indicate_cfg80211(priv, GetAddr2Ptr(pframe), CFG80211_CONNECT_RESULT, NULL); event_indicate_cfg80211(priv, GetAddr2Ptr(pframe), CFG80211_NEW_STA, pstat);
OnDisassoc() ->event_indicate_cfg80211(priv, sa, CFG80211_DEL_STA, NULL);
OnDeAuth() ->event_indicate_cfg80211(priv, sa, CFG80211_DEL_STA, NULL);
calculate_rx_beacon() ->event_indicate_cfg80211(priv, NULL, CFG80211_DISCONNECTED, NULL);
OnAssocRsp() ->event_indicate_cfg80211(priv, GetAddr2Ptr(pframe), CFG80211_CONNECT_RESULT, NULL);
OnBeaconClnt_Ibss() ->event_indicate_cfg80211(priv, NULL, CFG80211_IBSS_JOINED, NULL);
OnDisassocClnt() ->event_indicate_cfg80211(priv, NULL, CFG80211_DISCONNECTED, NULL);
rtl8192cd_ss_timer() ->event_indicate_cfg80211(priv, NULL, CFG80211_SCAN_DONE, NULL);
rtl8192cd_rx_mgntframe() mgt_handler()
https://robotwxy.github.io/2017/09/25/Hostapd/