Home | History | Annotate | Download | only in 1.0
      1 /*
      2  * hidl interface for wpa_hostapd daemon
      3  * Copyright (c) 2004-2018, Jouni Malinen <j (at) w1.fi>
      4  * Copyright (c) 2004-2018, Roshan Pius <rpius (at) google.com>
      5  *
      6  * This software may be distributed under the terms of the BSD license.
      7  * See README for more details.
      8  */
      9 
     10 #ifndef HOSTAPD_HIDL_SUPPLICANT_H
     11 #define HOSTAPD_HIDL_SUPPLICANT_H
     12 
     13 #include <string>
     14 
     15 #include <android-base/macros.h>
     16 
     17 #include <android/hardware/wifi/hostapd/1.0/IHostapd.h>
     18 
     19 extern "C"
     20 {
     21 #include "utils/common.h"
     22 #include "utils/includes.h"
     23 #include "utils/wpa_debug.h"
     24 #include "ap/hostapd.h"
     25 }
     26 
     27 namespace android {
     28 namespace hardware {
     29 namespace wifi {
     30 namespace hostapd {
     31 namespace V1_0 {
     32 namespace implementation {
     33 
     34 /**
     35  * Implementation of the hostapd hidl object. This hidl
     36  * object is used core for global control operations on
     37  * hostapd.
     38  */
     39 class Hostapd : public V1_0::IHostapd
     40 {
     41 public:
     42 	Hostapd(hapd_interfaces* interfaces);
     43 	~Hostapd() override = default;
     44 
     45 	// Hidl methods exposed.
     46 	Return<void> addAccessPoint(
     47 	    const IfaceParams& iface_params, const NetworkParams& nw_params,
     48 	    addAccessPoint_cb _hidl_cb) override;
     49 	Return<void> removeAccessPoint(
     50 	    const hidl_string& iface_name,
     51 	    removeAccessPoint_cb _hidl_cb) override;
     52 	Return<void> terminate() override;
     53 
     54 private:
     55 	// Corresponding worker functions for the HIDL methods.
     56 	HostapdStatus addAccessPointInternal(
     57 	    const IfaceParams& iface_params, const NetworkParams& nw_params);
     58 	HostapdStatus removeAccessPointInternal(const std::string& iface_name);
     59 
     60 	// Raw pointer to the global structure maintained by the core.
     61 	struct hapd_interfaces* interfaces_;
     62 
     63 	DISALLOW_COPY_AND_ASSIGN(Hostapd);
     64 };
     65 }  // namespace implementation
     66 }  // namespace V1_0
     67 }  // namespace hostapd
     68 }  // namespace wifi
     69 }  // namespace hardware
     70 }  // namespace android
     71 
     72 #endif  // HOSTAPD_HIDL_SUPPLICANT_H
     73