Additional routines made available to plugins, from Tomas Kukosa.

svn path=/trunk/; revision=4150
This commit is contained in:
Guy Harris 2001-11-04 03:37:29 +00:00
parent 8789943142
commit d859325753
7 changed files with 65 additions and 15 deletions

View File

@ -862,6 +862,10 @@ Andrew C. Feren <aferen[AT]cetacean.com> {
Makefile fix
}
Tomas Kukosa <tomas.kukosa[AT]anfdata.cz> {
Additional routines made available to plugins
}
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to
give his permission to use his version of snprintf.c.

View File

@ -1210,6 +1210,7 @@ B<http://www.ethereal.com>.
Pavel Novotny <Pavel.Novotny[AT]icn.siemens.de>
Shinsuke Suzuki <suz[AT]kame.net>
Andrew C. Feren <aferen[AT]cetacean.com>
Tomas Kukosa <tomas.kukosa[AT]anfdata.cz>
Alain Magloire <alainm[AT]rcsm.ece.mcgill.ca> was kind enough to give his
permission to use his version of snprintf.c.

View File

@ -1,7 +1,7 @@
/* plugins.c
* plugin routines
*
* $Id: plugins.c,v 1.38 2001/10/29 21:56:48 guy Exp $
* $Id: plugins.c,v 1.39 2001/11/04 03:37:28 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -283,6 +283,8 @@ init_plugins(const char *plugin_dir)
{
#ifdef PLUGINS_NEED_ADDRESS_TABLE
/* Intialize address table */
patable.p_pi = &pi;
patable.p_check_col = check_col;
patable.p_col_clear = col_clear;
patable.p_col_add_fstr = col_add_fstr;
@ -291,7 +293,12 @@ init_plugins(const char *plugin_dir)
patable.p_col_append_str = col_append_str;
patable.p_col_set_str = col_set_str;
patable.p_pi = &pi;
patable.p_register_init_routine = register_init_routine;
patable.p_conv_dissector_add = conv_dissector_add;
patable.p_conversation_new = conversation_new;
patable.p_find_conversation = find_conversation;
patable.p_match_strval = match_strval;
patable.p_val_to_str = val_to_str;
patable.p_proto_register_protocol = proto_register_protocol;
patable.p_proto_register_field_array = proto_register_field_array;

View File

@ -1,7 +1,7 @@
/* plugin_api.c
* Routines for Ethereal plugins.
*
* $Id: plugin_api.c,v 1.25 2001/10/29 21:56:50 guy Exp $
* $Id: plugin_api.c,v 1.26 2001/11/04 03:37:29 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
@ -44,6 +44,12 @@ plugin_address_table_init(plugin_address_table_t *pat)
p_col_add_str = pat->p_col_add_str;
p_col_append_str = pat->p_col_append_str;
p_col_set_str = pat->p_col_set_str;
p_register_init_routine = pat->p_register_init_routine;
p_conv_dissector_add = pat->p_conv_dissector_add;
p_conversation_new = pat->p_conversation_new;
p_find_conversation = pat->p_find_conversation;
p_match_strval = pat->p_match_strval;
p_val_to_str = pat->p_val_to_str;
p_proto_register_protocol = pat->p_proto_register_protocol;
p_proto_register_field_array = pat->p_proto_register_field_array;
p_proto_register_subtree_array = pat->p_proto_register_subtree_array;

View File

@ -1,7 +1,7 @@
/* plugin_api.h
* Routines for Ethereal plugins.
*
* $Id: plugin_api.h,v 1.25 2001/10/29 21:56:50 guy Exp $
* $Id: plugin_api.h,v 1.26 2001/11/04 03:37:29 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
@ -25,13 +25,17 @@
/* Some OSes (Win32) have DLLs that cannot reference symbols in the parent
executable, so the executable needs to provide a collection of pointers
to those functions for the DLL plugin to use. */
to global variables and functions for the DLL plugin to use. */
/* #defines for those functions that are called through pointers,
and global variables that are referred to through pointers.
#defined in this fashion so that the declaration of the functions
and variables, from the system header files, turn into declarations
of pointers to functions and variables, and the references to them in
plugins, in the plugins, turn into references through the pointers. */
#define pi (*p_pi)
/* #defines for those functions that call through pointers.
#defined in this fashion so that the declaration of the functions,
from the system header files, turn into declarations of pointers
to functions, and the calls to it in plugins, in the plugins, turn
into calls through the pointers. */
#define check_col (*p_check_col)
#define col_clear (*p_col_clear)
#define col_add_fstr (*p_col_add_fstr)
@ -40,6 +44,13 @@
#define col_append_str (*p_col_append_str)
#define col_set_str (*p_col_set_str)
#define register_init_routine (*p_register_init_routine)
#define conv_dissector_add (*p_conv_dissector_add)
#define conversation_new (*p_conversation_new)
#define find_conversation (*p_find_conversation)
#define match_strval (*p_match_strval)
#define val_to_str (*p_val_to_str)
#define proto_register_protocol (*p_proto_register_protocol)
#define proto_register_field_array (*p_proto_register_field_array)
#define proto_register_subtree_array (*p_proto_register_subtree_array)
@ -177,8 +188,6 @@
/* GIOP entries End */
#define pi (*p_pi)
#endif
#include "packet.h"

