/* packet-udp.c
* Routines for UDP packet disassembly
*
- * $Id: packet-udp.c,v 1.86 2001/01/22 03:33:45 guy Exp $
+ * $Id: packet-udp.c,v 1.89 2001/03/28 21:33:31 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
#include "resolv.h"
#include "in_cksum.h"
-#include "plugins.h"
#include "packet-udp.h"
#include "packet-ip.h"
static int hf_udp_port = -1;
static int hf_udp_length = -1;
static int hf_udp_checksum = -1;
+static int hf_udp_checksum_bad = -1;
static gint ett_udp = -1;
proto_tree *tree, int uh_sport, int uh_dport)
{
tvbuff_t *next_tvb;
-#ifdef HAVE_PLUGINS
- const u_char *next_pd;
- int next_offset;
-#endif
next_tvb = tvb_new_subset(tvb, offset, -1, -1);
if (try_conversation_dissector(&pinfo->src, &pinfo->dst, PT_UDP,
uh_sport, uh_dport, next_tvb, pinfo, tree))
- return;
-
- /* try to apply the plugins */
-#ifdef HAVE_PLUGINS
- {
- plugin *pt_plug = plugin_list;
-
- if (enabled_plugins_number > 0) {
- tvb_compat(next_tvb, &next_pd, &next_offset);
- while (pt_plug) {
- if (pt_plug->enabled && strstr(pt_plug->protocol, "udp") &&
- tree && dfilter_apply(pt_plug->filter, tree, next_pd, pinfo->fd->cap_len)) {
- pt_plug->dissector(next_pd, next_offset, pinfo->fd, tree);
- return;
- }
- pt_plug = pt_plug->next;
- }
- }
- }
-#endif
+ return;
/* do lookup with the subdissector table */
if (dissector_try_port(udp_dissector_table, uh_sport, next_tvb, pinfo, tree) ||
proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb,
offset + 6, 2, uh_sum, "Checksum: 0x%04x (correct)", uh_sum);
} else {
+ proto_tree_add_boolean_hidden(udp_tree, hf_udp_checksum_bad, tvb,
+ offset + 6, 2, TRUE);
proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb,
offset + 6, 2, uh_sum,
"Checksum: 0x%04x (incorrect, should be 0x%04x)", uh_sum,
{ "Length", "udp.length", FT_UINT16, BASE_DEC, NULL, 0x0,
"" }},
+ { &hf_udp_checksum_bad,
+ { "Bad Checksum", "udp.checksum_bad", FT_BOOLEAN, BASE_NONE, NULL, 0x0,
+ "" }},
+
{ &hf_udp_checksum,
{ "Checksum", "udp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0,
"" }},