Now that WinPcap is a DLL, I can load it at run-time rather than load-time.
[obnox/wireshark/wip.git] / packet-udp.c
index 88c7fd792dc8f3ee8db6e2e43bfad5cb7b21aaad..5d07d8702c68d62802a9b8b7f18816d974d5d9d8 100644 (file)
@@ -1,7 +1,7 @@
 /* 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>
@@ -46,7 +46,6 @@
 #include "resolv.h"
 #include "in_cksum.h"
 
-#include "plugins.h"
 #include "packet-udp.h"
 
 #include "packet-ip.h"
@@ -59,6 +58,7 @@ static int hf_udp_dstport = -1;
 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;
 
@@ -84,10 +84,6 @@ decode_udp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
        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);
 
@@ -96,26 +92,7 @@ decode_udp_ports(tvbuff_t *tvb, int offset, packet_info *pinfo,
 
   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) ||
@@ -216,6 +193,8 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *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,
@@ -259,6 +238,10 @@ proto_register_udp(void)
                { "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,
                        "" }},