Commit c3882bb7 authored by Slava Monich's avatar Slava Monich

[gsupplicant] Initial commit

parents
*~
debian/files
debian/libgsupplicant
debian/libgsupplicant-dev
debian/*.debhelper.log
debian/*.debhelper
debian/*.substvars
debian/tmp
documentation.list
installroot
build
RPMS
Copyright (C) 2015-2017 Jolla Ltd.
You may use this file under the terms of BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Jolla Ltd nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
# -*- Mode: makefile-gmake -*-
.PHONY: clean all debug release pkgconfig
.PHONY: print_debug_lib print_release_lib
.PHONY: print_debug_link print_release_link
#
# Required packages
#
PKGS = glib-2.0 gio-2.0 gio-unix-2.0 libglibutil
#
# Default target
#
all: debug release pkgconfig
#
# Library version
#
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_RELEASE = 0
# Version for pkg-config
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
#
# Library name
#
NAME = gsupplicant
LIB_NAME = lib$(NAME)
LIB_DEV_SYMLINK = $(LIB_NAME).so
LIB_SYMLINK1 = $(LIB_DEV_SYMLINK).$(VERSION_MAJOR)
LIB_SYMLINK2 = $(LIB_SYMLINK1).$(VERSION_MINOR)
LIB_SONAME = $(LIB_SYMLINK1)
LIB = $(LIB_SONAME).$(VERSION_MINOR).$(VERSION_RELEASE)
#
# Sources
#
SRC = \
gsupplicant.c \
gsupplicant_bss.c \
gsupplicant_error.c \
gsupplicant_interface.c \
gsupplicant_network.c \
gsupplicant_util.c
GEN_SRC = \
fi.w1.wpa_supplicant1.c \
fi.w1.wpa_supplicant1.Interface.c \
fi.w1.wpa_supplicant1.Interface.WPS.c \
fi.w1.wpa_supplicant1.BSS.c \
fi.w1.wpa_supplicant1.Network.c
#
# Directories
#
SRC_DIR = src
INCLUDE_DIR = include
BUILD_DIR = build
GEN_DIR = $(BUILD_DIR)
SPEC_DIR = spec
DEBUG_BUILD_DIR = $(BUILD_DIR)/debug
RELEASE_BUILD_DIR = $(BUILD_DIR)/release
#
# Tools and flags
#
CC = $(CROSS_COMPILE)gcc
LD = $(CC)
WARNINGS = -Wall
INCLUDES = -I$(INCLUDE_DIR) -I$(GEN_DIR)
BASE_FLAGS = -fPIC
FULL_CFLAGS = $(BASE_FLAGS) $(CFLAGS) $(DEFINES) $(WARNINGS) $(INCLUDES) \
-MMD -MP $(shell pkg-config --cflags $(PKGS))
FULL_LDFLAGS = $(BASE_FLAGS) $(LDFLAGS) -shared -Wl,-soname -Wl,$(LIB_SONAME) \
$(shell pkg-config --libs $(PKGS))
DEBUG_FLAGS = -g
RELEASE_FLAGS =
ifndef KEEP_SYMBOLS
KEEP_SYMBOLS = 0
endif
ifneq ($(KEEP_SYMBOLS),0)
RELEASE_FLAGS += -g
endif
DEBUG_LDFLAGS = $(FULL_LDFLAGS) $(DEBUG_FLAGS)
RELEASE_LDFLAGS = $(FULL_LDFLAGS) $(RELEASE_FLAGS)
DEBUG_CFLAGS = $(FULL_CFLAGS) $(DEBUG_FLAGS) -DDEBUG
RELEASE_CFLAGS = $(FULL_CFLAGS) $(RELEASE_FLAGS) -O2
#
# Files
#
PKGCONFIG = \
$(BUILD_DIR)/$(LIB_NAME).pc
DEBUG_OBJS = \
$(GEN_SRC:%.c=$(DEBUG_BUILD_DIR)/%.o) \
$(SRC:%.c=$(DEBUG_BUILD_DIR)/%.o)
RELEASE_OBJS = \
$(GEN_SRC:%.c=$(RELEASE_BUILD_DIR)/%.o) \
$(SRC:%.c=$(RELEASE_BUILD_DIR)/%.o)
GEN_FILES = $(GEN_SRC:%=$(GEN_DIR)/%)
.PRECIOUS: $(GEN_FILES)
#
# Dependencies
#
DEPS = $(DEBUG_OBJS:%.o=%.d) $(RELEASE_OBJS:%.o=%.d)
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(DEPS)),)
-include $(DEPS)
endif
endif
$(GEN_FILES): | $(GEN_DIR)
$(DEBUG_OBJS): | $(DEBUG_BUILD_DIR)
$(RELEASE_OBJS): | $(RELEASE_BUILD_DIR)
#
# Rules
#
DEBUG_LIB = $(DEBUG_BUILD_DIR)/$(LIB)
RELEASE_LIB = $(RELEASE_BUILD_DIR)/$(LIB)
DEBUG_LINK = $(DEBUG_BUILD_DIR)/$(LIB_SONAME)
RELEASE_LINK = $(RELEASE_BUILD_DIR)/$(LIB_SONAME)
debug: $(DEBUG_LIB) $(DEBUG_LINK)
release: $(RELEASE_LIB) $(RELEASE_LINK)
pkgconfig: $(PKGCONFIG)
print_debug_lib:
@echo $(DEBUG_LIB)
print_release_lib:
@echo $(RELEASE_LIB)
print_debug_link:
@echo $(DEBUG_LINK)
print_release_link:
@echo $(RELEASE_LINK)
clean:
rm -f *~ $(SRC_DIR)/*~ $(INCLUDE_DIR)/*~ rpm/*~
rm -fr $(BUILD_DIR) RPMS installroot
rm -fr debian/tmp debian/lib$(NAME) debian/lib$(NAME)-dev
rm -f documentation.list debian/files debian/*.substvars
rm -f debian/*.debhelper.log debian/*.debhelper debian/*~
make -C tools/wpa-tool clean
$(GEN_DIR):
mkdir -p $@
$(DEBUG_BUILD_DIR):
mkdir -p $@
$(RELEASE_BUILD_DIR):
mkdir -p $@
$(GEN_DIR)/%.c: $(SPEC_DIR)/%.xml
gdbus-codegen --generate-c-code $(@:%.c=%) $<
$(DEBUG_BUILD_DIR)/%.o : $(GEN_DIR)/%.c
$(CC) -c -I. $(DEBUG_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@
$(RELEASE_BUILD_DIR)/%.o : $(GEN_DIR)/%.c
$(CC) -c -I. $(RELEASE_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@
$(DEBUG_BUILD_DIR)/%.o : $(SRC_DIR)/%.c
$(CC) -c $(DEBUG_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@
$(RELEASE_BUILD_DIR)/%.o : $(SRC_DIR)/%.c
$(CC) -c $(RELEASE_CFLAGS) -MT"$@" -MF"$(@:%.o=%.d)" $< -o $@
$(DEBUG_LIB): $(DEBUG_BUILD_DIR) $(DEBUG_OBJS)
$(LD) $(DEBUG_OBJS) $(DEBUG_LDFLAGS) -o $@
$(RELEASE_LIB): $(RELEASE_BUILD_DIR) $(RELEASE_OBJS)
$(LD) $(RELEASE_OBJS) $(RELEASE_LDFLAGS) -o $@
ifeq ($(KEEP_SYMBOLS),0)
strip $@
endif
$(DEBUG_BUILD_DIR)/$(LIB_SYMLINK1): $(DEBUG_BUILD_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $@
$(RELEASE_BUILD_DIR)/$(LIB_SYMLINK1): $(RELEASE_BUILD_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $@
$(DEBUG_BUILD_DIR)/$(LIB_SYMLINK2): $(DEBUG_LIB)
ln -sf $(LIB) $@
$(RELEASE_BUILD_DIR)/$(LIB_SYMLINK2): $(RELEASE_LIB)
ln -sf $(LIB) $@
$(PKGCONFIG): $(LIB_NAME).pc.in
sed -e 's/\[version\]/'$(PCVERSION)/g $< > $@
#
# Install
#
INSTALL_PERM = 644
INSTALL_OWNER = $(shell id -u)
INSTALL_GROUP = $(shell id -g)
INSTALL = install
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m $(INSTALL_PERM)
INSTALL_LIB_DIR = $(DESTDIR)/usr/lib
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/$(NAME)
INSTALL_PKGCONFIG_DIR = $(DESTDIR)/usr/lib/pkgconfig
install: $(INSTALL_LIB_DIR)
$(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR)
ln -sf $(LIB) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1)
install-dev: install $(INSTALL_INCLUDE_DIR) $(INSTALL_PKGCONFIG_DIR)
$(INSTALL_FILES) $(INCLUDE_DIR)/*.h $(INSTALL_INCLUDE_DIR)
$(INSTALL_FILES) $(PKGCONFIG) $(INSTALL_PKGCONFIG_DIR)
ln -sf $(LIB_SYMLINK1) $(INSTALL_LIB_DIR)/$(LIB_DEV_SYMLINK)
$(INSTALL_LIB_DIR):
$(INSTALL_DIRS) $@
$(INSTALL_INCLUDE_DIR):
$(INSTALL_DIRS) $@
$(INSTALL_PKGCONFIG_DIR):
$(INSTALL_DIRS) $@
This is a glib-based wrapper for wpa_supplicant D-Bus interfaces:
https://w1.fi/wpa_supplicant/devel/dbus.html
libgsupplicant (1.0.0) unstable; urgency=low
* Initial release
-- Slava Monich <slava.monich@jolla.com> Tue, 28 Feb 2017 02:25:55 +0200
Source: libgsupplicant
Section: libs
Priority: optional
Maintainer: Slava Monich <slava.monich@jolla.com>
Build-Depends: debhelper (>= 7), libglib2.0-dev (>= 2.0), libglibutil-dev
Standards-Version: 3.8.4
Package: libgsupplicant
Section: libs
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Client library for mce
Package: libgsupplicant-dev
Section: libdevel
Architecture: any
Depends: libgsupplicant (= ${binary:Version}), ${misc:Depends}
Description: Development files for libgsupplicant
Copyright (C) 2015-2017 Jolla Ltd.
You may use this file under the terms of BSD license as follows:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of Jolla Ltd nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
debian/tmp/usr/lib/libgsupplicant.so usr/lib
include/*.h usr/include/gsupplicant
build/libgsupplicant.pc usr/lib/pkgconfig
debian/tmp/usr/lib/libgsupplicant.so.* usr/lib
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
override_dh_auto_install:
dh_auto_install -- install-dev
%:
dh $@
tar-ignore = ".git"
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GSUPPLICANT_H
#define GSUPPLICANT_H
#include <gsupplicant_types.h>
G_BEGIN_DECLS
typedef enum gsupplicant_property {
GSUPPLICANT_PROPERTY_ANY,
GSUPPLICANT_PROPERTY_VALID,
GSUPPLICANT_PROPERTY_CAPABILITIES,
GSUPPLICANT_PROPERTY_EAP_METHODS,
GSUPPLICANT_PROPERTY_INTERFACES,
GSUPPLICANT_PROPERTY_COUNT
} GSUPPLICANT_PROPERTY;
typedef struct gsupplicant_priv GSupplicantPriv;
struct gsupplicant {
GObject object;
GSupplicantPriv* priv;
gboolean valid;
gboolean failed;
const GStrV* interfaces;
GSUPPLICANT_EAP_METHOD eap_methods;
guint32 caps;
#define GSUPPLICANT_CAPS_AP (0x00000001)
#define GSUPPLICANT_CAPS_IBSS_RSN (0x00000002)
#define GSUPPLICANT_CAPS_P2P (0x00000004)
#define GSUPPLICANT_CAPS_INTERWORKING (0x00000008)
};
typedef struct gsupplicant_create_interface_params {
const char* ifname;
const char* bridge_ifname;
const char* driver;
const char* config_file;
} GSupplicantCreateInterfaceParams;
typedef
void
(*GSupplicantFunc)(
GSupplicant* supplicant,
void* data);
typedef
void
(*GSupplicantPropertyFunc)(
GSupplicant* supplicant,
GSUPPLICANT_PROPERTY property,
void* data);
typedef
void
(*GSupplicantResultFunc)(
GSupplicant* supplicant,
GCancellable* cancel,
const GError* error,
void* data);
typedef
void
(*GSupplicantStringResultFunc)(
GSupplicant* supplicant,
GCancellable* cancel,
const GError* error,
const char* result,
void* data);
GSupplicant*
gsupplicant_new(
void);
GSupplicant*
gsupplicant_ref(
GSupplicant* supplicant);
void
gsupplicant_unref(
GSupplicant* supplicant);
gulong
gsupplicant_add_handler(
GSupplicant* self,
GSUPPLICANT_PROPERTY prop,
GSupplicantFunc fn,
void* data);
gulong
gsupplicant_add_property_changed_handler(
GSupplicant* self,
GSUPPLICANT_PROPERTY property,
GSupplicantPropertyFunc fn,
void* data);
void
gsupplicant_remove_handler(
GSupplicant* supplicant,
gulong id);
void
gsupplicant_remove_handlers(
GSupplicant* supplicant,
gulong* ids,
guint count);
GCancellable*
gsupplicant_create_interface(
GSupplicant* supplicant,
const GSupplicantCreateInterfaceParams* params,
GSupplicantStringResultFunc fn,
void* data);
GCancellable*
gsupplicant_remove_interface(
GSupplicant* supplicant,
const char* path,
GSupplicantResultFunc fn,
void* data);
GCancellable*
gsupplicant_get_interface(
GSupplicant* supplicant,
const char* ifname,
GSupplicantStringResultFunc fn,
void* data);
const char*
gsupplicant_caps_name(
guint caps,
guint* cap);
const char*
gsupplicant_eap_method_name(
guint methods,
guint* method);
const char*
gsupplicant_cipher_suite_name(
guint cipher_suites,
guint* cipher_suite);
const char*
gsupplicant_keymgmt_suite_name(
guint keymgmt_suites,
guint* keymgmt_suite);
G_END_DECLS
#endif /* GSUPPLICANT_H */
/*
* Local Variables:
* mode: C
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
/*
* Copyright (C) 2015-2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Jolla Ltd nor the names of its contributors may
* be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GSUPPLICANT_BSS_H
#define GSUPPLICANT_BSS_H
#include <gsupplicant_types.h>
G_BEGIN_DECLS
typedef struct gsupplicant_bss_wpa {
GSUPPLICANT_KEYMGMT keymgmt;
GSUPPLICANT_CIPHER pairwise;
GSUPPLICANT_CIPHER group;
} GSupplicantBSSWPA;
typedef struct gsupplicant_bss_rsn {
GSUPPLICANT_KEYMGMT keymgmt;
GSUPPLICANT_CIPHER pairwise;
GSUPPLICANT_CIPHER group;
GSUPPLICANT_CIPHER mgmt_group;
} GSupplicantBSSRSN;
typedef struct gsupplicant_bss_connect_params {
guint flags; /* Should be zero */
GSUPPLICANT_AUTH_FLAGS auth_flags;
GSUPPLICANT_EAP_METHOD eap;
const char* bgscan;
const char* passphrase;
/* EAP */
const char* identity;
const char* anonymous_identity;
const char* ca_cert_file;
const char* client_cert_file;
const char* private_key_file;
const char* private_key_passphrase;
const char* subject_match;
const char* altsubject_match;
const char* domain_suffix_match;
const char* domain_match;
GSUPPLICANT_EAP_METHOD phase2;
const char* ca_cert_file2;
const char* client_cert_file2;
const char* private_key_file2;
const char* private_key_passphrase2;
const char* subject_match2;
const char* altsubject_match2;
const char* domain_suffix_match2;
} GSupplicantBSSConnectParams;
typedef enum gsupplicant_bss_property {
GSUPPLICANT_BSS_PROPERTY_ANY,
GSUPPLICANT_BSS_PROPERTY_VALID,
GSUPPLICANT_BSS_PROPERTY_PRESENT,
GSUPPLICANT_BSS_PROPERTY_SSID,
GSUPPLICANT_BSS_PROPERTY_BSSID,
GSUPPLICANT_BSS_PROPERTY_WPA,
GSUPPLICANT_BSS_PROPERTY_RSN,
GSUPPLICANT_BSS_PROPERTY_MODE,
GSUPPLICANT_BSS_PROPERTY_WPS_CAPS,
GSUPPLICANT_BSS_PROPERTY_IES,
GSUPPLICANT_BSS_PROPERTY_PRIVACY,
GSUPPLICANT_BSS_PROPERTY_FREQUENCY,
GSUPPLICANT_BSS_PROPERTY_RATES,
GSUPPLICANT_BSS_PROPERTY_MAXRATE,
GSUPPLICANT_BSS_PROPERTY_SIGNAL,
GSUPPLICANT_BSS_PROPERTY_COUNT
} GSUPPLICANT_BSS_PROPERTY;
typedef enum gsupplicant_bss_mode {
GSUPPLICANT_BSS_MODE_UNKNOWN,
GSUPPLICANT_BSS_MODE_INFRA,
GSUPPLICANT_BSS_MODE_AD_HOC
} GSUPPLICANT_BSS_MODE;
typedef struct gsupplicant_bss_priv GSupplicantBSSPriv;
struct gsupplicant_bss {
GObject object;
GSupplicantBSSPriv* priv;
GSupplicantInterface* iface;
const char* path;
gboolean valid;
gboolean present;
GBytes* bssid;
GBytes* ssid;
const char* ssid_str;
const GSupplicantBSSWPA* wpa;
const GSupplicantBSSRSN* rsn;
GSUPPLICANT_WPS_CAPS wps_caps;
GSUPPLICANT_BSS_MODE mode;
GBytes* ies;
gboolean privacy;
guint frequency;
const GSupplicantUIntArray* rates;
guint maxrate;
gint signal;
};
typedef
void
(*GSupplicantBSSFunc)(
GSupplicantBSS* bss,
void* data);
typedef
void
(*GSupplicantBSSStringResultFunc)(
GSupplicantBSS* bss,
GCancellable* cancel,
const GError* error,
const char* result,
void* data);
typedef
void
(*GSupplicantBSSPropertyFunc)(
GSupplicantBSS* bss,
GSUPPLICANT_BSS_PROPERTY property,
void* data);
GSupplicantBSS*
gsupplicant_bss_new(
const char* path);
GSupplicantBSS*
gsupplicant_bss_ref(
GSupplicantBSS* bss);
void
gsupplicant_bss_unref(
GSupplicantBSS* bss);
gulong
gsupplicant_bss_add_handler(
GSupplicantBSS* bss,
GSUPPLICANT_BSS_PROPERTY property,
GSupplicantBSSFunc fn,
void* data);
gulong
gsupplicant_bss_add_property_changed_handler(
GSupplicantBSS* bss,
GSUPPLICANT_BSS_PROPERTY property,
GSupplicantBSSPropertyFunc fn,
void* data);
void
gsupplicant_bss_remove_handler(
GSupplicantBSS* bss,
gulong id);
void
gsupplicant_bss_remove_handlers(
GSupplicantBSS* bss,
gulong* ids,
guint count);
GSUPPLICANT_SECURITY
gsupplicant_bss_security(
GSupplicantBSS* bss);