aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorgizem.yurdagul <gizemnuryurdagul@gmail.com>2017-12-05 13:14:06 +0300
committerMichael Mann <mmann78@netscape.net>2017-12-06 12:41:45 +0000
commit27f7bbbec20966c671eeb094caad0399f54d8203 (patch)
tree24f0a987fb875dba06d29b531ce98cec6d894dd8 /plugins
parent99ea13988da6a6e5234aa4f5f3614b9aacfe1c5b (diff)
PROFINET: AdjustPeerToPeerBoundary disection is added.
According to specification, AdjustPeerToPeerBoundary is a subblock for adjusting the peer to peer boundary. Change-Id: I4036aa08509300e0b8533c94b991c9a21077f634 Reviewed-on: https://code.wireshark.org/review/24710 Reviewed-by: Birol Capa <birol.capa@siemens.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/profinet/packet-dcerpc-pn-io.c110
1 files changed, 109 insertions, 1 deletions
diff --git a/plugins/profinet/packet-dcerpc-pn-io.c b/plugins/profinet/packet-dcerpc-pn-io.c
index 8703a4b288..cfd251758e 100644
--- a/plugins/profinet/packet-dcerpc-pn-io.c
+++ b/plugins/profinet/packet-dcerpc-pn-io.c
@@ -766,6 +766,12 @@ static int hf_pn_io_dcp_boundary_value = -1;
static int hf_pn_io_dcp_boundary_value_bit0 = -1;
static int hf_pn_io_dcp_boundary_value_bit1 = -1;
static int hf_pn_io_dcp_boundary_value_otherbits = -1;
+
+static int hf_pn_io_peer_to_peer_boundary_value = -1;
+static int hf_pn_io_peer_to_peer_boundary_value_bit0 = -1;
+static int hf_pn_io_peer_to_peer_boundary_value_bit1 = -1;
+static int hf_pn_io_peer_to_peer_boundary_value_bit2 = -1;
+static int hf_pn_io_peer_to_peer_boundary_value_otherbits = -1;
/* static int hf_pn_io_packedframe_SFCRC = -1; */
static gint ett_pn_io = -1;
static gint ett_pn_io_block = -1;
@@ -837,6 +843,7 @@ static gint ett_pn_io_asset_management_block = -1;
static gint ett_pn_io_am_location = -1;
static gint ett_pn_io_dcp_boundary = -1;
+static gint ett_pn_io_peer_to_peer_boundary = -1;
#define PD_SUB_FRAME_BLOCK_FIOCR_PROPERTIES_LENGTH 4
#define PD_SUB_FRAME_BLOCK_FRAME_ID_LENGTH 2
@@ -2579,6 +2586,35 @@ static const value_string pn_io_dcp_boundary_value_bit1[] = {
{ 0x01, "Block an outgoing DCP_Hello frame (egress filter) with the multicast MAC address 01-0E-CF-00-00-01" },
{ 0, NULL }
};
+
+static const value_string pn_io_peer_to_peer_boundary_value_bit0[] = {
+ { 0x00, "The LLDP agent shall send LLDP frames for this port." },
+ { 0x01, "The LLDP agent shall not send LLDP frames (egress filter)." },
+ { 0, NULL }
+};
+
+static const value_string pn_io_peer_to_peer_boundary_value_bit1[] = {
+ { 0x00, "The PTCP ASE shall send PTCP_DELAY request frames for this port." },
+ { 0x01, "The PTCP ASE shall not send PTCP_DELAY request frames (egress filter)." },
+ { 0, NULL }
+};
+
+static const value_string pn_io_peer_to_peer_boundary_value_bit2[] = {
+ { 0x00, "The Time ASE shall send PATH_DELAY request frames for this port." },
+ { 0x01, "The Time ASE shall not send PATH_DELAY request frames (egress filter)." },
+ { 0, NULL }
+};
+
+static const range_string pn_io_mau_type_extension[] = {
+ { 0x0000, 0x0000, "No SubMAUType" },
+ { 0x0001, 0x00FF, "Reserved" },
+ { 0x0100, 0x0100, "POF" },
+ { 0x0101, 0xFFEF, "Reserved for SubMAUType" },
+ { 0xFFF0, 0xFFFF, "Reserved" },
+ { 0, 0, NULL }
+};
+
+
static const value_string pn_io_port_state[] = {
{ 0x0000, "reserved" },
{ 0x0001, "up" },
@@ -6687,6 +6723,49 @@ dissect_PDPortFODataCheck_block(tvbuff_t *tvb, int offset,
return offset;
}
+
+/* dissect the AdjustPeerToPeerBoundary block */
+static int
+dissect_AdjustPeerToPeerBoundary_block(tvbuff_t *tvb, int offset,
+ packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint8 *drep, guint8 u8BlockVersionHigh, guint8 u8BlockVersionLow)
+{
+ proto_item *sub_item;
+ proto_tree *sub_tree;
+ guint32 u32PeerToPeerBoundary;
+ guint16 u16AdjustProperties;
+
+ if (u8BlockVersionHigh != 1 || u8BlockVersionLow != 0) {
+ expert_add_info_format(pinfo, item, &ei_pn_io_block_version,
+ "Block version %u.%u not implemented yet!", u8BlockVersionHigh, u8BlockVersionLow);
+ return offset;
+ }
+
+ /* Padding */
+ offset = dissect_pn_align4(tvb, offset, pinfo, tree);
+
+ sub_item = proto_tree_add_item(tree, hf_pn_io_peer_to_peer_boundary_value, tvb, offset, 4, ENC_BIG_ENDIAN);
+ sub_tree = proto_item_add_subtree(sub_item, ett_pn_io_peer_to_peer_boundary);
+
+ /* PeerToPeerBoundary.Bit0 */
+ dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_peer_to_peer_boundary_value_bit0, &u32PeerToPeerBoundary);
+
+ /* PeerToPeerBoundary.Bit1 */
+ dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_peer_to_peer_boundary_value_bit1, &u32PeerToPeerBoundary);
+
+ /* PeerToPeerBoundary.Bit2 */
+ dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_peer_to_peer_boundary_value_bit2, &u32PeerToPeerBoundary);
+
+ /* PeerToPeerBoundary.OtherBits */
+ offset = dissect_dcerpc_uint32(tvb, offset, pinfo, sub_tree, drep, hf_pn_io_peer_to_peer_boundary_value_otherbits, &u32PeerToPeerBoundary);
+
+ /* Properties */
+ offset = dissect_dcerpc_uint16(tvb, offset, pinfo, tree, drep,
+ hf_pn_io_adjust_properties, &u16AdjustProperties);
+
+ return offset;
+}
+
+
/* dissect the AdjustDCPBoundary block */
static int
dissect_AdjustDCPBoundary_block(tvbuff_t *tvb, int offset,
@@ -10588,6 +10667,9 @@ dissect_block(tvbuff_t *tvb, int offset,
case(0x0223):
dissect_PDPortFODataCheck_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
break;
+ case(0x0224):
+ dissect_AdjustPeerToPeerBoundary_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
+ break;
case(0x0225):
dissect_AdjustDCPBoundary_block(tvb, offset, pinfo, sub_tree, sub_item, drep, u8BlockVersionHigh, u8BlockVersionLow);
break;
@@ -13584,6 +13666,31 @@ proto_register_pn_io (void)
FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
NULL, HFILL }
},
+ { &hf_pn_io_peer_to_peer_boundary_value,
+ { "AdjustPeerToPeer-Boundary", "pn_io.peer_to_peer_boundary_value",
+ FT_UINT32, BASE_HEX, NULL, 0x0,
+ NULL, HFILL }
+ },
+ { &hf_pn_io_peer_to_peer_boundary_value_bit0,
+ { "AdjustPeerToPeer-Boundary", "pn_io.peer_to_peer_boundary_value_bit0",
+ FT_UINT32, BASE_HEX, VALS(pn_io_peer_to_peer_boundary_value_bit0), 0x1,
+ NULL, HFILL }
+ },
+ { &hf_pn_io_peer_to_peer_boundary_value_bit1,
+ { "AdjustPeerToPeer-Boundary", "pn_io.peer_to_peer_boundary_value_bit1",
+ FT_UINT32, BASE_HEX, VALS(pn_io_peer_to_peer_boundary_value_bit1), 0x2,
+ NULL, HFILL }
+ },
+ { &hf_pn_io_peer_to_peer_boundary_value_bit2,
+ { "AdjustPeerToPeer-Boundary", "pn_io.peer_to_peer_boundary_value_bit2",
+ 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",
+ FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF8,
+ NULL, HFILL }
+ },
{ &hf_pn_io_port_state,
{ "PortState", "pn_io.port_state",
FT_UINT16, BASE_HEX, VALS(pn_io_port_state), 0x0,
@@ -14900,7 +15007,8 @@ proto_register_pn_io (void)
&ett_pn_io_sr_properties,
&ett_pn_io_line_delay,
&ett_pn_io_counter_status,
- &ett_pn_io_dcp_boundary
+ &ett_pn_io_dcp_boundary,
+ &ett_pn_io_peer_to_peer_boundary
};
static ei_register_info ei[] = {