Add "pinfo_stats_tree.h" to declare "register_pinfo_stat_trees()", and
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 24 Jul 2005 10:32:22 +0000 (10:32 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 24 Jul 2005 10:32:22 +0000 (10:32 +0000)
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
plugins/stats_tree/pinfo_stats_tree.c
plugins/stats_tree/pinfo_stats_tree.h [new file with mode: 0644]
plugins/stats_tree/stats_tree_plugin.c

index e4bbf76f626517f348f59f4569c3671f08993bc7..f1b46882f2ace547425a69ab8cb320792f44dc7b 100644 (file)
@@ -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@
 
index 757c0c827fb74d397a135195140efb5105fba5ea..62cfbdda75141dccf7db0dc6057e41a237e6167a 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <epan/stats_tree.h>
 
+#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 (file)
index 0000000..33d81f0
--- /dev/null
@@ -0,0 +1,27 @@
+/* pinfo_stats_tree.h
+* Stats tree for ethernet frames
+*
+*  (c) 2005, Luis E. G. Ontanon <luis.ontanon@gmail.com>
+*
+* $Id$
+*
+* Ethereal - Network traffic analyzer
+* By Gerald Combs <gerald@ethereal.com>
+* 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);
index df3b743ca2800e4561f4331b2784f84181c1cc81..b3b8b36ce126870724684919090c89847ed68989 100644 (file)
@@ -32,7 +32,7 @@
 
 #include <epan/stats_tree.h>
 
-extern void register_http_stat_trees(void);
+#include "pinfo_stats_tree.h"
 
 G_MODULE_EXPORT const gchar version[] = "0.0";