Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
authorGuy Harris <guy@alum.mit.edu>
Sun, 5 May 2002 00:16:38 +0000 (00:16 -0000)
committerGuy Harris <guy@alum.mit.edu>
Sun, 5 May 2002 00:16:38 +0000 (00:16 -0000)
extracting PDUs from it and possibly doing reassembly.  Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.

Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.

Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.

Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.

Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.

svn path=/trunk/; revision=5394

15 files changed:
epan/plugins.c
epan/to_str.h
packet-cops.c
packet-dns.c
packet-dsi.c
packet-skinny.c
packet-tcp.c
packet-tcp.h
plugins/Makefile.am
plugins/gryphon/packet-gryphon.c
plugins/plugin_api.c
plugins/plugin_api.h
plugins/plugin_api_decls.h [new file with mode: 0644]
plugins/plugin_api_defs.h
plugins/plugin_table.h

index f1fd26201b4f70013123310e2d6f5c2bd41c8b62..84dbd62b4034ac02b8ebfa7f5d829e753dd2af4f 100644 (file)
@@ -1,7 +1,7 @@
 /* plugins.c
  * plugin routines
  *
- * $Id: plugins.c,v 1.50 2002/02/23 02:16:12 guy Exp $
+ * $Id: plugins.c,v 1.51 2002/05/05 00:16:34 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -64,6 +64,7 @@
 #include "conversation.h"
 #include "packet-giop.h"
 #include "packet-tpkt.h"
+#include "packet-tcp.h"
 #include "plugins/plugin_table.h"
 static plugin_address_table_t  patable;
 #endif
@@ -441,6 +442,12 @@ init_plugins(const char *plugin_dir)
 
        patable.p_is_tpkt                       = is_tpkt;
        patable.p_dissect_tpkt_encap            = dissect_tpkt_encap;
+
+       patable.p_set_actual_length             = set_actual_length;
+       patable.p_tcp_dissect_pdus              = tcp_dissect_pdus;
+       patable.p_decode_boolean_bitfield       = decode_boolean_bitfield;
+       patable.p_decode_numeric_bitfield       = decode_numeric_bitfield;
+       patable.p_decode_enumerated_bitfield    = decode_enumerated_bitfield;
 #endif
 
 #ifdef WIN32
index 18a412f90e8bf608ad04dfd2a502cf2196080e01..a95470020535ffdb1b3f3947e87e3ae97dfbcadf 100644 (file)
@@ -1,7 +1,7 @@
 /* to_str.h
  * Definitions for utilities to convert various other types to strings.
  *
- * $Id: to_str.h,v 1.5 2001/09/14 07:10:10 guy Exp $
+ * $Id: to_str.h,v 1.6 2002/05/05 00:16:34 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -51,28 +51,29 @@ typedef enum {
  * but for which no more specific module applies.  
  */
 
-gchar*     ether_to_str(const guint8 *);
-gchar*     ether_to_str_punct(const guint8 *, char);
-gchar*     ip_to_str(const guint8 *);
-void       ip_to_str_buf(const guint8 *, gchar *);
+extern gchar*  ether_to_str(const guint8 *);
+extern gchar*  ether_to_str_punct(const guint8 *, char);
+extern gchar*  ip_to_str(const guint8 *);
+extern void    ip_to_str_buf(const guint8 *, gchar *);
 struct     e_in6_addr;
