aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorJaap Keuter <jaap.keuter@xs4all.nl>2007-12-15 13:20:17 +0000
committerJaap Keuter <jaap.keuter@xs4all.nl>2007-12-15 13:20:17 +0000
commit74cf6511fb2fe3f5dd57f68cf5c977f526f6b9f6 (patch)
treed7271983a9bf056adc35e8adaeddf848f91b807a /epan/packet.c
parent16341e7365c6d2585aade3a80864c40b21333dc7 (diff)
Cleanup call_dissector / call_dissector_only
svn path=/trunk/; revision=23871
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/epan/packet.c b/epan/packet.c
index d2c2e06d20..20f1f2f71b 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -1761,6 +1761,20 @@ new_register_dissector(const char *name, new_dissector_t dissector, int proto)
(gpointer) handle);
}
+/* Call a dissector through a handle but if the dissector rejected it
+ * return 0.
+ */
+int
+call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb,
+ packet_info *pinfo, proto_tree *tree)
+{
+ int ret;
+
+ g_assert(handle != NULL);
+ ret = call_dissector_work(handle, tvb, pinfo, tree);
+ return ret;
+}
+
/* Call a dissector through a handle and if this fails call the "data"
* dissector.
*/
@@ -1770,8 +1784,7 @@ call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
{
int ret;
- g_assert(handle != NULL);
- ret = call_dissector_work(handle, tvb, pinfo, tree);
+ ret = call_dissector_only(handle, tvb, pinfo, tree);
if (ret == 0) {
/*
* The protocol was disabled, or the dissector rejected
@@ -1779,25 +1792,12 @@ call_dissector(dissector_handle_t handle, tvbuff_t *tvb,
*/
g_assert(data_handle != NULL);
g_assert(data_handle->protocol != NULL);
- call_dissector_only(data_handle, tvb, pinfo, tree);
+ call_dissector_work(data_handle, tvb, pinfo, tree);
return tvb_length(tvb);
}
return ret;
}
-/* Call a dissector through a handle but if the dissector rejected it
- * return 0 instead of using the default "data" dissector.
- */
-int
-call_dissector_only(dissector_handle_t handle, tvbuff_t *tvb,
- packet_info *pinfo, proto_tree *tree)
-{
- int ret;
-
- ret = call_dissector_work(handle, tvb, pinfo, tree);
- return ret;
-}
-
/*
* Dumps the "layer type"/"decode as" associations to stdout, similar
* to the proto_registrar_dump_*() routines.