aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2003-04-19 20:13:23 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2003-04-19 20:13:23 +0000
commitd8b05d1729d16c0484b66eb7cb9ddac4303621b7 (patch)
tree5d3d9da0bcc8e54c690e1309b9b42d05d837c7d5
parent2f420ebf71a559ef42a7638af139b636c27ddae0 (diff)
downloadwireshark-d8b05d1729d16c0484b66eb7cb9ddac4303621b7.tar.gz
wireshark-d8b05d1729d16c0484b66eb7cb9ddac4303621b7.tar.bz2
wireshark-d8b05d1729d16c0484b66eb7cb9ddac4303621b7.zip
- add better INFO column handling using col_set_fence.
- change my e-mail. svn path=/trunk/; revision=7502
-rw-r--r--packet-isup.c6
-rw-r--r--packet-mtp2.c137
-rw-r--r--packet-mtp3.c12
-rw-r--r--packet-mtp3mg.c11
-rw-r--r--packet-ranap.c6
-rw-r--r--packet-sccp.c16
-rwxr-xr-xpacket-sccpmg.c12
7 files changed, 76 insertions, 124 deletions
diff --git a/packet-isup.c b/packet-isup.c
index 09ae385813..183b9b2f46 100644
--- a/packet-isup.c
+++ b/packet-isup.c
@@ -2,7 +2,7 @@
* Routines for ISUP dissection
* Copyright 2001, Martina Obermeier <martina.obermeier@icn.siemens.de>
*
- * $Id: packet-isup.c,v 1.20 2003/04/14 18:04:13 guy Exp $
+ * $Id: packet-isup.c,v 1.21 2003/04/19 20:13:22 tuexen Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -4038,8 +4038,8 @@ dissect_isup(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
message_type = tvb_get_guint8(tvb, CIC_OFFSET + CIC_LENGTH);
if (check_col(pinfo->cinfo, COL_INFO)){
- col_append_str(pinfo->cinfo, COL_INFO, val_to_str(message_type, isup_message_type_value_acro, "reserved"));
- col_append_str(pinfo->cinfo, COL_INFO, " ");
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, isup_message_type_value_acro, "reserved"));
+ col_set_fence(pinfo->cinfo, COL_INFO);
}
/* In the interest of speed, if "tree" is NULL, don't do any work not
diff --git a/packet-mtp2.c b/packet-mtp2.c
index 8aa2aba410..feec13a88d 100644
--- a/packet-mtp2.c
+++ b/packet-mtp2.c
@@ -3,9 +3,9 @@
* It is hopefully (needs testing) compliant to
* ITU-T Q.703
*
- * Copyright 2001, Michael Tuexen <michael.tuexen[AT]icn.siemens.de>
+ * Copyright 2001, Michael Tuexen <tuexen [AT] fh-muenster.de>
*
- * $Id: packet-mtp2.c,v 1.4 2002/08/28 21:00:22 jmayer Exp $
+ * $Id: packet-mtp2.c,v 1.5 2003/04/19 20:13:22 tuexen Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -33,7 +33,6 @@
#endif
#include <glib.h>
-
#include <epan/packet.h>
/* Initialize the protocol and registered fields */
@@ -57,14 +56,11 @@ static int mtp3_proto_id;
#define FSN_FIB_LENGTH 1
#define LI_LENGTH 1
#define HEADER_LENGTH (BSN_BIB_LENGTH + FSN_FIB_LENGTH + LI_LENGTH)
-#define SF_LENGTH 1
-#define LONG_SF_LENGTH 2
#define BSN_BIB_OFFSET 0
#define FSN_FIB_OFFSET (BSN_BIB_OFFSET + BSN_BIB_LENGTH)
#define LI_OFFSET (FSN_FIB_OFFSET + FSN_FIB_LENGTH)
#define SIO_OFFSET (LI_OFFSET + LI_LENGTH)
-#define SF_OFFSET (LI_OFFSET + LI_LENGTH)
#define BSN_MASK 0x7f
#define BIB_MASK 0x80
@@ -73,67 +69,58 @@ static int mtp3_proto_id;
#define LI_MASK 0x3f
#define SPARE_MASK 0xc0
-#define STATUS_O 0x0
-#define STATUS_N 0x1
-#define STATUS_E 0x2
-#define STATUS_OS 0x3
-#define STATUS_PO 0x4
-#define STATUS_B 0x5
-
-static const value_string status_field_vals[] = {
- { STATUS_O, "Status Indication O" },
- { STATUS_N, "Status Indication N" },
- { STATUS_E, "Status Indication E" },
- { STATUS_OS, "Status Indication OS" },
- { STATUS_PO, "Status Indication PO" },
- { STATUS_B, "Status Indication BO" },
- { 0, NULL}
-};
-
static void
dissect_mtp2_header(tvbuff_t *su_tvb, proto_item *mtp2_tree)
{
- guint8 bsn_bib, fsn_fib, li;
-
- bsn_bib = tvb_get_guint8(su_tvb, BSN_BIB_OFFSET);
- fsn_fib = tvb_get_guint8(su_tvb, FSN_FIB_OFFSET);
- li = tvb_get_guint8(su_tvb, LI_OFFSET);
-
if (mtp2_tree) {
- proto_tree_add_uint(mtp2_tree, hf_mtp2_bsn, su_tvb, BSN_BIB_OFFSET, BSN_BIB_LENGTH, bsn_bib);
- proto_tree_add_uint(mtp2_tree, hf_mtp2_bib, su_tvb, BSN_BIB_OFFSET, BSN_BIB_LENGTH, bsn_bib);
- proto_tree_add_uint(mtp2_tree, hf_mtp2_fsn, su_tvb, FSN_FIB_OFFSET, FSN_FIB_LENGTH, fsn_fib);
- proto_tree_add_uint(mtp2_tree, hf_mtp2_fib, su_tvb, FSN_FIB_OFFSET, FSN_FIB_LENGTH, fsn_fib);
- proto_tree_add_uint(mtp2_tree, hf_mtp2_li, su_tvb, LI_OFFSET, LI_LENGTH, li);
- proto_tree_add_uint(mtp2_tree, hf_mtp2_spare, su_tvb, LI_OFFSET, LI_LENGTH, li);
+ proto_tree_add_item(mtp2_tree, hf_mtp2_bsn, su_tvb, BSN_BIB_OFFSET, BSN_BIB_LENGTH, LITTLE_ENDIAN);
+ proto_tree_add_item(mtp2_tree, hf_mtp2_bib, su_tvb, BSN_BIB_OFFSET, BSN_BIB_LENGTH, LITTLE_ENDIAN);
+ proto_tree_add_item(mtp2_tree, hf_mtp2_fsn, su_tvb, FSN_FIB_OFFSET, FSN_FIB_LENGTH, LITTLE_ENDIAN);
+ proto_tree_add_item(mtp2_tree, hf_mtp2_fib, su_tvb, FSN_FIB_OFFSET, FSN_FIB_LENGTH, LITTLE_ENDIAN);
+ proto_tree_add_item(mtp2_tree, hf_mtp2_li, su_tvb, LI_OFFSET, LI_LENGTH, LITTLE_ENDIAN);
+ proto_tree_add_item(mtp2_tree, hf_mtp2_spare, su_tvb, LI_OFFSET, LI_LENGTH, LITTLE_ENDIAN);
}
}
static void
dissect_mtp2_fisu(packet_info *pinfo)
{
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO, "FISU");
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_set_str(pinfo->cinfo, COL_INFO, "FISU ");
+ col_set_fence(pinfo->cinfo, COL_INFO);
+ }
}
+static const value_string status_field_vals[] = {
+ { 0x0, "Status Indication O" },
+ { 0x1, "Status Indication N" },
+ { 0x2, "Status Indication E" },
+ { 0x3, "Status Indication OS" },
+ { 0x4, "Status Indication PO" },
+ { 0x5, "Status Indication BO" },
+ { 0, NULL}
+};
+
+#define SF_OFFSET (LI_OFFSET + LI_LENGTH)
+#define SF_LENGTH 1
+#define LONG_SF_LENGTH 2
+
static void
dissect_mtp2_lssu(tvbuff_t *su_tvb, packet_info *pinfo, proto_item *mtp2_tree)
{
- guint8 li, sf;
- guint16 long_sf;
-
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO, "LSSU");
+ guint8 li;
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_set_str(pinfo->cinfo, COL_INFO, "LSSU ");
+ col_set_fence(pinfo->cinfo, COL_INFO);
+ }
+
if (mtp2_tree) {
li = tvb_get_guint8(su_tvb, LI_OFFSET);
- if ((li & LI_MASK) == 1) {
- sf = tvb_get_guint8(su_tvb, SF_OFFSET);
- proto_tree_add_uint(mtp2_tree, hf_mtp2_sf, su_tvb, SF_OFFSET, SF_LENGTH, sf);
- } else {
- long_sf = tvb_get_letohs(su_tvb, SF_OFFSET);
- proto_tree_add_uint(mtp2_tree, hf_mtp2_long_sf, su_tvb, SF_OFFSET, LONG_SF_LENGTH, long_sf);
- }
+ if ((li & LI_MASK) == 1)
+ proto_tree_add_item(mtp2_tree, hf_mtp2_sf, su_tvb, SF_OFFSET, SF_LENGTH, LITTLE_ENDIAN);
+ else
+ proto_tree_add_item(mtp2_tree, hf_mtp2_long_sf, su_tvb, SF_OFFSET, LONG_SF_LENGTH, LITTLE_ENDIAN);
}
}
@@ -143,8 +130,8 @@ dissect_mtp2_msu(tvbuff_t *su_tvb, packet_info *pinfo, proto_item *mtp2_item, pr
gint sif_sio_length;
tvbuff_t *sif_sio_tvb;
- if ((check_col(pinfo->cinfo, COL_INFO)) && (!proto_is_protocol_enabled(mtp3_proto_id)))
- col_append_str(pinfo->cinfo, COL_INFO, "MSU");
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_set_str(pinfo->cinfo, COL_INFO, "MSU ");
sif_sio_length = tvb_length(su_tvb) - HEADER_LENGTH;
sif_sio_tvb = tvb_new_subset(su_tvb, SIO_OFFSET, sif_sio_length, sif_sio_length);
@@ -198,46 +185,14 @@ proto_register_mtp2(void)
{
static hf_register_info hf[] = {
- { &hf_mtp2_bsn,
- { "Backward sequence number", "mtp2.bsn",
- FT_UINT8, BASE_DEC, NULL, BSN_MASK,
- "", HFILL }
- },
- { &hf_mtp2_bib,
- { "Backward indicator bit", "mtp2.bib",
- FT_UINT8, BASE_DEC, NULL, BIB_MASK,
- "", HFILL }
- },
- { &hf_mtp2_fsn,
- { "Forward sequence number", "mtp2.fsn",
- FT_UINT8, BASE_DEC, NULL, FSN_MASK,
- "", HFILL }
- },
- { &hf_mtp2_fib,
- { "Forward indicator bit", "mtp2.fib",
- FT_UINT8, BASE_DEC, NULL, FIB_MASK,
- "", HFILL }
- },
- { &hf_mtp2_li,
- { "Length Indicator", "mtp2.li",
- FT_UINT8, BASE_DEC, NULL, LI_MASK,
- "", HFILL }
- },
- { &hf_mtp2_spare,
- { "Spare", "mtp2.spare",
- FT_UINT8, BASE_DEC, NULL, SPARE_MASK,
- "", HFILL }
- },
- { &hf_mtp2_sf,
- { "Status field", "mtp2.sf",
- FT_UINT8, BASE_DEC, VALS(status_field_vals), 0x0,
- "", HFILL }
- },
- { &hf_mtp2_long_sf,
- { "Status field", "mtp2.long_sf",
- FT_UINT16, BASE_HEX, NULL, 0x0,
- "", HFILL }
- }
+ { &hf_mtp2_bsn, { "Backward sequence number", "mtp2.bsn", FT_UINT8, BASE_DEC, NULL, BSN_MASK, "", HFILL } },
+ { &hf_mtp2_bib, { "Backward indicator bit", "mtp2.bib", FT_UINT8, BASE_DEC, NULL, BIB_MASK, "", HFILL } },
+ { &hf_mtp2_fsn, { "Forward sequence number", "mtp2.fsn", FT_UINT8, BASE_DEC, NULL, FSN_MASK, "", HFILL } },
+ { &hf_mtp2_fib, { "Forward indicator bit", "mtp2.fib", FT_UINT8, BASE_DEC, NULL, FIB_MASK, "", HFILL } },
+ { &hf_mtp2_li, { "Length Indicator", "mtp2.li", FT_UINT8, BASE_DEC, NULL, LI_MASK, "", HFILL } },
+ { &hf_mtp2_spare, { "Spare", "mtp2.spare", FT_UINT8, BASE_DEC, NULL, SPARE_MASK, "", HFILL } },
+ { &hf_mtp2_sf, { "Status field", "mtp2.sf", FT_UINT8, BASE_DEC, VALS(status_field_vals), 0x0, "", HFILL } },
+ { &hf_mtp2_long_sf, { "Status field", "mtp2.sf", FT_UINT16, BASE_HEX, NULL, 0x0, "", HFILL } }
};
static gint *ett[] = {
diff --git a/packet-mtp3.c b/packet-mtp3.c
index 4380738ea2..131f04668c 100644
--- a/packet-mtp3.c
+++ b/packet-mtp3.c
@@ -6,10 +6,10 @@
* ITU-T Q.704 7/1996
* GF 001-9001 (Chinese ITU variant)
*
- * Copyright 2001, Michael Tuexen <Michael.Tuexen@icn.siemens.de>
+ * Copyright 2001, Michael Tuexen <tuexen [AT] fh-muenster.de>
* Updated for ANSI and Chinese ITU support by Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
- * $Id: packet-mtp3.c,v 1.15 2003/04/10 18:52:09 guy Exp $
+ * $Id: packet-mtp3.c,v 1.16 2003/04/19 20:13:23 tuexen Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -315,12 +315,12 @@ dissect_mtp3_payload(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_set_str(pinfo->cinfo, COL_INFO, "DATA ");
+
if (!dissector_try_port(mtp3_sio_dissector_table, service_indicator,
- payload_tvb, pinfo, tree)) {
+ payload_tvb, pinfo, tree))
call_dissector(data_handle, payload_tvb, pinfo, tree);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_str(pinfo->cinfo, COL_INFO, "DATA ");
- }
}
/* Code to actually dissect the packets */
diff --git a/packet-mtp3mg.c b/packet-mtp3mg.c
index da3b12ccb3..237cd3e3d1 100644
--- a/packet-mtp3mg.c
+++ b/packet-mtp3mg.c
@@ -10,7 +10,7 @@
*
* Copyright 2003, Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
- * $Id: packet-mtp3mg.c,v 1.4 2003/04/10 18:52:11 guy Exp $
+ * $Id: packet-mtp3mg.c,v 1.5 2003/04/19 20:13:23 tuexen Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -416,10 +416,11 @@ static void
dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
- if (check_col(pinfo->cinfo, COL_INFO))
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(h1, chm_h1_message_type_acro_values, "Unknown"));
-
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(h1, chm_h1_message_type_acro_values, "Unknown"));
+ col_set_fence(pinfo->cinfo, COL_INFO);
+ }
+
switch (h1)
{
case CHM_H1_COO:
diff --git a/packet-ranap.c b/packet-ranap.c
index 7415d2cbcc..a4370f4851 100644
--- a/packet-ranap.c
+++ b/packet-ranap.c
@@ -3,7 +3,7 @@
* Based on 3GPP TS 25.413 V3.4.0
* Copyright 2001, Martin Held <Martin.Held@icn.siemens.de>
*
- * $Id: packet-ranap.c,v 1.16 2002/12/10 21:41:23 tuexen Exp $
+ * $Id: packet-ranap.c,v 1.17 2003/04/19 20:13:23 tuexen Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -4007,10 +4007,10 @@ dissect_ranap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
if (procedure_code <= PC_max)
{
- col_append_str(pinfo->cinfo, COL_INFO,
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(pdu_index, ranap_message_names[procedure_code],
"unknown message"));
- col_append_str(pinfo->cinfo, COL_INFO, " ");
+ col_set_fence(pinfo->cinfo, COL_INFO);
}
}
diff --git a/packet-sccp.c b/packet-sccp.c
index 8abc09d28b..20e9040088 100644
--- a/packet-sccp.c
+++ b/packet-sccp.c
@@ -8,7 +8,7 @@
*
* Copyright 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
- * $Id: packet-sccp.c,v 1.9 2003/04/10 18:52:11 guy Exp $
+ * $Id: packet-sccp.c,v 1.10 2003/04/19 20:13:22 tuexen Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -1179,8 +1179,7 @@ dissect_sccp_refusal_cause_param(tvbuff_t *tvb, proto_tree *tree, guint8 length)
/* This function is used for both data and long data (ITU only) parameters */
static void
-dissect_sccp_data_param(tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *sccp_tree, proto_tree *tree)
+dissect_sccp_data_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
/* Try subdissectors (if we found a valid SSN on the current message) */
@@ -1193,7 +1192,7 @@ dissect_sccp_data_param(tvbuff_t *tvb, packet_info *pinfo,
return;
/* No sub-dissection occured, treat it as raw data */
- call_dissector(data_handle, tvb, pinfo, sccp_tree);
+ call_dissector(data_handle, tvb, pinfo, tree);
}
static void
@@ -1388,7 +1387,7 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
break;
case PARAMETER_DATA:
- dissect_sccp_data_param(parameter_tvb, pinfo, sccp_tree, tree);
+ dissect_sccp_data_param(parameter_tvb, pinfo, tree);
/* TODO? Re-adjust length of SCCP item since it may be sub-dissected */
/* sccp_length = proto_item_get_len(sccp_item);
@@ -1415,7 +1414,7 @@ dissect_sccp_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
case PARAMETER_LONG_DATA:
if (mtp3_standard != ANSI_STANDARD)
- dissect_sccp_data_param(parameter_tvb, pinfo, sccp_tree, tree);
+ dissect_sccp_data_param(parameter_tvb, pinfo, tree);
else
dissect_sccp_unknown_param(parameter_tvb, sccp_tree, parameter_type,
parameter_length);
@@ -1543,10 +1542,9 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
message_type = tvb_get_guint8(tvb, MESSAGE_TYPE_OFFSET);
offset = MESSAGE_TYPE_LENGTH;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",
+ if (check_col(pinfo->cinfo, COL_INFO))
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(message_type, sccp_message_type_acro_values, "Unknown"));
- };
if (sccp_tree) {
/* add the message type to the protocol tree */
diff --git a/packet-sccpmg.c b/packet-sccpmg.c
index 6a425c209a..2c31e3b0df 100755
--- a/packet-sccpmg.c
+++ b/packet-sccpmg.c
@@ -8,7 +8,7 @@
*
* Copyright 2002, Jeff Morriss <jeff.morriss[AT]ulticom.com>
*
- * $Id: packet-sccpmg.c,v 1.3 2003/04/10 18:52:15 guy Exp $
+ * $Id: packet-sccpmg.c,v 1.4 2003/04/19 20:13:22 tuexen Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -233,12 +233,10 @@ dissect_sccpmg_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccpmg_tre
message_type = tvb_get_guint8(tvb, SCCPMG_MESSAGE_TYPE_OFFSET);
offset = SCCPMG_MESSAGE_TYPE_LENGTH;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_append_fstr(pinfo->cinfo, COL_INFO, "(%s) ",
- val_to_str(message_type,
- sccpmg_message_type_acro_values,
- "Unknown"));
- }
+ if (check_col(pinfo->cinfo, COL_INFO)) {
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, sccpmg_message_type_acro_values, "Unknown"));
+ col_set_fence(pinfo->cinfo, COL_INFO);
+ }
if (sccpmg_tree) {
/* add the message type to the protocol tree */