]> git.ipfire.org Git - thirdparty/iw.git/blame - ocb.c
info: macro-ify ext_feat_print()
[thirdparty/iw.git] / ocb.c
CommitLineData
3955e524
RL
1#include <errno.h>
2#include <string.h>
3
4#include "nl80211.h"
5#include "iw.h"
6
7SECTION(ocb);
8
34b23014 9static int join_ocb(struct nl80211_state *state,
3955e524
RL
10 struct nl_msg *msg, int argc, char **argv,
11 enum id_input id)
12{
f7504581
PG
13 struct chandef chandef;
14 int err, parsed;
3955e524
RL
15
16 if (argc < 2)
17 return 1;
18
f7504581 19 err = parse_freqchan(&chandef, false, argc, argv, &parsed);
3955e524 20
f7504581
PG
21 if (err)
22 return err;
3955e524 23
bcdceae1 24 err = put_chandef(msg, &chandef);
f7504581
PG
25 if (err)
26 return err;
3955e524
RL
27
28 return 0;
3955e524 29}
f0dff705 30COMMAND(ocb, join, "<freq in MHz> <5MHz|10MHz>",
3955e524
RL
31 NL80211_CMD_JOIN_OCB, 0, CIB_NETDEV, join_ocb,
32 "Join the OCB mode network.");
33
34b23014 34static int leave_ocb(struct nl80211_state *state,
3955e524
RL
35 struct nl_msg *msg, int argc, char **argv,
36 enum id_input id)
37{
38 if (argc)
39 return 1;
40
41 return 0;
42}
43COMMAND(ocb, leave, NULL, NL80211_CMD_LEAVE_OCB, 0, CIB_NETDEV, leave_ocb,
44 "Leave the OCB mode network.");