-gchar*     ip6_to_str(struct e_in6_addr *);
-gchar*     ipx_addr_to_str(guint32, const guint8 *);
-gchar*     ipxnet_to_string(const guint8 *ad);
-gchar*     ipxnet_to_str_punct(const guint32 ad, char punct);
-gchar*     vines_addr_to_str(const guint8 *addrp);
-gchar*     time_secs_to_str(guint32);
-gchar*     time_msecs_to_str(guint32);
-gchar*    abs_time_to_str(nstime_t*);
-void       display_signed_time(gchar *, int, gint32, gint32, time_res_t);
-gchar*    rel_time_to_str(nstime_t*);
-gchar*    rel_time_to_secs_str(nstime_t*);
+extern char*   ip6_to_str(struct e_in6_addr *);
+extern gchar*  ipx_addr_to_str(guint32, const guint8 *);
+extern gchar*  ipxnet_to_string(const guint8 *ad);
+extern gchar*  ipxnet_to_str_punct(const guint32 ad, char punct);
+extern gchar*  vines_addr_to_str(const guint8 *addrp);
+extern gchar*  time_secs_to_str(guint32);
+extern gchar*  time_msecs_to_str(guint32);
+extern gchar*  abs_time_to_str(nstime_t*);
+extern void    display_signed_time(gchar *, int, gint32, gint32, time_res_t);
+extern gchar*  rel_time_to_str(nstime_t*);
+extern gchar*  rel_time_to_secs_str(nstime_t*);
 
 
-char * decode_bitfield_value(char *buf, guint32 val, guint32 mask, int width);
-const char *decode_boolean_bitfield(guint32 val, guint32 mask, int width,
+extern char    *decode_bitfield_value(char *buf, guint32 val, guint32 mask,
+    int width);
+extern const char *decode_boolean_bitfield(guint32 val, guint32 mask, int width,
   const char *truedesc, const char *falsedesc);
-const char *decode_numeric_bitfield(guint32 val, guint32 mask, int width,
+extern const char *decode_numeric_bitfield(guint32 val, guint32 mask, int width,
   const char *fmt);
 
 #endif /* __TO_STR_H__  */
index 68482188624a7b8465c1d83a6fcffb95f26477e5..a664e9818f0dcf6ad67cc7e44f9f5fb37522755d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright 2000, Heikki Vatiainen <hessu@cs.tut.fi>
  *
- * $Id: packet-cops.c,v 1.29 2002/04/28 00:43:16 guy Exp $
+ * $Id: packet-cops.c,v 1.30 2002/05/05 00:16:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -37,7 +37,7 @@
 #include <glib.h>
 #include <epan/packet.h>
 #include "packet-ipv6.h"
-#include "packet-frame.h"
+#include "packet-tcp.h"
 
 #include "asn1.h"
 #include "format-oid.h"
@@ -426,6 +426,7 @@ static gint ett_cops_pdp = -1;
 
 void proto_reg_handoff_cops(void);
 
+static guint get_cops_pdu_len(tvbuff_t *tvb, int offset);
 static void dissect_cops_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
 
 static int dissect_cops_object(tvbuff_t *tvb, guint32 offset, proto_tree *tree);
@@ -440,115 +441,17 @@ static int dissect_cops_pr_object_data(tvbuff_t *tvb, guint32 offset, proto_tree
 static void
 dissect_cops(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
-        volatile int offset = 0;
-       int length_remaining;
-       guint32 msg_len;
-       int length;
-       tvbuff_t *next_tvb;
-
-       while (tvb_reported_length_remaining(tvb, offset) != 0) {
-               length_remaining = tvb_length_remaining(tvb, offset);
-               if (length_remaining == -1)
-                       THROW(BoundsError);
-
-               /*
-                * Can we do reassembly?
-                */
-               if (cops_desegment && pinfo->can_desegment) {
-                       /*
-                        * Yes - is the COPS header split across segment
-                        * boundaries?
-                        */
-                       if (length_remaining < 8) {
-                               /*
-                                * Yes.  Tell the TCP dissector where
-                                * the data for this message starts in
-                                * the data it handed us, and how many
-                                * more bytes we need, and return.
-                                */
-                               pinfo->desegment_offset = offset;
-                               pinfo->desegment_len = 8 - length_remaining;
-                               return;
-                       }
-               }
-
-               /*
-                * Get the length of the COPS message.
-                */
-               msg_len = tvb_get_ntohl(tvb, offset + 4);
-
-               /*
-                * Can we do reassembly?
-                */
-               if (cops_desegment && pinfo->can_desegment) {
-                       /*
-                        * Yes - is the DNS packet split across segment
-                        * boundaries?
-                        */
-                       if ((guint32)length_remaining < msg_len) {
-                               /*
-                                * Yes.  Tell the TCP dissector where
-                                * the data for this message starts in
-                                * the data it handed us, and how many
-                                * more bytes we need, and return.
-                                */
-                               pinfo->desegment_offset = offset;
-                               pinfo->desegment_len =
-                                   msg_len - length_remaining;
-                               return;
-                       }
-               }
-
-               /*
-                * Construct a tvbuff containing the amount of the payload
-                * we have available.  Make its reported length the
-                * amount of data in the COPS packet.
-                *
-                * XXX - if reassembly isn't enabled. the subdissector
-                * will throw a BoundsError exception, rather than a
-                * ReportedBoundsError exception.  We really want
-                * a tvbuff where the length is "length", the reported
-                * length is "plen + 2", and the "if the snapshot length
-                * were infinite" length were the minimum of the
-                * reported length of the tvbuff handed to us and "plen+2",
-                * with a new type of exception thrown if the offset is
-                * within the reported length but beyond that third length,
-                * with that exception getting the "Unreassembled Packet"
-                * error.
-                */
-               length = length_remaining;
-               if ((guint32)length > msg_len)
-                       length = msg_len;
-               next_tvb = tvb_new_subset(tvb, offset, length, msg_len);
-
-               /*
-                * Dissect the COPS packet.
-                *
-                * Catch the ReportedBoundsError exception; if this
-                * particular message happens to get a ReportedBoundsError
-                * exception, that doesn't mean that we should stop
-                * dissecting COPS messages within this frame or chunk
-                * of reassembled data.
-                *
-                * If it gets a BoundsError, we can stop, as there's nothing
-                * more to see, so we just re-throw it.
-                */
-               TRY {
-                       dissect_cops_pdu(next_tvb, pinfo, tree);
-               }
-               CATCH(BoundsError) {
-                       RETHROW;
-               }
-               CATCH(ReportedBoundsError) {
-                       show_reported_bounds_error(tvb, pinfo, tree);
-               }
-               ENDTRY;
+       tcp_dissect_pdus(tvb, pinfo, tree, cops_desegment, 8,
+           get_cops_pdu_len, dissect_cops_pdu);
+}
 
-               /*
-                * Skip the COPS packet.
-                */
-               offset += msg_len;
-       }
+static guint
+get_cops_pdu_len(tvbuff_t *tvb, int offset)
+{
+       /*
+        * Get the length of the COPS message.
+        */
+       return tvb_get_ntohl(tvb, offset + 4);
 }
 
 static void
index f95e0e553ce0e142443a23b70131c6e7a21c3e73..0ef668a35b51c60779b7828be0d27e665cadf625 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-dns.c
  * Routines for DNS packet disassembly
  *
- * $Id: packet-dns.c,v 1.84 2002/03/19 09:18:42 guy Exp $
+ * $Id: packet-dns.c,v 1.85 2002/05/05 00:16:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -39,7 +39,7 @@
 #include "ipproto.h"
 #include <epan/resolv.h>
 #include "packet-dns.h"
-#include "packet-frame.h"
+#include "packet-tcp.h"
 #include "prefs.h"
 
 static int proto_dns = -1;
@@ -1753,8 +1753,8 @@ dissect_answer_records(tvbuff_t *tvb, int cur_off, int dns_data_offset,
 }
 
 static void
-dissect_dns_common(tvbuff_t *tvb, int msg_len, packet_info *pinfo,
-       proto_tree *tree, gboolean is_tcp)
+dissect_dns_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
+    gboolean is_tcp)
 {
   int offset = is_tcp ? 2 : 0;
   int dns_data_offset;
@@ -1816,7 +1816,7 @@ dissect_dns_common(tvbuff_t *tvb, int msg_len, packet_info *pinfo,
 
     if (is_tcp) {
       /* Put the length indication into the tree. */
-      proto_tree_add_uint(dns_tree, hf_dns_length, tvb, offset - 2, 2, msg_len);
+      proto_tree_add_item(dns_tree, hf_dns_length, tvb, offset - 2, 2, FALSE);
     }
 
     if (flags & F_RESPONSE)
@@ -1946,119 +1946,36 @@ dissect_dns_common(tvbuff_t *tvb, int msg_len, packet_info *pinfo,
 static void
 dissect_dns_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
-       dissect_dns_common(tvb, -1, pinfo, tree, FALSE);
+  dissect_dns_common(tvb, pinfo, tree, FALSE);
+}
+
+static guint
+get_dns_pdu_len(tvbuff_t *tvb, int offset)
+{
+  guint16 plen;
+
+  /*
+   * Get the length of the DNS packet.
+   */
+  plen = tvb_get_ntohs(tvb, offset);
+
+  /*
+   * That length doesn't include the length field itself; add that in.
+   */
+  return plen + 2;
+}
+
+static void
+dissect_dns_tcp_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+  dissect_dns_common(tvb, pinfo, tree, TRUE);
 }
 
 static void
 dissect_dns_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
-       volatile int offset = 0;
-       int length_remaining;
-       guint16 plen;
-       int length;
-       tvbuff_t *next_tvb;
-
-       while (tvb_reported_length_remaining(tvb, offset) != 0) {
-               length_remaining = tvb_length_remaining(tvb, offset);
-
-               /*
-                * Can we do reassembly?
-                */
-               if (dns_desegment && pinfo->can_desegment) {
-                       /*
-                        * Yes - is the DNS-over-TCP header split across
-                        * segment boundaries?
-                        */
-                       if (length_remaining < 2) {
-                               /*
-                                * Yes.  Tell the TCP dissector where
-                                * the data for this message starts in
-                                * the data it handed us, and how many
-                                * more bytes we need, and return.
-                                */
-                               pinfo->desegment_offset = offset;
-                               pinfo->desegment_len = 2 - length_remaining;
-                               return;
-                       }
-               }
-
-               /*
-                * Get the length of the DNS packet.
-                */
-               plen = tvb_get_ntohs(tvb, offset);
-
-               /*
-                * Can we do reassembly?
-                */
-               if (dns_desegment && pinfo->can_desegment) {
-                       /*
-                        * Yes - is the DNS packet split across segment
-                        * boundaries?
-                        */
-                       if (length_remaining < plen + 2) {
-                               /*
-                                * Yes.  Tell the TCP dissector where
-                                * the data for this message starts in
-                                * the data it handed us, and how many
-                                * more bytes we need, and return.
-                                */
-                               pinfo->desegment_offset = offset;
-                               pinfo->desegment_len =
-                                   (plen + 2) - length_remaining;
-                               return;
-                       }
-               }
-
-               /*
-                * Construct a tvbuff containing the amount of the payload
-                * we have available.  Make its reported length the
-                * amount of data in the DNS-over-TCP packet.
-                *
-                * XXX - if reassembly isn't enabled. the subdissector
-                * will throw a BoundsError exception, rather than a
-                * ReportedBoundsError exception.  We really want
-                * a tvbuff where the length is "length", the reported
-                * length is "plen + 2", and the "if the snapshot length
-                * were infinite" length is the minimum of the
-                * reported length of the tvbuff handed to us and "plen+2",
-                * with a new type of exception thrown if the offset is
-                * within the reported length but beyond that third length,
-                * with that exception getting the "Unreassembled Packet"
-                * error.
-                */
-               length = length_remaining;
-               if (length > plen + 2)
-                       length = plen + 2;
-               next_tvb = tvb_new_subset(tvb, offset, length, plen + 2);
-
-               /*
-                * Dissect the DNS-over-TCP packet.
-                *
-                * Catch the ReportedBoundsError exception; if this
-                * particular message happens to get a ReportedBoundsError
-                * exception, that doesn't mean that we should stop
-                * dissecting DNS-over-TCP messages within this frame or
-                * chunk of reassembled data.
-                *
-                * If it gets a BoundsError, we can stop, as there's nothing
-                * more to see, so we just re-throw it.
-                */
-               TRY {
-                       dissect_dns_common(next_tvb, plen, pinfo, tree, TRUE);
-               }
-               CATCH(BoundsError) {
-                       RETHROW;
-               }
-               CATCH(ReportedBoundsError) {
-                       show_reported_bounds_error(tvb, pinfo, tree);
-               }
-               ENDTRY;
-
-               /*
-                * Skip the DNS-over-TCP header and the payload.
-                */
-               offset += plen + 2;
-       }
+  tcp_dissect_pdus(tvb, pinfo, tree, dns_desegment, 2, get_dns_pdu_len,
+       dissect_dns_tcp_pdu);
 }
 
 void
index e2387cbbd130cde6391cf5839f16b23a67b43a8b..4db93e87f5e84550852f9a0b1d9140e0b651542b 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for dsi packet dissection
  * Copyright 2001, Randy McEoin <rmceoin@pe.com>
  *
- * $Id: packet-dsi.c,v 1.18 2002/05/03 21:25:43 guy Exp $
+ * $Id: packet-dsi.c,v 1.19 2002/05/05 00:16:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -43,7 +43,7 @@
 #include <epan/packet.h>
 
 #include "prefs.h"
-#include "packet-frame.h"
+#include "packet-tcp.h"
 
 #include "packet-afp.h"
 
@@ -402,120 +402,28 @@ dissect_dsi_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        }
 }
 
