]>
git.ipfire.org Git - thirdparty/iw.git/blob - ibss.c
3 #include <netlink/genl/genl.h>
4 #include <netlink/genl/family.h>
5 #include <netlink/genl/ctrl.h>
6 #include <netlink/msg.h>
7 #include <netlink/attr.h>
14 static int join_ibss(struct nl80211_state
*state
,
17 int argc
, char **argv
)
20 unsigned char abssid
[6];
26 NLA_PUT(msg
, NL80211_ATTR_SSID
, strlen(argv
[0]), argv
[0]);
31 NLA_PUT_U32(msg
, NL80211_ATTR_WIPHY_FREQ
,
32 strtoul(argv
[0], &end
, 10));
38 if (argc
&& strcmp(argv
[0], "fixed-freq") == 0) {
39 NLA_PUT_FLAG(msg
, NL80211_ATTR_FREQ_FIXED
);
45 if (mac_addr_a2n(abssid
, argv
[0]) == 0) {
46 NLA_PUT(msg
, NL80211_ATTR_MAC
, 6, abssid
);
55 if (strcmp(*argv
, "key") != 0 && strcmp(*argv
, "keys") != 0)
61 return parse_keys(msg
, argv
, argc
);
66 static int leave_ibss(struct nl80211_state
*state
,
69 int argc
, char **argv
)
73 COMMAND(ibss
, leave
, NULL
,
74 NL80211_CMD_LEAVE_IBSS
, 0, CIB_NETDEV
, leave_ibss
,
75 "Leave the current IBSS cell.");
76 COMMAND(ibss
, join
, "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>] [key d:0:abcde]",
77 NL80211_CMD_JOIN_IBSS
, 0, CIB_NETDEV
, join_ibss
,
78 "Join the IBSS cell with the given SSID, if it doesn't exist create\n"
79 "it on the given frequency. When fixed frequency is requested, don't\n"
80 "join/create a cell on a different frequency. When a fixed BSSID is\n"
81 "requested use that BSSID and do not adopt another cell's BSSID even\n"
82 "if it has higher TSF and the same SSID.");