]>
Commit | Line | Data |
---|---|---|
0f55e0b8 JB |
1 | #include <errno.h> |
2 | #include <linux/nl80211.h> | |
3 | #include <net/if.h> | |
4 | ||
5 | #include <netlink/genl/genl.h> | |
6 | #include <netlink/genl/family.h> | |
7 | #include <netlink/genl/ctrl.h> | |
8 | #include <netlink/msg.h> | |
9 | #include <netlink/attr.h> | |
10 | ||
11 | #include "iw.h" | |
12 | ||
70391ccf | 13 | static int handle_name(struct nl_cb *cb, |
0f55e0b8 JB |
14 | struct nl_msg *msg, |
15 | int argc, char **argv) | |
16 | { | |
0f55e0b8 | 17 | if (argc != 1) |
5e75fd04 | 18 | return 1; |
0f55e0b8 JB |
19 | |
20 | NLA_PUT_STRING(msg, NL80211_ATTR_WIPHY_NAME, *argv); | |
21 | ||
70391ccf | 22 | return 0; |
0f55e0b8 | 23 | nla_put_failure: |
70391ccf | 24 | return -ENOBUFS; |
0f55e0b8 JB |
25 | } |
26 | COMMAND(set, name, "<new name>", NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_name); |