-static void
-dissect_dsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static guint
+get_dsi_pdu_len(tvbuff_t *tvb, int offset)
 {
-       volatile int offset = 0;
-       int length_remaining;
        guint32 plen;
-       int length;
-       tvbuff_t *next_tvb;
-
-       while (tvb_reported_length_remaining(tvb, offset) != 0) {
-               length_remaining = tvb_length_remaining(tvb, offset);
-
-               /*
-                * Can we do reassembly?
-                */
-               if (dsi_desegment && pinfo->can_desegment) {
-                       /*
-                        * Yes - is the DSI header split across segment
-                        * boundaries?
-                        */
-                       if (length_remaining < 12) {
-                               /*
-                                * Yes.  Tell the TCP dissector where
-                                * the data for this message starts in
-                                * the data it handed us, and how many
-                                * more bytes we need, and return.
-                                */
-                               pinfo->desegment_offset = offset;
-                               pinfo->desegment_len = 12 - length_remaining;
-                               return;
-                       }
-               }
 
-               /*
-                * Get the length of the DSI packet.
-                */
-               plen = tvb_get_ntohl(tvb, offset+8);
-
-               /*
-                * Can we do reassembly?
-                */
-               if (dsi_desegment && pinfo->can_desegment) {
-                       /*
-                        * Yes - is the DSI packet split across segment
-                        * boundaries?
-                        */
-                       if ((guint32)length_remaining < plen + 16) {
-                               /*
-                                * Yes.  Tell the TCP dissector where
-                                * the data for this message starts in
-                                * the data it handed us, and how many
-                                * more bytes we need, and return.
-                                */
-                               pinfo->desegment_offset = offset;
-                               pinfo->desegment_len =
-                                   (plen + 16) - length_remaining;
-                               return;
-                       }
-               }
+       /*
+        * Get the length of the DSI packet.
+        */
+       plen = tvb_get_ntohl(tvb, offset+8);
 
-               /*
-                * Construct a tvbuff containing the amount of the payload
-                * we have available.  Make its reported length the
-                * amount of data in the DSI packet.
-                *
-                * XXX - if reassembly isn't enabled. the subdissector
-                * will throw a BoundsError exception, rather than a
-                * ReportedBoundsError exception.  We really want
-                * a tvbuff where the length is "length", the reported
-                * length is "plen + 16", and the "if the snapshot length
-                * were infinite" length is the minimum of the
-                * reported length of the tvbuff handed to us and "plen+16",
-                * with a new type of exception thrown if the offset is
-                * within the reported length but beyond that third length,
-                * with that exception getting the "Unreassembled Packet"
-                * error.
-                */
-               if (plen > 0x7fffffff) {
-                       show_reported_bounds_error(tvb, pinfo, tree);
-                       return;
-               }                                       
-               length = length_remaining;
-               if ((guint32)length > plen + 16)
-                       length = plen + 16;
-               next_tvb = tvb_new_subset(tvb, offset, length, plen + 16);
-
-               /*
-                * Dissect the DSI packet.
-                *
-                * Catch the ReportedBoundsError exception; if this
-                * particular message happens to get a ReportedBoundsError
-                * exception, that doesn't mean that we should stop
-                * dissecting DSI messages within this frame or chunk
-                * of reassembled data.
-                *
-                * If it gets a BoundsError, we can stop, as there's nothing
-                * more to see, so we just re-throw it.
-                */
-               TRY {
-                       dissect_dsi_packet(next_tvb, pinfo, tree);
-               }
-               CATCH(BoundsError) {
-                       RETHROW;
-               }
-               CATCH(ReportedBoundsError) {
-                       show_reported_bounds_error(tvb, pinfo, tree);
-               }
-               ENDTRY;
+       /*
+        * That length doesn't include the length of the header itself;
+        * add that in.
+        */
+       return plen + 16;
+}
 
-               /*
-                * Skip the DSI header and the payload.
-                */
-               offset += plen + 16;
-       }
+static void
+dissect_dsi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+       tcp_dissect_pdus(tvb, pinfo, tree, dsi_desegment, 12,
+           get_dsi_pdu_len, dissect_dsi_packet);
 }
 
 void
index 7933827819755f1fc213c81870b5aef307148011..663bd5fb9e9d38df8dd806d585f113bdd712a77f 100644 (file)
@@ -11,7 +11,7 @@
  * This file is based on packet-aim.c, which is
  * Copyright 2000, Ralf Hoelzer <ralf@well.com>
  *
- * $Id: packet-skinny.c,v 1.17 2002/03/27 20:29:05 guy Exp $
+ * $Id: packet-skinny.c,v 1.18 2002/05/05 00:16:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -45,7 +45,7 @@
 #include <epan/packet.h>
 #include "prefs.h"
 
-#include "packet-frame.h"
+#include "packet-tcp.h"
 
 #define TCP_PORT_SKINNY 2000
 
@@ -828,6 +828,23 @@ static gboolean skinny_desegment = TRUE;
 
 static dissector_handle_t data_handle;
 
+/* Get the length of a single SCCP PDU */
+static guint get_skinny_pdu_len(tvbuff_t *tvb, int offset)
+{
+  guint32 hdr_data_length;
+
+  /*
+   * Get the length of the SCCP packet.
+   */
+  hdr_data_length = tvb_get_letohl(tvb, offset);
+
+  /*
+   * That length doesn't include the length of the header itself;
+   * add that in.
+   */
+  return hdr_data_length + 8;
+}
+
 /* Dissect a single SCCP PDU */
 static void dissect_skinny_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
@@ -1446,12 +1463,6 @@ static void dissect_skinny(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
   /* The general structure of a packet: {IP-Header|TCP-Header|n*SKINNY}
    * SKINNY-Packet: {Header(Size, Reserved)|Data(MessageID, Message-Data)}
    */
-  
-  volatile int offset = 0;
-  int length_remaining;
-  int length;
-  tvbuff_t *next_tvb;
-
   /* Header fields */
   volatile guint32 hdr_data_length;
   guint32 hdr_reserved;
@@ -1480,100 +1491,8 @@ static void dissect_skinny(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
     col_set_str(pinfo->cinfo, COL_INFO, "Skinny Client Control Protocol");
   }
   
-  while (tvb_reported_length_remaining(tvb, offset) != 0) {
-    length_remaining = tvb_length_remaining(tvb, offset);
-
-    /*
-     * Can we do reassembly?
-     */
-    if (skinny_desegment && pinfo->can_desegment) {
-      /*
-       * Yes - is the length field in the SCCP header split across
-       * segment boundaries?
-       */
-      if (length_remaining < 4) {
-       /*
-        * Yes.  Tell the TCP dissector where the data for this message
-        * starts in the data it handed us, and how many more bytes we
-        * need, and return.
-        */
-       pinfo->desegment_offset = offset;
-       pinfo->desegment_len = 4 - length_remaining;
-       return;
-      }
-    }
-
-    /*
-     * Get the length of the SCCP packet.
-     */
-    hdr_data_length = tvb_get_letohl(tvb, offset);
-
-    /*
-     * Can we do reassembly?
-     */
-    if (skinny_desegment && pinfo->can_desegment) {
-      /*
-       * Yes - is the SCCP packet split across segment boundaries?
-       */
-      if ((guint32)length_remaining < hdr_data_length + 8) {
-       /*
-        * Yes.  Tell the TCP dissector where the data for this message
-        * starts in the data it handed us, and how many more bytes we
-        * need, and return.
-        */
-       pinfo->desegment_offset = offset;
-       pinfo->desegment_len = (hdr_data_length + 8) - length_remaining;
-       return;
-      }
-    }
-
-    /*
-     * Construct a tvbuff containing the amount of the payload we have
-     * available.  Make its reported length the amount of data in the
-     * SCCP packet.
-     *
-     * XXX - if reassembly isn't enabled. the subdissector will throw a
-     * BoundsError exception, rather than a ReportedBoundsError exception.
-     * We really want a tvbuff where the length is "length", the reported
-     * length is "hdr_data_length + 8", and the "if the snapshot length
-     * were infinite" length is the minimum of the reported length of
-     * the tvbuff handed to us and "hdr_data_length + 8", with a new type
-     * of exception thrown if the offset is within the reported length but
-     * beyond that third length, with that exception getting the
-     * "Unreassembled Packet" error.
-     */
-    length = length_remaining;
-    if ((guint32)length > hdr_data_length + 8)
-      length = hdr_data_length + 8;
-    next_tvb = tvb_new_subset(tvb, offset, length, hdr_data_length + 8);
-
-    /*
-     * Dissect the SCCP packet.
-     *
-     * Catch the ReportedBoundsError exception; if this particular message
-     * happens to get a ReportedBoundsError exception, that doesn't mean
-     * that we should stop dissecting SCCP messages within this frame or
-     * chunk of reassembled data.
-     *
-     * If it gets a BoundsError, we can stop, as there's nothing more to
-     * see, so we just re-throw it.
-     */
-    TRY {
-      dissect_skinny_pdu(next_tvb, pinfo, tree);
-    }
-    CATCH(BoundsError) {
-      RETHROW;
-    }
-    CATCH(ReportedBoundsError) {
-      show_reported_bounds_error(tvb, pinfo, tree);
-    }
-    ENDTRY;
-
-    /*
-     * Skip the SCCP header and the payload.
-     */
-    offset += hdr_data_length + 8;
-  }
+  tcp_dissect_pdus(tvb, pinfo, tree, skinny_desegment, 4,
+       get_skinny_pdu_len, dissect_skinny_pdu);
 }
 
 /* Register the protocol with Ethereal */
index f3919a74c1187b050d21d034f4e850901c4820d4..0bfa45eb65521bb201b0637e518fe3f2448284b7 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-tcp.c
  * Routines for TCP packet disassembly
  *
- * $Id: packet-tcp.c,v 1.139 2002/05/04 02:54:48 sharpe Exp $
+ * $Id: packet-tcp.c,v 1.140 2002/05/05 00:16:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -49,6 +49,7 @@
 #include "prefs.h"
 #include "packet-tcp.h"
 #include "packet-ip.h"
+#include "packet-frame.h"
 #include <epan/conversation.h>
 #include <epan/strutil.h>
 #include "reassemble.h"
@@ -643,8 +644,142 @@ desegment_tcp(tvbuff_t *tvb, packet_info *pinfo, int offset,
        pinfo->desegment_len = 0;
 }
 
