aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/priv_netlink.h
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2004-05-07 01:09:58 (GMT)
committerJouni Malinen <j@w1.fi>2004-05-07 01:09:58 (GMT)
commit80d0dcf3fa68d47a8a95e9365ed71b3723082e9c (patch)
tree88a197afa224d9845ba85b9f315f9b264730f790 /hostapd/priv_netlink.h
parent046fcf55b20fac8d6d9f91ac219eea6a1faedeac (diff)
downloadhostap-history-80d0dcf3fa68d47a8a95e9365ed71b3723082e9c.zip
hostap-history-80d0dcf3fa68d47a8a95e9365ed71b3723082e9c.tar.gz
hostap-history-80d0dcf3fa68d47a8a95e9365ed71b3723082e9c.tar.bz2
Added local Michael MIC failure processing:
- receive Michael MIC failure reports from the driver (using wireless events) - trigger TKIP countermeasures if two or more failures (local or remote) are reported within 60 seconds
Diffstat (limited to 'hostapd/priv_netlink.h')
-rw-r--r--hostapd/priv_netlink.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/hostapd/priv_netlink.h b/hostapd/priv_netlink.h
new file mode 100644
index 0000000..c9810b4
--- /dev/null
+++ b/hostapd/priv_netlink.h
@@ -0,0 +1,67 @@
+#ifndef PRIV_NETLINK_H
+#define PRIV_NETLINK_H
+
+/* Private copy of needed Linux netlink/rtnetlink definitions.
+ *
+ * This should be replaced with user space header once one is available with C
+ * library, etc..
+ */
+
+#ifndef IFLA_WIRELESS
+#define IFLA_WIRELESS 11
+#endif
+
+#define NETLINK_ROUTE 0
+#define RTMGRP_LINK 1
+#define RTM_BASE 0x10
+#define RTM_NEWLINK (RTM_BASE + 0)
+
+#define NLMSG_ALIGNTO 4
+#define NLMSG_ALIGN(len) (((len) + NLMSG_ALIGNTO - 1) & ~(NLMSG_ALIGNTO - 1))
+#define NLMSG_LENGTH(len) ((len) + NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+#define NLMSG_DATA(nlh) ((void*) (((char*) nlh) + NLMSG_LENGTH(0)))
+
+#define RTA_ALIGNTO 4
+#define RTA_ALIGN(len) (((len) + RTA_ALIGNTO - 1) & ~(RTA_ALIGNTO - 1))
+#define RTA_OK(rta,len) \
+((len) > 0 && (rta)->rta_len >= sizeof(struct rtattr) && \
+(rta)->rta_len <= (len))
+#define RTA_NEXT(rta,attrlen) \
+((attrlen) -= RTA_ALIGN((rta)->rta_len), \
+(struct rtattr *) (((char *)(rta)) + RTA_ALIGN((rta)->rta_len)))
+
+
+struct sockaddr_nl
+{
+ sa_family_t nl_family;
+ unsigned short nl_pad;
+ u32 nl_pid;
+ u32 nl_groups;
+};
+
+struct nlmsghdr
+{
+ u32 nlmsg_len;
+ u16 nlmsg_type;
+ u16 nlmsg_flags;
+ u32 nlmsg_seq;
+ u32 nlmsg_pid;
+};
+
+struct ifinfomsg
+{
+ unsigned char ifi_family;
+ unsigned char __ifi_pad;
+ unsigned short ifi_type;
+ int ifi_index;
+ unsigned ifi_flags;
+ unsigned ifi_change;
+};
+
+struct rtattr
+{
+ unsigned short rta_len;
+ unsigned short rta_type;
+};
+
+#endif /* PRIV_NETLINK_H */