Remove unused files / directories.
This commit is contained in:
parent
6eb3180fb2
commit
521fc850a0
@ -1,907 +0,0 @@
|
||||
ifndef CC
|
||||
CC=gcc
|
||||
endif
|
||||
|
||||
ifndef CFLAGS
|
||||
CFLAGS = -MMD -O2 -Wall -g
|
||||
endif
|
||||
|
||||
CFLAGS += -I../src
|
||||
CFLAGS += -I../src/utils
|
||||
|
||||
# Uncomment following line and set the path to your kernel tree include
|
||||
# directory if your C library does not include all header files.
|
||||
# CFLAGS += -DUSE_KERNEL_HEADERS -I/usr/src/linux/include
|
||||
|
||||
-include .config
|
||||
|
||||
ifndef CONFIG_OS
|
||||
ifdef CONFIG_NATIVE_WINDOWS
|
||||
CONFIG_OS=win32
|
||||
else
|
||||
CONFIG_OS=unix
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_OS), internal)
|
||||
CFLAGS += -DOS_NO_C_LIB_DEFINES
|
||||
endif
|
||||
|
||||
ifdef CONFIG_NATIVE_WINDOWS
|
||||
CFLAGS += -DCONFIG_NATIVE_WINDOWS
|
||||
LIBS += -lws2_32
|
||||
endif
|
||||
|
||||
OBJS += main.o
|
||||
OBJS += config_file.o
|
||||
|
||||
OBJS += ../src/ap/hostapd.o
|
||||
OBJS += ../src/ap/wpa_auth_glue.o
|
||||
OBJS += ../src/ap/drv_callbacks.o
|
||||
OBJS += ../src/ap/ap_drv_ops.o
|
||||
OBJS += ../src/ap/utils.o
|
||||
OBJS += ../src/ap/authsrv.o
|
||||
OBJS += ../src/ap/ieee802_1x.o
|
||||
OBJS += ../src/ap/ap_config.o
|
||||
OBJS += ../src/ap/eap_user_db.o
|
||||
OBJS += ../src/ap/ieee802_11_auth.o
|
||||
OBJS += ../src/ap/sta_info.o
|
||||
OBJS += ../src/ap/wpa_auth.o
|
||||
OBJS += ../src/ap/tkip_countermeasures.o
|
||||
OBJS += ../src/ap/ap_mlme.o
|
||||
OBJS += ../src/ap/wpa_auth_ie.o
|
||||
OBJS += ../src/ap/preauth_auth.o
|
||||
OBJS += ../src/ap/pmksa_cache_auth.o
|
||||
OBJS += ../src/ap/ieee802_11_shared.o
|
||||
OBJS += ../src/ap/beacon.o
|
||||
|
||||
OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o
|
||||
|
||||
NEED_RC4=y
|
||||
NEED_AES=y
|
||||
NEED_MD5=y
|
||||
NEED_SHA1=y
|
||||
|
||||
OBJS += ../src/drivers/drivers.o
|
||||
CFLAGS += -DHOSTAPD
|
||||
|
||||
ifdef CONFIG_WPA_TRACE
|
||||
CFLAGS += -DWPA_TRACE
|
||||
OBJS += ../src/utils/trace.o
|
||||
HOBJS += ../src/utils/trace.o
|
||||
LDFLAGS += -rdynamic
|
||||
CFLAGS += -funwind-tables
|
||||
ifdef CONFIG_WPA_TRACE_BFD
|
||||
CFLAGS += -DWPA_TRACE_BFD
|
||||
LIBS += -lbfd
|
||||
LIBS_c += -lbfd
|
||||
LIBS_h += -lbfd
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef CONFIG_ELOOP
|
||||
CONFIG_ELOOP=eloop
|
||||
endif
|
||||
OBJS += ../src/utils/$(CONFIG_ELOOP).o
|
||||
OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
|
||||
OBJS += ../src/utils/common.o
|
||||
OBJS += ../src/utils/wpa_debug.o
|
||||
OBJS_c += ../src/utils/wpa_debug.o
|
||||
OBJS += ../src/utils/wpabuf.o
|
||||
OBJS += ../src/utils/os_$(CONFIG_OS).o
|
||||
OBJS += ../src/utils/ip_addr.o
|
||||
|
||||
OBJS += ../src/common/ieee802_11_common.o
|
||||
OBJS += ../src/common/wpa_common.o
|
||||
|
||||
OBJS += ../src/eapol_auth/eapol_auth_sm.o
|
||||
|
||||
|
||||
ifndef CONFIG_NO_DUMP_STATE
|
||||
# define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
|
||||
# a file (undefine it, if you want to save in binary size)
|
||||
CFLAGS += -DHOSTAPD_DUMP_STATE
|
||||
OBJS += dump_state.o
|
||||
OBJS += ../src/eapol_auth/eapol_auth_dump.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_NO_RADIUS
|
||||
CFLAGS += -DCONFIG_NO_RADIUS
|
||||
CONFIG_NO_ACCOUNTING=y
|
||||
else
|
||||
OBJS += ../src/radius/radius.o
|
||||
OBJS += ../src/radius/radius_client.o
|
||||
OBJS += ../src/radius/radius_das.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_NO_ACCOUNTING
|
||||
CFLAGS += -DCONFIG_NO_ACCOUNTING
|
||||
else
|
||||
OBJS += ../src/ap/accounting.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_NO_VLAN
|
||||
CFLAGS += -DCONFIG_NO_VLAN
|
||||
else
|
||||
OBJS += ../src/ap/vlan_init.o
|
||||
ifdef CONFIG_VLAN_NETLINK
|
||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||
OBJS += ../src/ap/vlan_util.o
|
||||
endif
|
||||
CFLAGS += -DCONFIG_VLAN_NETLINK
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_NO_CTRL_IFACE
|
||||
CFLAGS += -DCONFIG_NO_CTRL_IFACE
|
||||
else
|
||||
OBJS += ctrl_iface.o
|
||||
OBJS += ../src/ap/ctrl_iface_ap.o
|
||||
endif
|
||||
|
||||
OBJS += ../src/crypto/md5.o
|
||||
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
|
||||
|
||||
ifdef CONFIG_IAPP
|
||||
CFLAGS += -DCONFIG_IAPP
|
||||
OBJS += ../src/ap/iapp.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_RSN_PREAUTH
|
||||
CFLAGS += -DCONFIG_RSN_PREAUTH
|
||||
CONFIG_L2_PACKET=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PEERKEY
|
||||
CFLAGS += -DCONFIG_PEERKEY
|
||||
OBJS += ../src/ap/peerkey_auth.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_IEEE80211W
|
||||
CFLAGS += -DCONFIG_IEEE80211W
|
||||
NEED_SHA256=y
|
||||
NEED_AES_OMAC1=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_IEEE80211R
|
||||
CFLAGS += -DCONFIG_IEEE80211R
|
||||
OBJS += ../src/ap/wpa_auth_ft.o
|
||||
NEED_SHA256=y
|
||||
NEED_AES_OMAC1=y
|
||||
NEED_AES_UNWRAP=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SAE
|
||||
CFLAGS += -DCONFIG_SAE
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WNM
|
||||
CFLAGS += -DCONFIG_WNM
|
||||
OBJS += ../src/ap/wnm_ap.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_IEEE80211N
|
||||
CFLAGS += -DCONFIG_IEEE80211N
|
||||
endif
|
||||
|
||||
ifdef CONFIG_IEEE80211AC
|
||||
CFLAGS += -DCONFIG_IEEE80211AC
|
||||
endif
|
||||
|
||||
include ../src/drivers/drivers.mak
|
||||
OBJS += $(DRV_AP_OBJS)
|
||||
CFLAGS += $(DRV_AP_CFLAGS)
|
||||
LDFLAGS += $(DRV_AP_LDFLAGS)
|
||||
LIBS += $(DRV_AP_LIBS)
|
||||
|
||||
ifdef CONFIG_L2_PACKET
|
||||
ifdef CONFIG_DNET_PCAP
|
||||
ifdef CONFIG_L2_FREEBSD
|
||||
LIBS += -lpcap
|
||||
OBJS += ../src/l2_packet/l2_packet_freebsd.o
|
||||
else
|
||||
LIBS += -ldnet -lpcap
|
||||
OBJS += ../src/l2_packet/l2_packet_pcap.o
|
||||
endif
|
||||
else
|
||||
OBJS += ../src/l2_packet/l2_packet_linux.o
|
||||
endif
|
||||
else
|
||||
OBJS += ../src/l2_packet/l2_packet_none.o
|
||||
endif
|
||||
|
||||
|
||||
ifdef CONFIG_EAP_MD5
|
||||
CFLAGS += -DEAP_SERVER_MD5
|
||||
OBJS += ../src/eap_server/eap_server_md5.o
|
||||
CHAP=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_TLS
|
||||
CFLAGS += -DEAP_SERVER_TLS
|
||||
OBJS += ../src/eap_server/eap_server_tls.o
|
||||
TLS_FUNCS=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_UNAUTH_TLS
|
||||
CFLAGS += -DEAP_SERVER_UNAUTH_TLS
|
||||
ifndef CONFIG_EAP_TLS
|
||||
OBJS += ../src/eap_server/eap_server_tls.o
|
||||
TLS_FUNCS=y
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_PEAP
|
||||
CFLAGS += -DEAP_SERVER_PEAP
|
||||
OBJS += ../src/eap_server/eap_server_peap.o
|
||||
OBJS += ../src/eap_common/eap_peap_common.o
|
||||
TLS_FUNCS=y
|
||||
CONFIG_EAP_MSCHAPV2=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_TTLS
|
||||
CFLAGS += -DEAP_SERVER_TTLS
|
||||
OBJS += ../src/eap_server/eap_server_ttls.o
|
||||
TLS_FUNCS=y
|
||||
CHAP=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_MSCHAPV2
|
||||
CFLAGS += -DEAP_SERVER_MSCHAPV2
|
||||
OBJS += ../src/eap_server/eap_server_mschapv2.o
|
||||
MS_FUNCS=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_GTC
|
||||
CFLAGS += -DEAP_SERVER_GTC
|
||||
OBJS += ../src/eap_server/eap_server_gtc.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_SIM
|
||||
CFLAGS += -DEAP_SERVER_SIM
|
||||
OBJS += ../src/eap_server/eap_server_sim.o
|
||||
CONFIG_EAP_SIM_COMMON=y
|
||||
NEED_AES_CBC=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_AKA
|
||||
CFLAGS += -DEAP_SERVER_AKA
|
||||
OBJS += ../src/eap_server/eap_server_aka.o
|
||||
CONFIG_EAP_SIM_COMMON=y
|
||||
NEED_SHA256=y
|
||||
NEED_AES_CBC=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_AKA_PRIME
|
||||
CFLAGS += -DEAP_SERVER_AKA_PRIME
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_SIM_COMMON
|
||||
OBJS += ../src/eap_common/eap_sim_common.o
|
||||
# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
|
||||
# replaced with another file implementating the interface specified in
|
||||
# eap_sim_db.h.
|
||||
OBJS += ../src/eap_server/eap_sim_db.o
|
||||
NEED_FIPS186_2_PRF=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_PAX
|
||||
CFLAGS += -DEAP_SERVER_PAX
|
||||
OBJS += ../src/eap_server/eap_server_pax.o ../src/eap_common/eap_pax_common.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_PSK
|
||||
CFLAGS += -DEAP_SERVER_PSK
|
||||
OBJS += ../src/eap_server/eap_server_psk.o ../src/eap_common/eap_psk_common.o
|
||||
NEED_AES_OMAC1=y
|
||||
NEED_AES_ENCBLOCK=y
|
||||
NEED_AES_EAX=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_SAKE
|
||||
CFLAGS += -DEAP_SERVER_SAKE
|
||||
OBJS += ../src/eap_server/eap_server_sake.o ../src/eap_common/eap_sake_common.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_GPSK
|
||||
CFLAGS += -DEAP_SERVER_GPSK
|
||||
OBJS += ../src/eap_server/eap_server_gpsk.o ../src/eap_common/eap_gpsk_common.o
|
||||
ifdef CONFIG_EAP_GPSK_SHA256
|
||||
CFLAGS += -DEAP_SERVER_GPSK_SHA256
|
||||
endif
|
||||
NEED_SHA256=y
|
||||
NEED_AES_OMAC1=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_PWD
|
||||
CFLAGS += -DEAP_SERVER_PWD
|
||||
OBJS += ../src/eap_server/eap_server_pwd.o ../src/eap_common/eap_pwd_common.o
|
||||
NEED_SHA256=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_VENDOR_TEST
|
||||
CFLAGS += -DEAP_SERVER_VENDOR_TEST
|
||||
OBJS += ../src/eap_server/eap_server_vendor_test.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_FAST
|
||||
CFLAGS += -DEAP_SERVER_FAST
|
||||
OBJS += ../src/eap_server/eap_server_fast.o
|
||||
OBJS += ../src/eap_common/eap_fast_common.o
|
||||
TLS_FUNCS=y
|
||||
NEED_T_PRF=y
|
||||
NEED_AES_UNWRAP=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WPS
|
||||
ifdef CONFIG_WPS2
|
||||
CFLAGS += -DCONFIG_WPS2
|
||||
endif
|
||||
|
||||
CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
|
||||
OBJS += ../src/utils/uuid.o
|
||||
OBJS += ../src/ap/wps_hostapd.o
|
||||
OBJS += ../src/eap_server/eap_server_wsc.o ../src/eap_common/eap_wsc_common.o
|
||||
OBJS += ../src/wps/wps.o
|
||||
OBJS += ../src/wps/wps_common.o
|
||||
OBJS += ../src/wps/wps_attr_parse.o
|
||||
OBJS += ../src/wps/wps_attr_build.o
|
||||
OBJS += ../src/wps/wps_attr_process.o
|
||||
OBJS += ../src/wps/wps_dev_attr.o
|
||||
OBJS += ../src/wps/wps_enrollee.o
|
||||
OBJS += ../src/wps/wps_registrar.o
|
||||
NEED_DH_GROUPS=y
|
||||
NEED_SHA256=y
|
||||
NEED_BASE64=y
|
||||
NEED_AES_CBC=y
|
||||
NEED_MODEXP=y
|
||||
CONFIG_EAP=y
|
||||
|
||||
ifdef CONFIG_WPS_NFC
|
||||
CFLAGS += -DCONFIG_WPS_NFC
|
||||
OBJS += ../src/wps/ndef.o
|
||||
NEED_WPS_OOB=y
|
||||
endif
|
||||
|
||||
ifdef NEED_WPS_OOB
|
||||
CFLAGS += -DCONFIG_WPS_OOB
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WPS_UPNP
|
||||
CFLAGS += -DCONFIG_WPS_UPNP
|
||||
OBJS += ../src/wps/wps_upnp.o
|
||||
OBJS += ../src/wps/wps_upnp_ssdp.o
|
||||
OBJS += ../src/wps/wps_upnp_web.o
|
||||
OBJS += ../src/wps/wps_upnp_event.o
|
||||
OBJS += ../src/wps/wps_upnp_ap.o
|
||||
OBJS += ../src/wps/upnp_xml.o
|
||||
OBJS += ../src/wps/httpread.o
|
||||
OBJS += ../src/wps/http_client.o
|
||||
OBJS += ../src/wps/http_server.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WPS_STRICT
|
||||
CFLAGS += -DCONFIG_WPS_STRICT
|
||||
OBJS += ../src/wps/wps_validate.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WPS_TESTING
|
||||
CFLAGS += -DCONFIG_WPS_TESTING
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_IKEV2
|
||||
CFLAGS += -DEAP_SERVER_IKEV2
|
||||
OBJS += ../src/eap_server/eap_server_ikev2.o ../src/eap_server/ikev2.o
|
||||
OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
|
||||
NEED_DH_GROUPS=y
|
||||
NEED_DH_GROUPS_ALL=y
|
||||
NEED_MODEXP=y
|
||||
NEED_CIPHER=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_EAP_TNC
|
||||
CFLAGS += -DEAP_SERVER_TNC
|
||||
OBJS += ../src/eap_server/eap_server_tnc.o
|
||||
OBJS += ../src/eap_server/tncs.o
|
||||
NEED_BASE64=y
|
||||
ifndef CONFIG_DRIVER_BSD
|
||||
LIBS += -ldl
|
||||
endif
|
||||
endif
|
||||
|
||||
# Basic EAP functionality is needed for EAPOL
|
||||
OBJS += eap_register.o
|
||||
OBJS += ../src/eap_server/eap_server.o
|
||||
OBJS += ../src/eap_common/eap_common.o
|
||||
OBJS += ../src/eap_server/eap_server_methods.o
|
||||
OBJS += ../src/eap_server/eap_server_identity.o
|
||||
CFLAGS += -DEAP_SERVER_IDENTITY
|
||||
|
||||
ifdef CONFIG_EAP
|
||||
CFLAGS += -DEAP_SERVER
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PKCS12
|
||||
CFLAGS += -DPKCS12_FUNCS
|
||||
endif
|
||||
|
||||
ifdef MS_FUNCS
|
||||
OBJS += ../src/crypto/ms_funcs.o
|
||||
NEED_DES=y
|
||||
NEED_MD4=y
|
||||
endif
|
||||
|
||||
ifdef CHAP
|
||||
OBJS += ../src/eap_common/chap.o
|
||||
endif
|
||||
|
||||
ifdef TLS_FUNCS
|
||||
NEED_DES=y
|
||||
# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
|
||||
CFLAGS += -DEAP_TLS_FUNCS
|
||||
OBJS += ../src/eap_server/eap_server_tls_common.o
|
||||
NEED_TLS_PRF=y
|
||||
endif
|
||||
|
||||
ifndef CONFIG_TLS
|
||||
CONFIG_TLS=openssl
|
||||
endif
|
||||
|
||||
ifdef CONFIG_TLSV11
|
||||
CFLAGS += -DCONFIG_TLSV11
|
||||
endif
|
||||
|
||||
ifdef CONFIG_TLSV12
|
||||
CFLAGS += -DCONFIG_TLSV12
|
||||
NEED_SHA256=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), openssl)
|
||||
ifdef TLS_FUNCS
|
||||
OBJS += ../src/crypto/tls_openssl.o
|
||||
LIBS += -lssl
|
||||
endif
|
||||
OBJS += ../src/crypto/crypto_openssl.o
|
||||
HOBJS += ../src/crypto/crypto_openssl.o
|
||||
ifdef NEED_FIPS186_2_PRF
|
||||
OBJS += ../src/crypto/fips_prf_openssl.o
|
||||
endif
|
||||
LIBS += -lcrypto
|
||||
LIBS_h += -lcrypto
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), gnutls)
|
||||
ifdef TLS_FUNCS
|
||||
OBJS += ../src/crypto/tls_gnutls.o
|
||||
LIBS += -lgnutls -lgpg-error
|
||||
endif
|
||||
OBJS += ../src/crypto/crypto_gnutls.o
|
||||
HOBJS += ../src/crypto/crypto_gnutls.o
|
||||
ifdef NEED_FIPS186_2_PRF
|
||||
OBJS += ../src/crypto/fips_prf_gnutls.o
|
||||
endif
|
||||
LIBS += -lgcrypt
|
||||
LIBS_h += -lgcrypt
|
||||
CONFIG_INTERNAL_SHA256=y
|
||||
CONFIG_INTERNAL_RC4=y
|
||||
CONFIG_INTERNAL_DH_GROUP5=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), schannel)
|
||||
ifdef TLS_FUNCS
|
||||
OBJS += ../src/crypto/tls_schannel.o
|
||||
endif
|
||||
OBJS += ../src/crypto/crypto_cryptoapi.o
|
||||
OBJS_p += ../src/crypto/crypto_cryptoapi.o
|
||||
CONFIG_INTERNAL_SHA256=y
|
||||
CONFIG_INTERNAL_RC4=y
|
||||
CONFIG_INTERNAL_DH_GROUP5=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), nss)
|
||||
ifdef TLS_FUNCS
|
||||
OBJS += ../src/crypto/tls_nss.o
|
||||
LIBS += -lssl3
|
||||
endif
|
||||
OBJS += ../src/crypto/crypto_nss.o
|
||||
ifdef NEED_FIPS186_2_PRF
|
||||
OBJS += ../src/crypto/fips_prf_nss.o
|
||||
endif
|
||||
LIBS += -lnss3
|
||||
LIBS_h += -lnss3
|
||||
CONFIG_INTERNAL_MD4=y
|
||||
CONFIG_INTERNAL_DH_GROUP5=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), internal)
|
||||
ifndef CONFIG_CRYPTO
|
||||
CONFIG_CRYPTO=internal
|
||||
endif
|
||||
ifdef TLS_FUNCS
|
||||
OBJS += ../src/crypto/crypto_internal-rsa.o
|
||||
OBJS += ../src/crypto/tls_internal.o
|
||||
OBJS += ../src/tls/tlsv1_common.o
|
||||
OBJS += ../src/tls/tlsv1_record.o
|
||||
OBJS += ../src/tls/tlsv1_cred.o
|
||||
OBJS += ../src/tls/tlsv1_server.o
|
||||
OBJS += ../src/tls/tlsv1_server_write.o
|
||||
OBJS += ../src/tls/tlsv1_server_read.o
|
||||
OBJS += ../src/tls/asn1.o
|
||||
OBJS += ../src/tls/rsa.o
|
||||
OBJS += ../src/tls/x509v3.o
|
||||
OBJS += ../src/tls/pkcs1.o
|
||||
OBJS += ../src/tls/pkcs5.o
|
||||
OBJS += ../src/tls/pkcs8.o
|
||||
NEED_SHA256=y
|
||||
NEED_BASE64=y
|
||||
NEED_TLS_PRF=y
|
||||
ifdef CONFIG_TLSV12
|
||||
NEED_TLS_PRF_SHA256=y
|
||||
endif
|
||||
NEED_MODEXP=y
|
||||
NEED_CIPHER=y
|
||||
CFLAGS += -DCONFIG_TLS_INTERNAL
|
||||
CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
|
||||
endif
|
||||
ifdef NEED_CIPHER
|
||||
NEED_DES=y
|
||||
OBJS += ../src/crypto/crypto_internal-cipher.o
|
||||
endif
|
||||
ifdef NEED_MODEXP
|
||||
OBJS += ../src/crypto/crypto_internal-modexp.o
|
||||
OBJS += ../src/tls/bignum.o
|
||||
endif
|
||||
ifeq ($(CONFIG_CRYPTO), libtomcrypt)
|
||||
OBJS += ../src/crypto/crypto_libtomcrypt.o
|
||||
LIBS += -ltomcrypt -ltfm
|
||||
LIBS_h += -ltomcrypt -ltfm
|
||||
CONFIG_INTERNAL_SHA256=y
|
||||
CONFIG_INTERNAL_RC4=y
|
||||
CONFIG_INTERNAL_DH_GROUP5=y
|
||||
endif
|
||||
ifeq ($(CONFIG_CRYPTO), internal)
|
||||
OBJS += ../src/crypto/crypto_internal.o
|
||||
NEED_AES_DEC=y
|
||||
CFLAGS += -DCONFIG_CRYPTO_INTERNAL
|
||||
ifdef CONFIG_INTERNAL_LIBTOMMATH
|
||||
CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
|
||||
ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
|
||||
CFLAGS += -DLTM_FAST
|
||||
endif
|
||||
else
|
||||
LIBS += -ltommath
|
||||
LIBS_h += -ltommath
|
||||
endif
|
||||
CONFIG_INTERNAL_AES=y
|
||||
CONFIG_INTERNAL_DES=y
|
||||
CONFIG_INTERNAL_SHA1=y
|
||||
CONFIG_INTERNAL_MD4=y
|
||||
CONFIG_INTERNAL_MD5=y
|
||||
CONFIG_INTERNAL_SHA256=y
|
||||
CONFIG_INTERNAL_RC4=y
|
||||
CONFIG_INTERNAL_DH_GROUP5=y
|
||||
endif
|
||||
ifeq ($(CONFIG_CRYPTO), cryptoapi)
|
||||
OBJS += ../src/crypto/crypto_cryptoapi.o
|
||||
OBJS_p += ../src/crypto/crypto_cryptoapi.o
|
||||
CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
|
||||
CONFIG_INTERNAL_SHA256=y
|
||||
CONFIG_INTERNAL_RC4=y
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_TLS), none)
|
||||
ifdef TLS_FUNCS
|
||||
OBJS += ../src/crypto/tls_none.o
|
||||
CFLAGS += -DEAP_TLS_NONE
|
||||
CONFIG_INTERNAL_AES=y
|
||||
CONFIG_INTERNAL_SHA1=y
|
||||
CONFIG_INTERNAL_MD5=y
|
||||
endif
|
||||
OBJS += ../src/crypto/crypto_none.o
|
||||
OBJS_p += ../src/crypto/crypto_none.o
|
||||
CONFIG_INTERNAL_SHA256=y
|
||||
CONFIG_INTERNAL_RC4=y
|
||||
endif
|
||||
|
||||
ifndef TLS_FUNCS
|
||||
OBJS += ../src/crypto/tls_none.o
|
||||
ifeq ($(CONFIG_TLS), internal)
|
||||
CONFIG_INTERNAL_AES=y
|
||||
CONFIG_INTERNAL_SHA1=y
|
||||
CONFIG_INTERNAL_MD5=y
|
||||
CONFIG_INTERNAL_RC4=y
|
||||
endif
|
||||
endif
|
||||
|
||||
AESOBJS = # none so far
|
||||
ifdef CONFIG_INTERNAL_AES
|
||||
AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-enc.o
|
||||
endif
|
||||
|
||||
AESOBJS += ../src/crypto/aes-wrap.o
|
||||
ifdef NEED_AES_EAX
|
||||
AESOBJS += ../src/crypto/aes-eax.o
|
||||
NEED_AES_CTR=y
|
||||
endif
|
||||
ifdef NEED_AES_CTR
|
||||
AESOBJS += ../src/crypto/aes-ctr.o
|
||||
endif
|
||||
ifdef NEED_AES_ENCBLOCK
|
||||
AESOBJS += ../src/crypto/aes-encblock.o
|
||||
endif
|
||||
ifdef NEED_AES_OMAC1
|
||||
AESOBJS += ../src/crypto/aes-omac1.o
|
||||
endif
|
||||
ifdef NEED_AES_UNWRAP
|
||||
NEED_AES_DEC=y
|
||||
AESOBJS += ../src/crypto/aes-unwrap.o
|
||||
endif
|
||||
ifdef NEED_AES_CBC
|
||||
NEED_AES_DEC=y
|
||||
AESOBJS += ../src/crypto/aes-cbc.o
|
||||
endif
|
||||
ifdef NEED_AES_DEC
|
||||
ifdef CONFIG_INTERNAL_AES
|
||||
AESOBJS += ../src/crypto/aes-internal-dec.o
|
||||
endif
|
||||
endif
|
||||
ifdef NEED_AES
|
||||
OBJS += $(AESOBJS)
|
||||
endif
|
||||
|
||||
ifdef NEED_SHA1
|
||||
ifneq ($(CONFIG_TLS), openssl)
|
||||
SHA1OBJS += ../src/crypto/sha1.o
|
||||
endif
|
||||
SHA1OBJS += ../src/crypto/sha1-prf.o
|
||||
ifdef CONFIG_INTERNAL_SHA1
|
||||
SHA1OBJS += ../src/crypto/sha1-internal.o
|
||||
ifdef NEED_FIPS186_2_PRF
|
||||
SHA1OBJS += ../src/crypto/fips_prf_internal.o
|
||||
endif
|
||||
endif
|
||||
ifneq ($(CONFIG_TLS), openssl)
|
||||
SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
|
||||
endif
|
||||
ifdef NEED_T_PRF
|
||||
SHA1OBJS += ../src/crypto/sha1-tprf.o
|
||||
endif
|
||||
ifdef NEED_TLS_PRF
|
||||
SHA1OBJS += ../src/crypto/sha1-tlsprf.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NEED_SHA1
|
||||
OBJS += $(SHA1OBJS)
|
||||
endif
|
||||
|
||||
ifdef NEED_MD5
|
||||
ifdef CONFIG_INTERNAL_MD5
|
||||
OBJS += ../src/crypto/md5-internal.o
|
||||
HOBJS += ../src/crypto/md5-internal.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NEED_MD4
|
||||
ifdef CONFIG_INTERNAL_MD4
|
||||
OBJS += ../src/crypto/md4-internal.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NEED_DES
|
||||
ifdef CONFIG_INTERNAL_DES
|
||||
OBJS += ../src/crypto/des-internal.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NEED_RC4
|
||||
ifdef CONFIG_INTERNAL_RC4
|
||||
OBJS += ../src/crypto/rc4.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NEED_SHA256
|
||||
CFLAGS += -DCONFIG_SHA256
|
||||
ifneq ($(CONFIG_TLS), openssl)
|
||||
OBJS += ../src/crypto/sha256.o
|
||||
endif
|
||||
OBJS += ../src/crypto/sha256-prf.o
|
||||
ifdef CONFIG_INTERNAL_SHA256
|
||||
OBJS += ../src/crypto/sha256-internal.o
|
||||
endif
|
||||
ifdef NEED_TLS_PRF_SHA256
|
||||
OBJS += ../src/crypto/sha256-tlsprf.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef NEED_DH_GROUPS
|
||||
OBJS += ../src/crypto/dh_groups.o
|
||||
endif
|
||||
ifdef NEED_DH_GROUPS_ALL
|
||||
CFLAGS += -DALL_DH_GROUPS
|
||||
endif
|
||||
ifdef CONFIG_INTERNAL_DH_GROUP5
|
||||
ifdef NEED_DH_GROUPS
|
||||
OBJS += ../src/crypto/dh_group5.o
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_NO_RANDOM_POOL
|
||||
CFLAGS += -DCONFIG_NO_RANDOM_POOL
|
||||
else
|
||||
OBJS += ../src/crypto/random.o
|
||||
HOBJS += ../src/crypto/random.o
|
||||
HOBJS += ../src/utils/eloop.o
|
||||
HOBJS += $(SHA1OBJS)
|
||||
HOBJS += ../src/crypto/md5.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_RADIUS_SERVER
|
||||
CFLAGS += -DRADIUS_SERVER
|
||||
OBJS += ../src/radius/radius_server.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_IPV6
|
||||
CFLAGS += -DCONFIG_IPV6
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_RADIUS_ACL
|
||||
CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
|
||||
endif
|
||||
|
||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||
# define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
|
||||
# and vlan interfaces for the vlan feature.
|
||||
CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
|
||||
endif
|
||||
|
||||
ifdef NEED_BASE64
|
||||
OBJS += ../src/utils/base64.o
|
||||
endif
|
||||
|
||||
ifdef NEED_AP_MLME
|
||||
OBJS += ../src/ap/wmm.o
|
||||
OBJS += ../src/ap/ap_list.o
|
||||
OBJS += ../src/ap/ieee802_11.o
|
||||
OBJS += ../src/ap/hw_features.o
|
||||
CFLAGS += -DNEED_AP_MLME
|
||||
endif
|
||||
ifdef CONFIG_IEEE80211N
|
||||
OBJS += ../src/ap/ieee802_11_ht.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_IEEE80211AC
|
||||
OBJS += ../src/ap/ieee802_11_vht.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_P2P_MANAGER
|
||||
CFLAGS += -DCONFIG_P2P_MANAGER
|
||||
OBJS += ../src/ap/p2p_hostapd.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_HS20
|
||||
CFLAGS += -DCONFIG_HS20
|
||||
OBJS += ../src/ap/hs20.o
|
||||
CONFIG_INTERWORKING=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_INTERWORKING
|
||||
CFLAGS += -DCONFIG_INTERWORKING
|
||||
OBJS += ../src/common/gas.o
|
||||
OBJS += ../src/ap/gas_serv.o
|
||||
endif
|
||||
|
||||
OBJS += ../src/drivers/driver_common.o
|
||||
|
||||
ifdef CONFIG_WPA_CLI_EDIT
|
||||
OBJS_c += ../src/utils/edit.o
|
||||
else
|
||||
OBJS_c += ../src/utils/edit_simple.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_NO_STDOUT_DEBUG
|
||||
CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DEBUG_FILE
|
||||
CFLAGS += -DCONFIG_DEBUG_FILE
|
||||
endif
|
||||
|
||||
ifdef CONFIG_SQLITE
|
||||
CFLAGS += -DCONFIG_SQLITE
|
||||
LIBS += -lsqlite3
|
||||
LIBS_h += -lsqlite3
|
||||
endif
|
||||
|
||||
ALL=hostapd hostapd_cli
|
||||
|
||||
all: verify_config $(ALL)
|
||||
|
||||
Q=@
|
||||
E=echo
|
||||
ifeq ($(V), 1)
|
||||
Q=
|
||||
E=true
|
||||
endif
|
||||
|
||||
%.o: %.c
|
||||
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
||||
@$(E) " CC " $<
|
||||
|
||||
verify_config:
|
||||
@if [ ! -r .config ]; then \
|
||||
echo 'Building hostapd requires a configuration file'; \
|
||||
echo '(.config). See README for more instructions. You can'; \
|
||||
echo 'run "cp defconfig .config" to create an example'; \
|
||||
echo 'configuration.'; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)/usr/local/bin
|
||||
for i in $(ALL); do cp -f $$i $(DESTDIR)/usr/local/bin/$$i; done
|
||||
|
||||
../src/drivers/build.hostapd:
|
||||
@if [ -f ../src/drivers/build.wpa_supplicant ]; then \
|
||||
$(MAKE) -C ../src/drivers clean; \
|
||||
fi
|
||||
@touch ../src/drivers/build.hostapd
|
||||
|
||||
BCHECK=../src/drivers/build.hostapd
|
||||
|
||||
hostapd: $(BCHECK) $(OBJS)
|
||||
$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
|
||||
@$(E) " LD " $@
|
||||
|
||||
ifdef CONFIG_WPA_TRACE
|
||||
OBJS_c += ../src/utils/trace.o
|
||||
endif
|
||||
hostapd_cli: $(OBJS_c)
|
||||
$(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
|
||||
@$(E) " LD " $@
|
||||
|
||||
NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) ../src/crypto/md5.o
|
||||
ifdef NEED_RC4
|
||||
ifdef CONFIG_INTERNAL_RC4
|
||||
NOBJS += ../src/crypto/rc4.o
|
||||
endif
|
||||
endif
|
||||
ifdef CONFIG_INTERNAL_MD5
|
||||
NOBJS += ../src/crypto/md5-internal.o
|
||||
endif
|
||||
NOBJS += ../src/crypto/crypto_openssl.o ../src/utils/os_$(CONFIG_OS).o
|
||||
NOBJS += ../src/utils/wpa_debug.o
|
||||
NOBJS += ../src/utils/wpabuf.o
|
||||
ifdef CONFIG_WPA_TRACE
|
||||
NOBJS += ../src/utils/trace.o
|
||||
LIBS_n += -lbfd
|
||||
endif
|
||||
ifdef TLS_FUNCS
|
||||
LIBS_n += -lcrypto
|
||||
endif
|
||||
|
||||
HOBJS += hlr_auc_gw.o ../src/utils/common.o ../src/utils/wpa_debug.o ../src/utils/os_$(CONFIG_OS).o ../src/utils/wpabuf.o ../src/crypto/milenage.o
|
||||
HOBJS += ../src/crypto/aes-encblock.o
|
||||
ifdef CONFIG_INTERNAL_AES
|
||||
HOBJS += ../src/crypto/aes-internal.o
|
||||
HOBJS += ../src/crypto/aes-internal-enc.o
|
||||
endif
|
||||
|
||||
nt_password_hash: $(NOBJS)
|
||||
$(Q)$(CC) $(LDFLAGS) -o nt_password_hash $(NOBJS) $(LIBS_n)
|
||||
@$(E) " LD " $@
|
||||
|
||||
hlr_auc_gw: $(HOBJS)
|
||||
$(Q)$(CC) $(LDFLAGS) -o hlr_auc_gw $(HOBJS) $(LIBS_h)
|
||||
@$(E) " LD " $@
|
||||
|
||||
clean:
|
||||
$(MAKE) -C ../src clean
|
||||
rm -f core *~ *.o hostapd hostapd_cli nt_password_hash hlr_auc_gw
|
||||
rm -f *.d
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
@ -1,11 +0,0 @@
|
||||
SUBDIRS=ap common crypto drivers eapol_auth eapol_supp eap_common eap_peer eap_server l2_packet p2p radius rsn_supp tls utils wps
|
||||
|
||||
all:
|
||||
for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d; done
|
||||
|
||||
clean:
|
||||
for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d clean; done
|
||||
rm -f *~
|
||||
|
||||
install:
|
||||
for d in $(SUBDIRS); do [ -d $$d ] && $(MAKE) -C $$d install; done
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,62 +0,0 @@
|
||||
all: libcrypto.a
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d libcrypto.a
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
||||
|
||||
|
||||
include ../lib.rules
|
||||
|
||||
CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
|
||||
CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
|
||||
#CFLAGS += -DALL_DH_GROUPS
|
||||
CFLAGS += -DCONFIG_SHA256
|
||||
|
||||
LIB_OBJS= \
|
||||
aes-cbc.o \
|
||||
aes-ccm.o \
|
||||
aes-ctr.o \
|
||||
aes-eax.o \
|
||||
aes-encblock.o \
|
||||
aes-gcm.o \
|
||||
aes-internal.o \
|
||||
aes-internal-dec.o \
|
||||
aes-internal-enc.o \
|
||||
aes-omac1.o \
|
||||
aes-unwrap.o \
|
||||
aes-wrap.o \
|
||||
des-internal.o \
|
||||
dh_group5.o \
|
||||
dh_groups.o \
|
||||
md4-internal.o \
|
||||
md5.o \
|
||||
md5-internal.o \
|
||||
milenage.o \
|
||||
ms_funcs.o \
|
||||
rc4.o \
|
||||
sha1.o \
|
||||
sha1-internal.o \
|
||||
sha1-pbkdf2.o \
|
||||
sha1-prf.o \
|
||||
sha1-tlsprf.o \
|
||||
sha1-tprf.o \
|
||||
sha256.o \
|
||||
sha256-prf.o \
|
||||
sha256-tlsprf.o \
|
||||
sha256-internal.o
|
||||
|
||||
LIB_OBJS += crypto_internal.o
|
||||
LIB_OBJS += crypto_internal-cipher.o
|
||||
LIB_OBJS += crypto_internal-modexp.o
|
||||
LIB_OBJS += crypto_internal-rsa.o
|
||||
LIB_OBJS += tls_internal.o
|
||||
LIB_OBJS += fips_prf_internal.o
|
||||
LIB_OBJS += random.o
|
||||
|
||||
|
||||
libcrypto.a: $(LIB_OBJS)
|
||||
$(AR) crT $@ $?
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
@ -1,9 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
rm -f build.wpa_supplicant build.hostapd
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Android driver interface
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of BSD
|
||||
* license.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_DRV_H
|
||||
#define ANDROID_DRV_H
|
||||
|
||||
#define WPA_EVENT_DRIVER_STATE "CTRL-EVENT-DRIVER-STATE "
|
||||
|
||||
#define MAX_SSID_LEN 32
|
||||
|
||||
#define MAX_DRV_CMD_SIZE 248
|
||||
#define DRV_NUMBER_SEQUENTIAL_ERRORS 4
|
||||
|
||||
#define WEXT_PNOSETUP_HEADER "PNOSETUP "
|
||||
#define WEXT_PNOSETUP_HEADER_SIZE 9
|
||||
#define WEXT_PNO_TLV_PREFIX 'S'
|
||||
#define WEXT_PNO_TLV_VERSION '1'
|
||||
#define WEXT_PNO_TLV_SUBVERSION '2'
|
||||
#define WEXT_PNO_TLV_RESERVED '0'
|
||||
#define WEXT_PNO_VERSION_SIZE 4
|
||||
#define WEXT_PNO_AMOUNT 16
|
||||
#define WEXT_PNO_SSID_SECTION 'S'
|
||||
/* SSID header size is SSID section type above + SSID length */
|
||||
#define WEXT_PNO_SSID_HEADER_SIZE 2
|
||||
#define WEXT_PNO_SCAN_INTERVAL_SECTION 'T'
|
||||
#define WEXT_PNO_SCAN_INTERVAL_LENGTH 2
|
||||
#define WEXT_PNO_SCAN_INTERVAL 30
|
||||
/* Scan interval size is scan interval section type + scan interval length
|
||||
* above */
|
||||
#define WEXT_PNO_SCAN_INTERVAL_SIZE (1 + WEXT_PNO_SCAN_INTERVAL_LENGTH)
|
||||
#define WEXT_PNO_REPEAT_SECTION 'R'
|
||||
#define WEXT_PNO_REPEAT_LENGTH 1
|
||||
#define WEXT_PNO_REPEAT 4
|
||||
/* Repeat section size is Repeat section type + Repeat value length above */
|
||||
#define WEXT_PNO_REPEAT_SIZE (1 + WEXT_PNO_REPEAT_LENGTH)
|
||||
#define WEXT_PNO_MAX_REPEAT_SECTION 'M'
|
||||
#define WEXT_PNO_MAX_REPEAT_LENGTH 1
|
||||
#define WEXT_PNO_MAX_REPEAT 3
|
||||
/* Max Repeat section size is Max Repeat section type + Max Repeat value length
|
||||
* above */
|
||||
#define WEXT_PNO_MAX_REPEAT_SIZE (1 + WEXT_PNO_MAX_REPEAT_LENGTH)
|
||||
/* This corresponds to the size of all sections expect SSIDs */
|
||||
#define WEXT_PNO_NONSSID_SECTIONS_SIZE \
|
||||
(WEXT_PNO_SCAN_INTERVAL_SIZE + WEXT_PNO_REPEAT_SIZE + WEXT_PNO_MAX_REPEAT_SIZE)
|
||||
/* PNO Max command size is total of header, version, ssid and other sections +
|
||||
* Null termination */
|
||||
#define WEXT_PNO_MAX_COMMAND_SIZE \
|
||||
(WEXT_PNOSETUP_HEADER_SIZE + WEXT_PNO_VERSION_SIZE \
|
||||
+ WEXT_PNO_AMOUNT * (WEXT_PNO_SSID_HEADER_SIZE + MAX_SSID_LEN) \
|
||||
+ WEXT_PNO_NONSSID_SECTIONS_SIZE + 1)
|
||||
|
||||
#endif /* ANDROID_DRV_H */
|
@ -1,183 +0,0 @@
|
||||
##### CLEAR VARS
|
||||
|
||||
DRV_CFLAGS =
|
||||
DRV_WPA_CFLAGS =
|
||||
DRV_AP_CFLAGS =
|
||||
DRV_OBJS =
|
||||
DRV_WPA_OBJS =
|
||||
DRV_AP_OBJS =
|
||||
DRV_LIBS =
|
||||
DRV_WPA_LIBS =
|
||||
DRV_AP_LIBS =
|
||||
|
||||
##### COMMON DRIVERS
|
||||
|
||||
ifdef CONFIG_DRIVER_WIRED
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_WIRED
|
||||
DRV_OBJS += ../src/drivers/driver_wired.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_NL80211
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_NL80211
|
||||
DRV_OBJS += ../src/drivers/driver_nl80211.o
|
||||
DRV_OBJS += ../src/utils/radiotap.o
|
||||
NEED_SME=y
|
||||
NEED_AP_MLME=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
NEED_RFKILL=y
|
||||
|
||||
ifdef CONFIG_LIBNL32
|
||||
DRV_LIBS += -lnl-3
|
||||
DRV_LIBS += -lnl-genl-3
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3
|
||||
else
|
||||
ifdef CONFIG_LIBNL_TINY
|
||||
DRV_LIBS += -lnl-tiny
|
||||
else
|
||||
DRV_LIBS += -lnl
|
||||
endif
|
||||
|
||||
ifdef CONFIG_LIBNL20
|
||||
DRV_LIBS += -lnl-genl
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_BSD
|
||||
ifndef CONFIG_L2_PACKET
|
||||
CONFIG_L2_PACKET=freebsd
|
||||
endif
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_BSD
|
||||
DRV_OBJS += ../src/drivers/driver_bsd.o
|
||||
CONFIG_L2_FREEBSD=y
|
||||
CONFIG_DNET_PCAP=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_TEST
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_TEST
|
||||
DRV_OBJS += ../src/drivers/driver_test.o
|
||||
NEED_AP_MLME=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_NONE
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_NONE
|
||||
DRV_OBJS += ../src/drivers/driver_none.o
|
||||
endif
|
||||
|
||||
##### PURE AP DRIVERS
|
||||
|
||||
ifdef CONFIG_DRIVER_HOSTAP
|
||||
DRV_AP_CFLAGS += -DCONFIG_DRIVER_HOSTAP
|
||||
DRV_AP_OBJS += ../src/drivers/driver_hostap.o
|
||||
CONFIG_WIRELESS_EXTENSION=y
|
||||
NEED_AP_MLME=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_MADWIFI
|
||||
DRV_AP_CFLAGS += -DCONFIG_DRIVER_MADWIFI
|
||||
DRV_AP_OBJS += ../src/drivers/driver_madwifi.o
|
||||
CONFIG_WIRELESS_EXTENSION=y
|
||||
CONFIG_L2_PACKET=linux
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_ATHEROS
|
||||
DRV_AP_CFLAGS += -DCONFIG_DRIVER_ATHEROS
|
||||
DRV_AP_OBJS += ../src/drivers/driver_atheros.o
|
||||
CONFIG_L2_PACKET=linux
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
endif
|
||||
|
||||
##### PURE CLIENT DRIVERS
|
||||
|
||||
ifdef CONFIG_DRIVER_WEXT
|
||||
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
|
||||
CONFIG_WIRELESS_EXTENSION=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
NEED_RFKILL=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_NDIS
|
||||
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_NDIS
|
||||
DRV_WPA_OBJS += ../src/drivers/driver_ndis.o
|
||||
ifdef CONFIG_NDIS_EVENTS_INTEGRATED
|
||||
DRV_WPA_OBJS += ../src/drivers/driver_ndis_.o
|
||||
endif
|
||||
ifndef CONFIG_L2_PACKET
|
||||
CONFIG_L2_PACKET=pcap
|
||||
endif
|
||||
CONFIG_WINPCAP=y
|
||||
ifdef CONFIG_USE_NDISUIO
|
||||
DRV_WPA_CFLAGS += -DCONFIG_USE_NDISUIO
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_ROBOSWITCH
|
||||
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH
|
||||
DRV_WPA_OBJS += ../src/drivers/driver_roboswitch.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WIRELESS_EXTENSION
|
||||
DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
|
||||
DRV_WPA_OBJS += ../src/drivers/driver_wext.o
|
||||
NEED_RFKILL=y
|
||||
endif
|
||||
|
||||
ifdef NEED_NETLINK
|
||||
DRV_OBJS += ../src/drivers/netlink.o
|
||||
endif
|
||||
|
||||
ifdef NEED_LINUX_IOCTL
|
||||
DRV_OBJS += ../src/drivers/linux_ioctl.o
|
||||
endif
|
||||
|
||||
ifdef NEED_RFKILL
|
||||
DRV_OBJS += ../src/drivers/rfkill.o
|
||||
endif
|
||||
|
||||
ifdef CONFIG_VLAN_NETLINK
|
||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||
ifdef CONFIG_LIBNL32
|
||||
DRV_LIBS += -lnl-3
|
||||
DRV_LIBS += -lnl-genl-3
|
||||
DRV_LIBS += -lnl-route-3
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20
|
||||
else
|
||||
ifdef CONFIG_LIBNL_TINY
|
||||
DRV_LIBS += -lnl-tiny
|
||||
else
|
||||
DRV_LIBS += -lnl
|
||||
endif
|
||||
|
||||
ifdef CONFIG_LIBNL20
|
||||
DRV_LIBS += -lnl-genl
|
||||
DRV_LIBS += -lnl-route
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
##### COMMON VARS
|
||||
DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS)
|
||||
DRV_WPA_CFLAGS += $(DRV_CFLAGS)
|
||||
DRV_AP_CFLAGS += $(DRV_CFLAGS)
|
||||
|
||||
DRV_BOTH_LIBS := $(DRV_LIBS) $(DRV_WPA_LIBS) $(DRV_AP_LIBS)
|
||||
DRV_WPA_LIBS += $(DRV_LIBS)
|
||||
DRV_AP_LIBS += $(DRV_LIBS)
|
||||
|
||||
DRV_BOTH_OBJS := $(DRV_OBJS) $(DRV_WPA_OBJS) $(DRV_AP_OBJS)
|
||||
DRV_WPA_OBJS += $(DRV_OBJS)
|
||||
DRV_AP_OBJS += $(DRV_OBJS)
|
||||
|
||||
DRV_BOTH_LDFLAGS := $(DRV_LDFLAGS) $(DRV_WPA_LDFLAGS) $(DRV_AP_LDFLAGS)
|
||||
DRV_WPA_LDFLAGS += $(DRV_LDFLAGS)
|
||||
DRV_AP_LDFLAGS += $(DRV_LDFLAGS)
|
@ -1,187 +0,0 @@
|
||||
##### CLEAR VARS
|
||||
|
||||
DRV_CFLAGS =
|
||||
DRV_WPA_CFLAGS =
|
||||
DRV_AP_CFLAGS =
|
||||
DRV_OBJS =
|
||||
DRV_WPA_OBJS =
|
||||
DRV_AP_OBJS =
|
||||
DRV_LIBS =
|
||||
DRV_WPA_LIBS =
|
||||
DRV_AP_LIBS =
|
||||
|
||||
##### COMMON DRIVERS
|
||||
|
||||
ifdef CONFIG_DRIVER_WIRED
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_WIRED
|
||||
DRV_OBJS += src/drivers/driver_wired.c
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_NL80211
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_NL80211
|
||||
DRV_OBJS += src/drivers/driver_nl80211.c
|
||||
DRV_OBJS += src/utils/radiotap.c
|
||||
NEED_SME=y
|
||||
NEED_AP_MLME=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
NEED_RFKILL=y
|
||||
|
||||
ifdef CONFIG_LIBNL32
|
||||
DRV_LIBS += -lnl-3
|
||||
DRV_LIBS += -lnl-genl-3
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3
|
||||
else
|
||||
ifdef CONFIG_LIBNL_TINY
|
||||
DRV_LIBS += -lnl-tiny
|
||||
else
|
||||
DRV_LIBS += -lnl
|
||||
endif
|
||||
|
||||
ifdef CONFIG_LIBNL20
|
||||
DRV_LIBS += -lnl-genl
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_BSD
|
||||
ifndef CONFIG_L2_PACKET
|
||||
CONFIG_L2_PACKET=freebsd
|
||||
endif
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_BSD
|
||||
DRV_OBJS += src/drivers/driver_bsd.c
|
||||
CONFIG_L2_FREEBSD=y
|
||||
CONFIG_DNET_PCAP=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_TEST
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_TEST
|
||||
DRV_OBJS += src/drivers/driver_test.c
|
||||
NEED_AP_MLME=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_NONE
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_NONE
|
||||
DRV_OBJS += src/drivers/driver_none.c
|
||||
endif
|
||||
|
||||
##### PURE AP DRIVERS
|
||||
|
||||
ifdef CONFIG_DRIVER_HOSTAP
|
||||
DRV_AP_CFLAGS += -DCONFIG_DRIVER_HOSTAP
|
||||
DRV_AP_OBJS += src/drivers/driver_hostap.c
|
||||
CONFIG_WIRELESS_EXTENSION=y
|
||||
NEED_AP_MLME=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_MADWIFI
|
||||
DRV_AP_CFLAGS += -DCONFIG_DRIVER_MADWIFI
|
||||
DRV_AP_OBJS += src/drivers/driver_madwifi.c
|
||||
CONFIG_WIRELESS_EXTENSION=y
|
||||
CONFIG_L2_PACKET=linux
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_ATHEROS
|
||||
DRV_AP_CFLAGS += -DCONFIG_DRIVER_ATHEROS
|
||||
DRV_AP_OBJS += src/drivers/driver_atheros.c
|
||||
CONFIG_L2_PACKET=linux
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
endif
|
||||
|
||||
##### PURE CLIENT DRIVERS
|
||||
|
||||
ifdef CONFIG_DRIVER_WEXT
|
||||
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
|
||||
CONFIG_WIRELESS_EXTENSION=y
|
||||
NEED_NETLINK=y
|
||||
NEED_LINUX_IOCTL=y
|
||||
NEED_RFKILL=y
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_NDIS
|
||||
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_NDIS
|
||||
DRV_WPA_OBJS += src/drivers/driver_ndis.c
|
||||
ifdef CONFIG_NDIS_EVENTS_INTEGRATED
|
||||
DRV_WPA_OBJS += src/drivers/driver_ndis_.c
|
||||
endif
|
||||
ifndef CONFIG_L2_PACKET
|
||||
CONFIG_L2_PACKET=pcap
|
||||
endif
|
||||
CONFIG_WINPCAP=y
|
||||
ifdef CONFIG_USE_NDISUIO
|
||||
DRV_WPA_CFLAGS += -DCONFIG_USE_NDISUIO
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_ROBOSWITCH
|
||||
DRV_WPA_CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH
|
||||
DRV_WPA_OBJS += src/drivers/driver_roboswitch.c
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WIRELESS_EXTENSION
|
||||
DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
|
||||
DRV_WPA_OBJS += src/drivers/driver_wext.c
|
||||
NEED_RFKILL=y
|
||||
endif
|
||||
|
||||
ifdef NEED_NETLINK
|
||||
DRV_OBJS += src/drivers/netlink.c
|
||||
endif
|
||||
|
||||
ifdef NEED_LINUX_IOCTL
|
||||
DRV_OBJS += src/drivers/linux_ioctl.c
|
||||
endif
|
||||
|
||||
ifdef NEED_RFKILL
|
||||
DRV_OBJS += src/drivers/rfkill.c
|
||||
endif
|
||||
|
||||
ifdef CONFIG_DRIVER_CUSTOM
|
||||
DRV_CFLAGS += -DCONFIG_DRIVER_CUSTOM
|
||||
endif
|
||||
|
||||
ifdef CONFIG_VLAN_NETLINK
|
||||
ifdef CONFIG_FULL_DYNAMIC_VLAN
|
||||
ifdef CONFIG_LIBNL32
|
||||
DRV_LIBS += -lnl-3
|
||||
DRV_LIBS += -lnl-genl-3
|
||||
DRV_LIBS += -lnl-route-3
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20
|
||||
else
|
||||
ifdef CONFIG_LIBNL_TINY
|
||||
DRV_LIBS += -lnl-tiny
|
||||
else
|
||||
DRV_LIBS += -lnl
|
||||
endif
|
||||
|
||||
ifdef CONFIG_LIBNL20
|
||||
DRV_LIBS += -lnl-genl
|
||||
DRV_LIBS += -lnl-route
|
||||
DRV_CFLAGS += -DCONFIG_LIBNL20
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
##### COMMON VARS
|
||||
DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS)
|
||||
DRV_WPA_CFLAGS += $(DRV_CFLAGS)
|
||||
DRV_AP_CFLAGS += $(DRV_CFLAGS)
|
||||
|
||||
DRV_BOTH_LIBS := $(DRV_LIBS) $(DRV_WPA_LIBS) $(DRV_AP_LIBS)
|
||||
DRV_WPA_LIBS += $(DRV_LIBS)
|
||||
DRV_AP_LIBS += $(DRV_LIBS)
|
||||
|
||||
DRV_BOTH_OBJS := $(DRV_OBJS) $(DRV_WPA_OBJS) $(DRV_AP_OBJS)
|
||||
DRV_WPA_OBJS += $(DRV_OBJS)
|
||||
DRV_AP_OBJS += $(DRV_OBJS)
|
||||
|
||||
DRV_BOTH_LDFLAGS := $(DRV_LDFLAGS) $(DRV_WPA_LDFLAGS) $(DRV_AP_LDFLAGS)
|
||||
DRV_WPA_LDFLAGS += $(DRV_LDFLAGS)
|
||||
DRV_AP_LDFLAGS += $(DRV_LDFLAGS)
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Driver interaction with generic Linux Wireless Extensions
|
||||
* Copyright (c) 2003-2011, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef LINUX_WEXT_H
|
||||
#define LINUX_WEXT_H
|
||||
|
||||
#ifndef ANDROID
|
||||
|
||||
/*
|
||||
* Avoid including other kernel header to avoid conflicts with C library
|
||||
* headers.
|
||||
*/
|
||||
#define _LINUX_TYPES_H
|
||||
#define _LINUX_SOCKET_H
|
||||
#define _LINUX_IF_H
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <net/if.h>
|
||||
typedef __uint32_t __u32;
|
||||
typedef __int32_t __s32;
|
||||
typedef __uint16_t __u16;
|
||||
typedef __int16_t __s16;
|
||||
typedef __uint8_t __u8;
|
||||
#ifndef __user
|
||||
#define __user
|
||||
#endif /* __user */
|
||||
|
||||
#endif /* ANDROID */
|
||||
|
||||
#include <linux/wireless.h>
|
||||
|
||||
#ifndef IW_ENCODE_ALG_PMK
|
||||
#define IW_ENCODE_ALG_PMK 4
|
||||
#endif
|
||||
|
||||
#ifndef IW_ENC_CAPA_4WAY_HANDSHAKE
|
||||
#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010
|
||||
#endif
|
||||
|
||||
#endif /* LINUX_WEXT_H */
|
@ -1,188 +0,0 @@
|
||||
/*
|
||||
* Linux rfkill helper functions for driver wrappers
|
||||
* Copyright (c) 2010, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "utils/common.h"
|
||||
#include "utils/eloop.h"
|
||||
#include "rfkill.h"
|
||||
|
||||
#define RFKILL_EVENT_SIZE_V1 8
|
||||
|
||||
struct rfkill_event {
|
||||
u32 idx;
|
||||
u8 type;
|
||||
u8 op;
|
||||
u8 soft;
|
||||
u8 hard;
|
||||
} STRUCT_PACKED;
|
||||
|
||||
enum rfkill_operation {
|
||||
RFKILL_OP_ADD = 0,
|
||||
RFKILL_OP_DEL,
|
||||
RFKILL_OP_CHANGE,
|
||||
RFKILL_OP_CHANGE_ALL,
|
||||
};
|
||||
|
||||
enum rfkill_type {
|
||||
RFKILL_TYPE_ALL = 0,
|
||||
RFKILL_TYPE_WLAN,
|
||||
RFKILL_TYPE_BLUETOOTH,
|
||||
RFKILL_TYPE_UWB,
|
||||
RFKILL_TYPE_WIMAX,
|
||||
RFKILL_TYPE_WWAN,
|
||||
RFKILL_TYPE_GPS,
|
||||
RFKILL_TYPE_FM,
|
||||
NUM_RFKILL_TYPES,
|
||||
};
|
||||
|
||||
|
||||
struct rfkill_data {
|
||||
struct rfkill_config *cfg;
|
||||
int fd;
|
||||
int blocked;
|
||||
};
|
||||
|
||||
|
||||
static void rfkill_receive(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
struct rfkill_data *rfkill = eloop_ctx;
|
||||
struct rfkill_event event;
|
||||
ssize_t len;
|
||||
int new_blocked;
|
||||
|
||||
len = read(rfkill->fd, &event, sizeof(event));
|
||||
if (len < 0) {
|
||||
wpa_printf(MSG_ERROR, "rfkill: Event read failed: %s",
|
||||
strerror(errno));
|
||||
return;
|
||||
}
|
||||
if (len != RFKILL_EVENT_SIZE_V1) {
|
||||
wpa_printf(MSG_DEBUG, "rfkill: Unexpected event size "
|
||||
"%d (expected %d)",
|
||||
(int) len, RFKILL_EVENT_SIZE_V1);
|
||||
return;
|
||||
}
|
||||
wpa_printf(MSG_DEBUG, "rfkill: event: idx=%u type=%d "
|
||||
"op=%u soft=%u hard=%u",
|
||||
event.idx, event.type, event.op, event.soft,
|
||||
event.hard);
|
||||
if (event.op != RFKILL_OP_CHANGE || event.type != RFKILL_TYPE_WLAN)
|
||||
return;
|
||||
|
||||
if (event.hard) {
|
||||
wpa_printf(MSG_INFO, "rfkill: WLAN hard blocked");
|
||||
new_blocked = 1;
|
||||
} else if (event.soft) {
|
||||
wpa_printf(MSG_INFO, "rfkill: WLAN soft blocked");
|
||||
new_blocked = 1;
|
||||
} else {
|
||||
wpa_printf(MSG_INFO, "rfkill: WLAN unblocked");
|
||||
new_blocked = 0;
|
||||
}
|
||||
|
||||
if (new_blocked != rfkill->blocked) {
|
||||
rfkill->blocked = new_blocked;
|
||||
if (new_blocked)
|
||||
rfkill->cfg->blocked_cb(rfkill->cfg->ctx);
|
||||
else
|
||||
rfkill->cfg->unblocked_cb(rfkill->cfg->ctx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct rfkill_data * rfkill_init(struct rfkill_config *cfg)
|
||||
{
|
||||
struct rfkill_data *rfkill;
|
||||
struct rfkill_event event;
|
||||
ssize_t len;
|
||||
|
||||
rfkill = os_zalloc(sizeof(*rfkill));
|
||||
if (rfkill == NULL)
|
||||
return NULL;
|
||||
|
||||
rfkill->cfg = cfg;
|
||||
rfkill->fd = open("/dev/rfkill", O_RDONLY);
|
||||
if (rfkill->fd < 0) {
|
||||
wpa_printf(MSG_INFO, "rfkill: Cannot open RFKILL control "
|
||||
"device");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (fcntl(rfkill->fd, F_SETFL, O_NONBLOCK) < 0) {
|
||||
wpa_printf(MSG_ERROR, "rfkill: Cannot set non-blocking mode: "
|
||||
"%s", strerror(errno));
|
||||
goto fail2;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
len = read(rfkill->fd, &event, sizeof(event));
|
||||
if (len < 0) {
|
||||
if (errno == EAGAIN)
|
||||
break; /* No more entries */
|
||||
wpa_printf(MSG_ERROR, "rfkill: Event read failed: %s",
|
||||
strerror(errno));
|
||||
break;
|
||||
}
|
||||
if (len != RFKILL_EVENT_SIZE_V1) {
|
||||
wpa_printf(MSG_DEBUG, "rfkill: Unexpected event size "
|
||||
"%d (expected %d)",
|
||||
(int) len, RFKILL_EVENT_SIZE_V1);
|
||||
continue;
|
||||
}
|
||||
wpa_printf(MSG_DEBUG, "rfkill: initial event: idx=%u type=%d "
|
||||
"op=%u soft=%u hard=%u",
|
||||
event.idx, event.type, event.op, event.soft,
|
||||
event.hard);
|
||||
if (event.op != RFKILL_OP_ADD ||
|
||||
event.type != RFKILL_TYPE_WLAN)
|
||||
continue;
|
||||
if (event.hard) {
|
||||
wpa_printf(MSG_INFO, "rfkill: WLAN hard blocked");
|
||||
rfkill->blocked = 1;
|
||||
} else if (event.soft) {
|
||||
wpa_printf(MSG_INFO, "rfkill: WLAN soft blocked");
|
||||
rfkill->blocked = 1;
|
||||
}
|
||||
}
|
||||
|
||||
eloop_register_read_sock(rfkill->fd, rfkill_receive, rfkill, NULL);
|
||||
|
||||
return rfkill;
|
||||
|
||||
fail2:
|
||||
close(rfkill->fd);
|
||||
fail:
|
||||
os_free(rfkill);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void rfkill_deinit(struct rfkill_data *rfkill)
|
||||
{
|
||||
if (rfkill == NULL)
|
||||
return;
|
||||
|
||||
if (rfkill->fd >= 0) {
|
||||
eloop_unregister_read_sock(rfkill->fd);
|
||||
close(rfkill->fd);
|
||||
}
|
||||
|
||||
os_free(rfkill->cfg);
|
||||
os_free(rfkill);
|
||||
}
|
||||
|
||||
|
||||
int rfkill_is_blocked(struct rfkill_data *rfkill)
|
||||
{
|
||||
if (rfkill == NULL)
|
||||
return 0;
|
||||
|
||||
return rfkill->blocked;
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* Linux rfkill helper functions for driver wrappers
|
||||
* Copyright (c) 2010, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef RFKILL_H
|
||||
#define RFKILL_H
|
||||
|
||||
struct rfkill_data;
|
||||
|
||||
struct rfkill_config {
|
||||
void *ctx;
|
||||
char ifname[IFNAMSIZ];
|
||||
void (*blocked_cb)(void *ctx);
|
||||
void (*unblocked_cb)(void *ctx);
|
||||
};
|
||||
|
||||
struct rfkill_data * rfkill_init(struct rfkill_config *cfg);
|
||||
void rfkill_deinit(struct rfkill_data *rfkill);
|
||||
int rfkill_is_blocked(struct rfkill_data *rfkill);
|
||||
|
||||
#endif /* RFKILL_H */
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,11 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.so *.d
|
||||
|
||||
install:
|
||||
if ls *.so >/dev/null 2>&1; then \
|
||||
install -d $(DESTDIR)$(LIBDIR)/wpa_supplicant && \
|
||||
cp *.so $(DESTDIR)$(LIBDIR)/wpa_supplicant \
|
||||
; fi
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,21 +0,0 @@
|
||||
ifndef CC
|
||||
CC=gcc
|
||||
endif
|
||||
|
||||
ifndef CFLAGS
|
||||
CFLAGS = -MMD -O2 -Wall -g
|
||||
endif
|
||||
|
||||
CFLAGS += -I.. -I../utils
|
||||
|
||||
|
||||
Q=@
|
||||
E=echo
|
||||
ifeq ($(V), 1)
|
||||
Q=
|
||||
E=true
|
||||
endif
|
||||
|
||||
%.o: %.c
|
||||
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
||||
@$(E) " CC " $<
|
@ -1,9 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
for d in $(SUBDIRS); do make -C $$d clean; done
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,22 +0,0 @@
|
||||
all: libradius.a
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d libradius.a
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
||||
|
||||
|
||||
include ../lib.rules
|
||||
|
||||
CFLAGS += -DCONFIG_IPV6
|
||||
|
||||
LIB_OBJS= \
|
||||
radius.o \
|
||||
radius_client.o \
|
||||
radius_server.o
|
||||
|
||||
libradius.a: $(LIB_OBJS)
|
||||
$(AR) crT $@ $?
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
@ -1,39 +0,0 @@
|
||||
all: libtls.a
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d libtls.a
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
||||
|
||||
|
||||
include ../lib.rules
|
||||
|
||||
CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
|
||||
CFLAGS += -DCONFIG_CRYPTO_INTERNAL
|
||||
CFLAGS += -DCONFIG_TLSV11
|
||||
CFLAGS += -DCONFIG_TLSV12
|
||||
|
||||
LIB_OBJS= \
|
||||
asn1.o \
|
||||
bignum.o \
|
||||
pkcs1.o \
|
||||
pkcs5.o \
|
||||
pkcs8.o \
|
||||
rsa.o \
|
||||
tlsv1_client.o \
|
||||
tlsv1_client_read.o \
|
||||
tlsv1_client_write.o \
|
||||
tlsv1_common.o \
|
||||
tlsv1_cred.o \
|
||||
tlsv1_record.o \
|
||||
tlsv1_server.o \
|
||||
tlsv1_server_read.o \
|
||||
tlsv1_server_write.o \
|
||||
x509v3.o
|
||||
|
||||
|
||||
libtls.a: $(LIB_OBJS)
|
||||
$(AR) crT $@ $?
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
@ -1,39 +0,0 @@
|
||||
all: libutils.a
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d libutils.a
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
||||
|
||||
|
||||
include ../lib.rules
|
||||
|
||||
#CFLAGS += -DWPA_TRACE
|
||||
CFLAGS += -DCONFIG_IPV6
|
||||
|
||||
LIB_OBJS= \
|
||||
base64.o \
|
||||
common.o \
|
||||
ip_addr.o \
|
||||
radiotap.o \
|
||||
trace.o \
|
||||
uuid.o \
|
||||
wpa_debug.o \
|
||||
wpabuf.o
|
||||
|
||||
# Pick correct OS wrapper implementation
|
||||
LIB_OBJS += os_unix.o
|
||||
|
||||
# Pick correct event loop implementation
|
||||
LIB_OBJS += eloop.o
|
||||
|
||||
# Pick correct edit implementation
|
||||
LIB_OBJS += edit.o
|
||||
|
||||
#LIB_OBJS += pcsc_funcs.o
|
||||
|
||||
libutils.a: $(LIB_OBJS)
|
||||
$(AR) crT $@ $?
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
@ -1,8 +0,0 @@
|
||||
all:
|
||||
@echo Nothing to be made.
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
File diff suppressed because it is too large
Load Diff
1
contrib/wpa/wpa_supplicant/dbus/.gitignore
vendored
1
contrib/wpa/wpa_supplicant/dbus/.gitignore
vendored
@ -1 +0,0 @@
|
||||
libwpadbus.a
|
@ -1,73 +0,0 @@
|
||||
all: libwpadbus.a
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.d
|
||||
rm -f libwpadbus.a
|
||||
|
||||
install:
|
||||
@echo Nothing to be made.
|
||||
|
||||
ifndef CC
|
||||
CC=gcc
|
||||
endif
|
||||
|
||||
ifndef CFLAGS
|
||||
CFLAGS = -MMD -O2 -Wall -g
|
||||
endif
|
||||
|
||||
PKG_CONFIG ?= pkg-config
|
||||
CFLAGS += -I../../src -I../../src/utils
|
||||
|
||||
|
||||
Q=@
|
||||
E=echo
|
||||
ifeq ($(V), 1)
|
||||
Q=
|
||||
E=true
|
||||
endif
|
||||
|
||||
%.o: %.c
|
||||
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
|
||||
@$(E) " CC " $<
|
||||
|
||||
|
||||
ifdef CONFIG_WPS
|
||||
CFLAGS += -DCONFIG_WPS
|
||||
endif
|
||||
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_DBUS
|
||||
|
||||
ifndef DBUS_LIBS
|
||||
DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
|
||||
endif
|
||||
ifndef DBUS_INCLUDE
|
||||
DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
|
||||
endif
|
||||
ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
|
||||
CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
|
||||
DBUS_INCLUDE += $(shell xml2-config --cflags)
|
||||
DBUS_LIBS += $(shell xml2-config --libs)
|
||||
endif
|
||||
|
||||
CFLAGS += $(DBUS_INCLUDE)
|
||||
|
||||
LIB_OBJS= \
|
||||
dbus_common.o \
|
||||
dbus_old.o \
|
||||
dbus_old_handlers.o \
|
||||
dbus_new.o \
|
||||
dbus_new_handlers.o \
|
||||
dbus_new_helpers.o \
|
||||
dbus_new_introspect.o \
|
||||
dbus_dict_helpers.o
|
||||
|
||||
ifdef CONFIG_WPS
|
||||
LIB_OBJS += dbus_old_handlers_wps.o
|
||||
LIB_OBJS += dbus_new_handlers_wps.o
|
||||
endif
|
||||
|
||||
libwpadbus.a: $(LIB_OBJS)
|
||||
$(AR) crT $@ $?
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
@ -1,27 +0,0 @@
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="root">
|
||||
<allow own="fi.epitest.hostap.WPASupplicant"/>
|
||||
|
||||
<allow send_destination="fi.epitest.hostap.WPASupplicant"/>
|
||||
<allow send_interface="fi.epitest.hostap.WPASupplicant"/>
|
||||
|
||||
<allow own="fi.w1.wpa_supplicant1"/>
|
||||
|
||||
<allow send_destination="fi.w1.wpa_supplicant1"/>
|
||||
<allow send_interface="fi.w1.wpa_supplicant1"/>
|
||||
<allow receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
|
||||
</policy>
|
||||
<policy context="default">
|
||||
<deny own="fi.epitest.hostap.WPASupplicant"/>
|
||||
<deny send_destination="fi.epitest.hostap.WPASupplicant"/>
|
||||
<deny send_interface="fi.epitest.hostap.WPASupplicant"/>
|
||||
|
||||
<deny own="fi.w1.wpa_supplicant1"/>
|
||||
<deny send_destination="fi.w1.wpa_supplicant1"/>
|
||||
<deny send_interface="fi.w1.wpa_supplicant1"/>
|
||||
<deny receive_sender="fi.w1.wpa_supplicant1" receive_type="signal"/>
|
||||
</policy>
|
||||
</busconfig>
|
@ -1,365 +0,0 @@
|
||||
/*
|
||||
* wpa_supplicant D-Bus control interface - common functionality
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "utils/includes.h"
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
#include "utils/common.h"
|
||||
#include "utils/eloop.h"
|
||||
#include "dbus_common.h"
|
||||
#include "dbus_common_i.h"
|
||||
#include "dbus_new.h"
|
||||
#include "dbus_old.h"
|
||||
|
||||
|
||||
#ifndef SIGPOLL
|
||||
#ifdef SIGIO
|
||||
/*
|
||||
* If we do not have SIGPOLL, try to use SIGIO instead. This is needed for
|
||||
* FreeBSD.
|
||||
*/
|
||||
#define SIGPOLL SIGIO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
static void dispatch_data(DBusConnection *con)
|
||||
{
|
||||
while (dbus_connection_get_dispatch_status(con) ==
|
||||
DBUS_DISPATCH_DATA_REMAINS)
|
||||
dbus_connection_dispatch(con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* dispatch_initial_dbus_messages - Dispatch initial dbus messages after
|
||||
* claiming bus name
|
||||
* @eloop_ctx: the DBusConnection to dispatch on
|
||||
* @timeout_ctx: unused
|
||||
*
|
||||
* If clients are quick to notice that service claimed its bus name,
|
||||
* there may have been messages that came in before initialization was
|
||||
* all finished. Dispatch those here.
|
||||
*/
|
||||
static void dispatch_initial_dbus_messages(void *eloop_ctx, void *timeout_ctx)
|
||||
{
|
||||
DBusConnection *con = eloop_ctx;
|
||||
dispatch_data(con);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch(struct wpas_dbus_priv *priv,
|
||||
DBusWatch *watch, eloop_event_type type)
|
||||
{
|
||||
dbus_connection_ref(priv->con);
|
||||
|
||||
priv->should_dispatch = 0;
|
||||
|
||||
if (type == EVENT_TYPE_READ)
|
||||
dbus_watch_handle(watch, DBUS_WATCH_READABLE);
|
||||
else if (type == EVENT_TYPE_WRITE)
|
||||
dbus_watch_handle(watch, DBUS_WATCH_WRITABLE);
|
||||
else if (type == EVENT_TYPE_EXCEPTION)
|
||||
dbus_watch_handle(watch, DBUS_WATCH_ERROR);
|
||||
|
||||
if (priv->should_dispatch) {
|
||||
dispatch_data(priv->con);
|
||||
priv->should_dispatch = 0;
|
||||
}
|
||||
|
||||
dbus_connection_unref(priv->con);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch_exception(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
process_watch(eloop_ctx, sock_ctx, EVENT_TYPE_EXCEPTION);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch_read(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
process_watch(eloop_ctx, sock_ctx, EVENT_TYPE_READ);
|
||||
}
|
||||
|
||||
|
||||
static void process_watch_write(int sock, void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
process_watch(eloop_ctx, sock_ctx, EVENT_TYPE_WRITE);
|
||||
}
|
||||
|
||||
|
||||
static dbus_bool_t add_watch(DBusWatch *watch, void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
unsigned int flags;
|
||||
int fd;
|
||||
|
||||
if (!dbus_watch_get_enabled(watch))
|
||||
return TRUE;
|
||||
|
||||
flags = dbus_watch_get_flags(watch);
|
||||
fd = dbus_watch_get_unix_fd(watch);
|
||||
|
||||
eloop_register_sock(fd, EVENT_TYPE_EXCEPTION, process_watch_exception,
|
||||
priv, watch);
|
||||
|
||||
if (flags & DBUS_WATCH_READABLE) {
|
||||
eloop_register_sock(fd, EVENT_TYPE_READ, process_watch_read,
|
||||
priv, watch);
|
||||
}
|
||||
if (flags & DBUS_WATCH_WRITABLE) {
|
||||
eloop_register_sock(fd, EVENT_TYPE_WRITE, process_watch_write,
|
||||
priv, watch);
|
||||
}
|
||||
|
||||
dbus_watch_set_data(watch, priv, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void remove_watch(DBusWatch *watch, void *data)
|
||||
{
|
||||
unsigned int flags;
|
||||
int fd;
|
||||
|
||||
flags = dbus_watch_get_flags(watch);
|
||||
fd = dbus_watch_get_unix_fd(watch);
|
||||
|
||||
eloop_unregister_sock(fd, EVENT_TYPE_EXCEPTION);
|
||||
|
||||
if (flags & DBUS_WATCH_READABLE)
|
||||
eloop_unregister_sock(fd, EVENT_TYPE_READ);
|
||||
if (flags & DBUS_WATCH_WRITABLE)
|
||||
eloop_unregister_sock(fd, EVENT_TYPE_WRITE);
|
||||
|
||||
dbus_watch_set_data(watch, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
static void watch_toggled(DBusWatch *watch, void *data)
|
||||
{
|
||||
if (dbus_watch_get_enabled(watch))
|
||||
add_watch(watch, data);
|
||||
else
|
||||
remove_watch(watch, data);
|
||||
}
|
||||
|
||||
|
||||
static void process_timeout(void *eloop_ctx, void *sock_ctx)
|
||||
{
|
||||
DBusTimeout *timeout = sock_ctx;
|
||||
dbus_timeout_handle(timeout);
|
||||
}
|
||||
|
||||
|
||||
static dbus_bool_t add_timeout(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
if (!dbus_timeout_get_enabled(timeout))
|
||||
return TRUE;
|
||||
|
||||
eloop_register_timeout(0, dbus_timeout_get_interval(timeout) * 1000,
|
||||
process_timeout, priv, timeout);
|
||||
|
||||
dbus_timeout_set_data(timeout, priv, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
static void remove_timeout(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
eloop_cancel_timeout(process_timeout, priv, timeout);
|
||||
dbus_timeout_set_data(timeout, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
static void timeout_toggled(DBusTimeout *timeout, void *data)
|
||||
{
|
||||
if (dbus_timeout_get_enabled(timeout))
|
||||
add_timeout(timeout, data);
|
||||
else
|
||||
remove_timeout(timeout, data);
|
||||
}
|
||||
|
||||
|
||||
static void process_wakeup_main(int sig, void *signal_ctx)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = signal_ctx;
|
||||
|
||||
if (sig != SIGPOLL || !priv->con)
|
||||
return;
|
||||
|
||||
if (dbus_connection_get_dispatch_status(priv->con) !=
|
||||
DBUS_DISPATCH_DATA_REMAINS)
|
||||
return;
|
||||
|
||||
/* Only dispatch once - we do not want to starve other events */
|
||||
dbus_connection_ref(priv->con);
|
||||
dbus_connection_dispatch(priv->con);
|
||||
dbus_connection_unref(priv->con);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wakeup_main - Attempt to wake our mainloop up
|
||||
* @data: dbus control interface private data
|
||||
*
|
||||
* Try to wake up the main eloop so it will process
|
||||
* dbus events that may have happened.
|
||||
*/
|
||||
static void wakeup_main(void *data)
|
||||
{
|
||||
struct wpas_dbus_priv *priv = data;
|
||||
|
||||
/* Use SIGPOLL to break out of the eloop select() */
|
||||
raise(SIGPOLL);
|
||||
priv->should_dispatch = 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* integrate_with_eloop - Register our mainloop integration with dbus
|
||||
* @connection: connection to the system message bus
|
||||
* @priv: a dbus control interface data structure
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*/
|
||||
static int integrate_with_eloop(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
if (!dbus_connection_set_watch_functions(priv->con, add_watch,
|
||||
remove_watch, watch_toggled,
|
||||
priv, NULL) ||
|
||||
!dbus_connection_set_timeout_functions(priv->con, add_timeout,
|
||||
remove_timeout,
|
||||
timeout_toggled, priv,
|
||||
NULL)) {
|
||||
wpa_printf(MSG_ERROR, "dbus: Failed to set callback "
|
||||
"functions");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (eloop_register_signal(SIGPOLL, process_wakeup_main, priv))
|
||||
return -1;
|
||||
dbus_connection_set_wakeup_main_function(priv->con, wakeup_main,
|
||||
priv, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int wpas_dbus_init_common(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
DBusError error;
|
||||
int ret = 0;
|
||||
|
||||
/* Get a reference to the system bus */
|
||||
dbus_error_init(&error);
|
||||
priv->con = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
|
||||
if (!priv->con) {
|
||||
wpa_printf(MSG_ERROR, "dbus: Could not acquire the system "
|
||||
"bus: %s - %s", error.name, error.message);
|
||||
ret = -1;
|
||||
}
|
||||
dbus_error_free(&error);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int wpas_dbus_init_common_finish(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
/* Tell dbus about our mainloop integration functions */
|
||||
integrate_with_eloop(priv);
|
||||
|
||||
/*
|
||||
* Dispatch initial DBus messages that may have come in since the bus
|
||||
* name was claimed above. Happens when clients are quick to notice the
|
||||
* service.
|
||||
*
|
||||
* FIXME: is there a better solution to this problem?
|
||||
*/
|
||||
eloop_register_timeout(0, 50, dispatch_initial_dbus_messages,
|
||||
priv->con, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void wpas_dbus_deinit_common(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
if (priv->con) {
|
||||
eloop_cancel_timeout(dispatch_initial_dbus_messages,
|
||||
priv->con, NULL);
|
||||
dbus_connection_set_watch_functions(priv->con, NULL, NULL,
|
||||
NULL, NULL, NULL);
|
||||
dbus_connection_set_timeout_functions(priv->con, NULL, NULL,
|
||||
NULL, NULL, NULL);
|
||||
dbus_connection_unref(priv->con);
|
||||
}
|
||||
|
||||
os_free(priv);
|
||||
}
|
||||
|
||||
|
||||
struct wpas_dbus_priv * wpas_dbus_init(struct wpa_global *global)
|
||||
{
|
||||
struct wpas_dbus_priv *priv;
|
||||
|
||||
priv = os_zalloc(sizeof(*priv));
|
||||
if (priv == NULL)
|
||||
return NULL;
|
||||
priv->global = global;
|
||||
|
||||
if (wpas_dbus_init_common(priv) < 0) {
|
||||
wpas_dbus_deinit(priv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
|
||||
if (wpas_dbus_ctrl_iface_init(priv) < 0) {
|
||||
wpas_dbus_deinit(priv);
|
||||
return NULL;
|
||||
}
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS
|
||||
if (wpa_supplicant_dbus_ctrl_iface_init(priv) < 0) {
|
||||
wpas_dbus_deinit(priv);
|
||||
return NULL;
|
||||
}
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS */
|
||||
|
||||
if (wpas_dbus_init_common_finish(priv) < 0) {
|
||||
wpas_dbus_deinit(priv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return priv;
|
||||
}
|
||||
|
||||
|
||||
void wpas_dbus_deinit(struct wpas_dbus_priv *priv)
|
||||
{
|
||||
if (priv == NULL)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
|
||||
wpas_dbus_ctrl_iface_deinit(priv);
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS
|
||||
/* TODO: is any deinit needed? */
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS */
|
||||
|
||||
wpas_dbus_deinit_common(priv);
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
/*
|
||||
* wpa_supplicant D-Bus control interface - common definitions
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef DBUS_COMMON_H
|
||||
#define DBUS_COMMON_H
|
||||
|
||||
struct wpas_dbus_priv;
|
||||
struct wpa_global;
|
||||
|
||||
struct wpas_dbus_priv * wpas_dbus_init(struct wpa_global *global);
|
||||
void wpas_dbus_deinit(struct wpas_dbus_priv *priv);
|
||||
|
||||
#endif /* DBUS_COMMON_H */
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* wpa_supplicant D-Bus control interface - internal definitions
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
* Copyright (c) 2009, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef DBUS_COMMON_I_H
|
||||
#define DBUS_COMMON_I_H
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
struct wpas_dbus_priv {
|
||||
DBusConnection *con;
|
||||
int should_dispatch;
|
||||
struct wpa_global *global;
|
||||
u32 next_objid;
|
||||
int dbus_new_initialized;
|
||||
|
||||
#if defined(CONFIG_CTRL_IFACE_DBUS_NEW) && defined(CONFIG_AP)
|
||||
int dbus_noc_refcnt;
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW && CONFIG_AP */
|
||||
};
|
||||
|
||||
#endif /* DBUS_COMMON_I_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,163 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef DBUS_DICT_HELPERS_H
|
||||
#define DBUS_DICT_HELPERS_H
|
||||
|
||||
#include "wpabuf.h"
|
||||
|
||||
/*
|
||||
* Adding a dict to a DBusMessage
|
||||
*/
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_open_write(DBusMessageIter *iter,
|
||||
DBusMessageIter *iter_dict);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_close_write(DBusMessageIter *iter,
|
||||
DBusMessageIter *iter_dict);
|
||||
|
||||
const char * wpa_dbus_type_as_string(const int type);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_string(DBusMessageIter *iter_dict,
|
||||
const char *key, const char *value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_byte(DBusMessageIter *iter_dict,
|
||||
const char *key, const char value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_bool(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const dbus_bool_t value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_int16(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const dbus_int16_t value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_uint16(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const dbus_uint16_t value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_int32(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const dbus_int32_t value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_uint32(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const dbus_uint32_t value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_int64(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const dbus_int64_t value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_uint64(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const dbus_uint64_t value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_double(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const double value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_object_path(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const char *value);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_byte_array(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const char *value,
|
||||
const dbus_uint32_t value_len);
|
||||
|
||||
/* Manual construction and addition of array elements */
|
||||
dbus_bool_t wpa_dbus_dict_begin_array(DBusMessageIter *iter_dict,
|
||||
const char *key, const char *type,
|
||||
DBusMessageIter *iter_dict_entry,
|
||||
DBusMessageIter *iter_dict_val,
|
||||
DBusMessageIter *iter_array);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_begin_string_array(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
DBusMessageIter *iter_dict_entry,
|
||||
DBusMessageIter *iter_dict_val,
|
||||
DBusMessageIter *iter_array);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_string_array_add_element(DBusMessageIter *iter_array,
|
||||
const char *elem);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_bin_array_add_element(DBusMessageIter *iter_array,
|
||||
const u8 *value,
|
||||
size_t value_len);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_end_array(DBusMessageIter *iter_dict,
|
||||
DBusMessageIter *iter_dict_entry,
|
||||
DBusMessageIter *iter_dict_val,
|
||||
DBusMessageIter *iter_array);
|
||||
|
||||
static inline dbus_bool_t
|
||||
wpa_dbus_dict_end_string_array(DBusMessageIter *iter_dict,
|
||||
DBusMessageIter *iter_dict_entry,
|
||||
DBusMessageIter *iter_dict_val,
|
||||
DBusMessageIter *iter_array)
|
||||
{
|
||||
return wpa_dbus_dict_end_array(iter_dict, iter_dict_entry,
|
||||
iter_dict_val, iter_array);
|
||||
}
|
||||
|
||||
/* Convenience function to add a whole string list */
|
||||
dbus_bool_t wpa_dbus_dict_append_string_array(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const char **items,
|
||||
const dbus_uint32_t num_items);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_append_wpabuf_array(DBusMessageIter *iter_dict,
|
||||
const char *key,
|
||||
const struct wpabuf **items,
|
||||
const dbus_uint32_t num_items);
|
||||
|
||||
/*
|
||||
* Reading a dict from a DBusMessage
|
||||
*/
|
||||
|
||||
#define WPAS_DBUS_TYPE_BINARRAY (DBUS_NUMBER_OF_TYPES + 100)
|
||||
|
||||
struct wpa_dbus_dict_entry {
|
||||
int type; /** the dbus type of the dict entry's value */
|
||||
int array_type; /** the dbus type of the array elements if the dict
|
||||
entry value contains an array, or the special
|
||||
WPAS_DBUS_TYPE_BINARRAY */
|
||||
const char *key; /** key of the dict entry */
|
||||
|
||||
/** Possible values of the property */
|
||||
union {
|
||||
char *str_value;
|
||||
char byte_value;
|
||||
dbus_bool_t bool_value;
|
||||
dbus_int16_t int16_value;
|
||||
dbus_uint16_t uint16_value;
|
||||
dbus_int32_t int32_value;
|
||||
dbus_uint32_t uint32_value;
|
||||
dbus_int64_t int64_value;
|
||||
dbus_uint64_t uint64_value;
|
||||
double double_value;
|
||||
char *bytearray_value;
|
||||
char **strarray_value;
|
||||
struct wpabuf **binarray_value;
|
||||
};
|
||||
dbus_uint32_t array_len; /** length of the array if the dict entry's
|
||||
value contains an array */
|
||||
};
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_open_read(DBusMessageIter *iter,
|
||||
DBusMessageIter *iter_dict,
|
||||
DBusError *error);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_get_entry(DBusMessageIter *iter_dict,
|
||||
struct wpa_dbus_dict_entry *entry);
|
||||
|
||||
dbus_bool_t wpa_dbus_dict_has_dict_entry(DBusMessageIter *iter_dict);
|
||||
|
||||
void wpa_dbus_dict_entry_clear(struct wpa_dbus_dict_entry *entry);
|
||||
|
||||
#endif /* DBUS_DICT_HELPERS_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,498 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef CTRL_IFACE_DBUS_NEW_H
|
||||
#define CTRL_IFACE_DBUS_NEW_H
|
||||
|
||||
#include "common/defs.h"
|
||||
#include "p2p/p2p.h"
|
||||
|
||||
struct wpa_global;
|
||||
struct wpa_supplicant;
|
||||
struct wpa_ssid;
|
||||
struct wps_event_m2d;
|
||||
struct wps_event_fail;
|
||||
struct wps_credential;
|
||||
|
||||
enum wpas_dbus_prop {
|
||||
WPAS_DBUS_PROP_AP_SCAN,
|
||||
WPAS_DBUS_PROP_SCANNING,
|
||||
WPAS_DBUS_PROP_STATE,
|
||||
WPAS_DBUS_PROP_CURRENT_BSS,
|
||||
WPAS_DBUS_PROP_CURRENT_NETWORK,
|
||||
WPAS_DBUS_PROP_CURRENT_AUTH_MODE,
|
||||
WPAS_DBUS_PROP_BSSS,
|
||||
WPAS_DBUS_PROP_DISCONNECT_REASON,
|
||||
};
|
||||
|
||||
enum wpas_dbus_bss_prop {
|
||||
WPAS_DBUS_BSS_PROP_SIGNAL,
|
||||
WPAS_DBUS_BSS_PROP_FREQ,
|
||||
WPAS_DBUS_BSS_PROP_MODE,
|
||||
WPAS_DBUS_BSS_PROP_PRIVACY,
|
||||
WPAS_DBUS_BSS_PROP_RATES,
|
||||
WPAS_DBUS_BSS_PROP_WPA,
|
||||
WPAS_DBUS_BSS_PROP_RSN,
|
||||
WPAS_DBUS_BSS_PROP_WPS,
|
||||
WPAS_DBUS_BSS_PROP_IES,
|
||||
};
|
||||
|
||||
#define WPAS_DBUS_OBJECT_PATH_MAX 150
|
||||
|
||||
#define WPAS_DBUS_NEW_SERVICE "fi.w1.wpa_supplicant1"
|
||||
#define WPAS_DBUS_NEW_PATH "/fi/w1/wpa_supplicant1"
|
||||
#define WPAS_DBUS_NEW_INTERFACE "fi.w1.wpa_supplicant1"
|
||||
|
||||
#define WPAS_DBUS_NEW_PATH_INTERFACES WPAS_DBUS_NEW_PATH "/Interfaces"
|
||||
#define WPAS_DBUS_NEW_IFACE_INTERFACE WPAS_DBUS_NEW_INTERFACE ".Interface"
|
||||
#define WPAS_DBUS_NEW_IFACE_WPS WPAS_DBUS_NEW_IFACE_INTERFACE ".WPS"
|
||||
|
||||
#define WPAS_DBUS_NEW_NETWORKS_PART "Networks"
|
||||
#define WPAS_DBUS_NEW_IFACE_NETWORK WPAS_DBUS_NEW_INTERFACE ".Network"
|
||||
|
||||
#define WPAS_DBUS_NEW_BSSIDS_PART "BSSs"
|
||||
#define WPAS_DBUS_NEW_IFACE_BSS WPAS_DBUS_NEW_INTERFACE ".BSS"
|
||||
|
||||
#define WPAS_DBUS_NEW_IFACE_P2PDEVICE \
|
||||
WPAS_DBUS_NEW_IFACE_INTERFACE ".P2PDevice"
|
||||
|
||||
/*
|
||||
* Groups correspond to P2P groups where this device is a GO (owner)
|
||||
*/
|
||||
#define WPAS_DBUS_NEW_P2P_GROUPS_PART "Groups"
|
||||
#define WPAS_DBUS_NEW_IFACE_P2P_GROUP WPAS_DBUS_NEW_INTERFACE ".Group"
|
||||
|
||||
/*
|
||||
* Different dbus object for persistent groups so they do not get confused
|
||||
* with regular (configured) network objects.
|
||||
*/
|
||||
#define WPAS_DBUS_NEW_PERSISTENT_GROUPS_PART "PersistentGroups"
|
||||
#define WPAS_DBUS_NEW_IFACE_PERSISTENT_GROUP \
|
||||
WPAS_DBUS_NEW_INTERFACE ".PersistentGroup"
|
||||
|
||||
#define WPAS_DBUS_NEW_P2P_PEERS_PART "Peers"
|
||||
#define WPAS_DBUS_NEW_IFACE_P2P_PEER WPAS_DBUS_NEW_INTERFACE ".Peer"
|
||||
|
||||
#define WPAS_DBUS_NEW_P2P_GROUPMEMBERS_PART "Members"
|
||||
#define WPAS_DBUS_NEW_IFACE_P2P_GROUPMEMBER \
|
||||
WPAS_DBUS_NEW_INTERFACE ".GroupMember"
|
||||
|
||||
/* Errors */
|
||||
#define WPAS_DBUS_ERROR_UNKNOWN_ERROR \
|
||||
WPAS_DBUS_NEW_INTERFACE ".UnknownError"
|
||||
#define WPAS_DBUS_ERROR_INVALID_ARGS \
|
||||
WPAS_DBUS_NEW_INTERFACE ".InvalidArgs"
|
||||
|
||||
#define WPAS_DBUS_ERROR_IFACE_EXISTS \
|
||||
WPAS_DBUS_NEW_INTERFACE ".InterfaceExists"
|
||||
#define WPAS_DBUS_ERROR_IFACE_UNKNOWN \
|
||||
WPAS_DBUS_NEW_INTERFACE ".InterfaceUnknown"
|
||||
|
||||
#define WPAS_DBUS_ERROR_NOT_CONNECTED \
|
||||
WPAS_DBUS_NEW_INTERFACE ".NotConnected"
|
||||
#define WPAS_DBUS_ERROR_NETWORK_UNKNOWN \
|
||||
WPAS_DBUS_NEW_INTERFACE ".NetworkUnknown"
|
||||
|
||||
#define WPAS_DBUS_ERROR_CONNECT_CHANNEL_UNAVAILABLE \
|
||||
WPAS_DBUS_NEW_INTERFACE ".ConnectChannelUnavailable"
|
||||
#define WPAS_DBUS_ERROR_CONNECT_CHANNEL_UNSUPPORTED \
|
||||
WPAS_DBUS_NEW_INTERFACE ".ConnectChannelUnsupported"
|
||||
#define WPAS_DBUS_ERROR_CONNECT_UNSPECIFIED_ERROR \
|
||||
WPAS_DBUS_NEW_INTERFACE ".ConnectUnspecifiedError"
|
||||
|
||||
#define WPAS_DBUS_ERROR_BLOB_EXISTS \
|
||||
WPAS_DBUS_NEW_INTERFACE ".BlobExists"
|
||||
#define WPAS_DBUS_ERROR_BLOB_UNKNOWN \
|
||||
WPAS_DBUS_NEW_INTERFACE ".BlobUnknown"
|
||||
|
||||
#define WPAS_DBUS_ERROR_SUBSCRIPTION_IN_USE \
|
||||
WPAS_DBUS_NEW_INTERFACE ".SubscriptionInUse"
|
||||
#define WPAS_DBUS_ERROR_NO_SUBSCRIPTION \
|
||||
WPAS_DBUS_NEW_INTERFACE ".NoSubscription"
|
||||
#define WPAS_DBUS_ERROR_SUBSCRIPTION_EPERM \
|
||||
WPAS_DBUS_NEW_INTERFACE ".SubscriptionNotYou"
|
||||
|
||||
|
||||
void wpas_dbus_subscribe_noc(struct wpas_dbus_priv *priv);
|
||||
void wpas_dbus_unsubscribe_noc(struct wpas_dbus_priv *priv);
|
||||
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
|
||||
|
||||
int wpas_dbus_ctrl_iface_init(struct wpas_dbus_priv *priv);
|
||||
void wpas_dbus_ctrl_iface_deinit(struct wpas_dbus_priv *iface);
|
||||
|
||||
int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s);
|
||||
int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s);
|
||||
void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
|
||||
enum wpas_dbus_prop property);
|
||||
void wpas_dbus_bss_signal_prop_changed(struct wpa_supplicant *wpa_s,
|
||||
enum wpas_dbus_bss_prop property,
|
||||
unsigned int id);
|
||||
void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id);
|
||||
void wpas_dbus_signal_network_request(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid,
|
||||
enum wpa_ctrl_req_type rtype,
|
||||
const char *default_text);
|
||||
void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success);
|
||||
void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred);
|
||||
void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_m2d *m2d);
|
||||
void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_fail *fail);
|
||||
void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s);
|
||||
int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid);
|
||||
int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id);
|
||||
int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id);
|
||||
void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
|
||||
const char *name);
|
||||
void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *name);
|
||||
void wpas_dbus_signal_debug_level_changed(struct wpa_global *global);
|
||||
void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global);
|
||||
void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global);
|
||||
|
||||
int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s, const u8 *dev_addr);
|
||||
void wpas_dbus_signal_peer_device_found(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr);
|
||||
int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr);
|
||||
void wpas_dbus_signal_peer_device_lost(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr);
|
||||
void wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *role);
|
||||
void wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status,
|
||||
u16 config_methods,
|
||||
unsigned int generated_pin);
|
||||
void wpas_dbus_signal_p2p_go_neg_req(struct wpa_supplicant *wpa_s,
|
||||
const u8 *src, u16 dev_passwd_id);
|
||||
void wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
|
||||
const struct wpa_ssid *ssid,
|
||||
int client, int network_id);
|
||||
void wpas_dbus_register_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
|
||||
struct p2p_go_neg_results *res);
|
||||
void wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
const struct wpa_ssid *ssid);
|
||||
int wpas_dbus_register_persistent_group(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
int wpas_dbus_unregister_persistent_group(struct wpa_supplicant *wpa_s,
|
||||
int nid);
|
||||
void wpas_dbus_signal_p2p_invitation_result(struct wpa_supplicant *wpa_s,
|
||||
int status, const u8 *bssid);
|
||||
void wpas_dbus_register_p2p_groupmember(struct wpa_supplicant *wpa_s,
|
||||
const u8 *p2p_if_addr);
|
||||
void wpas_dbus_unregister_p2p_groupmember(struct wpa_supplicant *wpa_s,
|
||||
const u8 *p2p_if_addr);
|
||||
void wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member);
|
||||
void wpas_dbus_signal_p2p_sd_request(struct wpa_supplicant *wpa_s,
|
||||
int freq, const u8 *sa, u8 dialog_token,
|
||||
u16 update_indic, const u8 *tlvs,
|
||||
size_t tlvs_len);
|
||||
void wpas_dbus_signal_p2p_sd_response(struct wpa_supplicant *wpa_s,
|
||||
const u8 *sa, u16 update_indic,
|
||||
const u8 *tlvs, size_t tlvs_len);
|
||||
void wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member);
|
||||
void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_fail *fail);
|
||||
void wpas_dbus_signal_certification(struct wpa_supplicant *wpa_s,
|
||||
int depth, const char *subject,
|
||||
const char *cert_hash,
|
||||
const struct wpabuf *cert);
|
||||
void wpas_dbus_signal_preq(struct wpa_supplicant *wpa_s,
|
||||
const u8 *addr, const u8 *dst, const u8 *bssid,
|
||||
const u8 *ie, size_t ie_len, u32 ssi_signal);
|
||||
void wpas_dbus_signal_eap_status(struct wpa_supplicant *wpa_s,
|
||||
const char *status, const char *parameter);
|
||||
|
||||
#else /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
static inline int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define wpas_dbus_signal_state_changed(w, n, o) do { } while (0)
|
||||
|
||||
static inline void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
|
||||
enum wpas_dbus_prop property)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_bss_signal_prop_changed(
|
||||
struct wpa_supplicant *wpa_s, enum wpas_dbus_bss_prop property,
|
||||
unsigned int id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_network_enabled_changed(
|
||||
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_network_selected(
|
||||
struct wpa_supplicant *wpa_s, int id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_network_request(
|
||||
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid,
|
||||
enum wpa_ctrl_req_type rtype, const char *default_txt)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s,
|
||||
int success)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_m2d *m2d)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_event_fail(
|
||||
struct wpa_supplicant *wpa_s, struct wps_event_fail *fail)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_wps_event_success(
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s,
|
||||
int nid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
|
||||
u8 bssid[ETH_ALEN], unsigned int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
|
||||
const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *name)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_debug_level_changed(
|
||||
struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_debug_timestamp_changed(
|
||||
struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_debug_show_keys_changed(
|
||||
struct wpa_global *global)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_peer(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
||||
const char *role)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr, int request,
|
||||
enum p2p_prov_disc_status status,
|
||||
u16 config_methods,
|
||||
unsigned int generated_pin)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_p2p_go_neg_req(
|
||||
struct wpa_supplicant *wpa_s,
|
||||
const u8 *src,
|
||||
u16 dev_passwd_id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_group_started(struct wpa_supplicant *wpa_s,
|
||||
const struct wpa_ssid *ssid,
|
||||
int client, int network_id)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_register_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_register_persistent_group(
|
||||
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int wpas_dbus_unregister_persistent_group(
|
||||
struct wpa_supplicant *wpa_s, int nid)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
|
||||
struct p2p_go_neg_results *res)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
|
||||
const struct wpa_ssid *ssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_p2p_invitation_result(
|
||||
struct wpa_supplicant *wpa_s, int status,
|
||||
const u8 *bssid)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_register_p2p_groupmember(struct wpa_supplicant *wpa_s,
|
||||
const u8 *p2p_if_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_sd_request(struct wpa_supplicant *wpa_s, int freq,
|
||||
const u8 *sa, u8 dialog_token, u16 update_indic,
|
||||
const u8 *tlvs, size_t tlvs_len)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_sd_response(struct wpa_supplicant *wpa_s,
|
||||
const u8 *sa, u16 update_indic,
|
||||
const u8 *tlvs, size_t tlvs_len)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_unregister_p2p_groupmember(struct wpa_supplicant *wpa_s,
|
||||
const u8 *p2p_if_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_peer_joined(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_peer_device_found(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_peer_device_lost(struct wpa_supplicant *wpa_s,
|
||||
const u8 *dev_addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_peer_disconnected(struct wpa_supplicant *wpa_s,
|
||||
const u8 *member)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
|
||||
struct wps_event_fail *fail)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_certification(struct wpa_supplicant *wpa_s,
|
||||
int depth,
|
||||
const char *subject,
|
||||
const char *cert_hash,
|
||||
const struct wpabuf *cert)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_preq(struct wpa_supplicant *wpa_s,
|
||||
const u8 *addr, const u8 *dst,
|
||||
const u8 *bssid,
|
||||
const u8 *ie, size_t ie_len,
|
||||
u32 ssi_signal)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void wpas_dbus_signal_eap_status(struct wpa_supplicant *wpa_s,
|
||||
const char *status,
|
||||
const char *parameter)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
|
||||
|
||||
#endif /* CTRL_IFACE_DBUS_H_NEW */
|
File diff suppressed because it is too large
Load Diff
@ -1,285 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef CTRL_IFACE_DBUS_NEW_HANDLERS_H
|
||||
#define CTRL_IFACE_DBUS_NEW_HANDLERS_H
|
||||
|
||||
struct network_handler_args {
|
||||
struct wpa_supplicant *wpa_s;
|
||||
struct wpa_ssid *ssid;
|
||||
};
|
||||
|
||||
struct bss_handler_args {
|
||||
struct wpa_supplicant *wpa_s;
|
||||
unsigned int id;
|
||||
};
|
||||
|
||||
dbus_bool_t wpas_dbus_simple_property_getter(DBusMessageIter *iter,
|
||||
const int type,
|
||||
const void *val,
|
||||
DBusError *error);
|
||||
|
||||
dbus_bool_t wpas_dbus_simple_property_setter(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
const int type, void *val);
|
||||
|
||||
dbus_bool_t wpas_dbus_simple_array_property_getter(DBusMessageIter *iter,
|
||||
const int type,
|
||||
const void *array,
|
||||
size_t array_len,
|
||||
DBusError *error);
|
||||
|
||||
dbus_bool_t wpas_dbus_simple_array_array_property_getter(DBusMessageIter *iter,
|
||||
const int type,
|
||||
struct wpabuf **array,
|
||||
size_t array_len,
|
||||
DBusError *error);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message,
|
||||
struct wpa_global *global);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_remove_interface(DBusMessage *message,
|
||||
struct wpa_global *global);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_get_interface(DBusMessage *message,
|
||||
struct wpa_global *global);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_debug_level(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_debug_timestamp(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_debug_show_keys(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_debug_level(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_debug_timestamp(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_debug_show_keys(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_interfaces(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_eap_methods(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_global_capabilities(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_disconnect(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
dbus_bool_t set_network_properties(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid,
|
||||
DBusMessageIter *iter,
|
||||
DBusError *error);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_add_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_reassociate(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_remove_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_remove_all_networks(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_select_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_network_reply(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_add_blob(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_get_blob(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_remove_blob(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_flush_bss(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_autoscan(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_capabilities(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_state(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_scanning(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_ap_scan(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_ap_scan(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_fast_reauth(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_fast_reauth(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_disconnect_reason(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_expire_age(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_bss_expire_age(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_expire_count(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_bss_expire_count(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_country(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_country(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_scan_interval(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_scan_interval(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_ifname(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_driver(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bridge_ifname(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_current_bss(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_current_network(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_current_auth_mode(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bsss(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_networks(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_blobs(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_bssid(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_ssid(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_privacy(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_mode(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_signal(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_frequency(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_rates(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_wpa(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_rsn(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_wps(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_bss_ies(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_enabled(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_enabled(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_network_properties(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_network_properties(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_process_credentials(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_process_credentials(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
DBusMessage * wpas_dbus_error_invalid_args(DBusMessage *message,
|
||||
const char *arg);
|
||||
DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message,
|
||||
const char *arg);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_subscribe_preq(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
DBusMessage * wpas_dbus_handler_unsubscribe_preq(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
#endif /* CTRL_IFACE_DBUS_HANDLERS_NEW_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,211 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface for p2p
|
||||
* Copyright (c) 2011-2012, Intel Corporation
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef DBUS_NEW_HANDLERS_P2P_H
|
||||
#define DBUS_NEW_HANDLERS_P2P_H
|
||||
|
||||
struct peer_handler_args {
|
||||
struct wpa_supplicant *wpa_s;
|
||||
u8 p2p_device_addr[ETH_ALEN];
|
||||
};
|
||||
|
||||
struct groupmember_handler_args {
|
||||
struct wpa_supplicant *wpa_s;
|
||||
u8 member_addr[ETH_ALEN];
|
||||
};
|
||||
|
||||
/*
|
||||
* P2P Device methods
|
||||
*/
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_find(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_stop_find(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_rejectpeer(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_listen(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_extendedlisten(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_presence_request(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_prov_disc_req(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_group_add(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_connect(
|
||||
DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_invite(
|
||||
DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_disconnect(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_flush(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_add_service(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_delete_service(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_flush_service(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_service_sd_req(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_service_sd_res(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_service_sd_cancel_req(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_service_update(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage *wpas_dbus_handler_p2p_serv_disc_external(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
/*
|
||||
* P2P Device property accessor methods.
|
||||
*/
|
||||
dbus_bool_t wpas_dbus_setter_p2p_device_config(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_device_config(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peers(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_role(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group(DBusMessageIter *iter, DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peergo(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
* P2P Peer properties.
|
||||
*/
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_device_name(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_primary_device_type(
|
||||
DBusMessageIter *iter, DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_config_method(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_level(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_device_capability(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_group_capability(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_secondary_device_types(
|
||||
DBusMessageIter *iter, DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_vendor_extension(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_peer_ies(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
* P2P Group properties
|
||||
*/
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group_members(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group_ssid(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group_bssid(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group_frequency(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group_passphrase(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group_psk(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_p2p_group_vendor_ext(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_p2p_group_vendor_ext(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
/*
|
||||
* P2P Persistent Groups and properties
|
||||
*/
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_persistent_groups(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_getter_persistent_group_properties(DBusMessageIter *iter,
|
||||
DBusError *error, void *user_data);
|
||||
|
||||
dbus_bool_t wpas_dbus_setter_persistent_group_properties(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_add_persistent_group(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_remove_persistent_group(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_handler_remove_all_persistent_groups(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
|
||||
#endif /* DBUS_NEW_HANDLERS_P2P_H */
|
@ -1,391 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface (WPS)
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "../config.h"
|
||||
#include "../wpa_supplicant_i.h"
|
||||
#include "../wps_supplicant.h"
|
||||
#include "../driver_i.h"
|
||||
#include "../ap.h"
|
||||
#include "dbus_new_helpers.h"
|
||||
#include "dbus_new.h"
|
||||
#include "dbus_new_handlers.h"
|
||||
#include "dbus_dict_helpers.h"
|
||||
|
||||
|
||||
struct wps_start_params {
|
||||
int role; /* 0 - not set, 1 - enrollee, 2 - registrar */
|
||||
int type; /* 0 - not set, 1 - pin, 2 - pbc */
|
||||
u8 *bssid;
|
||||
char *pin;
|
||||
u8 *p2p_dev_addr;
|
||||
};
|
||||
|
||||
|
||||
static int wpas_dbus_handler_wps_role(DBusMessage *message,
|
||||
DBusMessageIter *entry_iter,
|
||||
struct wps_start_params *params,
|
||||
DBusMessage **reply)
|
||||
{
|
||||
DBusMessageIter variant_iter;
|
||||
char *val;
|
||||
|
||||
dbus_message_iter_recurse(entry_iter, &variant_iter);
|
||||
if (dbus_message_iter_get_arg_type(&variant_iter) !=
|
||||
DBUS_TYPE_STRING) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Wrong Role type, "
|
||||
"string required");
|
||||
*reply = wpas_dbus_error_invalid_args(message,
|
||||
"Role must be a string");
|
||||
return -1;
|
||||
}
|
||||
dbus_message_iter_get_basic(&variant_iter, &val);
|
||||
if (os_strcmp(val, "enrollee") == 0)
|
||||
params->role = 1;
|
||||
else if (os_strcmp(val, "registrar") == 0)
|
||||
params->role = 2;
|
||||
else {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Uknown role %s", val);
|
||||
*reply = wpas_dbus_error_invalid_args(message, val);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int wpas_dbus_handler_wps_type(DBusMessage *message,
|
||||
DBusMessageIter *entry_iter,
|
||||
struct wps_start_params *params,
|
||||
DBusMessage **reply)
|
||||
{
|
||||
DBusMessageIter variant_iter;
|
||||
char *val;
|
||||
|
||||
dbus_message_iter_recurse(entry_iter, &variant_iter);
|
||||
if (dbus_message_iter_get_arg_type(&variant_iter) !=
|
||||
DBUS_TYPE_STRING) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Wrong Type type, "
|
||||
"string required");
|
||||
*reply = wpas_dbus_error_invalid_args(message,
|
||||
"Type must be a string");
|
||||
return -1;
|
||||
}
|
||||
dbus_message_iter_get_basic(&variant_iter, &val);
|
||||
if (os_strcmp(val, "pin") == 0)
|
||||
params->type = 1;
|
||||
else if (os_strcmp(val, "pbc") == 0)
|
||||
params->type = 2;
|
||||
else {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Unknown type %s",
|
||||
val);
|
||||
*reply = wpas_dbus_error_invalid_args(message, val);
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int wpas_dbus_handler_wps_bssid(DBusMessage *message,
|
||||
DBusMessageIter *entry_iter,
|
||||
struct wps_start_params *params,
|
||||
DBusMessage **reply)
|
||||
{
|
||||
DBusMessageIter variant_iter, array_iter;
|
||||
int len;
|
||||
|
||||
dbus_message_iter_recurse(entry_iter, &variant_iter);
|
||||
if (dbus_message_iter_get_arg_type(&variant_iter) != DBUS_TYPE_ARRAY ||
|
||||
dbus_message_iter_get_element_type(&variant_iter) !=
|
||||
DBUS_TYPE_BYTE) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Wrong Bssid type, "
|
||||
"byte array required");
|
||||
*reply = wpas_dbus_error_invalid_args(
|
||||
message, "Bssid must be a byte array");
|
||||
return -1;
|
||||
}
|
||||
dbus_message_iter_recurse(&variant_iter, &array_iter);
|
||||
dbus_message_iter_get_fixed_array(&array_iter, ¶ms->bssid, &len);
|
||||
if (len != ETH_ALEN) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Stsrt - Wrong Bssid length "
|
||||
"%d", len);
|
||||
*reply = wpas_dbus_error_invalid_args(message,
|
||||
"Bssid is wrong length");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int wpas_dbus_handler_wps_pin(DBusMessage *message,
|
||||
DBusMessageIter *entry_iter,
|
||||
struct wps_start_params *params,
|
||||
DBusMessage **reply)
|
||||
{
|
||||
DBusMessageIter variant_iter;
|
||||
|
||||
dbus_message_iter_recurse(entry_iter, &variant_iter);
|
||||
if (dbus_message_iter_get_arg_type(&variant_iter) !=
|
||||
DBUS_TYPE_STRING) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Wrong Pin type, "
|
||||
"string required");
|
||||
*reply = wpas_dbus_error_invalid_args(message,
|
||||
"Pin must be a string");
|
||||
return -1;
|
||||
}
|
||||
dbus_message_iter_get_basic(&variant_iter, ¶ms->pin);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
static int wpas_dbus_handler_wps_p2p_dev_addr(DBusMessage *message,
|
||||
DBusMessageIter *entry_iter,
|
||||
struct wps_start_params *params,
|
||||
DBusMessage **reply)
|
||||
{
|
||||
DBusMessageIter variant_iter, array_iter;
|
||||
int len;
|
||||
|
||||
dbus_message_iter_recurse(entry_iter, &variant_iter);
|
||||
if (dbus_message_iter_get_arg_type(&variant_iter) != DBUS_TYPE_ARRAY ||
|
||||
dbus_message_iter_get_element_type(&variant_iter) !=
|
||||
DBUS_TYPE_BYTE) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Wrong "
|
||||
"P2PDeviceAddress type, byte array required");
|
||||
*reply = wpas_dbus_error_invalid_args(
|
||||
message, "P2PDeviceAddress must be a byte array");
|
||||
return -1;
|
||||
}
|
||||
dbus_message_iter_recurse(&variant_iter, &array_iter);
|
||||
dbus_message_iter_get_fixed_array(&array_iter, ¶ms->p2p_dev_addr,
|
||||
&len);
|
||||
if (len != ETH_ALEN) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Wrong "
|
||||
"P2PDeviceAddress length %d", len);
|
||||
*reply = wpas_dbus_error_invalid_args(message,
|
||||
"P2PDeviceAddress "
|
||||
"has wrong length");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
|
||||
static int wpas_dbus_handler_wps_start_entry(DBusMessage *message, char *key,
|
||||
DBusMessageIter *entry_iter,
|
||||
struct wps_start_params *params,
|
||||
DBusMessage **reply)
|
||||
{
|
||||
if (os_strcmp(key, "Role") == 0)
|
||||
return wpas_dbus_handler_wps_role(message, entry_iter,
|
||||
params, reply);
|
||||
else if (os_strcmp(key, "Type") == 0)
|
||||
return wpas_dbus_handler_wps_type(message, entry_iter,
|
||||
params, reply);
|
||||
else if (os_strcmp(key, "Bssid") == 0)
|
||||
return wpas_dbus_handler_wps_bssid(message, entry_iter,
|
||||
params, reply);
|
||||
else if (os_strcmp(key, "Pin") == 0)
|
||||
return wpas_dbus_handler_wps_pin(message, entry_iter,
|
||||
params, reply);
|
||||
#ifdef CONFIG_P2P
|
||||
else if (os_strcmp(key, "P2PDeviceAddress") == 0)
|
||||
return wpas_dbus_handler_wps_p2p_dev_addr(message, entry_iter,
|
||||
params, reply);
|
||||
#endif /* CONFIG_P2P */
|
||||
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - unknown key %s", key);
|
||||
*reply = wpas_dbus_error_invalid_args(message, key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_handler_wps_start - Start WPS configuration
|
||||
* @message: Pointer to incoming dbus message
|
||||
* @wpa_s: %wpa_supplicant data structure
|
||||
* Returns: DBus message dictionary on success or DBus error on failure
|
||||
*
|
||||
* Handler for "Start" method call. DBus dictionary argument contains
|
||||
* information about role (enrollee or registrar), authorization method
|
||||
* (pin or push button) and optionally pin and bssid. Returned message
|
||||
* has a dictionary argument which may contain newly generated pin (optional).
|
||||
*/
|
||||
DBusMessage * wpas_dbus_handler_wps_start(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
DBusMessage *reply = NULL;
|
||||
DBusMessageIter iter, dict_iter, entry_iter;
|
||||
struct wps_start_params params;
|
||||
char *key;
|
||||
char npin[9] = { '\0' };
|
||||
int ret;
|
||||
|
||||
os_memset(¶ms, 0, sizeof(params));
|
||||
dbus_message_iter_init(message, &iter);
|
||||
|
||||
dbus_message_iter_recurse(&iter, &dict_iter);
|
||||
while (dbus_message_iter_get_arg_type(&dict_iter) ==
|
||||
DBUS_TYPE_DICT_ENTRY) {
|
||||
dbus_message_iter_recurse(&dict_iter, &entry_iter);
|
||||
|
||||
dbus_message_iter_get_basic(&entry_iter, &key);
|
||||
dbus_message_iter_next(&entry_iter);
|
||||
|
||||
if (wpas_dbus_handler_wps_start_entry(message, key,
|
||||
&entry_iter,
|
||||
¶ms, &reply))
|
||||
return reply;
|
||||
|
||||
dbus_message_iter_next(&dict_iter);
|
||||
}
|
||||
|
||||
if (params.role == 0) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Role not specified");
|
||||
return wpas_dbus_error_invalid_args(message,
|
||||
"Role not specified");
|
||||
} else if (params.role == 1 && params.type == 0) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Type not specified");
|
||||
return wpas_dbus_error_invalid_args(message,
|
||||
"Type not specified");
|
||||
} else if (params.role == 2 && params.pin == NULL) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start - Pin required for "
|
||||
"registrar role");
|
||||
return wpas_dbus_error_invalid_args(
|
||||
message, "Pin required for registrar role.");
|
||||
}
|
||||
|
||||
if (params.role == 2)
|
||||
ret = wpas_wps_start_reg(wpa_s, params.bssid, params.pin,
|
||||
NULL);
|
||||
else if (params.type == 1) {
|
||||
#ifdef CONFIG_AP
|
||||
if (wpa_s->ap_iface)
|
||||
ret = wpa_supplicant_ap_wps_pin(wpa_s,
|
||||
params.bssid,
|
||||
params.pin,
|
||||
npin, sizeof(npin), 0);
|
||||
else
|
||||
#endif /* CONFIG_AP */
|
||||
{
|
||||
ret = wpas_wps_start_pin(wpa_s, params.bssid,
|
||||
params.pin, 0,
|
||||
DEV_PW_DEFAULT);
|
||||
if (ret > 0)
|
||||
os_snprintf(npin, sizeof(npin), "%08d", ret);
|
||||
}
|
||||
} else {
|
||||
#ifdef CONFIG_AP
|
||||
if (wpa_s->ap_iface)
|
||||
ret = wpa_supplicant_ap_wps_pbc(wpa_s,
|
||||
params.bssid,
|
||||
params.p2p_dev_addr);
|
||||
else
|
||||
#endif /* CONFIG_AP */
|
||||
ret = wpas_wps_start_pbc(wpa_s, params.bssid, 0);
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
wpa_printf(MSG_DEBUG, "dbus: WPS.Start wpas_wps_failed in "
|
||||
"role %s and key %s",
|
||||
(params.role == 1 ? "enrollee" : "registrar"),
|
||||
(params.type == 0 ? "" :
|
||||
(params.type == 1 ? "pin" : "pbc")));
|
||||
return wpas_dbus_error_unknown_error(message,
|
||||
"WPS start failed");
|
||||
}
|
||||
|
||||
reply = dbus_message_new_method_return(message);
|
||||
if (!reply) {
|
||||
return dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY,
|
||||
NULL);
|
||||
}
|
||||
|
||||
dbus_message_iter_init_append(reply, &iter);
|
||||
if (!wpa_dbus_dict_open_write(&iter, &dict_iter)) {
|
||||
dbus_message_unref(reply);
|
||||
return dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (os_strlen(npin) > 0) {
|
||||
if (!wpa_dbus_dict_append_string(&dict_iter, "Pin", npin)) {
|
||||
dbus_message_unref(reply);
|
||||
return dbus_message_new_error(message,
|
||||
DBUS_ERROR_NO_MEMORY,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!wpa_dbus_dict_close_write(&iter, &dict_iter)) {
|
||||
dbus_message_unref(reply);
|
||||
return dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY,
|
||||
NULL);
|
||||
}
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_getter_process_credentials - Check if credentials are processed
|
||||
* @message: Pointer to incoming dbus message
|
||||
* @wpa_s: %wpa_supplicant data structure
|
||||
* Returns: TRUE on success, FALSE on failure
|
||||
*
|
||||
* Getter for "ProcessCredentials" property. Returns returned boolean will be
|
||||
* true if wps_cred_processing configuration field is not equal to 1 or false
|
||||
* if otherwise.
|
||||
*/
|
||||
dbus_bool_t wpas_dbus_getter_process_credentials(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = user_data;
|
||||
dbus_bool_t process = (wpa_s->conf->wps_cred_processing != 1);
|
||||
return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_BOOLEAN,
|
||||
&process, error);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_setter_process_credentials - Set credentials_processed conf param
|
||||
* @iter: Pointer to incoming dbus message iter
|
||||
* @error: Location to store error on failure
|
||||
* @user_data: Function specific data
|
||||
* Returns: TRUE on success, FALSE on failure
|
||||
*
|
||||
* Setter for "ProcessCredentials" property. Sets credentials_processed on 2
|
||||
* if boolean argument is true or on 1 if otherwise.
|
||||
*/
|
||||
dbus_bool_t wpas_dbus_setter_process_credentials(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = user_data;
|
||||
dbus_bool_t process_credentials, old_pc;
|
||||
|
||||
if (!wpas_dbus_simple_property_setter(iter, error, DBUS_TYPE_BOOLEAN,
|
||||
&process_credentials))
|
||||
return FALSE;
|
||||
|
||||
old_pc = (wpa_s->conf->wps_cred_processing != 1);
|
||||
wpa_s->conf->wps_cred_processing = (process_credentials ? 2 : 1);
|
||||
|
||||
if ((wpa_s->conf->wps_cred_processing != 1) != old_pc)
|
||||
wpa_dbus_mark_property_changed(wpa_s->global->dbus,
|
||||
wpa_s->dbus_new_path,
|
||||
WPAS_DBUS_NEW_IFACE_WPS,
|
||||
"ProcessCredentials");
|
||||
|
||||
return TRUE;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,150 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef WPA_DBUS_CTRL_H
|
||||
#define WPA_DBUS_CTRL_H
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
typedef DBusMessage * (* WPADBusMethodHandler)(DBusMessage *message,
|
||||
void *user_data);
|
||||
typedef void (* WPADBusArgumentFreeFunction)(void *handler_arg);
|
||||
|
||||
typedef dbus_bool_t (* WPADBusPropertyAccessor)(DBusMessageIter *iter,
|
||||
DBusError *error,
|
||||
void *user_data);
|
||||
|
||||
struct wpa_dbus_object_desc {
|
||||
DBusConnection *connection;
|
||||
char *path;
|
||||
|
||||
/* list of methods, properties and signals registered with object */
|
||||
const struct wpa_dbus_method_desc *methods;
|
||||
const struct wpa_dbus_signal_desc *signals;
|
||||
const struct wpa_dbus_property_desc *properties;
|
||||
|
||||
/* property changed flags */
|
||||
u8 *prop_changed_flags;
|
||||
|
||||
/* argument for method handlers and properties
|
||||
* getter and setter functions */
|
||||
void *user_data;
|
||||
/* function used to free above argument */
|
||||
WPADBusArgumentFreeFunction user_data_free_func;
|
||||
};
|
||||
|
||||
enum dbus_arg_direction { ARG_IN, ARG_OUT };
|
||||
|
||||
struct wpa_dbus_argument {
|
||||
char *name;
|
||||
char *type;
|
||||
enum dbus_arg_direction dir;
|
||||
};
|
||||
|
||||
#define END_ARGS { NULL, NULL, ARG_IN }
|
||||
|
||||
/**
|
||||
* struct wpa_dbus_method_desc - DBus method description
|
||||
*/
|
||||
struct wpa_dbus_method_desc {
|
||||
/* method name */
|
||||
const char *dbus_method;
|
||||
/* method interface */
|
||||
const char *dbus_interface;
|
||||
/* method handling function */
|
||||
WPADBusMethodHandler method_handler;
|
||||
/* array of arguments */
|
||||
struct wpa_dbus_argument args[4];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wpa_dbus_signal_desc - DBus signal description
|
||||
*/
|
||||
struct wpa_dbus_signal_desc {
|
||||
/* signal name */
|
||||
const char *dbus_signal;
|
||||
/* signal interface */
|
||||
const char *dbus_interface;
|
||||
/* array of arguments */
|
||||
struct wpa_dbus_argument args[4];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct wpa_dbus_property_desc - DBus property description
|
||||
*/
|
||||
struct wpa_dbus_property_desc {
|
||||
/* property name */
|
||||
const char *dbus_property;
|
||||
/* property interface */
|
||||
const char *dbus_interface;
|
||||
/* property type signature in DBus type notation */
|
||||
const char *type;
|
||||
/* property getter function */
|
||||
WPADBusPropertyAccessor getter;
|
||||
/* property setter function */
|
||||
WPADBusPropertyAccessor setter;
|
||||
};
|
||||
|
||||
|
||||
#define WPAS_DBUS_OBJECT_PATH_MAX 150
|
||||
#define WPAS_DBUS_INTERFACE_MAX 150
|
||||
#define WPAS_DBUS_METHOD_SIGNAL_PROP_MAX 50
|
||||
#define WPAS_DBUS_AUTH_MODE_MAX 64
|
||||
|
||||
#define WPA_DBUS_INTROSPECTION_INTERFACE "org.freedesktop.DBus.Introspectable"
|
||||
#define WPA_DBUS_INTROSPECTION_METHOD "Introspect"
|
||||
#define WPA_DBUS_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
|
||||
#define WPA_DBUS_PROPERTIES_GET "Get"
|
||||
#define WPA_DBUS_PROPERTIES_SET "Set"
|
||||
#define WPA_DBUS_PROPERTIES_GETALL "GetAll"
|
||||
|
||||
void free_dbus_object_desc(struct wpa_dbus_object_desc *obj_dsc);
|
||||
|
||||
int wpa_dbus_ctrl_iface_init(struct wpas_dbus_priv *iface, char *dbus_path,
|
||||
char *dbus_service,
|
||||
struct wpa_dbus_object_desc *obj_desc);
|
||||
|
||||
int wpa_dbus_register_object_per_iface(
|
||||
struct wpas_dbus_priv *ctrl_iface,
|
||||
const char *path, const char *ifname,
|
||||
struct wpa_dbus_object_desc *obj_desc);
|
||||
|
||||
int wpa_dbus_unregister_object_per_iface(
|
||||
struct wpas_dbus_priv *ctrl_iface,
|
||||
const char *path);
|
||||
|
||||
dbus_bool_t wpa_dbus_get_object_properties(struct wpas_dbus_priv *iface,
|
||||
const char *path,
|
||||
const char *interface,
|
||||
DBusMessageIter *iter);
|
||||
|
||||
|
||||
void wpa_dbus_flush_all_changed_properties(DBusConnection *con);
|
||||
|
||||
void wpa_dbus_flush_object_changed_properties(DBusConnection *con,
|
||||
const char *path);
|
||||
|
||||
void wpa_dbus_mark_property_changed(struct wpas_dbus_priv *iface,
|
||||
const char *path, const char *interface,
|
||||
const char *property);
|
||||
|
||||
DBusMessage * wpa_dbus_introspect(DBusMessage *message,
|
||||
struct wpa_dbus_object_desc *obj_dsc);
|
||||
|
||||
char *wpas_dbus_new_decompose_object_path(const char *path,
|
||||
int p2p_persistent_group,
|
||||
char **network,
|
||||
char **bssid);
|
||||
|
||||
DBusMessage *wpas_dbus_reply_new_from_error(DBusMessage *message,
|
||||
DBusError *error,
|
||||
const char *fallback_name,
|
||||
const char *fallback_string);
|
||||
|
||||
#endif /* WPA_DBUS_CTRL_H */
|
@ -1,279 +0,0 @@
|
||||
/*
|
||||
* wpa_supplicant - D-Bus introspection
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
* Copyright (c) 2009, Witold Sowa <witold.sowa@gmail.com>
|
||||
* Copyright (c) 2010, Jouni Malinen <j@w1.fi>
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "utils/includes.h"
|
||||
|
||||
#include "utils/common.h"
|
||||
#include "utils/list.h"
|
||||
#include "utils/wpabuf.h"
|
||||
#include "dbus_common_i.h"
|
||||
#include "dbus_new_helpers.h"
|
||||
|
||||
|
||||
struct interfaces {
|
||||
struct dl_list list;
|
||||
char *dbus_interface;
|
||||
struct wpabuf *xml;
|
||||
};
|
||||
|
||||
|
||||
static struct interfaces * add_interface(struct dl_list *list,
|
||||
const char *dbus_interface)
|
||||
{
|
||||
struct interfaces *iface;
|
||||
|
||||
dl_list_for_each(iface, list, struct interfaces, list) {
|
||||
if (os_strcmp(iface->dbus_interface, dbus_interface) == 0)
|
||||
return iface; /* already in the list */
|
||||
}
|
||||
|
||||
iface = os_zalloc(sizeof(struct interfaces));
|
||||
if (!iface)
|
||||
return NULL;
|
||||
iface->xml = wpabuf_alloc(6000);
|
||||
if (iface->xml == NULL) {
|
||||
os_free(iface);
|
||||
return NULL;
|
||||
}
|
||||
wpabuf_printf(iface->xml, "<interface name=\"%s\">", dbus_interface);
|
||||
dl_list_add_tail(list, &iface->list);
|
||||
iface->dbus_interface = os_strdup(dbus_interface);
|
||||
return iface;
|
||||
}
|
||||
|
||||
|
||||
static void add_arg(struct wpabuf *xml, const char *name, const char *type,
|
||||
const char *direction)
|
||||
{
|
||||
wpabuf_printf(xml, "<arg name=\"%s\"", name);
|
||||
if (type)
|
||||
wpabuf_printf(xml, " type=\"%s\"", type);
|
||||
if (direction)
|
||||
wpabuf_printf(xml, " direction=\"%s\"", direction);
|
||||
wpabuf_put_str(xml, "/>");
|
||||
}
|
||||
|
||||
|
||||
static void add_entry(struct wpabuf *xml, const char *type, const char *name,
|
||||
const struct wpa_dbus_argument *args, int include_dir)
|
||||
{
|
||||
const struct wpa_dbus_argument *arg;
|
||||
|
||||
if (args == NULL || args->name == NULL) {
|
||||
wpabuf_printf(xml, "<%s name=\"%s\"/>", type, name);
|
||||
return;
|
||||
}
|
||||
wpabuf_printf(xml, "<%s name=\"%s\">", type, name);
|
||||
for (arg = args; arg && arg->name; arg++) {
|
||||
add_arg(xml, arg->name, arg->type,
|
||||
include_dir ? (arg->dir == ARG_IN ? "in" : "out") :
|
||||
NULL);
|
||||
}
|
||||
wpabuf_printf(xml, "</%s>", type);
|
||||
}
|
||||
|
||||
|
||||
static void add_property(struct wpabuf *xml,
|
||||
const struct wpa_dbus_property_desc *dsc)
|
||||
{
|
||||
wpabuf_printf(xml, "<property name=\"%s\" type=\"%s\" "
|
||||
"access=\"%s%s\"/>",
|
||||
dsc->dbus_property, dsc->type,
|
||||
dsc->getter ? "read" : "",
|
||||
dsc->setter ? "write" : "");
|
||||
}
|
||||
|
||||
|
||||
static void extract_interfaces_methods(
|
||||
struct dl_list *list, const struct wpa_dbus_method_desc *methods)
|
||||
{
|
||||
const struct wpa_dbus_method_desc *dsc;
|
||||
struct interfaces *iface;
|
||||
for (dsc = methods; dsc && dsc->dbus_method; dsc++) {
|
||||
iface = add_interface(list, dsc->dbus_interface);
|
||||
if (iface)
|
||||
add_entry(iface->xml, "method", dsc->dbus_method,
|
||||
dsc->args, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void extract_interfaces_signals(
|
||||
struct dl_list *list, const struct wpa_dbus_signal_desc *signals)
|
||||
{
|
||||
const struct wpa_dbus_signal_desc *dsc;
|
||||
struct interfaces *iface;
|
||||
for (dsc = signals; dsc && dsc->dbus_signal; dsc++) {
|
||||
iface = add_interface(list, dsc->dbus_interface);
|
||||
if (iface)
|
||||
add_entry(iface->xml, "signal", dsc->dbus_signal,
|
||||
dsc->args, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void extract_interfaces_properties(
|
||||
struct dl_list *list, const struct wpa_dbus_property_desc *properties)
|
||||
{
|
||||
const struct wpa_dbus_property_desc *dsc;
|
||||
struct interfaces *iface;
|
||||
for (dsc = properties; dsc && dsc->dbus_property; dsc++) {
|
||||
iface = add_interface(list, dsc->dbus_interface);
|
||||
if (iface)
|
||||
add_property(iface->xml, dsc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* extract_interfaces - Extract interfaces from methods, signals and props
|
||||
* @list: Interface list to be filled
|
||||
* @obj_dsc: Description of object from which interfaces will be extracted
|
||||
*
|
||||
* Iterates over all methods, signals, and properties registered with an
|
||||
* object and collects all declared DBus interfaces and create interfaces'
|
||||
* node in XML root node for each. Returned list elements contain interface
|
||||
* name and XML node of corresponding interface.
|
||||
*/
|
||||
static void extract_interfaces(struct dl_list *list,
|
||||
struct wpa_dbus_object_desc *obj_dsc)
|
||||
{
|
||||
extract_interfaces_methods(list, obj_dsc->methods);
|
||||
extract_interfaces_signals(list, obj_dsc->signals);
|
||||
extract_interfaces_properties(list, obj_dsc->properties);
|
||||
}
|
||||
|
||||
|
||||
static void add_interfaces(struct dl_list *list, struct wpabuf *xml)
|
||||
{
|
||||
struct interfaces *iface, *n;
|
||||
dl_list_for_each_safe(iface, n, list, struct interfaces, list) {
|
||||
if (wpabuf_len(iface->xml) + 20 < wpabuf_tailroom(xml)) {
|
||||
wpabuf_put_buf(xml, iface->xml);
|
||||
wpabuf_put_str(xml, "</interface>");
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "dbus: Not enough room for "
|
||||
"add_interfaces inspect data: tailroom %u, "
|
||||
"add %u",
|
||||
(unsigned int) wpabuf_tailroom(xml),
|
||||
(unsigned int) wpabuf_len(iface->xml));
|
||||
}
|
||||
dl_list_del(&iface->list);
|
||||
wpabuf_free(iface->xml);
|
||||
os_free(iface->dbus_interface);
|
||||
os_free(iface);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void add_child_nodes(struct wpabuf *xml, DBusConnection *con,
|
||||
const char *path)
|
||||
{
|
||||
char **children;
|
||||
int i;
|
||||
|
||||
/* add child nodes to introspection tree */
|
||||
dbus_connection_list_registered(con, path, &children);
|
||||
for (i = 0; children[i]; i++)
|
||||
wpabuf_printf(xml, "<node name=\"%s\"/>", children[i]);
|
||||
dbus_free_string_array(children);
|
||||
}
|
||||
|
||||
|
||||
static void add_introspectable_interface(struct wpabuf *xml)
|
||||
{
|
||||
wpabuf_printf(xml, "<interface name=\"%s\">"
|
||||
"<method name=\"%s\">"
|
||||
"<arg name=\"data\" type=\"s\" direction=\"out\"/>"
|
||||
"</method>"
|
||||
"</interface>",
|
||||
WPA_DBUS_INTROSPECTION_INTERFACE,
|
||||
WPA_DBUS_INTROSPECTION_METHOD);
|
||||
}
|
||||
|
||||
|
||||
static void add_properties_interface(struct wpabuf *xml)
|
||||
{
|
||||
wpabuf_printf(xml, "<interface name=\"%s\">",
|
||||
WPA_DBUS_PROPERTIES_INTERFACE);
|
||||
|
||||
wpabuf_printf(xml, "<method name=\"%s\">", WPA_DBUS_PROPERTIES_GET);
|
||||
add_arg(xml, "interface", "s", "in");
|
||||
add_arg(xml, "propname", "s", "in");
|
||||
add_arg(xml, "value", "v", "out");
|
||||
wpabuf_put_str(xml, "</method>");
|
||||
|
||||
wpabuf_printf(xml, "<method name=\"%s\">", WPA_DBUS_PROPERTIES_GETALL);
|
||||
add_arg(xml, "interface", "s", "in");
|
||||
add_arg(xml, "props", "a{sv}", "out");
|
||||
wpabuf_put_str(xml, "</method>");
|
||||
|
||||
wpabuf_printf(xml, "<method name=\"%s\">", WPA_DBUS_PROPERTIES_SET);
|
||||
add_arg(xml, "interface", "s", "in");
|
||||
add_arg(xml, "propname", "s", "in");
|
||||
add_arg(xml, "value", "v", "in");
|
||||
wpabuf_put_str(xml, "</method>");
|
||||
|
||||
wpabuf_put_str(xml, "</interface>");
|
||||
}
|
||||
|
||||
|
||||
static void add_wpas_interfaces(struct wpabuf *xml,
|
||||
struct wpa_dbus_object_desc *obj_dsc)
|
||||
{
|
||||
struct dl_list ifaces;
|
||||
dl_list_init(&ifaces);
|
||||
extract_interfaces(&ifaces, obj_dsc);
|
||||
add_interfaces(&ifaces, xml);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpa_dbus_introspect - Responds for Introspect calls on object
|
||||
* @message: Message with Introspect call
|
||||
* @obj_dsc: Object description on which Introspect was called
|
||||
* Returns: Message with introspection result XML string as only argument
|
||||
*
|
||||
* Iterates over all methods, signals and properties registered with
|
||||
* object and generates introspection data for the object as XML string.
|
||||
*/
|
||||
DBusMessage * wpa_dbus_introspect(DBusMessage *message,
|
||||
struct wpa_dbus_object_desc *obj_dsc)
|
||||
{
|
||||
|
||||
DBusMessage *reply;
|
||||
struct wpabuf *xml;
|
||||
|
||||
xml = wpabuf_alloc(10000);
|
||||
if (xml == NULL)
|
||||
return NULL;
|
||||
|
||||
wpabuf_put_str(xml, "<?xml version=\"1.0\"?>\n");
|
||||
wpabuf_put_str(xml, DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE);
|
||||
wpabuf_put_str(xml, "<node>");
|
||||
|
||||
add_introspectable_interface(xml);
|
||||
add_properties_interface(xml);
|
||||
add_wpas_interfaces(xml, obj_dsc);
|
||||
add_child_nodes(xml, obj_dsc->connection,
|
||||
dbus_message_get_path(message));
|
||||
|
||||
wpabuf_put_str(xml, "</node>\n");
|
||||
|
||||
reply = dbus_message_new_method_return(message);
|
||||
if (reply) {
|
||||
const char *intro_str = wpabuf_head(xml);
|
||||
dbus_message_append_args(reply, DBUS_TYPE_STRING, &intro_str,
|
||||
DBUS_TYPE_INVALID);
|
||||
}
|
||||
wpabuf_free(xml);
|
||||
|
||||
return reply;
|
||||
}
|
@ -1,743 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "eloop.h"
|
||||
#include "wps/wps.h"
|
||||
#include "../config.h"
|
||||
#include "../wpa_supplicant_i.h"
|
||||
#include "../bss.h"
|
||||
#include "dbus_old.h"
|
||||
#include "dbus_old_handlers.h"
|
||||
#include "dbus_common_i.h"
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_decompose_object_path - Decompose an interface object path into parts
|
||||
* @path: The dbus object path
|
||||
* @network: (out) the configured network this object path refers to, if any
|
||||
* @bssid: (out) the scanned bssid this object path refers to, if any
|
||||
* Returns: The object path of the network interface this path refers to
|
||||
*
|
||||
* For a given object path, decomposes the object path into object id, network,
|
||||
* and BSSID parts, if those parts exist.
|
||||
*/
|
||||
char * wpas_dbus_decompose_object_path(const char *path, char **network,
|
||||
char **bssid)
|
||||
{
|
||||
const unsigned int dev_path_prefix_len =
|
||||
strlen(WPAS_DBUS_PATH_INTERFACES "/");
|
||||
char *obj_path_only;
|
||||
char *next_sep;
|
||||
|
||||
/* Be a bit paranoid about path */
|
||||
if (!path || strncmp(path, WPAS_DBUS_PATH_INTERFACES "/",
|
||||
dev_path_prefix_len))
|
||||
return NULL;
|
||||
|
||||
/* Ensure there's something at the end of the path */
|
||||
if ((path + dev_path_prefix_len)[0] == '\0')
|
||||
return NULL;
|
||||
|
||||
obj_path_only = os_strdup(path);
|
||||
if (obj_path_only == NULL)
|
||||
return NULL;
|
||||
|
||||
next_sep = strchr(obj_path_only + dev_path_prefix_len, '/');
|
||||
if (next_sep != NULL) {
|
||||
const char *net_part = strstr(next_sep,
|
||||
WPAS_DBUS_NETWORKS_PART "/");
|
||||
const char *bssid_part = strstr(next_sep,
|
||||
WPAS_DBUS_BSSIDS_PART "/");
|
||||
|
||||
if (network && net_part) {
|
||||
/* Deal with a request for a configured network */
|
||||
const char *net_name = net_part +
|
||||
strlen(WPAS_DBUS_NETWORKS_PART "/");
|
||||
*network = NULL;
|
||||
if (strlen(net_name))
|
||||
*network = os_strdup(net_name);
|
||||
} else if (bssid && bssid_part) {
|
||||
/* Deal with a request for a scanned BSSID */
|
||||
const char *bssid_name = bssid_part +
|
||||
strlen(WPAS_DBUS_BSSIDS_PART "/");
|
||||
if (strlen(bssid_name))
|
||||
*bssid = os_strdup(bssid_name);
|
||||
else
|
||||
*bssid = NULL;
|
||||
}
|
||||
|
||||
/* Cut off interface object path before "/" */
|
||||
*next_sep = '\0';
|
||||
}
|
||||
|
||||
return obj_path_only;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_new_invalid_iface_error - Return a new invalid interface error message
|
||||
* @message: Pointer to incoming dbus message this error refers to
|
||||
* Returns: A dbus error message
|
||||
*
|
||||
* Convenience function to create and return an invalid interface error
|
||||
*/
|
||||
DBusMessage * wpas_dbus_new_invalid_iface_error(DBusMessage *message)
|
||||
{
|
||||
return dbus_message_new_error(message, WPAS_ERROR_INVALID_IFACE,
|
||||
"wpa_supplicant knows nothing about "
|
||||
"this interface.");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_new_invalid_network_error - Return a new invalid network error message
|
||||
* @message: Pointer to incoming dbus message this error refers to
|
||||
* Returns: a dbus error message
|
||||
*
|
||||
* Convenience function to create and return an invalid network error
|
||||
*/
|
||||
DBusMessage * wpas_dbus_new_invalid_network_error(DBusMessage *message)
|
||||
{
|
||||
return dbus_message_new_error(message, WPAS_ERROR_INVALID_NETWORK,
|
||||
"The requested network does not exist.");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_new_invalid_bssid_error - Return a new invalid bssid error message
|
||||
* @message: Pointer to incoming dbus message this error refers to
|
||||
* Returns: a dbus error message
|
||||
*
|
||||
* Convenience function to create and return an invalid bssid error
|
||||
*/
|
||||
static DBusMessage * wpas_dbus_new_invalid_bssid_error(DBusMessage *message)
|
||||
{
|
||||
return dbus_message_new_error(message, WPAS_ERROR_INVALID_BSSID,
|
||||
"The BSSID requested was invalid.");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dispatch_network_method - dispatch messages for configured networks
|
||||
* @message: the incoming dbus message
|
||||
* @wpa_s: a network interface's data
|
||||
* @network_id: id of the configured network we're interested in
|
||||
* Returns: a reply dbus message, or a dbus error message
|
||||
*
|
||||
* This function dispatches all incoming dbus messages for configured networks.
|
||||
*/
|
||||
static DBusMessage * wpas_dispatch_network_method(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s,
|
||||
int network_id)
|
||||
{
|
||||
DBusMessage *reply = NULL;
|
||||
const char *method = dbus_message_get_member(message);
|
||||
struct wpa_ssid *ssid;
|
||||
|
||||
ssid = wpa_config_get_network(wpa_s->conf, network_id);
|
||||
if (ssid == NULL)
|
||||
return wpas_dbus_new_invalid_network_error(message);
|
||||
|
||||
if (!strcmp(method, "set"))
|
||||
reply = wpas_dbus_iface_set_network(message, wpa_s, ssid);
|
||||
else if (!strcmp(method, "enable"))
|
||||
reply = wpas_dbus_iface_enable_network(message, wpa_s, ssid);
|
||||
else if (!strcmp(method, "disable"))
|
||||
reply = wpas_dbus_iface_disable_network(message, wpa_s, ssid);
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dispatch_bssid_method - dispatch messages for scanned networks
|
||||
* @message: the incoming dbus message
|
||||
* @wpa_s: a network interface's data
|
||||
* @bssid: bssid of the scanned network we're interested in
|
||||
* Returns: a reply dbus message, or a dbus error message
|
||||
*
|
||||
* This function dispatches all incoming dbus messages for scanned networks.
|
||||
*/
|
||||
static DBusMessage * wpas_dispatch_bssid_method(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s,
|
||||
const char *bssid_txt)
|
||||
{
|
||||
u8 bssid[ETH_ALEN];
|
||||
struct wpa_bss *bss;
|
||||
|
||||
if (hexstr2bin(bssid_txt, bssid, ETH_ALEN) < 0)
|
||||
return wpas_dbus_new_invalid_bssid_error(message);
|
||||
|
||||
bss = wpa_bss_get_bssid(wpa_s, bssid);
|
||||
if (bss == NULL)
|
||||
return wpas_dbus_new_invalid_bssid_error(message);
|
||||
|
||||
/* Dispatch the method call against the scanned bssid */
|
||||
if (os_strcmp(dbus_message_get_member(message), "properties") == 0)
|
||||
return wpas_dbus_bssid_properties(message, wpa_s, bss);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_iface_message_handler - Dispatch messages for interfaces or networks
|
||||
* @connection: Connection to the system message bus
|
||||
* @message: An incoming dbus message
|
||||
* @user_data: A pointer to a dbus control interface data structure
|
||||
* Returns: Whether or not the message was handled
|
||||
*
|
||||
* This function dispatches all incoming dbus messages for network interfaces,
|
||||
* or objects owned by them, such as scanned BSSIDs and configured networks.
|
||||
*/
|
||||
static DBusHandlerResult wpas_iface_message_handler(DBusConnection *connection,
|
||||
DBusMessage *message,
|
||||
void *user_data)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = user_data;
|
||||
const char *method = dbus_message_get_member(message);
|
||||
const char *path = dbus_message_get_path(message);
|
||||
const char *msg_interface = dbus_message_get_interface(message);
|
||||
char *iface_obj_path = NULL;
|
||||
char *network = NULL;
|
||||
char *bssid = NULL;
|
||||
DBusMessage *reply = NULL;
|
||||
|
||||
/* Caller must specify a message interface */
|
||||
if (!msg_interface)
|
||||
goto out;
|
||||
|
||||
iface_obj_path = wpas_dbus_decompose_object_path(path, &network,
|
||||
&bssid);
|
||||
if (iface_obj_path == NULL) {
|
||||
reply = wpas_dbus_new_invalid_iface_error(message);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Make sure the message's object path actually refers to the
|
||||
* wpa_supplicant structure it's supposed to (which is wpa_s)
|
||||
*/
|
||||
if (wpa_supplicant_get_iface_by_dbus_path(wpa_s->global,
|
||||
iface_obj_path) != wpa_s) {
|
||||
reply = wpas_dbus_new_invalid_iface_error(message);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (network && !strcmp(msg_interface, WPAS_DBUS_IFACE_NETWORK)) {
|
||||
/* A method for one of this interface's configured networks */
|
||||
int nid = strtoul(network, NULL, 10);
|
||||
if (errno != EINVAL)
|
||||
reply = wpas_dispatch_network_method(message, wpa_s,
|
||||
nid);
|
||||
else
|
||||
reply = wpas_dbus_new_invalid_network_error(message);
|
||||
} else if (bssid && !strcmp(msg_interface, WPAS_DBUS_IFACE_BSSID)) {
|
||||
/* A method for one of this interface's scanned BSSIDs */
|
||||
reply = wpas_dispatch_bssid_method(message, wpa_s, bssid);
|
||||
} else if (!strcmp(msg_interface, WPAS_DBUS_IFACE_INTERFACE)) {
|
||||
/* A method for an interface only. */
|
||||
if (!strcmp(method, "scan"))
|
||||
reply = wpas_dbus_iface_scan(message, wpa_s);
|
||||
else if (!strcmp(method, "scanResults"))
|
||||
reply = wpas_dbus_iface_scan_results(message, wpa_s);
|
||||
else if (!strcmp(method, "addNetwork"))
|
||||
reply = wpas_dbus_iface_add_network(message, wpa_s);
|
||||
else if (!strcmp(method, "removeNetwork"))
|
||||
reply = wpas_dbus_iface_remove_network(message, wpa_s);
|
||||
else if (!strcmp(method, "selectNetwork"))
|
||||
reply = wpas_dbus_iface_select_network(message, wpa_s);
|
||||
else if (!strcmp(method, "capabilities"))
|
||||
reply = wpas_dbus_iface_capabilities(message, wpa_s);
|
||||
else if (!strcmp(method, "disconnect"))
|
||||
reply = wpas_dbus_iface_disconnect(message, wpa_s);
|
||||
else if (!strcmp(method, "setAPScan"))
|
||||
reply = wpas_dbus_iface_set_ap_scan(message, wpa_s);
|
||||
else if (!strcmp(method, "setSmartcardModules"))
|
||||
reply = wpas_dbus_iface_set_smartcard_modules(message,
|
||||
wpa_s);
|
||||
else if (!strcmp(method, "state"))
|
||||
reply = wpas_dbus_iface_get_state(message, wpa_s);
|
||||
else if (!strcmp(method, "scanning"))
|
||||
reply = wpas_dbus_iface_get_scanning(message, wpa_s);
|
||||
else if (!strcmp(method, "setBlobs"))
|
||||
reply = wpas_dbus_iface_set_blobs(message, wpa_s);
|
||||
else if (!strcmp(method, "removeBlobs"))
|
||||
reply = wpas_dbus_iface_remove_blobs(message, wpa_s);
|
||||
#ifdef CONFIG_WPS
|
||||
else if (!os_strcmp(method, "wpsPbc"))
|
||||
reply = wpas_dbus_iface_wps_pbc(message, wpa_s);
|
||||
else if (!os_strcmp(method, "wpsPin"))
|
||||
reply = wpas_dbus_iface_wps_pin(message, wpa_s);
|
||||
else if (!os_strcmp(method, "wpsReg"))
|
||||
reply = wpas_dbus_iface_wps_reg(message, wpa_s);
|
||||
#endif /* CONFIG_WPS */
|
||||
else if (!os_strcmp(method, "flush"))
|
||||
reply = wpas_dbus_iface_flush(message, wpa_s);
|
||||
}
|
||||
|
||||
/* If the message was handled, send back the reply */
|
||||
if (reply) {
|
||||
if (!dbus_message_get_no_reply(message))
|
||||
dbus_connection_send(connection, reply, NULL);
|
||||
dbus_message_unref(reply);
|
||||
}
|
||||
|
||||
out:
|
||||
os_free(iface_obj_path);
|
||||
os_free(network);
|
||||
os_free(bssid);
|
||||
return reply ? DBUS_HANDLER_RESULT_HANDLED :
|
||||
DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_message_handler - dispatch incoming dbus messages
|
||||
* @connection: connection to the system message bus
|
||||
* @message: an incoming dbus message
|
||||
* @user_data: a pointer to a dbus control interface data structure
|
||||
* Returns: whether or not the message was handled
|
||||
*
|
||||
* This function dispatches all incoming dbus messages to the correct
|
||||
* handlers, depending on what the message's target object path is,
|
||||
* and what the method call is.
|
||||
*/
|
||||
static DBusHandlerResult wpas_message_handler(DBusConnection *connection,
|
||||
DBusMessage *message, void *user_data)
|
||||
{
|
||||
struct wpas_dbus_priv *ctrl_iface = user_data;
|
||||
const char *method;
|
||||
const char *path;
|
||||
const char *msg_interface;
|
||||
DBusMessage *reply = NULL;
|
||||
|
||||
method = dbus_message_get_member(message);
|
||||
path = dbus_message_get_path(message);
|
||||
msg_interface = dbus_message_get_interface(message);
|
||||
if (!method || !path || !ctrl_iface || !msg_interface)
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
/* Validate the method interface */
|
||||
if (strcmp(msg_interface, WPAS_DBUS_INTERFACE) != 0)
|
||||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
|
||||
if (!strcmp(path, WPAS_DBUS_PATH)) {
|
||||
/* dispatch methods against our global dbus interface here */
|
||||
if (!strcmp(method, "addInterface")) {
|
||||
reply = wpas_dbus_global_add_interface(
|
||||
message, ctrl_iface->global);
|
||||
} else if (!strcmp(method, "removeInterface")) {
|
||||
reply = wpas_dbus_global_remove_interface(
|
||||
message, ctrl_iface->global);
|
||||
} else if (!strcmp(method, "getInterface")) {
|
||||
reply = wpas_dbus_global_get_interface(
|
||||
message, ctrl_iface->global);
|
||||
} else if (!strcmp(method, "setDebugParams")) {
|
||||
reply = wpas_dbus_global_set_debugparams(
|
||||
message, ctrl_iface->global);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the message was handled, send back the reply */
|
||||
if (reply) {
|
||||
if (!dbus_message_get_no_reply(message))
|
||||
dbus_connection_send(connection, reply, NULL);
|
||||
dbus_message_unref(reply);
|
||||
}
|
||||
|
||||
return reply ? DBUS_HANDLER_RESULT_HANDLED :
|
||||
DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpa_supplicant_dbus_notify_scan_results - Send a scan results signal
|
||||
* @wpa_s: %wpa_supplicant network interface data
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* Notify listeners that this interface has updated scan results.
|
||||
*/
|
||||
void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
struct wpas_dbus_priv *iface = wpa_s->global->dbus;
|
||||
DBusMessage *_signal;
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (iface == NULL)
|
||||
return;
|
||||
|
||||
_signal = dbus_message_new_signal(wpa_s->dbus_path,
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"ScanResultsAvailable");
|
||||
if (_signal == NULL) {
|
||||
wpa_printf(MSG_ERROR, "dbus: Not enough memory to send scan "
|
||||
"results signal");
|
||||
return;
|
||||
}
|
||||
dbus_connection_send(iface->con, _signal, NULL);
|
||||
dbus_message_unref(_signal);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpa_supplicant_dbus_notify_state_change - Send a state change signal
|
||||
* @wpa_s: %wpa_supplicant network interface data
|
||||
* @new_state: new state wpa_supplicant is entering
|
||||
* @old_state: old state wpa_supplicant is leaving
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* Notify listeners that wpa_supplicant has changed state
|
||||
*/
|
||||
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
|
||||
enum wpa_states new_state,
|
||||
enum wpa_states old_state)
|
||||
{
|
||||
struct wpas_dbus_priv *iface;
|
||||
DBusMessage *_signal = NULL;
|
||||
const char *new_state_str, *old_state_str;
|
||||
|
||||
if (wpa_s->dbus_path == NULL)
|
||||
return; /* Skip signal since D-Bus setup is not yet ready */
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (wpa_s->global == NULL)
|
||||
return;
|
||||
iface = wpa_s->global->dbus;
|
||||
if (iface == NULL)
|
||||
return;
|
||||
|
||||
/* Only send signal if state really changed */
|
||||
if (new_state == old_state)
|
||||
return;
|
||||
|
||||
_signal = dbus_message_new_signal(wpa_s->dbus_path,
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"StateChange");
|
||||
if (_signal == NULL) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: wpa_supplicant_dbus_notify_state_change: "
|
||||
"could not create dbus signal; likely out of "
|
||||
"memory");
|
||||
return;
|
||||
}
|
||||
|
||||
new_state_str = wpa_supplicant_state_txt(new_state);
|
||||
old_state_str = wpa_supplicant_state_txt(old_state);
|
||||
if (new_state_str == NULL || old_state_str == NULL) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: wpa_supplicant_dbus_notify_state_change: "
|
||||
"Could not convert state strings");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!dbus_message_append_args(_signal,
|
||||
DBUS_TYPE_STRING, &new_state_str,
|
||||
DBUS_TYPE_STRING, &old_state_str,
|
||||
DBUS_TYPE_INVALID)) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: wpa_supplicant_dbus_notify_state_change: "
|
||||
"Not enough memory to construct state change "
|
||||
"signal");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dbus_connection_send(iface->con, _signal, NULL);
|
||||
|
||||
out:
|
||||
dbus_message_unref(_signal);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpa_supplicant_dbus_notify_scanning - send scanning status
|
||||
* @wpa_s: %wpa_supplicant network interface data
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* Notify listeners of interface scanning state changes
|
||||
*/
|
||||
void wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
struct wpas_dbus_priv *iface = wpa_s->global->dbus;
|
||||
DBusMessage *_signal;
|
||||
dbus_bool_t scanning = wpa_s->scanning ? TRUE : FALSE;
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (iface == NULL)
|
||||
return;
|
||||
|
||||
_signal = dbus_message_new_signal(wpa_s->dbus_path,
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"Scanning");
|
||||
if (_signal == NULL) {
|
||||
wpa_printf(MSG_ERROR, "dbus: Not enough memory to send scan "
|
||||
"results signal");
|
||||
return;
|
||||
}
|
||||
|
||||
if (dbus_message_append_args(_signal,
|
||||
DBUS_TYPE_BOOLEAN, &scanning,
|
||||
DBUS_TYPE_INVALID)) {
|
||||
dbus_connection_send(iface->con, _signal, NULL);
|
||||
} else {
|
||||
wpa_printf(MSG_ERROR, "dbus: Not enough memory to construct "
|
||||
"signal");
|
||||
}
|
||||
dbus_message_unref(_signal);
|
||||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_WPS
|
||||
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred)
|
||||
{
|
||||
struct wpas_dbus_priv *iface;
|
||||
DBusMessage *_signal = NULL;
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (wpa_s->global == NULL)
|
||||
return;
|
||||
iface = wpa_s->global->dbus;
|
||||
if (iface == NULL)
|
||||
return;
|
||||
|
||||
_signal = dbus_message_new_signal(wpa_s->dbus_path,
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"WpsCred");
|
||||
if (_signal == NULL) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: wpa_supplicant_dbus_notify_wps_cred: "
|
||||
"Could not create dbus signal; likely out of "
|
||||
"memory");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!dbus_message_append_args(_signal,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&cred->cred_attr, cred->cred_attr_len,
|
||||
DBUS_TYPE_INVALID)) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: wpa_supplicant_dbus_notify_wps_cred: "
|
||||
"Not enough memory to construct signal");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dbus_connection_send(iface->con, _signal, NULL);
|
||||
|
||||
out:
|
||||
dbus_message_unref(_signal);
|
||||
}
|
||||
#else /* CONFIG_WPS */
|
||||
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_WPS */
|
||||
|
||||
void wpa_supplicant_dbus_notify_certification(struct wpa_supplicant *wpa_s,
|
||||
int depth, const char *subject,
|
||||
const char *cert_hash,
|
||||
const struct wpabuf *cert)
|
||||
{
|
||||
struct wpas_dbus_priv *iface;
|
||||
DBusMessage *_signal = NULL;
|
||||
const char *hash;
|
||||
const char *cert_hex;
|
||||
int cert_hex_len;
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (wpa_s->global == NULL)
|
||||
return;
|
||||
iface = wpa_s->global->dbus;
|
||||
if (iface == NULL)
|
||||
return;
|
||||
|
||||
_signal = dbus_message_new_signal(wpa_s->dbus_path,
|
||||
WPAS_DBUS_IFACE_INTERFACE,
|
||||
"Certification");
|
||||
if (_signal == NULL) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: wpa_supplicant_dbus_notify_certification: "
|
||||
"Could not create dbus signal; likely out of "
|
||||
"memory");
|
||||
return;
|
||||
}
|
||||
|
||||
hash = cert_hash ? cert_hash : "";
|
||||
cert_hex = cert ? wpabuf_head(cert) : "";
|
||||
cert_hex_len = cert ? wpabuf_len(cert) : 0;
|
||||
|
||||
if (!dbus_message_append_args(_signal,
|
||||
DBUS_TYPE_INT32,&depth,
|
||||
DBUS_TYPE_STRING, &subject,
|
||||
DBUS_TYPE_STRING, &hash,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&cert_hex, cert_hex_len,
|
||||
DBUS_TYPE_INVALID)) {
|
||||
wpa_printf(MSG_ERROR,
|
||||
"dbus: wpa_supplicant_dbus_notify_certification: "
|
||||
"Not enough memory to construct signal");
|
||||
goto out;
|
||||
}
|
||||
|
||||
dbus_connection_send(iface->con, _signal, NULL);
|
||||
|
||||
out:
|
||||
dbus_message_unref(_signal);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpa_supplicant_dbus_ctrl_iface_init - Initialize dbus control interface
|
||||
* @global: Pointer to global data from wpa_supplicant_init()
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* Initialize the dbus control interface and start receiving commands from
|
||||
* external programs over the bus.
|
||||
*/
|
||||
int wpa_supplicant_dbus_ctrl_iface_init(struct wpas_dbus_priv *iface)
|
||||
{
|
||||
DBusError error;
|
||||
int ret = -1;
|
||||
DBusObjectPathVTable wpas_vtable = {
|
||||
NULL, &wpas_message_handler, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
/* Register the message handler for the global dbus interface */
|
||||
if (!dbus_connection_register_object_path(iface->con,
|
||||
WPAS_DBUS_PATH, &wpas_vtable,
|
||||
iface)) {
|
||||
wpa_printf(MSG_ERROR, "dbus: Could not set up message "
|
||||
"handler");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Register our service with the message bus */
|
||||
dbus_error_init(&error);
|
||||
switch (dbus_bus_request_name(iface->con, WPAS_DBUS_SERVICE,
|
||||
0, &error)) {
|
||||
case DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER:
|
||||
ret = 0;
|
||||
break;
|
||||
case DBUS_REQUEST_NAME_REPLY_EXISTS:
|
||||
case DBUS_REQUEST_NAME_REPLY_IN_QUEUE:
|
||||
case DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER:
|
||||
wpa_printf(MSG_ERROR, "dbus: Could not request service name: "
|
||||
"already registered");
|
||||
break;
|
||||
default:
|
||||
wpa_printf(MSG_ERROR, "dbus: Could not request service name: "
|
||||
"%s %s", error.name, error.message);
|
||||
break;
|
||||
}
|
||||
dbus_error_free(&error);
|
||||
|
||||
if (ret != 0)
|
||||
return -1;
|
||||
|
||||
wpa_printf(MSG_DEBUG, "Providing DBus service '" WPAS_DBUS_SERVICE
|
||||
"'.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_register_new_iface - Register a new interface with dbus
|
||||
* @wpa_s: %wpa_supplicant interface description structure to register
|
||||
* Returns: 0 on success, -1 on error
|
||||
*
|
||||
* Registers a new interface with dbus and assigns it a dbus object path.
|
||||
*/
|
||||
int wpas_dbus_register_iface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
struct wpas_dbus_priv *ctrl_iface = wpa_s->global->dbus;
|
||||
DBusConnection * con;
|
||||
u32 next;
|
||||
DBusObjectPathVTable vtable = {
|
||||
NULL, &wpas_iface_message_handler, NULL, NULL, NULL, NULL
|
||||
};
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (ctrl_iface == NULL)
|
||||
return 0;
|
||||
|
||||
con = ctrl_iface->con;
|
||||
next = ctrl_iface->next_objid++;
|
||||
|
||||
/* Create and set the interface's object path */
|
||||
wpa_s->dbus_path = os_zalloc(WPAS_DBUS_OBJECT_PATH_MAX);
|
||||
if (wpa_s->dbus_path == NULL)
|
||||
return -1;
|
||||
os_snprintf(wpa_s->dbus_path, WPAS_DBUS_OBJECT_PATH_MAX,
|
||||
WPAS_DBUS_PATH_INTERFACES "/%u",
|
||||
next);
|
||||
|
||||
/* Register the message handler for the interface functions */
|
||||
if (!dbus_connection_register_fallback(con, wpa_s->dbus_path, &vtable,
|
||||
wpa_s)) {
|
||||
wpa_printf(MSG_ERROR, "dbus: Could not set up message "
|
||||
"handler for interface %s", wpa_s->ifname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_unregister_iface - Unregister an interface from dbus
|
||||
* @wpa_s: wpa_supplicant interface structure
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* Unregisters the interface with dbus
|
||||
*/
|
||||
int wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
struct wpas_dbus_priv *ctrl_iface;
|
||||
DBusConnection *con;
|
||||
|
||||
/* Do nothing if the control interface is not turned on */
|
||||
if (wpa_s == NULL || wpa_s->global == NULL)
|
||||
return 0;
|
||||
ctrl_iface = wpa_s->global->dbus;
|
||||
if (ctrl_iface == NULL)
|
||||
return 0;
|
||||
|
||||
con = ctrl_iface->con;
|
||||
if (!dbus_connection_unregister_object_path(con, wpa_s->dbus_path))
|
||||
return -1;
|
||||
|
||||
os_free(wpa_s->dbus_path);
|
||||
wpa_s->dbus_path = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpa_supplicant_get_iface_by_dbus_path - Get a new network interface
|
||||
* @global: Pointer to global data from wpa_supplicant_init()
|
||||
* @path: Pointer to a dbus object path representing an interface
|
||||
* Returns: Pointer to the interface or %NULL if not found
|
||||
*/
|
||||
struct wpa_supplicant * wpa_supplicant_get_iface_by_dbus_path(
|
||||
struct wpa_global *global, const char *path)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s;
|
||||
|
||||
for (wpa_s = global->ifaces; wpa_s; wpa_s = wpa_s->next) {
|
||||
if (strcmp(wpa_s->dbus_path, path) == 0)
|
||||
return wpa_s;
|
||||
}
|
||||
return NULL;
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef CTRL_IFACE_DBUS_H
|
||||
#define CTRL_IFACE_DBUS_H
|
||||
|
||||
struct wps_credential;
|
||||
|
||||
#ifdef CONFIG_CTRL_IFACE_DBUS
|
||||
|
||||
#define WPAS_DBUS_OBJECT_PATH_MAX 150
|
||||
|
||||
#define WPAS_DBUS_SERVICE "fi.epitest.hostap.WPASupplicant"
|
||||
#define WPAS_DBUS_PATH "/fi/epitest/hostap/WPASupplicant"
|
||||
#define WPAS_DBUS_INTERFACE "fi.epitest.hostap.WPASupplicant"
|
||||
|
||||
#define WPAS_DBUS_PATH_INTERFACES WPAS_DBUS_PATH "/Interfaces"
|
||||
#define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface"
|
||||
|
||||
#define WPAS_DBUS_NETWORKS_PART "Networks"
|
||||
#define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network"
|
||||
|
||||
#define WPAS_DBUS_BSSIDS_PART "BSSIDs"
|
||||
#define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID"
|
||||
|
||||
|
||||
/* Errors */
|
||||
#define WPAS_ERROR_INVALID_NETWORK \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".InvalidNetwork"
|
||||
#define WPAS_ERROR_INVALID_BSSID \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".InvalidBSSID"
|
||||
|
||||
#define WPAS_ERROR_INVALID_OPTS \
|
||||
WPAS_DBUS_INTERFACE ".InvalidOptions"
|
||||
#define WPAS_ERROR_INVALID_IFACE \
|
||||
WPAS_DBUS_INTERFACE ".InvalidInterface"
|
||||
|
||||
#define WPAS_ERROR_ADD_ERROR \
|
||||
WPAS_DBUS_INTERFACE ".AddError"
|
||||
#define WPAS_ERROR_EXISTS_ERROR \
|
||||
WPAS_DBUS_INTERFACE ".ExistsError"
|
||||
#define WPAS_ERROR_REMOVE_ERROR \
|
||||
WPAS_DBUS_INTERFACE ".RemoveError"
|
||||
|
||||
#define WPAS_ERROR_SCAN_ERROR \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".ScanError"
|
||||
#define WPAS_ERROR_ADD_NETWORK_ERROR \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".AddNetworkError"
|
||||
#define WPAS_ERROR_INTERNAL_ERROR \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".InternalError"
|
||||
#define WPAS_ERROR_REMOVE_NETWORK_ERROR \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".RemoveNetworkError"
|
||||
|
||||
#define WPAS_ERROR_WPS_PBC_ERROR \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".WpsPbcError"
|
||||
#define WPAS_ERROR_WPS_PIN_ERROR \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".WpsPinError"
|
||||
#define WPAS_ERROR_WPS_REG_ERROR \
|
||||
WPAS_DBUS_IFACE_INTERFACE ".WpsRegError"
|
||||
|
||||
#define WPAS_DBUS_BSSID_FORMAT "%02x%02x%02x%02x%02x%02x"
|
||||
|
||||
struct wpa_global;
|
||||
struct wpa_supplicant;
|
||||
|
||||
int wpa_supplicant_dbus_ctrl_iface_init(struct wpas_dbus_priv *iface);
|
||||
void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s);
|
||||
void wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s);
|
||||
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
|
||||
enum wpa_states new_state,
|
||||
enum wpa_states old_state);
|
||||
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred);
|
||||
void wpa_supplicant_dbus_notify_certification(struct wpa_supplicant *wpa_s,
|
||||
int depth, const char *subject,
|
||||
const char *cert_hash,
|
||||
const struct wpabuf *cert);
|
||||
|
||||
char * wpas_dbus_decompose_object_path(const char *path, char **network,
|
||||
char **bssid);
|
||||
|
||||
int wpas_dbus_register_iface(struct wpa_supplicant *wpa_s);
|
||||
int wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s);
|
||||
|
||||
|
||||
/* Methods internal to the dbus control interface */
|
||||
struct wpa_supplicant * wpa_supplicant_get_iface_by_dbus_path(
|
||||
struct wpa_global *global, const char *path);
|
||||
|
||||
#else /* CONFIG_CTRL_IFACE_DBUS */
|
||||
|
||||
static inline void
|
||||
wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
}
|
||||
|
||||
#define wpa_supplicant_dbus_notify_state_change(w,n,o) do { } while (0)
|
||||
|
||||
static inline void
|
||||
wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
|
||||
const struct wps_credential *cred)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void
|
||||
wpa_supplicant_dbus_notify_certification(struct wpa_supplicant *wpa_s,
|
||||
int depth, const char *subject,
|
||||
const char *cert_hash,
|
||||
const struct wpabuf *cert)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int
|
||||
wpas_dbus_register_iface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_CTRL_IFACE_DBUS */
|
||||
|
||||
#endif /* CTRL_IFACE_DBUS_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,101 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#ifndef CTRL_IFACE_DBUS_HANDLERS_H
|
||||
#define CTRL_IFACE_DBUS_HANDLERS_H
|
||||
|
||||
struct wpa_bss;
|
||||
|
||||
DBusMessage * wpas_dbus_new_invalid_iface_error(DBusMessage *message);
|
||||
DBusMessage * wpas_dbus_new_invalid_network_error(DBusMessage *message);
|
||||
|
||||
DBusMessage * wpas_dbus_global_add_interface(DBusMessage *message,
|
||||
struct wpa_global *global);
|
||||
|
||||
DBusMessage * wpas_dbus_global_remove_interface(DBusMessage *message,
|
||||
struct wpa_global *global);
|
||||
|
||||
DBusMessage * wpas_dbus_global_get_interface(DBusMessage *message,
|
||||
struct wpa_global *global);
|
||||
|
||||
DBusMessage * wpas_dbus_global_set_debugparams(DBusMessage *message,
|
||||
struct wpa_global *global);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_scan(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_scan_results(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_bssid_properties(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s,
|
||||
struct wpa_bss *bss);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_capabilities(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_add_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_remove_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_set_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_enable_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_disable_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s,
|
||||
struct wpa_ssid *ssid);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_select_network(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_disconnect(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_set_ap_scan(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_set_smartcard_modules(
|
||||
DBusMessage *message, struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_get_state(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_get_scanning(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_set_blobs(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_remove_blobs(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_wps_pbc(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_wps_pin(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_wps_reg(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_iface_flush(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s);
|
||||
|
||||
DBusMessage * wpas_dbus_new_success_reply(DBusMessage *message);
|
||||
DBusMessage * wpas_dbus_new_invalid_opts_error(DBusMessage *message,
|
||||
const char *arg);
|
||||
|
||||
#endif /* CTRL_IFACE_DBUS_HANDLERS_H */
|
||||
|
@ -1,157 +0,0 @@
|
||||
/*
|
||||
* WPA Supplicant / dbus-based control interface (WPS)
|
||||
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
|
||||
*
|
||||
* This software may be distributed under the terms of the BSD license.
|
||||
* See README for more details.
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
#include <dbus/dbus.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "../config.h"
|
||||
#include "../wpa_supplicant_i.h"
|
||||
#include "../wps_supplicant.h"
|
||||
#include "dbus_old.h"
|
||||
#include "dbus_old_handlers.h"
|
||||
|
||||
/**
|
||||
* wpas_dbus_iface_wps_pbc - Request credentials using WPS PBC method
|
||||
* @message: Pointer to incoming dbus message
|
||||
* @wpa_s: %wpa_supplicant data structure
|
||||
* Returns: A dbus message containing a UINT32 indicating success (1) or
|
||||
* failure (0)
|
||||
*
|
||||
* Handler function for "wpsPbc" method call
|
||||
*/
|
||||
DBusMessage * wpas_dbus_iface_wps_pbc(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
char *arg_bssid = NULL;
|
||||
u8 bssid[ETH_ALEN];
|
||||
int ret = 0;
|
||||
|
||||
if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
|
||||
DBUS_TYPE_INVALID))
|
||||
return wpas_dbus_new_invalid_opts_error(message, NULL);
|
||||
|
||||
if (!os_strcmp(arg_bssid, "any"))
|
||||
ret = wpas_wps_start_pbc(wpa_s, NULL, 0);
|
||||
else if (!hwaddr_aton(arg_bssid, bssid))
|
||||
ret = wpas_wps_start_pbc(wpa_s, bssid, 0);
|
||||
else {
|
||||
return wpas_dbus_new_invalid_opts_error(message,
|
||||
"Invalid BSSID");
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
return dbus_message_new_error(message,
|
||||
WPAS_ERROR_WPS_PBC_ERROR,
|
||||
"Could not start PBC "
|
||||
"negotiation");
|
||||
}
|
||||
|
||||
return wpas_dbus_new_success_reply(message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_iface_wps_pin - Establish the PIN number of the enrollee
|
||||
* @message: Pointer to incoming dbus message
|
||||
* @wpa_s: %wpa_supplicant data structure
|
||||
* Returns: A dbus message containing a UINT32 indicating success (1) or
|
||||
* failure (0)
|
||||
*
|
||||
* Handler function for "wpsPin" method call
|
||||
*/
|
||||
DBusMessage * wpas_dbus_iface_wps_pin(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
DBusMessage *reply = NULL;
|
||||
char *arg_bssid;
|
||||
char *pin = NULL;
|
||||
u8 bssid[ETH_ALEN], *_bssid = NULL;
|
||||
int ret = 0;
|
||||
|
||||
if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
|
||||
DBUS_TYPE_STRING, &pin, DBUS_TYPE_INVALID))
|
||||
return wpas_dbus_new_invalid_opts_error(message, NULL);
|
||||
|
||||
if (!os_strcmp(arg_bssid, "any"))
|
||||
_bssid = NULL;
|
||||
else if (!hwaddr_aton(arg_bssid, bssid))
|
||||
_bssid = bssid;
|
||||
else {
|
||||
return wpas_dbus_new_invalid_opts_error(message,
|
||||
"Invalid BSSID");
|
||||
}
|
||||
|
||||
if (os_strlen(pin) > 0)
|
||||
ret = wpas_wps_start_pin(wpa_s, _bssid, pin, 0,
|
||||
DEV_PW_DEFAULT);
|
||||
else
|
||||
ret = wpas_wps_start_pin(wpa_s, _bssid, NULL, 0,
|
||||
DEV_PW_DEFAULT);
|
||||
|
||||
if (ret < 0) {
|
||||
return dbus_message_new_error(message,
|
||||
WPAS_ERROR_WPS_PIN_ERROR,
|
||||
"Could not init PIN");
|
||||
}
|
||||
|
||||
reply = dbus_message_new_method_return(message);
|
||||
if (reply == NULL)
|
||||
return NULL;
|
||||
|
||||
if (ret == 0) {
|
||||
dbus_message_append_args(reply, DBUS_TYPE_STRING, &pin,
|
||||
DBUS_TYPE_INVALID);
|
||||
} else {
|
||||
char npin[9];
|
||||
os_snprintf(npin, sizeof(npin), "%08d", ret);
|
||||
dbus_message_append_args(reply, DBUS_TYPE_STRING, &npin,
|
||||
DBUS_TYPE_INVALID);
|
||||
}
|
||||
return reply;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* wpas_dbus_iface_wps_reg - Request credentials using the PIN of the AP
|
||||
* @message: Pointer to incoming dbus message
|
||||
* @wpa_s: %wpa_supplicant data structure
|
||||
* Returns: A dbus message containing a UINT32 indicating success (1) or
|
||||
* failure (0)
|
||||
*
|
||||
* Handler function for "wpsReg" method call
|
||||
*/
|
||||
DBusMessage * wpas_dbus_iface_wps_reg(DBusMessage *message,
|
||||
struct wpa_supplicant *wpa_s)
|
||||
{
|
||||
char *arg_bssid;
|
||||
char *pin = NULL;
|
||||
u8 bssid[ETH_ALEN];
|
||||
int ret = 0;
|
||||
|
||||
if (!dbus_message_get_args(message, NULL, DBUS_TYPE_STRING, &arg_bssid,
|
||||
DBUS_TYPE_STRING, &pin, DBUS_TYPE_INVALID))
|
||||
return wpas_dbus_new_invalid_opts_error(message, NULL);
|
||||
|
||||
if (!os_strcmp(arg_bssid, "any"))
|
||||
ret = wpas_wps_start_reg(wpa_s, NULL, pin, NULL);
|
||||
else if (!hwaddr_aton(arg_bssid, bssid))
|
||||
ret = wpas_wps_start_reg(wpa_s, bssid, pin, NULL);
|
||||
else {
|
||||
return wpas_dbus_new_invalid_opts_error(message,
|
||||
"Invalid BSSID");
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
return dbus_message_new_error(message,
|
||||
WPAS_ERROR_WPS_PBC_ERROR,
|
||||
"Could not request credentials");
|
||||
}
|
||||
|
||||
return wpas_dbus_new_success_reply(message);
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
[D-BUS Service]
|
||||
Name=fi.epitest.hostap.WPASupplicant
|
||||
Exec=@BINDIR@/wpa_supplicant -u
|
||||
User=root
|
||||
SystemdService=wpa_supplicant.service
|
@ -1,5 +0,0 @@
|
||||
[D-BUS Service]
|
||||
Name=fi.w1.wpa_supplicant1
|
||||
Exec=@BINDIR@/wpa_supplicant -u
|
||||
User=root
|
||||
SystemdService=wpa_supplicant.service
|
@ -1,6 +0,0 @@
|
||||
manpage.links
|
||||
manpage.refs
|
||||
*.8
|
||||
*.5
|
||||
*.html
|
||||
*.pdf
|
@ -1,27 +0,0 @@
|
||||
all: man html pdf
|
||||
|
||||
FILES += wpa_background
|
||||
FILES += wpa_cli
|
||||
FILES += wpa_gui
|
||||
FILES += wpa_passphrase
|
||||
FILES += wpa_priv
|
||||
FILES += wpa_supplicant.conf
|
||||
FILES += wpa_supplicant
|
||||
|
||||
man:
|
||||
for i in $(FILES); do docbook2man $$i.sgml; done
|
||||
|
||||
html:
|
||||
for i in $(FILES); do docbook2html $$i.sgml && \
|
||||
mv index.html $$i.html; done
|
||||
|
||||
pdf:
|
||||
for i in $(FILES); do docbook2pdf $$i.sgml; done
|
||||
|
||||
|
||||
clean:
|
||||
rm -f wpa_background.8 wpa_cli.8 wpa_gui.8 wpa_passphrase.8 wpa_priv.8 wpa_supplicant.8
|
||||
rm -f wpa_supplicant.conf.5
|
||||
rm -f manpage.links manpage.refs
|
||||
rm -f $(FILES:%=%.pdf)
|
||||
rm -f $(FILES:%=%.html)
|
@ -1,4 +0,0 @@
|
||||
{
|
||||
'' => '',
|
||||
'' => ''
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||
.\" Please send any bug reports, improvements, comments, patches,
|
||||
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||
.TH "WPA_BACKGROUND" "8" "12 January 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
wpa_background \- Background information on Wi-Fi Protected Access and IEEE 802.11i
|
||||
.SH "WPA"
|
||||
.PP
|
||||
The original security mechanism of IEEE 802.11 standard was
|
||||
not designed to be strong and has proven to be insufficient for
|
||||
most networks that require some kind of security. Task group I
|
||||
(Security) of IEEE 802.11 working group
|
||||
(http://www.ieee802.org/11/) has worked to address the flaws of
|
||||
the base standard and has in practice completed its work in May
|
||||
2004. The IEEE 802.11i amendment to the IEEE 802.11 standard was
|
||||
approved in June 2004 and published in July 2004.
|
||||
.PP
|
||||
Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version
|
||||
of the IEEE 802.11i work (draft 3.0) to define a subset of the
|
||||
security enhancements that can be implemented with existing wlan
|
||||
hardware. This is called Wi-Fi Protected Access<TM> (WPA). This
|
||||
has now become a mandatory component of interoperability testing
|
||||
and certification done by Wi-Fi Alliance. Wi-Fi provides
|
||||
information about WPA at its web site
|
||||
(http://www.wi-fi.org/OpenSection/protected_access.asp).
|
||||
.PP
|
||||
IEEE 802.11 standard defined wired equivalent privacy (WEP)
|
||||
algorithm for protecting wireless networks. WEP uses RC4 with
|
||||
40-bit keys, 24-bit initialization vector (IV), and CRC32 to
|
||||
protect against packet forgery. All these choices have proven to
|
||||
be insufficient: key space is too small against current attacks,
|
||||
RC4 key scheduling is insufficient (beginning of the pseudorandom
|
||||
stream should be skipped), IV space is too small and IV reuse
|
||||
makes attacks easier, there is no replay protection, and non-keyed
|
||||
authentication does not protect against bit flipping packet
|
||||
data.
|
||||
.PP
|
||||
WPA is an intermediate solution for the security issues. It
|
||||
uses Temporal Key Integrity Protocol (TKIP) to replace WEP. TKIP
|
||||
is a compromise on strong security and possibility to use existing
|
||||
hardware. It still uses RC4 for the encryption like WEP, but with
|
||||
per-packet RC4 keys. In addition, it implements replay protection,
|
||||
keyed packet authentication mechanism (Michael MIC).
|
||||
.PP
|
||||
Keys can be managed using two different mechanisms. WPA can
|
||||
either use an external authentication server (e.g., RADIUS) and
|
||||
EAP just like IEEE 802.1X is using or pre-shared keys without need
|
||||
for additional servers. Wi-Fi calls these "WPA-Enterprise" and
|
||||
"WPA-Personal", respectively. Both mechanisms will generate a
|
||||
master session key for the Authenticator (AP) and Supplicant
|
||||
(client station).
|
||||
.PP
|
||||
WPA implements a new key handshake (4-Way Handshake and
|
||||
Group Key Handshake) for generating and exchanging data encryption
|
||||
keys between the Authenticator and Supplicant. This handshake is
|
||||
also used to verify that both Authenticator and Supplicant know
|
||||
the master session key. These handshakes are identical regardless
|
||||
of the selected key management mechanism (only the method for
|
||||
generating master session key changes).
|
||||
.SH "IEEE 802.11I / WPA2"
|
||||
.PP
|
||||
The design for parts of IEEE 802.11i that were not included
|
||||
in WPA has finished (May 2004) and this amendment to IEEE 802.11
|
||||
was approved in June 2004. Wi-Fi Alliance is using the final IEEE
|
||||
802.11i as a new version of WPA called WPA2. This includes, e.g.,
|
||||
support for more robust encryption algorithm (CCMP: AES in Counter
|
||||
mode with CBC-MAC) to replace TKIP and optimizations for handoff
|
||||
(reduced number of messages in initial key handshake,
|
||||
pre-authentication, and PMKSA caching).
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBwpa_supplicant\fR(8)
|
||||
.SH "LEGAL"
|
||||
.PP
|
||||
wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <j@w1.fi> and
|
||||
contributors.
|
||||
All Rights Reserved.
|
||||
.PP
|
||||
This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).
|
@ -1,101 +0,0 @@
|
||||
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
|
||||
<refentry>
|
||||
<refmeta>
|
||||
<refentrytitle>wpa_background</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>wpa_background</refname>
|
||||
<refpurpose>Background information on Wi-Fi Protected Access and IEEE 802.11i</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>WPA</title>
|
||||
|
||||
<para>The original security mechanism of IEEE 802.11 standard was
|
||||
not designed to be strong and has proven to be insufficient for
|
||||
most networks that require some kind of security. Task group I
|
||||
(Security) of IEEE 802.11 working group
|
||||
(http://www.ieee802.org/11/) has worked to address the flaws of
|
||||
the base standard and has in practice completed its work in May
|
||||
2004. The IEEE 802.11i amendment to the IEEE 802.11 standard was
|
||||
approved in June 2004 and published in July 2004.</para>
|
||||
|
||||
<para>Wi-Fi Alliance (http://www.wi-fi.org/) used a draft version
|
||||
of the IEEE 802.11i work (draft 3.0) to define a subset of the
|
||||
security enhancements that can be implemented with existing wlan
|
||||
hardware. This is called Wi-Fi Protected Access<TM> (WPA). This
|
||||
has now become a mandatory component of interoperability testing
|
||||
and certification done by Wi-Fi Alliance. Wi-Fi provides
|
||||
information about WPA at its web site
|
||||
(http://www.wi-fi.org/OpenSection/protected_access.asp).</para>
|
||||
|
||||
<para>IEEE 802.11 standard defined wired equivalent privacy (WEP)
|
||||
algorithm for protecting wireless networks. WEP uses RC4 with
|
||||
40-bit keys, 24-bit initialization vector (IV), and CRC32 to
|
||||
protect against packet forgery. All these choices have proven to
|
||||
be insufficient: key space is too small against current attacks,
|
||||
RC4 key scheduling is insufficient (beginning of the pseudorandom
|
||||
stream should be skipped), IV space is too small and IV reuse
|
||||
makes attacks easier, there is no replay protection, and non-keyed
|
||||
authentication does not protect against bit flipping packet
|
||||
data.</para>
|
||||
|
||||
<para>WPA is an intermediate solution for the security issues. It
|
||||
uses Temporal Key Integrity Protocol (TKIP) to replace WEP. TKIP
|
||||
is a compromise on strong security and possibility to use existing
|
||||
hardware. It still uses RC4 for the encryption like WEP, but with
|
||||
per-packet RC4 keys. In addition, it implements replay protection,
|
||||
keyed packet authentication mechanism (Michael MIC).</para>
|
||||
|
||||
<para>Keys can be managed using two different mechanisms. WPA can
|
||||
either use an external authentication server (e.g., RADIUS) and
|
||||
EAP just like IEEE 802.1X is using or pre-shared keys without need
|
||||
for additional servers. Wi-Fi calls these "WPA-Enterprise" and
|
||||
"WPA-Personal", respectively. Both mechanisms will generate a
|
||||
master session key for the Authenticator (AP) and Supplicant
|
||||
(client station).</para>
|
||||
|
||||
<para>WPA implements a new key handshake (4-Way Handshake and
|
||||
Group Key Handshake) for generating and exchanging data encryption
|
||||
keys between the Authenticator and Supplicant. This handshake is
|
||||
also used to verify that both Authenticator and Supplicant know
|
||||
the master session key. These handshakes are identical regardless
|
||||
of the selected key management mechanism (only the method for
|
||||
generating master session key changes).</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>IEEE 802.11i / WPA2</title>
|
||||
|
||||
<para>The design for parts of IEEE 802.11i that were not included
|
||||
in WPA has finished (May 2004) and this amendment to IEEE 802.11
|
||||
was approved in June 2004. Wi-Fi Alliance is using the final IEEE
|
||||
802.11i as a new version of WPA called WPA2. This includes, e.g.,
|
||||
support for more robust encryption algorithm (CCMP: AES in Counter
|
||||
mode with CBC-MAC) to replace TKIP and optimizations for handoff
|
||||
(reduced number of messages in initial key handshake,
|
||||
pre-authentication, and PMKSA caching).</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Legal</title>
|
||||
<para>wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <email>j@w1.fi</email> and
|
||||
contributors.
|
||||
All Rights Reserved.</para>
|
||||
|
||||
<para>This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
@ -1,210 +0,0 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||
.\" Please send any bug reports, improvements, comments, patches,
|
||||
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||
.TH "WPA_CLI" "8" "12 January 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
wpa_cli \- WPA command line client
|
||||
.SH SYNOPSIS
|
||||
|
||||
\fBwpa_cli\fR [ \fB-p \fIpath to ctrl sockets\fB\fR ] [ \fB-i \fIifname\fB\fR ] [ \fB-hvB\fR ] [ \fB-a \fIaction file\fB\fR ] [ \fB-P \fIpid file\fB\fR ] [ \fB\fIcommand ...\fB\fR ]
|
||||
|
||||
.SH "OVERVIEW"
|
||||
.PP
|
||||
wpa_cli is a text-based frontend program for interacting
|
||||
with wpa_supplicant. It is used to query current status, change
|
||||
configuration, trigger events, and request interactive user
|
||||
input.
|
||||
.PP
|
||||
wpa_cli can show the current authentication status, selected
|
||||
security mode, dot11 and dot1x MIBs, etc. In addition, it can
|
||||
configure some variables like EAPOL state machine parameters and
|
||||
trigger events like reassociation and IEEE 802.1X
|
||||
logoff/logon. wpa_cli provides a user interface to request
|
||||
authentication information, like username and password, if these
|
||||
are not included in the configuration. This can be used to
|
||||
implement, e.g., one-time-passwords or generic token card
|
||||
authentication where the authentication is based on a
|
||||
challenge-response that uses an external device for generating the
|
||||
response.
|
||||
.PP
|
||||
The control interface of wpa_supplicant can be configured to
|
||||
allow non-root user access (ctrl_interface GROUP= parameter in the
|
||||
configuration file). This makes it possible to run wpa_cli with a
|
||||
normal user account.
|
||||
.PP
|
||||
wpa_cli supports two modes: interactive and command
|
||||
line. Both modes share the same command set and the main
|
||||
difference is in interactive mode providing access to unsolicited
|
||||
messages (event messages, username/password requests).
|
||||
.PP
|
||||
Interactive mode is started when wpa_cli is executed without
|
||||
including the command as a command line parameter. Commands are
|
||||
then entered on the wpa_cli prompt. In command line mode, the same
|
||||
commands are entered as command line arguments for wpa_cli.
|
||||
.SH "INTERACTIVE AUTHENTICATION PARAMETERS REQUEST"
|
||||
.PP
|
||||
When wpa_supplicant need authentication parameters, like
|
||||
username and password, which are not present in the configuration
|
||||
file, it sends a request message to all attached frontend programs,
|
||||
e.g., wpa_cli in interactive mode. wpa_cli shows these requests
|
||||
with "CTRL-REQ-<type>-<id>:<text>"
|
||||
prefix. <type> is IDENTITY, PASSWORD, or OTP
|
||||
(one-time-password). <id> is a unique identifier for the
|
||||
current network. <text> is description of the request. In
|
||||
case of OTP request, it includes the challenge from the
|
||||
authentication server.
|
||||
.PP
|
||||
The reply to these requests can be given with
|
||||
\fBidentity\fR, \fBpassword\fR, and
|
||||
\fBotp\fR commands. <id> needs to be copied from
|
||||
the matching request. \fBpassword\fR and
|
||||
\fBotp\fR commands can be used regardless of whether
|
||||
the request was for PASSWORD or OTP. The main difference between these
|
||||
two commands is that values given with \fBpassword\fR are
|
||||
remembered as long as wpa_supplicant is running whereas values given
|
||||
with \fBotp\fR are used only once and then forgotten,
|
||||
i.e., wpa_supplicant will ask frontend for a new value for every use.
|
||||
This can be used to implement one-time-password lists and generic token
|
||||
card -based authentication.
|
||||
.PP
|
||||
Example request for password and a matching reply:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
|
||||
> password 1 mysecretpassword
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Example request for generic token card challenge-response:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
|
||||
> otp 2 9876
|
||||
.fi
|
||||
.RE
|
||||
.SH "COMMAND ARGUMENTS"
|
||||
.TP
|
||||
\fB-p path\fR
|
||||
Change the path where control sockets should
|
||||
be found.
|
||||
.TP
|
||||
\fB-i ifname\fR
|
||||
Specify the interface that is being
|
||||
configured. By default, choose the first interface found with
|
||||
a control socket in the socket path.
|
||||
.TP
|
||||
\fB-h\fR
|
||||
Help. Show a usage message.
|
||||
.TP
|
||||
\fB-v\fR
|
||||
Show version information.
|
||||
.TP
|
||||
\fB-B\fR
|
||||
Run as a daemon in the background.
|
||||
.TP
|
||||
\fB-a file\fR
|
||||
Run in daemon mode executing the action file
|
||||
based on events from wpa_supplicant. The specified file will
|
||||
be executed with the first argument set to interface name and
|
||||
second to "CONNECTED" or "DISCONNECTED" depending on the event.
|
||||
This can be used to execute networking tools required to configure
|
||||
the interface.
|
||||
|
||||
Additionally, three environmental variables are available to
|
||||
the file: WPA_CTRL_DIR, WPA_ID, and WPA_ID_STR. WPA_CTRL_DIR
|
||||
contains the absolute path to the ctrl_interface socket. WPA_ID
|
||||
contains the unique network_id identifier assigned to the active
|
||||
network, and WPA_ID_STR contains the content of the id_str option.
|
||||
.TP
|
||||
\fB-P file\fR
|
||||
Set the location of the PID
|
||||
file.
|
||||
.TP
|
||||
\fBcommand\fR
|
||||
Run a command. The available commands are
|
||||
listed in the next section.
|
||||
.SH "COMMANDS"
|
||||
.PP
|
||||
The following commands are available:
|
||||
.TP
|
||||
\fBstatus\fR
|
||||
get current WPA/EAPOL/EAP status
|
||||
.TP
|
||||
\fBmib\fR
|
||||
get MIB variables (dot1x, dot11)
|
||||
.TP
|
||||
\fBhelp\fR
|
||||
show this usage help
|
||||
.TP
|
||||
\fBinterface [ifname]\fR
|
||||
show interfaces/select interface
|
||||
.TP
|
||||
\fBlevel <debug level>\fR
|
||||
change debug level
|
||||
.TP
|
||||
\fBlicense\fR
|
||||
show full wpa_cli license
|
||||
.TP
|
||||
\fBlogoff\fR
|
||||
IEEE 802.1X EAPOL state machine logoff
|
||||
.TP
|
||||
\fBlogon\fR
|
||||
IEEE 802.1X EAPOL state machine logon
|
||||
.TP
|
||||
\fBset\fR
|
||||
set variables (shows list of variables when run without arguments)
|
||||
.TP
|
||||
\fBpmksa\fR
|
||||
show PMKSA cache
|
||||
.TP
|
||||
\fBreassociate\fR
|
||||
force reassociation
|
||||
.TP
|
||||
\fBreconfigure\fR
|
||||
force wpa_supplicant to re-read its configuration file
|
||||
.TP
|
||||
\fBpreauthenticate <BSSID>\fR
|
||||
force preauthentication
|
||||
.TP
|
||||
\fBidentity <network id> <identity>\fR
|
||||
configure identity for an SSID
|
||||
.TP
|
||||
\fBpassword <network id> <password>\fR
|
||||
configure password for an SSID
|
||||
.TP
|
||||
\fBpin <network id> <pin>\fR
|
||||
configure pin for an SSID
|
||||
.TP
|
||||
\fBotp <network id> <password>\fR
|
||||
configure one-time-password for an SSID
|
||||
.TP
|
||||
\fBbssid <network id> <BSSID>\fR
|
||||
set preferred BSSID for an SSID
|
||||
.TP
|
||||
\fBlist_networks\fR
|
||||
list configured networks
|
||||
.TP
|
||||
\fBterminate\fR
|
||||
terminate \fBwpa_supplicant\fR
|
||||
.TP
|
||||
\fBquit\fR
|
||||
exit wpa_cli
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBwpa_supplicant\fR(8)
|
||||
.SH "LEGAL"
|
||||
.PP
|
||||
wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <j@w1.fi> and
|
||||
contributors.
|
||||
All Rights Reserved.
|
||||
.PP
|
||||
This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).
|
@ -1,339 +0,0 @@
|
||||
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
|
||||
<refentry>
|
||||
<refmeta>
|
||||
<refentrytitle>wpa_cli</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>wpa_cli</refname>
|
||||
|
||||
<refpurpose>WPA command line client</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>wpa_cli</command>
|
||||
<arg>-p <replaceable>path to ctrl sockets</replaceable></arg>
|
||||
<arg>-i <replaceable>ifname</replaceable></arg>
|
||||
<arg>-hvB</arg>
|
||||
<arg>-a <replaceable>action file</replaceable></arg>
|
||||
<arg>-P <replaceable>pid file</replaceable></arg>
|
||||
<arg><replaceable>command ...</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
|
||||
<para>wpa_cli is a text-based frontend program for interacting
|
||||
with wpa_supplicant. It is used to query current status, change
|
||||
configuration, trigger events, and request interactive user
|
||||
input.</para>
|
||||
|
||||
<para>wpa_cli can show the current authentication status, selected
|
||||
security mode, dot11 and dot1x MIBs, etc. In addition, it can
|
||||
configure some variables like EAPOL state machine parameters and
|
||||
trigger events like reassociation and IEEE 802.1X
|
||||
logoff/logon. wpa_cli provides a user interface to request
|
||||
authentication information, like username and password, if these
|
||||
are not included in the configuration. This can be used to
|
||||
implement, e.g., one-time-passwords or generic token card
|
||||
authentication where the authentication is based on a
|
||||
challenge-response that uses an external device for generating the
|
||||
response.</para>
|
||||
|
||||
<para>The control interface of wpa_supplicant can be configured to
|
||||
allow non-root user access (ctrl_interface GROUP= parameter in the
|
||||
configuration file). This makes it possible to run wpa_cli with a
|
||||
normal user account.</para>
|
||||
|
||||
<para>wpa_cli supports two modes: interactive and command
|
||||
line. Both modes share the same command set and the main
|
||||
difference is in interactive mode providing access to unsolicited
|
||||
messages (event messages, username/password requests).</para>
|
||||
|
||||
<para>Interactive mode is started when wpa_cli is executed without
|
||||
including the command as a command line parameter. Commands are
|
||||
then entered on the wpa_cli prompt. In command line mode, the same
|
||||
commands are entered as command line arguments for wpa_cli.</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Interactive authentication parameters request</title>
|
||||
|
||||
<para>When wpa_supplicant need authentication parameters, like
|
||||
username and password, which are not present in the configuration
|
||||
file, it sends a request message to all attached frontend programs,
|
||||
e.g., wpa_cli in interactive mode. wpa_cli shows these requests
|
||||
with "CTRL-REQ-<type>-<id>:<text>"
|
||||
prefix. <type> is IDENTITY, PASSWORD, or OTP
|
||||
(one-time-password). <id> is a unique identifier for the
|
||||
current network. <text> is description of the request. In
|
||||
case of OTP request, it includes the challenge from the
|
||||
authentication server.</para>
|
||||
|
||||
<para>The reply to these requests can be given with
|
||||
<emphasis>identity</emphasis>, <emphasis>password</emphasis>, and
|
||||
<emphasis>otp</emphasis> commands. <id> needs to be copied from
|
||||
the matching request. <emphasis>password</emphasis> and
|
||||
<emphasis>otp</emphasis> commands can be used regardless of whether
|
||||
the request was for PASSWORD or OTP. The main difference between these
|
||||
two commands is that values given with <emphasis>password</emphasis> are
|
||||
remembered as long as wpa_supplicant is running whereas values given
|
||||
with <emphasis>otp</emphasis> are used only once and then forgotten,
|
||||
i.e., wpa_supplicant will ask frontend for a new value for every use.
|
||||
This can be used to implement one-time-password lists and generic token
|
||||
card -based authentication.</para>
|
||||
|
||||
<para>Example request for password and a matching reply:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
CTRL-REQ-PASSWORD-1:Password needed for SSID foobar
|
||||
> password 1 mysecretpassword
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>Example request for generic token card challenge-response:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
CTRL-REQ-OTP-2:Challenge 1235663 needed for SSID foobar
|
||||
> otp 2 9876
|
||||
</programlisting></blockquote>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Command Arguments</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-p path</term>
|
||||
|
||||
<listitem><para>Change the path where control sockets should
|
||||
be found.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-i ifname</term>
|
||||
|
||||
<listitem><para>Specify the interface that is being
|
||||
configured. By default, choose the first interface found with
|
||||
a control socket in the socket path.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem><para>Help. Show a usage message.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem><para>Show version information.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>-B</term>
|
||||
<listitem><para>Run as a daemon in the background.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-a file</term>
|
||||
|
||||
<listitem><para>Run in daemon mode executing the action file
|
||||
based on events from wpa_supplicant. The specified file will
|
||||
be executed with the first argument set to interface name and
|
||||
second to "CONNECTED" or "DISCONNECTED" depending on the event.
|
||||
This can be used to execute networking tools required to configure
|
||||
the interface.</para>
|
||||
|
||||
<para>Additionally, three environmental variables are available to
|
||||
the file: WPA_CTRL_DIR, WPA_ID, and WPA_ID_STR. WPA_CTRL_DIR
|
||||
contains the absolute path to the ctrl_interface socket. WPA_ID
|
||||
contains the unique network_id identifier assigned to the active
|
||||
network, and WPA_ID_STR contains the content of the id_str option.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-P file</term>
|
||||
|
||||
<listitem><para>Set the location of the PID
|
||||
file.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>command</term>
|
||||
|
||||
<listitem><para>Run a command. The available commands are
|
||||
listed in the next section.</para></listitem>
|
||||
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Commands</title>
|
||||
<para>The following commands are available:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>status</term>
|
||||
<listitem>
|
||||
<para>get current WPA/EAPOL/EAP status</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>mib</term>
|
||||
<listitem>
|
||||
<para>get MIB variables (dot1x, dot11)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>help</term>
|
||||
<listitem>
|
||||
<para>show this usage help</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>interface [ifname]</term>
|
||||
<listitem>
|
||||
<para>show interfaces/select interface</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>level <debug level></term>
|
||||
<listitem>
|
||||
<para>change debug level</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>license</term>
|
||||
<listitem>
|
||||
<para>show full wpa_cli license</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>logoff</term>
|
||||
<listitem>
|
||||
<para>IEEE 802.1X EAPOL state machine logoff</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>logon</term>
|
||||
<listitem>
|
||||
<para>IEEE 802.1X EAPOL state machine logon</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>set</term>
|
||||
<listitem>
|
||||
<para>set variables (shows list of variables when run without arguments)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>pmksa</term>
|
||||
<listitem>
|
||||
<para>show PMKSA cache</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>reassociate</term>
|
||||
<listitem>
|
||||
<para>force reassociation</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>reconfigure</term>
|
||||
<listitem>
|
||||
<para>force wpa_supplicant to re-read its configuration file</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>preauthenticate <BSSID></term>
|
||||
<listitem>
|
||||
<para>force preauthentication</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>identity <network id> <identity></term>
|
||||
<listitem>
|
||||
<para>configure identity for an SSID</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>password <network id> <password></term>
|
||||
<listitem>
|
||||
<para>configure password for an SSID</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>pin <network id> <pin></term>
|
||||
<listitem>
|
||||
<para>configure pin for an SSID</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>otp <network id> <password></term>
|
||||
<listitem>
|
||||
<para>configure one-time-password for an SSID</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>bssid <network id> <BSSID></term>
|
||||
<listitem>
|
||||
<para>set preferred BSSID for an SSID</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>list_networks</term>
|
||||
<listitem>
|
||||
<para>list configured networks</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>terminate</term>
|
||||
<listitem>
|
||||
<para>terminate <command>wpa_supplicant</command></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>quit</term>
|
||||
<listitem><para>exit wpa_cli</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Legal</title>
|
||||
<para>wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <email>j@w1.fi</email> and
|
||||
contributors.
|
||||
All Rights Reserved.</para>
|
||||
|
||||
<para>This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
@ -1,51 +0,0 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||
.\" Please send any bug reports, improvements, comments, patches,
|
||||
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||
.TH "WPA_GUI" "8" "12 January 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
wpa_gui \- WPA Graphical User Interface
|
||||
.SH SYNOPSIS
|
||||
|
||||
\fBwpa_gui\fR [ \fB-p \fIpath to ctrl sockets\fB\fR ] [ \fB-i \fIifname\fB\fR ] [ \fB-t\fR ]
|
||||
|
||||
.SH "OVERVIEW"
|
||||
.PP
|
||||
wpa_gui is a QT graphical frontend program for interacting
|
||||
with wpa_supplicant. It is used to query current status, change
|
||||
configuration and request interactive user input.
|
||||
.PP
|
||||
wpa_gui supports (almost) all of the interactive status and
|
||||
configuration features of the command line client, wpa_cli. Refer
|
||||
to the wpa_cli manpage for a comprehensive list of the
|
||||
interactive mode features.
|
||||
.SH "COMMAND ARGUMENTS"
|
||||
.TP
|
||||
\fB-p path\fR
|
||||
Change the path where control sockets should
|
||||
be found.
|
||||
.TP
|
||||
\fB-i ifname\fR
|
||||
Specify the interface that is being
|
||||
configured. By default, choose the first interface found with
|
||||
a control socket in the socket path.
|
||||
.TP
|
||||
\fB-t\fR
|
||||
Start program in the system tray only (if the window
|
||||
manager supports it). By default the main status window is
|
||||
shown.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBwpa_cli\fR(8)
|
||||
\fBwpa_supplicant\fR(8)
|
||||
.SH "LEGAL"
|
||||
.PP
|
||||
wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <j@w1.fi> and
|
||||
contributors.
|
||||
All Rights Reserved.
|
||||
.PP
|
||||
This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).
|
@ -1,85 +0,0 @@
|
||||
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
|
||||
<refentry>
|
||||
<refmeta>
|
||||
<refentrytitle>wpa_gui</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>wpa_gui</refname>
|
||||
|
||||
<refpurpose>WPA Graphical User Interface</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>wpa_gui</command>
|
||||
<arg>-p <replaceable>path to ctrl sockets</replaceable></arg>
|
||||
<arg>-i <replaceable>ifname</replaceable></arg>
|
||||
<arg>-t</arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
|
||||
<para>wpa_gui is a QT graphical frontend program for interacting
|
||||
with wpa_supplicant. It is used to query current status, change
|
||||
configuration and request interactive user input.</para>
|
||||
|
||||
<para>wpa_gui supports (almost) all of the interactive status and
|
||||
configuration features of the command line client, wpa_cli. Refer
|
||||
to the wpa_cli manpage for a comprehensive list of the
|
||||
interactive mode features.</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Command Arguments</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-p path</term>
|
||||
|
||||
<listitem><para>Change the path where control sockets should
|
||||
be found.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-i ifname</term>
|
||||
|
||||
<listitem><para>Specify the interface that is being
|
||||
configured. By default, choose the first interface found with
|
||||
a control socket in the socket path.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-t</term>
|
||||
|
||||
<listitem><para>Start program in the system tray only (if the window
|
||||
manager supports it). By default the main status window is
|
||||
shown.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_cli</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Legal</title>
|
||||
<para>wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <email>j@w1.fi</email> and
|
||||
contributors.
|
||||
All Rights Reserved.</para>
|
||||
|
||||
<para>This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
@ -1,40 +0,0 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||
.\" Please send any bug reports, improvements, comments, patches,
|
||||
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||
.TH "WPA_PASSPHRASE" "8" "12 January 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
wpa_passphrase \- Generate a WPA PSK from an ASCII passphrase for a SSID
|
||||
.SH SYNOPSIS
|
||||
|
||||
\fBwpa_passphrase\fR [ \fB\fIssid\fB\fR ] [ \fB\fIpassphrase\fB\fR ]
|
||||
|
||||
.SH "OVERVIEW"
|
||||
.PP
|
||||
\fBwpa_passphrase\fR pre-computes PSK entries for
|
||||
network configuration blocks of a
|
||||
\fIwpa_supplicant.conf\fR file. An ASCII passphrase
|
||||
and SSID are used to generate a 256-bit PSK.
|
||||
.SH "OPTIONS"
|
||||
.TP
|
||||
\fBssid\fR
|
||||
The SSID whose passphrase should be derived.
|
||||
.TP
|
||||
\fBpassphrase\fR
|
||||
The passphrase to use. If not included on the command line,
|
||||
passphrase will be read from standard input.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBwpa_supplicant.conf\fR(5)
|
||||
\fBwpa_supplicant\fR(8)
|
||||
.SH "LEGAL"
|
||||
.PP
|
||||
wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <j@w1.fi> and
|
||||
contributors.
|
||||
All Rights Reserved.
|
||||
.PP
|
||||
This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).
|
@ -1,73 +0,0 @@
|
||||
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
|
||||
<refentry>
|
||||
<refmeta>
|
||||
<refentrytitle>wpa_passphrase</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>wpa_passphrase</refname>
|
||||
<refpurpose>Generate a WPA PSK from an ASCII passphrase for a SSID</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>wpa_passphrase</command>
|
||||
<arg><replaceable>ssid</replaceable></arg>
|
||||
<arg><replaceable>passphrase</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
|
||||
<para><command>wpa_passphrase</command> pre-computes PSK entries for
|
||||
network configuration blocks of a
|
||||
<filename>wpa_supplicant.conf</filename> file. An ASCII passphrase
|
||||
and SSID are used to generate a 256-bit PSK.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>ssid</term>
|
||||
<listitem>
|
||||
<para>The SSID whose passphrase should be derived.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>passphrase</term>
|
||||
<listitem>
|
||||
<para>The passphrase to use. If not included on the command line,
|
||||
passphrase will be read from standard input.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Legal</title>
|
||||
<para>wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <email>j@w1.fi</email> and
|
||||
contributors.
|
||||
All Rights Reserved.</para>
|
||||
|
||||
<para>This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
@ -1,120 +0,0 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||
.\" Please send any bug reports, improvements, comments, patches,
|
||||
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||
.TH "WPA_PRIV" "8" "12 January 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
wpa_priv \- wpa_supplicant privilege separation helper
|
||||
.SH SYNOPSIS
|
||||
|
||||
\fBwpa_priv\fR [ \fB-c \fIctrl path\fB\fR ] [ \fB-Bdd\fR ] [ \fB-P \fIpid file\fB\fR ] [ \fBdriver:ifname \fI[driver:ifname ...]\fB\fR ]
|
||||
|
||||
.SH "OVERVIEW"
|
||||
.PP
|
||||
\fBwpa_priv\fR is a privilege separation helper that
|
||||
minimizes the size of \fBwpa_supplicant\fR code that needs
|
||||
to be run with root privileges.
|
||||
.PP
|
||||
If enabled, privileged operations are done in the wpa_priv process
|
||||
while leaving rest of the code (e.g., EAP authentication and WPA
|
||||
handshakes) to operate in an unprivileged process (wpa_supplicant) that
|
||||
can be run as non-root user. Privilege separation restricts the effects
|
||||
of potential software errors by containing the majority of the code in an
|
||||
unprivileged process to avoid the possibility of a full system
|
||||
compromise.
|
||||
.PP
|
||||
\fBwpa_priv\fR needs to be run with network admin
|
||||
privileges (usually, root user). It opens a UNIX domain socket for each
|
||||
interface that is included on the command line; any other interface will
|
||||
be off limits for \fBwpa_supplicant\fR in this kind of
|
||||
configuration. After this, \fBwpa_supplicant\fR can be run as
|
||||
a non-root user (e.g., all standard users on a laptop or as a special
|
||||
non-privileged user account created just for this purpose to limit access
|
||||
to user files even further).
|
||||
.SH "EXAMPLE CONFIGURATION"
|
||||
.PP
|
||||
The following steps are an example of how to configure
|
||||
\fBwpa_priv\fR to allow users in the
|
||||
\fBwpapriv\fR group to communicate with
|
||||
\fBwpa_supplicant\fR with privilege separation:
|
||||
.PP
|
||||
Create user group (e.g., wpapriv) and assign users that
|
||||
should be able to use wpa_supplicant into that group.
|
||||
.PP
|
||||
Create /var/run/wpa_priv directory for UNIX domain sockets and
|
||||
control user access by setting it accessible only for the wpapriv
|
||||
group:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
mkdir /var/run/wpa_priv
|
||||
chown root:wpapriv /var/run/wpa_priv
|
||||
chmod 0750 /var/run/wpa_priv
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Start \fBwpa_priv\fR as root (e.g., from system
|
||||
startup scripts) with the enabled interfaces configured on the
|
||||
command line:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_priv -B -c /var/run/wpa_priv -P /var/run/wpa_priv.pid wext:wlan0
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Run \fBwpa_supplicant\fR as non-root with a user
|
||||
that is in the wpapriv group:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_supplicant -i ath0 -c wpa_supplicant.conf
|
||||
.fi
|
||||
.RE
|
||||
.SH "COMMAND ARGUMENTS"
|
||||
.TP
|
||||
\fB-c ctrl path\fR
|
||||
Specify the path to wpa_priv control directory
|
||||
(Default: /var/run/wpa_priv/).
|
||||
.TP
|
||||
\fB-B\fR
|
||||
Run as a daemon in the background.
|
||||
.TP
|
||||
\fB-P file\fR
|
||||
Set the location of the PID
|
||||
file.
|
||||
.TP
|
||||
\fBdriver:ifname [driver:ifname ...]\fR
|
||||
The <driver> string dictates which of the
|
||||
supported \fBwpa_supplicant\fR driver backends is to be
|
||||
used. To get a list of supported driver types see wpa_supplicant help
|
||||
(e.g, wpa_supplicant -h). The driver backend supported by most good
|
||||
drivers is \fBwext\fR\&.
|
||||
|
||||
The <ifname> string specifies which network
|
||||
interface is to be managed by \fBwpa_supplicant\fR
|
||||
(e.g., wlan0 or ath0).
|
||||
|
||||
\fBwpa_priv\fR does not use the network interface
|
||||
before \fBwpa_supplicant\fR is started, so it is fine to
|
||||
include network interfaces that are not available at the time wpa_priv
|
||||
is started. wpa_priv can control multiple interfaces with one process,
|
||||
but it is also possible to run multiple \fBwpa_priv\fR
|
||||
processes at the same time, if desired.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBwpa_supplicant\fR(8)
|
||||
.SH "LEGAL"
|
||||
.PP
|
||||
wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <j@w1.fi> and
|
||||
contributors.
|
||||
All Rights Reserved.
|
||||
.PP
|
||||
This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).
|
@ -1,148 +0,0 @@
|
||||
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
|
||||
<refentry>
|
||||
<refmeta>
|
||||
<refentrytitle>wpa_priv</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>wpa_priv</refname>
|
||||
|
||||
<refpurpose>wpa_supplicant privilege separation helper</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>wpa_priv</command>
|
||||
<arg>-c <replaceable>ctrl path</replaceable></arg>
|
||||
<arg>-Bdd</arg>
|
||||
<arg>-P <replaceable>pid file</replaceable></arg>
|
||||
<arg>driver:ifname <replaceable>[driver:ifname ...]</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
|
||||
<para><command>wpa_priv</command> is a privilege separation helper that
|
||||
minimizes the size of <command>wpa_supplicant</command> code that needs
|
||||
to be run with root privileges.</para>
|
||||
|
||||
<para>If enabled, privileged operations are done in the wpa_priv process
|
||||
while leaving rest of the code (e.g., EAP authentication and WPA
|
||||
handshakes) to operate in an unprivileged process (wpa_supplicant) that
|
||||
can be run as non-root user. Privilege separation restricts the effects
|
||||
of potential software errors by containing the majority of the code in an
|
||||
unprivileged process to avoid the possibility of a full system
|
||||
compromise.</para>
|
||||
|
||||
<para><command>wpa_priv</command> needs to be run with network admin
|
||||
privileges (usually, root user). It opens a UNIX domain socket for each
|
||||
interface that is included on the command line; any other interface will
|
||||
be off limits for <command>wpa_supplicant</command> in this kind of
|
||||
configuration. After this, <command>wpa_supplicant</command> can be run as
|
||||
a non-root user (e.g., all standard users on a laptop or as a special
|
||||
non-privileged user account created just for this purpose to limit access
|
||||
to user files even further).</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Example configuration</title>
|
||||
|
||||
<para>The following steps are an example of how to configure
|
||||
<command>wpa_priv</command> to allow users in the
|
||||
<emphasis>wpapriv</emphasis> group to communicate with
|
||||
<command>wpa_supplicant</command> with privilege separation:</para>
|
||||
|
||||
<para>Create user group (e.g., wpapriv) and assign users that
|
||||
should be able to use wpa_supplicant into that group.</para>
|
||||
|
||||
<para>Create /var/run/wpa_priv directory for UNIX domain sockets and
|
||||
control user access by setting it accessible only for the wpapriv
|
||||
group:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
mkdir /var/run/wpa_priv
|
||||
chown root:wpapriv /var/run/wpa_priv
|
||||
chmod 0750 /var/run/wpa_priv
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>Start <command>wpa_priv</command> as root (e.g., from system
|
||||
startup scripts) with the enabled interfaces configured on the
|
||||
command line:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_priv -B -c /var/run/wpa_priv -P /var/run/wpa_priv.pid wext:wlan0
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>Run <command>wpa_supplicant</command> as non-root with a user
|
||||
that is in the wpapriv group:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_supplicant -i ath0 -c wpa_supplicant.conf
|
||||
</programlisting></blockquote>
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Command Arguments</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-c ctrl path</term>
|
||||
|
||||
<listitem><para>Specify the path to wpa_priv control directory
|
||||
(Default: /var/run/wpa_priv/).</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-B</term>
|
||||
<listitem><para>Run as a daemon in the background.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-P file</term>
|
||||
|
||||
<listitem><para>Set the location of the PID
|
||||
file.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>driver:ifname [driver:ifname ...]</term>
|
||||
|
||||
<listitem><para>The <driver> string dictates which of the
|
||||
supported <command>wpa_supplicant</command> driver backends is to be
|
||||
used. To get a list of supported driver types see wpa_supplicant help
|
||||
(e.g, wpa_supplicant -h). The driver backend supported by most good
|
||||
drivers is <emphasis>wext</emphasis>.</para>
|
||||
|
||||
<para>The <ifname> string specifies which network
|
||||
interface is to be managed by <command>wpa_supplicant</command>
|
||||
(e.g., wlan0 or ath0).</para>
|
||||
|
||||
<para><command>wpa_priv</command> does not use the network interface
|
||||
before <command>wpa_supplicant</command> is started, so it is fine to
|
||||
include network interfaces that are not available at the time wpa_priv
|
||||
is started. wpa_priv can control multiple interfaces with one process,
|
||||
but it is also possible to run multiple <command>wpa_priv</command>
|
||||
processes at the same time, if desired.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Legal</title>
|
||||
<para>wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <email>j@w1.fi</email> and
|
||||
contributors.
|
||||
All Rights Reserved.</para>
|
||||
|
||||
<para>This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
@ -1,511 +0,0 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||
.\" Please send any bug reports, improvements, comments, patches,
|
||||
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||
.TH "WPA_SUPPLICANT" "8" "12 January 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
wpa_supplicant \- Wi-Fi Protected Access client and IEEE 802.1X supplicant
|
||||
.SH SYNOPSIS
|
||||
|
||||
\fBwpa_supplicant\fR [ \fB-BddfhKLqqtuvW\fR ] [ \fB-i\fIifname\fB\fR ] [ \fB-c\fIconfig file\fB\fR ] [ \fB-D\fIdriver\fB\fR ] [ \fB-P\fIPID_file\fB\fR ] [ \fB-f\fIoutput file\fB\fR ]
|
||||
|
||||
.SH "OVERVIEW"
|
||||
.PP
|
||||
Wireless networks do not require physical access to the network equipment
|
||||
in the same way as wired networks. This makes it easier for unauthorized
|
||||
users to passively monitor a network and capture all transmitted frames.
|
||||
In addition, unauthorized use of the network is much easier. In many cases,
|
||||
this can happen even without user's explicit knowledge since the wireless
|
||||
LAN adapter may have been configured to automatically join any available
|
||||
network.
|
||||
.PP
|
||||
Link-layer encryption can be used to provide a layer of security for
|
||||
wireless networks. The original wireless LAN standard, IEEE 802.11,
|
||||
included a simple encryption mechanism, WEP. However, that proved to
|
||||
be flawed in many areas and network protected with WEP cannot be consider
|
||||
secure. IEEE 802.1X authentication and frequently changed dynamic WEP keys
|
||||
can be used to improve the network security, but even that has inherited
|
||||
security issues due to the use of WEP for encryption. Wi-Fi Protected
|
||||
Access and IEEE 802.11i amendment to the wireless LAN standard introduce
|
||||
a much improvement mechanism for securing wireless networks. IEEE 802.11i
|
||||
enabled networks that are using CCMP (encryption mechanism based on strong
|
||||
cryptographic algorithm AES) can finally be called secure used for
|
||||
applications which require efficient protection against unauthorized
|
||||
access.
|
||||
.PP
|
||||
\fBwpa_supplicant\fR is an implementation of
|
||||
the WPA Supplicant component, i.e., the part that runs in the
|
||||
client stations. It implements WPA key negotiation with a WPA
|
||||
Authenticator and EAP authentication with Authentication
|
||||
Server. In addition, it controls the roaming and IEEE 802.11
|
||||
authentication/association of the wireless LAN driver.
|
||||
.PP
|
||||
\fBwpa_supplicant\fR is designed to be a
|
||||
"daemon" program that runs in the background and acts as the
|
||||
backend component controlling the wireless
|
||||
connection. \fBwpa_supplicant\fR supports separate
|
||||
frontend programs and an example text-based frontend,
|
||||
\fBwpa_cli\fR, is included with
|
||||
wpa_supplicant.
|
||||
.PP
|
||||
Before wpa_supplicant can do its work, the network interface
|
||||
must be available. That means that the physical device must be
|
||||
present and enabled, and the driver for the device must be
|
||||
loaded. The daemon will exit immediately if the device is not already
|
||||
available.
|
||||
.PP
|
||||
After \fBwpa_supplicant\fR has configured the
|
||||
network device, higher level configuration such as DHCP may
|
||||
proceed. There are a variety of ways to integrate wpa_supplicant
|
||||
into a machine's networking scripts, a few of which are described
|
||||
in sections below.
|
||||
.PP
|
||||
The following steps are used when associating with an AP
|
||||
using WPA:
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
\fBwpa_supplicant\fR requests the kernel
|
||||
driver to scan neighboring BSSes
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
\fBwpa_supplicant\fR selects a BSS based on
|
||||
its configuration
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
\fBwpa_supplicant\fR requests the kernel
|
||||
driver to associate with the chosen BSS
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
If WPA-EAP: integrated IEEE 802.1X Supplicant
|
||||
completes EAP authentication with the
|
||||
authentication server (proxied by the Authenticator in the
|
||||
AP)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
If WPA-EAP: master key is received from the IEEE 802.1X
|
||||
Supplicant
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
If WPA-PSK: \fBwpa_supplicant\fR uses PSK
|
||||
as the master session key
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
\fBwpa_supplicant\fR completes WPA 4-Way
|
||||
Handshake and Group Key Handshake with the Authenticator
|
||||
(AP)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
\fBwpa_supplicant\fR configures encryption
|
||||
keys for unicast and broadcast
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
normal data packets can be transmitted and received
|
||||
.SH "SUPPORTED FEATURES"
|
||||
.PP
|
||||
Supported WPA/IEEE 802.11i features:
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
WPA-PSK ("WPA-Personal")
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
WPA with EAP (e.g., with RADIUS authentication server)
|
||||
("WPA-Enterprise") Following authentication methods are
|
||||
supported with an integrate IEEE 802.1X Supplicant:
|
||||
.RS
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TLS
|
||||
.RE
|
||||
.RS
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-PEAP/TLS (both PEAPv0 and PEAPv1)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-PEAP/GTC (both PEAPv0 and PEAPv1)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-PEAP/OTP (both PEAPv0 and PEAPv1)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/EAP-MD5-Challenge
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/EAP-GTC
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/EAP-OTP
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/EAP-MSCHAPv2
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/EAP-TLS
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/MSCHAPv2
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/MSCHAP
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/PAP
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-TTLS/CHAP
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-SIM
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-AKA
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-PSK
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-PAX
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
LEAP (note: requires special support from
|
||||
the driver for IEEE 802.11 authentication)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
(following methods are supported, but since
|
||||
they do not generate keying material, they cannot be used
|
||||
with WPA or IEEE 802.1X WEP keying)
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-MD5-Challenge
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-MSCHAPv2
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-GTC
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
EAP-OTP
|
||||
.RE
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
key management for CCMP, TKIP, WEP104, WEP40
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
RSN/WPA2 (IEEE 802.11i)
|
||||
.RS
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
pre-authentication
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
PMKSA caching
|
||||
.RE
|
||||
.SH "AVAILABLE DRIVERS"
|
||||
.PP
|
||||
A summary of available driver backends is below. Support for each
|
||||
of the driver backends is chosen at wpa_supplicant compile time. For a
|
||||
list of supported driver backends that may be used with the -D option on
|
||||
your system, refer to the help output of wpa_supplicant
|
||||
(\fBwpa_supplicant -h\fR).
|
||||
.TP
|
||||
\fBwext\fR
|
||||
Linux wireless extensions (generic).
|
||||
.TP
|
||||
\fBwired\fR
|
||||
wpa_supplicant wired Ethernet driver
|
||||
.TP
|
||||
\fBroboswitch\fR
|
||||
wpa_supplicant Broadcom switch driver
|
||||
.TP
|
||||
\fBbsd\fR
|
||||
BSD 802.11 support (Atheros, etc.).
|
||||
.TP
|
||||
\fBndis\fR
|
||||
Windows NDIS driver.
|
||||
.SH "COMMAND LINE OPTIONS"
|
||||
.PP
|
||||
Most command line options have global scope. Some are given per
|
||||
interface, and are only valid if at least one \fB-i\fR option
|
||||
is specified, otherwise they're ignored. Option groups for different
|
||||
interfaces must be separated by \fB-N\fR option.
|
||||
.TP
|
||||
\fB-b br_ifname\fR
|
||||
Optional bridge interface name. (Per interface)
|
||||
.TP
|
||||
\fB-B\fR
|
||||
Run daemon in the background.
|
||||
.TP
|
||||
\fB-c filename\fR
|
||||
Path to configuration file. (Per interface)
|
||||
.TP
|
||||
\fB-C ctrl_interface\fR
|
||||
Path to ctrl_interface socket (Per interface. Only used if
|
||||
\fB-c\fR is not).
|
||||
.TP
|
||||
\fB-i ifname\fR
|
||||
Interface to listen on. Multiple instances of this option can
|
||||
be present, one per interface, separated by \fB-N\fR
|
||||
option (see below).
|
||||
.TP
|
||||
\fB-d\fR
|
||||
Increase debugging verbosity (\fB-dd\fR even
|
||||
more).
|
||||
.TP
|
||||
\fB-D driver\fR
|
||||
Driver to use (can be multiple drivers: nl80211,wext).
|
||||
(Per interface, see the available options below.)
|
||||
.TP
|
||||
\fB-f output file\fR
|
||||
Log output to specified file instead of stdout.
|
||||
.TP
|
||||
\fB-g global ctrl_interface\fR
|
||||
Path to global ctrl_interface socket. If specified, interface
|
||||
definitions may be omitted.
|
||||
.TP
|
||||
\fB-K\fR
|
||||
Include keys (passwords, etc.) in debug output.
|
||||
.TP
|
||||
\fB-t\fR
|
||||
Include timestamp in debug messages.
|
||||
.TP
|
||||
\fB-h\fR
|
||||
Help. Show a usage message.
|
||||
.TP
|
||||
\fB-L\fR
|
||||
Show license (BSD).
|
||||
.TP
|
||||
\fB-p\fR
|
||||
Driver parameters. (Per interface)
|
||||
.TP
|
||||
\fB-P PID_file\fR
|
||||
Path to PID file.
|
||||
.TP
|
||||
\fB-q\fR
|
||||
Decrease debugging verbosity (\fB-qq\fR even
|
||||
less).
|
||||
.TP
|
||||
\fB-u\fR
|
||||
Enabled DBus control interface. If enabled, interface
|
||||
definitions may be omitted.
|
||||
.TP
|
||||
\fB-v\fR
|
||||
Show version.
|
||||
.TP
|
||||
\fB-W\fR
|
||||
Wait for a control interface monitor before starting.
|
||||
.TP
|
||||
\fB-N\fR
|
||||
Start describing new interface.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
In most common cases, \fBwpa_supplicant\fR is
|
||||
started with:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
This makes the process fork into background.
|
||||
.PP
|
||||
The easiest way to debug problems, and to get debug log for
|
||||
bug reports, is to start \fBwpa_supplicant\fR on
|
||||
foreground with debugging enabled:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
If the specific driver wrapper is not known beforehand, it is
|
||||
possible to specify multiple comma separated driver wrappers on the command
|
||||
line. \fBwpa_supplicant\fR will use the first driver
|
||||
wrapper that is able to initialize the interface.
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
\fBwpa_supplicant\fR can control multiple
|
||||
interfaces (radios) either by running one process for each
|
||||
interface separately or by running just one process and list of
|
||||
options at command line. Each interface is separated with -N
|
||||
argument. As an example, following command would start
|
||||
wpa_supplicant for two interfaces:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_supplicant \\
|
||||
-c wpa1.conf -i wlan0 -D nl80211 -N \\
|
||||
-c wpa2.conf -i ath0 -D wext
|
||||
.fi
|
||||
.RE
|
||||
.SH "OS REQUIREMENTS"
|
||||
.PP
|
||||
Current hardware/software requirements:
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
Linux kernel 2.4.x or 2.6.x with Linux Wireless
|
||||
Extensions v15 or newer
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
FreeBSD 6-CURRENT
|
||||
.TP 0.2i
|
||||
\(bu
|
||||
Microsoft Windows with WinPcap (at least WinXP, may work
|
||||
with other versions)
|
||||
.SH "SUPPORTED DRIVERS"
|
||||
.TP
|
||||
\fBLinux wireless extensions\fR
|
||||
In theory, any driver that supports Linux wireless
|
||||
extensions can be used with IEEE 802.1X (i.e., not WPA) when
|
||||
using ap_scan=0 option in configuration file.
|
||||
.TP
|
||||
\fBWired Ethernet drivers\fR
|
||||
Use ap_scan=0.
|
||||
.TP
|
||||
\fBBSD net80211 layer (e.g., Atheros driver)\fR
|
||||
At the moment, this is for FreeBSD 6-CURRENT branch.
|
||||
.TP
|
||||
\fBWindows NDIS\fR
|
||||
The current Windows port requires WinPcap
|
||||
(http://winpcap.polito.it/). See README-Windows.txt for more
|
||||
information.
|
||||
.PP
|
||||
wpa_supplicant was designed to be portable for different
|
||||
drivers and operating systems. Hopefully, support for more wlan
|
||||
cards and OSes will be added in the future. See developer.txt for
|
||||
more information about the design of wpa_supplicant and porting to
|
||||
other drivers. One main goal is to add full WPA/WPA2 support to
|
||||
Linux wireless extensions to allow new drivers to be supported
|
||||
without having to implement new driver-specific interface code in
|
||||
wpa_supplicant.
|
||||
.SH "ARCHITECTURE"
|
||||
.PP
|
||||
The
|
||||
\fBwpa_supplicant\fR system consists of the following
|
||||
components:
|
||||
.TP
|
||||
\fB\fIwpa_supplicant.conf\fB \fR
|
||||
the configuration file describing all networks that the
|
||||
user wants the computer to connect to.
|
||||
.TP
|
||||
\fBwpa_supplicant\fR
|
||||
the program that directly interacts with the
|
||||
network interface.
|
||||
.TP
|
||||
\fBwpa_cli\fR
|
||||
the
|
||||
client program that provides a high-level interface to the
|
||||
functionality of the daemon.
|
||||
.TP
|
||||
\fBwpa_passphrase\fR
|
||||
a utility needed to construct
|
||||
\fIwpa_supplicant.conf\fR files that include
|
||||
encrypted passwords.
|
||||
.SH "QUICK START"
|
||||
.PP
|
||||
First, make a configuration file, e.g.
|
||||
\fI/etc/wpa_supplicant.conf\fR, that describes the networks
|
||||
you are interested in. See \fBwpa_supplicant.conf\fR(5)
|
||||
for details.
|
||||
.PP
|
||||
Once the configuration is ready, you can test whether the
|
||||
configuration works by running \fBwpa_supplicant\fR
|
||||
with following command to start it on foreground with debugging
|
||||
enabled:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
|
||||
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Assuming everything goes fine, you can start using following
|
||||
command to start \fBwpa_supplicant\fR on background
|
||||
without debugging:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
|
||||
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Please note that if you included more than one driver
|
||||
interface in the build time configuration (.config), you may need
|
||||
to specify which interface to use by including -D<driver
|
||||
name> option on the command line.
|
||||
.SH "INTERFACE TO PCMCIA-CS/CARDMRG"
|
||||
.PP
|
||||
For example, following small changes to pcmcia-cs scripts
|
||||
can be used to enable WPA support:
|
||||
.PP
|
||||
Add MODE="Managed" and WPA="y" to the network scheme in
|
||||
\fI/etc/pcmcia/wireless.opts\fR\&.
|
||||
.PP
|
||||
Add the following block to the end of \fBstart\fR
|
||||
action handler in \fI/etc/pcmcia/wireless\fR:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
|
||||
/usr/local/bin/wpa_supplicant -B -c/etc/wpa_supplicant.conf -i$DEVICE
|
||||
fi
|
||||
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
Add the following block to the end of \fBstop\fR
|
||||
action handler (may need to be separated from other actions) in
|
||||
\fI/etc/pcmcia/wireless\fR:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
|
||||
killall wpa_supplicant
|
||||
fi
|
||||
|
||||
.fi
|
||||
.RE
|
||||
.PP
|
||||
This will make \fBcardmgr\fR start
|
||||
\fBwpa_supplicant\fR when the card is plugged
|
||||
in.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBwpa_background\fR(8)
|
||||
\fBwpa_supplicant.conf\fR(5)
|
||||
\fBwpa_cli\fR(8)
|
||||
\fBwpa_passphrase\fR(8)
|
||||
.SH "LEGAL"
|
||||
.PP
|
||||
wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <j@w1.fi> and
|
||||
contributors.
|
||||
All Rights Reserved.
|
||||
.PP
|
||||
This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).
|
@ -1,225 +0,0 @@
|
||||
.\" This manpage has been automatically generated by docbook2man
|
||||
.\" from a DocBook document. This tool can be found at:
|
||||
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
|
||||
.\" Please send any bug reports, improvements, comments, patches,
|
||||
.\" etc. to Steve Cheng <steve@ggi-project.org>.
|
||||
.TH "WPA_SUPPLICANT.CONF" "5" "12 January 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
wpa_supplicant.conf \- configuration file for wpa_supplicant
|
||||
.SH "OVERVIEW"
|
||||
.PP
|
||||
\fBwpa_supplicant\fR is configured using a text
|
||||
file that lists all accepted networks and security policies,
|
||||
including pre-shared keys. See the example configuration file,
|
||||
probably in \fB/usr/share/doc/wpa_supplicant/\fR, for
|
||||
detailed information about the configuration format and supported
|
||||
fields.
|
||||
.PP
|
||||
All file paths in this configuration file should use full
|
||||
(absolute, not relative to working directory) path in order to allow
|
||||
working directory to be changed. This can happen if wpa_supplicant is
|
||||
run in the background.
|
||||
.PP
|
||||
Changes to configuration file can be reloaded be sending
|
||||
SIGHUP signal to \fBwpa_supplicant\fR ('killall -HUP
|
||||
wpa_supplicant'). Similarly, reloading can be triggered with
|
||||
the \fBwpa_cli reconfigure\fR command.
|
||||
.PP
|
||||
Configuration file can include one or more network blocks,
|
||||
e.g., one for each used SSID. wpa_supplicant will automatically
|
||||
select the best network based on the order of network blocks in
|
||||
the configuration file, network security level (WPA/WPA2 is
|
||||
preferred), and signal strength.
|
||||
.SH "QUICK EXAMPLES"
|
||||
.TP 3
|
||||
1.
|
||||
WPA-Personal (PSK) as home network and WPA-Enterprise with
|
||||
EAP-TLS as work network.
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
#
|
||||
# home network; allow all valid ciphers
|
||||
network={
|
||||
ssid="home"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-PSK
|
||||
psk="very secret passphrase"
|
||||
}
|
||||
#
|
||||
# work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphers
|
||||
network={
|
||||
ssid="work"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP
|
||||
pairwise=CCMP TKIP
|
||||
group=CCMP TKIP
|
||||
eap=TLS
|
||||
identity="user@example.com"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
client_cert="/etc/cert/user.pem"
|
||||
private_key="/etc/cert/user.prv"
|
||||
private_key_passwd="password"
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.TP 3
|
||||
2.
|
||||
WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that
|
||||
use old peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse
|
||||
Aegis, Interlink RAD-Series)
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="example"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP
|
||||
eap=PEAP
|
||||
identity="user@example.com"
|
||||
password="foobar"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
phase1="peaplabel=0"
|
||||
phase2="auth=MSCHAPV2"
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.TP 3
|
||||
3.
|
||||
EAP-TTLS/EAP-MD5-Challenge configuration with anonymous
|
||||
identity for the unencrypted use. Real identity is sent only
|
||||
within an encrypted TLS tunnel.
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="example"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP
|
||||
eap=TTLS
|
||||
identity="user@example.com"
|
||||
anonymous_identity="anonymous@example.com"
|
||||
password="foobar"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
phase2="auth=MD5"
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.TP 3
|
||||
4.
|
||||
IEEE 802.1X (i.e., no WPA) with dynamic WEP keys
|
||||
(require both unicast and broadcast); use EAP-TLS for
|
||||
authentication
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="1x-test"
|
||||
scan_ssid=1
|
||||
key_mgmt=IEEE8021X
|
||||
eap=TLS
|
||||
identity="user@example.com"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
client_cert="/etc/cert/user.pem"
|
||||
private_key="/etc/cert/user.prv"
|
||||
private_key_passwd="password"
|
||||
eapol_flags=3
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.TP 3
|
||||
5.
|
||||
Catch all example that allows more or less all
|
||||
configuration modes. The configuration options are used based
|
||||
on what security policy is used in the selected SSID. This is
|
||||
mostly for testing and is not recommended for normal
|
||||
use.
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="example"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
|
||||
pairwise=CCMP TKIP
|
||||
group=CCMP TKIP WEP104 WEP40
|
||||
psk="very secret passphrase"
|
||||
eap=TTLS PEAP TLS
|
||||
identity="user@example.com"
|
||||
password="foobar"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
client_cert="/etc/cert/user.pem"
|
||||
private_key="/etc/cert/user.prv"
|
||||
private_key_passwd="password"
|
||||
phase1="peaplabel=0"
|
||||
ca_cert2="/etc/cert/ca2.pem"
|
||||
client_cert2="/etc/cer/user.pem"
|
||||
private_key2="/etc/cer/user.prv"
|
||||
private_key2_passwd="password"
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.TP 3
|
||||
6.
|
||||
Authentication for wired Ethernet. This can be used with
|
||||
\fBwired\fR or \fBroboswitch\fR interface
|
||||
(-Dwired or -Droboswitch on command line).
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
ap_scan=0
|
||||
network={
|
||||
key_mgmt=IEEE8021X
|
||||
eap=MD5
|
||||
identity="user"
|
||||
password="password"
|
||||
eapol_flags=0
|
||||
}
|
||||
.fi
|
||||
.RE
|
||||
.SH "CERTIFICATES"
|
||||
.PP
|
||||
Some EAP authentication methods require use of
|
||||
certificates. EAP-TLS uses both server side and client
|
||||
certificates whereas EAP-PEAP and EAP-TTLS only require the server
|
||||
side certificate. When client certificate is used, a matching
|
||||
private key file has to also be included in configuration. If the
|
||||
private key uses a passphrase, this has to be configured in
|
||||
wpa_supplicant.conf ("private_key_passwd").
|
||||
.PP
|
||||
wpa_supplicant supports X.509 certificates in PEM and DER
|
||||
formats. User certificate and private key can be included in the
|
||||
same file.
|
||||
.PP
|
||||
If the user certificate and private key is received in
|
||||
PKCS#12/PFX format, they need to be converted to suitable PEM/DER
|
||||
format for wpa_supplicant. This can be done, e.g., with following
|
||||
commands:
|
||||
.sp
|
||||
.RS
|
||||
|
||||
.nf
|
||||
# convert client certificate and private key to PEM format
|
||||
openssl pkcs12 -in example.pfx -out user.pem -clcerts
|
||||
# convert CA certificate (if included in PFX file) to PEM format
|
||||
openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys
|
||||
.fi
|
||||
.RE
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fBwpa_supplicant\fR(8)
|
||||
\fBopenssl\fR(1)
|
@ -1,239 +0,0 @@
|
||||
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
<refentry>
|
||||
<refmeta>
|
||||
<refentrytitle>wpa_supplicant.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>wpa_supplicant.conf</refname>
|
||||
<refpurpose>configuration file for wpa_supplicant</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
|
||||
<para><command>wpa_supplicant</command> is configured using a text
|
||||
file that lists all accepted networks and security policies,
|
||||
including pre-shared keys. See the example configuration file,
|
||||
probably in <command>/usr/share/doc/wpa_supplicant/</command>, for
|
||||
detailed information about the configuration format and supported
|
||||
fields.</para>
|
||||
|
||||
<para>All file paths in this configuration file should use full
|
||||
(absolute, not relative to working directory) path in order to allow
|
||||
working directory to be changed. This can happen if wpa_supplicant is
|
||||
run in the background.</para>
|
||||
|
||||
<para>Changes to configuration file can be reloaded be sending
|
||||
SIGHUP signal to <command>wpa_supplicant</command> ('killall -HUP
|
||||
wpa_supplicant'). Similarly, reloading can be triggered with
|
||||
the <emphasis>wpa_cli reconfigure</emphasis> command.</para>
|
||||
|
||||
<para>Configuration file can include one or more network blocks,
|
||||
e.g., one for each used SSID. wpa_supplicant will automatically
|
||||
select the best network based on the order of network blocks in
|
||||
the configuration file, network security level (WPA/WPA2 is
|
||||
preferred), and signal strength.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Quick Examples</title>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
|
||||
<para>WPA-Personal (PSK) as home network and WPA-Enterprise with
|
||||
EAP-TLS as work network.</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
# allow frontend (e.g., wpa_cli) to be used by all users in 'wheel' group
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
#
|
||||
# home network; allow all valid ciphers
|
||||
network={
|
||||
ssid="home"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-PSK
|
||||
psk="very secret passphrase"
|
||||
}
|
||||
#
|
||||
# work network; use EAP-TLS with WPA; allow only CCMP and TKIP ciphers
|
||||
network={
|
||||
ssid="work"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP
|
||||
pairwise=CCMP TKIP
|
||||
group=CCMP TKIP
|
||||
eap=TLS
|
||||
identity="user@example.com"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
client_cert="/etc/cert/user.pem"
|
||||
private_key="/etc/cert/user.prv"
|
||||
private_key_passwd="password"
|
||||
}
|
||||
</programlisting></blockquote>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>WPA-RADIUS/EAP-PEAP/MSCHAPv2 with RADIUS servers that
|
||||
use old peaplabel (e.g., Funk Odyssey and SBR, Meetinghouse
|
||||
Aegis, Interlink RAD-Series)</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="example"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP
|
||||
eap=PEAP
|
||||
identity="user@example.com"
|
||||
password="foobar"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
phase1="peaplabel=0"
|
||||
phase2="auth=MSCHAPV2"
|
||||
}
|
||||
</programlisting></blockquote>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>EAP-TTLS/EAP-MD5-Challenge configuration with anonymous
|
||||
identity for the unencrypted use. Real identity is sent only
|
||||
within an encrypted TLS tunnel.</para>
|
||||
|
||||
|
||||
<blockquote><programlisting>
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="example"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP
|
||||
eap=TTLS
|
||||
identity="user@example.com"
|
||||
anonymous_identity="anonymous@example.com"
|
||||
password="foobar"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
phase2="auth=MD5"
|
||||
}
|
||||
</programlisting></blockquote>
|
||||
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>IEEE 802.1X (i.e., no WPA) with dynamic WEP keys
|
||||
(require both unicast and broadcast); use EAP-TLS for
|
||||
authentication</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="1x-test"
|
||||
scan_ssid=1
|
||||
key_mgmt=IEEE8021X
|
||||
eap=TLS
|
||||
identity="user@example.com"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
client_cert="/etc/cert/user.pem"
|
||||
private_key="/etc/cert/user.prv"
|
||||
private_key_passwd="password"
|
||||
eapol_flags=3
|
||||
}
|
||||
</programlisting></blockquote>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>Catch all example that allows more or less all
|
||||
configuration modes. The configuration options are used based
|
||||
on what security policy is used in the selected SSID. This is
|
||||
mostly for testing and is not recommended for normal
|
||||
use.</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
network={
|
||||
ssid="example"
|
||||
scan_ssid=1
|
||||
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
|
||||
pairwise=CCMP TKIP
|
||||
group=CCMP TKIP WEP104 WEP40
|
||||
psk="very secret passphrase"
|
||||
eap=TTLS PEAP TLS
|
||||
identity="user@example.com"
|
||||
password="foobar"
|
||||
ca_cert="/etc/cert/ca.pem"
|
||||
client_cert="/etc/cert/user.pem"
|
||||
private_key="/etc/cert/user.prv"
|
||||
private_key_passwd="password"
|
||||
phase1="peaplabel=0"
|
||||
ca_cert2="/etc/cert/ca2.pem"
|
||||
client_cert2="/etc/cer/user.pem"
|
||||
private_key2="/etc/cer/user.prv"
|
||||
private_key2_passwd="password"
|
||||
}
|
||||
</programlisting></blockquote>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Authentication for wired Ethernet. This can be used with
|
||||
<emphasis>wired</emphasis> or <emphasis>roboswitch</emphasis> interface
|
||||
(-Dwired or -Droboswitch on command line).</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
|
||||
ap_scan=0
|
||||
network={
|
||||
key_mgmt=IEEE8021X
|
||||
eap=MD5
|
||||
identity="user"
|
||||
password="password"
|
||||
eapol_flags=0
|
||||
}
|
||||
</programlisting></blockquote>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Certificates</title>
|
||||
|
||||
<para>Some EAP authentication methods require use of
|
||||
certificates. EAP-TLS uses both server side and client
|
||||
certificates whereas EAP-PEAP and EAP-TTLS only require the server
|
||||
side certificate. When client certificate is used, a matching
|
||||
private key file has to also be included in configuration. If the
|
||||
private key uses a passphrase, this has to be configured in
|
||||
wpa_supplicant.conf ("private_key_passwd").</para>
|
||||
|
||||
<para>wpa_supplicant supports X.509 certificates in PEM and DER
|
||||
formats. User certificate and private key can be included in the
|
||||
same file.</para>
|
||||
|
||||
<para>If the user certificate and private key is received in
|
||||
PKCS#12/PFX format, they need to be converted to suitable PEM/DER
|
||||
format for wpa_supplicant. This can be done, e.g., with following
|
||||
commands:</para>
|
||||
<blockquote><programlisting>
|
||||
# convert client certificate and private key to PEM format
|
||||
openssl pkcs12 -in example.pfx -out user.pem -clcerts
|
||||
# convert CA certificate (if included in PFX file) to PEM format
|
||||
openssl pkcs12 -in example.pfx -out ca.pem -cacerts -nokeys
|
||||
</programlisting></blockquote>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>openssl</refentrytitle>
|
||||
<manvolnum>1</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
@ -1,690 +0,0 @@
|
||||
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
|
||||
|
||||
<refentry>
|
||||
<refmeta>
|
||||
<refentrytitle>wpa_supplicant</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>wpa_supplicant</refname>
|
||||
<refpurpose>Wi-Fi Protected Access client and IEEE 802.1X supplicant</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>wpa_supplicant</command>
|
||||
<arg>-BddfhKLqqtuvW</arg>
|
||||
<arg>-i<replaceable>ifname</replaceable></arg>
|
||||
<arg>-c<replaceable>config file</replaceable></arg>
|
||||
<arg>-D<replaceable>driver</replaceable></arg>
|
||||
<arg>-P<replaceable>PID_file</replaceable></arg>
|
||||
<arg>-f<replaceable>output file</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
<refsect1>
|
||||
<title>Overview</title>
|
||||
|
||||
<para>
|
||||
Wireless networks do not require physical access to the network equipment
|
||||
in the same way as wired networks. This makes it easier for unauthorized
|
||||
users to passively monitor a network and capture all transmitted frames.
|
||||
In addition, unauthorized use of the network is much easier. In many cases,
|
||||
this can happen even without user's explicit knowledge since the wireless
|
||||
LAN adapter may have been configured to automatically join any available
|
||||
network.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Link-layer encryption can be used to provide a layer of security for
|
||||
wireless networks. The original wireless LAN standard, IEEE 802.11,
|
||||
included a simple encryption mechanism, WEP. However, that proved to
|
||||
be flawed in many areas and network protected with WEP cannot be consider
|
||||
secure. IEEE 802.1X authentication and frequently changed dynamic WEP keys
|
||||
can be used to improve the network security, but even that has inherited
|
||||
security issues due to the use of WEP for encryption. Wi-Fi Protected
|
||||
Access and IEEE 802.11i amendment to the wireless LAN standard introduce
|
||||
a much improvement mechanism for securing wireless networks. IEEE 802.11i
|
||||
enabled networks that are using CCMP (encryption mechanism based on strong
|
||||
cryptographic algorithm AES) can finally be called secure used for
|
||||
applications which require efficient protection against unauthorized
|
||||
access.
|
||||
</para>
|
||||
|
||||
<para><command>wpa_supplicant</command> is an implementation of
|
||||
the WPA Supplicant component, i.e., the part that runs in the
|
||||
client stations. It implements WPA key negotiation with a WPA
|
||||
Authenticator and EAP authentication with Authentication
|
||||
Server. In addition, it controls the roaming and IEEE 802.11
|
||||
authentication/association of the wireless LAN driver.</para>
|
||||
|
||||
<para><command>wpa_supplicant</command> is designed to be a
|
||||
"daemon" program that runs in the background and acts as the
|
||||
backend component controlling the wireless
|
||||
connection. <command>wpa_supplicant</command> supports separate
|
||||
frontend programs and an example text-based frontend,
|
||||
<command>wpa_cli</command>, is included with
|
||||
wpa_supplicant.</para>
|
||||
|
||||
<para>Before wpa_supplicant can do its work, the network interface
|
||||
must be available. That means that the physical device must be
|
||||
present and enabled, and the driver for the device must be
|
||||
loaded. The daemon will exit immediately if the device is not already
|
||||
available.</para>
|
||||
|
||||
<para>After <command>wpa_supplicant</command> has configured the
|
||||
network device, higher level configuration such as DHCP may
|
||||
proceed. There are a variety of ways to integrate wpa_supplicant
|
||||
into a machine's networking scripts, a few of which are described
|
||||
in sections below.</para>
|
||||
|
||||
<para>The following steps are used when associating with an AP
|
||||
using WPA:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><command>wpa_supplicant</command> requests the kernel
|
||||
driver to scan neighboring BSSes</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><command>wpa_supplicant</command> selects a BSS based on
|
||||
its configuration</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><command>wpa_supplicant</command> requests the kernel
|
||||
driver to associate with the chosen BSS</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>If WPA-EAP: integrated IEEE 802.1X Supplicant
|
||||
completes EAP authentication with the
|
||||
authentication server (proxied by the Authenticator in the
|
||||
AP)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>If WPA-EAP: master key is received from the IEEE 802.1X
|
||||
Supplicant</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>If WPA-PSK: <command>wpa_supplicant</command> uses PSK
|
||||
as the master session key</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><command>wpa_supplicant</command> completes WPA 4-Way
|
||||
Handshake and Group Key Handshake with the Authenticator
|
||||
(AP)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para><command>wpa_supplicant</command> configures encryption
|
||||
keys for unicast and broadcast</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>normal data packets can be transmitted and received</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Supported Features</title>
|
||||
<para>Supported WPA/IEEE 802.11i features:</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>WPA-PSK ("WPA-Personal")</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>WPA with EAP (e.g., with RADIUS authentication server)
|
||||
("WPA-Enterprise") Following authentication methods are
|
||||
supported with an integrate IEEE 802.1X Supplicant:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>EAP-TLS</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>EAP-PEAP/MSCHAPv2 (both PEAPv0 and PEAPv1)</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>EAP-PEAP/TLS (both PEAPv0 and PEAPv1)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>EAP-PEAP/GTC (both PEAPv0 and PEAPv1)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>EAP-PEAP/OTP (both PEAPv0 and PEAPv1)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>EAP-PEAP/MD5-Challenge (both PEAPv0 and PEAPv1)</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>EAP-TTLS/EAP-MD5-Challenge</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>EAP-TTLS/EAP-GTC</para>
|
||||
</listitem>
|
||||
|
||||
<listitem><para>EAP-TTLS/EAP-OTP</para></listitem>
|
||||
|
||||
<listitem><para>EAP-TTLS/EAP-MSCHAPv2</para></listitem>
|
||||
|
||||
<listitem><para>EAP-TTLS/EAP-TLS</para></listitem>
|
||||
|
||||
<listitem><para>EAP-TTLS/MSCHAPv2</para></listitem>
|
||||
|
||||
<listitem><para>EAP-TTLS/MSCHAP</para></listitem>
|
||||
|
||||
<listitem><para>EAP-TTLS/PAP</para></listitem>
|
||||
|
||||
<listitem><para>EAP-TTLS/CHAP</para></listitem>
|
||||
|
||||
<listitem><para>EAP-SIM</para></listitem>
|
||||
|
||||
<listitem><para>EAP-AKA</para></listitem>
|
||||
|
||||
<listitem><para>EAP-PSK</para></listitem>
|
||||
|
||||
<listitem><para>EAP-PAX</para></listitem>
|
||||
|
||||
<listitem><para>LEAP (note: requires special support from
|
||||
the driver for IEEE 802.11 authentication)</para></listitem>
|
||||
|
||||
<listitem><para>(following methods are supported, but since
|
||||
they do not generate keying material, they cannot be used
|
||||
with WPA or IEEE 802.1X WEP keying)</para></listitem>
|
||||
|
||||
<listitem><para>EAP-MD5-Challenge </para></listitem>
|
||||
|
||||
<listitem><para>EAP-MSCHAPv2</para></listitem>
|
||||
|
||||
<listitem><para>EAP-GTC</para></listitem>
|
||||
|
||||
<listitem><para>EAP-OTP</para></listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>key management for CCMP, TKIP, WEP104, WEP40</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>RSN/WPA2 (IEEE 802.11i)</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>pre-authentication</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>PMKSA caching</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Available Drivers</title>
|
||||
<para>A summary of available driver backends is below. Support for each
|
||||
of the driver backends is chosen at wpa_supplicant compile time. For a
|
||||
list of supported driver backends that may be used with the -D option on
|
||||
your system, refer to the help output of wpa_supplicant
|
||||
(<emphasis>wpa_supplicant -h</emphasis>).</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>wext</term>
|
||||
<listitem>
|
||||
<para>Linux wireless extensions (generic).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>wired</term>
|
||||
<listitem>
|
||||
<para>wpa_supplicant wired Ethernet driver</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>roboswitch</term>
|
||||
<listitem>
|
||||
<para>wpa_supplicant Broadcom switch driver</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>bsd</term>
|
||||
<listitem>
|
||||
<para>BSD 802.11 support (Atheros, etc.).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>ndis</term>
|
||||
<listitem>
|
||||
<para>Windows NDIS driver.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Command Line Options</title>
|
||||
<para>Most command line options have global scope. Some are given per
|
||||
interface, and are only valid if at least one <option>-i</option> option
|
||||
is specified, otherwise they're ignored. Option groups for different
|
||||
interfaces must be separated by <option>-N</option> option.</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>-b br_ifname</term>
|
||||
<listitem>
|
||||
<para>Optional bridge interface name. (Per interface)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-B</term>
|
||||
<listitem>
|
||||
<para>Run daemon in the background.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-c filename</term>
|
||||
<listitem>
|
||||
<para>Path to configuration file. (Per interface)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-C ctrl_interface</term>
|
||||
<listitem>
|
||||
<para>Path to ctrl_interface socket (Per interface. Only used if
|
||||
<option>-c</option> is not).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-i ifname</term>
|
||||
<listitem>
|
||||
<para>Interface to listen on. Multiple instances of this option can
|
||||
be present, one per interface, separated by <option>-N</option>
|
||||
option (see below).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-d</term>
|
||||
<listitem>
|
||||
<para>Increase debugging verbosity (<option>-dd</option> even
|
||||
more).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-D driver</term>
|
||||
<listitem>
|
||||
<para>Driver to use (can be multiple drivers: nl80211,wext).
|
||||
(Per interface, see the available options below.)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-f output file</term>
|
||||
<listitem>
|
||||
<para>Log output to specified file instead of stdout.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-g global ctrl_interface</term>
|
||||
<listitem>
|
||||
<para>Path to global ctrl_interface socket. If specified, interface
|
||||
definitions may be omitted.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-K</term>
|
||||
<listitem>
|
||||
<para>Include keys (passwords, etc.) in debug output.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-t</term>
|
||||
<listitem>
|
||||
<para>Include timestamp in debug messages.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-h</term>
|
||||
<listitem>
|
||||
<para>Help. Show a usage message.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-L</term>
|
||||
<listitem>
|
||||
<para>Show license (BSD).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-p</term>
|
||||
<listitem>
|
||||
<para>Driver parameters. (Per interface)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-P PID_file</term>
|
||||
<listitem>
|
||||
<para>Path to PID file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-q</term>
|
||||
<listitem>
|
||||
<para>Decrease debugging verbosity (<option>-qq</option> even
|
||||
less).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-u</term>
|
||||
<listitem>
|
||||
<para>Enabled DBus control interface. If enabled, interface
|
||||
definitions may be omitted.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-v</term>
|
||||
<listitem>
|
||||
<para>Show version.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-W</term>
|
||||
<listitem>
|
||||
<para>Wait for a control interface monitor before starting.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>-N</term>
|
||||
<listitem>
|
||||
<para>Start describing new interface.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Examples</title>
|
||||
|
||||
<para>In most common cases, <command>wpa_supplicant</command> is
|
||||
started with:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_supplicant -B -c/etc/wpa_supplicant.conf -iwlan0
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>This makes the process fork into background.</para>
|
||||
|
||||
<para>The easiest way to debug problems, and to get debug log for
|
||||
bug reports, is to start <command>wpa_supplicant</command> on
|
||||
foreground with debugging enabled:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_supplicant -c/etc/wpa_supplicant.conf -iwlan0 -d
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>If the specific driver wrapper is not known beforehand, it is
|
||||
possible to specify multiple comma separated driver wrappers on the command
|
||||
line. <command>wpa_supplicant</command> will use the first driver
|
||||
wrapper that is able to initialize the interface.</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_supplicant -Dnl80211,wext -c/etc/wpa_supplicant.conf -iwlan0
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para><command>wpa_supplicant</command> can control multiple
|
||||
interfaces (radios) either by running one process for each
|
||||
interface separately or by running just one process and list of
|
||||
options at command line. Each interface is separated with -N
|
||||
argument. As an example, following command would start
|
||||
wpa_supplicant for two interfaces:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_supplicant \
|
||||
-c wpa1.conf -i wlan0 -D nl80211 -N \
|
||||
-c wpa2.conf -i ath0 -D wext
|
||||
</programlisting></blockquote>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>OS Requirements</title>
|
||||
<para>Current hardware/software requirements:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Linux kernel 2.4.x or 2.6.x with Linux Wireless
|
||||
Extensions v15 or newer</para>
|
||||
</listitem>
|
||||
|
||||
|
||||
<listitem>
|
||||
<para>FreeBSD 6-CURRENT</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Microsoft Windows with WinPcap (at least WinXP, may work
|
||||
with other versions)</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Supported Drivers</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>Linux wireless extensions</term>
|
||||
<listitem>
|
||||
<para>In theory, any driver that supports Linux wireless
|
||||
extensions can be used with IEEE 802.1X (i.e., not WPA) when
|
||||
using ap_scan=0 option in configuration file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Wired Ethernet drivers</term>
|
||||
<listitem>
|
||||
<para>Use ap_scan=0.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>BSD net80211 layer (e.g., Atheros driver)</term>
|
||||
<listitem>
|
||||
<para>At the moment, this is for FreeBSD 6-CURRENT branch.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>Windows NDIS</term>
|
||||
<listitem>
|
||||
<para>The current Windows port requires WinPcap
|
||||
(http://winpcap.polito.it/). See README-Windows.txt for more
|
||||
information.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
|
||||
<para>wpa_supplicant was designed to be portable for different
|
||||
drivers and operating systems. Hopefully, support for more wlan
|
||||
cards and OSes will be added in the future. See developer.txt for
|
||||
more information about the design of wpa_supplicant and porting to
|
||||
other drivers. One main goal is to add full WPA/WPA2 support to
|
||||
Linux wireless extensions to allow new drivers to be supported
|
||||
without having to implement new driver-specific interface code in
|
||||
wpa_supplicant.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Architecture</title> <para>The
|
||||
<command>wpa_supplicant</command> system consists of the following
|
||||
components:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><filename>wpa_supplicant.conf</filename> </term>
|
||||
<listitem>
|
||||
<para>the configuration file describing all networks that the
|
||||
user wants the computer to connect to. </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><command>wpa_supplicant</command></term>
|
||||
<listitem><para>the program that directly interacts with the
|
||||
network interface. </para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><command>wpa_cli</command></term> <listitem><para> the
|
||||
client program that provides a high-level interface to the
|
||||
functionality of the daemon. </para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><command>wpa_passphrase</command></term>
|
||||
<listitem><para>a utility needed to construct
|
||||
<filename>wpa_supplicant.conf</filename> files that include
|
||||
encrypted passwords.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Quick Start</title>
|
||||
|
||||
<para>First, make a configuration file, e.g.
|
||||
<filename>/etc/wpa_supplicant.conf</filename>, that describes the networks
|
||||
you are interested in. See <citerefentry>
|
||||
<refentrytitle>wpa_supplicant.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
for details.</para>
|
||||
|
||||
<para>Once the configuration is ready, you can test whether the
|
||||
configuration works by running <command>wpa_supplicant</command>
|
||||
with following command to start it on foreground with debugging
|
||||
enabled:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -d
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>Assuming everything goes fine, you can start using following
|
||||
command to start <command>wpa_supplicant</command> on background
|
||||
without debugging:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>Please note that if you included more than one driver
|
||||
interface in the build time configuration (.config), you may need
|
||||
to specify which interface to use by including -D<driver
|
||||
name> option on the command line.</para>
|
||||
|
||||
<!-- XXX at this point, the page could include a little script
|
||||
based on wpa_cli to wait for a connection and then run
|
||||
dhclient -->
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Interface to pcmcia-cs/cardmrg</title>
|
||||
|
||||
<para>For example, following small changes to pcmcia-cs scripts
|
||||
can be used to enable WPA support:</para>
|
||||
|
||||
<para>Add MODE="Managed" and WPA="y" to the network scheme in
|
||||
<filename>/etc/pcmcia/wireless.opts</filename>.</para>
|
||||
|
||||
<para>Add the following block to the end of <emphasis>start</emphasis>
|
||||
action handler in <filename>/etc/pcmcia/wireless</filename>:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
|
||||
/usr/local/bin/wpa_supplicant -B -c/etc/wpa_supplicant.conf -i$DEVICE
|
||||
fi
|
||||
</programlisting></blockquote>
|
||||
|
||||
|
||||
<para>Add the following block to the end of <emphasis>stop</emphasis>
|
||||
action handler (may need to be separated from other actions) in
|
||||
<filename>/etc/pcmcia/wireless</filename>:</para>
|
||||
|
||||
<blockquote><programlisting>
|
||||
if [ "$WPA" = "y" -a -x /usr/local/bin/wpa_supplicant ]; then
|
||||
killall wpa_supplicant
|
||||
fi
|
||||
</programlisting></blockquote>
|
||||
|
||||
<para>This will make <command>cardmgr</command> start
|
||||
<command>wpa_supplicant</command> when the card is plugged
|
||||
in.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_background</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_supplicant.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_cli</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>wpa_passphrase</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Legal</title>
|
||||
<para>wpa_supplicant is copyright (c) 2003-2012,
|
||||
Jouni Malinen <email>j@w1.fi</email> and
|
||||
contributors.
|
||||
All Rights Reserved.</para>
|
||||
|
||||
<para>This program is licensed under the BSD license (the one with
|
||||
advertisement clause removed).</para>
|
||||
</refsect1>
|
||||
</refentry>
|
Loading…
Reference in New Issue
Block a user