+/*
+ * Loop for dissecting PDUs within a TCP stream; assumes that a PDU
+ * consists of a fixed-length chunk of data that contains enough information
+ * to determine the length of the PDU, followed by rest of the PDU.
+ *
+ * The first three arguments are the arguments passed to the dissector
+ * that calls this routine.
+ *
+ * "proto_desegment" is the dissector's flag controlling whether it should
+ * desegment PDUs that cross TCP segment boundaries.
+ *
+ * "fixed_len" is the length of the fixed-length part of the PDU.
+ *
+ * "get_pdu_len()" is a routine called to get the length of the PDU from
+ * the fixed-length part of the PDU; it's passed "tvb" and "offset".
+ *
+ * "dissect_pdu()" is the routine to dissect a PDU.
+ */
+void
+tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
+                gboolean proto_desegment, int fixed_len,
+                guint (*get_pdu_len)(tvbuff_t *, int),
+                void (*dissect_pdu)(tvbuff_t *, packet_info *, proto_tree *))
+{
+  volatile int offset = 0;
+  int length_remaining;
+  guint plen;
+  int length;
+  tvbuff_t *next_tvb;
+
+  while (tvb_reported_length_remaining(tvb, offset) != 0) {
+    length_remaining = tvb_length_remaining(tvb, offset);
+    if (length_remaining == -1)
+      THROW(BoundsError);
+
+    /*
+     * Can we do reassembly?
+     */
+    if (proto_desegment && pinfo->can_desegment) {
+      /*
+       * Yes - is the fixed-length part of the PDU split across segment
+       * boundaries?
+       */
+      if (length_remaining < fixed_len) {
+       /*
+        * Yes.  Tell the TCP dissector where the data for this message
+        * starts in the data it handed us, and how many more bytes we
+        * need, and return.
+        */
+       pinfo->desegment_offset = offset;
+       pinfo->desegment_len = fixed_len - length_remaining;
+       return;
+      }
+    }
 
+    /*
+     * Get the length of the PDU.
+     */
+    plen = (*get_pdu_len)(tvb, offset);
 
+    /*
+     * Can we do reassembly?
+     */
+    if (proto_desegment && pinfo->can_desegment) {
+      /*
+       * Yes - is the PDU split across segment boundaries?
+       */
+      if ((guint)length_remaining < plen) {
+       /*
+        * Yes.  Tell the TCP dissector where the data for this message
+        * starts in the data it handed us, and how many more bytes we
+        * need, and return.
+        */
+       pinfo->desegment_offset = offset;
+       pinfo->desegment_len = plen - length_remaining;
+       return;
+      }
+    }
+
+    /*
+     * Construct a tvbuff containing the amount of the payload we have
+     * available.  Make its reported length the amount of data in the PDU.
+     *
+     * XXX - if reassembly isn't enabled. the subdissector will throw a
+     * BoundsError exception, rather than a ReportedBoundsError exception.
+     * We really want a tvbuff where the length is "length", the reported
+     * length is "plen", and the "if the snapshot length were infinite"
+     * length is the minimum of the reported length of the tvbuff handed
+     * to us and "plen", with a new type of exception thrown if the offset
+     * is within the reported length but beyond that third length, with
+     * that exception getting the "Unreassembled Packet" error.
+     */
+    if (plen < (guint)fixed_len) {
+      /*
+       * The PDU length from the fixed-length portion probably didn't
+       * include the fixed-length portion's length, and was probably so
+       * large that the total length overflowed.
+       *
+       * Report this as an error.
+       */
+      show_reported_bounds_error(tvb, pinfo, tree);
+      return;
+    }
+    length = length_remaining;
+    if ((guint)length > plen)
+       length = plen;
+    next_tvb = tvb_new_subset(tvb, offset, length, plen);
+
+    /*
+     * Dissect the PDU.
+     *
+     * Catch the ReportedBoundsError exception; if this particular message
+     * happens to get a ReportedBoundsError exception, that doesn't mean
+     * that we should stop dissecting PDUs within this frame or chunk of
+     * reassembled data.
+     *
+     * If it gets a BoundsError, we can stop, as there's nothing more to
+     * see, so we just re-throw it.
+     */
+    TRY {
+      (*dissect_pdu)(next_tvb, pinfo, tree);
+    }
+    CATCH(BoundsError) {
+      RETHROW;
+    }
+    CATCH(ReportedBoundsError) {
+      show_reported_bounds_error(tvb, pinfo, tree);
+    }
+    ENDTRY;
+
+    /*
+     * Step to the next PDU.
+     */
+    offset += plen;
+  }
+}
 
 static void
 tcp_info_append_uint(packet_info *pinfo, const char *abbrev, guint32 val)
index 5e4c34184b0d5001a80f2906089707de895ecb0d..40d8a354e5c19f189cf83fcf998e5b4af5a2f765 100644 (file)
@@ -1,6 +1,6 @@
 /* packet-tcp.h
  *
- * $Id: packet-tcp.h,v 1.9 2002/02/18 23:51:55 guy Exp $
+ * $Id: packet-tcp.h,v 1.10 2002/05/05 00:16:32 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -34,6 +34,29 @@ struct tcpinfo {
        guint16 urgent_pointer;  /* Urgent pointer value for the current packet. */
 };
 
+/*
+ * Loop for dissecting PDUs within a TCP stream; assumes that a PDU
+ * consists of a fixed-length chunk of data that contains enough information
+ * to determine the length of the PDU, followed by rest of the PDU.
+ *
+ * The first three arguments are the arguments passed to the dissector
+ * that calls this routine.
+ *
+ * "proto_desegment" is the dissector's flag controlling whether it should
+ * desegment PDUs that cross TCP segment boundaries.
+ *
+ * "fixed_len" is the length of the fixed-length part of the PDU.
+ *
+ * "get_pdu_len()" is a routine called to get the length of the PDU from
+ * the fixed-length part of the PDU; it's passed "tvb" and "offset".
+ *
+ * "dissect_pdu()" is the routine to dissect a PDU.
+ */
+extern void
+tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
+                gboolean proto_desegment, int fixed_len,
+                guint (*get_pdu_len)(tvbuff_t *, int),
+                void (*dissect_pdu)(tvbuff_t *, packet_info *, proto_tree *));
 
 extern void decode_tcp_ports(tvbuff_t *, int, packet_info *,
        proto_tree *, int, int);
index f4c28806a0976d63bc8192b79470744754f5f585..83338ea0000234f6bec0065047c421e01ce6e384 100644 (file)
@@ -1,7 +1,7 @@
 # Makefile.am
 # Automake file for Ethereal
 #
-# $Id: Makefile.am,v 1.8 2001/10/31 10:40:54 guy Exp $
+# $Id: Makefile.am,v 1.9 2002/05/05 00:16:36 guy Exp $
 #
 # Ethereal - Network traffic analyzer
 # By Gerald Combs <gerald@zing.org>
@@ -29,6 +29,7 @@ plugindir = @PLUGIN_DIR@
 EXTRA_DIST = \
        plugin_api.c    \
        plugin_api.h    \
+       plugin_api_decls.h      \
        plugin_api_defs.h       \
        plugin_table.h  \
        Makefile.nmake
index d7e607d47617d56eb0dfdff4a48e99a57c83d3f3..fddad1487e6b506006eb257f42f07d8a33afa1f2 100644 (file)
@@ -3,7 +3,7 @@
  * By Steve Limkemann <stevelim@dgtech.com>
  * Copyright 1998 Steve Limkemann
  *
- * $Id: packet-gryphon.c,v 1.32 2002/05/01 06:56:16 guy Exp $
+ * $Id: packet-gryphon.c,v 1.33 2002/05/05 00:16:38 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -46,7 +46,7 @@
 #endif
 #include <epan/packet.h>
 #include "packet-gryphon.h"
-#include "packet-frame.h"
+#include "packet-tcp.h"
 #include "prefs.h"
 
 #include "plugins/plugin_api_defs.h"
@@ -154,115 +154,42 @@ static char *frame_type[] = {
        "Text string"
 };
 
-static void
-dissect_gryphon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+/*
+ * Length of the frame header.
+ */
+#define FRAME_HEADER_LEN       8
+
+static guint
+get_gryphon_pdu_len(tvbuff_t *tvb, int offset)
 {
-    volatile int offset = 0;
-    int length_remaining;
     guint16 plen;
     int padded_len;
-    int length;
-    tvbuff_t *next_tvb;
-
-    offset = 0;
-    while (tvb_reported_length_remaining(tvb, offset) != 0) {
-       length_remaining = tvb_length_remaining(tvb, offset);
-
-       /*
-        * Can we do reassembly?
-        */
-       if (gryphon_desegment && pinfo->can_desegment) {
-           /*
-            * Yes - is the Gryphon header split across segment boundaries?
-            */
-           if (length_remaining < 8) {
-               /*
-                * Yes.  Tell the TCP dissector where the data for
-                * this message starts in the data it handed us,
-                * and how many more bytes we need, and return.
-                */
-               pinfo->desegment_offset = offset;
-               pinfo->desegment_len = 8 - length_remaining;
-               return;
-           }
-       }
-
-       /*
-        * Get the length of the Gryphon packet, and then
-        * get the length as padded to a 4-byte boundary.
-        */
-       plen = tvb_get_ntohs(tvb, offset + 4);
-       padded_len = plen + 3 - (plen + 3) % 4;
 
-       /*
-        * Can we do reassembly?
-        */
-       if (gryphon_desegment && pinfo->can_desegment) {
-           /*
-            * Yes - is the Gryphon packet split across segment boundaries?
-            */
-           if (length_remaining < padded_len + 8) {
-               /*
-                * Yes.  Tell the TCP dissector where the data for
-                * this message starts in the data it handed us,
-                * and how many more bytes we need, and return.
-                */
-               pinfo->desegment_offset = offset;
-               pinfo->desegment_len = (padded_len + 8) - length_remaining;
-               return;
-           }
-       }
-
-       /*
-        * Construct a tvbuff containing the amount of the payload
-        * we have available.  Make its reported length the
-        * amount of data in the Gryphon packet.
-        *
-        * XXX - if reassembly isn't enabled. the subdissector
-        * will throw a BoundsError exception, rather than a
-        * ReportedBoundsError exception.  We really want
-        * a tvbuff where the length is "length", the reported
-        * length is "plen + 8", and the "if the snapshot length
-        * were infinite" length is the minimum of the
-        * reported length of the tvbuff handed to us and "plen+8",
-        * with a new type of exception thrown if the offset is
-        * within the reported length but beyond that third length,
-        * with that exception getting the "Unreassembled Packet"
-        * error.
-        */
-       length = length_remaining;
-       if (length > plen + 8)
-           length = plen + 8;
-       next_tvb = tvb_new_subset(tvb, offset, length, plen + 8);
+    /*
+     * Get the length of the Gryphon packet, and then get the length as
+     * padded to a 4-byte boundary.
+     */
+    plen = tvb_get_ntohs(tvb, offset + 4);
+    padded_len = plen + 3 - (plen + 3) % 4;
+
+    /*
+     * That length doesn't include the fixed-length part of the header;
+     * add that in.
+     */
+    return padded_len + FRAME_HEADER_LEN;
+}
 
-       /*
-        * Dissect the Gryphon packet.
-        *
-        * Catch the ReportedBoundsError exception; if this
-        * particular message happens to get a ReportedBoundsError
-        * exception, that doesn't mean that we should stop
-        * dissecting Gryphon messages within this frame or
-        * chunk of reassembled data.
-        *
-        * If it gets a BoundsError, we can stop, as there's nothing
-        * more to see, so we just re-throw it.
-        */
-       TRY {
-           dissect_gryphon_message(next_tvb, pinfo, tree, FALSE);
-       }
-       CATCH(BoundsError) {
-           RETHROW;
-       }
-       CATCH(ReportedBoundsError) {
-           show_reported_bounds_error(tvb, pinfo, tree);
-       }
-       ENDTRY;
+static void
+dissect_gryphon_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+    dissect_gryphon_message(tvb, pinfo, tree, FALSE);
+}
 
