blob: 7985fd9a1d162278154ee0a4865ff3ae192d82ae [file] [log] [blame]
Roshan Piuscc817562017-12-22 14:45:05 -08001/*
2 * hidl interface for wpa_hostapd daemon
3 * Copyright (c) 2004-2018, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2004-2018, Roshan Pius <rpius@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
19extern "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
27namespace android {
28namespace hardware {
29namespace wifi {
30namespace hostapd {
31namespace V1_0 {
32namespace 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 */
39class Hostapd : public V1_0::IHostapd
40{
41public:
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;
Roshan Pius3455af42018-02-01 09:19:49 -080052 Return<void> terminate() override;
Roshan Piuscc817562017-12-22 14:45:05 -080053
54private:
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