summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2006-11-29 06:44:07 +0000
committerAnders Broman <anders.broman@ericsson.com>2006-11-29 06:44:07 +0000
commit6c9ce8acf8610f9c5ff99215eb3650ec0b6e0688 (patch)
tree8ec6fc9d92c3351e1dec0eec3a14a7a1290a6155
parent35482921b20efde6d5856cad5df217bfabd323c8 (diff)
downloadwireshark-6c9ce8acf8610f9c5ff99215eb3650ec0b6e0688.tar.gz
Froim Rene Pilz:
This patch consists also the last issues. Additionally it solves: - For the SSCOP frames the AAL5 decoding was not performed due to an earlier patch. This caused that no SSCOP message was properly decoded. - As the detection between a LANE frame and a SSCOP frame is rather hard a switch within the atm dissector is included which enforce SSCOP dissecting over a LANE frame. At the moment I do not see a better solution for that. svn path=/trunk/; revision=20013
-rw-r--r--epan/column-utils.c4
-rw-r--r--epan/column.c24
-rw-r--r--epan/column_info.h2
-rw-r--r--epan/dissectors/packet-atm.c20
-rw-r--r--epan/dissectors/packet-bssgp.c5
-rw-r--r--epan/dissectors/packet-fr.c7
-rw-r--r--wiretap/atm.c4
-rw-r--r--wiretap/erf.c5
-rw-r--r--wiretap/file_access.c2
9 files changed, 67 insertions, 6 deletions
diff --git a/epan/column-utils.c b/epan/column-utils.c
index 4dcd891afd..550302b658 100644
--- a/epan/column-utils.c
+++ b/epan/column-utils.c
@@ -1242,6 +1242,10 @@ col_fill_in(packet_info *pinfo)
case COL_8021Q_VLAN_ID:
break;
+ case COL_FR_DLCI: /* done by packet-fr.c */
+ case COL_BSSGP_TLLI: /* done by packet-bssgp.c */
+ break;
+
case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */
g_assert_not_reached();
break;
diff --git a/epan/column.c b/epan/column.c
index 33a85eb9d6..dc56cd0a2e 100644
--- a/epan/column.c
+++ b/epan/column.c
@@ -93,7 +93,9 @@ col_format_to_string(gint fmt) {
"%y",
"%z",
"%v",
- "%E"
+ "%E",
+ "%C",
+ "%l"
};
if (fmt < 0 || fmt >= NUM_COL_FMTS)
@@ -154,6 +156,8 @@ static const gchar *dlist[NUM_COL_FMTS] = {
"DCE/RPC context ID (cn_ctx_id)", /* COL_DCE_CTX */
"802.1Q VLAN id", /* COL_8021Q_VLAN_ID */
"TEI", /* XXX - why is it missing in column_utils.c and elsewhere? */
+ "Frame Relay DLCI", /* COL_FR_DLCI */
+ "GPRS BSSGP TLLI", /* COL_BSSGP_TLLI */
};
const gchar *
@@ -260,6 +264,12 @@ get_column_format_matches(gboolean *fmt_list, gint format) {
case COL_TEI:
fmt_list[COL_TEI] = TRUE;
break;
+ case COL_FR_DLCI:
+ fmt_list[COL_FR_DLCI] = TRUE;
+ break;
+ case COL_BSSGP_TLLI:
+ fmt_list[COL_BSSGP_TLLI] = TRUE;
+ break;
default:
break;
}
@@ -460,7 +470,7 @@ get_column_longest_string(gint format)
return "0000000";
break;
case COL_VSAN:
- return "000000";
+ return "000000";
break;
case COL_TX_RATE:
return "108.0";
@@ -486,6 +496,12 @@ get_column_longest_string(gint format)
case COL_TEI:
return "127";
break;
+ case COL_FR_DLCI:
+ return "8388608";
+ break;
+ case COL_BSSGP_TLLI:
+ return "0xffffffff";
+ break;
default: /* COL_INFO */
return "Source port: kerberos-master Destination port: kerberos-master";
break;
@@ -640,6 +656,10 @@ get_column_format_from_str(gchar *str) {
break;
case 'E':
return COL_TEI;
+ case 'C':
+ return COL_FR_DLCI;
+ case 'l':
+ return COL_BSSGP_TLLI;
break;
}
cptr++;
diff --git a/epan/column_info.h b/epan/column_info.h
index e2ad087073..20279bcdcd 100644
--- a/epan/column_info.h
+++ b/epan/column_info.h
@@ -101,6 +101,8 @@ enum {
COL_DCE_CTX, /* DCE/RPC connection oriented context id */
COL_8021Q_VLAN_ID, /* 802.1Q vlan ID */
COL_TEI, /* q.921 TEI */
+ COL_FR_DLCI, /* Frame Relay DLCI */
+ COL_BSSGP_TLLI, /* GPRS BSSGP IE TLLI */
NUM_COL_FMTS /* Should always be last */
};
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index ade879cd58..9034845cbe 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -37,6 +37,7 @@
#include "packet-eth.h"
#include "packet-tr.h"
#include "packet-llc.h"
+#include "prefs.h"
static int proto_atm = -1;
static int hf_atm_aal = -1;
@@ -70,6 +71,8 @@ static dissector_handle_t ilmi_handle;
static dissector_handle_t fp_handle;
static dissector_handle_t data_handle;
+static gboolean dissect_lanesscop = FALSE;
+
/*
* See
*
@@ -1017,7 +1020,8 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree_add_text(atm_tree, tvb, 0, 0, "Cells: %u",
reported_length/48);
}
- if (pinfo->pseudo_header->atm.aal == AAL_5 &&
+ if ((pinfo->pseudo_header->atm.aal == AAL_5 ||
+ pinfo->pseudo_header->atm.aal == AAL_SIGNALLING) &&
length >= reported_length) {
/*
* XXX - what if the packet is truncated? Can that happen?
@@ -1558,6 +1562,12 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_tree *atm_tree = NULL;
proto_item *atm_ti = NULL;
+
+ if ( pinfo->pseudo_header->atm.aal == AAL_5 &&
+ pinfo->pseudo_header->atm.type == TRAF_LANE &&
+ dissect_lanesscop ) {
+ pinfo->pseudo_header->atm.aal = AAL_SIGNALLING;
+ }
if (check_col(pinfo->cinfo, COL_PROTOCOL))
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM");
@@ -1677,6 +1687,9 @@ proto_register_atm(void)
&ett_atm_lane_lc_flags,
&ett_atm_lane_lc_tlv,
};
+
+ module_t *atm_module;
+
proto_atm = proto_register_protocol("ATM", "ATM", "atm");
proto_aal1 = proto_register_protocol("ATM AAL1", "AAL1", "aal1");
proto_aal3_4 = proto_register_protocol("ATM AAL3/4", "AAL3/4", "aal3_4");
@@ -1693,6 +1706,11 @@ proto_register_atm(void)
register_dissector("lane", dissect_lane, proto_atm_lane);
register_dissector("atm_untruncated", dissect_atm_untruncated, proto_atm);
+
+ atm_module = prefs_register_protocol ( proto_atm, NULL );
+ prefs_register_bool_preference ( atm_module, "dissect_lane_as_sscop", "Dissect LANE as SSCOP",
+ "Autodection between LANE and SSCOP is hard. As default LANE is preferred",
+ &dissect_lanesscop);
}
void
diff --git a/epan/dissectors/packet-bssgp.c b/epan/dissectors/packet-bssgp.c
index 39596bfb1d..6704bf5ab5 100644
--- a/epan/dissectors/packet-bssgp.c
+++ b/epan/dissectors/packet-bssgp.c
@@ -2892,6 +2892,11 @@ decode_iei_tlli(bssgp_ie_t *ie, build_info_t *bi, int ie_start_offset) {
col_append_sep_fstr(bi->pinfo->cinfo, COL_INFO, BSSGP_SEP,
"TLLI %#4x", tlli);
}
+
+ if (check_col(bi->pinfo->cinfo, COL_BSSGP_TLLI)) {
+ col_add_fstr(bi->pinfo->cinfo, COL_BSSGP_TLLI, "%#04x", tlli);
+ }
+
decode_nri(bi->bssgp_tree, bi, tlli);
}
diff --git a/epan/dissectors/packet-fr.c b/epan/dissectors/packet-fr.c
index d74972a2c8..c48c25e818 100644
--- a/epan/dissectors/packet-fr.c
+++ b/epan/dissectors/packet-fr.c
@@ -551,6 +551,8 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
proto_tree_add_boolean(octet_tree, hf_fr_dc, tvb, offset, 1, fr_octet);
proto_tree_add_boolean(octet_tree, hf_fr_ea, tvb, offset, 1, fr_octet);
+
+ offset++;
}
}
if (tree) {
@@ -561,6 +563,11 @@ dissect_fr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pinfo->ctype = CT_DLCI;
pinfo->circuit_id = address;
+ /* Add DLCI to a collumn */
+ if ( check_col(pinfo->cinfo, COL_FR_DLCI)) {
+ col_add_fstr(pinfo->cinfo, COL_FR_DLCI, "%u", address);
+ }
+
if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "DLCI %u", address);
diff --git a/wiretap/atm.c b/wiretap/atm.c
index 7882e73898..e7021cb9f3 100644
--- a/wiretap/atm.c
+++ b/wiretap/atm.c
@@ -74,6 +74,7 @@ atm_guess_traffic_type(const guint8 *pd, guint32 len,
* guessing based on the contents, if we have enough data
* to guess.
*/
+
if (len >= 3) {
if (pd[0] == 0xaa && pd[1] == 0xaa && pd[2] == 0x03) {
/*
@@ -81,7 +82,8 @@ atm_guess_traffic_type(const guint8 *pd, guint32 len,
* multiplexed RFC 1483 traffic.
*/
pseudo_header->atm.type = TRAF_LLCMX;
- } else if (len < 16) {
+ } else if ((pseudo_header->atm.aal5t_len &&
+ pseudo_header->atm.aal5t_len < 16) || len<16) {
/*
* As this cannot be a LANE Ethernet frame (less
* than 2 bytes of LANE header + 14 bytes of
diff --git a/wiretap/erf.c b/wiretap/erf.c
index 4961398b8d..60b2dfba2f 100644
--- a/wiretap/erf.c
+++ b/wiretap/erf.c
@@ -123,7 +123,10 @@ int erf_open(wtap *wth, int *err, gchar **err_info _U_)
guint32 packet_size;
erf_timestamp_t ts;
- if (file_read(&header,1,sizeof(header),wth->fh) != sizeof(header)) {
+ int r = file_read(&header,1,sizeof(header),wth->fh);
+
+ if (r == 0 ) break;
+ if (r != sizeof(header)) {
if ((*err = file_error(wth->fh)) != 0)
return -1;
else
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index cf8792c74a..6ba90b8206 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -117,6 +117,7 @@ static int (*const open_routines[])(wtap *, int *, char **) = {
* would be, for example, saved copies of a Telnet session
* to some box.
*/
+ erf_open,
etherpeek_open,
pppdump_open,
iseries_open,
@@ -127,7 +128,6 @@ static int (*const open_routines[])(wtap *, int *, char **) = {
csids_open,
vms_open,
cosine_open,
- erf_open,
hcidump_open,
};