[PATCH 4/8] extend new dbus api FlushBSS method to take an age parameter

Sam Leffler sleffler
Thu Mar 17 15:39:39 PDT 2011


On resume it is better to flush only some entries; enable this with
an age parameter to the FlushBSS method that causes only entries older
than the specified time be flushed.  Specifying an age of zero causes
all entries to be flushed.
---
 wpa_supplicant/dbus/dbus_new.c          |    1 +
 wpa_supplicant/dbus/dbus_new_handlers.c |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index e49e280..d86552f 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -1355,6 +1355,7 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
 	{ "FlushBSS", WPAS_DBUS_NEW_IFACE_INTERFACE,
 	  (WPADBusMethodHandler) &wpas_dbus_handler_flush_bss,
 	  {
+		  { "age", "u", ARG_IN },
 		  END_ARGS
 	  }
 	},
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 7f6e1aa..67b493d 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1695,7 +1695,15 @@ DBusMessage * wpas_dbus_handler_remove_blob(DBusMessage *message,
 DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message,
 					  struct wpa_supplicant *wpa_s)
 {
-	wpa_bss_flush(wpa_s);
+	dbus_uint32_t age;
+
+	dbus_message_get_args(message, NULL, DBUS_TYPE_UINT32, &age,
+			      DBUS_TYPE_INVALID);
+
+	if (age == 0)
+		wpa_bss_flush(wpa_s);
+	else
+		wpa_bss_flush_by_age(wpa_s, age);
 	return NULL;
 }
 
-- 
1.7.3.1




More information about the Hostap mailing list