From aebc99a49c325fa26040cd8bf4b8342a49b541e4 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 7 Sep 2015 16:03:11 +0200 Subject: IAP: Enhance Aruba IAP dissector After some analysis, update the dissector Display only VC IP when type = 3, 4, 5 or 7 Change-Id: I53214125eebe978f67f6503072638ce3521cd155 Reviewed-on: https://code.wireshark.org/review/10441 Reviewed-by: Alexis La Goutte Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-aruba-iap.c | 109 +++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 24 deletions(-) (limited to 'epan/dissectors/packet-aruba-iap.c') diff --git a/epan/dissectors/packet-aruba-iap.c b/epan/dissectors/packet-aruba-iap.c index dfb24536aa..6e4730336a 100644 --- a/epan/dissectors/packet-aruba-iap.c +++ b/epan/dissectors/packet-aruba-iap.c @@ -24,10 +24,19 @@ /* * Aruba Instant AP broadcast on L2 Layer with ethertype 0x8ffd - * All frame start with 0xbeef (Magic number ?) - * The address IP(v4) of Aruba Instant AP is available start in offset 11 - * the 3 octet is may be a type field(found some frame with this octet is different and data is different) - * Octet to 7 to 10 is may be uptime of AP (the value always increment ) + * All frame start with 0xbeef (Magic number) + * Octet 1 : Header (version) + * Octet 2 : Type (only see type 3, 4, 5, 7 with IP Address...) + * Octet 3 : Length + * Octet 4 : Id + * + * Only for Type 3, 4, 5 and 7 + * Octet 5 : Status (Master / Slave..) + * Octet 6-9 : timestamp + * Octet 10-13 : The address IP(v4) of VC (Virtual Controller) + * Octet 14 : Unknown + * Octet 15-16 : Vlan ID (of Uplink) + * Octet 17-20 : Unknown... */ #include "config.h" @@ -43,9 +52,15 @@ void proto_reg_handoff_aruba_iap(void); static int proto_aruba_iap = -1; static gint ett_aruba_iap = -1; -static int hf_iap_magic = -1; -static int hf_iap_type = -1; -static int hf_iap_ip = -1; +static int hf_iap_magic = -1; +static int hf_iap_version = -1; +static int hf_iap_type = -1; +static int hf_iap_length = -1; +static int hf_iap_id = -1; +static int hf_iap_status = -1; +static int hf_iap_uptime = -1; +static int hf_iap_vc_ip = -1; +static int hf_iap_pvid = -1; static int hf_iap_unknown_uint = -1; static int hf_iap_unknown_bytes = -1; @@ -55,6 +70,7 @@ dissect_aruba_iap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat proto_tree *ti; proto_tree *aruba_iap_tree; guint16 magic; + guint8 type; int offset = 0; magic = tvb_get_ntohs(tvb, offset); @@ -73,26 +89,47 @@ dissect_aruba_iap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* dat proto_tree_add_item(aruba_iap_tree, hf_iap_magic, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; + proto_tree_add_item(aruba_iap_tree, hf_iap_version, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + col_add_fstr(pinfo->cinfo, COL_INFO, "Aruba Instant AP"); + proto_tree_add_item(aruba_iap_tree, hf_iap_type, tvb, offset, 1, ENC_BIG_ENDIAN); + type = tvb_get_guint8(tvb, offset); + offset += 1; + + proto_tree_add_item(aruba_iap_tree, hf_iap_length, tvb, offset, 1, ENC_BIG_ENDIAN); offset += 1; - proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_uint, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; + proto_tree_add_item(aruba_iap_tree, hf_iap_id, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + + if(type == 3 || type == 4 || type == 5 || type == 7){ + + proto_tree_add_item(aruba_iap_tree, hf_iap_status, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; + + proto_tree_add_item(aruba_iap_tree, hf_iap_uptime, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; - proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_uint, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; + proto_tree_add_item(aruba_iap_tree, hf_iap_vc_ip, tvb, offset, 4, ENC_BIG_ENDIAN); + col_append_fstr(pinfo->cinfo, COL_INFO, " VC IP: %s", tvb_ip_to_str(tvb, offset)); + offset += 4; - proto_tree_add_item(aruba_iap_tree, hf_iap_ip, tvb, offset, 4, ENC_BIG_ENDIAN); - col_add_fstr(pinfo->cinfo, COL_INFO, "Aruba Instant AP IP: %s", tvb_ip_to_str(tvb, offset)); - offset += 4; + proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_uint, tvb, offset, 1, ENC_BIG_ENDIAN); + offset += 1; - proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_uint, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; + proto_tree_add_item(aruba_iap_tree, hf_iap_pvid, tvb, offset, 2, ENC_BIG_ENDIAN); + offset += 2; - proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_uint, tvb, offset, 4, ENC_BIG_ENDIAN); - offset += 4; + proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_uint, tvb, offset, 4, ENC_BIG_ENDIAN); + offset += 4; + + proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_bytes, tvb, offset, -1, ENC_NA); + + } else { + proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_bytes, tvb, offset, -1, ENC_NA); + } - proto_tree_add_item(aruba_iap_tree, hf_iap_unknown_bytes, tvb, offset, -1, ENC_NA); return tvb_reported_length(tvb); } @@ -104,13 +141,37 @@ proto_register_aruba_iap(void) { "Magic", "aruba_iap.magic", FT_UINT16, BASE_HEX, NULL,0x0, "Magic Number of IAP trafic (Always 0x8ffd)", HFILL}}, + { &hf_iap_version, + { "Version", "aruba_iap.version", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL}}, + { &hf_iap_type, - { "Type (?)", "aruba_iap.type", FT_UINT8, BASE_DEC_HEX, NULL, 0x0, - "May type field...", HFILL}}, + { "Type", "aruba_iap.type", FT_UINT8, BASE_DEC, NULL, 0x0, + "Type of message", HFILL}}, + + { &hf_iap_length, + { "Length", "aruba_iap.length", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL}}, + + { &hf_iap_id, + { "Id", "aruba_iap.id", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL}}, + + { &hf_iap_status, + { "Status", "aruba_iap.status", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL}}, + + { &hf_iap_uptime, + { "Uptime", "aruba_iap.uptime", FT_UINT32, BASE_DEC, NULL, 0x0, + NULL, HFILL}}, + + { &hf_iap_vc_ip, + { "VC IP", "aruba_iap.vc_ip", FT_IPv4, BASE_NONE, NULL, 0x0, + "Address IP of Virtual Controller", HFILL}}, - { &hf_iap_ip, - { "IP", "aruba_iap.ip", FT_IPv4, BASE_NONE, NULL, 0x0, - "Address IP of IAP", HFILL}}, + { &hf_iap_pvid, + { "PVID (Port Vlan ID)", "aruba_iap.pvid", FT_UINT16, BASE_DEC, NULL, 0x0, + "Vlan ID (of Uplink)", HFILL}}, { &hf_iap_unknown_bytes, { "Unknown", "aruba_iap.unknown.bytes", FT_BYTES, BASE_NONE, NULL, 0x0, -- cgit v1.2.1