[PATCH 2/2] dbus-signal for IBSS-RSN-CONNECTED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 8eb6908732c5e08c803bbffffab156af6acdcfa8 Mon Sep 17 00:00:00 2001
From: Avichal Agarwal <avichal.a@xxxxxxxxxxx>
Date: Tue, 12 Jul 2016 17:21:24 +0530
Subject: [PATCH 2/2] dbus-signal for IBSS-RSN-CONNECTED

this patch will send a dbus signal IbssRsnConnected
when two ibss-rsn peers will join each other successfully.
this signal will send the address of peer type array of bytes.

Signed-off-by: Avichal Agarwal <avichal.a@xxxxxxxxxxx>
---
 wpa_supplicant/dbus/dbus_new.c                     |   37 ++++++++
 wpa_supplicant/dbus/dbus_new.h                     |    5 +-
 wpa_supplicant/ibss_rsn.c                          |    3 +-
 wpa_supplicant/notify.c                            |    6 ++
 wpa_supplicant/notify.h                            |    3 +
 5 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 8fa03bb..1300ad5 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -1954,6 +1954,35 @@ void wpas_dbus_signal_p2p_invitation_received(struct wpa_supplicant *wpa_s,
 
 #endif /* CONFIG_P2P */
 
+#ifdef CONFIG_IBSS_RSN

+void wpas_dbus_signal_ibss_rsn_connected(struct wpa_supplicant *wpa_s,

+                                const u8 *peer)

+{

+        struct wpas_dbus_priv *iface;

+        DBusMessage *msg;

+        DBusMessageIter iter,array_iter;

+        iface = wpa_s->global->dbus;

+        /* Do nothing if the control interface is not turned on */

+        if (iface == NULL)

+                return;

+        msg = dbus_message_new_signal(wpa_s->dbus_new_path,

+                                      WPAS_DBUS_NEW_IFACE_INTERFACE,

+                                      "IbssRsnConnected");

+        if (msg == NULL)

+                return;

+        dbus_message_iter_init_append(msg, &iter);

+	if(!dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,

+                                              DBUS_TYPE_BYTE_AS_STRING,

+                                              &array_iter) ||

+            !dbus_message_iter_append_fixed_array(&array_iter, DBUS_TYPE_BYTE,

+                                                  &peer, 6) ||

+            !dbus_message_iter_close_container(&iter, &array_iter))

+		goto nomem;

+        dbus_connection_send(iface->con, msg, NULL);

+nomem:

+        dbus_message_unref(msg);

+}

+#endif /*CONFIG_IBSS_RSN*/
 
 /**
  * wpas_dbus_signal_prop_changed - Signals change of property
@@ -3548,6 +3577,14 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
 		  END_ARGS
 	  }
 	},
+#ifdef CONFIG_IBSS_RSN

+	{ "IbssRsnConnected",WPAS_DBUS_NEW_IFACE_INTERFACE,

+	  {

+		 { "peer","ay",ARG_OUT },

+		 END_ARGS

+	  }

+	},

+#endif
 	{ NULL, NULL, { END_ARGS } }
 };
 
diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
index d64fcee..38f521d 100644
--- a/wpa_supplicant/dbus/dbus_new.h
+++ b/wpa_supplicant/dbus/dbus_new.h
@@ -237,7 +237,10 @@ void wpas_dbus_signal_p2p_invitation_received(struct wpa_supplicant *wpa_s,
 					      const u8 *sa, const u8 *dev_addr,
 					      const u8 *bssid, int id,
 					      int op_freq);
-
+#ifdef CONFIG_IBSS_RSN

+void wpas_dbus_signal_ibss_rsn_connected(struct wpa_supplicant *wpa_s,

+                               const u8 *peer);

+#endif /*CONFIG_IBSS_RSN*/
 #else /* CONFIG_CTRL_IFACE_DBUS_NEW */
 
 static inline int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index c00db31..549995d 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -19,7 +19,7 @@
 #include "driver_i.h"
 #include "common/ieee802_11_defs.h"
 #include "ibss_rsn.h"
-
+#include "notify.h"
 
 static void ibss_rsn_auth_timeout(void *eloop_ctx, void *timeout_ctx);
 
@@ -133,6 +133,7 @@ static void ibss_check_rsn_completed(struct ibss_rsn_peer *peer)
 	peer->authentication_status |= IBSS_RSN_REPORTED_PTK;
 	wpa_msg(wpa_s, MSG_INFO, IBSS_RSN_COMPLETED MACSTR,
 		MAC2STR(peer->addr));
+	wpas_notify_ibssrsn_connected(wpa_s,peer->addr);
 }
 
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index 67e36ae..5cce236 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -148,6 +148,12 @@ void wpas_notify_assoc_status_code(struct wpa_supplicant *wpa_s)
 	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_ASSOC_STATUS_CODE);
 }
 
+#ifdef CONFIG_IBSS_RSN

+void wpas_notify_ibssrsn_connected(struct wpa_supplicant *wpa_s,const u8 *peer)

+{

+	wpas_dbus_signal_ibss_rsn_connected(wpa_s,peer);

+}

+#endif /*CONFIG_IBSS_RSN*/
 
 void wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
 {
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index 8cce0f3..d90c4f3 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -141,5 +141,8 @@ void wpas_notify_network_type_changed(struct wpa_supplicant *wpa_s,
 void wpas_notify_p2p_invitation_received(struct wpa_supplicant *wpa_s,
 					 const u8 *sa, const u8 *go_dev_addr,
 					 const u8 *bssid, int id, int op_freq);
+#ifdef CONFIG_IBSS_RSN

+void wpas_notify_ibssrsn_connected(struct wpa_supplicant *wpa_s, const u8 *peer);

+#endif /*CONFIG_IBSS_RSN*/
 
 #endif /* NOTIFY_H */
-- 
1.7.9.5
_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux