aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-01-13 16:03:26 -0800
committerGuy Harris <guy@alum.mit.edu>2016-01-14 00:04:13 +0000
commitd9da77afe85ce91086be80df8802c565c8f9d84d (patch)
treeee196dee355f757f02ebd8732c43b862540d5b4a /epan
parent7c2eaefd07e2fb68ae8603c72e1151e5a81dd1b6 (diff)
Have various ATM dissectors use the data arguments for pseudo-headers.
Don't use the pseudo-header pointed to by pinfo->pseudo_header; have the argument either point to a struct atm_phdr or to a pwatm_private_data_t. Don't *overwrite* the pseudo-header pointed to by pinfo->pseudo_header if you need to construct an ATM pseudo-header for a dissector; have your own struct atm_phdr structure, fill it in, and pass a pointer to *that* to the sub-dissector. Cleans things up a bit. Change-Id: I4464924def4de41c625002b2d273592bd529e46e Reviewed-on: https://code.wireshark.org/review/13270 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-atm.c140
-rw-r--r--epan/dissectors/packet-catapult-dct2000.c4
-rw-r--r--epan/dissectors/packet-erf.c184
-rw-r--r--epan/dissectors/packet-fp_hint.c25
-rw-r--r--epan/dissectors/packet-meta.c53
-rw-r--r--epan/dissectors/packet-pw-atm.c61
6 files changed, 233 insertions, 234 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index 6888997681..8577e61709 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -672,15 +672,16 @@ capture_lane(const guchar *pd, int offset _U_,
}
static int
-dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
+dissect_lane(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
+ struct atm_phdr *atm_info = (struct atm_phdr *)data;
tvbuff_t *next_tvb;
tvbuff_t *next_tvb_le_client;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM LANE");
/* Is it LE Control, 802.3, 802.5, or "none of the above"? */
- switch (pinfo->pseudo_header->atm.subtype) {
+ switch (atm_info->subtype) {
case TRAF_ST_LANE_LE_CTRL:
dissect_le_control(tvb, pinfo, tree);
@@ -800,8 +801,8 @@ capture_atm(const guchar *pd, int offset _U_,
static void
dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_item *atm_ti,
- proto_tree *atm_tree, gboolean truncated, gboolean pseudowire_mode)
+ proto_item *atm_ti, proto_tree *atm_tree, gboolean truncated,
+ struct atm_phdr *atm_info, gboolean pseudowire_mode)
{
guint length, reported_length;
guint16 aal5_length;
@@ -816,44 +817,41 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* show the traffic type for AAL5 traffic, and the VPI and VCI,
* from the pseudo-header.
*/
- if (pinfo->pseudo_header->atm.aal == AAL_5) {
- proto_tree_add_uint(atm_tree, hf_atm_traffic_type, tvb, 0, 0, pinfo->pseudo_header->atm.type);
+ if (atm_info->aal == AAL_5) {
+ proto_tree_add_uint(atm_tree, hf_atm_traffic_type, tvb, 0, 0, atm_info->type);
- switch (pinfo->pseudo_header->atm.type) {
+ switch (atm_info->type) {
case TRAF_VCMX:
- proto_tree_add_uint(atm_tree, hf_atm_traffic_vcmx, tvb, 0, 0, pinfo->pseudo_header->atm.subtype);
+ proto_tree_add_uint(atm_tree, hf_atm_traffic_vcmx, tvb, 0, 0, atm_info->subtype);
break;
case TRAF_LANE:
- proto_tree_add_uint(atm_tree, hf_atm_traffic_lane, tvb, 0, 0, pinfo->pseudo_header->atm.subtype);
+ proto_tree_add_uint(atm_tree, hf_atm_traffic_lane, tvb, 0, 0, atm_info->subtype);
break;
case TRAF_IPSILON:
- proto_tree_add_uint(atm_tree, hf_atm_traffic_ipsilon, tvb, 0, 0, pinfo->pseudo_header->atm.subtype);
+ proto_tree_add_uint(atm_tree, hf_atm_traffic_ipsilon, tvb, 0, 0, atm_info->subtype);
break;
}
}
if (!pseudowire_mode) {
- proto_tree_add_uint(atm_tree, hf_atm_vpi, tvb, 0, 0,
- pinfo->pseudo_header->atm.vpi);
- proto_tree_add_uint(atm_tree, hf_atm_vci, tvb, 0, 0,
- pinfo->pseudo_header->atm.vci);
+ proto_tree_add_uint(atm_tree, hf_atm_vpi, tvb, 0, 0, atm_info->vpi);
+ proto_tree_add_uint(atm_tree, hf_atm_vci, tvb, 0, 0, atm_info->vci);
/* Also show vpi/vci in info column */
col_append_fstr(pinfo->cinfo, COL_INFO, " VPI=%u, VCI=%u",
- pinfo->pseudo_header->atm.vpi,
- pinfo->pseudo_header->atm.vci);
+ atm_info->vpi, atm_info->vci);
}
next_tvb = tvb;
- if (truncated || pinfo->pseudo_header->atm.flags & ATM_REASSEMBLY_ERROR) {
+ if (truncated || atm_info->flags & ATM_REASSEMBLY_ERROR) {
/*
* The packet data does not include stuff such as the AAL5
* trailer, either because it was explicitly left out or because
* reassembly failed.
*/
- if (pinfo->pseudo_header->atm.cells != 0) {
+ if (atm_info->cells != 0) {
/*
* If the cell count is 0, assume it means we don't know how
* many cells it was.
@@ -865,11 +863,11 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* have the AAL5 trailer information.
*/
if (tree) {
- proto_tree_add_uint(atm_tree, hf_atm_cells, tvb, 0, 0, pinfo->pseudo_header->atm.cells);
- proto_tree_add_uint(atm_tree, hf_atm_aal5_uu, tvb, 0, 0, pinfo->pseudo_header->atm.aal5t_u2u >> 8);
- proto_tree_add_uint(atm_tree, hf_atm_aal5_cpi, tvb, 0, 0, pinfo->pseudo_header->atm.aal5t_u2u & 0xFF);
- proto_tree_add_uint(atm_tree, hf_atm_aal5_len, tvb, 0, 0, pinfo->pseudo_header->atm.aal5t_len);
- proto_tree_add_uint(atm_tree, hf_atm_aal5_crc, tvb, 0, 0, pinfo->pseudo_header->atm.aal5t_chksum);
+ proto_tree_add_uint(atm_tree, hf_atm_cells, tvb, 0, 0, atm_info->cells);
+ proto_tree_add_uint(atm_tree, hf_atm_aal5_uu, tvb, 0, 0, atm_info->aal5t_u2u >> 8);
+ proto_tree_add_uint(atm_tree, hf_atm_aal5_cpi, tvb, 0, 0, atm_info->aal5t_u2u & 0xFF);
+ proto_tree_add_uint(atm_tree, hf_atm_aal5_len, tvb, 0, 0, atm_info->aal5t_len);
+ proto_tree_add_uint(atm_tree, hf_atm_aal5_crc, tvb, 0, 0, atm_info->aal5t_chksum);
}
}
} else {
@@ -888,8 +886,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
*/
proto_tree_add_uint(atm_tree, hf_atm_cells, tvb, 0, 0, reported_length/48);
}
- if ((pinfo->pseudo_header->atm.aal == AAL_5 ||
- pinfo->pseudo_header->atm.aal == AAL_SIGNALLING) &&
+ if ((atm_info->aal == AAL_5 || atm_info->aal == AAL_SIGNALLING) &&
length >= reported_length) {
/*
* XXX - what if the packet is truncated? Can that happen?
@@ -951,18 +948,18 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* Don't try to dissect the payload of PDUs with a reassembly
* error.
*/
- switch (pinfo->pseudo_header->atm.aal) {
+ switch (atm_info->aal) {
case AAL_SIGNALLING:
- if (!(pinfo->pseudo_header->atm.flags & ATM_REASSEMBLY_ERROR)) {
+ if (!(atm_info->flags & ATM_REASSEMBLY_ERROR)) {
call_dissector(sscop_handle, next_tvb, pinfo, tree);
decoded = TRUE;
}
break;
case AAL_5:
- if (!(pinfo->pseudo_header->atm.flags & ATM_REASSEMBLY_ERROR)) {
- if (dissector_try_uint(atm_type_aal5_table, pinfo->pseudo_header->atm.type, next_tvb, pinfo, tree))
+ if (!(atm_info->flags & ATM_REASSEMBLY_ERROR)) {
+ if (dissector_try_uint_new(atm_type_aal5_table, atm_info->type, next_tvb, pinfo, tree, TRUE, atm_info))
{
decoded = TRUE;
}
@@ -1027,14 +1024,14 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case AAL_2:
proto_tree_add_uint(atm_tree, hf_atm_cid, tvb, 0, 0,
- pinfo->pseudo_header->atm.aal2_cid);
+ atm_info->aal2_cid);
proto_item_append_text(atm_ti, " (vpi=%u vci=%u cid=%u)",
- pinfo->pseudo_header->atm.vpi,
- pinfo->pseudo_header->atm.vci,
- pinfo->pseudo_header->atm.aal2_cid);
+ atm_info->vpi,
+ atm_info->vci,
+ atm_info->aal2_cid);
- if (!(pinfo->pseudo_header->atm.flags & ATM_REASSEMBLY_ERROR)) {
- if (pinfo->pseudo_header->atm.flags & ATM_AAL2_NOPHDR) {
+ if (!(atm_info->flags & ATM_REASSEMBLY_ERROR)) {
+ if (atm_info->flags & ATM_AAL2_NOPHDR) {
next_tvb = tvb;
} else {
/* Skip first 4 bytes of message
@@ -1045,7 +1042,7 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
next_tvb = tvb_new_subset_remaining(tvb, 4);
}
- if (dissector_try_uint(atm_type_aal2_table, pinfo->pseudo_header->atm.type, next_tvb, pinfo, tree))
+ if (dissector_try_uint(atm_type_aal2_table, atm_info->type, next_tvb, pinfo, tree))
{
decoded = TRUE;
}
@@ -1324,8 +1321,7 @@ static const value_string ft_ad_vals[] = {
static void
dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo,
- proto_tree *tree, guint aal,
- const pwatm_private_data_t *pwpd)
+ proto_tree *tree, guint aal, gboolean fill_columns)
{
proto_tree *aal_tree;
proto_item *ti;
@@ -1383,7 +1379,7 @@ dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo,
break;
case AAL_OAMCELL:
- if (NULL == pwpd || pwpd->enable_fill_columns_by_atm_dissector)
+ if (fill_columns)
{
col_set_str(pinfo->cinfo, COL_PROTOCOL, "OAM AAL");
col_clear(pinfo->cinfo, COL_INFO);
@@ -1391,7 +1387,7 @@ dissect_atm_cell_payload(tvbuff_t *tvb, int offset, packet_info *pinfo,
ti = proto_tree_add_item(tree, proto_oamaal, tvb, offset, -1, ENC_NA);
aal_tree = proto_item_add_subtree(ti, ett_oamaal);
octet = tvb_get_guint8(tvb, offset);
- if (NULL == pwpd || pwpd->enable_fill_columns_by_atm_dissector)
+ if (fill_columns)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "%s",
val_to_str(octet >> 4, oam_type_vals, "Unknown (%u)"));
@@ -1550,27 +1546,25 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- dissect_atm_cell_payload(tvb, offset, pinfo, tree, aal, NULL);
+ dissect_atm_cell_payload(tvb, offset, pinfo, tree, aal, TRUE);
}
static int
dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- gboolean truncated, const pwatm_private_data_t *pwpd)
+ gboolean truncated, struct atm_phdr *atm_info, gboolean pseudowire_mode)
{
proto_tree *atm_tree = NULL;
proto_item *atm_ti = NULL;
- gboolean pseudowire_mode = (NULL != pwpd);
- if ( pinfo->pseudo_header->atm.aal == AAL_5 &&
- pinfo->pseudo_header->atm.type == TRAF_LANE &&
+ if ( atm_info->aal == AAL_5 && atm_info->type == TRAF_LANE &&
dissect_lanesscop ) {
- pinfo->pseudo_header->atm.aal = AAL_SIGNALLING;
+ atm_info->aal = AAL_SIGNALLING;
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM");
if (!pseudowire_mode) {
- switch (pinfo->pseudo_header->atm.channel) {
+ switch (atm_info->channel) {
case 0:
/* Traffic from DTE to DCE. */
@@ -1586,13 +1580,13 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- if (pinfo->pseudo_header->atm.aal == AAL_5) {
+ if (atm_info->aal == AAL_5) {
col_add_fstr(pinfo->cinfo, COL_INFO, "AAL5 %s",
- val_to_str(pinfo->pseudo_header->atm.type, aal5_hltype_vals,
+ val_to_str(atm_info->type, aal5_hltype_vals,
"Unknown traffic type (%u)"));
} else {
col_add_str(pinfo->cinfo, COL_INFO,
- val_to_str(pinfo->pseudo_header->atm.aal, aal_vals,
+ val_to_str(atm_info->aal, aal_vals,
"Unknown AAL (%u)"));
}
@@ -1601,27 +1595,27 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
atm_tree = proto_item_add_subtree(atm_ti, ett_atm);
if (!pseudowire_mode) {
- proto_tree_add_uint(atm_tree, hf_atm_channel, tvb, 0, 0, pinfo->pseudo_header->atm.channel);
- if (pinfo->pseudo_header->atm.flags & ATM_REASSEMBLY_ERROR)
+ proto_tree_add_uint(atm_tree, hf_atm_channel, tvb, 0, 0, atm_info->channel);
+ if (atm_info->flags & ATM_REASSEMBLY_ERROR)
expert_add_info(pinfo, atm_ti, &ei_atm_reassembly_failed);
}
proto_tree_add_uint_format_value(atm_tree, hf_atm_aal, tvb, 0, 0,
- pinfo->pseudo_header->atm.aal,
+ atm_info->aal,
"%s",
- val_to_str(pinfo->pseudo_header->atm.aal, aal_vals,
+ val_to_str(atm_info->aal, aal_vals,
"Unknown AAL (%u)"));
}
- if (pinfo->pseudo_header->atm.flags & ATM_RAW_CELL) {
+ if (atm_info->flags & ATM_RAW_CELL) {
/* This is a single cell, with the cell header at the beginning. */
- if (pinfo->pseudo_header->atm.flags & ATM_NO_HEC) {
+ if (atm_info->flags & ATM_NO_HEC) {
proto_item_set_len(atm_ti, 4);
} else {
proto_item_set_len(atm_ti, 5);
}
dissect_atm_cell(tvb, pinfo, tree, atm_tree,
- pinfo->pseudo_header->atm.aal, FALSE,
- pinfo->pseudo_header->atm.flags & ATM_NO_HEC);
+ atm_info->aal, FALSE,
+ atm_info->flags & ATM_NO_HEC);
} else {
/* This is a reassembled PDU. */
@@ -1631,38 +1625,43 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* PW dissector to ATM dissector. For decoding normal ATM traffic
* data parameter should be NULL.
*/
- dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, atm_ti, truncated, pwpd != NULL);
+ dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, atm_ti, truncated,
+ atm_info, pseudowire_mode);
}
return tvb_reported_length(tvb);
}
static int
-dissect_atm_truncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
+dissect_atm_truncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- return dissect_atm_common(tvb, pinfo, tree, TRUE, NULL);
+ struct atm_phdr *atm_info = (struct atm_phdr *)data;
+
+ return dissect_atm_common(tvb, pinfo, tree, TRUE, atm_info, FALSE);
}
static int
-dissect_atm_pw_truncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
+dissect_atm_pw_truncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- const pwatm_private_data_t *pwpd = (const pwatm_private_data_t *)data;
+ struct atm_phdr *atm_info = (struct atm_phdr *)data;
- return dissect_atm_common(tvb, pinfo, tree, TRUE, pwpd);
+ return dissect_atm_common(tvb, pinfo, tree, TRUE, atm_info, TRUE);
}
static int
-dissect_atm_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
+dissect_atm_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- return dissect_atm_common(tvb, pinfo, tree, FALSE, NULL);
+ struct atm_phdr *atm_info = (struct atm_phdr *)data;
+
+ return dissect_atm_common(tvb, pinfo, tree, FALSE, atm_info, FALSE);
}
static int
-dissect_atm_pw_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
+dissect_atm_pw_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
- const pwatm_private_data_t *pwpd = (const pwatm_private_data_t *)data;
+ struct atm_phdr *atm_info = (struct atm_phdr *)data;
- return dissect_atm_common(tvb, pinfo, tree, FALSE, pwpd);
+ return dissect_atm_common(tvb, pinfo, tree, FALSE, atm_info, TRUE);
}
static int
@@ -1687,7 +1686,8 @@ dissect_atm_pw_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM");
- dissect_atm_cell_payload(tvb, 0, pinfo, tree, AAL_OAMCELL, pwpd);
+ dissect_atm_cell_payload(tvb, 0, pinfo, tree, AAL_OAMCELL,
+ pwpd->enable_fill_columns_by_atm_dissector);
return tvb_reported_length(tvb);
}
diff --git a/epan/dissectors/packet-catapult-dct2000.c b/epan/dissectors/packet-catapult-dct2000.c
index b1c3cd16d9..349dd9645b 100644
--- a/epan/dissectors/packet-catapult-dct2000.c
+++ b/epan/dissectors/packet-catapult-dct2000.c
@@ -2091,6 +2091,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
int encap;
dissector_handle_t protocol_handle = 0;
dissector_handle_t heur_protocol_handle = 0;
+ void *protocol_data = 0;
int sub_dissector_result = 0;
const char *protocol_name;
gboolean is_comment, is_sprint = FALSE;
@@ -2349,6 +2350,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
break;
case WTAP_ENCAP_ATM_PDUS_UNTRUNCATED:
protocol_handle = find_dissector("atm_untruncated");
+ protocol_data = &pinfo->pseudo_header->dct2000.inner_pseudo_header.atm;
break;
case WTAP_ENCAP_PPP:
protocol_handle = find_dissector("ppp_hdlc");
@@ -2804,7 +2806,7 @@ dissect_catapult_dct2000(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
if (protocol_handle != 0) {
/* Dissect the remainder of the frame using chosen protocol handle */
next_tvb = tvb_new_subset_remaining(tvb, offset);
- sub_dissector_result = call_dissector_only(protocol_handle, next_tvb, pinfo, tree, NULL);
+ sub_dissector_result = call_dissector_only(protocol_handle, next_tvb, pinfo, tree, protocol_data);
}
diff --git a/epan/dissectors/packet-erf.c b/epan/dissectors/packet-erf.c
index 8baf3888ff..a345170e22 100644
--- a/epan/dissectors/packet-erf.c
+++ b/epan/dissectors/packet-erf.c
@@ -352,6 +352,7 @@ static dissector_handle_t sdh_handle;
/* AAL2 */
#define AAL2_CID_MASK 0x000000ff
+#define AAL2_CID_SHIFT 0
#define AAL2_MAALE_MASK 0x0000ff00
#define AAL2_MAALEI_MASK 0x00010000
#define AAL2_FIRST_MASK 0x00020000
@@ -464,14 +465,14 @@ static const value_string channelised_type[] = {
/* Copy of atm_guess_traffic_type from atm.c in /wiretap */
static void
erf_atm_guess_lane_type(tvbuff_t *tvb, int offset, guint len,
- union wtap_pseudo_header *pseudo_header)
+ struct atm_phdr *atm_info)
{
if (len >= 2) {
if (tvb_get_ntohs(tvb, offset) == 0xFF00) {
/*
* Looks like LE Control traffic.
*/
- pseudo_header->atm.subtype = TRAF_ST_LANE_LE_CTRL;
+ atm_info->subtype = TRAF_ST_LANE_LE_CTRL;
} else {
/*
* XXX - Ethernet, or Token Ring?
@@ -481,41 +482,41 @@ erf_atm_guess_lane_type(tvbuff_t *tvb, int offset, guint len,
* still be situations where the user has to
* tell us.
*/
- pseudo_header->atm.subtype = TRAF_ST_LANE_802_3;
+ atm_info->subtype = TRAF_ST_LANE_802_3;
}
}
}
static void
erf_atm_guess_traffic_type(tvbuff_t *tvb, int offset, guint len,
- union wtap_pseudo_header *pseudo_header)
+ struct atm_phdr *atm_info)
{
/*
* Start out assuming nothing other than that it's AAL5.
*/
- pseudo_header->atm.aal = AAL_5;
- pseudo_header->atm.type = TRAF_UNKNOWN;
- pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ atm_info->aal = AAL_5;
+ atm_info->type = TRAF_UNKNOWN;
+ atm_info->subtype = TRAF_ST_UNKNOWN;
- if (pseudo_header->atm.vpi == 0) {
+ if (atm_info->vpi == 0) {
/*
* Traffic on some PVCs with a VPI of 0 and certain
* VCIs is of particular types.
*/
- switch (pseudo_header->atm.vci) {
+ switch (atm_info->vci) {
case 5:
/*
* Signalling AAL.
*/
- pseudo_header->atm.aal = AAL_SIGNALLING;
+ atm_info->aal = AAL_SIGNALLING;
return;
case 16:
/*
* ILMI.
*/
- pseudo_header->atm.type = TRAF_ILMI;
+ atm_info->type = TRAF_ILMI;
return;
}
}
@@ -533,15 +534,15 @@ erf_atm_guess_traffic_type(tvbuff_t *tvb, int offset, guint len,
* Looks like a SNAP header; assume it's LLC
* multiplexed RFC 1483 traffic.
*/
- pseudo_header->atm.type = TRAF_LLCMX;
- } else if ((pseudo_header->atm.aal5t_len &&
- pseudo_header->atm.aal5t_len < 16) || len<16) {
+ atm_info->type = TRAF_LLCMX;
+ } else if ((atm_info->aal5t_len &&
+ atm_info->aal5t_len < 16) || len<16) {
/*
* As this cannot be a LANE Ethernet frame (less
* than 2 bytes of LANE header + 14 bytes of
* Ethernet header) we can try it as a SSCOP frame.
*/
- pseudo_header->atm.aal = AAL_SIGNALLING;
+ atm_info->aal = AAL_SIGNALLING;
} else if (((mtp3b = tvb_get_guint8(tvb, offset)) == 0x83) || (mtp3b == 0x81)) {
/*
* MTP3b headers often encapsulate
@@ -549,20 +550,20 @@ erf_atm_guess_traffic_type(tvbuff_t *tvb, int offset, guint len,
* This should cause 0x83 or 0x81
* in the first byte.
*/
- pseudo_header->atm.aal = AAL_SIGNALLING;
+ atm_info->aal = AAL_SIGNALLING;
} else {
/*
* Assume it's LANE.
*/
- pseudo_header->atm.type = TRAF_LANE;
- erf_atm_guess_lane_type(tvb, offset, len, pseudo_header);
+ atm_info->type = TRAF_LANE;
+ erf_atm_guess_lane_type(tvb, offset, len, atm_info);
}
} else {
/*
* Not only VCI 5 is used for signaling. It might be
* one of these VCIs.
*/
- pseudo_header->atm.aal = AAL_SIGNALLING;
+ atm_info->aal = AAL_SIGNALLING;
}
}
@@ -1145,6 +1146,7 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
guint8 first_byte;
tvbuff_t *new_tvb;
guint8 aal2_cid;
+ struct atm_phdr atm_info;
erf_type=pinfo->pseudo_header->erf.phdr.type & 0x7F;
@@ -1226,46 +1228,48 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
/* continue with type ATM */
case ERF_TYPE_ATM:
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
+ memset(&atm_info, 0, sizeof(atm_info));
atm_hdr = tvb_get_ntohl(tvb, 0);
- pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20);
- pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
- pinfo->pseudo_header->atm.channel = (flags & 0x03);
+ atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
+ atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
+ atm_info.channel = (flags & 0x03);
/* Work around to have decoding working */
if (erf_rawcell_first) {
new_tvb = tvb_new_subset_remaining(tvb, ATM_HDR_LENGTH);
/* Treat this as a (short) ATM AAL5 PDU */
- pinfo->pseudo_header->atm.aal = AAL_5;
+ atm_info.aal = AAL_5;
switch (erf_aal5_type) {
case ERF_AAL5_GUESS:
- pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ atm_info.type = TRAF_UNKNOWN;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
/* Try to guess the type according to the first bytes */
- erf_atm_guess_traffic_type(new_tvb, 0, tvb_captured_length(new_tvb), pinfo->pseudo_header);
+ erf_atm_guess_traffic_type(new_tvb, 0, tvb_captured_length(new_tvb), &atm_info);
break;
case ERF_AAL5_LLC:
- pinfo->pseudo_header->atm.type = TRAF_LLCMX;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ atm_info.type = TRAF_LLCMX;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
break;
case ERF_AAL5_UNSPEC:
- pinfo->pseudo_header->atm.aal = AAL_5;
- pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ atm_info.aal = AAL_5;
+ atm_info.type = TRAF_UNKNOWN;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
break;
}
- call_dissector(atm_untruncated_handle, new_tvb, pinfo, tree);
+ call_dissector_with_data(atm_untruncated_handle, new_tvb, pinfo, tree,
+ &atm_info);
} else {
/* Treat this as a raw cell */
- pinfo->pseudo_header->atm.flags |= ATM_RAW_CELL;
- pinfo->pseudo_header->atm.flags |= ATM_NO_HEC;
- pinfo->pseudo_header->atm.aal = AAL_UNKNOWN;
+ atm_info.flags |= ATM_RAW_CELL;
+ atm_info.flags |= ATM_NO_HEC;
+ atm_info.aal = AAL_UNKNOWN;
/* can call atm_untruncated because we set ATM_RAW_CELL flag */
- call_dissector(atm_untruncated_handle, tvb, pinfo, tree);
+ call_dissector_with_data(atm_untruncated_handle, tvb, pinfo, tree,
+ &atm_info);
}
break;
@@ -1275,104 +1279,98 @@ dissect_erf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
case ERF_TYPE_AAL5:
atm_hdr = tvb_get_ntohl(tvb, 0);
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
- pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20);
- pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
- pinfo->pseudo_header->atm.channel = (flags & 0x03);
+ memset(&atm_info, 0, sizeof(atm_info));
+ atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
+ atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
+ atm_info.channel = (flags & 0x03);
new_tvb = tvb_new_subset_remaining(tvb, ATM_HDR_LENGTH);
/* Work around to have decoding working */
- pinfo->pseudo_header->atm.aal = AAL_5;
+ atm_info.aal = AAL_5;
switch (erf_aal5_type) {
case ERF_AAL5_GUESS:
- pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ atm_info.type = TRAF_UNKNOWN;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
/* Try to guess the type according to the first bytes */
- erf_atm_guess_traffic_type(new_tvb, 0, tvb_captured_length(new_tvb), pinfo->pseudo_header);
+ erf_atm_guess_traffic_type(new_tvb, 0, tvb_captured_length(new_tvb), &atm_info);
break;
case ERF_AAL5_LLC:
- pinfo->pseudo_header->atm.type = TRAF_LLCMX;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ atm_info.type = TRAF_LLCMX;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
break;
case ERF_AAL5_UNSPEC:
- pinfo->pseudo_header->atm.aal = AAL_5;
- pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ atm_info.aal = AAL_5;
+ atm_info.type = TRAF_UNKNOWN;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
break;
}
- call_dissector(atm_untruncated_handle, new_tvb, pinfo, tree);
+ call_dissector_with_data(atm_untruncated_handle, new_tvb, pinfo, tree,
+ &atm_info);
break;
case ERF_TYPE_MC_AAL2:
dissect_mc_aal2_header(tvb, pinfo, erf_tree);
/*
- * The channel identification number is in the MC header, so it's
- * in the pseudo-header, not in the packet data.
- *
- * We'll be overwriting the pseudo-header, so fetch it first.
- *
- * XXX - we should be passing a newly-constructed pseudo-header as
- * an argument to the ATM dissector.
- */
- aal2_cid = (pinfo->pseudo_header->erf.subhdr.mc_hdr & MC_AAL2_CID_MASK) >> MC_AAL2_CID_SHIFT;
-
- /*
- * ERF_TYPE_MC_AAL2 MC pseudoheader is not included in tvb,
- * and we do not supply 'dct2000' pseudoheader.
+ * Most of the information is in the ATM header; fetch it.
*/
+ atm_hdr = tvb_get_ntohl(tvb, 0);
/*
- * Overwrite the wtap pseudo_header with an ATM pseudo-header.
- * Zero it out, and fill it in.
+ * The channel identification number is in the MC header, so it's
+ * in the pseudo-header, not in the packet data.
*/
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
-
- atm_hdr = tvb_get_ntohl(tvb, 0);
+ aal2_cid = (pinfo->pseudo_header->erf.subhdr.mc_hdr & MC_AAL2_CID_MASK) >> MC_AAL2_CID_SHIFT;
- pinfo->pseudo_header->atm.aal = AAL_2;
- pinfo->pseudo_header->atm.flags |= ATM_AAL2_NOPHDR;
- pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20);
- pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
- pinfo->pseudo_header->atm.channel = (flags & 0x03);
- pinfo->pseudo_header->atm.aal2_cid = aal2_cid;
- pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ /* Zero out and fill in the ATM pseudo-header. */
+ memset(&atm_info, 0, sizeof(atm_info));
+ atm_info.aal = AAL_2;
+ atm_info.flags |= ATM_AAL2_NOPHDR;
+ atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
+ atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
+ atm_info.channel = (flags & 0x03);
+ atm_info.aal2_cid = aal2_cid;
+ atm_info.type = TRAF_UNKNOWN;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
/* remove ATM cell header from tvb */
new_tvb = tvb_new_subset_remaining(tvb, ATM_HDR_LENGTH);
- call_dissector(atm_untruncated_handle, new_tvb, pinfo, tree);
+ call_dissector_with_data(atm_untruncated_handle, new_tvb, pinfo, tree,
+ &atm_info);
break;
case ERF_TYPE_AAL2:
dissect_aal2_header(tvb, pinfo, erf_tree);
/*
- * We removed the ERF_TYPE_AAL2 'ext' pseudoheader in wtap,
- * and do not supply the 'dct2000' pseudoheader.
+ * Most of the information is in the ATM header; fetch it.
*/
-
atm_hdr = tvb_get_ntohl(tvb, 0);
- /* Change wtap pseudo_header from erf to atm for atm dissector */
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
-
- /* fill in atm pseudo header */
- pinfo->pseudo_header->atm.aal = AAL_2;
- pinfo->pseudo_header->atm.flags |= ATM_AAL2_NOPHDR;
- pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20);
- pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
- pinfo->pseudo_header->atm.channel = (flags & 0x03);
- pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
- pinfo->pseudo_header->atm.subtype = TRAF_ST_UNKNOWN;
+ /*
+ * The channel identification number is in the AAL2 header, so it's
+ * in the pseudo-header, not in the packet data.
+ */
+ aal2_cid = (pinfo->pseudo_header->erf.subhdr.aal2_hdr & AAL2_CID_MASK) >> AAL2_CID_SHIFT;
+
+ /* Zero out and fill in the ATM pseudo-header. */
+ memset(&atm_info, 0, sizeof(atm_info));
+ atm_info.aal = AAL_2;
+ atm_info.flags |= ATM_AAL2_NOPHDR;
+ atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
+ atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
+ atm_info.channel = (flags & 0x03);
+ atm_info.type = TRAF_UNKNOWN;
+ atm_info.subtype = TRAF_ST_UNKNOWN;
/* remove ATM cell header from tvb */
new_tvb = tvb_new_subset_remaining(tvb, ATM_HDR_LENGTH);
- call_dissector(atm_untruncated_handle, new_tvb, pinfo, tree);
+ call_dissector_with_data(atm_untruncated_handle, new_tvb, pinfo, tree,
+ &atm_info);
break;
case ERF_TYPE_MC_HDLC:
diff --git a/epan/dissectors/packet-fp_hint.c b/epan/dissectors/packet-fp_hint.c
index 9fb951f182..8bb3350fed 100644
--- a/epan/dissectors/packet-fp_hint.c
+++ b/epan/dissectors/packet-fp_hint.c
@@ -493,8 +493,10 @@ static int dissect_fp_hint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint32 atm_hdr, aal2_ext;
tvbuff_t *next_tvb;
dissector_handle_t next_dissector;
+ void *next_dissector_data;
proto_item *ti;
proto_tree *fph_tree = NULL;
+ struct atm_phdr atm_info;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "FP Hint");
@@ -515,25 +517,30 @@ static int dissect_fp_hint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
case FPH_FRAME_ATM_AAL2:
aal2_ext = tvb_get_ntohl(tvb, hdrlen); hdrlen += 4;
atm_hdr = tvb_get_ntohl(tvb, hdrlen); hdrlen += 4;
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
- pinfo->pseudo_header->atm.aal = AAL_2;
- /* pinfo->pseudo_header->atm.flags = pinfo->p2p_dir; */
- pinfo->pseudo_header->atm.flags = ATM_AAL2_NOPHDR;
- pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20);
- pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
- pinfo->pseudo_header->atm.aal2_cid = aal2_ext & 0x000000ff;
- pinfo->pseudo_header->atm.type = TRAF_UMTS_FP;
+ memset(&atm_info, 0, sizeof(atm_info));
+ atm_info.aal = AAL_2;
+ /* atm_info.flags = pinfo->p2p_dir; */
+ atm_info.flags = ATM_AAL2_NOPHDR;
+ atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
+ atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
+ atm_info.aal2_cid = aal2_ext & 0x000000ff;
+ atm_info.type = TRAF_UMTS_FP;
next_dissector = atm_untrunc_handle;
+ next_dissector_data = &atm_info;
break;
case FPH_FRAME_ETHERNET:
next_dissector = ethwithfcs_handle;
+ next_dissector_data = NULL;
break;
default:
next_dissector = data_handle;
+ next_dissector_data = NULL;
+ break;
}
next_tvb = tvb_new_subset_remaining(tvb, hdrlen);
- call_dissector(next_dissector, next_tvb, pinfo, tree);
+ call_dissector_with_data(next_dissector, next_tvb, pinfo, tree,
+ next_dissector_data);
return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-meta.c b/epan/dissectors/packet-meta.c
index f5b91a493c..263ad4a5fa 100644
--- a/epan/dissectors/packet-meta.c
+++ b/epan/dissectors/packet-meta.c
@@ -308,7 +308,7 @@ static guint16 evaluate_meta_item_pcap(proto_tree *meta_tree, tvbuff_t *tvb, pac
/*
* offs: current offset in tvb
*/
-static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, packet_info *pinfo, guint16 offs)
+static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, packet_info *pinfo, guint16 offs, struct atm_phdr *atm_info)
{
guint16 id;
guint8 type;
@@ -410,8 +410,8 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
case META_AAL5PROTO_MTP3:
p_sscop_info->subdissector = sscf_nni_handle;
/* hint for ATM dissector that this frame contains SSCOP */
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
- pinfo->pseudo_header->atm.type = TRAF_SSCOP;
+ memset(atm_info, 0, sizeof(*atm_info));
+ atm_info->type = TRAF_SSCOP;
break;
case META_AAL5PROTO_ALCAP:
p_sscop_info->subdissector = alcap_handle;
@@ -421,8 +421,8 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
break;
case META_AAL5PROTO_NS:
/* hint for ATM dissector that this frame contains GPRS NS */
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
- pinfo->pseudo_header->atm.type = TRAF_GPRS_NS;
+ memset(atm_info, 0, sizeof(*atm_info));
+ atm_info->type = TRAF_GPRS_NS;
break;
/* TODO: check for additional protos on Iu 802 LLC/SNAP ... */
default:
@@ -480,7 +480,8 @@ static guint16 evaluate_meta_item_dxt(proto_tree *meta_tree, tvbuff_t *tvb, pack
* header_length: length of meta header
*/
static gint32 evaluate_meta_items(guint16 schema, tvbuff_t *tvb, packet_info *pinfo,
- proto_tree *meta_tree, guint16 offs, gint32 header_length)
+ proto_tree *meta_tree, guint16 offs, gint32 header_length,
+ struct atm_phdr *atm_info)
{
gint16 item_len;
gint32 total_len = 0;
@@ -488,7 +489,7 @@ static gint32 evaluate_meta_items(guint16 schema, tvbuff_t *tvb, packet_info *pi
while (total_len < header_length) {
switch (schema) {
case META_SCHEMA_DXT:
- item_len = evaluate_meta_item_dxt(meta_tree, tvb, pinfo, offs + total_len);
+ item_len = evaluate_meta_item_dxt(meta_tree, tvb, pinfo, offs + total_len, atm_info);
break;
case META_SCHEMA_PCAP:
item_len = evaluate_meta_item_pcap(meta_tree, tvb, pinfo, offs + total_len);
@@ -516,7 +517,9 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree *meta_tree = NULL;
proto_item *ti = NULL;
tvbuff_t *next_tvb = NULL;
- dissector_handle_t next_dissector = NULL;
+ dissector_handle_t next_dissector = data_handle;
+ void *next_dissector_data = NULL;
+ struct atm_phdr atm_info;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "META");
@@ -533,7 +536,7 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree_add_uint(meta_tree, hf_meta_proto, tvb, 4, 2, proto);
proto_tree_add_uint(meta_tree, hf_meta_reserved, tvb, 6, 2, reserved);
}
- item_len = evaluate_meta_items(schema, tvb, pinfo, meta_tree, META_HEADER_SIZE, hdrlen);
+ item_len = evaluate_meta_items(schema, tvb, pinfo, meta_tree, META_HEADER_SIZE, hdrlen, &atm_info);
if (item_len < 0) {
/* evaluate_meta_items signalled an error */
@@ -562,28 +565,32 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
next_dissector = fphint_handle;
break;
case META_PROTO_DXT_ATM:
+ memset(&atm_info, 0, sizeof atm_info);
+ atm_info.aal = AAL_OAMCELL;
+ atm_info.type = TRAF_UNKNOWN;
next_dissector = atm_untrunc_handle;
- pinfo->pseudo_header->atm.aal = AAL_OAMCELL;
- pinfo->pseudo_header->atm.type = TRAF_UNKNOWN;
+ next_dissector_data = &atm_info;
break;
case META_PROTO_DXT_ATM_AAL2:
aal2_ext = tvb_get_ntohl(tvb, item_len + META_HEADER_SIZE); item_len += 4;
atm_hdr = tvb_get_ntohl(tvb, item_len + META_HEADER_SIZE); item_len += 4;
- memset(&pinfo->pseudo_header->atm, 0, sizeof(pinfo->pseudo_header->atm));
- pinfo->pseudo_header->atm.aal = AAL_2;
- /* pinfo->pseudo_header->atm.flags = pinfo->p2p_dir; */
- pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20);
- pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
- pinfo->pseudo_header->atm.aal2_cid = aal2_ext & 0x000000ff;
- pinfo->pseudo_header->atm.type = TRAF_UMTS_FP;
+ memset(&atm_info, 0, sizeof(atm_info));
+ atm_info.aal = AAL_2;
+ /* atm_info.flags = pinfo->p2p_dir; */
+ atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
+ atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
+ atm_info.aal2_cid = aal2_ext & 0x000000ff;
+ atm_info.type = TRAF_UMTS_FP;
next_dissector = atm_untrunc_handle;
+ next_dissector_data = &atm_info;
break;
case META_PROTO_DXT_ERF_AAL5:
atm_hdr = tvb_get_ntohl(tvb, item_len + META_HEADER_SIZE); item_len += 4;
- pinfo->pseudo_header->atm.vpi = ((atm_hdr & 0x0ff00000) >> 20);
- pinfo->pseudo_header->atm.vci = ((atm_hdr & 0x000ffff0) >> 4);
- pinfo->pseudo_header->atm.aal = AAL_5;
+ atm_info.vpi = ((atm_hdr & 0x0ff00000) >> 20);
+ atm_info.vci = ((atm_hdr & 0x000ffff0) >> 4);
+ atm_info.aal = AAL_5;
next_dissector = atm_untrunc_handle;
+ next_dissector_data = &atm_info;
break;
case META_PROTO_DXT_HDLC:
next_dissector = mtp2_handle;
@@ -598,8 +605,8 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if (!next_tvb)
next_tvb = tvb_new_subset_remaining(tvb, item_len + META_HEADER_SIZE);
- call_dissector(next_dissector ? next_dissector : data_handle,
- next_tvb, pinfo, tree);
+ call_dissector_with_data(next_dissector, next_tvb, pinfo, tree,
+ next_dissector_data);
return tvb_captured_length(tvb);
}
diff --git a/epan/dissectors/packet-pw-atm.c b/epan/dissectors/packet-pw-atm.c
index 5476ce05bd..39a3de9e1a 100644
--- a/epan/dissectors/packet-pw-atm.c
+++ b/epan/dissectors/packet-pw-atm.c
@@ -359,7 +359,7 @@ col_append_pw_info(packet_info * pinfo
static void
prepare_pseudo_header_atm(
- union wtap_pseudo_header * const ph,
+ struct atm_phdr *ph,
const pwatm_private_data_t * const pdata,
const guint aal)
{
@@ -367,23 +367,23 @@ prepare_pseudo_header_atm(
DISSECTOR_ASSERT(NULL != ph);
memset(ph, 0 , sizeof(*ph)); /* it is OK to clear unknown values */
- ph->atm.flags = 0; /* status flags */
- ph->atm.aal = aal;
- ph->atm.type = TRAF_UNKNOWN;
- ph->atm.subtype = TRAF_ST_UNKNOWN;
- ph->atm.vpi = (pdata->vpi >= 0) ? pdata->vpi : 0 /*unknown*/;
- ph->atm.vci = (pdata->vci >= 0) ? pdata->vci : 0 /*unknown*/;
- ph->atm.aal2_cid = 0; /*not applicable*//* channel id */
- ph->atm.channel = 0; /*unknown*//* link: 0 for DTE->DCE, 1 for DCE->DTE */
- ph->atm.cells = 0; /*zero indicates that we do not have trailer info*/
+ ph->flags = 0; /* status flags */
+ ph->aal = aal;
+ ph->type = TRAF_UNKNOWN;
+ ph->subtype = TRAF_ST_UNKNOWN;
+ ph->vpi = (pdata->vpi >= 0) ? pdata->vpi : 0 /*unknown*/;
+ ph->vci = (pdata->vci >= 0) ? pdata->vci : 0 /*unknown*/;
+ ph->aal2_cid = 0; /*not applicable*//* channel id */
+ ph->channel = 0; /*unknown*//* link: 0 for DTE->DCE, 1 for DCE->DTE */
+ ph->cells = 0; /*zero indicates that we do not have trailer info*/
/*user-to-user indicator & CPI*/
- ph->atm.aal5t_u2u = 0; /* all bits unknown except lsb of UU */
+ ph->aal5t_u2u = 0; /* all bits unknown except lsb of UU */
if (pdata->aal5_sdu_frame_relay_cr_bit)
{ /* Let's give Frame Relay C/R bit to ATM dissector.*/
- ph->atm.aal5t_u2u |= (1<<8); /*UU octet is at << 8 in aal5t_u2u*/
+ ph->aal5t_u2u |= (1<<8); /*UU octet is at << 8 in aal5t_u2u*/
}
- ph->atm.aal5t_len = 0; /*unknown*//* length of the packet from trailer*/
- ph->atm.aal5t_chksum = 0; /*unknown*//* checksum for AAL5 packet from trailer */
+ ph->aal5t_len = 0; /*unknown*//* length of the packet from trailer*/
+ ph->aal5t_chksum = 0; /*unknown*//* checksum for AAL5 packet from trailer */
return;
}
@@ -420,8 +420,7 @@ dissect_payload_and_padding(
if (pd->cell_mode_oam)
{
- union wtap_pseudo_header * pseudo_header_save;
- union wtap_pseudo_header ph;
+ struct atm_phdr ph;
tvbuff_t* tvb_3;
int bytes_to_dissect;
/* prepare buffer for old-style dissector */
@@ -436,15 +435,11 @@ dissect_payload_and_padding(
{
pd->enable_fill_columns_by_atm_dissector = FALSE;
}
- /* save & prepare new pseudo header for atm aal5 decoding */
- pseudo_header_save = pinfo->pseudo_header;
- pinfo->pseudo_header = &ph;
+ /* prepare atm pseudo header for atm OAM cell decoding */
prepare_pseudo_header_atm(&ph, pd, AAL_OAMCELL);
- call_dissector_with_data(dh_atm_oam_cell, tvb_3, pinfo, tree, pd);
+ call_dissector_with_data(dh_atm_oam_cell, tvb_3, pinfo, tree, &pd);
dissected += bytes_to_dissect;
- /* restore pseudo header */
- pinfo->pseudo_header = pseudo_header_save;
}
else
{
@@ -665,17 +660,12 @@ dissect_11_or_aal5_pdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, v
if (payload_size != 0)
{
tvbuff_t* tvb_3;
- union wtap_pseudo_header* pseudo_header_save;
- union wtap_pseudo_header ph;
+ struct atm_phdr ph;
tvb_3 = tvb_new_subset_remaining(tvb_2, 1);
- /* prepare pseudo header for atm aal5 decoding */
- pseudo_header_save = pinfo->pseudo_header;
- pinfo->pseudo_header = &ph;
+ /* prepare atm pseudo header for atm aal5 decoding */
prepare_pseudo_header_atm(&ph, &pd, AAL_5);
- call_dissector_with_data(dh_atm_untruncated, tvb_3, pinfo, tree, &pd);
- /* restore pseudo header */
- pinfo->pseudo_header = pseudo_header_save;
+ call_dissector_with_data(dh_atm_untruncated, tvb_3, pinfo, tree, &ph);
}
}
}
@@ -873,17 +863,12 @@ dissect_aal5_sdu(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* d
if (payload_size != 0)
{
tvbuff_t* tvb_3;
- union wtap_pseudo_header* pseudo_header_save;
- union wtap_pseudo_header ph;
+ struct atm_phdr ph;
tvb_3 = tvb_new_subset_length(tvb_2, 0, payload_size);
- /* prepare pseudo header for atm aal5 decoding */
- pseudo_header_save = pinfo->pseudo_header;
- pinfo->pseudo_header = &ph;
+ /* prepare atm pseudo header for atm aal5 decoding */
prepare_pseudo_header_atm(&ph, &pd, AAL_5);
- call_dissector_with_data(dh_atm_truncated, tvb_3, pinfo, tree, &pd); /* no PAD and trailer */
- /* restore pseudo header */
- pinfo->pseudo_header = pseudo_header_save;
+ call_dissector_with_data(dh_atm_truncated, tvb_3, pinfo, tree, &ph); /* no PAD and trailer */
}
if (padding_size != 0)
{