Ethereal-dev: [Ethereal-dev] minor changes to isakmp

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Mon, 5 Nov 2001 16:13:40 +0100
Guy,

enclosed you´ll find two minor changes to packet-isakmp.c (IPCOMP and
ID_IPV4_ADDR_SUBNET).

Best regards,
liebe Gruesse aus Berlin,
-- Stocki

Index: packet-isakmp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-isakmp.c,v
retrieving revision 1.47
diff -u -b -r1.47 packet-isakmp.c
--- packet-isakmp.c 2001/10/26 10:30:16  1.47
+++ packet-isakmp.c 2001/11/05 15:09:09
@@ -156,6 +156,18 @@
   "AES"
 };

+#define NUM_IPCOMP_TRANS_TYPES    5
+#define ipcomp_trans2str(t)  \
+  ((t < NUM_IPCOMP_TRANS_TYPES) ? ipcomp_transtypestr[t] :
"UNKNOWN-IPCOMP-TRANS-TYPE")
+
+static const char *ipcomp_transtypestr[NUM_IPCOMP_TRANS_TYPES] = {
+  "RESERVED",
+  "OUI",
+  "DEFLATE",
+  "LZS",
+  "LZJH"
+};
+
 #define NUM_ID_TYPES    12
 #define id2str(t)  \
   ((t < NUM_ID_TYPES) ? idtypestr[t] : "UNKNOWN-ID-TYPE")
@@ -614,6 +626,11 @@
               "Transform ID: %s (%u)",
               esp_trans2str(transform_id), transform_id);
     break;
+  case 4:     /* IPCOMP */
+    proto_tree_add_text(tree, tvb, offset, 1,
+              "Transform ID: %s (%u)",
+              ipcomp_trans2str(transform_id), transform_id);
+    break;
   }
   offset += 3;
   length -= 3;
@@ -706,7 +723,6 @@

   switch (id_type) {
     case 1:
-    case 4:
       proto_tree_add_text(tree, tvb, offset, length,
                 "Identification data: %s",
                 ip_to_str(tvb_get_ptr(tvb, offset, 4)));
@@ -716,6 +732,12 @@
       proto_tree_add_text(tree, tvb, offset, length,
                 "Identification data: %.*s", length,
                 tvb_get_ptr(tvb, offset, length));
+      break;
+    case 4:
+      proto_tree_add_text(tree, tvb, offset, length,
+                "Identification data: %s/%s",
+                ip_to_str(tvb_get_ptr(tvb, offset, 4)),
+                ip_to_str(tvb_get_ptr(tvb, offset+4, 4)));
       break;
     default:
       proto_tree_add_text(tree, tvb, offset, length, "Identification
Data");