diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-01 20:27:16 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-02-01 20:27:16 +0000 |
commit | 19478caae65f75e683c189e69f1a0abd984ef246 (patch) | |
tree | 8edd39f442606c4ae42e98279a063faf0a4802b5 /epan | |
parent | 97ee79e70557cc8dddd91ae8ef1b6582e405b4fa (diff) |
From Tobias Witek:
Replace ERF dissector with ATM dissector for protocols 'FP Hint' and 'META'
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4384
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31761 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-atm.c | 27 | ||||
-rw-r--r-- | epan/dissectors/packet-fp_hint.c | 32 | ||||
-rw-r--r-- | epan/dissectors/packet-meta.c | 88 | ||||
-rw-r--r-- | epan/dissectors/packet-meta.h | 2 |
4 files changed, 70 insertions, 79 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c index 00e21e3798..db51ba51cf 100644 --- a/epan/dissectors/packet-atm.c +++ b/epan/dissectors/packet-atm.c @@ -1181,19 +1181,20 @@ dissect_reassembled_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, case AAL_2: switch (pinfo->pseudo_header->atm.type) { case TRAF_UMTS_FP: - /* Skip first 4 bytes of message - - side - - length - - UUI - Ignoring for now... */ - proto_tree_add_uint(atm_tree, hf_atm_cid, tvb, 0, 0, - pinfo->pseudo_header->atm.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); - - next_tvb = tvb_new_subset_remaining(tvb, 4); + proto_tree_add_uint(atm_tree, hf_atm_cid, tvb, 0, 0, + pinfo->pseudo_header->atm.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); + if ((pinfo->pseudo_header->atm.flags | ATM_AAL2_NOPHDR) == 0) { + /* Skip first 4 bytes of message + - side + - length + - UUI + Ignoring for now... */ + next_tvb = tvb_new_subset_remaining(tvb, 4); + } call_dissector(fp_handle, next_tvb, pinfo, tree); break; diff --git a/epan/dissectors/packet-fp_hint.c b/epan/dissectors/packet-fp_hint.c index 87fd76183d..37716d369a 100644 --- a/epan/dissectors/packet-fp_hint.c +++ b/epan/dissectors/packet-fp_hint.c @@ -32,7 +32,6 @@ #include "packet-umts_fp.h" #include "packet-umts_mac.h" #include "packet-rlc.h" -#include "wiretap/erf.h" static int proto_fp_hint = -1; extern int proto_fp; @@ -68,7 +67,6 @@ static int hf_fph_tf_size = -1; static dissector_handle_t data_handle; static dissector_handle_t ethwithfcs_handle; static dissector_handle_t atm_untrunc_handle; -static dissector_handle_t erf_handle; enum fph_ctype { FPH_CHANNEL_PCH, @@ -80,7 +78,7 @@ enum fph_ctype { }; enum fph_frame { - FPH_FRAME_ERF_AAL2, + FPH_FRAME_ATM_AAL2, FPH_FRAME_ETHERNET }; @@ -99,7 +97,7 @@ enum fph_content { }; static const value_string fph_frametype_vals[] = { - { FPH_FRAME_ERF_AAL2, "ERF AAL2" }, + { FPH_FRAME_ATM_AAL2, "ATM AAL2" }, { FPH_FRAME_ETHERNET, "Ethernet" }, { 0, NULL } }; @@ -440,7 +438,7 @@ static void attach_info(tvbuff_t *tvb, packet_info *pinfo, guint16 offset, guint fpi->dch_crc_present = 1; switch (frame_type) { - case FPH_FRAME_ERF_AAL2: + case FPH_FRAME_ATM_AAL2: fpi->link_type = FP_Link_ATM; break; case FPH_FRAME_ETHERNET: @@ -483,9 +481,7 @@ static void dissect_fp_hint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint8 frame_type, channel_type; guint16 hdrlen; -#if 0 - guint32 atm_aal2_ext, atm_hdr; -#endif + guint32 atm_hdr, aal2_ext; tvbuff_t *next_tvb; dissector_handle_t *next_dissector; proto_item *ti; @@ -508,15 +504,18 @@ static void dissect_fp_hint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* attach FP, MAC, RLC information */ attach_info(tvb, pinfo, 4, channel_type, frame_type, fph_tree); switch (frame_type) { - case FPH_FRAME_ERF_AAL2: - memset(&pinfo->pseudo_header->erf, 0, sizeof(pinfo->pseudo_header->erf)); - pinfo->pseudo_header->erf.phdr.type = ERF_TYPE_AAL2; - /* store p2p direction in ERF flags */ - pinfo->pseudo_header->erf.phdr.flags |= pinfo->p2p_dir; - /* set ATM properties */ + 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; - pinfo->pseudo_header->atm.subtype = TRAF_UNKNOWN; - next_dissector = &erf_handle; + next_dissector = &atm_untrunc_handle; break; case FPH_FRAME_ETHERNET: next_dissector = ðwithfcs_handle; @@ -578,5 +577,4 @@ proto_reg_handoff_fp_hint(void) atm_untrunc_handle = find_dissector("atm_untruncated"); data_handle = find_dissector("data"); ethwithfcs_handle = find_dissector("eth_withfcs"); - erf_handle = find_dissector("erf"); } diff --git a/epan/dissectors/packet-meta.c b/epan/dissectors/packet-meta.c index 893a080ad4..b8c933ec5f 100644 --- a/epan/dissectors/packet-meta.c +++ b/epan/dissectors/packet-meta.c @@ -90,7 +90,7 @@ static const value_string meta_proto_vals[] = { { META_PROTO_DXT_ETHERNET_CRC, "Ethernet with FCS" }, { META_PROTO_DXT_FP_HINT, "FP Hint" }, { META_PROTO_DXT_ERF_AAL5, "ERF AAL5" }, - { META_PROTO_DXT_ERF_AAL2, "ERF AAL2" }, + { META_PROTO_DXT_ATM_AAL2, "ATM AAL2" }, { META_PROTO_DXT_ATM, "ATM" }, { 0, NULL } }; @@ -373,57 +373,17 @@ static gint32 evaluate_meta_items(guint16 schema, tvbuff_t *tvb, packet_info *pi return total_len; } -static dissector_handle_t *dxt_get_dissector(guint16 proto, packet_info *pinfo) -{ - dissector_handle_t *next_dissector = &data_handle; - switch (proto) { - case META_PROTO_DXT_ETHERNET: - next_dissector = ðwithoutfcs_handle; - break; - case META_PROTO_DXT_ETHERNET_CRC: - next_dissector = ðwithfcs_handle; - break; - case META_PROTO_DXT_FP_HINT: - next_dissector = &fphint_handle; - break; - case META_PROTO_DXT_ATM: - next_dissector = &atm_untrunc_handle; - pinfo->pseudo_header->atm.aal = AAL_OAMCELL; - pinfo->pseudo_header->atm.type = TRAF_UNKNOWN; - break; - case META_PROTO_DXT_ERF_AAL2: - /* fake erf pseudo header */ - memset(&pinfo->pseudo_header->erf, 0, sizeof(pinfo->pseudo_header->erf)); - pinfo->pseudo_header->erf.phdr.type = ERF_TYPE_AAL2; - /* store p2p direction in ERF flags */ - pinfo->pseudo_header->erf.phdr.flags |= pinfo->p2p_dir; - next_dissector = &erf_handle; - break; - case META_PROTO_DXT_ERF_AAL5: - /* fake erf pseudo header */ - memset(&pinfo->pseudo_header->erf, 0, sizeof(pinfo->pseudo_header->erf)); - pinfo->pseudo_header->erf.phdr.type = ERF_TYPE_AAL5; - /* store p2p direction in ERF flags */ - pinfo->pseudo_header->erf.phdr.flags |= pinfo->p2p_dir; - next_dissector = &erf_handle; - break; - default: - next_dissector = &data_handle; - } - if (!*next_dissector) next_dissector = &data_handle; - return next_dissector; -} - static void dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { #define META_HEADER_SIZE 8 guint16 schema, proto, hdrlen, reserved; gint32 item_len; + guint32 aal2_ext, atm_hdr; proto_tree *meta_tree = NULL; proto_item *ti = NULL; tvbuff_t *next_tvb; - dissector_handle_t *next_dissector = &data_handle; + dissector_handle_t next_dissector = data_handle; if (check_col(pinfo->cinfo, COL_PROTOCOL)) col_set_str(pinfo->cinfo, COL_PROTOCOL, "META"); @@ -460,13 +420,45 @@ dissect_meta(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* TODO */ break; case META_SCHEMA_DXT: - next_dissector = dxt_get_dissector(proto, pinfo); - break; - default: - next_dissector = &data_handle; + switch (proto) { + case META_PROTO_DXT_ETHERNET: + next_dissector = ethwithoutfcs_handle; + break; + case META_PROTO_DXT_ETHERNET_CRC: + next_dissector = ethwithfcs_handle; + break; + case META_PROTO_DXT_FP_HINT: + next_dissector = fphint_handle; + break; + case META_PROTO_DXT_ATM: + next_dissector = atm_untrunc_handle; + pinfo->pseudo_header->atm.aal = AAL_OAMCELL; + pinfo->pseudo_header->atm.type = TRAF_UNKNOWN; + 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; + next_dissector = atm_untrunc_handle; + break; + case META_PROTO_DXT_ERF_AAL5: + /* fake erf pseudo header */ + memset(&pinfo->pseudo_header->erf, 0, sizeof(pinfo->pseudo_header->erf)); + pinfo->pseudo_header->erf.phdr.type = ERF_TYPE_AAL5; + /* store p2p direction in ERF flags */ + pinfo->pseudo_header->erf.phdr.flags |= pinfo->p2p_dir; + next_dissector = erf_handle; + break; + } } next_tvb = tvb_new_subset(tvb, item_len + META_HEADER_SIZE, -1, -1); - call_dissector(*next_dissector, next_tvb, pinfo, tree); + call_dissector(next_dissector, next_tvb, pinfo, tree); } void diff --git a/epan/dissectors/packet-meta.h b/epan/dissectors/packet-meta.h index e54e585730..455e5924ab 100644 --- a/epan/dissectors/packet-meta.h +++ b/epan/dissectors/packet-meta.h @@ -30,7 +30,7 @@ #define META_PROTO_DXT_ETHERNET_CRC 36 #define META_PROTO_DXT_ATM 41 #define META_PROTO_DXT_ERF_AAL5 49 -#define META_PROTO_DXT_ERF_AAL2 76 +#define META_PROTO_DXT_ATM_AAL2 76 #define META_PROTO_DXT_FP_HINT 82 /* data types */ |