From patchwork Mon Jul 14 05:19:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 369488 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) by ozlabs.org (Postfix) with ESMTP id DC26214008F for ; Mon, 14 Jul 2014 15:24:38 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id C8BE59D361; Mon, 14 Jul 2014 01:23:54 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id t0v8h29YRuxf; Mon, 14 Jul 2014 01:23:54 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8449E17C05C; Mon, 14 Jul 2014 01:21:46 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 782B317C05C for ; Mon, 14 Jul 2014 01:21:44 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fg7Jb2EKIRM4 for ; Mon, 14 Jul 2014 01:21:39 -0400 (EDT) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 91CF49D31E for ; Mon, 14 Jul 2014 01:21:13 -0400 (EDT) Received: by mail-ig0-f181.google.com with SMTP id h3so1356576igd.8 for ; Sun, 13 Jul 2014 22:21:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZKZNbCsEoDnlwzwHsaKVT+/ecL33zXPs95fvmNpqdjM=; b=PvKd6jIVvtXR++8xIVj1adG6sXzocGA+C0knykjVdOFvPs3wrakoKoBKuBq4WCMuv0 uxgU3SZFeHNnWs4gRjgpe2ly0u5C+cFFOOmzxL/U+u33cT4B3RQWakq+08zzrFROdL2G nqJMvV8i1KdNaoL5d2o4K8CyS5+TNJuU6i3WsIJyT7BSLQq4zDfv8hyCPA1dM3Xp3gcx kJcopRkK0ZIV48dOaRdBmN5BZ7A1NECjvUJpXXlpDkUE2XGmTKuQYteZaJzFuKt35p0u wozodLIUzn7JpNfvz39N1vW2r9d4iDxfHwOPgrz0IQ8ysm9CVk2uCeVjjPs1TxMaCJCn wcBQ== X-Gm-Message-State: ALoCoQmVAIikdovDduzwW3zyHNZT7mLS/Lo7lkasgG3Z0wZciFz8mxIoeNN8XF8LyMnZGuKJg+17 X-Received: by 10.50.23.16 with SMTP id i16mr21765902igf.24.1405315273071; Sun, 13 Jul 2014 22:21:13 -0700 (PDT) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by mx.google.com with ESMTPSA id la7sm21130167igb.9.2014.07.13.22.21.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 13 Jul 2014 22:21:09 -0700 (PDT) Received: from glass.local ([192.168.1.51] helo=glass.lan) by hash with esmtp (Exim 4.80) (envelope-from ) id 1X6YhG-0005TE-BU; Mon, 14 Jul 2014 01:21:06 -0400 Received: from bob by glass.lan with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1X6YhG-0002U9-Q0; Mon, 14 Jul 2014 01:21:06 -0400 From: Bob Copeland To: hostap@lists.shmoo.com Subject: [PATCH/RFC 01/18] data structures: add required mesh data fields Date: Mon, 14 Jul 2014 01:19:06 -0400 Message-Id: <1405315163-9492-2-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <1405315163-9492-1-git-send-email-me@bobcopeland.com> References: <1405315163-9492-1-git-send-email-me@bobcopeland.com> Cc: devel@lists.open80211s.org, Javier Lopez X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Thomas Pedersen Modify and add necessary fields to hostapd and wpa_supplicant data structures required by mesh networks wpa_supplicant module. Signed-off-by: Javier Lopez Signed-off-by: Jason Mobarak Signed-hostap: Thomas Pedersen --- src/ap/ap_config.h | 29 ++++++++++++++++++++++++++++- src/ap/hostapd.h | 11 +++++++++++ src/ap/sta_info.h | 18 ++++++++++++++++++ src/common/ieee802_11_defs.h | 36 ++++++++++++++++++++++++++++++++++++ src/common/wpa_ctrl.h | 6 ++++++ wpa_supplicant/config_ssid.h | 3 +++ wpa_supplicant/wpa_supplicant_i.h | 5 +++++ 7 files changed, 107 insertions(+), 1 deletion(-) diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 905aec3..5db0d85 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -15,6 +15,32 @@ #include "common/ieee802_11_common.h" #include "wps/wps.h" +#ifdef CONFIG_MESH +/** + * mesh_conf - local MBSS state and settings + */ +struct mesh_conf { + u8 meshid[32]; + u8 meshid_len; + /* Active Path Selection Protocol Identifier */ + u8 mesh_pp_id; + /* Active Path Selection Metric Identifier */ + u8 mesh_pm_id; + /* Congestion Control Mode Identifier */ + u8 mesh_cc_id; + /* Synchronization Protocol Identifier */ + u8 mesh_sp_id; + /* Authentication Protocol Identifier */ + u8 mesh_auth_id; + u8 *ies; + int ie_len; +#define MESH_CONF_SEC_NONE BIT(0) +#define MESH_CONF_SEC_AUTH BIT(1) +#define MESH_CONF_SEC_AMPE BIT(2) + int security; +}; +#endif /* CONFIG_MESH */ + #define MAX_STA_COUNT 2007 #define MAX_VLAN_ID 4094 @@ -396,7 +422,8 @@ struct hostapd_bss_config { u8 ip_addr_start[4]; u8 ip_addr_end[4]; #endif /* CONFIG_P2P */ - +#define MESH_ENABLED BIT(0) + int mesh; int disassoc_low_ack; int skip_inactivity_poll; diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 3c8727b..0f9b1d2 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -22,6 +22,9 @@ struct ieee80211_ht_capabilities; struct full_dynamic_vlan; enum wps_event; union wps_event_data; +#ifdef CONFIG_MESH +struct mesh_conf; +#endif /* CONFIG_MESH */ struct hostapd_iface; @@ -235,6 +238,10 @@ struct hostapd_data { #ifdef CONFIG_INTERWORKING size_t gas_frag_limit; #endif /* CONFIG_INTERWORKING */ +#ifdef CONFIG_MESH + int num_plinks; + int max_plinks; +#endif /* CONFIG_MESH */ #ifdef CONFIG_SQLITE struct hostapd_eap_user tmp_eap_user; @@ -272,6 +279,10 @@ struct hostapd_iface { HAPD_IFACE_ENABLED } state; +#ifdef CONFIG_MESH + struct mesh_conf *mconf; +#endif /* CONFIG_MESH */ + size_t num_bss; struct hostapd_data **bss; diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h index 03db98f..a1a8ed1 100644 --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -9,6 +9,11 @@ #ifndef STA_INFO_H #define STA_INFO_H +#ifdef CONFIG_MESH +/* needed for mesh_plink_state enum */ +#include "common/defs.h" +#endif /* CONFIG_MESH */ + /* STA flags */ #define WLAN_STA_AUTH BIT(0) #define WLAN_STA_ASSOC BIT(1) @@ -49,6 +54,19 @@ struct sta_info { int supported_rates_len; u8 qosinfo; /* Valid when WLAN_STA_WMM is set */ +#ifdef CONFIG_MESH + enum mesh_plink_state plink_state; + u16 peer_lid; + u16 my_lid; + u16 mpm_close_reason; + int mpm_retries; + u8 my_nonce[32]; + u8 peer_nonce[32]; + u8 aek[32]; /* SHA256 digest length */ + u8 mtk[16]; + u8 mgtk[16]; +#endif /* CONFIG_MESH */ + unsigned int nonerp_set:1; unsigned int no_short_slot_time_set:1; unsigned int no_short_preamble_set:1; diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index 6de71e9..3238bd4 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -194,6 +194,16 @@ #define WLAN_REASON_TDLS_TEARDOWN_UNSPECIFIED 26 /* IEEE 802.11e */ #define WLAN_REASON_DISASSOC_LOW_ACK 34 +/* IEEE 802.11s */ +#define WLAN_REASON_MESH_PEERING_CANCELLED 52 +#define WLAN_REASON_MESH_MAX_PEERS 53 +#define WLAN_REASON_MESH_CONFIG_POLICY_VIOLATION 54 +#define WLAN_REASON_MESH_CLOSE_RCVD 55 +#define WLAN_REASON_MESH_MAX_RETRIES 56 +#define WLAN_REASON_MESH_CONFIRM_TIMEOUT 57 +#define WLAN_REASON_MESH_INVALID_GTK 58 +#define WLAN_REASON_MESH_INCONSISTENT_PARAMS 59 +#define WLAN_REASON_MESH_INVALID_SECURITY_CAP 60 /* Information Element IDs */ @@ -249,7 +259,12 @@ #define WLAN_EID_ADV_PROTO 108 #define WLAN_EID_QOS_MAP_SET 110 #define WLAN_EID_ROAMING_CONSORTIUM 111 +#define WLAN_EID_MESH_CONFIG 113 +#define WLAN_EID_MESH_ID 114 +#define WLAN_EID_PEER_MGMT 117 #define WLAN_EID_EXT_CAPAB 127 +#define WLAN_EID_AMPE 139 +#define WLAN_EID_MIC 140 #define WLAN_EID_CCKM 156 #define WLAN_EID_VHT_CAP 191 #define WLAN_EID_VHT_OPERATION 192 @@ -277,6 +292,7 @@ #define WLAN_ACTION_WNM 10 #define WLAN_ACTION_UNPROTECTED_WNM 11 #define WLAN_ACTION_TDLS 12 +#define WLAN_ACTION_SELF_PROTECTED 15 #define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */ #define WLAN_ACTION_VENDOR_SPECIFIC 127 @@ -577,6 +593,10 @@ struct ieee80211_mgmt { * Entries (optional) */ u8 variable[0]; } STRUCT_PACKED bss_tm_query; + struct { + u8 action; /* 15 */ + u8 variable[0]; + } STRUCT_PACKED slf_prot_action; } u; } STRUCT_PACKED action; } u; @@ -638,6 +658,15 @@ struct ieee80211_vht_operation { le16 vht_basic_mcs_set; } STRUCT_PACKED; +struct ieee80211_ampe_ie { + u8 selected_pairwise_suite[4]; + u8 local_nonce[32]; + u8 peer_nonce[32]; + u8 mgtk[16]; + u8 key_rsc[8]; + u8 key_expiration[4]; +} STRUCT_PACKED; + #ifdef _MSC_VER #pragma pack(pop) #endif /* _MSC_VER */ @@ -1087,6 +1116,13 @@ enum wifi_display_subelem { WFD_SUBELEM_SESSION_INFO = 9 }; +/* 802.11s */ +#define MESH_SYNC_METHOD_NEIGHBOR_OFFSET 1 +#define MESH_SYNC_METHOD_VENDOR 255 +#define MESH_PATH_PROTOCOL_HWMP 1 +#define MESH_PATH_PROTOCOL_VENDOR 255 +#define MESH_PATH_METRIC_AIRTIME 1 +#define MESH_PATH_METRIC_VENDOR 255 #define OUI_BROADCOM 0x00904c /* Broadcom (Epigram) */ diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index d91594e..521b97b 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -118,6 +118,12 @@ extern "C" { #define WPS_EVENT_ER_AP_SETTINGS "WPS-ER-AP-SETTINGS " #define WPS_EVENT_ER_SET_SEL_REG "WPS-ER-AP-SET-SEL-REG " +/* MESH events */ +#define MESH_GROUP_STARTED "MESH-GROUP-STARTED " +#define MESH_GROUP_REMOVED "MESH-GROUP-REMOVED " +#define MESH_PEER_CONNECTED "MESH-PEER-CONNECTED " +#define MESH_PEER_DISCONNECTED "MESH-PEER-DISCONNECTED " + /** P2P device found */ #define P2P_EVENT_DEVICE_FOUND "P2P-DEVICE-FOUND " diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h index ab474ff..394a956 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -317,6 +317,8 @@ struct wpa_ssid { * 4 = P2P Group Formation (used internally; not in configuration * files) * + * 5 = Mesh + * * Note: IBSS can only be used with key_mgmt NONE (plaintext and static * WEP) and WPA-PSK (with proto=RSN). In addition, key_mgmt=WPA-NONE * (fixed group key TKIP/CCMP) is available for backwards compatibility, @@ -331,6 +333,7 @@ struct wpa_ssid { WPAS_MODE_AP = 2, WPAS_MODE_P2P_GO = 3, WPAS_MODE_P2P_GROUP_FORMATION = 4, + WPAS_MODE_MESH = 5, } mode; /** diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h index bf3d19d..f35cd0d 100644 --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h @@ -659,6 +659,11 @@ struct wpa_supplicant { void *ap_configured_cb_data; #endif /* CONFIG_AP */ +#ifdef CONFIG_MESH + struct hostapd_iface *ifmsh; + struct mesh_rsn *mesh_rsn; +#endif /* CONFIG_MESH */ + unsigned int off_channel_freq; struct wpabuf *pending_action_tx; u8 pending_action_src[ETH_ALEN];