chiark / gitweb /
Allow admin clients to filter out async messages. Send notifications
[tripe] / ethereal / packet-tripe.c
index afeb1bcc3435e0dea8960942169ef4e783d56e5a..aaad0ec9b486fabfbd0e71d8b5bbac4099a7c12a 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: packet-tripe.c,v 1.4 2004/04/18 18:08:11 mdw Exp $
+ * $Id$
  *
  * TrIPE protocol dissector for Ethereal
  *
 
 #include <glib.h>
 #include <gmodule.h>
-#include <epan/packet.h>
-#include <prefs.h>
-
-#ifdef ETHEREAL_BUGGERED
-#  define plugin_address_table_t void
-#  define plugin_address_table_init(x)
-#else
-#  include <plugins/plugin_api.h>
-#endif
+#include <ethereal/config.h>
+#include <ethereal/epan/packet.h>
+#include <ethereal/epan/prefs.h>
 
 #include "tripe-protocol.h"
 
@@ -132,13 +126,15 @@ static void dissect_tripe(tvbuff_t *b, packet_info *p, proto_tree *t)
   proto_item *ti;
   proto_tree *tt;
   guint8 ty;
-  gint off = tvb_raw_offset(b);
+  gint off = 0;
   guint32 seq;
 
   /* --- Initialize the summary cells --- */
 
   if (check_col(p->cinfo, COL_PROTOCOL))
     col_set_str(p->cinfo, COL_PROTOCOL, "TrIPE");
