Store cluster ID and send a notification over the control interface.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
struct nan_de {
u8 nmi[ETH_ALEN];
+ u8 cluster_id[ETH_ALEN];
+ bool cluster_id_set;
bool offload;
bool ap;
unsigned int max_listen;
return 0;
}
+
+
+void nan_de_set_cluster_id(struct nan_de *de, const u8 *cluster_id)
+{
+ if (cluster_id) {
+ os_memcpy(de->cluster_id, cluster_id, ETH_ALEN);
+ de->cluster_id_set = true;
+ } else {
+ de->cluster_id_set = false;
+ }
+}
int nan_de_transmit(struct nan_de *de, int handle,
const struct wpabuf *ssi, const struct wpabuf *elems,
const u8 *peer_addr, u8 req_instance_id);
+void nan_de_set_cluster_id(struct nan_de *de, const u8 *cluster_id);
int nan_de_stop_listen(struct nan_de *de, int handle);
#define DPP_EVENT_PB_RESULT "DPP-PB-RESULT "
#define DPP_EVENT_RELAY_NEEDS_CONTROLLER "DPP-RELAY-NEEDS-CONTROLLER "
-/* Wi-Fi Aware (NAN USD) events */
+/* Wi-Fi Aware (NAN) events */
#define NAN_DISCOVERY_RESULT "NAN-DISCOVERY-RESULT "
#define NAN_REPLIED "NAN-REPLIED "
#define NAN_PUBLISH_TERMINATED "NAN-PUBLISH-TERMINATED "
#define NAN_SUBSCRIBE_TERMINATED "NAN-SUBSCRIBE-TERMINATED "
#define NAN_RECEIVE "NAN-RECEIVE "
+#define NAN_CLUSTER_JOIN "NAN-CLUSTER-JOIN "
/* MESH events */
#define MESH_GROUP_STARTED "MESH-GROUP-STARTED "
return -1;
nan_stop(wpa_s->nan);
+ nan_de_set_cluster_id(wpa_s->nan_de, NULL);
return 0;
}
if (!wpas_nan_ready(wpa_s))
return;
- /* TODO: Handle cluster merge */
- wpa_printf(MSG_DEBUG, "NAN: Joined cluster " MACSTR " (new: %d)",
- MAC2STR(cluster_id), new_cluster);
+ wpa_msg_global(wpa_s, MSG_INFO, NAN_CLUSTER_JOIN "cluster_id=" MACSTR
+ " new=%d", MAC2STR(cluster_id), new_cluster);
+
+ nan_de_set_cluster_id(wpa_s->nan_de, cluster_id);
}