Don't let the user specify a maximum capture file size if they're not
[obnox/wireshark/wip.git] / packet-udp.c
index bde090f679ee12ebe713e9c44a398aeed01f915b..d7c30ab3247a659f39d29500ed5966ce15b9120c 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-udp.c
  * Routines for UDP packet disassembly
  *
- * $Id: packet-udp.c,v 1.96 2001/11/26 04:52:51 hagbard Exp $
+ * $Id: packet-udp.c,v 1.100 2001/12/10 00:25:40 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -77,7 +77,6 @@ typedef struct _e_udphdr {
 
 static dissector_table_t udp_dissector_table;
 static heur_dissector_list_t heur_subdissector_list;
-static conv_dissector_list_t conv_subdissector_list;
 static dissector_handle_t data_handle;
 
 /* Determine if there is a sub-dissector and call it.  This has been */
@@ -126,10 +125,10 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   guint16    computed_cksum;
   int        offset = 0;
 
-  if (check_col(pinfo->fd, COL_PROTOCOL))
-    col_set_str(pinfo->fd, COL_PROTOCOL, "UDP");
-  if (check_col(pinfo->fd, COL_INFO))
-    col_clear(pinfo->fd, COL_INFO);
+  if (check_col(pinfo->cinfo, COL_PROTOCOL))
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "UDP");
+  if (check_col(pinfo->cinfo, COL_INFO))
+    col_clear(pinfo->cinfo, COL_INFO);
 
   /* Avoids alignment problems on many architectures. */
   tvb_memcpy(tvb, (guint8 *)&uh, offset, sizeof(e_udphdr));
@@ -138,8 +137,8 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   uh_ulen  = ntohs(uh.uh_ulen);
   uh_sum   = ntohs(uh.uh_sum);
   
-  if (check_col(pinfo->fd, COL_INFO))
-    col_add_fstr(pinfo->fd, COL_INFO, "Source port: %s  Destination port: %s",
+  if (check_col(pinfo->cinfo, COL_INFO))
+    col_add_fstr(pinfo->cinfo, COL_INFO, "Source port: %s  Destination port: %s",
            get_udp_port(uh_sport), get_udp_port(uh_dport));
     
   if (tree) {
@@ -268,9 +267,9 @@ proto_register_udp(void)
        proto_register_subtree_array(ett, array_length(ett));
 
 /* subdissector code */
-       udp_dissector_table = register_dissector_table("udp.port");
+       udp_dissector_table = register_dissector_table("udp.port",
+           "UDP port", FT_UINT16, BASE_DEC);
        register_heur_dissector_list("udp", &heur_subdissector_list);
-       register_conv_dissector_list("udp", &conv_subdissector_list);
        
        /* Register configuration preferences */
        udp_module = prefs_register_protocol(proto_udp, NULL);
@@ -283,6 +282,9 @@ proto_register_udp(void)
 void
 proto_reg_handoff_udp(void)
 {
-       dissector_add("ip.proto", IP_PROTO_UDP, dissect_udp, proto_udp);
+       dissector_handle_t udp_handle;
+
+       udp_handle = create_dissector_handle(dissect_udp, proto_udp);
+       dissector_add("ip.proto", IP_PROTO_UDP, udp_handle);
        data_handle = find_dissector("data");
 }