• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * WPA Supplicant - Interface to receive callbacks from the core supplicant
3  * Copyright (c) 2025, Google Inc. All rights reserved.
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef MAINLINE_SUPPLICANT_CALLBACK_BRIDGE_H
10 #define MAINLINE_SUPPLICANT_CALLBACK_BRIDGE_H
11 
12 /**
13  * Intermediary layer to receive callbacks from the core supplicant.
14  *
15  * For each callback, we provide a full implementation if the MAINLINE_SUPPLICANT
16  * flag is enabled. Otherwise, we provide an empty default implementation for builds
17  * that do not have the flag enabled (ex. the vendor supplicant).
18  */
19 #ifdef _cplusplus
20 extern "C"
21 {
22 #endif  // _cplusplus
23 
24 #include "utils/common.h"
25 #include "src/common/nan_de.h"
26 #include "wpa_supplicant_i.h"
27 
28 #ifdef MAINLINE_SUPPLICANT
29 
30 void mainline_aidl_notify_usd_service_discovered(struct wpa_supplicant *wpa_s,
31     enum nan_service_protocol_type srv_proto_type,
32     int subscribe_id, int peer_publish_id, const u8 *peer_addr,
33     bool fsd, const u8 *ssi, size_t ssi_len);
34 void mainline_aidl_notify_usd_publish_replied(struct wpa_supplicant *wpa_s,
35     enum nan_service_protocol_type srv_proto_type,
36     int publish_id, int peer_subscribe_id,
37     const u8 *peer_addr, const u8 *ssi, size_t ssi_len);
38 void mainline_aidl_notify_usd_message_received(struct wpa_supplicant *wpa_s, int id,
39     int peer_instance_id, const u8 *peer_addr,
40     const u8 *message, size_t message_len);
41 void mainline_aidl_notify_usd_publish_terminated(struct wpa_supplicant *wpa_s,
42     int publish_id, enum nan_de_reason reason);
43 void mainline_aidl_notify_usd_subscribe_terminated(struct wpa_supplicant *wpa_s,
44     int subscribe_id, enum nan_de_reason reason);
45 
46 #else // MAINLINE_SUPPLICANT
47 
48 static void mainline_aidl_notify_usd_service_discovered(struct wpa_supplicant *wpa_s,
49     enum nan_service_protocol_type srv_proto_type,
50     int subscribe_id, int peer_publish_id, const u8 *peer_addr,
51     bool fsd, const u8 *ssi, size_t ssi_len) {}
52 static void mainline_aidl_notify_usd_publish_replied(struct wpa_supplicant *wpa_s,
53     enum nan_service_protocol_type srv_proto_type,
54     int publish_id, int peer_subscribe_id,
55     const u8 *peer_addr, const u8 *ssi, size_t ssi_len) {}
56 static void mainline_aidl_notify_usd_message_received(struct wpa_supplicant *wpa_s, int id,
57     int peer_instance_id, const u8 *peer_addr,
58     const u8 *message, size_t message_len) {}
59 static void mainline_aidl_notify_usd_publish_terminated(struct wpa_supplicant *wpa_s,
60     int publish_id, enum nan_de_reason reason) {}
61 static void mainline_aidl_notify_usd_subscribe_terminated(struct wpa_supplicant *wpa_s,
62     int subscribe_id, enum nan_de_reason reason) {}
63 
64 #endif // MAINLINE_SUPPLICANT
65 
66 #ifdef _cplusplus
67 }
68 #endif  // _cplusplus
69 
70 #endif // MAINLINE_SUPPLICANT_CALLBACK_BRIDGE_H
71