aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-atm.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2009-02-25 09:26:27 +0000
committerGuy Harris <guy@alum.mit.edu>2009-02-25 09:26:27 +0000
commiteeae7f9ff0580fd7a341e7801cca207e21ec355b (patch)
treebf48db8c816863e16a443ab27ac609187d05b4fe /epan/dissectors/packet-atm.c
parentc265b3003d4ab7fa4f7e94970e343d562d8b6d01 (diff)
Clean up the comments in the L2TP dissector about RFCs.
Clean up indentation a bit. Clean up the L2TPv3 dissection a bit. Make an OAM cell dissector, and have the L2TP dissector call it. svn path=/trunk/; revision=27540
Diffstat (limited to 'epan/dissectors/packet-atm.c')
-rw-r--r--epan/dissectors/packet-atm.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index a496e40896..cb4647ad01 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -1523,7 +1523,7 @@ static const value_string ft_ad_vals[] = {
static void
dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
- proto_tree *atm_tree)
+ proto_tree *atm_tree, guint aal)
{
int offset;
proto_tree *aal_tree;
@@ -1533,7 +1533,6 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 vpi;
guint16 vci;
guint8 pt;
- guint8 aal;
guint16 aal3_4_hdr, aal3_4_trlr;
guint16 oam_crc;
gint length;
@@ -1573,7 +1572,6 @@ dissect_atm_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
* XXX - do this for all AAL values, overriding whatever information
* Wiretap got from the file?
*/
- aal = pinfo->pseudo_header->atm.aal;
if (aal == AAL_USER) {
/*
* OAM F4 is VCI 3 or 4 and PT 0X0.
@@ -1783,7 +1781,7 @@ dissect_atm_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
if (pinfo->pseudo_header->atm.flags & ATM_RAW_CELL) {
/* This is a single cell, with the cell header at the beginning. */
proto_item_set_len(atm_ti, 5);
- dissect_atm_cell(tvb, pinfo, tree, atm_tree);
+ dissect_atm_cell(tvb, pinfo, tree, atm_tree, pinfo->pseudo_header->atm.aal);
} else {
/* This is a reassembled PDU. */
dissect_reassembled_pdu(tvb, pinfo, tree, atm_tree, atm_ti, truncated);
@@ -1802,6 +1800,23 @@ dissect_atm_untruncated(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
dissect_atm_common(tvb, pinfo, tree, FALSE);
}
+static void
+dissect_atm_oam_cell(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+ proto_tree *atm_tree = NULL;
+ proto_item *atm_ti = NULL;
+
+ if (check_col(pinfo->cinfo, COL_PROTOCOL))
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "ATM");
+
+ if (tree) {
+ atm_ti = proto_tree_add_protocol_format(tree, proto_atm, tvb, 0, 0, "ATM");
+ atm_tree = proto_item_add_subtree(atm_ti, ett_atm);
+ }
+
+ dissect_atm_cell(tvb, pinfo, tree, atm_tree, AAL_OAMCELL);
+}
+
void
proto_register_atm(void)
{
@@ -1854,6 +1869,7 @@ proto_register_atm(void)
register_dissector("lane", dissect_lane, proto_atm_lane);
register_dissector("atm_untruncated", dissect_atm_untruncated, proto_atm);
+ register_dissector("atm_oam_cell", dissect_atm_oam_cell, proto_oamaal);
atm_module = prefs_register_protocol ( proto_atm, NULL );
prefs_register_bool_preference ( atm_module, "dissect_lane_as_sscop", "Dissect LANE as SSCOP",