From 82b4eaba91c81c010ca18ec77d8686cdd7d0f0c6 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 24 Jul 2005 10:32:22 +0000 Subject: [PATCH] Add "pinfo_stats_tree.h" to declare "register_pinfo_stat_trees()", and include it in "pinfo_stats_tree.c" (which defines it) and "stats_tree_plugin.c" (which refers to it). Make all the other routines defined in "pinfo_stats_tree.c" static, as they're not used outside "pinfo_stats_tree.c". Get rid of declaration of unused "register_http_stat_trees()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15035 f5534014-38df-0310-8fa8-9805f1628bb7 --- plugins/stats_tree/Makefile.am | 2 +- plugins/stats_tree/pinfo_stats_tree.c | 18 +++++++++-------- plugins/stats_tree/pinfo_stats_tree.h | 27 ++++++++++++++++++++++++++ plugins/stats_tree/stats_tree_plugin.c | 2 +- 4 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 plugins/stats_tree/pinfo_stats_tree.h diff --git a/plugins/stats_tree/Makefile.am b/plugins/stats_tree/Makefile.am index e4bbf76f62..f1b46882f2 100644 --- a/plugins/stats_tree/Makefile.am +++ b/plugins/stats_tree/Makefile.am @@ -27,7 +27,7 @@ INCLUDES = -I$(top_srcdir) plugindir = @plugindir@ plugin_LTLIBRARIES = stats_tree.la -stats_tree_la_SOURCES = stats_tree_plugin.c pinfo_stats_tree.c +stats_tree_la_SOURCES = stats_tree_plugin.c pinfo_stats_tree.c pinfo_stats_tree.h stats_tree_la_LDFLAGS = -module -avoid-version stats_tree_la_LIBADD = @PLUGIN_LIBS@ diff --git a/plugins/stats_tree/pinfo_stats_tree.c b/plugins/stats_tree/pinfo_stats_tree.c index 757c0c827f..62cfbdda75 100644 --- a/plugins/stats_tree/pinfo_stats_tree.c +++ b/plugins/stats_tree/pinfo_stats_tree.c @@ -30,6 +30,8 @@ #include +#include "pinfo_stats_tree.h" + /* XXX: this belongs to to_str.c */ static const gchar* port_type_to_str (port_type type) { switch (type) { @@ -51,11 +53,11 @@ static const gchar* port_type_to_str (port_type type) { static int st_node_ip = -1; static gchar* st_str_ip = "IP address"; -extern void ip_hosts_stats_tree_init(stats_tree* st) { +static void ip_hosts_stats_tree_init(stats_tree* st) { st_node_ip = stats_tree_create_node(st, st_str_ip, 0, TRUE); } -extern int ip_hosts_stats_tree_packet(stats_tree *st , packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static int ip_hosts_stats_tree_packet(stats_tree *st , packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { static guint8 str[128]; tick_stat_node(st, st_str_ip, 0, FALSE); @@ -73,11 +75,11 @@ extern int ip_hosts_stats_tree_packet(stats_tree *st , packet_info *pinfo, epan static int st_node_ptype = -1; static gchar* st_str_ptype = "Port Type"; -extern void ptype_stats_tree_init(stats_tree* st) { +static void ptype_stats_tree_init(stats_tree* st) { st_node_ptype = stats_tree_create_pivot(st, st_str_ptype, 0); } -extern int ptype_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static int ptype_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) { const gchar* ptype; ptype = port_type_to_str(pinfo->ptype); @@ -91,11 +93,11 @@ extern int ptype_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_diss static int st_node_plen = -1; static gchar* st_str_plen = "Packet Lenght"; -extern void plen_stats_tree_init(stats_tree* st) { +static void plen_stats_tree_init(stats_tree* st) { st_node_plen = stats_tree_create_range_node(st, st_str_plen, 0, "0-19","20-39","40-79","80-159","160-319","320-639","640-1279","1280-",NULL); } -extern int plen_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static int plen_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) { tick_stat_node(st, st_str_plen, 0, FALSE); stats_tree_tick_range(st, st_str_plen, 0, pinfo->fd->pkt_len); @@ -111,11 +113,11 @@ extern int plen_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_disse static int st_node_dsts = -1; static gchar* st_str_dsts = "Destinations"; -extern void dsts_stats_tree_init(stats_tree* st) { +static void dsts_stats_tree_init(stats_tree* st) { st_node_dsts = stats_tree_create_node(st, st_str_dsts, 0, TRUE); } -extern int dsts_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static int dsts_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) { static guint8 str[128]; int ip_dst_node; int proto_node; diff --git a/plugins/stats_tree/pinfo_stats_tree.h b/plugins/stats_tree/pinfo_stats_tree.h new file mode 100644 index 0000000000..33d81f03ec --- /dev/null +++ b/plugins/stats_tree/pinfo_stats_tree.h @@ -0,0 +1,27 @@ +/* pinfo_stats_tree.h +* Stats tree for ethernet frames +* +* (c) 2005, Luis E. G. Ontanon +* +* $Id$ +* +* Ethereal - Network traffic analyzer +* By Gerald Combs +* Copyright 1998 Gerald Combs +* +* 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. +*/ + +extern void register_pinfo_stat_trees(void); diff --git a/plugins/stats_tree/stats_tree_plugin.c b/plugins/stats_tree/stats_tree_plugin.c index df3b743ca2..b3b8b36ce1 100644 --- a/plugins/stats_tree/stats_tree_plugin.c +++ b/plugins/stats_tree/stats_tree_plugin.c @@ -32,7 +32,7 @@ #include -extern void register_http_stat_trees(void); +#include "pinfo_stats_tree.h" G_MODULE_EXPORT const gchar version[] = "0.0"; -- 2.34.1