aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-01 16:44:44 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-01 16:44:44 (GMT)
commitc64e3a08a92cdc0765b004a028e8e1071b1087db (patch)
treeab4f83a519e8a0bb13da2a7b1a33b2b5d0ac6fdd /src
parent9a170ed2448c1878b003f49d30a3b6fa456d4994 (diff)
downloadhostap-c64e3a08a92cdc0765b004a028e8e1071b1087db.zip
hostap-c64e3a08a92cdc0765b004a028e8e1071b1087db.tar.gz
hostap-c64e3a08a92cdc0765b004a028e8e1071b1087db.tar.bz2
P2P: Send received Presence Response information to ctrl_iface monitors
The P2P_PRESENCE_REQ command did not give any easily available indication of the response received from the GO. Make this more useful by providing such response (if received) as a ctrl_iface monitor event (P2P-PRESENCE-RESPONSE). Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/common/wpa_ctrl.h1
-rw-r--r--src/p2p/p2p.c5
-rw-r--r--src/p2p/p2p.h11
3 files changed, 17 insertions, 0 deletions
diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h
index 1c95881..030df13 100644
--- a/src/common/wpa_ctrl.h
+++ b/src/common/wpa_ctrl.h
@@ -147,6 +147,7 @@ extern "C" {
#define P2P_EVENT_INVITATION_RESULT "P2P-INVITATION-RESULT "
#define P2P_EVENT_FIND_STOPPED "P2P-FIND-STOPPED "
#define P2P_EVENT_PERSISTENT_PSK_FAIL "P2P-PERSISTENT-PSK-FAIL id="
+#define P2P_EVENT_PRESENCE_RESPONSE "P2P-PRESENCE-RESPONSE "
/* parameters: <PMF enabled> <timeout in ms> <Session Information URL> */
#define ESS_DISASSOC_IMMINENT "ESS-DISASSOC-IMMINENT "
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index 23b74c0..2a13736 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -3770,6 +3770,11 @@ static void p2p_process_presence_resp(struct p2p_data *p2p, const u8 *da,
return;
}
+ if (p2p->cfg->presence_resp) {
+ p2p->cfg->presence_resp(p2p->cfg->cb_ctx, sa, *msg.status,
+ msg.noa, msg.noa_len);
+ }
+
if (*msg.status) {
p2p_dbg(p2p, "P2P Presence Request was rejected: status %u",
*msg.status);
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index bff78ef..f35a236 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -778,6 +778,17 @@ struct p2p_config {
* or 0 if not.
*/
int (*go_connected)(void *ctx, const u8 *dev_addr);
+
+ /**
+ * presence_resp - Callback on Presence Response
+ * @ctx: Callback context from cb_ctx
+ * @src: Source address (GO's P2P Interface Address)
+ * @status: Result of the request (P2P_SC_*)
+ * @noa: Returned NoA value
+ * @noa_len: Length of the NoA buffer in octets
+ */
+ void (*presence_resp)(void *ctx, const u8 *src, u8 status,
+ const u8 *noa, size_t noa_len);
};