mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
binder: Expose an aidl interface module
Restructure the binder related makefile sections to expose a separate |libwpa_binder_interface| which can be imported by clients/tests. While there, Change the name of the binder service to the name used in the selinux permissions. Signed-off-by: Roshan Pius <rpius@google.com>
This commit is contained in:
parent
b84ce655d3
commit
fe1d0771f7
@ -49,6 +49,12 @@ ifeq ($(TARGET_ARCH),arm)
|
|||||||
L_CFLAGS += -mabi=aapcs-linux
|
L_CFLAGS += -mabi=aapcs-linux
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# C++ flags for binder interface
|
||||||
|
L_CPPFLAGS := -std=c++11 -Wall -Werror
|
||||||
|
# TODO: Remove these allowed warnings later.
|
||||||
|
L_CPPFLAGS += -Wno-unused-variable -Wno-unused-parameter
|
||||||
|
L_CPPFLAGS += -Wno-unused-private-field
|
||||||
|
|
||||||
INCLUDES = $(LOCAL_PATH)
|
INCLUDES = $(LOCAL_PATH)
|
||||||
INCLUDES += $(LOCAL_PATH)/src
|
INCLUDES += $(LOCAL_PATH)/src
|
||||||
INCLUDES += $(LOCAL_PATH)/src/common
|
INCLUDES += $(LOCAL_PATH)/src/common
|
||||||
@ -1350,13 +1356,8 @@ OBJS += $(DBUS_OBJS)
|
|||||||
L_CFLAGS += $(DBUS_CFLAGS)
|
L_CFLAGS += $(DBUS_CFLAGS)
|
||||||
|
|
||||||
ifdef CONFIG_CTRL_IFACE_BINDER
|
ifdef CONFIG_CTRL_IFACE_BINDER
|
||||||
BINDER=y
|
WPA_SUPPLICANT_USE_BINDER=y
|
||||||
L_CFLAGS += -DCONFIG_BINDER -DCONFIG_CTRL_IFACE_BINDER
|
L_CFLAGS += -DCONFIG_BINDER -DCONFIG_CTRL_IFACE_BINDER
|
||||||
OBJS += binder/binder.cpp binder/binder_manager.cpp
|
|
||||||
OBJS += binder/supplicant.cpp binder/iface.cpp
|
|
||||||
OBJS += binder/fi/w1/wpa_supplicant/ISupplicant.aidl
|
|
||||||
OBJS += binder/fi/w1/wpa_supplicant/ISupplicantCallbacks.aidl
|
|
||||||
OBJS += binder/fi/w1/wpa_supplicant/IIface.aidl
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef CONFIG_READLINE
|
ifdef CONFIG_READLINE
|
||||||
@ -1596,9 +1597,9 @@ LOCAL_C_INCLUDES := $(INCLUDES)
|
|||||||
ifeq ($(DBUS), y)
|
ifeq ($(DBUS), y)
|
||||||
LOCAL_SHARED_LIBRARIES += libdbus
|
LOCAL_SHARED_LIBRARIES += libdbus
|
||||||
endif
|
endif
|
||||||
ifeq ($(BINDER), y)
|
ifeq ($(WPA_SUPPLICANT_USE_BINDER), y)
|
||||||
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder frameworks/native/aidl/binder
|
LOCAL_SHARED_LIBRARIES += libbinder libutils
|
||||||
LOCAL_SHARED_LIBRARIES += libutils libbinder
|
LOCAL_STATIC_LIBRARIES += libwpa_binder libwpa_binder_interface
|
||||||
endif
|
endif
|
||||||
include $(BUILD_EXECUTABLE)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
@ -1638,3 +1639,42 @@ LOCAL_COPY_HEADERS_TO := libwpa_client
|
|||||||
LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
|
LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
|
||||||
LOCAL_COPY_HEADERS += src/common/qca-vendor.h
|
LOCAL_COPY_HEADERS += src/common/qca-vendor.h
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
|
ifeq ($(WPA_SUPPLICANT_USE_BINDER), y)
|
||||||
|
### Binder interface library ###
|
||||||
|
########################
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libwpa_binder_interface
|
||||||
|
LOCAL_AIDL_INCLUDES := \
|
||||||
|
$(LOCAL_PATH)/binder \
|
||||||
|
frameworks/native/aidl/binder
|
||||||
|
LOCAL_EXPORT_C_INCLUDE_DIRS := \
|
||||||
|
$(LOCAL_PATH)/binder
|
||||||
|
LOCAL_CPPFLAGS := $(L_CPPFLAGS)
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
binder/binder_constants.cpp \
|
||||||
|
binder/fi/w1/wpa_supplicant/ISupplicant.aidl \
|
||||||
|
binder/fi/w1/wpa_supplicant/ISupplicantCallbacks.aidl \
|
||||||
|
binder/fi/w1/wpa_supplicant/IIface.aidl
|
||||||
|
LOCAL_SHARED_LIBRARIES := libbinder
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
### Binder service library ###
|
||||||
|
########################
|
||||||
|
|
||||||
|
include $(CLEAR_VARS)
|
||||||
|
LOCAL_MODULE := libwpa_binder
|
||||||
|
LOCAL_CPPFLAGS := $(L_CPPFLAGS)
|
||||||
|
LOCAL_CFLAGS := $(L_CFLAGS)
|
||||||
|
LOCAL_C_INCLUDES := $(INCLUDES)
|
||||||
|
LOCAL_SRC_FILES := \
|
||||||
|
binder/binder.cpp binder/binder_manager.cpp \
|
||||||
|
binder/supplicant.cpp binder/iface.cpp
|
||||||
|
LOCAL_SHARED_LIBRARIES := \
|
||||||
|
libbinder \
|
||||||
|
libutils
|
||||||
|
LOCAL_STATIC_LIBRARIES := libwpa_binder_interface
|
||||||
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
endif # BINDER == y
|
||||||
|
18
wpa_supplicant/binder/binder_constants.cpp
Normal file
18
wpa_supplicant/binder/binder_constants.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* binder interface for wpa_supplicant daemon
|
||||||
|
* Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
|
||||||
|
* Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
|
||||||
|
*
|
||||||
|
* This software may be distributed under the terms of the BSD license.
|
||||||
|
* See README for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "binder_constants.h"
|
||||||
|
|
||||||
|
namespace wpa_supplicant_binder {
|
||||||
|
namespace binder_constants {
|
||||||
|
|
||||||
|
const char kServiceName[] = "wpa_supplicant";
|
||||||
|
|
||||||
|
} /* namespace binder_constants */
|
||||||
|
} /* namespace wpa_supplicant_binder */
|
21
wpa_supplicant/binder/binder_constants.h
Normal file
21
wpa_supplicant/binder/binder_constants.h
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* binder interface for wpa_supplicant daemon
|
||||||
|
* Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi>
|
||||||
|
* Copyright (c) 2004-2016, Roshan Pius <rpius@google.com>
|
||||||
|
*
|
||||||
|
* This software may be distributed under the terms of the BSD license.
|
||||||
|
* See README for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BINDER_CONSTANTS_H
|
||||||
|
#define BINDER_CONSTANTS_H
|
||||||
|
|
||||||
|
namespace wpa_supplicant_binder {
|
||||||
|
namespace binder_constants {
|
||||||
|
|
||||||
|
extern const char kServiceName[];
|
||||||
|
|
||||||
|
} /* namespace binder_constants */
|
||||||
|
} /* namespace wpa_supplicant_binder */
|
||||||
|
|
||||||
|
#endif /* BINDER_CONSTANTS_H */
|
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include <binder/IServiceManager.h>
|
#include <binder/IServiceManager.h>
|
||||||
|
|
||||||
|
#include "binder_constants.h"
|
||||||
#include "binder_manager.h"
|
#include "binder_manager.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -18,10 +19,8 @@ extern "C" {
|
|||||||
|
|
||||||
namespace wpa_supplicant_binder {
|
namespace wpa_supplicant_binder {
|
||||||
|
|
||||||
const char BinderManager::kBinderServiceName[] = "fi.w1.wpa_supplicant";
|
|
||||||
BinderManager *BinderManager::instance_ = NULL;
|
BinderManager *BinderManager::instance_ = NULL;
|
||||||
|
|
||||||
|
|
||||||
BinderManager * BinderManager::getInstance()
|
BinderManager * BinderManager::getInstance()
|
||||||
{
|
{
|
||||||
if (!instance_)
|
if (!instance_)
|
||||||
@ -43,7 +42,7 @@ int BinderManager::registerBinderService(struct wpa_global *global)
|
|||||||
/* Create the main binder service object and register with
|
/* Create the main binder service object and register with
|
||||||
* system service manager. */
|
* system service manager. */
|
||||||
supplicant_object_ = new Supplicant(global);
|
supplicant_object_ = new Supplicant(global);
|
||||||
android::String16 service_name(kBinderServiceName);
|
android::String16 service_name(binder_constants::kServiceName);
|
||||||
android::defaultServiceManager()->addService(
|
android::defaultServiceManager()->addService(
|
||||||
service_name,
|
service_name,
|
||||||
android::IInterface::asBinder(supplicant_object_));
|
android::IInterface::asBinder(supplicant_object_));
|
||||||
|
@ -29,8 +29,6 @@ namespace wpa_supplicant_binder {
|
|||||||
*/
|
*/
|
||||||
class BinderManager {
|
class BinderManager {
|
||||||
public:
|
public:
|
||||||
static const char kBinderServiceName[];
|
|
||||||
|
|
||||||
static BinderManager * getInstance();
|
static BinderManager * getInstance();
|
||||||
static void destroyInstance();
|
static void destroyInstance();
|
||||||
int registerBinderService(struct wpa_global *global);
|
int registerBinderService(struct wpa_global *global);
|
||||||
|
Loading…
Reference in New Issue
Block a user