diff options
author | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-11-29 05:16:15 +0000 |
---|---|---|
committer | gram <gram@f5534014-38df-0310-8fa8-9805f1628bb7> | 2000-11-29 05:16:15 +0000 |
commit | fdb1111e958124a68463e3c76a66c621d7d26915 (patch) | |
tree | 5469fa22c76501813519d37f54fc09a373e07c8c /packet-fddi.c | |
parent | f9fd8376e4516c310d9b8e3074892f14e9251dfa (diff) |
Wrap the dissect_fddi() call (with a 4th argument) with
dissect_fddi_not_bitswapped() and dissect_fddi_bitswapped(), both of which
use the standard 3-argument tvbuffified-dissector argument list.
Add a dissector table called "wtap_encap" which is used to call dissectors
from dissect_frame(). The switch() statement from this top-level dissector
is removed.
The link-layer dissectors register themselves with the "wtap_encap"
dissector table. The dissectors are now static where possible.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2708 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-fddi.c')
-rw-r--r-- | packet-fddi.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/packet-fddi.c b/packet-fddi.c index ae3737e6f9..72351bc4b4 100644 --- a/packet-fddi.c +++ b/packet-fddi.c @@ -3,7 +3,7 @@ * * Laurent Deniel <deniel@worldnet.fr> * - * $Id: packet-fddi.c,v 1.42 2000/11/19 08:53:57 guy Exp $ + * $Id: packet-fddi.c,v 1.43 2000/11/29 05:16:15 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -219,7 +219,8 @@ fddifc_to_str(int fc) } } -void + +static void dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean bitswapped) { @@ -324,6 +325,19 @@ dissect_fddi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, } /* fc */ } /* dissect_fddi */ + +static void +dissect_fddi_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_fddi(tvb, pinfo, tree, TRUE); +} + +static void +dissect_fddi_not_bitswapped(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +{ + dissect_fddi(tvb, pinfo, tree, FALSE); +} + void proto_register_fddi(void) { @@ -359,3 +373,10 @@ proto_register_fddi(void) proto_register_field_array(proto_fddi, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); } + +void +proto_reg_handoff_fddi(void) +{ + dissector_add("wtap_encap", WTAP_ENCAP_FDDI, dissect_fddi_not_bitswapped); + dissector_add("wtap_encap", WTAP_ENCAP_FDDI_BITSWAPPED, dissect_fddi_bitswapped); +} |