]>
git.ipfire.org Git - thirdparty/iw.git/blob - iw.h
4 #include <linux/nl80211.h>
5 #include <netlink/genl/genl.h>
6 #include <netlink/genl/family.h>
7 #include <netlink/genl/ctrl.h>
13 struct nl80211_state
{
14 struct nl_handle
*nl_handle
;
15 struct nl_cache
*nl_cache
;
16 struct genl_family
*nl80211
;
19 enum command_identify_by
{
29 const enum nl80211_commands cmd
;
31 const enum command_identify_by idby
;
33 * The handler should return a negative error code,
34 * zero on success, 1 if the arguments were wrong
35 * and the usage message should and 2 otherwise.
37 int (*handler
)(struct nl_cb
*cb
,
39 int argc
, char **argv
);
42 #define __COMMAND(sect, name, args, nlcmd, flags, idby, handler) \
43 static const struct cmd __cmd_ ## handler ## nlcmd ## idby \
44 __attribute__((used)) __attribute__((section("__cmd"))) \
45 = { sect, name, args, nlcmd, flags, idby, handler }
46 #define COMMAND(section, name, args, cmd, flags, idby, handler) \
47 __COMMAND(#section, #name, args, cmd, flags, idby, handler)
48 #define TOPLEVEL(name, args, cmd, flags, idby, handler) \
49 __COMMAND(NULL, #name, args, cmd, flags, idby, handler)
50 extern struct cmd __start___cmd
;
51 extern struct cmd __stop___cmd
;
53 int mac_addr_a2n(unsigned char *mac_addr
, char *arg
);
54 int mac_addr_n2a(char *mac_addr
, unsigned char *arg
);
56 const char *iftype_name(enum nl80211_iftype iftype
);