]>
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>
12 static int join_ibss(struct nl80211_state
*state
,
15 int argc
, char **argv
)
18 unsigned char abssid
[6];
24 NLA_PUT(msg
, NL80211_ATTR_SSID
, strlen(argv
[0]), argv
[0]);
29 NLA_PUT_U32(msg
, NL80211_ATTR_WIPHY_FREQ
,
30 strtoul(argv
[0], &end
, 10));
36 if (argc
&& strcmp(argv
[0], "fixed-freq") == 0) {
37 NLA_PUT_FLAG(msg
, NL80211_ATTR_FREQ_FIXED
);
43 if (mac_addr_a2n(abssid
, argv
[0]))
45 NLA_PUT(msg
, NL80211_ATTR_MAC
, 6, abssid
);
58 static int leave_ibss(struct nl80211_state
*state
,
61 int argc
, char **argv
)
65 COMMAND(ibss
, leave
, NULL
,
66 NL80211_CMD_LEAVE_IBSS
, 0, CIB_NETDEV
, leave_ibss
);
67 COMMAND(ibss
, join
, "<SSID> <freq in MHz> [fixed-freq] [<fixed bssid>]",
68 NL80211_CMD_JOIN_IBSS
, 0, CIB_NETDEV
, join_ibss
);