diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-10-21 02:10:19 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-10-21 02:10:19 +0000 |
commit | 794757ae8fbee85db2b24bc46b7e9cc492de01df (patch) | |
tree | a955184a13d8444bdec0de9200f261c46cfa2734 /plugins/profinet | |
parent | 449d732485da5a19b8a0d3ddef49ed30498712ff (diff) |
For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.
svn path=/trunk/; revision=39503
Diffstat (limited to 'plugins/profinet')
-rw-r--r-- | plugins/profinet/packet-pn-mrp.c | 34 | ||||
-rw-r--r-- | plugins/profinet/packet-pn-rt.c | 80 |
2 files changed, 57 insertions, 57 deletions
diff --git a/plugins/profinet/packet-pn-mrp.c b/plugins/profinet/packet-pn-mrp.c index 9c34ea4430..f820b06cfe 100644 --- a/plugins/profinet/packet-pn-mrp.c +++ b/plugins/profinet/packet-pn-mrp.c @@ -1,5 +1,5 @@ /* packet-pn-mrp.c - * Routines for PN-MRP (PROFINET Media Redundancy Protocol) + * Routines for PN-MRP (PROFINET Media Redundancy Protocol) * packet dissection. * * $Id$ @@ -7,17 +7,17 @@ * Wireshark - Network traffic analyzer * By Gerald Combs <gerald@wireshark.org> * Copyright 1998 Gerald Combs - * + * * This program is free software; you can redistribute it and/or * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -111,7 +111,7 @@ static const value_string pn_mrp_prio_vals[] = { static int -dissect_PNMRP_Common(tvbuff_t *tvb, int offset, +dissect_PNMRP_Common(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_item *item) { guint16 sequence_id; @@ -133,7 +133,7 @@ dissect_PNMRP_Common(tvbuff_t *tvb, int offset, static int -dissect_PNMRP_LinkUp(tvbuff_t *tvb, int offset, +dissect_PNMRP_LinkUp(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_item *item) { guint8 mac[6]; @@ -165,7 +165,7 @@ dissect_PNMRP_LinkUp(tvbuff_t *tvb, int offset, static int -dissect_PNMRP_LinkDown(tvbuff_t *tvb, int offset, +dissect_PNMRP_LinkDown(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_item *item) { guint8 mac[6]; @@ -197,7 +197,7 @@ dissect_PNMRP_LinkDown(tvbuff_t *tvb, int offset, static int -dissect_PNMRP_Test(tvbuff_t *tvb, int offset, +dissect_PNMRP_Test(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_item *item) { guint16 prio; @@ -238,7 +238,7 @@ dissect_PNMRP_Test(tvbuff_t *tvb, int offset, static int -dissect_PNMRP_TopologyChange(tvbuff_t *tvb, int offset, +dissect_PNMRP_TopologyChange(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_item *item) { guint16 prio; @@ -267,7 +267,7 @@ dissect_PNMRP_TopologyChange(tvbuff_t *tvb, int offset, static int -dissect_PNMRP_Option(tvbuff_t *tvb, int offset, +dissect_PNMRP_Option(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_item *item, guint8 length) { guint32 oui; @@ -276,7 +276,7 @@ dissect_PNMRP_Option(tvbuff_t *tvb, int offset, /* OUI (organizational unique id) */ offset = dissect_pn_oid(tvb, offset, pinfo,tree, hf_pn_mrp_oui, &oui); length -= 3; - + switch (oui) { case OUI_SIEMENS: @@ -308,7 +308,7 @@ dissect_PNMRP_Option(tvbuff_t *tvb, int offset, static int -dissect_PNMRP_PDU(tvbuff_t *tvb, int offset, +dissect_PNMRP_PDU(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, proto_item *item) { guint16 version; @@ -382,22 +382,22 @@ dissect_PNMRP(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti = NULL; proto_tree *mrp_tree = NULL; - + guint32 offset = 0; col_set_str(pinfo->cinfo, COL_PROTOCOL, "PN-MRP"); - + /* Clear the information column on summary display */ col_clear(pinfo->cinfo, COL_INFO); - if (tree) + if (tree) { - ti = proto_tree_add_item(tree, proto_pn_mrp, tvb, offset, -1, FALSE); + ti = proto_tree_add_item(tree, proto_pn_mrp, tvb, offset, -1, ENC_NA); mrp_tree = proto_item_add_subtree(ti, ett_pn_mrp); } dissect_PNMRP_PDU(tvb, offset, pinfo, mrp_tree, ti); -} +} void diff --git a/plugins/profinet/packet-pn-rt.c b/plugins/profinet/packet-pn-rt.c index a6dba80636..891093a3e1 100644 --- a/plugins/profinet/packet-pn-rt.c +++ b/plugins/profinet/packet-pn-rt.c @@ -80,7 +80,7 @@ static int hf_pn_rt_frag_status_fragment_number = -1; static int hf_pn_rt_frag_data = -1; -/* +/* * Define the trees for pn-rt * We need one tree for pn-rt itself and one for the pn-rt data status subtree */ @@ -90,8 +90,8 @@ static int ett_pn_rt_sf = -1; static int ett_pn_rt_frag = -1; static int ett_pn_rt_frag_status = -1; -/* - * Here are the global variables associated with +/* + * Here are the global variables associated with * the various user definable characteristics of the dissection */ /* Place summary in proto tree */ @@ -127,10 +127,10 @@ dissect_DataStatus(tvbuff_t *tvb, int offset, proto_tree *tree, guint8 u8DataSta proto_item *sub_item; proto_tree *sub_tree; - sub_item = proto_tree_add_uint_format(tree, hf_pn_rt_data_status, + sub_item = proto_tree_add_uint_format(tree, hf_pn_rt_data_status, tvb, offset, 1, u8DataStatus, - "DataStatus: 0x%02x (Frame: %s and %s, Provider: %s and %s)", - u8DataStatus, + "DataStatus: 0x%02x (Frame: %s and %s, Provider: %s and %s)", + u8DataStatus, (u8DataStatus & 0x04) ? "Valid" : "Invalid", (u8DataStatus & 0x01) ? "Primary" : "Backup", (u8DataStatus & 0x20) ? "Ok" : "Problem", @@ -287,7 +287,7 @@ dissect_FRAG_PDU_heur(tvbuff_t *tvb, /* XXX - should this use u8FragDataLength? */ - proto_tree_add_none_format(sub_tree, hf_pn_rt_frag_data, tvb, offset, tvb_length(tvb) - offset, + proto_tree_add_none_format(sub_tree, hf_pn_rt_frag_data, tvb, offset, tvb_length(tvb) - offset, "FragData: %d bytes", tvb_length(tvb) - offset); /* note: the actual defragmentation implementation is still missing here */ @@ -347,12 +347,12 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Initialize variables */ pn_rt_tree = NULL; ti = NULL; - + /* * Set the columns now, so that they'll be set correctly if we throw * an exception. We can set them (or append things) later again .... */ - + col_set_str(pinfo->cinfo, COL_PROTOCOL, "PN-RT"); col_set_str(pinfo->cinfo, COL_INFO, "PROFINET Real-Time"); @@ -629,7 +629,7 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) ti = proto_tree_add_protocol_format(tree, proto_pn_rt, tvb, 0, pdu_len, "PROFINET %s, %s", pszProtSummary, szFieldSummary); } else { - ti = proto_tree_add_item(tree, proto_pn_rt, tvb, 0, pdu_len, ENC_BIG_ENDIAN); + ti = proto_tree_add_item(tree, proto_pn_rt, tvb, 0, pdu_len, ENC_NA); } pn_rt_tree = proto_item_add_subtree(ti, ett_pn_rt); @@ -641,23 +641,23 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* add cycle counter */ proto_tree_add_uint_format(pn_rt_tree, hf_pn_rt_cycle_counter, tvb, pdu_len - 4, 2, u16CycleCounter, "CycleCounter: %u", u16CycleCounter); - + /* add data status subtree */ dissect_DataStatus(tvb, pdu_len - 2, tree, u8DataStatus); /* add transfer status */ if (u8TransferStatus) { proto_tree_add_uint_format(pn_rt_tree, hf_pn_rt_transfer_status, tvb, - pdu_len - 1, 1, u8TransferStatus, + pdu_len - 1, 1, u8TransferStatus, "TransferStatus: 0x%02x (ignore this frame)", u8TransferStatus); } else { proto_tree_add_uint_format(pn_rt_tree, hf_pn_rt_transfer_status, tvb, - pdu_len - 1, 1, u8TransferStatus, + pdu_len - 1, 1, u8TransferStatus, "TransferStatus: 0x%02x (OK)", u8TransferStatus); } } } - + /* update column info now */ col_add_str(pinfo->cinfo, COL_INFO, szFieldSummary); col_set_str(pinfo->cinfo, COL_PROTOCOL, pszProtShort); @@ -678,59 +678,59 @@ dissect_pn_rt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Register all the bits needed by the filtering engine */ -void +void proto_register_pn_rt(void) { static hf_register_info hf[] = { { &hf_pn_rt_frame_id, { "FrameID", "pn_rt.frame_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_cycle_counter, { + { &hf_pn_rt_cycle_counter, { "CycleCounter", "pn_rt.cycle_counter", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_data_status, { + { &hf_pn_rt_data_status, { "DataStatus", "pn_rt.ds", FT_UINT8, BASE_HEX, 0, 0x0, NULL, HFILL }}, - { &hf_pn_rt_data_status_ignore, { + { &hf_pn_rt_data_status_ignore, { "Ignore (1:Ignore/0:Evaluate)", "pn_rt.ds_ignore", FT_UINT8, BASE_HEX, 0, 0x80, NULL, HFILL }}, - { &hf_pn_rt_data_status_subframe_sender_mode, { + { &hf_pn_rt_data_status_subframe_sender_mode, { "SubFrameSenderMode", "pn_rt.ds_subframe_sender_mode", FT_UINT8, BASE_HEX, 0, 0x40, NULL, HFILL }}, - { &hf_pn_rt_data_status_ok, { + { &hf_pn_rt_data_status_ok, { "StationProblemIndicator (1:Ok/0:Problem)", "pn_rt.ds_ok", FT_UINT8, BASE_HEX, 0, 0x20, NULL, HFILL }}, - { &hf_pn_rt_data_status_operate, { + { &hf_pn_rt_data_status_operate, { "ProviderState (1:Run/0:Stop)", "pn_rt.ds_operate", FT_UINT8, BASE_HEX, 0, 0x10, NULL, HFILL }}, - { &hf_pn_rt_data_status_res3, { + { &hf_pn_rt_data_status_res3, { "Reserved (should be zero)", "pn_rt.ds_res3", FT_UINT8, BASE_HEX, 0, 0x08, NULL, HFILL }}, - { &hf_pn_rt_data_status_valid, { + { &hf_pn_rt_data_status_valid, { "DataValid (1:Valid/0:Invalid)", "pn_rt.ds_valid", FT_UINT8, BASE_HEX, 0, 0x04, NULL, HFILL }}, - { &hf_pn_rt_data_status_res1, { + { &hf_pn_rt_data_status_res1, { "Reserved (should be zero)", "pn_rt.ds_res1", FT_UINT8, BASE_HEX, 0, 0x02, NULL, HFILL }}, - { &hf_pn_rt_data_status_primary, { + { &hf_pn_rt_data_status_primary, { "State (1:Primary/0:Backup)", "pn_rt.ds_primary", FT_UINT8, BASE_HEX, 0, 0x01, NULL, HFILL }}, { &hf_pn_rt_transfer_status, { "TransferStatus", "pn_rt.transfer_status", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_sf, { + { &hf_pn_rt_sf, { "SubFrame", "pn_rt.sf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_sf_crc16, { + { &hf_pn_rt_sf_crc16, { "CRC16", "pn_rt.sf.crc16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_sf_position, { + { &hf_pn_rt_sf_position, { "Position", "pn_rt.sf.position", FT_UINT8, BASE_DEC, NULL, 0x7F, NULL, HFILL }}, - { &hf_pn_rt_sf_position_control, { + { &hf_pn_rt_sf_position_control, { "Control", "pn_rt.sf.position_control", FT_UINT8, BASE_DEC, VALS(pn_rt_position_control), 0x80, NULL, HFILL }}, - { &hf_pn_rt_sf_data_length, { + { &hf_pn_rt_sf_data_length, { "DataLength", "pn_rt.sf.data_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_sf_cycle_counter, { + { &hf_pn_rt_sf_cycle_counter, { "CycleCounter", "pn_rt.sf.cycle_counter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_frag, { + { &hf_pn_rt_frag, { "PROFINET Real-Time Fragment", "pn_rt.frag", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_frag_data_length, { + { &hf_pn_rt_frag_data_length, { "FragDataLength", "pn_rt.frag_data_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_frag_status, { + { &hf_pn_rt_frag_status, { "FragStatus", "pn_rt.frag_status", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_pn_rt_frag_status_more_follows, { + { &hf_pn_rt_frag_status_more_follows, { "MoreFollows", "pn_rt.frag_status.more_follows", FT_UINT8, BASE_HEX, VALS(pn_rt_frag_status_more_follows), 0x80, NULL, HFILL }}, - { &hf_pn_rt_frag_status_error, { + { &hf_pn_rt_frag_status_error, { "Error", "pn_rt.frag_status.error", FT_UINT8, BASE_HEX, VALS(pn_rt_frag_status_error), 0x40, NULL, HFILL }}, - { &hf_pn_rt_frag_status_fragment_number, { + { &hf_pn_rt_frag_status_fragment_number, { "FragmentNumber (zero based)", "pn_rt.frag_status.fragment_number", FT_UINT8, BASE_DEC, NULL, 0x3F, NULL, HFILL }}, - { &hf_pn_rt_frag_data, { + { &hf_pn_rt_frag_data, { "FragData", "pn_rt.frag_data", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }}, }; static gint *ett[] = { @@ -740,7 +740,7 @@ proto_register_pn_rt(void) &ett_pn_rt_frag, &ett_pn_rt_frag_status }; - module_t *pn_rt_module; + module_t *pn_rt_module; proto_pn_rt = proto_register_protocol("PROFINET Real-Time Protocol", "PN-RT", "pn_rt"); @@ -776,6 +776,6 @@ proto_reg_handoff_pn_rt(void) dissector_add_uint("udp.port", 0x8892, pn_rt_handle); heur_dissector_add("pn_rt", dissect_CSF_SDU_heur, proto_pn_rt); - heur_dissector_add("pn_rt", dissect_FRAG_PDU_heur, proto_pn_rt); + heur_dissector_add("pn_rt", dissect_FRAG_PDU_heur, proto_pn_rt); } |