+  if (check_col(p->cinfo, COL_INFO))
+    col_clear(p->cinfo, COL_INFO);
   ty = tvb_get_guint8(b, 0);
   if (check_col(p->cinfo, COL_INFO)) {
     col_clear(p->cinfo, COL_INFO);
@@ -286,111 +282,111 @@ void proto_register_tripe(void)
   };
 
   static hf_register_info hfs[] = {
-    &hf_tripe_cat, {
+    &hf_tripe_cat, {
       "Message category", "tripe.cat",
       FT_UINT8, BASE_HEX, 0, MSG_CATMASK
-    },
-    &hf_tripe_packet_type, {
+    } },
+    &hf_tripe_packet_type, {
       "Packet message type", "tripe.packet.type",
       FT_UINT8, BASE_HEX, 0, MSG_TYPEMASK,
       "This is the TrIPE packet type subcode."
-    },
-    &hf_tripe_ct, {
+    } },
+    &hf_tripe_ct, {
       "Encrypted ciphertext", "tripe.ct",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is an encrypted message."
-    },
-    &hf_tripe_ct_seq, {
+    } },
+    &hf_tripe_ct_seq, {
       "Ciphertext sequence number", "tripe.ct.seq",
       FT_UINT32, BASE_DEC, 0, 0,
       "This is the unique sequence number for the ciphertext."
-    },
-    &hf_tripe_ct_iv, {
+    } },
+    &hf_tripe_ct_iv, {
       "Ciphertext initialization vector", "tripe.ct.iv",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the initialization vector used for the actual encryption."
-    },
-    &hf_tripe_ct_ct, {
+    } },
+    &hf_tripe_ct_ct, {
       "Actual encrypted data", "tripe.ct.ct",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the encrypted message.  Reading it ought to be hard."
-    },
-    &hf_tripe_ct_tag, {
+    } },
+    &hf_tripe_ct_tag, {
       "Message authentication code", "tripe.ct.tag",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the message authentication code tag for the ciphertext."
-    },
-    &hf_tripe_kx_type, {
+    } },
+    &hf_tripe_kx_type, {
       "Key-exchange message type", "tripe.kx.type",
       FT_UINT8, BASE_HEX, vs_kxtype, MSG_TYPEMASK,
       "This is the TrIPE key-exchange type subcode."
-    },
-    &hf_tripe_kx_mychal.hf, {
+    } },
+    &hf_tripe_kx_mychal.hf, {
       "Sender's challenge data", "tripe.kx.mychal",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the sender's challenge."
-    },
-    &hf_tripe_kx_mychal.hf_len, {
+    } },
+    &hf_tripe_kx_mychal.hf_len, {
       "Challenge length", "tripe.kx.mychal.len",
       FT_UINT16, BASE_DEC, 0, 0,
       "This is the length of the sender's challenge."
-    },
-    &hf_tripe_kx_mychal.hf_val, {
+    } },
+    &hf_tripe_kx_mychal.hf_val, {
       "Challenge", "tripe.kx.mychal.val",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the value of the sender's challenge."
-    },
-    &hf_tripe_kx_mychal.hfx_len, {
+    } },
+    &hf_tripe_kx_mychal.hfx_len, {
       "Challenge x length", "tripe.kx.mychal.x.len",
       FT_UINT16, BASE_DEC, 0, 0,
       "This is the length of the sender's challenge x-coordinate."
-    },
-    &hf_tripe_kx_mychal.hfy_val, {
+    } },
+    &hf_tripe_kx_mychal.hfy_val, {
       "Challenge x value", "tripe.kx.mychal.x.val",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the value of the sender's challenge x-coordinate."
-    },
-    &hf_tripe_kx_mychal.hfy_len, {
+    } },
+    &hf_tripe_kx_mychal.hfy_len, {
       "Challenge y length", "tripe.kx.mychal.y.len",
       FT_UINT16, BASE_DEC, 0, 0,
       "This is the length of the sender's challenge x-coordinate."
-    },
-    &hf_tripe_kx_mychal.hfx_val, {
+    } },
+    &hf_tripe_kx_mychal.hfx_val, {
       "Challenge y value", "tripe.kx.mychal.y.val",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the value of the sender's challenge x-coordinate."
-    },
-    &hf_tripe_kx_mycookie, {
+    } },
+    &hf_tripe_kx_mycookie, {
       "Sender's hashed cookie", "tripe.kx.mycookie",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the hash of the sender's challenge."
-    },
-    &hf_tripe_kx_yourcookie, {
+    } },
+    &hf_tripe_kx_yourcookie, {
       "Recipient's hashed cookie", "tripe.kx.yourcookie",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the hash of the recipient's challenge."
-    },
-    &hf_tripe_kx_check.hf, {
+    } },
+    &hf_tripe_kx_check.hf, {
       "Challenge check-value", "tripe.kx.check",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is an encrypted check-value which proves that the sender "
       "knows the answer to the challenge, and that it is therefore honest."
-    },
-    &hf_tripe_kx_check.hf_len, {
+    } },
+    &hf_tripe_kx_check.hf_len, {
       "Check-value length", "tripe.kx.check.len",
       FT_UINT16, BASE_DEC, 0, 0,
       "This is the length of the encrypted check-value."
-    },
-    &hf_tripe_kx_check.hf_val, {
+    } },
+    &hf_tripe_kx_check.hf_val, {
       "Check-value data", "tripe.kx.check.val",
       FT_BYTES, BASE_NONE, 0, 0,
       "This is the actual encrypted check-value."
-    },
-    &hf_tripe_huh, {
+    } },
+    &hf_tripe_huh, {
       "Unknown data", "tripe.huh",
       FT_BYTES, BASE_NONE, 0, 0,
       "I don't know what's meant to appear here."
-    },
+    } },
   };
 
   static gint *tts[] = {
@@ -429,9 +425,8 @@ G_MODULE_EXPORT void plugin_reg_handoff(void)
   proto_reg_handoff_tripe();
 }
 
-G_MODULE_EXPORT void plugin_init(plugin_address_table_t *pat)
+G_MODULE_EXPORT void plugin_register(void)
 {
-  plugin_address_table_init(pat);
   if (proto_tripe == -1)
     proto_register_tripe();
 }