-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathocb.c
44 lines (34 loc) · 851 Bytes
/
ocb.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <errno.h>
#include <string.h>
#include "nl80211.h"
#include "iw.h"
SECTION(ocb);
static int join_ocb(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
struct chandef chandef;
int err, parsed;
if (argc < 2)
return 1;
err = parse_freqchan(&chandef, false, argc, argv, &parsed);
if (err)
return err;
err = put_chandef(msg, &chandef);
if (err)
return err;
return 0;
}
COMMAND(ocb, join, "<freq in MHz> <5MHz|10MHz>",
NL80211_CMD_JOIN_OCB, 0, CIB_NETDEV, join_ocb,
"Join the OCB mode network.");
static int leave_ocb(struct nl80211_state *state,
struct nl_msg *msg, int argc, char **argv,
enum id_input id)
{
if (argc)
return 1;
return 0;
}
COMMAND(ocb, leave, NULL, NL80211_CMD_LEAVE_OCB, 0, CIB_NETDEV, leave_ocb,
"Leave the OCB mode network.");