diff options
Diffstat (limited to 'epan/dissectors/packet-dpnss-link.c')
-rw-r--r-- | epan/dissectors/packet-dpnss-link.c | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/epan/dissectors/packet-dpnss-link.c b/epan/dissectors/packet-dpnss-link.c index 9ae4334c32..42e77b8812 100644 --- a/epan/dissectors/packet-dpnss-link.c +++ b/epan/dissectors/packet-dpnss-link.c @@ -1,29 +1,29 @@ /* packet-dpnss-link.c * Routines for DPNNS/DASS2 link layer dissection * Copyright 2009, Rolf Fiedler <rolf.fiedler[at]innoventif[dot]de> - * + * * $Id$ * * 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. */ /* References: - * BTNR188 + * BTNR188 * ND1301:2001/03 http://www.nicc.org.uk/nicc-public/Public/interconnectstandards/dpnss/nd1301_2004_11.pdf */ @@ -31,12 +31,9 @@ # include "config.h" #endif -#include <stdlib.h> - #include <glib.h> #include <epan/packet.h> -#include <epan/proto.h> static dissector_handle_t dpnss_handle; /* DPNSS UI frame dissector */ #define LINK_HEADER_SIZE 3 @@ -110,36 +107,36 @@ dissect_dpnss_link(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) uton = pinfo->pseudo_header->l1event.uton; /* Make entries in src and dst column */ - if (check_col(pinfo->cinfo, COL_DEF_SRC)) + if (check_col(pinfo->cinfo, COL_DEF_SRC)) col_set_str(pinfo->cinfo, COL_DEF_SRC, uton?"TE":"NT"); - if (check_col(pinfo->cinfo, COL_DEF_DST)) + if (check_col(pinfo->cinfo, COL_DEF_DST)) col_set_str(pinfo->cinfo, COL_DEF_DST, uton?"NT":"TE"); item = proto_tree_add_item(tree, proto_dpnss_link, tvb, 0, -1, FALSE); dpnss_link_tree = proto_item_add_subtree(item, ett_dpnss_link); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_framegroup, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_framegroup, tvb, 0, 1, FALSE); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_crbit, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_crbit, tvb, 0, 1, FALSE); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_extension, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address_extension, tvb, 0, 1, FALSE); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_reserved, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_reserved, tvb, 1, 1, FALSE); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_dlcId, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_dlcId, tvb, 1, 1, FALSE); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_dlcIdNr, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_dlcIdNr, tvb, 1, 1, FALSE); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_extension, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_address2_extension, tvb, 1, 1, FALSE); - proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_control_frameType, + proto_tree_add_item(dpnss_link_tree, hf_dpnss_link_control_frameType, tvb, 2, 1, FALSE); octet = tvb_get_guint8(tvb, 2); switch (octet){ case FRAME_TYPE_UI_EVEN: case FRAME_TYPE_UI_ODD: protocol_data_length=tvb_length(tvb)-LINK_HEADER_SIZE; - protocol_data_tvb=tvb_new_subset(tvb, LINK_HEADER_SIZE, - protocol_data_length, + protocol_data_tvb=tvb_new_subset(tvb, LINK_HEADER_SIZE, + protocol_data_length, protocol_data_length); if (dpnss_handle && protocol_data_length>0) { call_dissector(dpnss_handle, protocol_data_tvb, pinfo, tree); @@ -161,43 +158,43 @@ void proto_register_dpnss_link(void) { static hf_register_info hf[] = { - { &hf_dpnss_link_address_framegroup, + { &hf_dpnss_link_address_framegroup, { "Frame Group", "dpnss_link.framegroup", FT_UINT8, BASE_DEC, VALS(dpnss_link_framegroup_vals), 0xfc, NULL, HFILL } }, - { &hf_dpnss_link_address_crbit, + { &hf_dpnss_link_address_crbit, { "C/R Bit", "dpnss_link.crbit", FT_UINT8, BASE_DEC, VALS(dpnss_link_crbit_vals), 0x02, NULL, HFILL } }, - { &hf_dpnss_link_address_extension, - { "Extension", "dpnss_link.extension", + { &hf_dpnss_link_address_extension, + { "Extension", "dpnss_link.extension", FT_UINT8, BASE_DEC, VALS(dpnss_link_extend_vals), 0x01, NULL, HFILL } }, - { &hf_dpnss_link_address2_reserved, + { &hf_dpnss_link_address2_reserved, { "Reserved", "dpnss_link.reserved", FT_UINT8, BASE_DEC, VALS(dpnss_link_reserved_vals), 0x80, NULL, HFILL } }, - { &hf_dpnss_link_address2_dlcId, + { &hf_dpnss_link_address2_dlcId, { "DLC ID", "dpnss_link.dlcId", FT_UINT8, BASE_DEC, VALS(dpnss_link_dlcId_vals), 0x40, NULL, HFILL } }, - { &hf_dpnss_link_address2_dlcIdNr, + { &hf_dpnss_link_address2_dlcIdNr, { "DLC ID Number", "dpnss_link.dlcIdNr", FT_UINT8, BASE_DEC, NULL, 0x3e, NULL, HFILL } }, - { &hf_dpnss_link_address2_extension, - { "Extension", "dpnss_link.extension2", + { &hf_dpnss_link_address2_extension, + { "Extension", "dpnss_link.extension2", FT_UINT8, BASE_DEC, VALS(dpnss_link_extend_vals), 0x01, NULL, HFILL } }, - { &hf_dpnss_link_control_frameType, - { "Frame Type", "dpnss_link.frameType", + { &hf_dpnss_link_control_frameType, + { "Frame Type", "dpnss_link.frameType", FT_UINT8, BASE_DEC, VALS(dpnss_link_frameType_vals), 0xff, NULL, HFILL } } |