diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2007-07-17 06:21:15 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2007-07-17 06:21:15 +0000 |
commit | a1f317de363550ac85528a53609ce50710715745 (patch) | |
tree | 2d5ca63b38ba017b2f8604c52c16e62a78924a64 /epan/dissectors/packet-wlccp.c | |
parent | 22d2547547b7c920bb48e769b878c41d2e66ce09 (diff) |
From Kevin A. Noll via private bug #1683:
This is a major re-write of the WLCCP version 0xc1 dissector. It now is
able to dissect many more WLCCP message types and the TLVs that may be
included in a message. Placeholders are left for message types and
TLV types that we do not currently have enough data to engineer a
dissector.
svn path=/trunk/; revision=22330
Diffstat (limited to 'epan/dissectors/packet-wlccp.c')
-rw-r--r-- | epan/dissectors/packet-wlccp.c | 3604 |
1 files changed, 3448 insertions, 156 deletions
diff --git a/epan/dissectors/packet-wlccp.c b/epan/dissectors/packet-wlccp.c index 79a8b0792d..897a1bf8c5 100644 --- a/epan/dissectors/packet-wlccp.c +++ b/epan/dissectors/packet-wlccp.c @@ -3,7 +3,7 @@ * * Copyright 2005, Joerg Mayer (see AUTHORS file) * Copyright 2006, Stephen Fisher <stephentfisher@yahoo.com> - * Copyright 2007, Kevin A. Noll <kevin.noll@versatile.com> + * Copyright 2007, Kevin A. Noll <maillistnoll@earthlink.net> * * $Id$ * @@ -17,12 +17,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -30,6 +30,8 @@ /* Version 0x00 was reverse engineered */ /* Version 0xC1 Protocol reference: US Patent Application 0050220054 */ +/* and considerable reverse engineering due to the patent application*/ +/* being incomplete */ /* More clues to version 0x00 of the protocol: * @@ -73,55 +75,127 @@ #include <epan/oui.h> #include "packet-llc.h" + +/* The UDP port that WLCCP is expected to ride on */ +/* WLCCP also uses an LLC OUI type and an ethertype */ +#define WLCCP_UDP_PORT 2887 + + +/* SAP is 2-bit version and 6-bit Type */ +#define SAP_VERSION_MASK (0xC0) +#define SAP_VALUE_MASK (0x3f) + static const value_string wlccp_sap_vs[] = { - { 0, "Context Management" }, - { 2, "Radio Resource Management" }, - { 0, NULL } + { 0x0, "Context Management" }, + { 0x1, "Security" }, + { 0x2, "Radio Resource Management" }, + { 0x3, "QOS" }, + { 0x4, "Network Management" }, + { 0x5, "MIP" }, + { 0, NULL } +}; + +#define WLCCP_SAP_CCM (0x00) +#define WLCCP_SAP_SEC (0x01) +#define WLCCP_SAP_RRM (0x02) +#define WLCCP_SAP_QOS (0x03) +#define WLCCP_SAP_NM (0x04) +#define WLCCP_SAP_MIP (0x05) + +static const value_string wlccp_node_type_vs[] = { + { 0x00, "None" }, + { 0x01, "Access Point (AP)" }, + { 0x02, "Subnet Context Manager (SCM)" }, + { 0x04, "Local Context Manager (LCM)" }, + { 0x08, "Campus Context Manager (CCM)" }, + { 0x10, "Infrastructure (ICN)" }, + { 0x40, "Client" }, +/* { 0x8000, "Multi Mask?" }, */ + { 0, NULL } }; +/* The Message Type field contains a 2-bit Sub-Type and a 6-bit Base Message Type */ +#define MT_SUBTYPE (0xC0) +#define MT_BASE_MSG_TYPE (0x3F) + static const value_string wlccp_subtype_vs[] = { - { 0, "Request" }, - { 1, "Reply" }, - { 2, "Confirm" }, - { 3, "Ack" }, + { 0x0, "Request" }, + { 0x1, "Reply" }, + { 0x2, "Confirm" }, + { 0x3, "Ack" }, { 0, NULL } }; -static const value_string wlccp_msg_type_vs[] = { - { 0x1, "nmAck" }, - { 0xb, "cmAAA" }, - { 0xc, "cmPathInit" }, - { 0xf, "cmWIDS" }, +/* The Message Type definitions are a combination of the SAP and the Type_ID */ +/* fields. These mappings are not well documented and have been gathered from a */ +/* combination of the WLCCP patent application, experimentation, and WLCCP */ +/* device logs. */ + +/* For SAP=0 */ +static const value_string wlccp_msg_type_vs_0[] = { + { 0x1, "SCM Advertise" }, + { 0x2, "CCM Advertise" }, + { 0x3, "Registration" }, + { 0x4, "DeRegistration" }, + { 0x5, "Detach" }, + { 0x6, "Context" }, + { 0x7, "Path Update" }, + { 0x8, "Path Check" }, + { 0x9, "PreRegistration" }, + { 0x0a, "Trace" }, + { 0x0b, "cmAAA EAP Authent" }, + { 0x0c, "cmPathInit Path Authent" }, + { 0x0f, "cmWIDS" }, + { 0, NULL } + +}; + +/* For SAP=1 */ +static const value_string wlccp_msg_type_vs_1[] = { +/* { 0x1, "Unknown" }, */ + { 0, NULL } + +}; + +/* For SAP=2 */ +static const value_string wlccp_msg_type_vs_2[] = { + { 0x1, "rmReq" }, + { 0x2, "rmReqRoutingResp" }, + { 0x3, "rmReport" }, + { 0, NULL } + +}; + +/* For SAP=3 */ +static const value_string wlccp_msg_type_vs_3[] = { +/* { 0x1, "Unknown" }, */ + { 0, NULL } + +}; + +/* For SAP=4 */ +static const value_string wlccp_msg_type_vs_4[] = { + { 0x01, "nmAck" }, { 0x10, "nmConfigRequest" }, { 0x11, "nmConfigReply" }, { 0x20, "nmApRegistration" }, + { 0x21, "nmScmStateChange" }, { 0x22, "nmScmKeepActive" }, { 0x30, "nmClientEventReport" }, { 0x31, "nmAllClientRefreshRequest" }, + { 0, NULL } }; -static const value_string wlccp_node_type_vs[] = { - { 0, "None" }, - { 1, "Access Point (AP)" }, - { 2, "Subnet Context Manager (SCM)" }, - { 4, "Local Context Manager (LCM)" }, - { 8, "Campus Context Manager (CCM)" }, - { 0x10, "Infrastructure (ICN)" }, - { 0x40, "Client" }, - { 0, NULL } -}; +/* For SAP=5 */ +static const value_string wlccp_msg_type_vs_5[] = { +/* { 0x1, "Unknown" }, */ + { 0, NULL } -static const value_string cisco_pid_vals[] = { - { 0x0000, "WLCCP" }, - { 0, NULL } }; -/* Bit fields in message type */ -#define MT_SUBTYPE (0xC0) -#define MT_BASE_MSG_TYPE (0x3F) -/* Bit fields in flags */ +/* Mask definitions for the CM Flags field */ #define F_RETRY (1<<15) #define F_RESPONSE_REQUEST (1<<14) #define F_TLV (1<<13) @@ -132,34 +206,284 @@ static const value_string cisco_pid_vals[] = { #define F_RELAY (1<<8) #define F_MIC (1<<7) -#define WLCCP_UDP_PORT 2887 -/* WLCCP also uses an LLC OUI type and an ethertype */ +/* Mask definitions for the RM Flags field */ +#define RM_F_REQUEST_REPLY (1<<0) +#define RM_F_MIC (1<<1) + +/* Mask definitions for the NM Flags field */ +/* the NM flags are the same as the CM flags except there is no +INBOUND, OUTBOUND, HOPWISE_ROUTING, ROOT_CM, or RELAY flag, and +the RESPONSE_REQUEST flag is renamed ACK_REQD +*/ +#define F_ACK_REQD (1<<14) + + + + +/* The TLV Type definitions are a combination of the TLV Group and the */ +/* TLV Type ID fields. These mappings are not well documented and have been */ +/* gathered from a combination of the WLCCP patent application, */ +/* experimentation, and WLCCP device logs */ + +/* The TLV Group/Type Field contains some flags and the Group ID and Type ID */ +#define TLV_F_CONTAINER (0x8000) +#define TLV_F_ENCRYPTED (0x4000) +#define TLV_F_RESVD (0x3000) +#define TLV_F_RESVD2 (0x2000) +#define TLV_F_RESVD3 (0x1000) +#define TLV_F_REQUEST (0x0080) +#define TLV_GROUP_ID (0x0F00) +#define TLV_TYPE_ID (0x007F) + +static const value_string wlccp_tlv_group_vs[] = { + { 0x0, "WLCCP Group" }, + { 0x1, "Security Group" }, + { 0x2, "RRM Group" }, + { 0x3, "QOS Group" }, + { 0x4, "NM Group" }, + { 0x5, "MIP Group" }, + { 0, NULL } +}; + + +#define WLCCP_TLV_GROUP_WLCCP (0x00) +#define WLCCP_TLV_GROUP_SEC (0x01) +#define WLCCP_TLV_GROUP_RRM (0x02) +#define WLCCP_TLV_GROUP_QOS (0x03) +#define WLCCP_TLV_GROUP_NM (0x04) +#define WLCCP_TLV_GROUP_MIP (0x05) + +/* Group 0 */ +static const value_string wlccp_tlv_typeID_0[] = { + { 0x00, "NULL TLV" }, + { 0x09, "ipv4Address" }, + { 0x01, "Container" }, + { 0x02, "AP Port Info" }, + { 0x03, "ipv4 Subnet ID" }, + { 0x04, "Secondary LAN Address List" }, + { 0x05, "Multicast Ethernet Address List" }, + { 0x06, "ipv4 Multicast Address List" }, + { 0x07, "AP Port List" }, + { 0x08, "Requestor SSID" }, + { 0, NULL } +}; + +/* Group 1 */ +static const value_string wlccp_tlv_typeID_1[] = { + { 0x01, "initSession" }, + { 0x02, "inSecureContextReq" }, + { 0x06, "authenticator" }, + { 0x08, "mic" }, + { 0x0a, "inSecureContextReply" }, + { 0, NULL } +}; + +/* Group 2 */ +static const value_string wlccp_tlv_typeID_2[] = { + { 0x03, "rmReport" }, + { 0x04, "aggrRmReport" }, + { 0x15, "frameReport" }, + { 0x17, "ccaReport" }, + { 0x19, "rpiHistReport" }, + { 0x1e, "commonBeaconReport" }, + { 0x1f, "aggrBeaconReport" }, + { 0x5b, "mfpRouting" }, + { 0x5c, "mfpConfig" }, + { 0, NULL } +}; + +/* Group 3 */ +static const value_string wlccp_tlv_typeID_3[] = { +/* { 0x01, "Unknown" } */ + { 0, NULL }, +}; + +/* Group 4 */ +static const value_string wlccp_tlv_typeID_4[] = { +/* { 0x01, "Unknown" } */ + { 0, NULL }, +}; + +/* Group 5 */ +static const value_string wlccp_tlv_typeID_5[] = { +/* { 0x01, "Unknown" } */ + { 0, NULL }, +}; + + + + + +static const value_string wlccp_aaa_msg_type_vs[] = { + { 0x0, "Start" }, + { 0x1, "Finish" }, + { 0x2, "EAPOL" }, + { 0x3, "Cisco Accounting" }, + { 0, NULL } +}; + +static const value_string wlccp_eapol_auth_type_vs[] = { + { 0x0, "EAP Only" }, + { 0x1, "MAC Only" }, + { 0x2, "MAC then EAP" }, + { 0x3, "MAC and EAP" }, + { 0x4, "LEAP only" }, + { 0x5, "MAC then LEAP" }, + { 0x6, "MAC and LEAP" }, + { 0, NULL } +}; + +static const value_string wlccp_key_mgmt_type_vs[] = { + { 0x0, "None" }, + { 0x1, "CCKM" }, + { 0x2, "Legacy 802.1x" }, + { 0x3, "SSN/TGi" }, + { 0, NULL } +}; + +static const value_string eapol_type_vs[] = { + { 0x0, "EAP Packet" }, + { 0x1, "EAP Start" }, + { 0x2, "Unknown" }, + { 0x3, "Key" }, + { 0, NULL } + +}; + +static const value_string wlccp_status_vs[] = { + {0, "Success" }, + { 0, NULL } +}; + +static const value_string cisco_pid_vals[] = { + { 0x0000, "WLCCP" }, + { 0, NULL } +}; + +static const value_string wlccp_mode_vs[] = { + { 0x0, "apSelected" }, + {0x01, "series" }, + {0x3, "parallel" }, + {0, NULL } +}; + + +static const value_string phy_type_80211_vs[] = { + { 0x01, "FHSS 2.4 GHz" }, + { 0x02, "DSSS 2.4 GHz" }, + { 0x03, "IR Baseband" }, + { 0x04, "OFDM 5GHz" }, + { 0x05, "HRDSSS" }, + { 0x06, "ERP" }, + { 0, NULL } +}; + + +/* 802.11 capabilities flags */ +#define F_80211_ESS 0x0001 +#define F_80211_IBSS 0x0002 +#define F_80211_CFPOLL 0x0004 +#define F_80211_CFPOLL_REQ 0x0008 +#define F_80211_PRIVACY 0x0010 +#define F_80211_SHORT_PREAMBLE 0x0020 +#define F_80211_PBCC 0x0040 +#define F_80211_CH_AGILITY 0x0080 +#define F_80211_SPEC_MGMT 0x0100 +#define F_80211_QOS 0x0200 +#define F_80211_SHORT_TIME_SLOT 0x0400 +#define F_80211_APSD 0x0800 +#define F_80211_RESVD 0x1000 +#define F_80211_DSSS_OFDM 0x2000 +#define F_80211_DLYD_BLK_ACK 0x4000 +#define F_80211_IMM_BLK_ACK 0x8000 + + + -/* Forward declaration we need below */ +/* +struct subdissector_returns_t +{ + static int consumed + static gboolean mic_flag; + static gboolean tlv_flag; +}; * struct flags_t declaration * +*/ + + + +/* Forward declarations we need below */ void proto_reg_handoff_wlccp(void); +static guint dissect_wlccp_ccm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); +static guint dissect_wlccp_sec_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); +static guint dissect_wlccp_rrm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); +static guint dissect_wlccp_qos_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); +static guint dissect_wlccp_nm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); +static guint dissect_wlccp_mip_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type); + +static guint dissect_wlccp_tlvs(proto_tree *_tree, tvbuff_t *tvb, guint tlv_offset, guint _depth); + +static guint dissect_wlccp_ccm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); +static guint dissect_wlccp_sec_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); +static guint dissect_wlccp_rrm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); +static guint dissect_wlccp_qos_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); +static guint dissect_wlccp_nm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); +static guint dissect_wlccp_mip_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti); + +static void set_mic_flag(gboolean flag); +static void set_tlv_flag(gboolean flag); +static gboolean get_tlv_flag(); +static gboolean get_mic_flag(); + +/* Initialize external dissector handles */ +/* We'll try to use the EAP dissector when necessary */ +static dissector_handle_t eap_handle; + + +/* Initialize some utlity variables */ +static gboolean mic_flag=0, tlv_flag=0; + /* Initialize the protocol and registered fields */ static int proto_wlccp = -1; static int hf_llc_wlccp_pid = -1; -static int hf_wlccp_version = -1; + static int hf_wlccp_dstmac = -1; static int hf_wlccp_srcmac = -1; static int hf_wlccp_hostname = -1; -static int hf_wlccp_sap = -1; +/* WLCCP Fixed header fields */ +static int hf_wlccp_version = -1; + +static int hf_wlccp_sap = -1; /* SAP Tree */ +static int hf_wlccp_sap_version = -1; +static int hf_wlccp_sap_id = -1; + static int hf_wlccp_destination_node_type = -1; static int hf_wlccp_length = -1; -static int hf_wlccp_type = -1; + +static int hf_wlccp_type = -1; /* Message Type Tree */ static int hf_wlccp_subtype = -1; -static int hf_wlccp_base_message_type = -1; +static int hf_wlccp_base_message_type_0 = -1; +static int hf_wlccp_base_message_type_1 = -1; +static int hf_wlccp_base_message_type_2 = -1; +static int hf_wlccp_base_message_type_3 = -1; +static int hf_wlccp_base_message_type_4 = -1; +static int hf_wlccp_base_message_type_5 = -1; +static int hf_wlccp_base_message_type_unknown = -1; + static int hf_wlccp_hops = -1; +static int hf_wlccp_nm_version = -1; + static int hf_wlccp_msg_id = -1; -static int hf_wlccp_flags = -1; + +static int hf_wlccp_flags = -1; /* Flags Tree */ +static int hf_wlccp_rm_flags = -1; static int hf_wlccp_retry_flag = -1; static int hf_wlccp_response_request_flag = -1; +static int hf_wlccp_ack_required_flag = -1; static int hf_wlccp_tlv_flag = -1; static int hf_wlccp_inbound_flag = -1; static int hf_wlccp_outbound_flag = -1; @@ -167,22 +491,174 @@ static int hf_wlccp_hopwise_routing_flag = -1; static int hf_wlccp_root_cm_flag = -1; static int hf_wlccp_relay_flag = -1; static int hf_wlccp_mic_flag = -1; +static int hf_wlccp_rm_request_reply_flag = -1; +static int hf_wlccp_rm_mic_flag = -1; + +static int hf_wlccp_originator = -1; /* Originator Tree */ static int hf_wlccp_originator_node_type = -1; -static int hf_wlccp_originator = -1; +/* static int hf_wlccp_originator_id = -1; */ + +static int hf_wlccp_responder = -1; /* Responder Tree */ static int hf_wlccp_responder_node_type = -1; -static int hf_wlccp_responder = -1; +/*static int hf_wlccp_responder_id = -1; */ + + +/* static int hf_wlccp_relay_node = -1;*/ /* Relay Node Tree */ static int hf_wlccp_relay_node_type = -1; static int hf_wlccp_relay_node_id = -1; + static int hf_wlccp_priority = -1; static int hf_wlccp_age = -1; static int hf_wlccp_period = -1; static int hf_wlccp_ipv4_address = -1; - +/*kan for apRegistration messages*/ +static int hf_wlccp_timestamp = -1; +static int hf_wlccp_apregstatus = -1; +static int hf_wlccp_ap_node_id = -1; +static int hf_wlccp_ap_node_type = -1; +static int hf_wlccp_ap_node_id_address = -1; +/*kan for nmPathInit messages */ +static int hf_wlccp_requ_node_type = -1; +static int hf_wlccp_requ_node_id = -1; +static int hf_wlccp_status = -1; +static int hf_wlccp_path_init_rsvd = -1; +/*kan - for cmAAA messages */ +static int hf_wlccp_aaa_msg_type = -1; +static int hf_wlccp_aaa_auth_type = -1; +static int hf_wlccp_keymgmt_type = -1; +/*kan - for cmAAA EAPOL messages */ +static int hf_wlccp_eapol_msg = -1; +static int hf_wlccp_eapol_version = -1; +static int hf_wlccp_eapol_type = -1; +static int hf_wlccp_eap_msg_length = -1; +static int hf_wlccp_eap_msg = -1; +/*kan - for cmAAA Proprietary message */ +static int hf_wlccp_cisco_acctg_msg = -1; +/*kan - for cmWIDS */ +static int hf_wlccp_wids_msg_type = -1; +/*kan - for nmConfigRequest and nmConfigReply */ +static int hf_wlccp_nmconfig = -1; + +static int hf_wlccp_scmstate_change = -1; +static int hf_wlccp_scmstate_change_reason = -1; + +static int hf_wlccp_scmattach_state = -1; +static int hf_wlccp_nmcapability = -1; +static int hf_wlccp_refresh_req_id = -1; + +static int hf_wlccp_tlv = -1; +static int hf_tlv_flags = -1; + +static int hf_wlccp_null_tlv = -1; + +static int hf_wlccp_tlv_type = -1; +static int hf_wlccp_tlv_type0 = -1; +static int hf_wlccp_tlv_type1 = -1; +static int hf_wlccp_tlv_type2 = -1; +static int hf_wlccp_tlv_type3 = -1; +static int hf_wlccp_tlv_type4 = -1; +static int hf_wlccp_tlv_type5 = -1; +static int hf_wlccp_tlv_group = -1; +static int hf_wlccp_tlv_container_flag = -1; +static int hf_wlccp_tlv_encrypted_flag = -1; +static int hf_wlccp_tlv_request_flag = -1; +static int hf_wlccp_tlv_reserved_bit = -1; +static int hf_wlccp_tlv_length = -1; + +/* static int hf_wlccp_tlv_value = -1; */ + +static int hf_wlccp_path_length = -1; +static int hf_wlccp_mic_msg_seq_count = -1; +static int hf_wlccp_mic_length = -1; +static int hf_wlccp_mic_value = -1; + +static int hf_wlccp_key_seq_count = -1; +static int hf_wlccp_dest_node_type = -1; +static int hf_wlccp_dest_node_id = -1; +static int hf_wlccp_supp_node_type = -1; +static int hf_wlccp_supp_node_id = -1; +static int hf_wlccp_key_mgmt_type = -1; +static int hf_wlccp_nonce = -1; +static int hf_wlccp_session_timeout = -1; +static int hf_wlccp_src_node_type = -1; +static int hf_wlccp_src_node_id = -1; +static int hf_wlccp_token = -1; +static int hf_wlccp_mode = -1; +static int hf_wlccp_scan_mode = -1; +static int hf_wlccp_rss = -1; +static int hf_wlccp_srcidx = -1; +static int hf_wlccp_parent_tsf = -1; +static int hf_wlccp_target_tsf = -1; + +static int hf_wlccp_channel = -1; +static int hf_wlccp_phy_type = -1; +static int hf_wlccp_bssid = -1; +static int hf_wlccp_beacon_interval = -1; +/* static int hf_wlccp_capabilities = -1; */ +static int hf_wlccp_tlv80211 = -1; +static int hf_wlccp_duration = -1; +static int hf_wlccp_rpidensity = -1; +static int hf_wlccp_ccabusy = -1; +static int hf_wlccp_sta_type = -1; +static int hf_wlccp_stamac = -1; +static int hf_wlccp_token2 = -1; +static int hf_wlccp_interval = -1; +static int hf_wlccp_count = -1; +static int hf_framereport_elements = -1; +static int hf_wlccp_numframes = -1; +static int hf_wlccp_mfpcapability = -1; +static int hf_wlccp_mfpflags = -1; +static int hf_wlccp_mfpconfig = -1; +static int hf_wlccp_clientmac = -1; +static int hf_time_elapsed = -1; +static int hf_wlccp_parent_ap_mac = -1; +static int hf_wlccp_auth_type =-1; +static int hf_reg_lifetime = -1; +static int hf_wlccp_radius_user_name = -1; +static int hf_wds_reason = -1; + + +static int hf_wlccp_80211_capabilities = -1; +static int hf_80211_cap_ess = -1; +static int hf_80211_cap_ibss = -1; +static int hf_80211_cap_cf_pollable = -1; +static int hf_80211_cap_cf_poll_req = -1; +static int hf_80211_cap_privacy = -1; +static int hf_80211_short_preamble = -1; +static int hf_80211_pbcc = -1; +static int hf_80211_chan_agility = -1; +static int hf_80211_spectrum_mgmt = -1; +static int hf_80211_qos = -1; +static int hf_80211_short_time_slot = -1; +static int hf_80211_apsd = -1; +static int hf_80211_reserved = -1; +static int hf_80211_dsss_ofdm = -1; +static int hf_80211_dlyd_block_ack = -1; +static int hf_80211_imm_block_ack = -1; + + +static int hf_wlccp_tlv_unknown_value = -1; /* Initialize the subtree pointers */ static gint ett_wlccp = -1; +static gint ett_wlccp_sap_tree = -1; static gint ett_wlccp_type = -1; +static gint ett_wlccp_cm_flags = -1; +static gint ett_wlccp_rm_flags = -1; +static gint ett_wlccp_nm_flags = -1; + + static gint ett_wlccp_flags = -1; +static gint ett_wlccp_ap_node_id = -1; +static gint ett_wlccp_eapol_msg_tree = -1; +static gint ett_wlccp_eap_tree = -1; +static gint ett_wlccp_tlv_tree = -1; +static gint ett_tlv_flags_tree = -1; +static gint ett_tlv_sub_tree = -1; +static gint ett_80211_capability_flags_tree = -1; +static gint ett_framereport_elements_tree = -1; + + /* Code to actually dissect the packets */ static void @@ -190,36 +666,119 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; - proto_tree *wlccp_tree, *wlccp_type_tree, *wlccp_flags_tree; - gboolean relay_flag; - guint8 version; - guint16 type, flags; + proto_tree *wlccp_tree, *wlccp_sap_tree, *wlccp_type_tree; + guint offset = 0; - /* Make entries in Protocol column and Info column on summary display */ - if (check_col(pinfo->cinfo, COL_PROTOCOL)) - col_set_str(pinfo->cinfo, COL_PROTOCOL, "WLCCP"); + guint8 version=0, sap=0, sap_id=0, sap_version=0; - if (check_col(pinfo->cinfo, COL_INFO)) { - if(tvb_get_guint8(tvb, 0) == 0xC1) { /* Get the version number */ + guint16 type; + guint8 base_message_type=0, message_sub_type=0; - col_add_fstr(pinfo->cinfo, COL_INFO, "%s (%s)", - val_to_str(tvb_get_guint8(tvb, 6) & 63, - wlccp_msg_type_vs, "Unknown"), - val_to_str((tvb_get_guint8(tvb, 6)>>6) & 3, - wlccp_subtype_vs, "Unknown")); - } else { - col_add_str(pinfo->cinfo, COL_INFO, "WLCCP frame"); - } - } + /* Make entries in Protocol column and Info column on summary display */ + if (check_col(pinfo->cinfo, COL_PROTOCOL)) + col_set_str(pinfo->cinfo, COL_PROTOCOL, "WLCCP"); - if (tree) { + if (check_col(pinfo->cinfo, COL_INFO)) + { + if(tvb_get_guint8(tvb, 0) == 0xC1) /* Get the version number */ + { + + sap_version = (tvb_get_guint8(tvb,1) & SAP_VERSION_MASK) >> 6; + sap_id = tvb_get_guint8(tvb,1) & SAP_VALUE_MASK; + base_message_type=(tvb_get_guint8(tvb,6)) & MT_BASE_MSG_TYPE; + message_sub_type=(tvb_get_guint8(tvb, 6) & MT_SUBTYPE ) >> 6; + + + switch (sap_id) + { + + case WLCCP_SAP_CCM: + { + + col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", + val_to_str(base_message_type, wlccp_msg_type_vs_0, "Unknown"), + val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown") + ); + break; + + } /* case WLCCP_SAP_CCM */ + + case WLCCP_SAP_SEC: + { + + col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", + val_to_str(base_message_type, wlccp_msg_type_vs_1, "Unknown"), + val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown") + ); + break; + } /* case WLCCP_SAP_SEC */ + + case WLCCP_SAP_RRM: + { + col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", + val_to_str(base_message_type, wlccp_msg_type_vs_2, "Unknown"), + val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown") + ); + break; + + } /* case WLCCP_SAP_RRM */ + + case WLCCP_SAP_QOS: + { + col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", + val_to_str(base_message_type, wlccp_msg_type_vs_3, "Unknown"), + val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown") + ); + break; + } /* case WLCCP_SAP_QOS */ + + case WLCCP_SAP_NM: + { + col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", + val_to_str(base_message_type, wlccp_msg_type_vs_4, "Unknown"), + val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown") + ); + break; + + } /* case WLCCP_SAP_NM */ + + case WLCCP_SAP_MIP: + { + col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", + val_to_str(base_message_type, wlccp_msg_type_vs_5, "Unknown"), + val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown") + ); + break; + } /* case WLCCP_SAP_MIP */ + + default: + { + col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %-27s SubType: %s", + "Unknown", + val_to_str(message_sub_type, wlccp_subtype_vs, "Unknown") + ); + break; + } /* default for switch sap */ + + + } /* switch sap */ + + } /* if version=0xC1 (tvb_get_guint8(tvb, 0) == 0xC1)*/ + + } /* if check_col */ + + if (tree) + +{ /* create display subtree for the protocol */ ti = proto_tree_add_item(tree, proto_wlccp, tvb, 0, -1, FALSE); wlccp_tree = proto_item_add_subtree(ti, ett_wlccp); proto_tree_add_item(wlccp_tree, hf_wlccp_version, tvb, offset, 1, FALSE); + + /* interpretation of the packet is determined by WLCCP version */ version = tvb_get_guint8(tvb, 0); offset += 1; @@ -230,7 +789,7 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(wlccp_tree, hf_wlccp_type, tvb, 2, 2, FALSE); type = tvb_get_ntohs(tvb, 2); - + proto_tree_add_item(wlccp_tree, hf_wlccp_dstmac, tvb, 4, 6, FALSE); @@ -243,127 +802,2128 @@ dissect_wlccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(wlccp_tree, hf_wlccp_hostname, tvb, 44, 28, FALSE); - } - } + } /* if type = 0x4081 */ + } /* if version == 0x00 */ + + if(version == 0xC1) + { + + { /* SAP Field */ + ti = proto_tree_add_item(wlccp_tree, hf_wlccp_sap, + tvb, offset, 1, FALSE); + wlccp_sap_tree = proto_item_add_subtree(ti, ett_wlccp_sap_tree); + + proto_tree_add_item(wlccp_sap_tree, hf_wlccp_sap_version, + tvb, offset, 1, FALSE); - if(version == 0xC1) { - proto_tree_add_item(wlccp_tree, hf_wlccp_sap, + proto_tree_add_item(wlccp_sap_tree, hf_wlccp_sap_id, tvb, offset, 1, FALSE); + + sap = tvb_get_guint8(tvb,offset); + sap_version = (tvb_get_guint8(tvb,offset) & SAP_VERSION_MASK) >> 6; + sap_id = tvb_get_guint8(tvb,offset) & SAP_VALUE_MASK; + offset += 1; + } /* SAP Field */ + proto_tree_add_item(wlccp_tree, hf_wlccp_destination_node_type, tvb, offset, 2, FALSE); offset += 2; - + proto_tree_add_item(wlccp_tree, hf_wlccp_length, tvb, offset, 2, FALSE); offset += 2; + + { /* Message Type Field */ ti = proto_tree_add_item(wlccp_tree, hf_wlccp_type, tvb, offset, 1, FALSE); + wlccp_type_tree = proto_item_add_subtree(ti, ett_wlccp_type); proto_tree_add_item(wlccp_type_tree, hf_wlccp_subtype, tvb, offset, 1, FALSE); - proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type, - tvb, offset, 1, FALSE); - offset += 1; - proto_tree_add_item(wlccp_tree, hf_wlccp_hops, - tvb, offset, 1, FALSE); + switch (sap_id) + { + + case WLCCP_SAP_CCM: + { + + proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_0, + tvb, offset, 1, FALSE); + + break; + + } /* case WLCCP_SAP_CCM */ + + case WLCCP_SAP_SEC: + { + proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_1, + tvb, offset, 1, FALSE); + + break; + + } /* case WLCCP_SAP_SEC */ + + case WLCCP_SAP_RRM: + { + proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_2, + tvb, offset, 1, FALSE); + + break; + + } /* case WLCCP_SAP_RRM */ + + case WLCCP_SAP_QOS: + { + proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_3, + tvb, offset, 1, FALSE); + + break; + + } /* case WLCCP_SAP_QOS */ + + case WLCCP_SAP_NM: + { + proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_4, + tvb, offset, 1, FALSE); + + break; + + } /* case WLCCP_SAP_NM */ + + case WLCCP_SAP_MIP: + { + proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_5, + tvb, offset, 1, FALSE); + + break; + + } /* case WLCCP_SAP_MIP */ + + default: + { + + proto_tree_add_item(wlccp_type_tree, hf_wlccp_base_message_type_unknown, + tvb, offset, 1, FALSE); + + break; + + } /* default for switch sap */ + + } /* switch sap */ + + base_message_type=(tvb_get_guint8(tvb,offset) & MT_BASE_MSG_TYPE ); + message_sub_type=((tvb_get_guint8(tvb,offset) & MT_SUBTYPE ) >> 6 ); + offset += 1; + } /* Message Type Field */ - proto_tree_add_item(wlccp_tree, hf_wlccp_msg_id, - tvb, offset, 2, FALSE); - offset += 2; + /* after the Message Type Field things change based on SAP and Message Type */ - ti = proto_tree_add_item(wlccp_tree, hf_wlccp_flags, - tvb, offset, 2, FALSE); - flags = tvb_get_ntohs(tvb, offset); - wlccp_flags_tree = proto_item_add_subtree(ti, ett_wlccp_flags); + set_mic_flag(FALSE); + set_tlv_flag(FALSE); - proto_tree_add_item(wlccp_flags_tree, hf_wlccp_retry_flag, - tvb, offset, 2, FALSE); + switch (sap_id) + { - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_response_request_flag, - tvb, offset, 2, FALSE); + case WLCCP_SAP_CCM: + { - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_tlv_flag, - tvb, offset, 2, FALSE); + offset = dissect_wlccp_ccm_msg(wlccp_tree, tvb, offset, base_message_type); + + break; - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_inbound_flag, - tvb, offset, 2, FALSE); + } /* case WLCCP_SAP_CCM */ - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_outbound_flag, - tvb, offset, 2, FALSE); + case WLCCP_SAP_SEC: + { - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_hopwise_routing_flag, - tvb, offset, 2, FALSE); + offset = dissect_wlccp_sec_msg(wlccp_tree, tvb, offset, base_message_type); - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_root_cm_flag, - tvb, offset, 2, FALSE); + break; - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_relay_flag, - tvb, offset, 2, FALSE); - relay_flag = (tvb_get_ntohs(tvb, offset)>>8) & 1; + } /* case WLCCP_SAP_SEC */ - proto_tree_add_item(wlccp_flags_tree, - hf_wlccp_mic_flag, - tvb, offset, 2, FALSE); - offset += 2; + case WLCCP_SAP_RRM: + { - proto_tree_add_item(wlccp_tree, hf_wlccp_originator_node_type, - tvb, offset, 2, FALSE); - offset += 2; + offset = dissect_wlccp_rrm_msg(wlccp_tree, tvb, offset, base_message_type); - proto_tree_add_item(wlccp_tree, hf_wlccp_originator, - tvb, offset, 6, FALSE); - offset += 6; + break; - proto_tree_add_item(wlccp_tree, hf_wlccp_responder_node_type, - tvb, offset, 2, FALSE); - offset += 2; + } /* case WLCCP_SAP_RRM */ - proto_tree_add_item(wlccp_tree, hf_wlccp_responder, - tvb, offset, 6, FALSE); - offset += 6; + case WLCCP_SAP_QOS: + { - offset += 6; /* Skip over MAC address of sender again */ + offset = dissect_wlccp_qos_msg(wlccp_tree, tvb, offset, base_message_type); - if(relay_flag) { - proto_tree_add_item(wlccp_tree, hf_wlccp_relay_node_type, - tvb, offset, 2, FALSE); - offset += 2; + break; - proto_tree_add_item(wlccp_tree, hf_wlccp_relay_node_id, - tvb, offset, 6, FALSE); - offset += 6; - } + } /* case WLCCP_SAP_QOS */ - if(flags == 0x2800) { /* We have extra information at the end of the frame */ - proto_tree_add_item(wlccp_tree, hf_wlccp_priority, - tvb, 38, 1, FALSE); + case WLCCP_SAP_NM: + { - proto_tree_add_item(wlccp_tree, hf_wlccp_age, - tvb, 48, 4, FALSE); + offset = dissect_wlccp_nm_msg(wlccp_tree, tvb, offset, base_message_type); - proto_tree_add_item(wlccp_tree, hf_wlccp_period, - tvb, 55, 1, FALSE); + break; - proto_tree_add_item(wlccp_tree, hf_wlccp_ipv4_address, - tvb, 76, 4, FALSE); + } /* case WLCCP_SAP_NM */ - } - } + case WLCCP_SAP_MIP: + { + + offset = dissect_wlccp_mip_msg(wlccp_tree, tvb, offset, base_message_type); + + break; + + } /* case WLCCP_SAP_MIP */ + + default: + { + /* what should we do if we get an undefined SAP? */ + + break; + + } /* default for switch sap */ + + } /* switch sap */ + + + + if(get_tlv_flag() || get_mic_flag()) + { + + if (tvb_length_remaining(tvb,offset) < 4) + { + /* something is wrong if the TLV flag is set and there's not enough left in the buffer */ + + /* proto_tree_add_string(wlccp_tree, NULL, tvb, offset, -1, "MIC Flag=%d and TLV Flag=%d, but no data left to decode."); */ + + } /* if bytes_left <=0 */ + else + { + + while (tvb_length_remaining(tvb,offset) >= 4) + { + + offset = dissect_wlccp_tlvs(wlccp_tree, tvb, offset, 0); + + } /* while bytes_left */ + +; + } /*else bytes_left < 4 */ + + } /* if tlv_flag || mic_flag */ + + } /* if version == 0xC1 */ + + } /* if tree */ + +} /* dissect_wlccp */ + + +/*******************************************************************************************/ + +/* some utility functions */ + +/* these could be implemented with a struct */ + +static void set_mic_flag(gboolean flag) +{ + mic_flag=flag; +} /*set_mic_flag */ + +static void set_tlv_flag(gboolean flag) +{ + tlv_flag=flag; +} /* set_tlv_flag */ + +static gboolean get_tlv_flag() +{ + return(tlv_flag); +} /* get_tlv_flag */ + +static gboolean get_mic_flag() +{ + return(mic_flag); +} /* get_mic_flag */ + +/*******************************************************************************************/ + +static guint dissect_wlccp_ccm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type) +{ + proto_item *_ti; + proto_tree *_wlccp_eapol_msg_tree, *_wlccp_cm_flags_tree; + + gboolean _relay_flag=0, _mic_flag=0, _tlv_flag=0; + guint8 _aaa_msg_type=0, _eapol_type=0; + guint16 _eap_msg_length=0; + + proto_tree_add_item(_tree, hf_wlccp_hops, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_msg_id, + _tvb, _offset, 2, FALSE); + _offset += 2; + + +/* Decode the CM Flags Field */ + + _ti = proto_tree_add_item(_tree, hf_wlccp_flags, + _tvb, _offset, 2, FALSE); + _wlccp_cm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_cm_flags); + + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_retry_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_response_request_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_tlv_flag, + _tvb, _offset, 2, FALSE); + _tlv_flag = (tvb_get_ntohs(_tvb, _offset)>>13) & 1; + set_tlv_flag(_tlv_flag); + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_inbound_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_outbound_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_hopwise_routing_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_root_cm_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_relay_flag, + _tvb, _offset, 2, FALSE); + _relay_flag = (tvb_get_ntohs(_tvb, _offset)>>8) & 1; + + proto_tree_add_item(_wlccp_cm_flags_tree, hf_wlccp_mic_flag, + _tvb, _offset, 2, FALSE); + _mic_flag = (tvb_get_ntohs(_tvb, _offset)>>7) & 1; + set_mic_flag(_mic_flag); + + _offset += 2; + +/* End Decode the CM Flags Field */ + + + proto_tree_add_item(_tree, hf_wlccp_originator_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_originator, + _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_responder_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_responder, + _tvb, _offset, 6, FALSE); + _offset += 6; + + if(_relay_flag) + { + proto_tree_add_item(_tree, hf_wlccp_relay_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_relay_node_id, + _tvb, _offset, 6, FALSE); + _offset += 6; + + } /* if _relay_flag */ + + + switch (_base_message_type) + { + + case 0x01: + { + + break; + } /* case 0x01 */ + + case 0x02: + { + + break; + } /* case 0x02 */ + + case 0x03: + { + + break; + } /* case 0x03 */ + + case 0x04: + { + + break; + } /* case 0x04 */ + + case 0x05: + { + + break; + } /* case 0x05 */ + + case 0x06: + { + + break; + } /* case 0x06 */ + + case 0x07: + { + + break; + } /* case 0x07 */ + + case 0x08: + { + + break; + } /* case 0x08 */ + + case 0x09: + { + + break; + } /* case 0x09 */ + + case 0x0a: + { + + break; + } /* case 0x0a */ + + case 0x0b: /* cmAAA */ + { + proto_tree_add_item(_tree, hf_wlccp_requ_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_requ_node_id, + _tvb, _offset, 6, FALSE); + _offset += 6; + + /*kan - according to the patent applicatoin these fields vary based + on one another. + For now we decode what we know about and then we'll come back and add + the rest */ + + proto_tree_add_item(_tree, hf_wlccp_aaa_msg_type, + _tvb, _offset, 1, FALSE); + _aaa_msg_type=tvb_get_guint8(_tvb,_offset); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_aaa_auth_type, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_keymgmt_type, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_status, + _tvb, _offset, 1, FALSE); + _offset += 1; + +/* kan - I'm pretty sure this EAPOL tree only applies sometimes, but it's the only complete example that I have +to test against for now. +For that matter, it may be possible to just hand this piece of the packet over to the EAPOL dissector and let it +handle things. To be investigated further */ + + if (_aaa_msg_type == 0x2) /*EAPOL*/ + { + _ti = proto_tree_add_item(_tree, hf_wlccp_eapol_msg, + _tvb, _offset, 6, FALSE); + + _wlccp_eapol_msg_tree = proto_item_add_subtree( + _ti, ett_wlccp_eapol_msg_tree); + + +/* THIS NEEDS TO BE CHECKED */ + /*kan - skip some unknown bytes */ + _offset += 2; + + proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eapol_version, + _tvb, _offset, 1, FALSE); + + _offset += 1; + + proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eapol_type, + _tvb, _offset, 1, FALSE); + _eapol_type=tvb_get_guint8(_tvb, _offset); + _offset += 1; + + if (_eapol_type == 0) + { + proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eap_msg_length, + _tvb, _offset, 2, FALSE); + _eap_msg_length=tvb_get_ntohs(_tvb, _offset); + _offset += 2; + + proto_tree_add_item(_wlccp_eapol_msg_tree, hf_wlccp_eap_msg, + _tvb, _offset, _eap_msg_length, FALSE); + _offset += _eap_msg_length; + + } /* if _eapol_type == 0 */ + + } /* if _aaa_msg_type ==0x2 */ + + if (_aaa_msg_type == 0x3) /*Cisco proprietary message*/ + { + proto_tree_add_item(_tree, hf_wlccp_cisco_acctg_msg, + _tvb, _offset, -1, FALSE); + } /* if aaa_msg_type == 0x3 */ + + break; + } /* case 0x0b */ + + case 0x0c: /* cmPathInit */ + { + proto_tree_add_item(_tree, hf_wlccp_requ_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_requ_node_id, + _tvb, _offset, 6, FALSE); + _offset += 6; + + /*kan - there's a reserved alignment byte right here*/ + proto_tree_add_item(_tree, hf_wlccp_path_init_rsvd, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_status, + _tvb, _offset, 1, FALSE); + _offset +=1; + + break; + } /* case 0x0c */ + + case 0x0f: /* cmWIDS */ + { + proto_tree_add_item(_tree, hf_wlccp_wids_msg_type, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_status, + _tvb, _offset, 1, FALSE); + _offset +=1; + + break; + } /* case 0x0f */ + + default: + { + + break; + } /* default for switch _base_message_type */ + + } /* switch _base_message_type */ + + + return(_offset); +} /* dissect_wlccp_ccm_msg */ + +static guint dissect_wlccp_sec_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type) +{ + +/* at the momemt we have no more data to use to write this dissector code */ +/* it's just a place holder for now */ + + switch (_base_message_type) + { + + case 0x01: + { + + break; + } /* case 0x01 */ + + default: + { + + break; + } /* default for switch _base_message_type */ + + } /* switch _base_message_type */ + + + + return(_offset); + +} /* dissect_wlccp_sec_msg */ + +static guint dissect_wlccp_rrm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type) +{ + + proto_tree *_wlccp_rm_flags_tree; + proto_item *_ti; + + gboolean _mic_flag=0; + + + +/* Decode the RM Flags Field */ + + _ti = proto_tree_add_item(_tree, hf_wlccp_rm_flags, + _tvb, _offset, 1, FALSE); + + _wlccp_rm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_rm_flags); + + proto_tree_add_item(_wlccp_rm_flags_tree, hf_wlccp_rm_mic_flag, + _tvb, _offset, 1, FALSE); + + _mic_flag = (tvb_get_guint8(_tvb, _offset) & RM_F_MIC) >> 1; + + set_mic_flag(_mic_flag); + + set_tlv_flag(TRUE); + + proto_tree_add_item(_wlccp_rm_flags_tree, hf_wlccp_rm_request_reply_flag, + _tvb, _offset, 1, FALSE); + + _offset += 1; + +/* End Decode the RM Flags Field */ + + proto_tree_add_item(_tree, hf_wlccp_msg_id, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_originator_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_originator, + _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_responder_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_responder, + _tvb, _offset, 6, FALSE); + _offset += 6; + + + switch (_base_message_type) + { + + case 0x01: /* rmReq */ + { + break; + } /* case 0x01 */ + + case 0x02: /* rmReqRoutingResp */ + { + break; + } /* case 0x01 */ + + case 0x03: /* rmReport */ + { + break; + } /* case 0x01 */ + + default: + { + + break; + } /* default for switch _base_message_type */ + + } /* switch _base_message_type */ + + + return(_offset); + +} /* dissect_wlccp_rrm_msg */ + + + +static guint dissect_wlccp_qos_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type) +{ +/* at the momemt we have no more data to use to write this dissector code */ +/* it's just a place holder for now */ + + + switch (_base_message_type) + { + + case 0x01: + { + + break; + } /* case 0x01 */ + + default: + { + + break; + } /* default for switch _base_message_type */ + + } /* switch _base_message_type */ + + + return(_offset); + +} /* dissect_wlccp_qos_msg */ + + +static guint dissect_wlccp_nm_msg(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint8 _base_message_type) +{ + proto_item *_ti; + proto_tree *_wlccp_ap_node_id_tree, *_wlccp_nm_flags_tree; + + gboolean _mic_flag=0, _tlv_flag=0; + + + proto_tree_add_item(_tree, hf_wlccp_nm_version, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_msg_id, + _tvb, _offset, 2, FALSE); + _offset += 2; + + +/* Decode the NM Flags Field */ + + _ti = proto_tree_add_item(_tree, hf_wlccp_flags, + _tvb, _offset, 2, FALSE); + _wlccp_nm_flags_tree = proto_item_add_subtree(_ti, ett_wlccp_nm_flags); + + + proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_retry_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_ack_required_flag, + _tvb, _offset, 2, FALSE); + + proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_tlv_flag, + _tvb, _offset, 2, FALSE); + _tlv_flag = (tvb_get_ntohs(_tvb, _offset)>>13) & 1; + set_tlv_flag(_tlv_flag); + + proto_tree_add_item(_wlccp_nm_flags_tree, hf_wlccp_mic_flag, + _tvb, _offset, 2, FALSE); + _mic_flag = (tvb_get_ntohs(_tvb, _offset)>>7) & 1; + set_mic_flag(_mic_flag); + + _offset += 2; + +/* End Decode the NM Flags Field */ + + + proto_tree_add_item(_tree, hf_wlccp_originator_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_originator, + _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_responder_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_responder, + _tvb, _offset, 6, FALSE); + _offset += 6; + + + switch (_base_message_type) + { + + case 0x01: /* nmAck */ + { + break; + } /* case 0x01 */ + + case 0x10: /* nmConfigRequest */ + { + proto_tree_add_item(_tree, hf_wlccp_nmconfig, + _tvb, _offset, 1, FALSE); + _offset += 1; + + /* kan - there appears to be some padding or other unknowns here */ + _offset += 3; + + break; + } /* case 0x10 */ + + case 0x11: /* nmConfigReply */ + { + proto_tree_add_item(_tree, hf_wlccp_nmconfig, + _tvb, _offset, 1, FALSE); + _offset += 1; + + /* kan - there appears to be some padding or other unknowns here */ + _offset += 3; + + break; + } /* case 0x11 */ + + case 0x20: /* nmApRegistration */ + { + proto_tree_add_item(_tree, hf_wlccp_timestamp, + _tvb, _offset, 8, FALSE); + _offset += 8; + + proto_tree_add_item(_tree, hf_wlccp_apregstatus, + _tvb, _offset, 1, FALSE); + _offset += 1; + + _offset += 3; /*kan - skip some apparently unused bytes */ + + _ti = proto_tree_add_item(_tree, hf_wlccp_ap_node_id, + _tvb, _offset, 8, FALSE); + + _wlccp_ap_node_id_tree = proto_item_add_subtree( + _ti, ett_wlccp_ap_node_id); + + proto_tree_add_item(_wlccp_ap_node_id_tree, hf_wlccp_ap_node_type, + _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_wlccp_ap_node_id_tree, hf_wlccp_ap_node_id_address, + _tvb, _offset, 6, FALSE); + _offset += 6; + + break; + } /* case 0x20 */ + + case 0x21: /* nmScmStateChange */ + { + proto_tree_add_item(_tree, hf_wlccp_timestamp, + _tvb, _offset, 8, FALSE); + _offset += 8; + + proto_tree_add_item(_tree, hf_wlccp_scmstate_change, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_scmstate_change_reason, + _tvb, _offset, 1, FALSE); + _offset += 1; + + /*kan - skip some apparently unused bytes */ + _offset += 2; + + break; + } /* case 0x21 */ + + case 0x22: /* nmScmKeepActive */ + { + proto_tree_add_item(_tree, hf_wlccp_scmattach_state, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_nmconfig, + _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_nmcapability, + _tvb, _offset, 1, FALSE); + _offset += 1; + + /*kan - skip some apparently unused bytes */ + _offset += 1; + + break; + } /* case 0x22 */ + + case 0x30: /* nmClientEventReport */ + { + proto_tree_add_item(_tree, hf_wlccp_timestamp, + _tvb, _offset, 8, FALSE); + _offset += 8; + + break; + } /* case 0x30 */ + + case 0x31: /* nmAllClientRefreshRequest */ + { + proto_tree_add_item(_tree, hf_wlccp_refresh_req_id, + _tvb, _offset, 4, FALSE); + _offset += 4; + + break; + } /* case 0x31 */ + + default: + { + + break; + } /* default for switch _base_message_type */ + + } /* switch _base_message_type */ + + + + return(_offset); + +} /* dissect_wlccp_nm_msg */ + +static guint dissect_wlccp_mip_msg(proto_tree *_tree _U_, tvbuff_t *_tvb _U_, guint _offset, guint8 _base_message_type) +{ +/* at the momemt we have no more data to use to write this dissector code */ +/* it's just a place holder for now */ + + switch (_base_message_type) + { + + case 0x01: + { + + break; + } /* case 0x01 */ + + default: + { + + break; + } /* default for switch _base_message_type */ + + } /* switch _base_message_type */ + + return(_offset); + +} /* dissect_wlccp_mip_msg */ + + +/***************************************************************************************************/ + +static guint dissect_wlccp_tlvs( proto_tree *_tree, tvbuff_t *_tvb, guint _offset, guint _depth) +{ + + proto_item *_ti, *_temp_ti; + proto_tree *_tlv_tree; + proto_tree *_tlv_flags_tree; + + gboolean _container_flag=0, _request_flag=0; + gint _group_id=0, _type_id=0; + guint _length=0; + guint _tlv_end=0; + + + + /* the TLV length is 2 bytes into the TLV, and we need it now */ + _length = tvb_get_ntohs(_tvb,_offset+2); + + /* figure out where the end of this TLV is so we know when to stop dissecting it */ + _tlv_end = _offset + _length; + + /* this TLV is _length bytes long */ + _ti = proto_tree_add_item(_tree, hf_wlccp_tlv, _tvb, _offset, _length, FALSE); + /* create the TLV sub tree */ + _tlv_tree = proto_item_add_subtree(_ti, ett_wlccp_tlv_tree); + + /* save the pointer because we'll add some text to it later */ + _temp_ti = _ti; + + + + /* add an arbitrary safety factor in case we foul up the dissector recursion */ + if (_depth > 1000) + { + return(tvb_length(_tvb)); } -} + + /* add the flags field to the tlv_tree */ + _ti = proto_tree_add_item(_tlv_tree, hf_tlv_flags, _tvb, _offset, 2, FALSE); + _tlv_flags_tree = proto_item_add_subtree(_ti, ett_tlv_flags_tree); + + /* + first 2 bytes are the flags, Group and Type + bit 0 = container, + bit 1 = encrypted, + bits 2-3 = reserved, + bits 4-7 = group ID, + bit 5 = request, + bits 9-15 = type ID + */ + + + /* the TLV group and type IDs are contained in the flags field, extract them */ + _group_id = (tvb_get_ntohs(_tvb,_offset) & TLV_GROUP_ID) >> 8; + _type_id = (tvb_get_ntohs(_tvb,_offset) & TLV_TYPE_ID); + + /* add the flags to the tree */ + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_container_flag, _tvb, _offset, 2, FALSE); + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_encrypted_flag, _tvb, _offset, 2, FALSE); + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_reserved_bit, _tvb, _offset, 2, FALSE); + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_group, _tvb, _offset, 2, FALSE); + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_request_flag, _tvb, _offset, 2, FALSE); + + /* a hack to show the right string representation of the type_id in the tree */ + switch (_group_id) + { + case WLCCP_TLV_GROUP_WLCCP: + { + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type0, _tvb, _offset, 2, FALSE); + break; + } /* case WLCCP_TLV_GROUP_WLCCP */ + + case WLCCP_TLV_GROUP_SEC: + { + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type1, _tvb, _offset, 2, FALSE); + break; + } /* case WLCCP_TLV_GROUP_SEC */ + + case WLCCP_TLV_GROUP_RRM: + { + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type2, _tvb, _offset, 2, FALSE); + break; + } /* case WLCCP_TLV_GROUP_RRM */ + + case WLCCP_TLV_GROUP_QOS: + { + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type3, _tvb, _offset, 2, FALSE); + break; + } /* case WLCCP_TLV_GROUP_QOS */ + + case WLCCP_TLV_GROUP_NM: + { + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type4, _tvb, _offset, 2, FALSE); + break; + } /* case WLCCP_TLV_GROUP_NM */ + + case WLCCP_TLV_GROUP_MIP: + { + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type5, _tvb, _offset, 2, FALSE); + break; + } /* case WLCCP_TLV_GROUP_MIP */ + + default: + { + proto_tree_add_item(_tlv_flags_tree, hf_wlccp_tlv_type, _tvb, _offset, 2, FALSE); + break; + } /* case default for switch _group_id */ + + + } /* switch _group_id */ + + _container_flag = (tvb_get_ntohs(_tvb, _offset) & TLV_F_CONTAINER) >> 15; + + /* according to the patent, some behavior changes if the request flag is set */ + /* it would be nice if it said how, but I don't think it matters for decoding purposes */ + + _request_flag = tvb_get_ntohs(_tvb, _offset) & TLV_F_REQUEST >> 7; + + _offset += 2; + + /* finished with the flags field */ + + /* add the length field to the tlv_tree */ + proto_tree_add_item(_tlv_tree, hf_wlccp_tlv_length, _tvb, _offset, 2, FALSE); + + _offset += 2; + /* finished with the length field */ + + /* now decode the fixed fields in each TLV */ + + switch (_group_id) + { + case WLCCP_TLV_GROUP_WLCCP: + { + _offset = dissect_wlccp_ccm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length, _temp_ti); + break; + + } /* case WLCCP_TLV_GROUP_WLCCP */ + + case WLCCP_TLV_GROUP_SEC: + { + _offset = dissect_wlccp_sec_tlv(_tlv_tree, _tvb, _offset, _type_id, _length, _temp_ti); + break; + + } /* case WLCCP_TLV_GROUP_SEC */ + + case WLCCP_TLV_GROUP_RRM: + { + _offset = dissect_wlccp_rrm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length, _temp_ti); + break; + + } /* case WLCCP_TLV_GROUP_RRM */ + + case WLCCP_TLV_GROUP_QOS: + { + _offset = dissect_wlccp_qos_tlv(_tlv_tree, _tvb, _offset, _type_id, _length, _temp_ti); + break; + + } /* case WLCCP_TLV_GROUP_QOS */ + + case WLCCP_TLV_GROUP_NM: + { + _offset = dissect_wlccp_nm_tlv(_tlv_tree, _tvb, _offset, _type_id, _length, _temp_ti); + break; + + } /* case WLCCP_TLV_GROUP_NM */ + + case WLCCP_TLV_GROUP_MIP: + { + _offset = dissect_wlccp_mip_tlv(_tlv_tree, _tvb, _offset, _type_id, _length, _temp_ti); + break; + + } /* case WLCCP_TLV_GROUP_MIP */ + + default: + { + break; + } /* case default for switch _group_id */ + + } /* switch _group_id */ + + /* done with decoding the fixed TLV fields */ + + + + /* If this TLV is a container, then build a sub tree and decode the contained TLVs */ + + if (_container_flag && (_offset >= _tlv_end) ) + { + /* something is wrong if there's not enough left in the buffer */ + + } /* if container_flag and _offset >= _tlv_end */ + else /* _container_flag && _offset >= tlv_end */ + { + + if (_container_flag && (_offset < _tlv_end) ) + { + + while (_offset < _tlv_end) + { + + _offset = dissect_wlccp_tlvs(_tlv_tree, _tvb, _offset, _depth++); + + } /* while bytes_left >= 4*/ + + } /* _container_flag && (tvb_length_remaining(_tvb,_offset) >= 4) */ + + } /*_container_flag && (tvb_length_remaining(_tvb,_offset) < 4) */ + + + /* done with decoding the contained TLVs */ + + return(_offset ); + +} /* dissect_wlccp_tlvs */ + + +/* ************************************************************************************************************* */ + +/* ALL THE TLV SUB-DISSECTORS NEED A DEFAULT CASE, OTHERWISE WE'LL GET INTO AN INFINITE RECURSION LOOP INSIDE */ +/* THE CALLING FUNCTION dissect_wlccp_tlvs. BESIDES, IT'S JUST GOOD FORM :-) */ + + +static guint dissect_wlccp_ccm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) +{ + + switch (_type_id) + { + + case 0x00: /* NULL TLV */ + { + proto_item_append_text(_ti, " NULL TLV"); + proto_tree_add_item(_tree, hf_wlccp_null_tlv , _tvb, _offset, _length, FALSE); + _offset += _length; + + break; + + } /* case tlv_type_id = 0x09 */ + + + case 0x09: /* ipv4Address */ + { + proto_item_append_text(_ti, " IPv4Address"); + proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, FALSE); + _offset += 4; + + break; + + } /* case tlv_type_id = 0x09 */ + + + default: + { + /* for unknown types, just add them to the tree as a blob */ + proto_item_append_text(_ti, " Unknown"); + + proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length-4, FALSE); + _offset += _length-4; + + break; + } /* case default for tlv_group_id=0x00 */ + + } /* switch _type_id */ + + return(_offset); + +} /* dissect_wlccp_ccm_tlv */ + + + +static guint dissect_wlccp_sec_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) +{ + + switch (_type_id) + { + + case 0x01: /* initSession */ + { + + proto_item_append_text(_ti, " initSession"); + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_path_length, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 2; + + + break; + } /* case 0x01 */ + + case 0x02: /* inSecureContextReq */ + { + + proto_item_append_text(_ti, " inSecureContextReq"); + + proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_supp_node_type, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_supp_node_id, _tvb, _offset, 6, FALSE); + _offset += 6; + + /* skip unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, FALSE); + _offset += 32; + + break; + } /* case 0x02 */ + + + case 0x06: /* authenticator */ + { + + proto_item_append_text(_ti, " authenticator"); + + proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_src_node_type, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_src_node_id, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, FALSE); + _offset += 4; + + /* skip unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, FALSE); + _offset += 32; + + break; + } /* case 0x06 */ + + case 0x08: /* MIC */ + { + + guint16 _mic_length=0; + + proto_item_append_text(_ti, " mic"); + + proto_tree_add_item(_tree, hf_wlccp_mic_msg_seq_count, _tvb, _offset, 8, FALSE); + _offset += 8; + + proto_tree_add_item(_tree, hf_wlccp_mic_length, _tvb, _offset, 2, FALSE); + _mic_length = tvb_get_ntohs(_tvb,_offset); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_mic_value, _tvb, _offset, _mic_length, FALSE); + _offset += _mic_length; + + break; + } + + case 0x0a: /* inSecureContextReply */ + { + + proto_item_append_text(_ti, " inSecureContextReply"); + + + proto_tree_add_item(_tree, hf_wlccp_key_seq_count, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_dest_node_type, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_dest_node_id, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_supp_node_type, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_supp_node_id, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_nonce, _tvb, _offset, 32, FALSE); + _offset += 32; + + proto_tree_add_item(_tree, hf_wlccp_session_timeout, _tvb, _offset, 4, FALSE); + _offset += 4; + + break; + } /* case 0x0a */ + + + + default: + { + /* for unknown types, just add them to the tree as a blob */ + proto_item_append_text(_ti, " Unknown"); + proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length-4, FALSE); + _offset += _length-4; + + break; + } /* default case for switch (_type_id) */ + + } /* switch _type_id */ + + return(_offset); +} /* dissect_wlccp_sec_tlv */ + + + +static guint dissect_wlccp_rrm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) +{ + + switch (_type_id) + { + + case 0x02: /* aggrRmReq */ + { + proto_item_append_text(_ti, " aggrRmReq"); + proto_tree_add_item(_tree, hf_wlccp_token2, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_interval, _tvb, _offset, 2, FALSE); + _offset += 2; + + break; + + } /* case tlv_type_id = 0x02 */ + + case 0x03 : /* rmReport */ + { + proto_item_append_text(_ti, " rmReport"); + + proto_tree_add_item(_tree, hf_wlccp_sta_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_stamac, _tvb, _offset, 6, FALSE); + _offset += 6; + + break; + } /* case tlv_type_id = 0x03 */ + + case 0x04: /* aggrRmReport */ + { + proto_item_append_text(_ti, " aggrRmReport"); + + /* no fields */ + + break; + } /* case tlv_type_id = 0x04 */ + + case 0x12: /* beaconRequest */ + { + proto_item_append_text(_ti, " beaconRequest"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_scan_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + + break; + } /* case 0x12 */ + + case 0x14: /* frameRequest */ + { + + guint _count=0, _counter=0; + + proto_item_append_text(_ti, " frameRequest"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_count, _tvb, _offset, 1, FALSE); + _count = tvb_get_guint8(_tvb,_offset); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + for (_counter=0; _counter < _count; _counter++) + { + + proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, FALSE); + _offset += 6; + + } /* for _counter=0 */ + + + + break; + } /* case 0x14 */ + + case 0x15: /* frameReport */ + { + + proto_item *_fr_ti; + proto_tree *_fr_elems_tree; + + guint _counter=0, _arraylen=0; + + proto_item_append_text(_ti, " frameReport"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + _arraylen=(_length-10)/14; + + if (_arraylen > 0) + { + + _fr_ti = proto_tree_add_item(_tree, hf_framereport_elements, _tvb, _offset, (_length-10), FALSE); + _fr_elems_tree = proto_item_add_subtree(_fr_ti, ett_framereport_elements_tree); + + for(_counter=0; _counter < _arraylen; _counter++) + { + + proto_tree_add_item(_fr_elems_tree, hf_wlccp_numframes, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_fr_elems_tree, hf_wlccp_rss, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_fr_elems_tree, hf_wlccp_bssid, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_fr_elems_tree, hf_wlccp_stamac, _tvb, _offset, 6, FALSE); + _offset += 6; + + } /* for _counter=0 */ + + } /* if _arraylen > 0 */ + + + break; + } /* case 0x15 */ + + + case 0x16: /* ccaRequest */ + { + proto_item_append_text(_ti, " ccaRequest"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + break; + } /* case 0x16 */ + + + case 0x17: /* ccaReport */ + { + proto_item_append_text(_ti, " ccaReport"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_ccabusy, _tvb, _offset, 1, FALSE); + _offset += 1; + + break; + + } /* case tlv_type_id = 0x17 */ + + case 0x18: /* rpiHistRequest */ + { + proto_item_append_text(_ti, " rpiHistRequest"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + break; + } /* case 0x18 */ + + case 0x19: /* rpiHistReport */ + { + + guint _rpi_density_length=0; + + proto_item_append_text(_ti, " rpiHistReport"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + _rpi_density_length = _length - 6 - 4; + + proto_tree_add_item(_tree, hf_wlccp_rpidensity, _tvb, _offset, _rpi_density_length, FALSE); + _offset += _rpi_density_length; + + break; + + } /* case tlv_type_id = 0x19 */ + + case 0x1c: /* nullRequest */ + { + proto_item_append_text(_ti, " nullRequest"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_duration, _tvb, _offset, 2, FALSE); + _offset += 2; + + break; + } /* case 0x1c */ + + + case 0x1e: /* commonBeaconReport */ + { + + proto_tree *_80211_capabilities_tree; + proto_item *_new_ti; + + guint _tlv80211length=0; + + proto_item_append_text(_ti, " commonBeaconReport"); + + proto_tree_add_item(_tree, hf_wlccp_srcidx, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_channel, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_phy_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_beacon_interval, _tvb, _offset, 2, FALSE); + _offset += 2; + + + /* + if we assume the next field is the capabilities field from the 802.11 beacon, + then we have a 16-bit field thhf_wlccp_statusat contains the following (802.11-2007): + bit 0 = ESS + bit 1 = IBSS + bit 2 = CF pollable + bit 3 = CF Poll Request + bit 4 = privacy + bit 5 = Short Preamble + bit 6 = PBCC + bit 7 = Channel Agility + bit 8 = Spectrum Management + bit 9 = QoS + bit 10 = Short Slot Time + bit 11 = APSD + bit 12 = Reserved + bit 13 = DSSS-OFDM + bit 14 = Delayed Block Ack + bit 15 = Immediate Block Ack + */ + + _new_ti = proto_tree_add_item(_tree, hf_wlccp_80211_capabilities, + _tvb, _offset, 2, FALSE); + _80211_capabilities_tree = proto_item_add_subtree(_new_ti, ett_80211_capability_flags_tree); + + proto_tree_add_item(_80211_capabilities_tree, hf_80211_imm_block_ack, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_dlyd_block_ack, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_dsss_ofdm, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_reserved, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_apsd, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_short_time_slot, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_qos, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_spectrum_mgmt, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_chan_agility, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_pbcc, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_short_preamble, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_privacy, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_cf_poll_req, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_cf_pollable, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_ibss, + _tvb, _offset, 2, FALSE); + proto_tree_add_item(_80211_capabilities_tree, hf_80211_cap_ess, + _tvb, _offset, 2, FALSE);; + + /* proto_tree_add_item(_tree, hf_wlccp_capabilities, _tvb, _offset, 2, FALSE); */ + _offset += 2; + + + _tlv80211length = _length - 13 - 4; + + /* This TLV could be decoded per the 802.11 information element spec's */ + proto_tree_add_item(_tree, hf_wlccp_tlv80211, _tvb, _offset, _tlv80211length, FALSE); + _offset += _tlv80211length; + + break; + + } /* case tlv_type_id = 0x1e */ + + + case 0x1f: /* aggrBeaconReport */ + { + proto_item_append_text(_ti, " aggrBeaconReport"); + + proto_tree_add_item(_tree, hf_wlccp_token, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_mode, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_rss, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_srcidx, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_parent_tsf, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_target_tsf, _tvb, _offset, 8, FALSE); + _offset += 8; + + break; + } /* case tlv_type_id = 0x1f */ + + + case 0x20: /* rmReqRoutingList */ + { + + guint _counter=0, _arraylen=0; + + proto_item_append_text(_ti, " rmReqRoutingList"); + + _arraylen=(_length)/16; + + if (_arraylen > 0) + { + + for(_counter=0; _counter < _arraylen; _counter++) + { + + proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_stamac, _tvb, _offset, 6, FALSE); + _offset += 6; + + } /* for _counter=0 */ + + } /* if _arraylen > 0 */ + break; + } /* case 0x20 */ + + case 0x21: /* rmReqRoutingResp */ + { + + guint _counter=0, _arraylen=0; + + proto_item_append_text(_ti, " rmReqRoutingResp"); + + proto_tree_add_item(_tree, hf_wlccp_token2, _tvb, _offset, 2, FALSE); + _offset += 2; + + _arraylen=(_length)/11; + + if (_arraylen > 0) + { + + for(_counter=0; _counter < _arraylen; _counter++) + { + + proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, FALSE); + _offset += 1; + + } /* for _counter=0 */ + + } /* if _arraylen > 0 */ + + break; + } /* case 0x21 */ + + case 0x22: /* rmReqAck */ + { + proto_item_append_text(_ti, " rmReqAck"); + + proto_tree_add_item(_tree, hf_wlccp_status, _tvb, _offset, 1, FALSE); + _offset += 1; + + break; + } /* case 0x22 */ + + + case 0x58: /* mfpCapability */ + { + proto_item_append_text(_ti, " mfpCapability"); + + proto_tree_add_item(_tree, hf_wlccp_mfpcapability, _tvb, _offset, 2, FALSE); + _offset += 2; + + break; + } /* case 0x58 */ + + case 0x5b: /* mfpRouting */ + { + proto_item_append_text(_ti, " mfpRouting"); + + proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_bssid, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wlccp_mfpflags, _tvb, _offset, 2, FALSE); + _offset += 2; + + break; + } /* case 0x5b */ + + case 0x5c: /* mfpConfig */ + { + proto_item_append_text(_ti, " mfpConfig"); + + proto_tree_add_item(_tree, hf_wlccp_mfpconfig, _tvb, _offset, 2, FALSE); + _offset += 2; + + break; + } /* case 0x5c */ + + + default: + { + /* for unknown types, just add them to the tree as a blob */ + proto_item_append_text(_ti, " Unknown"); + + proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length-4, FALSE); + _offset += _length-4; + + break; + } /* case default */ + + } /* switch type_id */ + + return(_offset); + +} /* dissect_wlccp_rrm_tlv */ + +static guint dissect_wlccp_qos_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) +{ + + switch (_type_id) + { + + default: + { + /* for unknown types, just add them to the tree as a blob */ + proto_item_append_text(_ti, " Unknown"); + + proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length-4, FALSE); + _offset += _length-4; + + break; + } /* default case for switch (_type_id) */ + + } /* switch _type_id */ + + + return(_offset); + +} /* dissect_wlccp_qos_tlv */ + +static guint dissect_wlccp_nm_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) +{ + + switch (_type_id) + { + + case 0x20: /* nmClientEventIntoWDS */ + { + + guint _radius_user_name_length = 0; + + proto_item_append_text(_ti, " nmClientEventIntoWDS"); + + proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + _radius_user_name_length = _length - 23 - 4; + + proto_tree_add_item(_tree, hf_wlccp_radius_user_name, _tvb, _offset, _radius_user_name_length, FALSE); + _offset += _radius_user_name_length; + + + break; + } /* case 0x20 */ + + case 0x21: /* nmClientEventOutOfWDS */ + { + proto_item_append_text(_ti, " nmClientEventOutOfWDS"); + + proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_wds_reason, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + break; + } /* case 0x21 */ + + case 0x22: /* nmClientEventIntraWDS */ + { + proto_item_append_text(_ti, " nmClientEventIntraWDS"); + + proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 3; + + + break; + } /* case 0x22 */ + + case 0x24: /* nmClientEventIPAddressUpdate */ + { + proto_item_append_text(_ti, " nmClientEventIPAddressUpdate"); + + proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, FALSE); + _offset += 6; + + /* skip some unused bytes */ + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, FALSE); + _offset += 4; + + + break; + } /* case 0x24 */ + + case 0x26: /* nmClientEventRefresh */ + { + + guint _radius_user_name_length = 0; + + proto_item_append_text(_ti, " nmClientEventRefresh"); + + proto_tree_add_item(_tree, hf_wlccp_clientmac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_parent_ap_mac, _tvb, _offset, 6, FALSE); + _offset += 6; + + proto_tree_add_item(_tree, hf_reg_lifetime, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_ipv4_address, _tvb, _offset, 4, FALSE); + _offset += 4; + + proto_tree_add_item(_tree, hf_wlccp_auth_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + proto_tree_add_item(_tree, hf_wlccp_key_mgmt_type, _tvb, _offset, 1, FALSE); + _offset += 1; + + /* skip some unused bytes */ + _offset += 1; + + _radius_user_name_length = _length - 23 - 4; + + proto_tree_add_item(_tree, hf_wlccp_radius_user_name, _tvb, _offset, _radius_user_name_length, FALSE); + _offset += _radius_user_name_length; + + break; + } /* case 0x26 */ + + case 0x27: /* nmClientEventRefreshDone */ + { + proto_item_append_text(_ti, " nmClientEventRefreshDone"); + + /* skip some unused bytes */ + _offset += 6; + + proto_tree_add_item(_tree, hf_time_elapsed, _tvb, _offset, 2, FALSE); + _offset += 2; + + proto_tree_add_item(_tree, hf_wlccp_refresh_req_id, _tvb, _offset, 4, FALSE); + _offset += 4; + + + break; + } /* case 0x27 */ + + + default: + { + /* for unknown types, just add them to the tree as a blob */ + proto_item_append_text(_ti, " Unknown"); + + proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length-4, FALSE); + _offset += _length-4; + + break; + } /* default case for switch (_type_id) */ + + } /* switch _type_id */ + + + return(_offset); + +} /* dissect_wlccp_nm_tlv */ + +static guint dissect_wlccp_mip_tlv(proto_tree *_tree, tvbuff_t *_tvb, guint _offset, gint _type_id, guint _length, proto_item *_ti) +{ + + switch (_type_id) + { + + + default: + { + /* for unknown types, just add them to the tree as a blob */ + proto_item_append_text(_ti, " Unknown"); + + proto_tree_add_item(_tree, hf_wlccp_tlv_unknown_value, _tvb, _offset, _length-4, FALSE); + _offset += _length-4; + + break; + } /* default case for switch (_type_id) */ + + } /* switch _type_id */ + + + return(_offset); + +} /* dissect_wlccp_mip_tlv */ /* Register the protocol with Wireshark */ @@ -398,13 +2958,25 @@ proto_register_wlccp(void) { &hf_wlccp_sap, { "SAP", "wlccp.sap", + FT_UINT8, BASE_HEX, NULL, + 0x0, "Service Access Point", HFILL } + }, + + { &hf_wlccp_sap_version, + { "SAP Version", "wlccp.sap_version", + FT_UINT8, BASE_DEC, NULL, + SAP_VERSION_MASK, "Service Access Point Version", HFILL } + }, + + { &hf_wlccp_sap_id, + { "SAP ID", "wlccp.sap_id", FT_UINT8, BASE_DEC, VALS(wlccp_sap_vs), - 0x0, "Service Access Point ID", HFILL } + SAP_VALUE_MASK, "Service Access Point ID", HFILL } }, { &hf_wlccp_destination_node_type, { "Destination node type", "wlccp.destination_node_type", - FT_UINT8, BASE_DEC, VALS(wlccp_node_type_vs), + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Node type of the hop destination", HFILL } }, @@ -427,12 +2999,47 @@ proto_register_wlccp(void) MT_SUBTYPE, "Message Subtype", HFILL } }, - { &hf_wlccp_base_message_type, + { &hf_wlccp_base_message_type_0, { "Base message type", "wlccp.base_message_type", - FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs), + FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_0), MT_BASE_MSG_TYPE, "Base message type", HFILL } }, + { &hf_wlccp_base_message_type_1, + { "Base message type", "wlccp.base_message_type", + FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_1), + MT_BASE_MSG_TYPE, "Base message type", HFILL } + }, + + { &hf_wlccp_base_message_type_2, + { "Base message type", "wlccp.base_message_type", + FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_2), + MT_BASE_MSG_TYPE, "Base message type", HFILL } + }, + + { &hf_wlccp_base_message_type_3, + { "Base message type", "wlccp.base_message_type", + FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_3), + MT_BASE_MSG_TYPE, "Base message type", HFILL } + }, + + { &hf_wlccp_base_message_type_4, + { "Base message type", "wlccp.base_message_type", + FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_4), + MT_BASE_MSG_TYPE, "Base message type", HFILL } + }, + + { &hf_wlccp_base_message_type_5, + { "Base message type", "wlccp.base_message_type", + FT_UINT8, BASE_HEX_DEC, VALS(wlccp_msg_type_vs_5), + MT_BASE_MSG_TYPE, "Base message type", HFILL } + }, + + { &hf_wlccp_base_message_type_unknown, + { "Base message type", "wlccp.base_message_type", + FT_UINT8, BASE_HEX_DEC, NULL, + MT_BASE_MSG_TYPE, "Base message type", HFILL } + }, { &hf_wlccp_hops, { "Hops", "wlccp.hops", @@ -440,6 +3047,12 @@ proto_register_wlccp(void) 0x0, "Number of WLCCP hops", HFILL } }, + { &hf_wlccp_nm_version, + { "NM Version", "wlccp.nm_version", + FT_UINT8, BASE_DEC, NULL, + 0x0, "NM Version", HFILL } + }, + { &hf_wlccp_msg_id, { "Message ID", "wlccp.msg_id", FT_UINT16, BASE_DEC, NULL, @@ -454,6 +3067,12 @@ proto_register_wlccp(void) 0x0, "Flags", HFILL } }, + { &hf_wlccp_rm_flags, + { "RM Flags", "wlccp.rm_flags", + FT_UINT8, BASE_HEX, NULL, + 0x0, "RM Flags", HFILL } + }, + { &hf_wlccp_retry_flag, { "Retry flag", "wlccp.retry_flag", FT_UINT16, BASE_DEC, NULL, @@ -466,6 +3085,18 @@ proto_register_wlccp(void) F_RESPONSE_REQUEST, "Set on to request a reply", HFILL } }, + { &hf_wlccp_rm_request_reply_flag, + { "Request Reply flag", "wlccp.request_reply_flag", + FT_UINT8, BASE_DEC, NULL, + RM_F_REQUEST_REPLY, "Set on to request a reply", HFILL } + }, + + { &hf_wlccp_ack_required_flag, + { "Ack Required flag", "wlccp.ack_required_flag", + FT_UINT16, BASE_DEC, NULL, + F_ACK_REQD, "Set on to require an acknowledgement", HFILL } + }, + { &hf_wlccp_tlv_flag, { "TLV flag", "wlccp.tlv_flag", FT_UINT16, BASE_DEC, NULL, @@ -508,9 +3139,15 @@ proto_register_wlccp(void) F_MIC, "On in a message that must be authenticated and has an authentication TLV", HFILL } }, + { &hf_wlccp_rm_mic_flag, + { "MIC flag", "wlccp.mic_flag", + FT_UINT8, BASE_DEC, NULL, + RM_F_MIC, "On in a message that must be authenticated and has an authentication TLV", HFILL } + }, + { &hf_wlccp_originator_node_type, { "Originator node type", "wlccp.originator_node_type", - FT_UINT8, BASE_DEC, VALS(wlccp_node_type_vs), + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Originating device's node type", HFILL } }, @@ -522,7 +3159,7 @@ proto_register_wlccp(void) { &hf_wlccp_responder_node_type, { "Responder node type", "wlccp.responder_node_type", - FT_UINT8, BASE_DEC, VALS(wlccp_node_type_vs), + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Responding device's node type", HFILL } }, @@ -532,9 +3169,33 @@ proto_register_wlccp(void) 0x0, "Responding device's MAC address", HFILL } }, + { &hf_wlccp_requ_node_type, + { "Requestor node type", "wlccp.requ_node_type", + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), + 0x0, "Requesting device's node type", HFILL } + }, + + { &hf_wlccp_requ_node_id, + { "Requestor", "wlccp.requestor", + FT_ETHER, BASE_NONE, NULL, + 0x0, "Requestor device's MAC address", HFILL } + }, + + { &hf_wlccp_status, + { "Status", "wlccp.status", + FT_UINT8, BASE_DEC, VALS(wlccp_status_vs), + 0x0, "Status", HFILL } + }, + + { &hf_wlccp_path_init_rsvd, + { "Reserved", "wlccp.path_init_reserved", + FT_UINT8, BASE_DEC, NULL, + 0x0, "Reserved", HFILL } + }, + { &hf_wlccp_relay_node_type, { "Relay node type", "wlccp.relay_node_type", - FT_UINT8, BASE_DEC, VALS(wlccp_node_type_vs), + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), 0x0, "Type of node which relayed this message", HFILL } }, @@ -565,17 +3226,647 @@ proto_register_wlccp(void) { &hf_wlccp_ipv4_address, { "IPv4 Address", "wlccp.ipv4_address", FT_IPv4, BASE_NONE, NULL, 0, - "IPv4 address of this access point", HFILL } - } + "IPv4 address", HFILL } + }, + + { &hf_wlccp_timestamp, + { "Timestamp", "wlccp.timestamp", + FT_UINT64, BASE_DEC, NULL, 0, + "Registration Timestamp", HFILL } + }, + + { &hf_wlccp_apregstatus, + { "Registration Status", "wlccp.apregstatus", + FT_UINT8, BASE_HEX, NULL, 0, + "AP Registration Status", HFILL } + }, + + { &hf_wlccp_ap_node_id, + { "AP Node ID", "wlccp.apnodeid", + FT_NONE, BASE_NONE, NULL, 0, + "AP Node ID", HFILL } + }, + + { &hf_wlccp_ap_node_type, + { "AP Node Type", "wlccp.apnodetype", + FT_UINT16, BASE_HEX, NULL, 0, + "AP Node Type", HFILL } + }, + + { &hf_wlccp_ap_node_id_address, + { "AP Node Address", "wlccp.apnodeidaddress", + FT_ETHER, BASE_NONE, NULL, 0, + "AP Node Address", HFILL } + }, - }; + { &hf_wlccp_aaa_msg_type, + { "AAA Message Type", "wlccp.aaa_msg_type", + FT_UINT8, BASE_HEX, VALS(wlccp_aaa_msg_type_vs), 0, + "AAA Message Type", HFILL } + }, + + { &hf_wlccp_aaa_auth_type, + { "AAA Authentication Type", "wlccp.aaa_auth_type", + FT_UINT8, BASE_HEX, VALS(wlccp_eapol_auth_type_vs), 0, + "AAA Authentication Type", HFILL } + }, + + { &hf_wlccp_keymgmt_type, + { "AAA Key Management Type", "wlccp.aaa_keymgmt_type", + FT_UINT8, BASE_HEX, VALS(wlccp_key_mgmt_type_vs), 0, + "AAA Key Management Type", HFILL } + }, + + { &hf_wlccp_eapol_msg, + { "EAPOL Message", "wlccp.eapol_msg", + FT_NONE, BASE_NONE, NULL, 0, + "EAPOL Message", HFILL } + }, + + { &hf_wlccp_eapol_version, + { "EAPOL Version", "wlccp.eapol_version", + FT_UINT8, BASE_DEC, NULL, 0, + "EAPOL Version", HFILL } + }, + + { &hf_wlccp_eapol_type, + { "EAPOL Type", "wlccp.eapol_type", + FT_UINT8, BASE_HEX, VALS(eapol_type_vs), 0, + "EAPOL Type", HFILL } + }, + + { &hf_wlccp_eap_msg_length, + { "EAP Packet Length", "wlccp.eap_pkt_length", + FT_UINT16, BASE_DEC, NULL, 0, + "EAPOL Type", HFILL } + }, + + { &hf_wlccp_eap_msg, + { "EAP Message", "wlccp.eap_msg", + FT_BYTES, BASE_HEX, NULL, 0, + "EAP Message", HFILL } + }, + + { &hf_wlccp_cisco_acctg_msg, + { "Cisco Accounting Message", "wlccp.cisco_acctg_msg", + FT_BYTES, BASE_HEX, NULL, 0, + "Cisco Accounting Message", HFILL } + }, + + { &hf_wlccp_wids_msg_type, + { "WIDS Message Type", "wlccp.wids_msg_type", + FT_UINT8, BASE_DEC, NULL, 0, + "WIDS Message Type", HFILL } + }, + + { &hf_wlccp_nmconfig, + { "NM Config", "wlccp.nmconfig", + FT_UINT8, BASE_DEC, NULL, 0, + "NM Config", HFILL } + }, + + { &hf_wlccp_scmstate_change, + { "SCM State Change", "wlccp.scmstate_change", + FT_UINT8, BASE_DEC, NULL, 0, + "SCM State Change", HFILL } + }, + + { &hf_wlccp_scmstate_change_reason, + { "SCM State Change Reason", "wlccp.scmstate_change_reason", + FT_UINT8, BASE_DEC, NULL, 0, + "SCM State Change Reason", HFILL } + }, + + { &hf_wlccp_scmattach_state, + { "SCM Attach State ", "wlccp.scmattach_state", + FT_UINT8, BASE_DEC, NULL, 0, + "SCM Attach State", HFILL } + }, + + { &hf_wlccp_nmcapability, + { "NM Capability", "wlccp.nm_capability", + FT_UINT8, BASE_DEC, NULL, 0, + "NM Capability", HFILL } + }, + + { &hf_wlccp_refresh_req_id, + { "Refresh Request ID", "wlccp.refresh_request_id", + FT_UINT32, BASE_DEC, NULL, 0, + "Refresh Request ID", HFILL } + }, + + { &hf_wlccp_tlv, + { "WLCCP TLV", "wlccp.tlv", + FT_NONE, BASE_NONE, NULL, 0, + "WLCCP TLV", HFILL } + }, + + { &hf_tlv_flags, + { "TLV Flags", "wlccp.tlv_flags", + FT_UINT16, BASE_HEX, NULL, 0, + "TLV Flags, Group and Type", HFILL } + }, + + { &hf_wlccp_null_tlv, + { "NULL TLV", "wlccp.wlccp_null_tlv", + FT_BYTES, BASE_HEX, NULL , + 0, "NULL TLV", HFILL } + }, + + + { &hf_wlccp_tlv_type, + { "TLV Type", "wlccp.wlccp_tlv_type", + FT_UINT16, BASE_DEC, NULL , + TLV_TYPE_ID, "TLV Type ID", HFILL } + }, + + { &hf_wlccp_tlv_type0, + { "TLV Type", "wlccp.wlccp_tlv_type", + FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_0), + TLV_TYPE_ID, "TLV Type ID", HFILL } + }, + + { &hf_wlccp_tlv_type1, + { "TLV Type", "wlccp.wlccp_tlv_type", + FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_1), + TLV_TYPE_ID, "TLV Type ID", HFILL } + }, + + { &hf_wlccp_tlv_type2, + { "TLV Type", "wlccp.wlccp_tlv_type", + FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_2), + TLV_TYPE_ID, "TLV Type ID", HFILL } + }, + + { &hf_wlccp_tlv_type3, + { "TLV Type", "wlccp.wlccp_tlv_type", + FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_3), + TLV_TYPE_ID, "TLV Type ID", HFILL } + }, + + { &hf_wlccp_tlv_type4, + { "TLV Type", "wlccp.wlccp_tlv_type", + FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_4), + TLV_TYPE_ID, "TLV Type ID", HFILL } + }, + + { &hf_wlccp_tlv_type5, + { "TLV Type", "wlccp.wlccp_tlv_type", + FT_UINT16, BASE_DEC, VALS(wlccp_tlv_typeID_5), + TLV_TYPE_ID, "TLV Type ID", HFILL } + }, + + { &hf_wlccp_tlv_group, + { "TLV Group", "wlccp.wlccp_tlv_group", + FT_UINT16, BASE_DEC, VALS(wlccp_tlv_group_vs) , + TLV_GROUP_ID, "TLV Group ID", HFILL } + }, + + { &hf_wlccp_tlv_container_flag, + { "TLV Container Flag", "wlccp.tlv_container_flag", + FT_UINT16, BASE_DEC, NULL, + TLV_F_CONTAINER, "Set on if the TLV is a container", HFILL } + }, + + { &hf_wlccp_tlv_encrypted_flag, + { "TLV Encrypted Flag", "wlccp.tlv_encrypted_flag", + FT_UINT16, BASE_DEC, NULL, + TLV_F_ENCRYPTED, "Set on if the TLV is encrypted", HFILL } + }, + + { &hf_wlccp_tlv_reserved_bit, + { "Reserved bits", "wlccp.tlv_reserved_bit", + FT_UINT16, BASE_DEC, NULL, + TLV_F_RESVD, "Reserved", HFILL } + }, + + { &hf_wlccp_tlv_request_flag, + { "TLV Request Flag", "wlccp.tlv_request_flag", + FT_UINT16, BASE_DEC, NULL, + TLV_F_REQUEST, "Set on if the TLV is a request", HFILL } + }, + + { &hf_wlccp_tlv_length, + { "TLV Length", "wlccp.tlv_length", + FT_UINT16, BASE_DEC, NULL, 0, + "TLV Length", HFILL } + }, + + { &hf_wlccp_path_length, + { "Path Length", "wlccp.path_length", + FT_UINT8, BASE_DEC, NULL, 0, + "Path Length", HFILL } + }, + + { &hf_wlccp_mic_msg_seq_count, + { "MIC Message Sequence Count", "wlccp.mic_msg_seq_count", + FT_UINT64, BASE_DEC, NULL, 0, + "MIC Message Sequence Count", HFILL } + }, + + { &hf_wlccp_mic_length, + { "MIC Length", "wlccp.mic_length", + FT_UINT16, BASE_DEC, NULL, 0, + "MIC Length", HFILL } + }, + + { &hf_wlccp_mic_value, + { "MIC Value", "wlccp.mic_value", + FT_BYTES, BASE_HEX, NULL, 0, + "MIC Value", HFILL } + }, + + { &hf_wlccp_dest_node_type, + { "Destination node type", "wlccp.dest_node_type", + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), + 0x0, "Destination node type", HFILL } + }, + + { &hf_wlccp_dest_node_id, + { "Destination node ID", "wlccp.dest_node_id", + FT_ETHER, BASE_NONE, NULL, + 0x0, "Destination node ID", HFILL } + }, + + { &hf_wlccp_supp_node_type, + { "Destination node type", "wlccp.supp_node_type", + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), + 0x0, "Destination node type", HFILL } + }, + + { &hf_wlccp_supp_node_id, + { "Supporting node ID", "wlccp.supp_node_id", + FT_ETHER, BASE_NONE, NULL, + 0x0, "Supporting node ID", HFILL } + }, + + { &hf_wlccp_src_node_type, + { "Source node type", "wlccp.source_node_type", + FT_UINT16, BASE_DEC, VALS(wlccp_node_type_vs), + 0x0, "Source node type", HFILL } + }, + + { &hf_wlccp_src_node_id, + { "Source node ID", "wlccp.source_node_id", + FT_ETHER, BASE_NONE, NULL, + 0x0, "Source node ID", HFILL } + }, + + { &hf_wlccp_key_mgmt_type, + { "Key Management type", "wlccp.key_mgmt_type", + FT_UINT8, BASE_HEX, NULL, + 0x0, "Key Management type", HFILL } + }, + + { &hf_wlccp_key_seq_count, + { "Key Sequence Count", "wlccp.key_seq_count", + FT_UINT32, BASE_DEC, NULL, 0, + "Key Sequence Count", HFILL } + }, + + { &hf_wlccp_session_timeout, + { "Session Timeout", "wlccp.session_timeout", + FT_UINT32, BASE_DEC, NULL, 0, + "Session Timeout", HFILL } + }, + + { &hf_wlccp_nonce, + { "Nonce Value", "wlccp.nonce_value", + FT_BYTES, BASE_HEX, NULL, 0, + "Nonce Value", HFILL } + }, + + { &hf_wlccp_token, + { "Token", "wlccp.token", + FT_UINT8, BASE_HEX, NULL, 0, + "Token", HFILL } + }, + + { &hf_wlccp_scan_mode, + { "Scan Mode", "wlccp.scan_mode", + FT_UINT8, BASE_HEX, NULL, + 0, "Scan Mode", HFILL } + }, + + { &hf_wlccp_mode, + { "Mode", "wlccp.mode", + FT_UINT8, BASE_HEX, VALS(wlccp_mode_vs), + 0, "Mode", HFILL } + }, + + { &hf_wlccp_rss, + { "RSS", "wlccp.rss", + FT_INT8, BASE_DEC, NULL, 0, + "Received Signal Strength", HFILL } + }, + + { &hf_wlccp_srcidx, + { "Source Index", "wlccp.srcidx", + FT_UINT8, BASE_HEX, NULL, 0, + "Source Index", HFILL } + }, + + { &hf_wlccp_parent_tsf, + { "Parent TSF", "wlccp.parenttsf", + FT_UINT32, BASE_HEX, NULL, 0, + "Parent TSF", HFILL } + }, + + { &hf_wlccp_target_tsf, + { "Target TSF", "wlccp.targettsf", + FT_UINT64, BASE_HEX, NULL, 0, + "Target TSF", HFILL } + }, + + { &hf_wlccp_channel, + { "Channel", "wlccp.channel", + FT_UINT8, BASE_DEC, NULL, 0, + "Channel", HFILL } + }, + + { &hf_wlccp_phy_type, + { "PHY Type", "wlccp.phy_type", + FT_UINT8, BASE_DEC, VALS(phy_type_80211_vs), 0, + "PHY Type", HFILL } + }, + + { &hf_wlccp_bssid, + { "BSS ID", "wlccp.bssid", + FT_ETHER, BASE_NONE, NULL, 0, + "Basic Service Set ID ", HFILL } + }, + { &hf_wlccp_beacon_interval, + { "Beacon Interval", "wlccp.beacon_interval", + FT_UINT16, BASE_DEC, NULL, 0, + "Beacon Interval", HFILL } + }, + + /* + { &hf_wlccp_capabilities, + { "Capabilities", "wlccp.capabilities", + FT_UINT16, BASE_HEX, NULL, 0, + "Capabilities", HFILL } + }, + */ + + { &hf_wlccp_80211_capabilities, + { "802.11 Capabilities Flags", "wlccp.80211_capabilities", + FT_UINT16, BASE_HEX, NULL, + 0x0, "802.11 Capabilities Flags", HFILL } + }, + + { &hf_80211_cap_ess, + { "ESS flag", "wlccp.80211_ess_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_ESS, "Set on by APs in Beacon or Probe Response", HFILL } + }, + + + { &hf_80211_cap_ibss, + { "IBSS flag", "wlccp.80211_ibss_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_IBSS, "Set on by STAs in Beacon or Probe Response", HFILL } + }, + + { &hf_80211_cap_cf_pollable, + { "CF Pollable flag", "wlccp.80211_cf_pollable_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_CFPOLL, "CF Pollable Flag", HFILL } + }, + + { &hf_80211_cap_cf_poll_req, + { "CF Poll Request flag", "wlccp.80211_cf_poll_req_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_CFPOLL_REQ, "CF Poll Request Flag", HFILL } + }, + + { &hf_80211_cap_privacy, + { "Privacy flag", "wlccp.80211_cf_poll_req_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_PRIVACY, "Set on indicate confidentiality is required in the BSS", HFILL } + }, + + { &hf_80211_short_preamble, + { "Short Preamble flag", "wlccp.80211_short_preamble_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_SHORT_PREAMBLE, "Short Preamble Flag", HFILL } + }, + + { &hf_80211_pbcc, + { "PBCC flag", "wlccp.80211_pbcc_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_PBCC, "PBCC Flag", HFILL } + }, + + { &hf_80211_chan_agility, + { "Channel Agility flag", "wlccp.80211_chan_agility_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_CH_AGILITY, "Channel Agility Flag", HFILL } + }, + + { &hf_80211_spectrum_mgmt, + { "Spectrum Management flag", "wlccp.80211_spectrum_mgmt_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_SPEC_MGMT, "Spectrum Management Flag", HFILL } + }, + + { &hf_80211_qos, + { "QOS flag", "wlccp.80211_qos_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_QOS, "QOS Flag", HFILL } + }, + + { &hf_80211_short_time_slot, + { "Short Time Slot flag", "wlccp.80211_short_time_slot_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_SHORT_TIME_SLOT, "Short Time Slot Flag", HFILL } + }, + + { &hf_80211_apsd, + { "APSD flag", "wlccp.80211_apsd_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_APSD, "APSD Flag", HFILL } + }, + + { &hf_80211_reserved, + { "Reserved", "wlccp.80211_reserved", + FT_UINT16, BASE_DEC, NULL, + F_80211_RESVD, "Reserved", HFILL } + }, + + { &hf_80211_dsss_ofdm, + { "DSSS-OFDM Flag", "wlccp.dsss_ofdm_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_DSSS_OFDM, "DSSS-OFDM Flag", HFILL } + }, + + { &hf_80211_dlyd_block_ack, + { "Delayed Block Ack Flag", "wlccp.dsss_dlyd_block_ack_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_DLYD_BLK_ACK, "Delayed Block Ack Flag", HFILL } + }, + + { &hf_80211_imm_block_ack, + { "Immediate Block Ack Flag", "wlccp.dsss_imm_block_ack_flag", + FT_UINT16, BASE_DEC, NULL, + F_80211_IMM_BLK_ACK, "Immediate Block Ack Flag", HFILL } + }, + + + { &hf_wlccp_tlv80211, + { "802.11 TLV Value", "wlccp.tlv80211", + FT_BYTES, BASE_HEX, NULL, 0, + "802.11 TLV Value", HFILL } + }, + + { &hf_wlccp_duration, + { "Duration", "wlccp.duration", + FT_UINT16, BASE_DEC, NULL, 0, + "Duration", HFILL } + }, + + { &hf_wlccp_rpidensity, + { "RPI Density", "wlccp.rpi_denisty", + FT_BYTES, BASE_DEC, NULL, 0, + "RPI Density", HFILL } + }, + + { &hf_wlccp_ccabusy, + { "CCA Busy", "wlccp.cca_busy", + FT_UINT8, BASE_HEX, NULL, 0, + "CCA Busy", HFILL } + }, + + { &hf_wlccp_stamac, + { "Station MAC", "wlccp.station_mac", + FT_ETHER, BASE_NONE, NULL, 0, + "Station MAC", HFILL } + }, + + { &hf_wlccp_sta_type, + { "Station Type", "wlccp.station_type", + FT_UINT8, BASE_HEX, NULL, 0, + "Station Type", HFILL } + }, + + { &hf_wlccp_token2, + { "2 Byte Token", "wlccp.token2", + FT_UINT16, BASE_HEX, NULL, 0, + "2 Byte Token", HFILL } + }, + + { &hf_wlccp_interval, + { "Interval", "wlccp.interval", + FT_UINT16, BASE_DEC, NULL, 0, + "Interval", HFILL } + }, + + { &hf_framereport_elements, + { "Frame Report Elements", "wlccp.framereport_elements", + FT_NONE, BASE_NONE, NULL, 0, + "Frame Report Elements", HFILL } + }, + + { &hf_wlccp_count, + { "Element Count", "wlccp.element_count", + FT_UINT8, BASE_DEC, NULL, 0, + "Element Count", HFILL } + }, + + { &hf_wlccp_numframes, + { "Number of frames", "wlccp.numframes", + FT_UINT8, BASE_DEC, NULL, 0, + "Number of Frames", HFILL } + }, + + { &hf_wlccp_mfpcapability, + { "MFP Capability", "wlccp.mfp_capability", + FT_UINT16, BASE_HEX, NULL, 0, + "MFP Capability", HFILL } + }, + + { &hf_wlccp_mfpflags, + { "MFP Flags", "wlccp.mfp_flags", + FT_UINT16, BASE_HEX, NULL, 0, + "MFP Flags", HFILL } + }, + + { &hf_wlccp_mfpconfig, + { "MFP Config", "wlccp.mfp_config", + FT_UINT16, BASE_HEX, NULL, 0, + "MFP Config", HFILL } + }, + + { &hf_wlccp_clientmac, + { "Client MAC", "wlccp.client_mac", + FT_ETHER, BASE_NONE, NULL, 0, + "Client MAC", HFILL } + }, + + { &hf_reg_lifetime, + { "Reg. LifeTime", "wlccp.reg_lifetime", + FT_UINT8, BASE_DEC, NULL, 0, + "Reg. LifeTime", HFILL } + }, + + { &hf_time_elapsed, + { "Elapsed Time", "wlccp.time_elapsed", + FT_UINT16, BASE_DEC, NULL, 0, + "Elapsed Time", HFILL } + }, + + { &hf_wlccp_parent_ap_mac, + { "Parent AP MAC", "wlccp.parent_ap_mac", + FT_ETHER, BASE_NONE, NULL, 0, + "Parent AP MAC", HFILL } + }, + + { &hf_wlccp_auth_type, + { "Authentication Type", "wlccp.auth_type", + FT_UINT8, BASE_HEX, NULL, 0, + "Authentication Type", HFILL } + }, + + { &hf_wlccp_radius_user_name, + { "RADIUS Username", "wlccp.radius_username", + FT_STRING, BASE_NONE, NULL, + 0x0, "RADIUS Username", HFILL } + }, + + { &hf_wds_reason, + { "Reason Code", "wlccp.wds_reason", + FT_UINT8, BASE_HEX, NULL, 0, + "Reason Code", HFILL } + }, + + + { &hf_wlccp_tlv_unknown_value, + { "Unknown TLV Contents", "wlccp.tlv_unknown_value", + FT_BYTES, BASE_HEX, NULL, 0, + "Unknown TLV Contents", HFILL } + } + + }; /* hf_register_info hf */ + /* Setup protocol subtree array */ static gint *ett[] = { &ett_wlccp, + &ett_wlccp_sap_tree, &ett_wlccp_type, - &ett_wlccp_flags - }; + &ett_wlccp_flags, + &ett_wlccp_cm_flags, + &ett_wlccp_rm_flags, + &ett_wlccp_nm_flags, + &ett_wlccp_ap_node_id, + &ett_wlccp_eapol_msg_tree, + &ett_wlccp_eap_tree, + &ett_wlccp_tlv_tree, + &ett_tlv_flags_tree, + &ett_tlv_sub_tree, + &ett_80211_capability_flags_tree, + &ett_framereport_elements_tree + }; /* static gint *ett[] */ /* Register the protocol name and description */ proto_wlccp = proto_register_protocol("Cisco Wireless LAN Context Control Protocol", "WLCCP", "wlccp"); @@ -585,17 +3876,18 @@ proto_register_wlccp(void) proto_register_subtree_array(ett, array_length(ett)); -} +} void proto_reg_handoff_wlccp(void) { static gboolean inited = FALSE; - + if( !inited ) { dissector_handle_t wlccp_handle; + eap_handle = find_dissector("eap"); wlccp_handle = create_dissector_handle(dissect_wlccp, proto_wlccp); @@ -619,6 +3911,6 @@ proto_register_wlccp_oui(void) 0x0, "", HFILL } } }; - + llc_add_oui(OUI_CISCOWL, "llc.wlccp_pid", "Cisco WLCCP OUI PID", hf); } |