View 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.3 2001/11/04 03:16:47 guy Exp $
* $Id: plugin_api_defs.h,v 1.4 2001/11/04 03:37:29 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
@ -31,6 +31,13 @@ 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_conv_dissector_add p_conv_dissector_add;
addr_conversation_new p_conversation_new;
addr_find_conversation p_find_conversation;
addr_match_strval p_match_strval;
addr_val_to_str p_val_to_str;
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;

View File

@ -1,7 +1,7 @@
/* plugin_table.h
* Table of exported addresses for Ethereal plugins.
*
* $Id: plugin_table.h,v 1.29 2001/11/04 03:16:47 guy Exp $
* $Id: plugin_table.h,v 1.30 2001/11/04 03:37:29 guy Exp $
*
* Ethereal - Network traffic analyzer
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
@ -36,6 +36,15 @@ typedef void (*addr_col_add_str)(frame_data*, gint, const gchar*);
typedef void (*addr_col_append_str)(frame_data*, gint, gchar*);
typedef void (*addr_col_set_str)(frame_data*, gint, gchar*);
typedef void (*addr_register_init_routine)(void (*func)(void));
typedef void (*addr_conv_dissector_add)(const char *, dissector_t, int);
typedef conversation_t *(*addr_conversation_new)(address *, address *,
port_type, guint32, guint32, guint);
typedef conversation_t *(*addr_find_conversation)(address *, address *,
port_type, guint32, guint32, guint);
typedef gchar* (*addr_match_strval)(guint32, const value_string*);
typedef gchar* (*addr_val_to_str)(guint32, const value_string *, const char *);
typedef int (*addr_proto_register_protocol)(char*, char*, char*);
typedef void (*addr_proto_register_field_array)(int, hf_register_info*, int);
typedef void (*addr_proto_register_subtree_array)(int**, int);
@ -196,6 +205,8 @@ typedef guint32 (*addr_get_CDR_wstring)(tvbuff_t *, gchar **, int *, gboolean,
int, MessageHeader *);
typedef struct {
packet_info *p_pi;
addr_check_col p_check_col;
addr_col_clear p_col_clear;
addr_col_add_fstr p_col_add_fstr;
@ -204,7 +215,12 @@ typedef struct {
addr_col_append_str p_col_append_str;
addr_col_set_str p_col_set_str;
packet_info *p_pi;
addr_register_init_routine p_register_init_routine;
addr_conv_dissector_add p_conv_dissector_add;
addr_conversation_new p_conversation_new;
addr_find_conversation p_find_conversation;
addr_match_strval p_match_strval;
addr_val_to_str p_val_to_str;
addr_proto_register_protocol p_proto_register_protocol;
addr_proto_register_field_array p_proto_register_field_array;