#include <netlink/genl/genl.h>
#include <netlink/genl/family.h>
#include <netlink/genl/ctrl.h>
+#include <endian.h>
#include "nl80211.h"
+#include "ieee80211.h"
#define ETH_ALEN 6
-#ifndef CONFIG_LIBNL20
+/* libnl 1.x compatibility code */
+#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
# define nl_sock nl_handle
#endif
struct nl80211_state {
struct nl_sock *nl_sock;
- struct nl_cache *nl_cache;
- struct genl_family *nl80211;
+ int nl80211_id;
};
enum command_identify_by {
CIB_NONE,
CIB_PHY,
CIB_NETDEV,
+ CIB_WDEV,
};
enum id_input {
II_NETDEV,
II_PHY_NAME,
II_PHY_IDX,
+ II_WDEV,
};
struct cmd {
int (*handler)(struct nl80211_state *state,
struct nl_cb *cb,
struct nl_msg *msg,
- int argc, char **argv);
+ int argc, char **argv,
+ enum id_input id);
const struct cmd *(*selector)(int argc, char **argv);
const struct cmd *parent;
};