2000-02-07 17:08:27 +00:00
|
|
|
/* plugin_api.c
|
2000-02-07 17:23:53 +00:00
|
|
|
* Routines for Ethereal plugins.
|
|
|
|
*
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
* $Id: plugin_api.c,v 1.7 2000/05/05 09:32:34 guy Exp $
|
2000-02-07 17:23:53 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
|
|
|
* Copyright 2000 by Gilbert Ramirez <gram@xiexie.org>
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2000-02-07 17:08:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "plugin_api.h"
|
|
|
|
|
2000-02-09 19:32:28 +00:00
|
|
|
packet_info *p_pi = NULL;
|
2000-02-07 17:08:27 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
plugin_address_table_init(plugin_address_table_t *pat)
|
|
|
|
{
|
2000-03-15 19:09:52 +00:00
|
|
|
p_pi = pat->p_pi;
|
|
|
|
p_check_col = pat->p_check_col;
|
|
|
|
p_col_add_fstr = pat->p_col_add_fstr;
|
|
|
|
p_col_append_fstr = pat->p_col_append_fstr;
|
|
|
|
p_col_add_str = pat->p_col_add_str;
|
|
|
|
p_col_append_str = pat->p_col_append_str;
|
|
|
|
p_dfilter_init = pat->p_dfilter_init;
|
|
|
|
p_dfilter_cleanup = pat->p_dfilter_cleanup;
|
|
|
|
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;
|
2000-04-04 21:46:29 +00:00
|
|
|
p_dissector_add = pat->p_dissector_add;
|
Add routines to:
register lists of "heuristic" dissectors, which are handed a
frame that may or may contain a payload for the protocol they
dissect, and that return FALSE if it's not or dissect the packet
and return TRUE if it is;
add a dissector to such a list;
go through such a list, calling each dissector until either a
dissector returns TRUE, in which case the routine returns TRUE,
or it runs out of entries in the list, in which case the routine
returns FALSE.
Have lists of heuristic dissectors for TCP and for COTP when used with
the Inactive Subset of CLNP, and add the GIOP and Yahoo Messenger
dissectors to the first list and the Sinec H1 dissector to the second
list.
Make the dissector name argument to "dissector_add()" and
"dissector_delete()" a "const char *" rarther than just a "char *".
Add "heur_dissector_add()", the routine to add a heuristic dissector to
a list of heuristic dissectors, to the set of routines we can export to
plugins through a table on platforms where dynamically-loaded code can't
call stuff in the main program, and initialize the element in the table
in question for "dissector_add()" (which we'd forgotten to do).
svn path=/trunk/; revision=1909
2000-05-05 09:32:36 +00:00
|
|
|
p_heur_dissector_add = pat->p_heur_dissector_add;
|
2000-03-15 19:09:52 +00:00
|
|
|
p_proto_item_add_subtree = pat->p_proto_item_add_subtree;
|
|
|
|
p_proto_tree_add_item = pat->p_proto_tree_add_item;
|
|
|
|
p_proto_tree_add_item_hidden = pat->p_proto_tree_add_item_hidden;
|
|
|
|
p_proto_tree_add_protocol_format = pat->p_proto_tree_add_protocol_format;
|
|
|
|
p_proto_tree_add_bytes_format = pat->p_proto_tree_add_bytes_format;
|
|
|
|
p_proto_tree_add_time_format = pat->p_proto_tree_add_time_format;
|
|
|
|
p_proto_tree_add_ipxnet_format = pat->p_proto_tree_add_ipxnet_format;
|
|
|
|
p_proto_tree_add_ipv4_format = pat->p_proto_tree_add_ipv4_format;
|
|
|
|
p_proto_tree_add_ipv6_format = pat->p_proto_tree_add_ipv6_format;
|
|
|
|
p_proto_tree_add_ether_format = pat->p_proto_tree_add_ether_format;
|
|
|
|
p_proto_tree_add_string_format = pat->p_proto_tree_add_string_format;
|
|
|
|
p_proto_tree_add_boolean_format = pat->p_proto_tree_add_boolean_format;
|
|
|
|
p_proto_tree_add_uint_format = pat->p_proto_tree_add_uint_format;
|
|
|
|
p_proto_tree_add_text = pat->p_proto_tree_add_text;
|
|
|
|
p_proto_tree_add_notext = pat->p_proto_tree_add_notext;
|
2000-02-07 17:08:27 +00:00
|
|
|
}
|