From 0111e461938d47efd1eb8dc17f135b93b253ab52 Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Sun, 5 Oct 2014 21:34:19 -0400 Subject: plugins: Add editor modelines; Adjust whitespace as needed. Change-Id: I36124f6021d46a228721bdc976f6b9fef1c8c088 Reviewed-on: https://code.wireshark.org/review/4488 Reviewed-by: Bill Meier --- plugins/stats_tree/pinfo_stats_tree.c | 101 +++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 44 deletions(-) (limited to 'plugins/stats_tree') diff --git a/plugins/stats_tree/pinfo_stats_tree.c b/plugins/stats_tree/pinfo_stats_tree.c index f52be1d91a..40bf5962f4 100644 --- a/plugins/stats_tree/pinfo_stats_tree.c +++ b/plugins/stats_tree/pinfo_stats_tree.c @@ -1,26 +1,26 @@ /* pinfo_stats_tree.c -* Stats tree for ethernet frames -* -* (c) 2005, Luis E. G. Ontanon -* -* Wireshark - 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ + * Stats tree for ethernet frames + * + * (c) 2005, Luis E. G. Ontanon + * + * Wireshark - 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #include "config.h" @@ -37,7 +37,7 @@ *------------------------------------- */ typedef struct { - range_t *packet_range; + range_t *packet_range; } uat_plen_record_t; static range_t default_range[10] = { @@ -53,10 +53,10 @@ static range_t default_range[10] = { {1, {{5120, 0xFFFFFFFF}}} }; static uat_plen_record_t *uat_plen_records = NULL; -static uat_t * plen_uat = NULL; +static uat_t *plen_uat = NULL; static guint num_plen_uat = 0; -static void* uat_plen_record_copy_cb(void* n, const void* o, size_t siz _U_) { +static void *uat_plen_record_copy_cb(void *n, const void *o, size_t siz _U_) { const uat_plen_record_t *r = (const uat_plen_record_t *)o; uat_plen_record_t *rn = (uat_plen_record_t *)n; @@ -79,7 +79,7 @@ uat_plen_record_update_cb(void *r, const char **err) } static void uat_plen_record_free_cb(void*r) { - uat_plen_record_t* record = (uat_plen_record_t*)r; + uat_plen_record_t *record = (uat_plen_record_t*)r; if (record->packet_range) g_free(record->packet_range); @@ -106,9 +106,9 @@ UAT_RANGE_CB_DEF(uat_plen_records, packet_range, uat_plen_record_t) /* ip host stats_tree -- basic test */ static int st_node_ip = -1; -static const gchar* st_str_ip = "IP Statistics/IP Addresses"; +static const gchar *st_str_ip = "IP Statistics/IP Addresses"; -static 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); } @@ -123,11 +123,11 @@ static int ip_hosts_stats_tree_packet(stats_tree *st , packet_info *pinfo, epan /* ip host stats_tree -- separate source and dest, test stats_tree flags */ static int st_node_ip_src = -1; static int st_node_ip_dst = -1; -static const gchar* st_str_ip_srcdst = "IP Statistics/Source and Dest IP Addresses"; -static const gchar* st_str_ip_src = "Source IP Addresses"; -static const gchar* st_str_ip_dst = "Destination IP Addresses"; +static const gchar *st_str_ip_srcdst = "IP Statistics/Source and Dest IP Addresses"; +static const gchar *st_str_ip_src = "Source IP Addresses"; +static const gchar *st_str_ip_dst = "Destination IP Addresses"; -static void ip_srcdst_stats_tree_init(stats_tree* st) { +static void ip_srcdst_stats_tree_init(stats_tree *st) { /* create one tree branch for source */ st_node_ip_src = stats_tree_create_node(st, st_str_ip_src, 0, TRUE); /* set flag so this branch will always be sorted to top of tree */ @@ -151,14 +151,14 @@ static int ip_srcdst_stats_tree_packet(stats_tree *st , packet_info *pinfo, epa /* packet type stats_tree -- test pivot node */ static int st_node_ptype = -1; -static const gchar* st_str_ptype = "IP Statistics/IP Protocol Types"; +static const gchar *st_str_ptype = "IP Statistics/IP Protocol Types"; -static 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); } -static int ptype_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t *edt _U_, const void *p _U_) { - const gchar* ptype; +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); @@ -169,9 +169,9 @@ static int ptype_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_diss /* packet length stats_tree -- test range node */ static int st_node_plen = -1; -static const gchar* st_str_plen = "Packet Lengths"; +static const gchar *st_str_plen = "Packet Lengths"; -static void plen_stats_tree_init(stats_tree* st) { +static void plen_stats_tree_init(stats_tree *st) { guint i; char **str_range_array = (char **)ep_alloc(num_plen_uat*sizeof(char*)); @@ -183,7 +183,7 @@ static void plen_stats_tree_init(stats_tree* st) { st_node_plen = stats_tree_create_range_node_string(st, st_str_plen, 0, num_plen_uat, str_range_array); } -static 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); /* also add value for averages calculation. we call the notick version of */ /* avg_stat_node_add_value and call tick_stat_node separately. this allows */ @@ -202,13 +202,13 @@ static int plen_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_disse */ static int st_node_dsts = -1; -static const gchar* st_str_dsts = "IP Statistics/IP Destinations"; +static const gchar *st_str_dsts = "IP Statistics/IP Destinations"; -static 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); } -static 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 gchar str[128]; int ip_dst_node; int protocol_node; @@ -234,8 +234,8 @@ void register_pinfo_stat_trees(void) { UAT_END_FIELDS }; - stats_tree_register_plugin("ip","ip_hosts",st_str_ip, 0, ip_hosts_stats_tree_packet, ip_hosts_stats_tree_init, NULL ); - stats_tree_register_plugin("ip","ip_srcdst",st_str_ip_srcdst, 0, ip_srcdst_stats_tree_packet, ip_srcdst_stats_tree_init, NULL ); + stats_tree_register_plugin("ip","ip_hosts",st_str_ip, 0, ip_hosts_stats_tree_packet, ip_hosts_stats_tree_init, NULL ); + stats_tree_register_plugin("ip","ip_srcdst",st_str_ip_srcdst, 0, ip_srcdst_stats_tree_packet, ip_srcdst_stats_tree_init, NULL ); stats_tree_register_plugin("ip","ptype",st_str_ptype, 0, ptype_stats_tree_packet, ptype_stats_tree_init, NULL ); stats_tree_register_with_group("frame","plen",st_str_plen, 0, plen_stats_tree_packet, plen_stats_tree_init, NULL, REGISTER_STAT_GROUP_GENERIC ); stats_tree_register_plugin("ip","dests",st_str_dsts, 0, dsts_stats_tree_packet, dsts_stats_tree_init, NULL ); @@ -259,3 +259,16 @@ void register_pinfo_stat_trees(void) { prefs_register_uat_preference(stat_module, "packet_lengths", "Packet Lengths", "Delineated packet sizes to count", plen_uat); } + +/* + * Editor modelines - http://www.wireshark.org/tools/modelines.html + * + * Local variables: + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + * + * vi: set shiftwidth=8 tabstop=8 noexpandtab: + * :indentSize=8:tabSize=8:noTabs=false: + */ -- cgit v1.2.3