diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-05-05 00:16:38 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-05-05 00:16:38 +0000 |
commit | eb70c97a9bd9f362a3e2f888dd082c5b9b4b9516 (patch) | |
tree | e3b201865b9c3108cf90f7953b3c85c4dad0066e /epan | |
parent | 82e11eb8eef35974a5c07658009561390720bfad (diff) | |
download | wireshark-eb70c97a9bd9f362a3e2f888dd082c5b9b4b9516.tar.gz wireshark-eb70c97a9bd9f362a3e2f888dd082c5b9b4b9516.tar.bz2 wireshark-eb70c97a9bd9f362a3e2f888dd082c5b9b4b9516.zip |
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
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
Diffstat (limited to 'epan')
-rw-r--r-- | epan/plugins.c | 9 | ||||
-rw-r--r-- | epan/to_str.h | 39 |
2 files changed, 28 insertions, 20 deletions
diff --git a/epan/plugins.c b/epan/plugins.c index f1fd26201b..84dbd62b40 100644 --- a/epan/plugins.c +++ b/epan/plugins.c @@ -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 diff --git a/epan/to_str.h b/epan/to_str.h index 18a412f90e..a954700205 100644 --- a/epan/to_str.h +++ b/epan/to_str.h @@ -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__ */ |