binder: Add network request/response interface

1. Add a callback function in |INetworkCallback| to make
any control requests on the corresponding network to registered
callback clients.
2. Add a function in |INetwork| to send responses to the above
request from the clients.

These are used when there is a need to perform external
SIM authentication for example.

While there, fix a nit:
Network.SetSSID() is setting a regular byte array field and
not a key field.

BUG: 30815238
TEST: This will have to wait for wificond integration for testing.

Change-Id: I8bfb9c381159373697ae8d1a0d7b999fca19b3a9
Signed-off-by: Roshan Pius <rpius@google.com>
diff --git a/wpa_supplicant/binder/binder.cpp b/wpa_supplicant/binder/binder.cpp
index c93b9bc..6a45754 100644
--- a/wpa_supplicant/binder/binder.cpp
+++ b/wpa_supplicant/binder/binder.cpp
@@ -167,3 +167,23 @@
 
 	return binder_manager->notifyStateChange(wpa_s);
 }
+
+int wpas_binder_notify_network_request(
+    struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
+    enum wpa_ctrl_req_type rtype, const char *default_txt)
+{
+	if (!wpa_s || !wpa_s->global->binder || !ssid)
+		return 1;
+
+	wpa_printf(
+	    MSG_DEBUG, "Notifying network request to binder control: %d",
+	    ssid->id);
+
+	wpa_supplicant_binder::BinderManager *binder_manager =
+	    wpa_supplicant_binder::BinderManager::getInstance();
+	if (!binder_manager)
+		return 1;
+
+	return binder_manager->notifyNetworkRequest(
+	    wpa_s, ssid, rtype, default_txt);
+}