aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-lacp.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2016-10-26 21:09:43 +0200
committerMichael Mann <mmann78@netscape.net>2016-10-28 13:52:19 +0000
commit01147f8369e76927d7a90cfa0b592457a1878839 (patch)
tree2125d5e98e3a7dc4c4c9f84b1c0e52c708a2d77a /epan/dissectors/packet-lacp.c
parentfa0e6adbc44f6c91389fd7bf031b92c5de7be61a (diff)
LACP: Add HP IRF vendor TLV
Change-Id: I8c0d18f104bf37686b9b53ad9e7d1b9f8a709f5c Reviewed-on: https://code.wireshark.org/review/18519 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-lacp.c')
-rw-r--r--epan/dissectors/packet-lacp.c68
1 files changed, 67 insertions, 1 deletions
diff --git a/epan/dissectors/packet-lacp.c b/epan/dissectors/packet-lacp.c
index 052eae05d2..d0cd4c1f4c 100644
--- a/epan/dissectors/packet-lacp.c
+++ b/epan/dissectors/packet-lacp.c
@@ -95,6 +95,14 @@ static int hf_lacp_term_reserved = -1;
static int hf_lacp_vendor = -1;
+static int hf_lacp_vendor_hp_length = -1;
+static int hf_lacp_vendor_hp_irf_domain = -1;
+static int hf_lacp_vendor_hp_irf_mac = -1;
+static int hf_lacp_vendor_hp_irf_switch = -1;
+static int hf_lacp_vendor_hp_irf_port = -1;
+static int hf_lacp_vendor_hp_unknown = -1;
+
+
/* Initialise the subtree pointers */
static gint ett_lacp = -1;
@@ -339,7 +347,39 @@ dissect_lacp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if(length_remaining) {
proto_tree_add_item(lacpdu_tree, hf_lacp_vendor, tvb, offset, length_remaining, ENC_NA);
- offset += length_remaining;
+ /* HP LACP MAD IRF, first bytes is always 0x64 and second bytes is the rest of length */
+ if (length_remaining > 2 && (tvb_get_guint8(tvb, offset) == 0x64) && ((length_remaining -2) == tvb_get_guint8(tvb, offset+1)) )
+ {
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_unknown, tvb, offset, 1, ENC_NA);
+ offset += 1;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_length, tvb, offset, 1, ENC_NA);
+ offset += 1;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_unknown, tvb, offset, 2, ENC_NA);
+ offset += 2;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_irf_domain, tvb, offset, 2, ENC_NA);
+ offset += 2;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_irf_mac, tvb, offset, 6, ENC_NA);
+ offset += 6;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_unknown, tvb, offset, 8, ENC_NA);
+ offset += 8;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_irf_switch, tvb, offset, 2, ENC_NA);
+ offset += 2;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_irf_port, tvb, offset, 2, ENC_NA);
+ offset += 2;
+
+ proto_tree_add_item(lacpdu_tree, hf_lacp_vendor_hp_unknown, tvb, offset, 2, ENC_NA);
+ offset += 2;
+
+ } else {
+ offset += length_remaining;
+ }
}
return offset;
@@ -576,6 +616,32 @@ proto_register_lacp(void)
{ "Unknown vendor", "lacp.vendor",
FT_BYTES, BASE_NONE, NULL, 0x0,
"Some extra bytes (Vendor Specific ?)", HFILL }},
+
+ /* HP IRF MAD LACP */
+ { &hf_lacp_vendor_hp_length,
+ { "Length", "lacp.vendor.hp.length",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "The length of HP TLV", HFILL }},
+ { &hf_lacp_vendor_hp_irf_domain,
+ { "IRF Domain", "lacp.vendor.hp.irf_domain",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ NULL, HFILL }},
+ { &hf_lacp_vendor_hp_irf_mac,
+ { "IRF MAC", "lacp.vendor.hp.irf_mac",
+ FT_ETHER, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+ { &hf_lacp_vendor_hp_irf_switch,
+ { "IRF Switch", "lacp.vendor.hp.irf_switch",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Number of switch on the IRF stack", HFILL }},
+ { &hf_lacp_vendor_hp_irf_port,
+ { "IRF Port", "lacp.vendor.hp.irf_port",
+ FT_UINT16, BASE_DEC, NULL, 0x0,
+ "Stack ID where the LACP is attached", HFILL }},
+ { &hf_lacp_vendor_hp_unknown,
+ { "Unknown", "lacp.vendor.hp.unknown",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
};
/* Setup protocol subtree array */