[RFC 07/13] TDLS: support sending TDLS discovery requests

Arik Nemtsov arik
Thu Sep 15 03:22:25 PDT 2011


Allow sending a TDLS discovery request as a frame through the driver.

Signed-off-by: Arik Nemtsov <arik at wizery.com>
Cc: Kalyan C Gaddam <chakkal at iit.edu>
---
 src/rsn_supp/tdls.c |    8 ++++++++
 src/rsn_supp/wpa.h  |    1 +
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index b4f17db..8da15bb 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -1269,6 +1269,14 @@ wpa_tdls_process_discovery_request(struct wpa_sm *sm, const u8 *addr,
 }
 
 
+int wpa_tdls_send_discovery_request(struct wpa_sm *sm, const u8 *addr)
+{
+	wpa_printf(MSG_DEBUG, "TDLS Discovery Req: Peer:" MACSTR,
+		   MAC2STR(addr));
+	return wpa_tdls_tpk_send(sm, addr, WLAN_TDLS_DISCOVERY_REQUEST,
+				 1, 0, NULL, 0);
+}
+
 
 static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
 				   const u8 *buf, size_t len)
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index e814d33..3c37ea6 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -360,6 +360,7 @@ int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr);
 int wpa_tdls_reneg(struct wpa_sm *sm, const u8 *addr);
 int wpa_tdls_send_teardown(struct wpa_sm *sm, const u8 *addr, u16 reason_code);
 int wpa_tdls_teardown_link(struct wpa_sm *sm, const u8 *addr, u16 reason_code);
+int wpa_tdls_send_discovery_request(struct wpa_sm *sm, const u8 *addr);
 int wpa_tdls_init(struct wpa_sm *sm);
 void wpa_tdls_deinit(struct wpa_sm *sm);
 void wpa_tdls_enable(struct wpa_sm *sm, int enabled);
-- 
1.7.4.1




More information about the Hostap mailing list