diff options
author | Ba?ak Kalfa <basakkalfa@gmail.com> | 2018-12-05 22:18:46 -0800 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-12-06 06:29:02 +0000 |
commit | 7805221e4a104a73867a28cf6a51c7270831c9b3 (patch) | |
tree | 903f0bb013a515cdd8dac0d16d737ff9c8874f0c /plugins | |
parent | 0da8a3dbd3786268d72ea96fe21340b5f9a9cd47 (diff) |
PROFINET: PDPortDataReal_block dissection is changed.
According to specification, PortState is renamed and dissected
as "LinkState.Link" and "LinkState.Port" which are both 8 bits.
Change-Id: I1eff258f48d6fd76286ae08a7d2d80793ea23f12
Reviewed-on: https://code.wireshark.org/review/30913
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/epan/profinet/packet-dcerpc-pn-io.c | 60 |
1 files changed, 52 insertions, 8 deletions
diff --git a/plugins/epan/profinet/packet-dcerpc-pn-io.c b/plugins/epan/profinet/packet-dcerpc-pn-io.c index e2f34b7822..7e65393e14 100644 --- a/plugins/epan/profinet/packet-dcerpc-pn-io.c +++ b/plugins/epan/profinet/packet-dcerpc-pn-io.c @@ -428,6 +428,8 @@ static int hf_pn_io_PreambleLength = -1; static int hf_pn_io_mau_type = -1; static int hf_pn_io_mau_type_mode = -1; static int hf_pn_io_port_state = -1; +static int hf_pn_io_link_state_port = -1; +static int hf_pn_io_link_state_link = -1; static int hf_pn_io_line_delay = -1; static int hf_pn_io_line_delay_value = -1; static int hf_pn_io_cable_delay_value = -1; @@ -2051,6 +2053,33 @@ static const value_string pn_io_port_state[] = { }; +static const value_string pn_io_link_state_port[] = { + { 0x00, "unknown" }, + { 0x01, "disabled/discarding" }, + { 0x02, "blocking" }, + { 0x03, "listening" }, + { 0x04, "learning" }, + { 0x05, "forwarding" }, + { 0x06, "broken" }, + /*0x07 - 0xFF reserved */ + { 0, NULL } +}; + + +static const value_string pn_io_link_state_link[] = { + { 0x00, "reserved" }, + { 0x01, "up" }, + { 0x02, "down" }, + { 0x03, "testing" }, + { 0x04, "unknown" }, + { 0x05, "dormant" }, + { 0x06, "notpresent" }, + { 0x07, "lowerlayerdown" }, + /*0x08 - 0xFF reserved */ + { 0, NULL } +}; + + static const value_string pn_io_media_type[] = { { 0x0000, "Unknown" }, { 0x0001, "Copper cable" }, @@ -4908,7 +4937,8 @@ dissect_PDPortDataReal_block(tvbuff_t *tvb, int offset, guint16 u16MAUType; guint32 u32DomainBoundary; guint32 u32MulticastBoundary; - guint16 u16PortState; + guint8 u8LinkStatePort; + guint8 u8LinkStateLink; guint32 u32MediaType; guint32 u32LineDelayValue; @@ -4990,9 +5020,12 @@ dissect_PDPortDataReal_block(tvbuff_t *tvb, int offset, /* MulticastBoundary */ offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_multicast_boundary, &u32MulticastBoundary); - /* PortState */ - offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep, - hf_pn_io_port_state, &u16PortState); + /* LinkState.Port */ + offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, + hf_pn_io_link_state_port, &u8LinkStatePort); + /* LinkState.Link */ + offset = dissect_dcerpc_uint8(tvb, offset, pinfo, tree, drep, + hf_pn_io_link_state_link, &u8LinkStateLink); /* Padding */ offset = dissect_pn_align4(tvb, offset, pinfo, tree); @@ -5000,9 +5033,10 @@ dissect_PDPortDataReal_block(tvbuff_t *tvb, int offset, offset = dissect_dcerpc_uint32(tvb, offset, pinfo, tree, drep, hf_pn_io_media_type, &u32MediaType); - proto_item_append_text(item, ": Slot:0x%x/0x%x, OwnPortID:%s, Peers:%u PortState:%s MediaType:%s", + proto_item_append_text(item, ": Slot:0x%x/0x%x, OwnPortID:%s, Peers:%u LinkState.Port:%s LinkState.Link:%s MediaType:%s", u16SlotNr, u16SubslotNr, pOwnPortID, u8NumberOfPeers, - val_to_str(u16PortState, pn_io_port_state, "0x%x"), + val_to_str(u8LinkStatePort, pn_io_link_state_port, "0x%x"), + val_to_str(u8LinkStateLink, pn_io_link_state_link, "0x%x"), val_to_str(u32MediaType, pn_io_media_type, "0x%x")); return offset; @@ -12756,8 +12790,8 @@ proto_register_pn_io (void) FT_UINT32, BASE_HEX, VALS(pn_io_peer_to_peer_boundary_value_bit2), 0x4, NULL, HFILL } }, - { &hf_pn_io_peer_to_peer_boundary_value_otherbits, - { "AdjustPeerToPeer-Boundary", "pn_io.peer_to_peer_boundary_value_otherbits", + { &hf_pn_io_peer_to_peer_boundary_value_otherbits, + { "AdjustPeerToPeer-Boundary", "pn_io.peer_to_peer_boundary_value_otherbits", FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF8, NULL, HFILL } }, @@ -12766,6 +12800,16 @@ proto_register_pn_io (void) FT_UINT16, BASE_HEX, VALS(pn_io_port_state), 0x0, NULL, HFILL } }, + { &hf_pn_io_link_state_port, + { "LinkState.Port", "pn_io.link_state_port", + FT_UINT8, BASE_HEX, VALS(pn_io_link_state_port), 0x0, + NULL, HFILL } + }, + { &hf_pn_io_link_state_link, + { "LinkState.Link", "pn_io.link_state_link", + FT_UINT8, BASE_HEX, VALS(pn_io_link_state_link), 0x0, + NULL, HFILL } + }, { &hf_pn_io_line_delay, { "LineDelay", "pn_io.line_delay", FT_UINT32, BASE_HEX, NULL, 0x0, |