-       /*
-        * Skip the Gryphon header and the payload.
-        */
-       offset += padded_len + 8;
-    }
+static void
+dissect_gryphon(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+{
+    tcp_dissect_pdus(tvb, pinfo, tree, gryphon_desegment, FRAME_HEADER_LEN,
+       get_gryphon_pdu_len, dissect_gryphon_pdu);
 }
 
 static const value_string src_dest[] = {
@@ -313,6 +240,12 @@ dissect_gryphon_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
     frmtyp = flags & ~RESPONSE_FLAGS;
 
     if (!is_msgresp_add) {
+       /*
+        * This tvbuff includes padding to make its length a multiple
+        * of 4 bytes; set it to the actual length.
+        */
+       set_actual_length(tvb, msglen + FRAME_HEADER_LEN);
+
        if (check_col(pinfo->cinfo, COL_INFO)) {
            /*
             * Indicate what kind of message this is.
index a76207d05c3bcad40ac2830c20b2a77bdae73fae..2c6f1b8a65559b334b7d43f452391edc4cc8173f 100644 (file)
@@ -1,7 +1,7 @@
 /* plugin_api.c
  * Routines for Ethereal plugins.
  *
- * $Id: plugin_api.c,v 1.37 2002/02/22 08:56:48 guy Exp $
+ * $Id: plugin_api.c,v 1.38 2002/05/05 00:16:36 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -140,8 +140,6 @@ plugin_address_table_init(plugin_address_table_t *pat)
        p_prefs_register_enum_preference        = pat->p_prefs_register_enum_preference;
        p_prefs_register_string_preference      = pat->p_prefs_register_string_preference;
 
-       /* GIOP Begin */
-
        p_register_giop_user                    = pat->p_register_giop_user;
        p_is_big_endian                         = pat->p_is_big_endian;
        p_get_CDR_encap_info                    = pat->p_get_CDR_encap_info;
@@ -166,12 +164,12 @@ plugin_address_table_init(plugin_address_table_t *pat)
        p_get_CDR_wchar                         = pat->p_get_CDR_wchar;
        p_get_CDR_wstring                       = pat->p_get_CDR_wstring;
 
-       /* GIOP End */
-
-       /* TPKT Begin */
-
        p_is_tpkt                               = pat->p_is_tpkt;
        p_dissect_tpkt_encap                    = pat->p_dissect_tpkt_encap;
 
-       /* TPKT End */
+       p_set_actual_length                     = pat->p_set_actual_length;
+       p_tcp_dissect_pdus                      = pat->p_tcp_dissect_pdus;
+       p_decode_boolean_bitfield               = pat->p_decode_boolean_bitfield;
+       p_decode_numeric_bitfield               = pat->p_decode_numeric_bitfield;
+       p_decode_enumerated_bitfield            = pat->p_decode_enumerated_bitfield;
 }
index b23e42438fbdcb06836dc5c294fc566052b28a3f..f76ae2ec71fa84a08554f0157a270eee539b3c91 100644 (file)
@@ -1,7 +1,7 @@
 /* plugin_api.h
  * Routines for Ethereal plugins.
  *
- * $Id: plugin_api.h,v 1.38 2002/02/22 08:56:48 guy Exp $
+ * $Id: plugin_api.h,v 1.39 2002/05/05 00:16:36 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
 #define prefs_register_enum_preference (*p_prefs_register_enum_preference)
 #define prefs_register_string_preference (*p_prefs_register_string_preference)
 
-/* GIOP entries Begin */
-
 #define register_giop_user             (*p_register_giop_user)
 #define is_big_endian                  (*p_is_big_endian)
 #define get_CDR_encap_info             (*p_get_CDR_encap_info)
 #define get_CDR_wchar                  (*p_get_CDR_wchar)
 #define get_CDR_wstring                        (*p_get_CDR_wstring)
 
-/* GIOP entries End */
-
-/* TPKT entries Begin */
-
 #define is_tpkt                                (*p_is_tpkt)
 #define dissect_tpkt_encap             (*p_dissect_tpkt_encap)
 
-/* TPKT entries End */
+#define set_actual_length              (*p_set_actual_length)
+
+#define tcp_dissect_pdus               (*p_tcp_dissect_pdus)
+
+#define decode_boolean_bitfield                (*p_decode_boolean_bitfield)
+#define decode_numeric_bitfield                (*p_decode_numeric_bitfield)
+#define decode_enumerated_bitfield     (*p_decode_enumerated_bitfield)
+
 #endif
 
 #include <epan/packet.h>
 #include "prefs.h"
 #include "packet-giop.h"
 #include "packet-tpkt.h"
+#include "packet-tcp.h"
 
 #include "plugin_table.h"
 
diff --git a/plugins/plugin_api_decls.h b/plugins/plugin_api_decls.h
new file mode 100644 (file)
index 0000000..b25456d
--- /dev/null
@@ -0,0 +1,212 @@
+/* plugin_api_decls.h
+ * Declarations of a list of "p_" names; included in various places
+ * to declare them as variables or as function members.
+ *
+ * $Id: plugin_api_decls.h,v 1.1 2002/05/05 00:16:36 guy Exp $
+ *
+ * Ethereal - Network traffic analyzer
+ * Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+/*
+ * If you're adding a new routine, please add it to the *end* of this
+ * table, so that the ABI remains backwards-compatible if the only change
+ * is that new functions are added; don't bother trying to keep related
+ * routines together.  (This list is included in "plugin_table.h" to
+ * declare the members of the function address table, so the order *does*
+ * matter.)
+ *
+ * If a routine is removed or a calling sequence changed, the ABI isn't
+ * going to be backwards-compatible no matter what you do; if that's
+ * done, you may re-shuffle the routines to put related routines
+ * together if you want.
+ */
+
+addr_check_col                         p_check_col;
+addr_col_clear                         p_col_clear;
+addr_col_add_fstr                      p_col_add_fstr;
+addr_col_append_fstr                   p_col_append_fstr;
+addr_col_prepend_fstr                  p_col_prepend_fstr;
+addr_col_add_str                       p_col_add_str;
+addr_col_append_str                    p_col_append_str;
+addr_col_set_str                       p_col_set_str;
+
+addr_register_init_routine             p_register_init_routine;
+addr_register_postseq_cleanup_routine  p_register_postseq_cleanup_routine;
+
+addr_match_strval                      p_match_strval;
+addr_val_to_str                                p_val_to_str;
+
+addr_conversation_new                  p_conversation_new;
+addr_find_conversation                 p_find_conversation;
+addr_conversation_set_dissector                p_conversation_set_dissector;
+
+addr_proto_register_protocol           p_proto_register_protocol;
+addr_proto_register_field_array                p_proto_register_field_array;
+addr_proto_register_subtree_array      p_proto_register_subtree_array;
+
+addr_dissector_add                     p_dissector_add;
+addr_dissector_delete                  p_dissector_delete;
+addr_dissector_add_handle              p_dissector_add_handle;
+
+addr_heur_dissector_add                        p_heur_dissector_add;
+
+addr_register_dissector                        p_register_dissector;
+addr_find_dissector                    p_find_dissector;
+addr_create_dissector_handle           p_create_dissector_handle;
+addr_call_dissector                    p_call_dissector;
+
+addr_proto_is_protocol_enabled         p_proto_is_protocol_enabled;
+
+addr_proto_item_get_len                        p_proto_item_get_len;
+addr_proto_item_set_len                        p_proto_item_set_len;
+addr_proto_item_set_text               p_proto_item_set_text;
+addr_proto_item_append_text            p_proto_item_append_text;
+addr_proto_item_add_subtree            p_proto_item_add_subtree;
+addr_proto_tree_add_item               p_proto_tree_add_item;
+addr_proto_tree_add_item_hidden                p_proto_tree_add_item_hidden;
+addr_proto_tree_add_protocol_format    p_proto_tree_add_protocol_format;
+
+addr_proto_tree_add_bytes              p_proto_tree_add_bytes;
+addr_proto_tree_add_bytes_hidden       p_proto_tree_add_bytes_hidden;
+addr_proto_tree_add_bytes_format       p_proto_tree_add_bytes_format;
+
+addr_proto_tree_add_time               p_proto_tree_add_time;
+addr_proto_tree_add_time_hidden                p_proto_tree_add_time_hidden;
+addr_proto_tree_add_time_format                p_proto_tree_add_time_format;
+
+addr_proto_tree_add_ipxnet             p_proto_tree_add_ipxnet;
+addr_proto_tree_add_ipxnet_hidden      p_proto_tree_add_ipxnet_hidden;
+addr_proto_tree_add_ipxnet_format      p_proto_tree_add_ipxnet_format;
+
+addr_proto_tree_add_ipv4               p_proto_tree_add_ipv4;
+addr_proto_tree_add_ipv4_hidden                p_proto_tree_add_ipv4_hidden;
+addr_proto_tree_add_ipv4_format                p_proto_tree_add_ipv4_format;
+
+addr_proto_tree_add_ipv6               p_proto_tree_add_ipv6;
+addr_proto_tree_add_ipv6_hidden                p_proto_tree_add_ipv6_hidden;
+addr_proto_tree_add_ipv6_format                p_proto_tree_add_ipv6_format;
+
+addr_proto_tree_add_ether              p_proto_tree_add_ether;
+addr_proto_tree_add_ether_hidden       p_proto_tree_add_ether_hidden;
+addr_proto_tree_add_ether_format       p_proto_tree_add_ether_format;
+
+addr_proto_tree_add_string             p_proto_tree_add_string;
+addr_proto_tree_add_string_hidden      p_proto_tree_add_string_hidden;
+addr_proto_tree_add_string_format      p_proto_tree_add_string_format;
+
+addr_proto_tree_add_boolean            p_proto_tree_add_boolean;
+addr_proto_tree_add_boolean_hidden     p_proto_tree_add_boolean_hidden;
+addr_proto_tree_add_boolean_format     p_proto_tree_add_boolean_format;
+
+addr_proto_tree_add_double             p_proto_tree_add_double;
+addr_proto_tree_add_double_hidden      p_proto_tree_add_double_hidden;
+addr_proto_tree_add_double_format      p_proto_tree_add_double_format;
+
+addr_proto_tree_add_uint               p_proto_tree_add_uint;
+addr_proto_tree_add_uint_hidden                p_proto_tree_add_uint_hidden;
+addr_proto_tree_add_uint_format                p_proto_tree_add_uint_format;
+
+addr_proto_tree_add_int                        p_proto_tree_add_int;
+addr_proto_tree_add_int_hidden         p_proto_tree_add_int_hidden;
+addr_proto_tree_add_int_format         p_proto_tree_add_int_format;
+
+addr_proto_tree_add_text               p_proto_tree_add_text;
+
+addr_tvb_new_subset                    p_tvb_new_subset;
+
+addr_tvb_set_free_cb                   p_tvb_set_free_cb;
+addr_tvb_set_child_real_data_tvbuff    p_tvb_set_child_real_data_tvbuff;
+addr_tvb_new_real_data                 p_tvb_new_real_data;
+
+addr_tvb_length                                p_tvb_length;
+addr_tvb_length_remaining              p_tvb_length_remaining;
+addr_tvb_bytes_exist                   p_tvb_bytes_exist;
+addr_tvb_offset_exists                 p_tvb_offset_exists;
+addr_tvb_reported_length               p_tvb_reported_length;
+addr_tvb_reported_length_remaining     p_tvb_reported_length_remaining;
+
+addr_tvb_get_guint8                    p_tvb_get_guint8;
+
+addr_tvb_get_ntohs                     p_tvb_get_ntohs;
+addr_tvb_get_ntoh24                    p_tvb_get_ntoh24;
+addr_tvb_get_ntohl                     p_tvb_get_ntohl;
+
+addr_tvb_get_letohs                    p_tvb_get_letohs;
+addr_tvb_get_letoh24                   p_tvb_get_letoh24;
+addr_tvb_get_letohl                    p_tvb_get_letohl;
+
+addr_tvb_memcpy                                p_tvb_memcpy;
+addr_tvb_memdup                                p_tvb_memdup;
+
+addr_tvb_get_ptr                       p_tvb_get_ptr;
+
+addr_tvb_find_guint8                   p_tvb_find_guint8;
+addr_tvb_pbrk_guint8                   p_tvb_pbrk_guint8;
+
+addr_tvb_strnlen                       p_tvb_strnlen;
+
+addr_tvb_format_text                   p_tvb_format_text;
+
+addr_tvb_get_nstringz                  p_tvb_get_nstringz;
+addr_tvb_get_nstringz0                 p_tvb_get_nstringz0;
+
+addr_tvb_find_line_end                 p_tvb_find_line_end;
+addr_tvb_find_line_end_unquoted                p_tvb_find_line_end_unquoted;
+
+addr_tvb_strneql                       p_tvb_strneql;
+addr_tvb_strncaseeql                   p_tvb_strncaseeql;
+
+addr_tvb_bytes_to_str                  p_tvb_bytes_to_str;
+
+addr_prefs_register_protocol           p_prefs_register_protocol;
+addr_prefs_register_uint_preference    p_prefs_register_uint_preference;
+addr_prefs_register_bool_preference    p_prefs_register_bool_preference;
+addr_prefs_register_enum_preference    p_prefs_register_enum_preference;
+addr_prefs_register_string_preference  p_prefs_register_string_preference;
+
+addr_register_giop_user                        p_register_giop_user;
+addr_is_big_endian                     p_is_big_endian;
+addr_get_CDR_encap_info                        p_get_CDR_encap_info;
+addr_get_CDR_any                       p_get_CDR_any;
+addr_get_CDR_boolean                   p_get_CDR_boolean;
+addr_get_CDR_char                      p_get_CDR_char;
+addr_get_CDR_double                    p_get_CDR_double;
+addr_get_CDR_enum                      p_get_CDR_enum;
+addr_get_CDR_fixed                     p_get_CDR_fixed;
+addr_get_CDR_float                     p_get_CDR_float;
+addr_get_CDR_interface                 p_get_CDR_interface;
+addr_get_CDR_long                      p_get_CDR_long;
+addr_get_CDR_object                    p_get_CDR_object;
+addr_get_CDR_octet                     p_get_CDR_octet;
+addr_get_CDR_octet_seq                 p_get_CDR_octet_seq;
+addr_get_CDR_short                     p_get_CDR_short;
+addr_get_CDR_string                    p_get_CDR_string;
+addr_get_CDR_typeCode                  p_get_CDR_typeCode;
+addr_get_CDR_ulong                     p_get_CDR_ulong;
+addr_get_CDR_ushort                    p_get_CDR_ushort;
+addr_get_CDR_wchar                     p_get_CDR_wchar;
+addr_get_CDR_wstring                   p_get_CDR_wstring;
+
+addr_is_tpkt                           p_is_tpkt;
+addr_dissect_tpkt_encap                        p_dissect_tpkt_encap;
+
+addr_set_actual_length                 p_set_actual_length;
+addr_tcp_dissect_pdus                  p_tcp_dissect_pdus;
+addr_decode_boolean_bitfield           p_decode_boolean_bitfield;
+addr_decode_numeric_bitfield           p_decode_numeric_bitfield;
+addr_decode_enumerated_bitfield                p_decode_enumerated_bitfield;
index 93fe80f598b3529f87343c4e9b0aa570cac6c970..24153f6c11918f96d2c0a50cd2d286f0b3601d4e 100644 (file)
@@ -1,7 +1,7 @@
 /* plugin_api_defs.h
  * Define the variables that hold pointers to plugin API functions
  *
- * $Id: plugin_api_defs.h,v 1.13 2002/02/22 08:56:48 guy Exp $
+ * $Id: plugin_api_defs.h,v 1.14 2002/05/05 00:16:36 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
 
 #ifdef PLUGINS_NEED_ADDRESS_TABLE
 
-addr_check_col                         p_check_col;
-addr_col_clear                         p_col_clear;
-addr_col_add_fstr                      p_col_add_fstr;
-addr_col_append_fstr                   p_col_append_fstr;
-addr_col_prepend_fstr                  p_col_prepend_fstr;
-addr_col_add_str                       p_col_add_str;
-addr_col_append_str                    p_col_append_str;
-addr_col_set_str                       p_col_set_str;
-
-addr_register_init_routine             p_register_init_routine;
-addr_register_postseq_cleanup_routine  p_register_postseq_cleanup_routine;
-
-addr_match_strval                      p_match_strval;
-addr_val_to_str                                p_val_to_str;
-
-addr_conversation_new                  p_conversation_new;
-addr_find_conversation                 p_find_conversation;
-addr_conversation_set_dissector                p_conversation_set_dissector;
-
-addr_proto_register_protocol           p_proto_register_protocol;
-addr_proto_register_field_array                p_proto_register_field_array;
-addr_proto_register_subtree_array      p_proto_register_subtree_array;
-
-addr_dissector_add                     p_dissector_add;
-addr_dissector_delete                  p_dissector_delete;
-addr_dissector_add_handle              p_dissector_add_handle;
-
-addr_heur_dissector_add                        p_heur_dissector_add;
-
-addr_register_dissector                        p_register_dissector;
-addr_find_dissector                    p_find_dissector;
-addr_create_dissector_handle           p_create_dissector_handle;
-addr_call_dissector                    p_call_dissector;
-
-addr_proto_is_protocol_enabled         p_proto_is_protocol_enabled;
-
-addr_proto_item_get_len                        p_proto_item_get_len;
-addr_proto_item_set_len                        p_proto_item_set_len;
-addr_proto_item_set_text               p_proto_item_set_text;
-addr_proto_item_append_text            p_proto_item_append_text;
-addr_proto_item_add_subtree            p_proto_item_add_subtree;
-addr_proto_tree_add_item               p_proto_tree_add_item;
-addr_proto_tree_add_item_hidden                p_proto_tree_add_item_hidden;
-addr_proto_tree_add_protocol_format    p_proto_tree_add_protocol_format;
-
-addr_proto_tree_add_bytes              p_proto_tree_add_bytes;
-addr_proto_tree_add_bytes_hidden       p_proto_tree_add_bytes_hidden;
-addr_proto_tree_add_bytes_format       p_proto_tree_add_bytes_format;
-
-addr_proto_tree_add_time               p_proto_tree_add_time;
-addr_proto_tree_add_time_hidden                p_proto_tree_add_time_hidden;
-addr_proto_tree_add_time_format                p_proto_tree_add_time_format;
-
-addr_proto_tree_add_ipxnet             p_proto_tree_add_ipxnet;
-addr_proto_tree_add_ipxnet_hidden      p_proto_tree_add_ipxnet_hidden;
-addr_proto_tree_add_ipxnet_format      p_proto_tree_add_ipxnet_format;
-
-addr_proto_tree_add_ipv4               p_proto_tree_add_ipv4;
-addr_proto_tree_add_ipv4_hidden                p_proto_tree_add_ipv4_hidden;
-addr_proto_tree_add_ipv4_format                p_proto_tree_add_ipv4_format;
-
-addr_proto_tree_add_ipv6               p_proto_tree_add_ipv6;
-addr_proto_tree_add_ipv6_hidden                p_proto_tree_add_ipv6_hidden;
-addr_proto_tree_add_ipv6_format                p_proto_tree_add_ipv6_format;
-
-addr_proto_tree_add_ether              p_proto_tree_add_ether;
-addr_proto_tree_add_ether_hidden       p_proto_tree_add_ether_hidden;
-addr_proto_tree_add_ether_format       p_proto_tree_add_ether_format;
-
-addr_proto_tree_add_string             p_proto_tree_add_string;
-addr_proto_tree_add_string_hidden      p_proto_tree_add_string_hidden;
-addr_proto_tree_add_string_format      p_proto_tree_add_string_format;
-
-addr_proto_tree_add_boolean            p_proto_tree_add_boolean;
-addr_proto_tree_add_boolean_hidden     p_proto_tree_add_boolean_hidden;
-addr_proto_tree_add_boolean_format     p_proto_tree_add_boolean_format;
-
-addr_proto_tree_add_double             p_proto_tree_add_double;
-addr_proto_tree_add_double_hidden      p_proto_tree_add_double_hidden;
-addr_proto_tree_add_double_format      p_proto_tree_add_double_format;
-
-addr_proto_tree_add_uint               p_proto_tree_add_uint;
-addr_proto_tree_add_uint_hidden                p_proto_tree_add_uint_hidden;
-addr_proto_tree_add_uint_format                p_proto_tree_add_uint_format;
-
-addr_proto_tree_add_int                        p_proto_tree_add_int;
-addr_proto_tree_add_int_hidden         p_proto_tree_add_int_hidden;
-addr_proto_tree_add_int_format         p_proto_tree_add_int_format;
-
-addr_proto_tree_add_text               p_proto_tree_add_text;
-
-addr_tvb_new_subset                    p_tvb_new_subset;
-
-addr_tvb_set_free_cb                   p_tvb_set_free_cb;
-addr_tvb_set_child_real_data_tvbuff    p_tvb_set_child_real_data_tvbuff;
-addr_tvb_new_real_data                 p_tvb_new_real_data;
-
-addr_tvb_length                                p_tvb_length;
-addr_tvb_length_remaining              p_tvb_length_remaining;
-addr_tvb_bytes_exist                   p_tvb_bytes_exist;
-addr_tvb_offset_exists                 p_tvb_offset_exists;
-addr_tvb_reported_length               p_tvb_reported_length;
-addr_tvb_reported_length_remaining     p_tvb_reported_length_remaining;
-
-addr_tvb_get_guint8                    p_tvb_get_guint8;
-
-addr_tvb_get_ntohs                     p_tvb_get_ntohs;
-addr_tvb_get_ntoh24                    p_tvb_get_ntoh24;
-addr_tvb_get_ntohl                     p_tvb_get_ntohl;
-
-addr_tvb_get_letohs                    p_tvb_get_letohs;
-addr_tvb_get_letoh24                   p_tvb_get_letoh24;
-addr_tvb_get_letohl                    p_tvb_get_letohl;
-
-addr_tvb_memcpy                                p_tvb_memcpy;
-addr_tvb_memdup                                p_tvb_memdup;
-
-addr_tvb_get_ptr                       p_tvb_get_ptr;
-
-addr_tvb_find_guint8                   p_tvb_find_guint8;
-addr_tvb_pbrk_guint8                   p_tvb_pbrk_guint8;
-
-addr_tvb_strnlen                       p_tvb_strnlen;
-
-addr_tvb_format_text                   p_tvb_format_text;
-
-addr_tvb_get_nstringz                  p_tvb_get_nstringz;
-addr_tvb_get_nstringz0                 p_tvb_get_nstringz0;
-
-addr_tvb_find_line_end                 p_tvb_find_line_end;
-addr_tvb_find_line_end_unquoted                p_tvb_find_line_end_unquoted;
-
-addr_tvb_strneql                       p_tvb_strneql;
-addr_tvb_strncaseeql                   p_tvb_strncaseeql;
-
-addr_tvb_bytes_to_str                  p_tvb_bytes_to_str;
-
-addr_prefs_register_protocol           p_prefs_register_protocol;
-addr_prefs_register_uint_preference    p_prefs_register_uint_preference;
-addr_prefs_register_bool_preference    p_prefs_register_bool_preference;
-addr_prefs_register_enum_preference    p_prefs_register_enum_preference;
-addr_prefs_register_string_preference  p_prefs_register_string_preference;
-
-addr_register_giop_user                        p_register_giop_user;
-addr_is_big_endian                     p_is_big_endian;
-addr_get_CDR_encap_info                        p_get_CDR_encap_info;
-addr_get_CDR_any                       p_get_CDR_any;
-addr_get_CDR_boolean                   p_get_CDR_boolean;
-addr_get_CDR_char                      p_get_CDR_char;
-addr_get_CDR_double                    p_get_CDR_double;
-addr_get_CDR_enum                      p_get_CDR_enum;
-addr_get_CDR_fixed                     p_get_CDR_fixed;
-addr_get_CDR_float                     p_get_CDR_float;
-addr_get_CDR_interface                 p_get_CDR_interface;
-addr_get_CDR_long                      p_get_CDR_long;
-addr_get_CDR_object                    p_get_CDR_object;
-addr_get_CDR_octet                     p_get_CDR_octet;
-addr_get_CDR_octet_seq                 p_get_CDR_octet_seq;
-addr_get_CDR_short                     p_get_CDR_short;
-addr_get_CDR_string                    p_get_CDR_string;
-addr_get_CDR_typeCode                  p_get_CDR_typeCode;
-addr_get_CDR_ulong                     p_get_CDR_ulong;
-addr_get_CDR_ushort                    p_get_CDR_ushort;
-addr_get_CDR_wchar                     p_get_CDR_wchar;
-addr_get_CDR_wstring                   p_get_CDR_wstring;
-
-addr_is_tpkt                           p_is_tpkt;
-addr_dissect_tpkt_encap                        p_dissect_tpkt_encap;
+#include "plugin_api_decls.h"
 
 #endif /* PLUGINS_NEED_ADDRESS_TABLE */
 
index 89cd06a865c9bf3b6a0c882f905f79a87f93d9c2..4b401a4b4088f727be7dd56e2b88f825754d6edf 100644 (file)
@@ -1,7 +1,7 @@
 /* plugin_table.h
  * Table of exported addresses for Ethereal plugins.
  *
- * $Id: plugin_table.h,v 1.44 2002/04/04 05:16:15 guy Exp $
+ * $Id: plugin_table.h,v 1.45 2002/05/05 00:16:36 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * Copyright 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
@@ -223,173 +223,23 @@ typedef int (*addr_is_tpkt)(tvbuff_t *);
 typedef void (*addr_dissect_tpkt_encap)(tvbuff_t *, packet_info *,
     proto_tree *, gboolean, dissector_handle_t);
 
+typedef void (*addr_set_actual_length)(tvbuff_t *, guint);
+
+typedef void (*addr_tcp_dissect_pdus)(tvbuff_t *, packet_info *, proto_tree *,
+    gboolean, int, guint (*)(tvbuff_t *, int),
+    void (*)(tvbuff_t *, packet_info *, proto_tree *));
+
+typedef const char *(*addr_decode_boolean_bitfield)(guint32, guint32, int,
+    const char *, const char *);
+typedef const char *(*addr_decode_numeric_bitfield)(guint32, guint32, int,
+    const char *);
+typedef const char *(*addr_decode_enumerated_bitfield)(guint32, guint32, int,
+    const value_string *, const char *);
+
 typedef struct  {
 
-       addr_check_col                          p_check_col;
-       addr_col_clear                          p_col_clear;
-       addr_col_add_fstr                       p_col_add_fstr;
-       addr_col_append_fstr                    p_col_append_fstr;
-       addr_col_prepend_fstr                   p_col_prepend_fstr;
-       addr_col_add_str                        p_col_add_str;
-       addr_col_append_str                     p_col_append_str;
-       addr_col_set_str                        p_col_set_str;
-
-       addr_register_init_routine              p_register_init_routine;
-       addr_register_postseq_cleanup_routine   p_register_postseq_cleanup_routine;
-
-       addr_match_strval                       p_match_strval;
-       addr_val_to_str                         p_val_to_str;
-
-       addr_conversation_new                   p_conversation_new;
-       addr_find_conversation                  p_find_conversation;
-       addr_conversation_set_dissector         p_conversation_set_dissector;
-
-       addr_proto_register_protocol            p_proto_register_protocol;
-       addr_proto_register_field_array         p_proto_register_field_array;
-       addr_proto_register_subtree_array       p_proto_register_subtree_array;
-
-       addr_dissector_add                      p_dissector_add;
-       addr_dissector_delete                   p_dissector_delete;
-       addr_dissector_add_handle               p_dissector_add_handle;
-
-       addr_heur_dissector_add                 p_heur_dissector_add;
-
-       addr_register_dissector                 p_register_dissector;
-       addr_find_dissector                     p_find_dissector;
-       addr_create_dissector_handle            p_create_dissector_handle;
-       addr_call_dissector                     p_call_dissector;
-
-       addr_proto_is_protocol_enabled          p_proto_is_protocol_enabled;
-
-       addr_proto_item_get_len                 p_proto_item_get_len;
-       addr_proto_item_set_len                 p_proto_item_set_len;
-       addr_proto_item_set_text                p_proto_item_set_text;
-       addr_proto_item_append_text             p_proto_item_append_text;
-       addr_proto_item_add_subtree             p_proto_item_add_subtree;
-       addr_proto_tree_add_item                p_proto_tree_add_item;
-       addr_proto_tree_add_item_hidden         p_proto_tree_add_item_hidden;
-       addr_proto_tree_add_protocol_format     p_proto_tree_add_protocol_format;
-       addr_proto_tree_add_bytes               p_proto_tree_add_bytes;
-       addr_proto_tree_add_bytes_hidden        p_proto_tree_add_bytes_hidden;
-       addr_proto_tree_add_bytes_format        p_proto_tree_add_bytes_format;
-       addr_proto_tree_add_time                p_proto_tree_add_time;
-       addr_proto_tree_add_time_hidden         p_proto_tree_add_time_hidden;
-       addr_proto_tree_add_time_format         p_proto_tree_add_time_format;
-       addr_proto_tree_add_ipxnet              p_proto_tree_add_ipxnet;
-       addr_proto_tree_add_ipxnet_hidden       p_proto_tree_add_ipxnet_hidden;
-       addr_proto_tree_add_ipxnet_format       p_proto_tree_add_ipxnet_format;
-       addr_proto_tree_add_ipv4                p_proto_tree_add_ipv4;
-       addr_proto_tree_add_ipv4_hidden         p_proto_tree_add_ipv4_hidden;
-       addr_proto_tree_add_ipv4_format         p_proto_tree_add_ipv4_format;
-       addr_proto_tree_add_ipv6                p_proto_tree_add_ipv6;
-       addr_proto_tree_add_ipv6_hidden         p_proto_tree_add_ipv6_hidden;
-       addr_proto_tree_add_ipv6_format         p_proto_tree_add_ipv6_format;
-       addr_proto_tree_add_ether               p_proto_tree_add_ether;
-       addr_proto_tree_add_ether_hidden        p_proto_tree_add_ether_hidden;
-       addr_proto_tree_add_ether_format        p_proto_tree_add_ether_format;
-       addr_proto_tree_add_string              p_proto_tree_add_string;
-       addr_proto_tree_add_string_hidden       p_proto_tree_add_string_hidden;
-       addr_proto_tree_add_string_format       p_proto_tree_add_string_format;
-       addr_proto_tree_add_boolean             p_proto_tree_add_boolean;
-       addr_proto_tree_add_boolean_hidden      p_proto_tree_add_boolean_hidden;
-       addr_proto_tree_add_boolean_format      p_proto_tree_add_boolean_format;
-       addr_proto_tree_add_double              p_proto_tree_add_double;
-       addr_proto_tree_add_double_hidden       p_proto_tree_add_double_hidden;
-       addr_proto_tree_add_double_format       p_proto_tree_add_double_format;
-       addr_proto_tree_add_uint                p_proto_tree_add_uint;
-       addr_proto_tree_add_uint_hidden         p_proto_tree_add_uint_hidden;
-       addr_proto_tree_add_uint_format         p_proto_tree_add_uint_format;
-       addr_proto_tree_add_int                 p_proto_tree_add_int;
-       addr_proto_tree_add_int_hidden          p_proto_tree_add_int_hidden;
-       addr_proto_tree_add_int_format          p_proto_tree_add_int_format;
-       addr_proto_tree_add_text                p_proto_tree_add_text;
-
-       addr_tvb_new_subset                     p_tvb_new_subset;
-
-       addr_tvb_set_free_cb                    p_tvb_set_free_cb;
-       addr_tvb_set_child_real_data_tvbuff     p_tvb_set_child_real_data_tvbuff;
-       addr_tvb_new_real_data                  p_tvb_new_real_data;
-
-       addr_tvb_length                         p_tvb_length;
-       addr_tvb_length_remaining               p_tvb_length_remaining;
-       addr_tvb_bytes_exist                    p_tvb_bytes_exist;
-       addr_tvb_offset_exists                  p_tvb_offset_exists;
-       addr_tvb_reported_length                p_tvb_reported_length;
-       addr_tvb_reported_length_remaining      p_tvb_reported_length_remaining;
-
-       addr_tvb_get_guint8                     p_tvb_get_guint8;
-
-       addr_tvb_get_ntohs                      p_tvb_get_ntohs;
-       addr_tvb_get_ntoh24                     p_tvb_get_ntoh24;
-       addr_tvb_get_ntohl                      p_tvb_get_ntohl;
-
-       addr_tvb_get_letohs                     p_tvb_get_letohs;
-       addr_tvb_get_letoh24                    p_tvb_get_letoh24;
-       addr_tvb_get_letohl                     p_tvb_get_letohl;
-
-       addr_tvb_memcpy                         p_tvb_memcpy;
-       addr_tvb_memdup                         p_tvb_memdup;
-
-       addr_tvb_get_ptr                        p_tvb_get_ptr;
-
-       addr_tvb_find_guint8                    p_tvb_find_guint8;
-       addr_tvb_pbrk_guint8                    p_tvb_pbrk_guint8;
-
-       addr_tvb_strnlen                        p_tvb_strnlen;
-
-       addr_tvb_format_text                    p_tvb_format_text;
-
-       addr_tvb_get_nstringz                   p_tvb_get_nstringz;
-       addr_tvb_get_nstringz0                  p_tvb_get_nstringz0;
-
-       addr_tvb_find_line_end                  p_tvb_find_line_end;
-       addr_tvb_find_line_end_unquoted p_tvb_find_line_end_unquoted;
-
-       addr_tvb_strneql                        p_tvb_strneql;
-       addr_tvb_strncaseeql                    p_tvb_strncaseeql;
-
-       addr_tvb_bytes_to_str                   p_tvb_bytes_to_str;
-
-       addr_prefs_register_protocol            p_prefs_register_protocol;
-       addr_prefs_register_uint_preference     p_prefs_register_uint_preference;
-       addr_prefs_register_bool_preference     p_prefs_register_bool_preference;
-       addr_prefs_register_enum_preference     p_prefs_register_enum_preference;
-       addr_prefs_register_string_preference   p_prefs_register_string_preference;
-
-        /* GIOP Begin */
-
-       addr_register_giop_user                 p_register_giop_user;
-       addr_is_big_endian                      p_is_big_endian;
-        addr_get_CDR_encap_info                 p_get_CDR_encap_info;
-
-       addr_get_CDR_any                        p_get_CDR_any;
-       addr_get_CDR_boolean                    p_get_CDR_boolean;
-       addr_get_CDR_char                       p_get_CDR_char;
-       addr_get_CDR_double                     p_get_CDR_double;
-       addr_get_CDR_enum                       p_get_CDR_enum;
-       addr_get_CDR_fixed                      p_get_CDR_fixed;
-       addr_get_CDR_float                      p_get_CDR_float;
-       addr_get_CDR_interface                  p_get_CDR_interface;
-       addr_get_CDR_long                       p_get_CDR_long;
-       addr_get_CDR_object                     p_get_CDR_object;
-       addr_get_CDR_octet                      p_get_CDR_octet;
-       addr_get_CDR_octet_seq                  p_get_CDR_octet_seq;
-       addr_get_CDR_short                      p_get_CDR_short;
-       addr_get_CDR_string                     p_get_CDR_string;
-       addr_get_CDR_typeCode                   p_get_CDR_typeCode;
-       addr_get_CDR_ulong                      p_get_CDR_ulong;
-       addr_get_CDR_ushort                     p_get_CDR_ushort;
-       addr_get_CDR_wchar                      p_get_CDR_wchar;
-       addr_get_CDR_wstring                    p_get_CDR_wstring;
-
-        /* GIOP End */
-
-        /* TPKT Begin */
-
-       addr_is_tpkt                            p_is_tpkt;
-       addr_dissect_tpkt_encap                 p_dissect_tpkt_encap;
-
-        /* GIOP End */
+#include "plugin_api_decls.h"
+
 } plugin_address_table_t;
 
 #else /* ! PLUGINS_NEED_ADDRESS_TABLE */