Extract the CRC-32 code from the 802.11 dissector into a separate file,
[obnox/wireshark/wip.git] / packet-isakmp.c
index 1d9db327688807c5f947bd466ff849c68ec84ff7..929b12b3a89d291dd43fad5e8bc116bdb97f5e8d 100644 (file)
@@ -4,7 +4,7 @@
  * for ISAKMP (RFC 2407)
  * Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
  *
- * $Id: packet-isakmp.c,v 1.65 2003/05/26 22:53:58 gerald Exp $
+ * $Id: packet-isakmp.c,v 1.67 2003/08/08 23:08:02 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -1022,11 +1022,11 @@ dissect_config(tvbuff_t *tvb, int offset, int length, proto_tree *tree,
 static const char *
 payloadtype2str(guint8 type) {
 
-  if (type < NUM_LOAD_TYPES) return strfuncs[type].str;
-  if (type < 128)            return "RESERVED";
-  if (type < 256)            return "Private USE";
-
-  return "Huh? You should never see this! Shame on you!";
+  if (type < NUM_LOAD_TYPES)
+    return strfuncs[type].str;
+  if (type < 128)
+    return "RESERVED";
+  return "Private USE";
 }
 
 static const char *
@@ -1051,10 +1051,9 @@ exchtype2str(guint8 type) {
   case 33:
     return "New Group Mode";
   }
-  if (type < 240)          return "DOI Specific Use";
-  if (type < 256)          return "Private Use";
-
-  return "Huh? You should never see this! Shame on you!";
+  if (type < 240)
+    return "DOI Specific Use";
+  return "Private Use";
 }
 
 static const char *
@@ -1419,6 +1418,8 @@ proto_register_isakmp(void)
                                               "ISAKMP", "isakmp");
 /*  proto_register_field_array(proto_isakmp, hf, array_length(hf));*/
   proto_register_subtree_array(ett, array_length(ett));
+
+  register_dissector("isakmp", dissect_isakmp, proto_isakmp);
 }
 
 void
@@ -1432,7 +1433,7 @@ proto_reg_handoff_isakmp(void)
   esp_handle = find_dissector("esp");
   ah_handle = find_dissector("ah");
 
-  isakmp_handle = create_dissector_handle(dissect_isakmp, proto_isakmp);
+  isakmp_handle = find_dissector("isakmp");
   dissector_add("udp.port", UDP_PORT_ISAKMP, isakmp_handle);
   dissector_add("tcp.port", TCP_PORT_ISAKMP, isakmp_handle);
 }