aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-eth.c
diff options
context:
space:
mode:
authorsake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2007-12-16 00:35:34 +0000
committersake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>2007-12-16 00:35:34 +0000
commit75288b3b78fc89a0c24bc3f337a3534539a18961 (patch)
treed8fefa1faa3421049a7179dac2ce36f13e8644ae /epan/dissectors/packet-eth.c
parent746658e3964c58bcc1242db715677a78e55cd96d (diff)
Big 2104 - From Benn Bollay:
This patch adds a heuristic dissector to the ethernet trailer under the keystring "eth.trailer". This allows for other protocol plugins which coopt the ethernet trailer for their own devices to register for trailer traffic without requiring any further changes to the executable. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23880 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-eth.c')
-rw-r--r--epan/dissectors/packet-eth.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c
index 39cb919636..743ff1a435 100644
--- a/epan/dissectors/packet-eth.c
+++ b/epan/dissectors/packet-eth.c
@@ -59,6 +59,7 @@ static gint ett_addr = -1;
static dissector_handle_t fw1_handle;
static heur_dissector_list_t heur_subdissector_list;
+static heur_dissector_list_t eth_trailer_subdissector_list;
static int eth_tap = -1;
@@ -376,8 +377,8 @@ static gboolean chek_is_802_2(tvbuff_t *tvb)
* it does, maybe it doesn't"), we try to infer whether it has an FCS.
*/
void
-add_ethernet_trailer(proto_tree *fh_tree, int trailer_id, tvbuff_t *tvb,
- tvbuff_t *trailer_tvb, int fcs_len)
+add_ethernet_trailer(packet_info *pinfo, proto_tree *fh_tree, int trailer_id,
+ tvbuff_t *tvb, tvbuff_t *trailer_tvb, int fcs_len)
{
/* If there're some bytes left over, show those bytes as a trailer.
@@ -389,8 +390,14 @@ add_ethernet_trailer(proto_tree *fh_tree, int trailer_id, tvbuff_t *tvb,
guint trailer_length, trailer_reported_length;
gboolean has_fcs = FALSE;
+ if (dissector_try_heuristic(eth_trailer_subdissector_list, trailer_tvb,
+ pinfo, fh_tree)) {
+ return;
+ }
+
trailer_length = tvb_length(trailer_tvb);
trailer_reported_length = tvb_reported_length(trailer_tvb);
+
if (fcs_len != 0) {
/* If fcs_len is 4, we assume we definitely have an FCS.
Otherwise, then, if the frame is big enough that, if we
@@ -527,6 +534,7 @@ proto_register_eth(void)
/* subdissector code */
register_heur_dissector_list("eth", &heur_subdissector_list);
+ register_heur_dissector_list("eth.trailer", &eth_trailer_subdissector_list);
/* Register configuration preferences */
eth_module = prefs_register_protocol(proto_eth, NULL);