aboutsummaryrefslogtreecommitdiffstats
path: root/packet-llc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-16 07:35:43 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-16 07:35:43 +0000
commitee1b884ee9b7baa22ebf1a7e1363994124a0ff24 (patch)
tree1eaeec182ddb59258b1ee66e3a901ada60ee9f79 /packet-llc.c
parentf19c2e2defe72f740356a3df48a64f6e24918130 (diff)
Tvbuffify the STP dissector, have it register itself and have the LLC
dissector call it through a handle, and make it static. Give "dissect_data()" an "offset" argument, so dissectors can use it to dissect part of the packet without having to cook up a new tvbuff. Go back to using "dissect_data()" to dissect the data in an IPP request. svn path=/trunk/; revision=2651
Diffstat (limited to 'packet-llc.c')
-rw-r--r--packet-llc.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/packet-llc.c b/packet-llc.c
index 5135ec64f5..f1481cff29 100644
--- a/packet-llc.c
+++ b/packet-llc.c
@@ -2,7 +2,7 @@
* Routines for IEEE 802.2 LLC layer
* Gilbert Ramirez <gram@xiexie.org>
*
- * $Id: packet-llc.c,v 1.69 2000/08/25 06:31:25 guy Exp $
+ * $Id: packet-llc.c,v 1.70 2000/11/16 07:35:38 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -38,7 +38,6 @@
#include "xdlc.h"
#include "etypes.h"
#include "llcsaps.h"
-#include "packet-bpdu.h"
#include "packet-cdp.h"
#include "packet-cgmp.h"
#include "packet-ip.h"
@@ -63,6 +62,8 @@ static gint ett_llc_ctrl = -1;
static dissector_table_t subdissector_table;
+static dissector_handle_t bpdu_handle;
+
typedef void (capture_func_t)(const u_char *, int, packet_counts *);
/* The SAP info is split into two tables, one value_string table and one
@@ -357,7 +358,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ethertype(etype, tvb, 8,
pinfo, tree, llc_tree, hf_llc_type);
} else
- dissect_data(next_tvb, pinfo, tree);
+ dissect_data(next_tvb, 0, pinfo, tree);
break;
case OUI_CISCO:
@@ -392,11 +393,11 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
default:
- dissect_data(next_tvb, pinfo, tree);
+ dissect_data(next_tvb, 0, pinfo, tree);
break;
}
} else
- dissect_data(next_tvb, pinfo, tree);
+ dissect_data(next_tvb, 0, pinfo, tree);
break;
case OUI_CABLE_BPDU: /* DOCSIS cable modem spanning tree BPDU */
@@ -404,7 +405,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(llc_tree,
hf_llc_pid, tvb, 6, 2, etype);
}
- dissect_bpdu(pd, offset, pinfo->fd, tree);
+ call_dissector(bpdu_handle, next_tvb, pinfo, tree);
break;
default:
@@ -412,7 +413,7 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(llc_tree,
hf_llc_pid, tvb, 6, 2, etype);
}
- dissect_data(next_tvb, pinfo, tree);
+ dissect_data(next_tvb, 0, pinfo, tree);
break;
}
}
@@ -435,10 +436,10 @@ dissect_llc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* do lookup with the subdissector table */
if (!dissector_try_port(subdissector_table, dsap,
next_tvb, pinfo, tree)) {
- dissect_data(next_tvb, pinfo, tree);
+ dissect_data(next_tvb, 0, pinfo, tree);
}
} else {
- dissect_data(next_tvb, pinfo, tree);
+ dissect_data(next_tvb, 0, pinfo, tree);
}
}
}
@@ -495,3 +496,12 @@ proto_register_llc(void)
/* subdissector code */
subdissector_table = register_dissector_table("llc.dsap");
}
+
+void
+proto_reg_handoff_llc(void)
+{
+ /*
+ * Get a handle for the BPDU dissector.
+ */
+ bpdu_handle = find_dissector("bpdu");
+}