aboutsummaryrefslogtreecommitdiff
path: root/p2p.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-11-06 11:31:55 +0100
committerJohannes Berg <johannes.berg@intel.com>2012-11-06 11:31:55 +0100
commit8d5d7ba796bf89c1efd3be3fbed5d1c7bd40dec7 (patch)
treebf70e549896a14ae34723e23de385de70a207714 /p2p.c
parent65d079578fd8efb49530da41a09c1c43e57bbc56 (diff)
downloadiw-8d5d7ba796bf89c1efd3be3fbed5d1c7bd40dec7.tar.gz
add P2P Device handling primitives
For testing, it can be useful to be able to use the P2P Device manually, add the ability to do that.
Diffstat (limited to 'p2p.c')
-rw-r--r--p2p.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/p2p.c b/p2p.c
new file mode 100644
index 0000000..addb740
--- /dev/null
+++ b/p2p.c
@@ -0,0 +1,30 @@
+#include <net/if.h>
+#include <errno.h>
+#include <string.h>
+
+#include <netlink/genl/genl.h>
+#include <netlink/genl/family.h>
+#include <netlink/genl/ctrl.h>
+#include <netlink/msg.h>
+#include <netlink/attr.h>
+
+#include "nl80211.h"
+#include "iw.h"
+
+SECTION(p2p);
+
+static int handle_p2p_start(struct nl80211_state *state, struct nl_cb *cb,
+ struct nl_msg *msg, int argc, char **argv,
+ enum id_input id)
+{
+ return 0;
+}
+COMMAND(p2p, start, "", NL80211_CMD_START_P2P_DEVICE, 0, CIB_WDEV, handle_p2p_start, "");
+
+static int handle_p2p_stop(struct nl80211_state *state, struct nl_cb *cb,
+ struct nl_msg *msg, int argc, char **argv,
+ enum id_input id)
+{
+ return 0;
+}
+COMMAND(p2p, stop, "", NL80211_CMD_STOP_P2P_DEVICE, 0, CIB_WDEV, handle_p2p_stop, "");