Remove some unnecessary includes: a lot of things don't need globals.h and register.h

svn path=/trunk/; revision=34017
This commit is contained in:
Jeff Morriss 2010-08-30 16:10:01 +00:00
parent 05f5bf510b
commit b4c2ed1b86
107 changed files with 563 additions and 703 deletions

View File

@ -40,7 +40,6 @@
#include <epan/geoip_db.h>
#endif
#include "../globals.h"
#include "../log.h"
#include "../version_info.h"

View File

@ -41,11 +41,9 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-afp.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"

View File

@ -47,8 +47,6 @@
#include "../stat_menu.h"
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/dlg_utils.h"

View File

@ -46,8 +46,6 @@
#include "../stat_menu.h"
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/dlg_utils.h"

View File

@ -35,8 +35,6 @@
#include <epan/tap.h>
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"
@ -218,7 +216,7 @@ dhcpstat_init(const char *optarg, void *userdata _U_)
}
/* transient_for top_level */
sp->win= dlg_window_new(title);
sp->win= dlg_window_new(title);
gtk_window_set_destroy_with_parent (GTK_WINDOW(sp->win), TRUE);
g_free(title);

View File

@ -42,9 +42,7 @@
#include <epan/asn1.h>
#include <epan/camel-persistentdata.h>
#include "../globals.h"
#include "../stat_menu.h"
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
@ -111,7 +109,7 @@ static void gtk_camelcounter_draw(void *phs)
char str[256];
GtkListStore *store;
GtkTreeIter iter;
/* Now print Message and Reason Counter Table */
/* clear list before printing */
store = GTK_LIST_STORE(gtk_tree_view_get_model(p_counter->table));
@ -171,7 +169,7 @@ static void gtk_camelcounter_init(const char *optarg, void *userdata _U_)
gtk_camelcounter_reset(p_camelcounter);
/* transient_for top_level */
p_camelcounter->win=dlg_window_new("Wireshark: CAMEL counters");
p_camelcounter->win=dlg_window_new("Wireshark: CAMEL counters");
gtk_window_set_destroy_with_parent (GTK_WINDOW(p_camelcounter->win), TRUE);
gtk_window_set_default_size(GTK_WINDOW(p_camelcounter->win), 500, 300);

View File

@ -42,11 +42,9 @@
#include <epan/asn1.h>
#include <epan/camel-persistentdata.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/main.h"
@ -65,8 +63,8 @@ struct camelsrt_t {
static void camelsrt_set_title(struct camelsrt_t * p_camelsrt);
static void camelsrt_reset(void *phs);
static int camelsrt_packet(void *phs,
packet_info *pinfo _U_,
static int camelsrt_packet(void *phs,
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *phi);
@ -91,16 +89,16 @@ static void camelsrt_reset(void *phs)
{
struct camelsrt_t *hs=(struct camelsrt_t *)phs;
reset_srt_table_data(&hs->camel_srt_table);
camelsrt_set_title(hs);
camelsrt_set_title(hs);
}
/*
* Count the delta time between Request and Response
* As we can make several measurement per message, we use a boolean array for the category
* Then, if the measurement is provided, check if it is valid, and update the table
* Then, if the measurement is provided, check if it is valid, and update the table
*/
static int camelsrt_packet(void *phs,
packet_info *pinfo _U_,
static int camelsrt_packet(void *phs,
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *phi)
{
@ -110,12 +108,12 @@ static int camelsrt_packet(void *phs,
for (i=1; i<NB_CAMELSRT_CATEGORY; i++) {
if ( pi->bool_msginfo[i] &&
pi->msginfo[i].is_delta_time
pi->msginfo[i].is_delta_time
&& pi->msginfo[i].request_available
&& !pi->msginfo[i].is_duplicate ) {
add_srt_table_data(&hs->camel_srt_table, i, &pi->msginfo[i].req_time, pinfo);
}
} /* category */
return 1;
@ -134,11 +132,11 @@ static void camelsrt_draw(void *phs)
static void win_destroy_cb(GtkWindow *win _U_, gpointer data)
{
struct camelsrt_t *hs=(struct camelsrt_t *)data;
protect_thread_critical_region();
remove_tap_listener(hs);
unprotect_thread_critical_region();
free_srt_table_data(&hs->camel_srt_table);
g_free(hs);
}
@ -146,7 +144,7 @@ static void win_destroy_cb(GtkWindow *win _U_, gpointer data)
static void gtk_camelsrt_init(const char *optarg, void *userdata _U_)
{
struct camelsrt_t * p_camelsrt;
const char *filter=NULL;
const char *filter=NULL;
GtkWidget *cmd_label;
GtkWidget *main_label;
@ -163,8 +161,8 @@ static void gtk_camelsrt_init(const char *optarg, void *userdata _U_)
} else {
filter=NULL;
}
p_camelsrt=g_malloc(sizeof(struct camelsrt_t));
p_camelsrt=g_malloc(sizeof(struct camelsrt_t));
p_camelsrt->win= dlg_window_new("camel-srt"); /* transient_for top_level */
gtk_window_set_destroy_with_parent (GTK_WINDOW(p_camelsrt->win), TRUE);
@ -175,7 +173,7 @@ static void gtk_camelsrt_init(const char *optarg, void *userdata _U_)
vbox=gtk_vbox_new(FALSE, 3);
gtk_container_add(GTK_CONTAINER(p_camelsrt->win), vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
main_label=gtk_label_new("CAMEL Service Response Time statistics");
gtk_box_pack_start(GTK_BOX(vbox), main_label, FALSE, FALSE, 0);
gtk_widget_show(main_label);
@ -193,35 +191,35 @@ static void gtk_camelsrt_init(const char *optarg, void *userdata _U_)
/* We must display TOP LEVEL Widget before calling init_srt_table() */
gtk_widget_show_all(p_camelsrt->win);
init_srt_table(&p_camelsrt->camel_srt_table, NB_CAMELSRT_CATEGORY, vbox, NULL);
init_srt_table(&p_camelsrt->camel_srt_table, NB_CAMELSRT_CATEGORY, vbox, NULL);
for(i=0 ;i<NB_CAMELSRT_CATEGORY; i++) {
init_srt_table_row(&p_camelsrt->camel_srt_table, i,
val_to_str(i,camelSRTtype_naming,"Unknown"));
}
error_string=register_tap_listener("CAMEL",
error_string=register_tap_listener("CAMEL",
p_camelsrt,
filter,
0,
camelsrt_reset,
camelsrt_packet,
camelsrt_packet,
camelsrt_draw);
if(error_string){
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", error_string->str);
g_string_free(error_string, TRUE);
g_free(p_camelsrt);
return;
}
/* Button row. */
bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL);
gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
close_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CLOSE);
window_set_cancel_button(p_camelsrt->win, close_bt, window_cancel_button_cb);
g_signal_connect(p_camelsrt->win, "delete_event", G_CALLBACK(window_delete_event_cb), NULL);
g_signal_connect(p_camelsrt->win, "destroy", G_CALLBACK(win_destroy_cb), p_camelsrt);

View File

@ -44,7 +44,6 @@
#include <epan/filesystem.h>
#include "../capture.h"
#include "../globals.h"
#include "../capture_errs.h"
#include "../capture_ifinfo.h"
#include "../simple_dialog.h"

View File

@ -37,7 +37,6 @@
#include <epan/value_string.h>
#include <epan/addr_resolv.h>
#include "../globals.h"
#include "../file.h"
#include "../capture.h"
#include "../simple_dialog.h"
@ -66,8 +65,8 @@
#include "../capture_wpcap_packet.h"
/* packet32.h requires sockaddr_storage
* whether sockaddr_storage is defined or not depends on the Platform SDK
/* packet32.h requires sockaddr_storage
* whether sockaddr_storage is defined or not depends on the Platform SDK
* version installed. The only one not defining it is the SDK that comes
* with MSVC 6.0 (WINVER 0x0400).
*
@ -2344,7 +2343,7 @@ capture_if_details_open_win(char *iface)
*/
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"%sCould not open adapter %s!%s"
"\n\nHas it been unplugged?",
"\n\nHas it been unplugged?",
simple_dialog_primary_start(), iface, simple_dialog_primary_end());
return;
}
@ -2516,13 +2515,13 @@ capture_if_has_details(char *iface) {
if (!iface) {
return FALSE;
}
adapter = wpcap_packet_open(iface);
if (adapter) {
wpcap_packet_close(adapter);
return TRUE;
}
return FALSE;
}

View File

@ -39,7 +39,6 @@
#include <epan/prefs.h>
#include "../globals.h"
#include "../capture_errs.h"
#include "../capture_ifinfo.h"
#include "../simple_dialog.h"

View File

@ -41,7 +41,6 @@
#include "../capture.h"
#include "../capture_info.h"
#include "../globals.h"
#include "../capture_ui_utils.h"
#include "../capture-pcap-util.h"

View File

@ -1,24 +1,24 @@
/* compare_stat.c
/* compare_stat.c
* Compare two capture files
* Copyright 2008 Vincenzo Condoleo, Christophe Dirac, Reto Ruoss
* supported by HSR (Hochschule Rapperswil)
* supported by HSR (Hochschule Rapperswil)
*
* $Id$
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* 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 0F111-1307, USA.
@ -57,7 +57,6 @@
#include <epan/in_cksum.h>
#include "../stat_menu.h"
#include "../globals.h"
#include "../simple_dialog.h"
#include "../timestats.h"

View File

@ -40,7 +40,6 @@
#include <epan/dissectors/packet-eth.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -41,7 +41,6 @@
#include <epan/dissectors/packet-fc.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-fddi.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-ip.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-ipv6.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-ipx.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -40,7 +40,6 @@
#include <epan/dissectors/packet-jxta.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-ncp-int.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-rsvp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-sctp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-tcp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-tr.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-udp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -38,7 +38,6 @@
#include <epan/tap.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-ieee80211.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/conversations_table.h"

View File

@ -46,8 +46,6 @@
#include "../stat_menu.h"
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/dlg_utils.h"
@ -578,7 +576,7 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
XXX: A simpler alternative might be to just do away with all the two-level
complexity and just use a standard ws_combo_box... even though the
list of "program names" is quite large.
XXX: The gtkrc file distributed with Windows Wireshark has the
XXX: The gtkrc file distributed with Windows Wireshark has the
"appears-as-list" GtkComboBox style property set to 1 and thus
on Windows the entries for this combo box will appear as a tree-view.
The default is 0(FALSE). In this case the the combo box entries will
@ -595,8 +593,8 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
*/
GtkStyle *s;
s = gtk_widget_get_style(prog_combo_box);
g_object_set(cell_renderer,
"foreground-gdk", &(s->fg[GTK_STATE_NORMAL]),
g_object_set(cell_renderer,
"foreground-gdk", &(s->fg[GTK_STATE_NORMAL]),
"foreground-set", TRUE,
NULL);
}

View File

@ -32,7 +32,6 @@
#include <epan/epan_dissect.h>
#include <epan/dissectors/packet-ber.h>
#include "../globals.h"
#include "../simple_dialog.h"
#include "gtk/decode_as_dlg.h"
@ -50,7 +49,7 @@
/*
* This routine is called when the user clicks the "OK" button in the
* "Decode As..." dialog window and the ASN.1 page is foremost.
* This routine takes care of making any changes requested to the ASN.1
* This routine takes care of making any changes requested to the ASN.1
* decoding.
*
* @param notebook_pg A pointer to the "ASN.1" notebook page.
@ -93,7 +92,7 @@ decode_ber(GtkWidget *notebook_pg)
/* add an interface to the list */
static void
static void
decode_ber_add_to_list(gpointer key, gpointer value, gpointer user_data)
{
decode_add_to_list("ASN.1", key, value, user_data);
@ -126,7 +125,7 @@ decode_ber_add_page (packet_info *pinfo _U_)
g_object_set_data(G_OBJECT(page_hb), E_PAGE_ACTION, decode_ber);
g_object_set_data(G_OBJECT(page_hb), E_PAGE_TABLE, "ASN.1");
g_object_set_data(G_OBJECT(page_hb), E_PAGE_TITLE, "ASN.1");
info_vb = gtk_vbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(page_hb), info_vb, TRUE, TRUE, 0);

View File

@ -32,7 +32,6 @@
#include <epan/epan_dissect.h>
#include <epan/dissectors/packet-dcerpc.h>
#include "../globals.h"
#include "../simple_dialog.h"
#include "gtk/decode_as_dlg.h"
@ -53,7 +52,7 @@ GSList *decode_dcerpc_bindings = NULL;
/**************************************************/
/* inject one of our bindings into the dcerpc binding table */
static void
static void
decode_dcerpc_inject_binding(gpointer data, gpointer user_data _U_)
{
dcerpc_add_conv_to_bind_table((decode_dcerpc_bind_values_t *) data);
@ -61,14 +60,14 @@ decode_dcerpc_inject_binding(gpointer data, gpointer user_data _U_)
/* inject all of our bindings into the dcerpc binding table */
static void
static void
decode_dcerpc_inject_bindings(gpointer data _U_) {
g_slist_foreach(decode_dcerpc_bindings, decode_dcerpc_inject_binding, NULL /* user_data */);
}
/* init this file */
void
void
decode_dcerpc_init(void) {
GHook* hook_init_proto;
@ -97,7 +96,7 @@ decode_dcerpc_binding_clone(decode_dcerpc_bind_values_t *binding_in)
/* free a binding */
void
void
decode_dcerpc_binding_free(void *binding_in)
{
decode_dcerpc_bind_values_t *binding = binding_in;
@ -119,7 +118,7 @@ decode_dcerpc_binding_cmp(gconstpointer a, gconstpointer b)
/* don't compare uuid and ver! */
if(
if(
ADDRESSES_EQUAL(&binding_a->addr_a, &binding_b->addr_a) &&
ADDRESSES_EQUAL(&binding_a->addr_b, &binding_b->addr_b) &&
binding_a->ptype == binding_b->ptype &&
@ -148,16 +147,16 @@ decode_dcerpc_add_show_list_single(gpointer data, gpointer user_data)
{
gchar string1[20];
decode_dcerpc_bind_values_t *binding = data;
g_snprintf(string1, sizeof(string1), "ctx_id: %u", binding->ctx_id);
decode_add_to_show_list (
user_data,
"DCE-RPC",
string1,
"-",
user_data,
"DCE-RPC",
string1,
"-",
binding->ifname->str);
}
@ -186,7 +185,7 @@ decode_dcerpc_reset_all(void)
decode_dcerpc_binding_free(binding);
decode_dcerpc_bindings = g_slist_remove(
decode_dcerpc_bindings,
decode_dcerpc_bindings,
decode_dcerpc_bindings->data);
}
}
@ -195,7 +194,7 @@ decode_dcerpc_reset_all(void)
/* remove a binding (looking the same way as the given one) */
static void
decode_dcerpc_binding_reset(
const gchar *table_name _U_,
const gchar *table_name _U_,
decode_dcerpc_bind_values_t *binding)
{
GSList *le;
@ -223,7 +222,7 @@ decode_dcerpc_bind_values_t *binding)
/* a binding has changed (remove a previously existing one) */
static void
decode_dcerpc_binding_change(
const gchar *table_name,
const gchar *table_name,
decode_dcerpc_bind_values_t *binding)
{
@ -279,7 +278,7 @@ decode_change_one_dcerpc_binding(const gchar *table_name, decode_dcerpc_bind_val
/*
* This routine is called when the user clicks the "OK" button in the
* "Decode As..." dialog window and the DCE-RPC page is foremost.
* This routine takes care of making any changes requested to the DCE-RPC
* This routine takes care of making any changes requested to the DCE-RPC
* binding tables.
*
* @param notebook_pg A pointer to the "DCE-RPC" notebook page.
@ -310,7 +309,7 @@ decode_dcerpc(GtkWidget *notebook_pg)
/* add an interface to the list */
static void
static void
decode_dcerpc_add_to_list(gpointer key, gpointer value, gpointer user_data)
{
/*dcerpc_uuid_key *k = key;*/
@ -364,7 +363,7 @@ decode_dcerpc_add_page (packet_info *pinfo)
g_object_set_data(G_OBJECT(page_hb), E_PAGE_TABLE, "DCE-RPC");
g_object_set_data(G_OBJECT(page_hb), E_PAGE_TITLE, "DCE-RPC");
g_object_set_data(G_OBJECT(page_hb), E_PAGE_BINDING, binding);
info_vb = gtk_vbox_new(FALSE, 5);
gtk_box_pack_start(GTK_BOX(page_hb), info_vb, TRUE, TRUE, 0);

View File

@ -33,7 +33,6 @@
#include <epan/packet.h>
#include <epan/epan_dissect.h>
#include "../globals.h"
#include "../simple_dialog.h"
#include "gtk/main.h"

View File

@ -47,7 +47,6 @@
#include <gtk/gtk.h>
#include "../globals.h"
#include "../simple_dialog.h"
#include "gtk/main.h"
@ -489,7 +488,7 @@ display_value_fields(header_field_info *hfinfo, gboolean is_comparison,
/*
* There is no list of names for values; only show the value_label if needed.
*/
if (is_comparison)
if (is_comparison)
show_value_label = TRUE;
break;
}

View File

@ -42,11 +42,9 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-diameter.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"
@ -94,7 +92,7 @@ diameterstat_packet(void *pdiameter, packet_info *pinfo, epan_dissect_t *edt _U_
int* idx = NULL;
/* Process only answers where corresponding request is found.
* Unpaired daimeter messages are currently not supported by statistics.
* Unpaired daimeter messages are currently not supported by statistics.
* Return 0, since redraw is not needed. */
if(!diameter || diameter->processing_request || !diameter->req_frame)
return 0;

View File

@ -36,7 +36,6 @@
#include <epan/prefs.h>
#include "../globals.h"
#include "../util.h"
#include "../file.h"
#include "../simple_dialog.h"
@ -261,7 +260,7 @@ dnd_open_file_cmd(gchar *cf_names_freeme)
default:
/* build and show the info dialog */
dialog_text = g_string_sized_new(200);
g_string_printf(dialog_text,
g_string_printf(dialog_text,
"%sMerging the following files:%s\n\n",
simple_dialog_primary_start(), simple_dialog_primary_end());
for(files_work = 0; files_work < in_files; files_work++) {
@ -270,7 +269,7 @@ dnd_open_file_cmd(gchar *cf_names_freeme)
}
g_string_append(dialog_text, "\nThe packets in these files will be merged chronologically into a new temporary file.");
simple_dialog(ESD_TYPE_CONFIRMATION,
ESD_BTN_OK, "%s",
ESD_BTN_OK, "%s",
dialog_text->str);
g_string_free(dialog_text, TRUE);

View File

@ -37,9 +37,7 @@
#include <epan/tap.h>
#include <epan/stat_cmd_args.h>
#include "../register.h"
#include "../simple_dialog.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"

View File

@ -9,17 +9,17 @@
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* 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.
@ -42,7 +42,6 @@
#include <epan/expert.h>
#include "../simple_dialog.h"
#include "../globals.h"
#include "../color.h"
#include "gtk/expert_comp_table.h"
@ -72,7 +71,7 @@ proto_data_func (GtkTreeViewColumn *column _U_,
GtkTreeModel *model,
GtkTreeIter *iter,
gpointer user_data)
{
{
gchar *str = NULL;
gchar *grp = NULL; /* type pointer, don't free */
@ -114,10 +113,10 @@ proto_sort_func(GtkTreeModel *model,
if (str_a == str_b) {
ret = 0;
}
}
else if (str_a == NULL || str_b == NULL) {
ret = (str_a == NULL) ? -1 : 1;
}
}
else {
if (grp == packet) {
gint int_a = atoi(str_a);
@ -126,7 +125,7 @@ proto_sort_func(GtkTreeModel *model,
ret = 0;
else if (int_a < int_b)
ret = -1;
else
else
ret = 1;
}
else
@ -141,7 +140,7 @@ static gint find_summary_data(error_equiv_table *err, const expert_info_t *exper
{
guint i;
error_procedure_t *procedure;
/* First time thru values will be 0 */
if (err->num_procs==0) {
return -1;
@ -179,12 +178,12 @@ error_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint call
return;
}
gtk_tree_model_get (model, &iter,
gtk_tree_model_get (model, &iter,
GROUP_COLUMN, &grp,
PROTOCOL_COLUMN, &expert_data.protocol,
SUMMARY_COLUMN, &expert_data.summary,
-1);
if (strcmp(grp, packet)==0) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You cannot filter or search for packet number. Click on a valid item header.");
g_free(expert_data.summary);
@ -213,7 +212,7 @@ error_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint call
char *msg;
if (0 /*procedure->fvalue_value==NULL*/) {
if (action != ACTION_FIND_FRAME && action != ACTION_FIND_NEXT && action != ACTION_FIND_PREVIOUS) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Wireshark cannot create a filter on this item - %s, try using find instead.",
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Wireshark cannot create a filter on this item - %s, try using find instead.",
procedure->entries[1]);
return;
}
@ -298,7 +297,7 @@ error_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint call
* a find with the expert string or we will not really be performing a find next.
* In an effort to allow the user to modify the string and/or continue searching, we
* will just present the user with the find window again with the default expert string.
* A better aproach would be to attempt in capturing the last find string and utilize this
* A better aproach would be to attempt in capturing the last find string and utilize this
* with a find next/previous. Also a better approach might be to just send a <Ctl-N> keystroke.
*/
/* Fall trough */
@ -308,14 +307,14 @@ error_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint call
* a find with the expert string or we will not really be performing a find previous.
* In an effort to allow the user to modify the string and/or continue searching, we
* will just present the user with the find window again with the default expert string.
* A better aproach would be to attempt in capturing the last find string and utilize this
* A better aproach would be to attempt in capturing the last find string and utilize this
* with a find next/previous. Also a better approach might be to just send a <Ctl-B> keystroke.
*/
if (procedure->fvalue_value==NULL) {
find_frame_with_filter(str);
}
else
{
{
/* We have an expert item so just continue search without find dialog. */
cf_find_packet_dfilter_string(&cfile, str, SD_FORWARD);
}
@ -350,7 +349,7 @@ error_show_popup_menu_cb(void *widg _U_, GdkEvent *event, gpointer user_data)
GdkEventButton *bevent = (GdkEventButton *)event;
if(event->type==GDK_BUTTON_PRESS && bevent->button==3){
gtk_menu_popup(GTK_MENU(err->menu), NULL, NULL, NULL, NULL,
gtk_menu_popup(GTK_MENU(err->menu), NULL, NULL, NULL, NULL,
bevent->button, bevent->time);
}
@ -611,7 +610,7 @@ static const char *ui_desc_expert_filter_popup =
"</ui>\n";
/*
/*
* GtkActionEntry
* typedef struct {
* const gchar *name;
@ -621,15 +620,15 @@ static const char *ui_desc_expert_filter_popup =
* const gchar *tooltip;
* GCallback callback;
* } GtkActionEntry;
* const gchar *name; The name of the action.
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
* const gchar *label; The label for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* If label is NULL, the label of the stock item with id stock_id is used.
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* GCallback callback; The function to call when the action is activated.
* const gchar *name; The name of the action.
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
* const gchar *label; The label for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* If label is NULL, the label of the stock item with id stock_id is used.
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* GCallback callback; The function to call when the action is activated.
*
*/
static const GtkActionEntry expert_popup_entries[] = {
@ -676,7 +675,7 @@ expert_goto_pkt_cb (GtkTreeSelection *selection, gpointer data _U_)
if (gtk_tree_selection_get_selected (selection, &model, &iter))
{
gtk_tree_model_get (model, &iter,
gtk_tree_model_get (model, &iter,
PROTOCOL_COLUMN, &pkt,
GROUP_COLUMN, &grp,
-1);
@ -712,7 +711,7 @@ error_create_popup_menu(error_equiv_table *err)
gtk_tree_selection_set_mode (err->select, GTK_SELECTION_SINGLE);
g_signal_connect (G_OBJECT (err->select), "changed", G_CALLBACK(expert_goto_pkt_cb), NULL);
action_group = gtk_action_group_new ("ExpertFilterPopupActionGroup");
action_group = gtk_action_group_new ("ExpertFilterPopupActionGroup");
gtk_action_group_add_actions (action_group, /* the action group */
expert_popup_entries, /* an array of action descriptions */
G_N_ELEMENTS(expert_popup_entries), /* the number of entries */
@ -720,14 +719,14 @@ error_create_popup_menu(error_equiv_table *err)
ui_manager = gtk_ui_manager_new ();
gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_expert_filter_popup, -1, &error);
if (error != NULL)
{
fprintf (stderr, "Warning: building expert filter popup failed: %s\n",
error->message);
g_error_free (error);
error = NULL;
}
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_expert_filter_popup, -1, &error);
if (error != NULL)
{
fprintf (stderr, "Warning: building expert filter popup failed: %s\n",
error->message);
g_error_free (error);
error = NULL;
}
err->menu = gtk_ui_manager_get_widget(ui_manager, "/ExpertFilterPopup");
g_signal_connect(err->tree_view, "button_press_event", G_CALLBACK(error_show_popup_menu_cb), err);
#endif
@ -773,7 +772,7 @@ init_error_table(error_equiv_table *err, guint num_procs, GtkWidget *vbox)
column = gtk_tree_view_column_new_with_attributes ("Group", renderer, NULL);
gtk_tree_view_column_set_sort_column_id(column, GROUP_COLUMN);
gtk_tree_view_column_set_resizable(column, TRUE);
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
GINT_TO_POINTER(GROUP_COLUMN), NULL);
gtk_tree_sortable_set_sort_func(sortable, GROUP_COLUMN, str_ptr_sort_func,
@ -783,13 +782,13 @@ init_error_table(error_equiv_table *err, guint num_procs, GtkWidget *vbox)
gtk_tree_view_column_set_min_width(column, 80);
/* Add the column to the view. */
gtk_tree_view_append_column (GTK_TREE_VIEW (err->tree_view), column);
/* Second column.. Protocol. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Protocol", renderer, "text", PROTOCOL_COLUMN, NULL);
gtk_tree_view_column_set_sort_column_id(column, PROTOCOL_COLUMN);
gtk_tree_view_column_set_resizable(column, TRUE);
gtk_tree_view_column_set_cell_data_func(column, renderer, proto_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, proto_data_func,
GINT_TO_POINTER(PROTOCOL_COLUMN), NULL);
gtk_tree_sortable_set_sort_func(sortable, PROTOCOL_COLUMN, proto_sort_func,
@ -799,7 +798,7 @@ init_error_table(error_equiv_table *err, guint num_procs, GtkWidget *vbox)
gtk_tree_view_column_set_min_width(column, 40);
gtk_tree_view_column_set_fixed_width(column, 100);
gtk_tree_view_append_column (GTK_TREE_VIEW (err->tree_view), column);
/* Third column.. Summary. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Summary", renderer, "text", SUMMARY_COLUMN, NULL);
@ -809,7 +808,7 @@ init_error_table(error_equiv_table *err, guint num_procs, GtkWidget *vbox)
gtk_tree_view_column_set_min_width(column, 80);
gtk_tree_view_column_set_fixed_width(column, 230);
gtk_tree_view_append_column (GTK_TREE_VIEW (err->tree_view), column);
/* Last column.. Count. */
renderer = gtk_cell_renderer_text_new ();
/* right align */
@ -820,7 +819,7 @@ init_error_table(error_equiv_table *err, guint num_procs, GtkWidget *vbox)
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_min_width(column, 80);
gtk_tree_view_append_column (GTK_TREE_VIEW (err->tree_view), column);
err->scrolled_window=scrolled_window_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(err->scrolled_window), GTK_WIDGET (err->tree_view));
@ -829,7 +828,7 @@ init_error_table(error_equiv_table *err, guint num_procs, GtkWidget *vbox)
gtk_tree_view_set_search_column (err->tree_view, SUMMARY_COLUMN); /* Allow searching the summary */
gtk_tree_view_set_reorderable (err->tree_view, TRUE); /* Allow user to reorder data with drag n drop */
/* Now enable the sorting of each column */
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(err->tree_view), TRUE);
gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(err->tree_view), TRUE);
@ -867,7 +866,7 @@ init_error_table_row(error_equiv_table *err, const expert_info_t *expert_data)
g_array_append_val(err->procs_array, new_procedure);
procedure = &g_array_index(err->procs_array, error_procedure_t, row);
/* Create the item in our memory table */
procedure->entries[0]=(char *)g_string_chunk_insert_const(err->text, expert_data->protocol); /* Protocol */
procedure->entries[1]=(char *)g_string_chunk_insert_const(err->text, expert_data->summary); /* Summary */
@ -875,17 +874,17 @@ init_error_table_row(error_equiv_table *err, const expert_info_t *expert_data)
/* Create a new item in our tree view */
store = GTK_TREE_STORE(gtk_tree_view_get_model(err->tree_view)); /* Get store */
gtk_tree_store_append (store, &procedure->iter, NULL); /* Acquire an iterator */
/* match_strval return a static constant or null */
/* match_strval return a static constant or null */
gtk_tree_store_set (store, &procedure->iter,
GROUP_COLUMN, match_strval(expert_data->group, expert_group_vals),
GROUP_COLUMN, match_strval(expert_data->group, expert_group_vals),
PROTOCOL_COLUMN, procedure->entries[0],
SUMMARY_COLUMN, procedure->entries[1], -1);
/* If an expert item was passed then build the filter string */
if (expert_data->pitem) {
char *filter;
g_assert(PITEM_FINFO(expert_data->pitem));
filter = proto_construct_match_selected_string(PITEM_FINFO(expert_data->pitem), NULL);
if (filter != NULL)
@ -901,8 +900,8 @@ init_error_table_row(error_equiv_table *err, const expert_info_t *expert_data)
/* Update the tree with new count for this event */
store = GTK_TREE_STORE(gtk_tree_view_get_model(err->tree_view));
gtk_tree_store_set(store, &procedure->iter,
COUNT_COLUMN, procedure->count,
gtk_tree_store_set(store, &procedure->iter,
COUNT_COLUMN, procedure->count,
-1);
g_snprintf(num, sizeof(num), "%d", expert_data->packet_num);
@ -916,13 +915,13 @@ if GTK_CHECK_VERSION(2,10,0)
#else
/* FIXME gtk is plagued with slow algorithms
/* FIXME gtk is plagued with slow algorithms
gtk_tree_store_append call new_path and its nice recursive linear search....
*/
if (procedure->count > 1000) {
/* If there's more than 1000 sub rows give up and prepend new rows, at least
/* If there's more than 1000 sub rows give up and prepend new rows, at least
it will end in a reasonable time. Anyway with so many rows it's not
very useful and if sorted the right order is restored.
very useful and if sorted the right order is restored.
*/
gtk_tree_store_prepend(store, &new_iter, &procedure->iter);
}

View File

@ -43,7 +43,6 @@
#include <epan/prefs.h>
#include "../simple_dialog.h"
#include "../globals.h"
#include "../color.h"
#include "../stat_menu.h"
@ -220,8 +219,8 @@ expert_dlg_draw(void *data)
}
list_store = GTK_LIST_STORE(gtk_tree_view_get_model(etd->tree_view)); /* Get store */
/* Creates a new row at position. iter will be changed to point to this new row.
/* Creates a new row at position. iter will be changed to point to this new row.
* If position is larger than the number of rows on the list, then the new row will be appended to the list.
* The row will be filled with the values given to this function.
* :
@ -242,7 +241,7 @@ expert_dlg_draw(void *data)
BACKGROUND_COLOR_COL, color_str,
-1);
}
if(etd->label) {
title = g_strdup_printf("Errors: %u Warnings: %u Notes: %u Chats: %u",
etd->error_events, etd->warn_events,
@ -271,7 +270,7 @@ select_row_cb(GtkTreeSelection *selection, gpointer *user_data _U_)
if (selection==NULL)
return;
if (gtk_tree_selection_get_selected (selection, &model, &iter)){
gtk_tree_model_get (model, &iter, NO_COLUMN, &fnumber, -1);
cf_goto_frame(&cfile, fnumber);
@ -348,7 +347,7 @@ expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox)
"background", BACKGROUND_COLOR_COL,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
GINT_TO_POINTER(SEVERITY_COLUMN), NULL);
gtk_tree_sortable_set_sort_func(sortable, SEVERITY_COLUMN, str_ptr_sort_func,
@ -369,9 +368,9 @@ expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox)
"background", BACKGROUND_COLOR_COL,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
GINT_TO_POINTER(GROUP_COLUMN), NULL);
gtk_tree_sortable_set_sort_func(sortable, GROUP_COLUMN, str_ptr_sort_func,
GINT_TO_POINTER(GROUP_COLUMN), NULL);
@ -389,7 +388,7 @@ expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox)
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
GINT_TO_POINTER(PROTOCOL_COLUMN), NULL);
gtk_tree_sortable_set_sort_func(sortable, PROTOCOL_COLUMN, str_ptr_sort_func,
@ -400,7 +399,7 @@ expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox)
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED);
gtk_tree_view_column_set_min_width(column, 80);
gtk_tree_view_append_column (etd->tree_view, column);
/* Summary. */
renderer = gtk_cell_renderer_text_new ();
g_object_set(renderer, "ypad", 0, NULL);
@ -408,7 +407,7 @@ expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox)
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, str_ptr_data_func,
GINT_TO_POINTER(SUMMARY_COLUMN), NULL);
gtk_tree_sortable_set_sort_func(sortable, SUMMARY_COLUMN, str_ptr_sort_func,
@ -419,11 +418,11 @@ expert_dlg_init_table(expert_tapdata_t * etd, GtkWidget *vbox)
gtk_tree_view_column_set_sort_column_id(column, SUMMARY_COLUMN);
gtk_tree_view_column_set_resizable(column, TRUE);
gtk_tree_view_append_column (etd->tree_view, column);
gtk_tree_view_set_search_column (etd->tree_view, SUMMARY_COLUMN); /* Allow searching the summary */
gtk_tree_view_set_reorderable (etd->tree_view, TRUE); /* Allow user to reorder data with drag n drop */
/* Now enable the sorting of each column */
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(etd->tree_view), TRUE);
gtk_tree_view_set_headers_clickable(GTK_TREE_VIEW(etd->tree_view), TRUE);
@ -484,7 +483,7 @@ expert_tapdata_t * expert_dlg_new_table(void)
{
expert_tapdata_t * etd;
etd=g_malloc0(sizeof(expert_tapdata_t));
etd->ei_array = g_array_sized_new(FALSE, FALSE, sizeof(expert_info_t), 1000);
etd->text = g_string_chunk_new(100);
etd->severity_report_level = PI_CHAT;

View File

@ -42,11 +42,9 @@
#include <epan/dissectors/packet-scsi.h>
#include <epan/dissectors/packet-fc.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"

View File

@ -48,7 +48,6 @@
#include "wsutil/file_util.h"
#include "wsutil/unicode-utils.h"
#include "../globals.h"
#include "../alert_box.h"
#include "../color.h"
#include "../print.h"

View File

@ -36,7 +36,6 @@
#include <epan/filesystem.h>
#include "../globals.h"
#include "../simple_dialog.h"
#include "../fileset.h"
@ -168,13 +167,13 @@ fileset_dlg_add_file(fileset_entry *entry) {
/* if this file doesn't follow the file set pattern, */
/* use the creation time of that file */
local = localtime(&entry->ctime);
created = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u",
created = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u",
local->tm_year+1900, local->tm_mon+1, local->tm_mday,
local->tm_hour, local->tm_min, local->tm_sec);
}
local = localtime(&entry->mtime);
modified = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u",
modified = g_strdup_printf("%04u.%02u.%02u %02u:%02u:%02u",
local->tm_year+1900, local->tm_mon+1, local->tm_mday,
local->tm_hour, local->tm_min, local->tm_sec);
size = g_strdup_printf("%" G_GINT64_MODIFIER "d Bytes", entry->size);
@ -226,11 +225,11 @@ fileset_dlg_add_file(fileset_entry *entry) {
gtk_widget_set_size_request(fs_sw, -1, requisition.height);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(fs_sw), GTK_POLICY_NEVER, GTK_POLICY_NEVER);
}
if(row == 18) {
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(fs_sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
}
row++;
g_free(created);
@ -245,7 +244,7 @@ fileset_init_table(GtkWidget *parent)
{
GtkWidget *fs_lb;
fs_tb = gtk_table_new(6,1, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(fs_tb), 1);
gtk_table_set_col_spacings(GTK_TABLE(fs_tb), 12);
@ -372,7 +371,7 @@ fileset_file_opened(const char *fname) {
}
/* update the menu */
set_menus_for_file_set(TRUE /* file_set */,
set_menus_for_file_set(TRUE /* file_set */,
fileset_get_previous() != NULL, fileset_get_next() != NULL );
}
@ -393,7 +392,7 @@ fileset_file_closed(void)
}
/* update the menu */
set_menus_for_file_set(FALSE /* file_set */,
set_menus_for_file_set(FALSE /* file_set */,
fileset_get_previous() != NULL,
fileset_get_next() != NULL );
}

View File

@ -28,8 +28,6 @@
#include <gtk/gtk.h>
#include <string.h>
#include "../globals.h"
#include "gtk/main.h"
#include "gtk/gtkglobals.h"
#include "gtk/find_dlg.h"

View File

@ -40,8 +40,6 @@
#include <epan/dissectors/packet-tcp.h>
#include <epan/strutil.h>
#include "../register.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "../simple_dialog.h"

View File

@ -47,7 +47,6 @@
#include <epan/tap.h>
#include <../color.h>
#include <../globals.h>
#include <../alert_box.h>
#include <../simple_dialog.h>
#include <../util.h>

View File

@ -51,7 +51,6 @@
#include "../isprint.h"
#include "../color.h"
#include "../file.h"
#include "../globals.h"
#include "../alert_box.h"
#include "../simple_dialog.h"
#include "../tempfile.h"

View File

@ -37,7 +37,6 @@
#include <epan/strutil.h>
#include <epan/tap.h>
#include <../globals.h>
#include <../simple_dialog.h>
#include "gtk/follow_stream.h"
@ -53,7 +52,7 @@ udp_queue_packet_data(void *tapdata, packet_info *pinfo,
follow_record_t *follow_record;
follow_info_t *follow_info = tapdata;
const tvbuff_t *next_tvb = data;
follow_record = g_malloc(sizeof(follow_record_t));
follow_record->data = g_byte_array_sized_new(next_tvb->length);
@ -69,7 +68,7 @@ udp_queue_packet_data(void *tapdata, packet_info *pinfo,
if (ADDRESSES_EQUAL(&follow_info->client_ip, &pinfo->src) &&
follow_info->client_port == pinfo->srcport)
follow_record->is_server = FALSE;
else
else
follow_record->is_server = TRUE;
/* update stream counter */
@ -108,7 +107,7 @@ follow_udp_stream_cb(GtkWidget *w, gpointer data _U_)
"sure you have a UDP packet selected.");
return;
}
follow_info = g_new0(follow_info_t, 1);
follow_info->follow_type = FOLLOW_UDP;
@ -189,22 +188,22 @@ follow_udp_stream_cb(GtkWidget *w, gpointer data _U_)
memcpy(&ipaddr, stats.ip_address[1], 4);
hostname1 = get_hostname(ipaddr);
}
port0 = get_udp_port(stats.port[0]);
port1 = get_udp_port(stats.port[1]);
follow_info->is_ipv6 = stats.is_ipv6;
/* Both Stream Directions */
both_directions_string = g_strdup_printf("Entire conversation (%u bytes)", follow_info->bytes_written[0] + follow_info->bytes_written[1]);
if(follow_info->client_port == stats.port[0]) {
server_to_client_string =
g_strdup_printf("%s:%s " UTF8_RIGHTWARDS_ARROW " %s:%s (%u bytes)",
hostname0, port0,
hostname1, port1,
follow_info->bytes_written[0]);
client_to_server_string =
g_strdup_printf("%s:%s " UTF8_RIGHTWARDS_ARROW " %s:%s (%u bytes)",
hostname1, port1,
@ -216,7 +215,7 @@ follow_udp_stream_cb(GtkWidget *w, gpointer data _U_)
hostname1, port1,
hostname0, port0,
follow_info->bytes_written[0]);
client_to_server_string =
g_strdup_printf("%s:%s " UTF8_RIGHTWARDS_ARROW " %s:%s (%u bytes)",
hostname0, port0,
@ -285,12 +284,12 @@ follow_read_udp_stream(follow_info_t *follow_info,
if (!skip) {
buffer = g_memdup(follow_record->data->data,
follow_record->data->len);
frs_return = follow_show(follow_info, print_line_fcn_p,
buffer,
follow_record->data->len,
follow_record->is_server, arg,
global_pos,
global_pos,
&server_packet_count,
&client_packet_count);
g_free(buffer);

View File

@ -47,11 +47,9 @@
#include <epan/prefs.h>
#include <epan/funnel.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "../file.h"
#include "../progress_dlg.h"
@ -88,10 +86,10 @@ struct _funnel_node_t {
static void text_window_cancel_button_cb(GtkWidget *bt _U_, gpointer data) {
funnel_text_window_t* tw = data;
window_destroy(GTK_WIDGET(tw->win));
tw->win = NULL;
if (tw->close_cb)
tw->close_cb(tw->close_data);
}
@ -99,16 +97,16 @@ static void text_window_cancel_button_cb(GtkWidget *bt _U_, gpointer data) {
static void unref_text_win_cancel_bt_cb(GtkWidget *bt _U_, gpointer data) {
funnel_text_window_t* tw = data;
unsigned i;
window_destroy(GTK_WIDGET(tw->win));
tw->win = NULL;
if (tw->close_cb)
tw->close_cb(tw->close_data);
for (i = 0; i < tw->buttons->len; i++) {
funnel_bt_t* cbd = g_ptr_array_index(tw->buttons,i);
/* XXX a free cb should be passed somehow */
/* XXX a free cb should be passed somehow */
if (cbd->data && cbd->free_data_fcn) cbd->free_data_fcn(cbd->data);
if (cbd->free_fcn) cbd->free_fcn(cbd);
}
@ -120,35 +118,35 @@ static void unref_text_win_cancel_bt_cb(GtkWidget *bt _U_, gpointer data) {
static gboolean text_window_unref_del_event_cb(GtkWidget *win _U_, GdkEvent *event _U_, gpointer user_data) {
funnel_text_window_t* tw = user_data;
unsigned i;
window_destroy(GTK_WIDGET(tw->win));
tw->win = NULL;
if (tw->close_cb)
tw->close_cb(tw->close_data);
for (i = 0; i < tw->buttons->len; i++) {
funnel_bt_t* cbd = g_ptr_array_index(tw->buttons,i);
/* XXX a free cb should be passed somehow */
/* XXX a free cb should be passed somehow */
if (cbd->data && cbd->free_data_fcn) cbd->free_data_fcn(cbd->data);
if (cbd->free_fcn) cbd->free_fcn(cbd);
}
g_ptr_array_free(tw->buttons,TRUE);
g_ptr_array_free(tw->buttons,TRUE);
g_free(tw);
return TRUE;
}
static gboolean text_window_delete_event_cb(GtkWidget *win _U_, GdkEvent *event _U_, gpointer user_data)
{
funnel_text_window_t* tw = user_data;
window_destroy(GTK_WIDGET(tw->win));
tw->win = NULL;
if (tw->close_cb)
tw->close_cb(tw->close_data);
return TRUE;
}
@ -159,7 +157,7 @@ static funnel_text_window_t* new_text_window(const gchar* title) {
tw->close_cb = NULL;
tw->close_data = NULL;
tw->buttons = g_ptr_array_new();
tw->win = dlg_window_new(title); /* transient_for top_level */
gtk_window_set_destroy_with_parent (GTK_WINDOW(tw->win), TRUE);
@ -169,10 +167,10 @@ static funnel_text_window_t* new_text_window(const gchar* title) {
main_vb = gtk_vbox_new(FALSE, 3);
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
gtk_container_add(GTK_CONTAINER(tw->win), main_vb);
gtk_container_add(GTK_CONTAINER(main_vb), txt_scrollw);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(txt_scrollw),
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(txt_scrollw),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(txt_scrollw),
@ -181,19 +179,19 @@ static funnel_text_window_t* new_text_window(const gchar* title) {
gtk_text_view_set_editable(GTK_TEXT_VIEW(tw->txt), FALSE);
gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(tw->txt), GTK_WRAP_WORD);
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(tw->txt), FALSE);
gtk_text_view_set_left_margin(GTK_TEXT_VIEW(tw->txt), 4);
gtk_text_view_set_right_margin(GTK_TEXT_VIEW(tw->txt), 4);
hbox = gtk_hbox_new(FALSE, 0);
gtk_widget_show(hbox);
tw->button_hbox = gtk_hbutton_box_new();
gtk_button_box_set_layout(GTK_BUTTON_BOX(tw->button_hbox), GTK_BUTTONBOX_START);
gtk_box_pack_start(GTK_BOX(hbox), tw->button_hbox, TRUE, TRUE, 0);
gtk_widget_show(tw->button_hbox);
gtk_box_pack_start(GTK_BOX(main_vb), hbox, FALSE, FALSE, 0);
tw->bt_close = gtk_button_new_with_label("Close");
@ -209,7 +207,7 @@ static funnel_text_window_t* new_text_window(const gchar* title) {
gtk_container_add(GTK_CONTAINER(txt_scrollw), tw->txt);
gtk_window_resize(GTK_WINDOW(tw->win),400,300);
gtk_widget_show_all(tw->win);
return tw;
}
@ -218,10 +216,10 @@ static void text_window_clear(funnel_text_window_t* tw)
{
GtkTextBuffer *buf;
if (! tw->win) return;
if (! tw->win) return;
buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(tw->txt));
gtk_text_buffer_set_text(buf, "", 0);
}
@ -233,17 +231,17 @@ static void text_window_append(funnel_text_window_t* tw, const char *str)
GtkTextBuffer *buf;
GtkTextIter iter;
if (! tw->win) return;
if (! tw->win) return;
txt = tw->txt;
nchars = (int) strlen(str);
buf= gtk_text_view_get_buffer(GTK_TEXT_VIEW(txt));
gtk_text_buffer_get_end_iter(buf, &iter);
gtk_widget_modify_font(GTK_WIDGET(txt), user_font_get_regular());
if (!g_utf8_validate(str, -1, NULL))
printf("Invalid utf8 encoding: %s\n", str);
@ -253,8 +251,8 @@ static void text_window_append(funnel_text_window_t* tw, const char *str)
static void text_window_set_text(funnel_text_window_t* tw, const gchar* text)
{
if (! tw->win) return;
if (! tw->win) return;
text_window_clear(tw);
text_window_append(tw, text);
}
@ -265,21 +263,21 @@ static void text_window_prepend(funnel_text_window_t* tw, const char *str _U_)
int nchars;
GtkTextBuffer *buf;
GtkTextIter iter;
if (! tw->win) return;
if (! tw->win) return;
txt = tw->txt;
nchars = (int) strlen(str);
buf= gtk_text_view_get_buffer(GTK_TEXT_VIEW(txt));
gtk_text_buffer_get_start_iter(buf, &iter);
gtk_widget_modify_font(GTK_WIDGET(txt), user_font_get_regular());
if (!g_utf8_validate(str, -1, NULL))
printf("Invalid utf8 encoding: %s\n", str);
gtk_text_buffer_insert(buf, &iter, str, nchars);
}
@ -288,20 +286,20 @@ static const gchar* text_window_get_text(funnel_text_window_t* tw) {
GtkTextBuffer *buf;
GtkTextIter start;
GtkTextIter end;
if (! tw->win) return "";
if (! tw->win) return "";
txt = tw->txt;
buf= gtk_text_view_get_buffer(GTK_TEXT_VIEW(txt));
gtk_text_buffer_get_start_iter(buf, &start);
gtk_text_buffer_get_end_iter(buf, &end);
return gtk_text_buffer_get_text(buf, &start, &end, FALSE);
}
static void text_window_set_close_cb(funnel_text_window_t* tw, text_win_close_cb_t cb, void* data) {
tw->close_cb = cb;
tw->close_data = data;
@ -323,7 +321,7 @@ static void text_window_destroy(funnel_text_window_t* tw) {
*/
for (i = 0; i < tw->buttons->len; i++) {
funnel_bt_t* cbd = g_ptr_array_index(tw->buttons,i);
/* XXX a free cb should be passed somehow */
/* XXX a free cb should be passed somehow */
if (cbd->data && cbd->free_data_fcn) cbd->free_data_fcn(cbd->data);
if (cbd->free_fcn) cbd->free_fcn(cbd);
}
@ -340,7 +338,7 @@ static void text_window_set_editable(funnel_text_window_t* tw, gboolean editabl
static gboolean text_window_button_cb(GtkWidget *bt _U_, gpointer user_data)
{
funnel_bt_t* cbd = user_data;
if (cbd->func) {
return cbd->func(cbd->tw,cbd->data);
} else {
@ -350,15 +348,15 @@ static gboolean text_window_button_cb(GtkWidget *bt _U_, gpointer user_data)
static void text_window_add_button(funnel_text_window_t* tw, funnel_bt_t* cbd, const gchar* label) {
GtkWidget *button;
cbd->tw = tw;
g_ptr_array_add(tw->buttons,cbd);
button = gtk_button_new_with_label(label);
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
gtk_box_pack_start(GTK_BOX(tw->button_hbox), button, FALSE, FALSE, 0);
gtk_widget_show(button);
g_signal_connect(button, "clicked", G_CALLBACK(text_window_button_cb), cbd);
@ -378,14 +376,14 @@ static gboolean funnel_dlg_cb(GtkWidget *win _U_, gpointer user_data)
guint i;
guint len = dd->entries->len;
GPtrArray* returns = g_ptr_array_new();
for(i=0; i<len; i++) {
GtkEntry* entry = g_ptr_array_index(dd->entries,i);
g_ptr_array_add(returns,g_strdup(gtk_entry_get_text(entry)));
}
g_ptr_array_add(returns,NULL);
if (dd->dlg_cb)
dd->dlg_cb((gchar**)returns->pdata,dd->data);
@ -398,7 +396,7 @@ static gboolean funnel_dlg_cb(GtkWidget *win _U_, gpointer user_data)
static void funnel_cancel_btn_cb(GtkWidget *bt _U_, gpointer data) {
GtkWidget* win = data;
window_destroy(GTK_WIDGET(win));
}
@ -414,15 +412,15 @@ static void funnel_new_dialog(const gchar* title,
dd->entries = g_ptr_array_new();
dd->dlg_cb = dlg_cb;
dd->data = data;
for (i=0;fieldnames[i];i++);
win = dlg_window_new(title);
dd->win = win;
gtk_window_resize(GTK_WINDOW(win),400,10*(i+2));
main_vb = gtk_vbox_new(TRUE,5);
gtk_container_add(GTK_CONTAINER(win), main_vb);
gtk_container_set_border_width(GTK_CONTAINER(main_vb), 6);
@ -431,10 +429,10 @@ static void funnel_new_dialog(const gchar* title,
gtk_box_pack_start(GTK_BOX(main_vb), main_tb, FALSE, FALSE, 0);
gtk_table_set_row_spacings(GTK_TABLE(main_tb), 10);
gtk_table_set_col_spacings(GTK_TABLE(main_tb), 15);
for (i = 0; (fieldname = fieldnames[i]) ; i++) {
GtkWidget *entry, *label;
label = gtk_label_new(fieldname);
gtk_misc_set_alignment(GTK_MISC(label), 1.0f, 0.5f);
gtk_table_attach_defaults(GTK_TABLE(main_tb), label, 0, 1, i+1, i + 2);
@ -448,27 +446,27 @@ static void funnel_new_dialog(const gchar* title,
bbox = dlg_button_row_new(GTK_STOCK_CANCEL,GTK_STOCK_OK, NULL);
gtk_box_pack_start(GTK_BOX(main_vb), bbox, FALSE, FALSE, 0);
bt_ok = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_OK);
g_signal_connect(bt_ok, "clicked", G_CALLBACK(funnel_dlg_cb), dd);
gtk_widget_grab_default(bt_ok);
bt_cancel = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_CANCEL);
g_signal_connect(bt_cancel, "clicked", G_CALLBACK(funnel_cancel_btn_cb), win);
gtk_widget_grab_default(bt_cancel);
gtk_widget_show(main_tb);
gtk_widget_show(main_vb);
gtk_widget_show(win);
}
static void funnel_set_filter(const char* filter_string) {
static void funnel_set_filter(const char* filter_string) {
gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), filter_string);
}
static void funnel_apply_filter(void) {
const char* filter_string = gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));
main_filter_packets(&cfile, filter_string, FALSE);
main_filter_packets(&cfile, filter_string, FALSE);
}
/* XXX: finish this */
@ -486,7 +484,7 @@ static void funnel_retap_packets(void) {
static gboolean funnel_open_file(const char* fname, const char* filter, const char** err_str) {
int err = 0;
dfilter_t *rfcode = NULL;
*err_str = "no error";
switch (cfile.state) {
@ -498,15 +496,15 @@ static gboolean funnel_open_file(const char* fname, const char* filter, const ch
*err_str = "file read in progress";
return FALSE;
}
if (filter) {
if (!dfilter_compile(filter, &rfcode)) {
*err_str = dfilter_error_msg ? dfilter_error_msg : "cannot compile filter";
return FALSE;
}
}
if (cf_open(&cfile, fname, FALSE, &err) != CF_OK) {
*err_str = strerror(err);
if (rfcode != NULL) dfilter_free(rfcode);
@ -514,7 +512,7 @@ static gboolean funnel_open_file(const char* fname, const char* filter, const ch
}
cfile.rfcode = rfcode;
switch (cf_read(&cfile, FALSE)) {
case CF_READ_OK:
case CF_READ_ERROR:
@ -523,7 +521,7 @@ static gboolean funnel_open_file(const char* fname, const char* filter, const ch
*err_str = "problem while reading file";
return FALSE;
}
return TRUE;
}
@ -595,7 +593,7 @@ static void register_menu_cb(const char *name,
mcb->callback = callback;
mcb->callback_data = callback_data;
mcb->retap = retap;
register_stat_menu_item(name, group, our_menu_callback, NULL, NULL, mcb);
}

View File

@ -49,7 +49,6 @@
#include "epan/filesystem.h"
#include "../util.h"
#include "../register.h"
#include "../color.h"
#include "../simple_dialog.h"
#include "../alert_box.h"

View File

@ -47,8 +47,6 @@
#include "../stat_menu.h"
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/dlg_utils.h"

View File

@ -48,8 +48,6 @@
#include "../stat_menu.h"
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/dlg_utils.h"
@ -117,14 +115,14 @@ GtkWidget* create_list(void)
/* The view now holds a reference. We can get rid of our own reference */
g_object_unref (G_OBJECT (list_store));
/*
/*
* Create the first column packet, associating the "text" attribute of the
* cell_renderer to the first column of the model
* cell_renderer to the first column of the model
*/
/* 1:st column */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("ID", renderer,
"text", ID_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("ID", renderer,
"text", ID_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, ID_COLUMN);
@ -137,7 +135,7 @@ GtkWidget* create_list(void)
/* 2:nd column..Operation Code. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Operation Code", renderer,
column = gtk_tree_view_column_new_with_attributes ("Operation Code", renderer,
"text", OP_CODE_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, OP_CODE_COLUMN);
@ -148,7 +146,7 @@ GtkWidget* create_list(void)
/* 3:d column..Invokes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Invokes", renderer,
column = gtk_tree_view_column_new_with_attributes ("Invokes", renderer,
"text", INVOKES_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, INVOKES_COLUMN);
@ -159,10 +157,10 @@ GtkWidget* create_list(void)
/* 4:th column.. Num Bytes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
"text", NUM_BYTES_FWD_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
"text", NUM_BYTES_FWD_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, NUM_BYTES_FWD_COLUMN);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -172,10 +170,10 @@ GtkWidget* create_list(void)
/* 5:th column.. Avg Bytes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_FWD_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_FWD_COLUMN,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
GINT_TO_POINTER(AVG_BYTES_FWD_COLUMN), NULL);
gtk_tree_view_column_set_sort_column_id(column, AVG_BYTES_FWD_COLUMN);
@ -186,7 +184,7 @@ GtkWidget* create_list(void)
/* 6:d column..Invokes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("ReturnResult", renderer,
column = gtk_tree_view_column_new_with_attributes ("ReturnResult", renderer,
"text", RET_RES_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, RET_RES_COLUMN);
@ -197,10 +195,10 @@ GtkWidget* create_list(void)
/* 7:th column.. Num Bytes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
"text", NUM_BYTES_REV_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
"text", NUM_BYTES_REV_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, NUM_BYTES_FWD_COLUMN);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -210,10 +208,10 @@ GtkWidget* create_list(void)
/* 8:th column.. Avg Bytes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_REV_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_REV_COLUMN,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
GINT_TO_POINTER(AVG_BYTES_REV_COLUMN), NULL);
@ -225,10 +223,10 @@ GtkWidget* create_list(void)
/* 9:th column.. Total Bytes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Total Bytes", renderer,
"text", TOT_BYTES_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Total Bytes", renderer,
"text", TOT_BYTES_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, NUM_BYTES_FWD_COLUMN);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -238,10 +236,10 @@ GtkWidget* create_list(void)
/* 10:th column.. Avg Bytes. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_COLUMN,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
GINT_TO_POINTER(AVG_BYTES_COLUMN), NULL);
gtk_tree_view_column_set_sort_column_id(column, AVG_BYTES_COLUMN);
@ -355,7 +353,7 @@ gsm_map_stat_draw(
}else{
avrage_bytes_tot = 0;
}
/* Creates a new row at position. iter will be changed to point to this new row.
/* Creates a new row at position. iter will be changed to point to this new row.
* If position is larger than the number of rows on the list, then the new row will be appended to the list.
* The row will be filled with the values given to this function.
* :

View File

@ -41,11 +41,9 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-gtp.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"
@ -106,7 +104,7 @@ gtpstat_packet(void *pgtp, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
switch(gtp->msgtype){
case GTP_MSG_ECHO_REQ: idx=0;
break;
break;
case GTP_MSG_CREATE_PDP_REQ: idx=1;
break;
case GTP_MSG_UPDATE_PDP_REQ: idx=2;

View File

@ -38,7 +38,6 @@
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "gtk/gui_stat_util.h"

View File

@ -42,10 +42,8 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-h225.h>
#include "../register.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_stat_util.h"
@ -322,7 +320,7 @@ h225counter_draw(void *phs)
case 2: /* GRJ */
for(j=0;j<=GRJ_REASONS;j++) {
if(hs->grj_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,GatekeeperRejectReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -334,7 +332,7 @@ h225counter_draw(void *phs)
case 5: /* RRJ */
for(j=0;j<=RRJ_REASONS;j++) {
if(hs->rrj_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,RegistrationRejectReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -346,7 +344,7 @@ h225counter_draw(void *phs)
case 6: /* URQ */
for(j=0;j<=URQ_REASONS;j++) {
if(hs->urq_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,UnregRequestReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -358,7 +356,7 @@ h225counter_draw(void *phs)
case 8: /* URJ */
for(j=0;j<=URJ_REASONS;j++) {
if(hs->urj_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,UnregRejectReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -370,7 +368,7 @@ h225counter_draw(void *phs)
case 11: /* ARJ */
for(j=0;j<=ARJ_REASONS;j++) {
if(hs->arj_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,AdmissionRejectReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -382,7 +380,7 @@ h225counter_draw(void *phs)
case 14: /* BRJ */
for(j=0;j<=BRJ_REASONS;j++) {
if(hs->brj_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,BandRejectReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -394,7 +392,7 @@ h225counter_draw(void *phs)
case 15: /* DRQ */
for(j=0;j<=DRQ_REASONS;j++) {
if(hs->drq_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,DisengageReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -406,7 +404,7 @@ h225counter_draw(void *phs)
case 17: /* DRJ */
for(j=0;j<=DRJ_REASONS;j++) {
if(hs->drj_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,DisengageRejectReason_vals,"unknown reason"));
gtk_list_store_set(store, &iter,
0, str,
@ -417,7 +415,7 @@ h225counter_draw(void *phs)
case 20: /* LRJ */
for(j=0;j<=LRJ_REASONS;j++) {
if(hs->lrj_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,LocationRejectReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -429,7 +427,7 @@ h225counter_draw(void *phs)
case 29: /* IRQNak */
for(j=0;j<=IRQNAK_REASONS;j++) {
if(hs->irqnak_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,InfoRequestNakReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -457,7 +455,7 @@ h225counter_draw(void *phs)
case 5: /* ReleaseComplete */
for(j=0;j<=REL_CMP_REASONS;j++) {
if(hs->rel_cmp_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,h225_ReleaseCompleteReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,
@ -469,7 +467,7 @@ h225counter_draw(void *phs)
case 6: /* Facility */
for(j=0;j<=FACILITY_REASONS;j++) {
if(hs->facility_reason[j]!=0) {
g_snprintf(str, 256," %s",
g_snprintf(str, 256," %s",
val_to_str(j,FacilityReason_vals,"unknown reason"));
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter,

View File

@ -42,11 +42,9 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-h225.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_stat_util.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-eth.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -52,7 +51,7 @@ eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons
const eth_hdr *ehdr=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_ETHER, PT_NONE);
add_hostlist_table_data(hosts, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_ETHER, PT_NONE);

View File

@ -41,7 +41,6 @@
#include <epan/dissectors/packet-fc.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -54,7 +53,7 @@ fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const
const fc_hdr *fchdr=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &fchdr->s_id, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
add_hostlist_table_data(hosts, &fchdr->d_id, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-fddi.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -52,7 +51,7 @@ fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
const fddi_hdr *ehdr=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_FDDI, PT_NONE);
add_hostlist_table_data(hosts, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_FDDI, PT_NONE);

View File

@ -41,7 +41,6 @@
#include <epan/dissectors/packet-ip.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -54,7 +53,7 @@ ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const
const ws_ip *iph=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &iph->ip_src, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
add_hostlist_table_data(hosts, &iph->ip_dst, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);

View File

@ -42,7 +42,6 @@
#include <epan/dissectors/packet-ipv6.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-ipx.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -52,7 +51,7 @@ ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons
const ipxhdr_t *ipxh=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &ipxh->ipx_src, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
add_hostlist_table_data(hosts, &ipxh->ipx_dst, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-jxta.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -52,7 +51,7 @@ jxta_hostlist_packet(void *pit, packet_info *pinfo _U_, epan_dissect_t *edt _U_,
const jxta_tap_header *jxtahdr = vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &jxtahdr->src_address, 0, TRUE, 1, jxtahdr->size, SAT_JXTA, PT_NONE);
add_hostlist_table_data(hosts, &jxtahdr->dest_address, 0, FALSE, 1, jxtahdr->size, SAT_JXTA, PT_NONE);

View File

@ -1,4 +1,4 @@
/* hostlist_ncp.c 2006 Greg Morris
/* hostlist_ncp.c 2006 Greg Morris
* modified from endpoint_talkers_eth.c 2003 Ronnie Sahlberg
*
* $Id$
@ -39,7 +39,6 @@
/*#include <epan/dissectors/packet-ncp-int.h>*/
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"

View File

@ -41,7 +41,6 @@
#include <epan/dissectors/packet-rsvp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -54,13 +53,13 @@ rsvp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
const rsvp_conversation_info *rsvph = vip;
/* Take two "add" passes per packet, adding for each direction, ensures
* that all packets are counted properly (even if address is sending to
* itself). XXX - this could probably be done more efficiently inside
* hostlist_table
* that all packets are counted properly (even if address is sending to
* itself). XXX - this could probably be done more efficiently inside
* hostlist_table
*/
add_hostlist_table_data(hosts, &rsvph->source, 0, TRUE, 1,
add_hostlist_table_data(hosts, &rsvph->source, 0, TRUE, 1,
pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
add_hostlist_table_data(hosts, &rsvph->destination, 0, FALSE, 1,
add_hostlist_table_data(hosts, &rsvph->destination, 0, FALSE, 1,
pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
return 1;
}
@ -76,7 +75,7 @@ gtk_rsvp_hostlist_init(const char *optarg, void* userdata _U_)
filter=NULL;
}
init_hostlist_table(TRUE, "RSVP", "rsvp", filter,
init_hostlist_table(TRUE, "RSVP", "rsvp", filter,
rsvp_hostlist_packet);
}
@ -97,6 +96,6 @@ register_tap_listener_rsvp_hostlist(void)
register_stat_menu_item("RSVP", REGISTER_STAT_GROUP_ENDPOINT_LIST,
gtk_rsvp_hostlist_cb, NULL, NULL, NULL);
register_hostlist_table(TRUE, "RSVP", "rsvp", NULL /*filter*/,
register_hostlist_table(TRUE, "RSVP", "rsvp", NULL /*filter*/,
rsvp_hostlist_packet);
}

View File

@ -38,7 +38,6 @@
#include <epan/dissectors/packet-sctp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"

View File

@ -49,7 +49,6 @@
#include <wsutil/file_util.h>
#include "../simple_dialog.h"
#include "../globals.h"
#include "../alert_box.h"
#include "../tempfile.h"
@ -94,7 +93,7 @@ hostlist_port_to_str(int port_type_val, guint32 port)
i = (i+1)%4;
strp=str[i];
bp = &strp[11];
*bp = 0;
do {
*--bp = (port % 10) +'0';
@ -230,7 +229,7 @@ reset_hostlist_table_data(hostlist_table *hosts)
if (hosts->hosts)
g_array_free(hosts->hosts, TRUE);
if (hosts->hashtable != NULL)
if (hosts->hashtable != NULL)
g_hash_table_destroy(hosts->hashtable);
hosts->hosts=NULL;
@ -257,7 +256,7 @@ hostlist_win_destroy_cb(GtkWindow *win _U_, gpointer data)
g_free(hosts);
}
enum
enum
{
ADR_COLUMN,
PORT_COLUMN,
@ -318,10 +317,10 @@ hostlist_sort_column(GtkTreeModel *model,
{
gchar *text1, *text2;
double loc1 = 0, loc2 = 0;
gtk_tree_model_get(model, a, data_column, &text1, -1);
gtk_tree_model_get(model, b, data_column, &text2, -1);
if (text1) {
loc1 = atof(text1);
g_free(text1);
@ -356,7 +355,7 @@ hostlist_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint c
if (!gtk_tree_selection_get_selected(sel, &model, &iter))
return;
gtk_tree_model_get (model, &iter,
gtk_tree_model_get (model, &iter,
INDEX_COLUMN, &idx,
-1);
@ -712,7 +711,7 @@ draw_hostlist_table_addresses(hostlist_table *hl)
char *entries[2];
GtkListStore *store;
store = GTK_LIST_STORE(gtk_tree_view_get_model(hl->table));
store = GTK_LIST_STORE(gtk_tree_view_get_model(hl->table));
g_object_ref(store);
gtk_tree_view_set_model(GTK_TREE_VIEW(hl->table), NULL);
@ -754,10 +753,10 @@ draw_hostlist_table_data(hostlist_table *hl)
gtk_label_set_text(GTK_LABEL(hl->name_lb), title);
}
store = GTK_LIST_STORE(gtk_tree_view_get_model(hl->table));
store = GTK_LIST_STORE(gtk_tree_view_get_model(hl->table));
for(i=0;i<hl->num_hosts;i++){
hostlist_talker_t *host = &g_array_index(hl->hosts, hostlist_talker_t, i);
if (!host->modified)
continue;
@ -813,7 +812,7 @@ draw_hostlist_table_data(hostlist_table *hl)
#else
gtk_list_store_append(store, &host->iter);
gtk_list_store_set (store, &host->iter,
#endif
#endif
ADR_COLUMN, entries[0],
PORT_COLUMN, entries[1],
PACKETS_COLUMN, host->tx_frames+host->rx_frames,
@ -1194,7 +1193,7 @@ init_default_col_size(GtkWidget *view)
default_col_size[PORT_COLUMN] = get_default_col_size(view, "000000");
default_col_size[PACKETS_COLUMN] = get_default_col_size(view, "00 000 000");
default_col_size[BYTES_COLUMN] = get_default_col_size(view, "0 000 000 000");
default_col_size[PKT_AB_COLUMN] = default_col_size[PACKETS_COLUMN];
default_col_size[PKT_AB_COLUMN] = default_col_size[PACKETS_COLUMN];
default_col_size[PKT_BA_COLUMN] = default_col_size[PACKETS_COLUMN];
default_col_size[BYTES_AB_COLUMN] = default_col_size[BYTES_COLUMN];
default_col_size[BYTES_BA_COLUMN] = default_col_size[BYTES_COLUMN];
@ -1217,7 +1216,7 @@ init_default_col_size(GtkWidget *view)
}
static gboolean
init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hide_ports, const char *table_name, const char *tap_name,
init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hide_ports, const char *table_name, const char *tap_name,
const char *filter, tap_packet_cb packet_func)
{
guint i;
@ -1303,7 +1302,7 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
col_size = TRUE;
init_default_col_size(GTK_WIDGET(hosttable->table));
}
g_object_set_data(G_OBJECT(store), HOST_PTR_KEY, hosttable);
g_object_set_data(G_OBJECT(hosttable->table), HOST_PTR_KEY, hosttable);
@ -1313,7 +1312,7 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
switch(i) {
case 0: /* address and port */
case 1:
column = gtk_tree_view_column_new_with_attributes (hosttable->default_titles[i], renderer, "text",
column = gtk_tree_view_column_new_with_attributes (hosttable->default_titles[i], renderer, "text",
i, NULL);
if(hide_ports && i == 1){
/* hide srcport and dstport if we don't use ports */
@ -1322,8 +1321,8 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
gtk_tree_sortable_set_sort_func(sortable, i, hostlist_sort_column, GINT_TO_POINTER(i), NULL);
break;
case 2: /* counts */
case 3:
case 4:
case 3:
case 4:
case 5:
case 6:
case 7: /* right align numbers */
@ -1332,7 +1331,7 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
gtk_tree_view_column_set_cell_data_func(column, renderer, u64_data_func, GINT_TO_POINTER(i), NULL);
break;
default: /* GEOIP */
column = gtk_tree_view_column_new_with_attributes (hosttable->default_titles[i], renderer, "text",
column = gtk_tree_view_column_new_with_attributes (hosttable->default_titles[i], renderer, "text",
i, NULL);
gtk_tree_view_column_set_visible(column, FALSE);
#ifdef HAVE_GEOIP
@ -1358,7 +1357,7 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
if (i == PACKETS_COLUMN) {
gtk_tree_view_column_clicked(column);
}
#endif
#endif
}
gtk_container_add(GTK_CONTAINER(hosttable->scrolled_window), (GtkWidget *)hosttable->table);
@ -1525,7 +1524,7 @@ hostlist_win_destroy_notebook_cb(GtkWindow *win _U_, gpointer data)
static hostlist_table *
init_hostlist_notebook_page_cb(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter,
init_hostlist_notebook_page_cb(gboolean hide_ports, const char *table_name, const char *tap_name, const char *filter,
tap_packet_cb packet_func)
{
gboolean ret;
@ -1813,7 +1812,7 @@ add_hostlist_table_data(hostlist_table *hl, const address *addr, guint32 port, g
talker=&g_array_index(hl->hosts, hostlist_talker_t, talker_idx);
}
}
/* if we still dont know what talker this is it has to be a new one
and we have to allocate it and append it to the end of the list */
if(talker==NULL){

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-tcp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -52,7 +51,7 @@ tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co
const struct tcpheader *tcphdr=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &tcphdr->ip_src, tcphdr->th_sport, TRUE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_TCP);
add_hostlist_table_data(hosts, &tcphdr->ip_dst, tcphdr->th_dport, FALSE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_TCP);

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-tr.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -52,7 +51,7 @@ tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const
const tr_hdr *trhdr=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &trhdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, SAT_TOKENRING, PT_NONE);
add_hostlist_table_data(hosts, &trhdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, SAT_TOKENRING, PT_NONE);

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-udp.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"
@ -52,7 +51,7 @@ udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co
const e_udphdr *udphdr=vip;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside hostlist_table */
add_hostlist_table_data(hosts, &udphdr->ip_src, udphdr->uh_sport, TRUE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_UDP);
add_hostlist_table_data(hosts, &udphdr->ip_dst, udphdr->uh_dport, FALSE, 1, pinfo->fd->pkt_len, SAT_NONE, PT_UDP);

View File

@ -39,7 +39,6 @@
#include <epan/dissectors/packet-usb.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"

View File

@ -1,4 +1,4 @@
/* hostlist_wlan.c 2004 Giles Scott
/* hostlist_wlan.c 2004 Giles Scott
* modified from endpoint_talkers_eth.c 2003 Ronnie Sahlberg
*
* $Id$
@ -39,7 +39,6 @@
#include <epan/dissectors/packet-ieee80211.h>
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/hostlist_table.h"

View File

@ -65,7 +65,6 @@
#include <epan/strutil.h>
#include "../util.h"
#include "../register.h"
#include "../g711.h"
#include "../alert_box.h"
#include "../simple_dialog.h"
@ -149,7 +148,7 @@ typedef struct _dialog_graph_graph_t {
typedef struct _dialog_graph_t {
gboolean needs_redraw;
gint32 interval_index; /* index into tick_interval_values array */
gint32 interval_index; /* index into tick_interval_values array */
gint32 interval; /* measurement interval in ms */
guint32 last_interval;
guint32 max_interval; /* XXX max_interval and num_items are redundant */
@ -422,7 +421,7 @@ static void iax2_draw(void *prs _U_)
/* forward declarations */
static void add_to_list(GtkWidget *list, user_data_t * user_data, guint32 number,
double delta, double jitter, double bandwidth, gchar *status,
double delta, double jitter, double bandwidth, gchar *status,
gchar *timeStr, guint32 pkt_len,gchar *color_str, guint32 flags);
static int iax2_packet_add_info(GtkWidget *list,user_data_t * user_data,
@ -445,11 +444,11 @@ static gboolean iax2_packet(void *user_data_arg, packet_info *pinfo, epan_dissec
/* we ignore packets that are not displayed */
if (pinfo->fd->flags.passed_dfilter == 0)
return FALSE;
/* we ignore packets that carry no data */
if (iax2info->payload_len == 0)
return FALSE;
/* is it the forward direction? */
else if (CMP_ADDRESS(&(user_data->ip_src_fwd), &(pinfo->net_src)) == 0
&& user_data->port_src_fwd == pinfo->srcport
@ -616,7 +615,7 @@ static int iax2_packet_add_info(GtkWidget *list, user_data_t * user_data,
tm_tmp->tm_min,
tm_tmp->tm_sec,
msecs);
/* Default to using black on white text if nothing below overrides it */
g_snprintf(color_str,sizeof(color_str),"#ffffffffffff");
@ -654,7 +653,7 @@ static int iax2_packet_add_info(GtkWidget *list, user_data_t * user_data,
/* is this the first packet we got in this direction? */
if (statinfo->flags & STAT_FLAG_FIRST) {
add_to_list(list, user_data,
pinfo->fd->num,
pinfo->fd->num,
0,
0,
statinfo->bandwidth,
@ -665,7 +664,7 @@ static int iax2_packet_add_info(GtkWidget *list, user_data_t * user_data,
}
else {
add_to_list(list, user_data,
pinfo->fd->num,
pinfo->fd->num,
statinfo->delta*1000,
statinfo->jitter*1000,
statinfo->bandwidth,
@ -782,12 +781,12 @@ static void on_notebook_switch_page(GtkNotebook *notebook _U_,
user_data->dlg.selected_list =
(page_num==0) ? user_data->dlg.list_fwd : user_data->dlg.list_rev ;
user_data->dlg.selected_list_row = 0;
}
/****************************************************************************/
static void on_list_select_row(GtkTreeSelection *selection,
static void on_list_select_row(GtkTreeSelection *selection,
gpointer data)
{
user_data_t *user_data = data;
@ -842,7 +841,7 @@ static void dialog_graph_reset(user_data_t* user_data)
for(i=0;i<MAX_GRAPHS;i++){
/* it is forward */
if (i<2){
g_snprintf(user_data->dlg.dialog_graph.graph[i].title,
g_snprintf(user_data->dlg.dialog_graph.graph[i].title,
sizeof (user_data->dlg.dialog_graph.graph[0].title),
"%s: %s:%u to %s:%u",
graph_descr[i],
@ -985,7 +984,7 @@ static void dialog_graph_draw(user_data_t* user_data)
/*
* Calculate size of borders surrounding the plot
* The border on the right side needs to be adjusted depending
* on the width of the text labels.
* on the width of the text labels.
*/
print_time_scale_string(label_string, sizeof(label_string), max_y);
layout = gtk_widget_create_pango_layout(user_data->dlg.dialog_graph.draw_area, label_string);
@ -1725,7 +1724,7 @@ static void on_goto_bt_clicked(GtkWidget *bt _U_, gpointer data)
if (selection==NULL)
return;
if (gtk_tree_selection_get_selected (selection, &model, &iter)){
gtk_tree_model_get (model, &iter, PACKET_COLUMN, &fnumber, -1);
cf_goto_frame(&cfile, fnumber);
@ -1883,9 +1882,9 @@ static gboolean save_csv_as_ok_cb(GtkWidget *w _U_, gpointer fc /*user_data_t *u
model = gtk_tree_view_get_model(GTK_TREE_VIEW(user_data->dlg.list_fwd));
store = GTK_LIST_STORE(model);
if( gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter) ) {
while (more_items) {
gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
0, &packet,
1, &delta,
2, &jitter,
@ -1914,7 +1913,7 @@ static gboolean save_csv_as_ok_cb(GtkWidget *w _U_, gpointer fc /*user_data_t *u
more_items = gtk_tree_model_iter_next (model,&iter);
}
}
if (fclose(fp) == EOF) {
write_failure_alert_box(g_dest, errno);
g_free(g_dest);
@ -1967,7 +1966,7 @@ static gboolean save_csv_as_ok_cb(GtkWidget *w _U_, gpointer fc /*user_data_t *u
more_items = TRUE;
while (more_items) {
gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
0, &packet,
1, &delta,
2, &jitter,
@ -2033,9 +2032,9 @@ static void save_csv_as_cb(GtkWidget *bt _U_, gpointer data)
return;
}
#endif
user_data->dlg.save_csv_as_w =
gtk_file_chooser_dialog_new("Wireshark: Save Data As CSV",
GTK_WINDOW(user_data->dlg.notebook),
user_data->dlg.save_csv_as_w =
gtk_file_chooser_dialog_new("Wireshark: Save Data As CSV",
GTK_WINDOW(user_data->dlg.notebook),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@ -2100,7 +2099,7 @@ static void save_csv_as_cb(GtkWidget *bt _U_, gpointer data)
g_object_set_data(G_OBJECT(user_data->dlg.save_csv_as_w), "both_rb", both_rb);
g_object_set_data(G_OBJECT(user_data->dlg.save_csv_as_w), "user_data", user_data);
g_signal_connect(user_data->dlg.save_csv_as_w, "delete_event",
g_signal_connect(user_data->dlg.save_csv_as_w, "delete_event",
G_CALLBACK(window_delete_event_cb), NULL);
g_signal_connect(user_data->dlg.save_csv_as_w, "destroy",
G_CALLBACK(save_csv_as_destroy_cb), user_data);
@ -2535,7 +2534,7 @@ static gboolean save_voice_as_ok_cb(GtkWidget *w _U_, gpointer fc)
#if 0
if (GTK_TOGGLE_BUTTON (wav)->active)
format = SAVE_WAV_FORMAT;
else
else
#endif
if (GTK_TOGGLE_BUTTON (au)->active)
format = SAVE_AU_FORMAT;
@ -2639,7 +2638,7 @@ static void save_voice_as_cb(GtkWidget *bt _U_, gpointer data)
}
#endif
/* XXX - use file_selection from dlg_utils instead! */
user_data->dlg.save_voice_as_w =
user_data->dlg.save_voice_as_w =
gtk_file_chooser_dialog_new("Wireshark: Save Payload As ...",
GTK_WINDOW(user_data->dlg.notebook),
GTK_FILE_CHOOSER_ACTION_SAVE,
@ -2827,7 +2826,7 @@ static void draw_stat(user_data_t *user_data)
/****************************************************************************/
/* append a line to list */
static void add_to_list(GtkWidget *list, user_data_t * user_data, guint32 number,
static void add_to_list(GtkWidget *list, user_data_t * user_data, guint32 number,
double delta, double jitter, double bandwidth, gchar *status,
gchar *timeStr, guint32 pkt_len, gchar *color_str, guint32 flags)
{
@ -2839,7 +2838,7 @@ static void add_to_list(GtkWidget *list, user_data_t * user_data, guint32 number
list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (list))); /* Get store */
/* Creates a new row at position. iter will be changed to point to this new row.
/* Creates a new row at position. iter will be changed to point to this new row.
* If position is larger than the number of rows on the list, then the new row will be appended to the list.
* The row will be filled with the values given to this function.
* :
@ -2957,13 +2956,13 @@ GtkWidget* create_list(user_data_t* user_data)
/* The view now holds a reference. We can get rid of our own reference */
g_object_unref (G_OBJECT (list_store));
/*
/*
* Create the first column packet, associating the "text" attribute of the
* cell_renderer to the first column of the model
* cell_renderer to the first column of the model
*/
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Packet", renderer,
"text", PACKET_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Packet", renderer,
"text", PACKET_COLUMN,
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
NULL);
@ -2977,13 +2976,13 @@ GtkWidget* create_list(user_data_t* user_data)
/* Second column.. Delta(ms). */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Delta(ms)", renderer,
"text", DELTA_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Delta(ms)", renderer,
"text", DELTA_COLUMN,
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, iax2_float_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, iax2_float_data_func,
GINT_TO_POINTER(DELTA_COLUMN), NULL);
gtk_tree_view_column_set_sort_column_id(column, DELTA_COLUMN);
@ -2994,13 +2993,13 @@ GtkWidget* create_list(user_data_t* user_data)
/* Third column.. Jitter(ms). */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Jitter(ms)", renderer,
"text", JITTER_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Jitter(ms)", renderer,
"text", JITTER_COLUMN,
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, iax2_float_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, iax2_float_data_func,
GINT_TO_POINTER(JITTER_COLUMN), NULL);
gtk_tree_view_column_set_sort_column_id(column, JITTER_COLUMN);
@ -3011,13 +3010,13 @@ GtkWidget* create_list(user_data_t* user_data)
/* Fourth column.. IP BW(kbps). */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("IP BW(kbps)", renderer,
"text", IPBW_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("IP BW(kbps)", renderer,
"text", IPBW_COLUMN,
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, iax2_float_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, iax2_float_data_func,
GINT_TO_POINTER(IPBW_COLUMN), NULL);
gtk_tree_view_column_set_sort_column_id(column, IPBW_COLUMN);
@ -3028,7 +3027,7 @@ GtkWidget* create_list(user_data_t* user_data)
/* Fifth column.. Status. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ( "Status", renderer,
column = gtk_tree_view_column_new_with_attributes ( "Status", renderer,
"text", STATUS_COLUMN,
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
@ -3041,8 +3040,8 @@ GtkWidget* create_list(user_data_t* user_data)
/* Sixth column.. Length. */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Length", renderer,
"text", LENGTH_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Length", renderer,
"text", LENGTH_COLUMN,
"foreground", FOREGROUND_COLOR_COL,
"background", BACKGROUND_COLOR_COL,
NULL);
@ -3466,13 +3465,13 @@ static void iax2_analysis_cb(GtkWidget *w _U_, gpointer data _U_)
"You didn't choose a IAX2 packet!");
return;
}
/* check if it is Voice or MiniPacket
/* check if it is Voice or MiniPacket
if (!get_int_value_from_proto_tree(edt->tree, "iax2", "iax2.call", &ptype)) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Please select a Voice packet!");
return;
} */
/* check if it is part of a Call */
if (edt.pi.circuit_id == 0) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,

View File

@ -45,10 +45,8 @@
#include <epan/strutil.h>
#include "../stat_menu.h"
#include "../register.h"
#include "../alert_box.h"
#include "../simple_dialog.h"
#include "../globals.h"
#include "../color.h"
#include "gtk/gtkglobals.h"

View File

@ -40,11 +40,9 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-ldap.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"
@ -162,7 +160,7 @@ gtk_ldapstat_init(const char *optarg, void *userdata _U_)
ldap=g_malloc(sizeof(ldapstat_t));
ldap->win = dlg_window_new("ldap-stat");
ldap->win = dlg_window_new("ldap-stat");
gtk_window_set_destroy_with_parent (GTK_WINDOW(ldap->win), TRUE);
gtk_window_set_default_size(GTK_WINDOW(ldap->win), 550, 400);
ldapstat_set_title(ldap);

View File

@ -47,7 +47,6 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-mac-lte.h>
#include "../register.h"
#include "../simple_dialog.h"
#include "../stat_menu.h"
@ -612,7 +611,7 @@ mac_lte_stat_draw(void *phs)
/* Set each column for this row */
gtk_list_store_set(ues_store, &tmp->iter,
RNTI_COLUMN, tmp->stats.rnti,
RNTI_TYPE_COLUMN,
RNTI_TYPE_COLUMN,
(tmp->stats.rnti_type == C_RNTI) ? "C-RNTI" : "SPS-RNTI",
UEID_COLUMN, tmp->stats.ueid,
UL_FRAMES_COLUMN, tmp->stats.UL_frames,

View File

@ -40,7 +40,6 @@
#include <epan/strutil.h>
#include <epan/timestamp.h>
#include "../globals.h"
#include "../color.h"
#include "../color_filters.h"
#include "../ui_util.h"
@ -424,7 +423,7 @@ packet_list_click_column_cb (GtkCList *clist, gint column, gpointer data)
{
GtkWidget *menu;
gboolean right_justify = right_justify_column (column);
menus_set_column_align_default (right_justify);
menu = g_object_get_data (G_OBJECT(popup_menu_object), PM_PACKET_LIST_COL_KEY);

View File

@ -51,8 +51,6 @@
#include <epan/tap.h>
#include <epan/strutil.h>
#include "../globals.h"
#include "../register.h"
#include "../alert_box.h"
#include "../simple_dialog.h"

View File

@ -44,11 +44,9 @@
#include "epan/gcp.h"
#include <epan/prefs-int.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_stat_util.h"
@ -143,7 +141,7 @@ static const stat_column titles[]={
{G_TYPE_STRING, RIGHT, "Max SRT" },
{G_TYPE_STRING, RIGHT, "Avg SRT" },
{G_TYPE_UINT, RIGHT, "Min in Frame" },
{G_TYPE_UINT, RIGHT, "Max in Frame" }
{G_TYPE_UINT, RIGHT, "Max in Frame" }
};
static void
@ -157,12 +155,12 @@ gtk_megacostat_init(const char *optarg, void *userdata _U_)
megaco_ctx_track = prefs_find_preference(prefs_find_module("megaco"),"ctx_info");
h248_ctx_track = prefs_find_preference(prefs_find_module("h248"),"ctx_info");
if (!*megaco_ctx_track->varp.boolp || !*h248_ctx_track->varp.boolp) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s", "Track Context option at Protocols -> MEGACO and Protocols -> H248 preferences has to be set to true to enable measurement of service reponse times.");
return;
}
ms=g_malloc(sizeof(megacostat_t));
if(strncmp(optarg,"megaco,srt,",11) == 0){

View File

@ -47,7 +47,6 @@
#include "gtk/dissector_tables_dlg.h"
#include "../print.h"
#include "../register.h"
#include "../ui_util.h"
#include "../simple_dialog.h"
#include "../color_filters.h"
@ -544,7 +543,7 @@ static GtkItemFactoryEntry menu_items[] =
* the user can, for example, copy the summaries of multiple
* packets to the clipboard from the packet list pane and multiple
* packet detail items - perhaps *all* packet detail items - from
* the packet detail pane. Given that, we'll also want to
* the packet detail pane. Given that, we'll also want to
* implement Select All.
*
* If multiple packets are selected, we would probably display nothing
@ -2970,7 +2969,7 @@ set_menus_for_selected_packet(capture_file *cf)
/* Allow un-ignore of all frames even with no frames currently displayed */
set_menu_sensitivity(main_menu_factory, "/Edit/Un-Ignore All Packets",
cf->ignored_count > 0);
set_menu_sensitivity(main_menu_factory, "/Edit/Set Time Reference (toggle)",
frame_selected);
set_menu_sensitivity(main_menu_factory, "/Edit/Un-Time Reference All Packets",
@ -2982,7 +2981,7 @@ set_menus_for_selected_packet(capture_file *cf)
another_is_time_ref);
set_menu_sensitivity(main_menu_factory, "/Edit/Find Previous Time Reference",
another_is_time_ref);
set_menu_sensitivity(main_menu_factory, "/View/Resize All Columns",
frame_selected);
set_menu_sensitivity(main_menu_factory, "/View/Collapse All",

View File

@ -41,11 +41,9 @@
#include <epan/tap.h>
#include "epan/dissectors/packet-mgcp.h"
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_stat_util.h"
@ -243,7 +241,7 @@ static const stat_column titles[]={
{G_TYPE_STRING, RIGHT, "Max SRT" },
{G_TYPE_STRING, RIGHT, "Avg SRT" },
{G_TYPE_UINT, RIGHT, "Min in Frame" },
{G_TYPE_UINT, RIGHT, "Max in Frame" }
{G_TYPE_UINT, RIGHT, "Max in Frame" }
};
static void

View File

@ -47,8 +47,6 @@
#include "../stat_menu.h"
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/dlg_utils.h"
@ -123,14 +121,14 @@ GtkWidget* create_list(void)
/* The view now holds a reference. We can get rid of our own reference */
g_object_unref (G_OBJECT (list_store));
/*
/*
* Create the first column packet, associating the "text" attribute of the
* cell_renderer to the first column of the model
* cell_renderer to the first column of the model
*/
/* 1:st column */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("OPC", renderer,
"text", OPC_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("OPC", renderer,
"text", OPC_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, OPC_COLUMN);
@ -143,7 +141,7 @@ GtkWidget* create_list(void)
/* 2:nd column... */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("DPC", renderer,
column = gtk_tree_view_column_new_with_attributes ("DPC", renderer,
"text", DPC_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, DPC_COLUMN);
@ -154,7 +152,7 @@ GtkWidget* create_list(void)
/* 3:d column... */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("SI", renderer,
column = gtk_tree_view_column_new_with_attributes ("SI", renderer,
"text", SI_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, SI_COLUMN);
@ -165,10 +163,10 @@ GtkWidget* create_list(void)
/* 4:th column... */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Num MSUs", renderer,
"text", NUM_MSUS_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Num MSUs", renderer,
"text", NUM_MSUS_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, NUM_MSUS_COLUMN);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -178,8 +176,8 @@ GtkWidget* create_list(void)
/* 5:th column... */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
"text", NUM_BYTES_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Num Bytes", renderer,
"text", NUM_BYTES_COLUMN,
NULL);
gtk_tree_view_column_set_sort_column_id(column, NUM_BYTES_COLUMN);
@ -190,10 +188,10 @@ GtkWidget* create_list(void)
/* 6:th column... */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Avg Bytes", renderer,
"text", AVG_BYTES_COLUMN,
NULL);
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
gtk_tree_view_column_set_cell_data_func(column, renderer, float_data_func,
GINT_TO_POINTER(AVG_BYTES_COLUMN), NULL);
gtk_tree_view_column_set_sort_column_id(column, AVG_BYTES_COLUMN);
@ -318,7 +316,7 @@ mtp3_stat_draw(
dlg.entries[1] = g_strdup(str);
for (j=0; j < MTP3_NUM_SI_CODE; j++){
/* Creates a new row at position. iter will be changed to point to this new row.
/* Creates a new row at position. iter will be changed to point to this new row.
* If position is larger than the number of rows on the list, then the new row will be appended to the list.
* The row will be filled with the values given to this function.
* :

View File

@ -40,11 +40,9 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-ncp-int.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_utils.h"

View File

@ -33,8 +33,6 @@
#include "epan/wslua/init_wslua.h"
#endif
#include "../globals.h"
#include "gtk/dlg_utils.h"
#include "gtk/gui_utils.h"
#include "gtk/plugins_dlg.h"
@ -110,9 +108,9 @@ about_plugins_page_new(void)
GtkWidget *plugins_list;
const gchar *titles[] = {"Name", "Version", "Type"};
scrolledwindow = scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow),
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledwindow),
GTK_SHADOW_IN);
plugins_list = simple_list_new(3 , titles);

View File

@ -33,7 +33,6 @@
#include <epan/prefs.h>
#include "../globals.h"
#include "../simple_dialog.h"
#include "../capture_ifinfo.h"
#include "../capture_ui_utils.h"
@ -363,13 +362,13 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
/* The view now holds a reference. We can get rid of our own reference */
g_object_unref (G_OBJECT (list_store));
/*
/*
* Create the first column packet, associating the "text" attribute of the
* cell_renderer to the first column of the model
* cell_renderer to the first column of the model
*/
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Device", renderer,
"text", DEVICE_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Device", renderer,
"text", DEVICE_COLUMN,
NULL);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -383,8 +382,8 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
gtk_tree_view_append_column (list_view, column);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Description", renderer,
"text", DESC_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Description", renderer,
"text", DESC_COLUMN,
NULL);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -398,7 +397,7 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
* XXX - for some reason, this doesn't show up.
*/
renderer = gtk_cell_renderer_toggle_new ();
column = gtk_tree_view_column_new_with_attributes ("Default to monitor mode", renderer,
column = gtk_tree_view_column_new_with_attributes ("Default to monitor mode", renderer,
"active", DEF_MONITOR_MODE_COLUMN,
NULL);
@ -409,8 +408,8 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
#endif
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Default link-layer", renderer,
"text", DEF_LINK_LAYER_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Default link-layer", renderer,
"text", DEF_LINK_LAYER_COLUMN,
NULL);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -420,8 +419,8 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
gtk_tree_view_append_column (list_view, column);
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Comment", renderer,
"text", COMMENT_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Comment", renderer,
"text", COMMENT_COLUMN,
NULL);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -431,8 +430,8 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
gtk_tree_view_append_column (list_view, column);
renderer = gtk_cell_renderer_toggle_new ();
column = gtk_tree_view_column_new_with_attributes ("Hide?", renderer,
"active", HIDE_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("Hide?", renderer,
"active", HIDE_COLUMN,
NULL);
gtk_tree_view_column_set_resizable(column, FALSE);
@ -443,8 +442,8 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
#if 0
/* Don't show the DLT column */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("DLT", renderer,
"text", DLT_COLUMN,
column = gtk_tree_view_column_new_with_attributes ("DLT", renderer,
"text", DLT_COLUMN,
NULL);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -582,7 +581,7 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
window_set_cancel_button(ifopts_edit_dlg, cancel_bt, window_cancel_button_cb);
help_bt = g_object_get_data(G_OBJECT(bbox), GTK_STOCK_HELP);
g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb),
g_signal_connect(help_bt, "clicked", G_CALLBACK(topic_cb),
(gpointer)HELP_CAPTURE_INTERFACE_OPTIONS_DIALOG);
gtk_tooltips_set_tip (tooltips, help_bt, "Show topic specific help", NULL);
@ -652,7 +651,7 @@ ifopts_edit_destroy_cb(GtkWidget *win, gpointer data _U_)
static gint
ifopts_description_to_val (const char *if_name, gboolean monitor_mode,
const char *descr)
const char *descr)
{
if_capabilities_t *caps;
int dlt = -1;
@ -706,7 +705,7 @@ ifopts_edit_ifsel_cb(GtkTreeSelection *selection _U_,
if (!gtk_tree_selection_get_selected (if_selection, &model, &iter)){
return;
}
gtk_tree_model_get(model, &iter,
gtk_tree_model_get(model, &iter,
DEVICE_COLUMN, &if_name,
DESC_COLUMN, &desc,
#ifdef HAVE_PCAP_CREATE
@ -814,7 +813,7 @@ ifopts_edit_monitor_changed_cb(GtkToggleButton *tbt, gpointer udata)
if (!gtk_tree_selection_get_selected (if_selection, &list_model, &list_iter)){
return;
}
gtk_tree_model_get(list_model, &list_iter,
gtk_tree_model_get(list_model, &list_iter,
DEVICE_COLUMN, &if_name,
-1);
@ -909,8 +908,8 @@ ifopts_edit_linktype_changed_cb(GtkComboBox *cb, gpointer udata)
if (!gtk_tree_selection_get_selected (if_selection, &list_model, &list_iter)){
return;
}
gtk_tree_model_get(list_model, &list_iter,
gtk_tree_model_get(list_model, &list_iter,
DEVICE_COLUMN, &ifnm,
#ifdef HAVE_PCAP_CREATE
DEF_MONITOR_MODE_COLUMN, &monitor_mode,
@ -1297,7 +1296,7 @@ ifopts_write_new_linklayer(void)
/*
* create/cat interface link-layer to new string
* (leave space for parens, comma and terminator)
*/
*/
tmp_linklayer = g_strdup_printf("%s(%d)", ifnm, linktype);
g_strlcat(new_linklayer, tmp_linklayer, MAX_VAL_LEN);
g_free(tmp_linklayer);

View File

@ -31,7 +31,6 @@
#include <epan/prefs.h>
#include "../globals.h"
#include "../simple_dialog.h"
#include "gtk/prefs_gui.h"
@ -58,7 +57,7 @@ static gint fetch_enum_value(gpointer control, const enum_val_t *enumvals);
static gboolean fileopen_dir_changed_cb(GtkWidget *myentry _U_, GdkEvent *event, gpointer parent_w);
static gboolean fileopen_preview_changed_cb(GtkWidget *myentry _U_, GdkEvent *event, gpointer parent_w);
static void fileopen_selected_cb(GtkWidget *mybutton_rb _U_, gpointer parent_w);
static gboolean recent_files_count_changed_cb(GtkWidget *recent_files_entry _U_,
static gboolean recent_files_count_changed_cb(GtkWidget *recent_files_entry _U_,
GdkEvent *event _U_, gpointer parent_w);
static gboolean recent_df_entries_changed_cb(GtkWidget *recent_df_entry _U_,
GdkEvent *event _U_, gpointer parent_w);
@ -201,40 +200,40 @@ gui_prefs_show(void)
/* Packet list selection browseable */
plist_browse_om = create_preference_option_menu(main_tb, pos++,
"Packet list selection mode:",
"Packet list selection mode:",
"Choose to browse or select a packet for detailed dissection.",
selection_mode_vals, prefs.gui_plist_sel_browse);
g_object_set_data(G_OBJECT(main_vb), PLIST_SEL_BROWSE_KEY, plist_browse_om);
/* Proto tree selection browseable */
ptree_browse_om = create_preference_option_menu(main_tb, pos++,
"Protocol tree selection mode:",
"Protocol tree selection mode:",
"Choose to browse or select.",
selection_mode_vals, prefs.gui_ptree_sel_browse);
g_object_set_data(G_OBJECT(main_vb), PTREE_SEL_BROWSE_KEY, ptree_browse_om);
/* Geometry prefs */
save_position_cb = create_preference_check_button(main_tb, pos++,
"Save window position:",
"Save window position:",
"Whether to save the position of the main window.",
prefs.gui_geometry_save_position);
g_object_set_data(G_OBJECT(main_vb), GEOMETRY_POSITION_KEY, save_position_cb);
save_size_cb = create_preference_check_button(main_tb, pos++,
"Save window size:",
"Save window size:",
"Whether to save the size of the main window.",
prefs.gui_geometry_save_size);
g_object_set_data(G_OBJECT(main_vb), GEOMETRY_SIZE_KEY, save_size_cb);
save_maximized_cb = create_preference_check_button(main_tb, pos++,
"Save maximized state:",
"Save maximized state:",
"Whether to save the maximized state of the main window.",
prefs.gui_geometry_save_maximized);
g_object_set_data(G_OBJECT(main_vb), GEOMETRY_MAXIMIZED_KEY, save_maximized_cb);
#if defined(HAVE_IGE_MAC_INTEGRATION) || defined(HAVE_GTKOSXAPPLICATION)
macosx_style_cb = create_preference_check_button(main_tb, pos++,
"Mac OS X style",
"Mac OS X style",
"Whether to create a Mac OS X look and feel. Checking this box will move the "
"menu bar to the top of the screen instead of the top of the Wireshark window. "
"Requires a restart of Wireshark to take effect.",
@ -245,7 +244,7 @@ gui_prefs_show(void)
#ifdef _WIN32
/* How the console window should be opened */
console_open_om = create_preference_option_menu(main_tb, pos++,
"Open a console window",
"Open a console window",
"Whether to open a console window "
"(Automatic will open a console if messages appear).",
gui_console_open_vals, prefs.gui_console_open);
@ -255,13 +254,13 @@ gui_prefs_show(void)
/* Allow user to select where they want the File Open dialog to open to
* by default */
fileopen_rb = create_preference_radio_buttons(main_tb, pos++,
"\"File Open\" dialog behavior:",
"Which directory the \"File Open\" dialog should start with.",
"\"File Open\" dialog behavior:",
"Which directory the \"File Open\" dialog should start with.",
gui_fileopen_vals, prefs.gui_fileopen_style);
/* Directory to default File Open dialog to */
fileopen_dir_te = create_preference_entry(main_tb, pos++,
"Directory:",
fileopen_dir_te = create_preference_entry(main_tb, pos++,
"Directory:",
"The \"File Open\" dialog defaults always to this directory.",
prefs.gui_fileopen_dir);
g_object_set_data(G_OBJECT(main_vb), GUI_FILEOPEN_KEY, fileopen_rb);
@ -272,7 +271,7 @@ gui_prefs_show(void)
/* File Open dialog preview timeout */
fileopen_preview_te = create_preference_entry(main_tb, pos++,
"\"File Open\" preview timeout:",
"\"File Open\" preview timeout:",
"Reading preview data in the \"File Open\" dialog will be stopped after given seconds.",
open_file_preview_str);
g_snprintf(current_val_str, sizeof(current_val_str), "%d", prefs.gui_fileopen_preview);
@ -282,7 +281,7 @@ gui_prefs_show(void)
/* Number of recent entries in the display filter list ... */
recent_df_entries_max_te = create_preference_entry(main_tb, pos++,
"Filter display max. list entries:",
"Filter display max. list entries:",
"Maximum number of recent entries in filter display list.",
recent_df_entries_max_str);
g_snprintf(current_val_str, sizeof(current_val_str), "%d", prefs.gui_recent_df_entries_max);
@ -292,7 +291,7 @@ gui_prefs_show(void)
/* Number of entries in the recent_files list ... */
recent_files_count_max_te = create_preference_entry(main_tb, pos++,
"\"Open Recent\" max. list entries:",
"\"Open Recent\" max. list entries:",
"Maximum number of entries in the \"File/Open Recent\" list.",
recent_files_count_max_str);
g_snprintf(current_val_str, sizeof(current_val_str), "%d", prefs.gui_recent_files_count_max);
@ -311,7 +310,7 @@ gui_prefs_show(void)
/* do we want to wrap when searching for data? */
find_wrap_cb = create_preference_check_button(main_tb, pos++,
"Wrap to end/beginning of file during a find:",
"Wrap to end/beginning of file during a find:",
"Whether a search should wrap in a capture file.",
prefs.gui_find_wrap);
g_object_set_data(G_OBJECT(main_vb), GUI_FIND_WRAP_KEY, find_wrap_cb);
@ -333,7 +332,7 @@ gui_prefs_show(void)
/* Webbrowser */
if (browser_needs_pref()) {
webbrowser_te = create_preference_entry(main_tb, pos++,
webbrowser_te = create_preference_entry(main_tb, pos++,
"Web browser command:",
"Command line to desired browser.",
prefs.gui_webbrowser);
@ -419,21 +418,21 @@ gui_prefs_fetch(GtkWidget *w)
#endif
prefs.gui_fileopen_style = fetch_preference_radio_buttons_val(
g_object_get_data(G_OBJECT(w), GUI_FILEOPEN_KEY), gui_fileopen_vals);
g_free(prefs.gui_fileopen_dir);
prefs.gui_fileopen_dir = g_strdup(gtk_entry_get_text(
GTK_ENTRY(g_object_get_data(G_OBJECT(w), GUI_FILEOPEN_DIR_KEY))));
prefs.gui_ask_unsaved =
prefs.gui_ask_unsaved =
gtk_toggle_button_get_active(g_object_get_data(G_OBJECT(w), GUI_ASK_UNSAVED_KEY));
prefs.gui_find_wrap =
prefs.gui_find_wrap =
gtk_toggle_button_get_active(g_object_get_data(G_OBJECT(w), GUI_FIND_WRAP_KEY));
prefs.gui_use_pref_save =
prefs.gui_use_pref_save =
gtk_toggle_button_get_active(g_object_get_data(G_OBJECT(w), GUI_USE_PREF_SAVE_KEY));
prefs.gui_version_in_start_page =
prefs.gui_version_in_start_page =
gtk_toggle_button_get_active(g_object_get_data(G_OBJECT(w), GUI_SHOW_VERSION_KEY));
if (browser_needs_pref()) {
@ -555,12 +554,12 @@ recent_df_entries_changed_cb(GtkWidget *recent_df_entry _U_,
}
static gboolean
recent_files_count_changed_cb(GtkWidget *recent_files_entry _U_,
recent_files_count_changed_cb(GtkWidget *recent_files_entry _U_,
GdkEvent *event _U_, gpointer parent_w)
{
GtkWidget *recent_files_count_te;
guint newval;
recent_files_count_te = (GtkWidget *)g_object_get_data(G_OBJECT(parent_w), GUI_RECENT_FILES_COUNT_KEY);
/*
@ -580,12 +579,12 @@ recent_files_count_changed_cb(GtkWidget *recent_files_entry _U_,
}
static gboolean
fileopen_preview_changed_cb(GtkWidget *recent_files_entry _U_,
fileopen_preview_changed_cb(GtkWidget *recent_files_entry _U_,
GdkEvent *event _U_, gpointer parent_w)
{
GtkWidget *fileopen_preview_te;
guint newval;
fileopen_preview_te = (GtkWidget *)g_object_get_data(G_OBJECT(parent_w), GUI_FILEOPEN_PREVIEW_KEY);
/*
@ -610,7 +609,7 @@ fileopen_dir_changed_cb(GtkWidget *fileopen_entry _U_, GdkEvent *event _U_, gpoi
GtkWidget *fileopen_dir_te;
char *lastchar;
gint fileopen_dir_te_length;
fileopen_dir_te = (GtkWidget *)g_object_get_data(G_OBJECT(parent_w), GUI_FILEOPEN_DIR_KEY);
fileopen_dir_te_length = (gint) strlen(gtk_entry_get_text (GTK_ENTRY(fileopen_entry)));
if (fileopen_dir_te_length == 0)
@ -628,10 +627,10 @@ static void
fileopen_selected_cb(GtkWidget *mybutton_rb _U_, gpointer parent_w)
{
GtkWidget *fileopen_rb, *fileopen_dir_te;
fileopen_rb = (GtkWidget *)g_object_get_data(G_OBJECT(parent_w), GUI_FILEOPEN_KEY);
fileopen_dir_te = (GtkWidget *)g_object_get_data(G_OBJECT(parent_w), GUI_FILEOPEN_DIR_KEY);
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(fileopen_rb)))
{
gtk_widget_set_sensitive(GTK_WIDGET(fileopen_dir_te), TRUE);

View File

@ -30,7 +30,6 @@
#include <epan/prefs.h>
#include "../globals.h"
#include "../ui_util.h"
#include "gtk/prefs_layout.h"
@ -235,7 +234,7 @@ static void layout_validate_cb(GtkWidget *w _U_, gpointer data) {
static void
layout_defaults_cb (GtkWidget * w _U_, gpointer data)
{
layout_t default_layout = {
layout_t default_layout = {
layout_type_5,
{
layout_pane_content_plist,
@ -370,7 +369,7 @@ layout_prefs_show(void)
default_vb = gtk_vbox_new(FALSE, 0);
default_bt = gtk_button_new_with_label("Default panes");
gtk_tooltips_set_tip (tooltips, default_bt,
gtk_tooltips_set_tip (tooltips, default_bt,
"Reset the pane layout settings to default values.", NULL);
g_signal_connect(default_bt, "clicked", G_CALLBACK(layout_defaults_cb), main_vb);
gtk_box_pack_end(GTK_BOX(default_vb), default_bt, FALSE, FALSE, 0);
@ -390,7 +389,7 @@ layout_prefs_show(void)
/* Scrollbar placement */
scrollbar_om = create_preference_option_menu(main_tb, pos++,
"Vertical scrollbar placement:",
"Vertical scrollbar placement:",
"Select where the vertical scrollbar will be displayed in the panes.",
scrollbar_placement_vals, prefs.gui_scrollbar_on_right);
g_object_set_data(G_OBJECT(main_vb), SCROLLBAR_PLACEMENT_KEY, scrollbar_om);
@ -404,21 +403,21 @@ layout_prefs_show(void)
/* Packet Bytes Dump highlight style */
highlight_style_om = create_preference_option_menu(main_tb, pos++,
"Packet bytes highlight style:",
"Packet bytes highlight style:",
"Select the style in which the packet bytes dump will be displayed.",
highlight_style_vals, prefs.gui_hex_dump_highlight_style);
g_object_set_data(G_OBJECT(main_vb), HEX_DUMP_HIGHLIGHT_STYLE_KEY, highlight_style_om);
/* Toolbar prefs */
toolbar_style_om = create_preference_option_menu(main_tb, pos++,
"Toolbar style:",
"Toolbar style:",
"Select the style in which the toolbar will be displayed.",
toolbar_style_vals, prefs.gui_toolbar_main_style);
g_object_set_data(G_OBJECT(main_vb), GUI_TOOLBAR_STYLE_KEY, toolbar_style_om);
/* Filter toolbar prefs */
filter_toolbar_style_om = create_preference_option_menu(main_tb, pos++,
"Filter toolbar style:",
"Filter toolbar style:",
"Select the style in which the filter toolbar will be displayed.",
toolbar_style_vals, prefs.gui_toolbar_filter_style);
g_object_set_data(G_OBJECT(main_vb), GUI_FILTER_TOOLBAR_STYLE_KEY, filter_toolbar_style_om);
@ -432,7 +431,7 @@ layout_prefs_show(void)
/* Window title */
window_title_te = create_preference_entry(main_tb, pos++,
"Custom window title (appended to existing titles):",
"Custom window title (appended to existing titles):",
"Enter the text to be appended to the window title.",
prefs.gui_window_title);
gtk_entry_set_text(GTK_ENTRY(window_title_te), prefs.gui_window_title);

View File

@ -33,8 +33,6 @@
#include <epan/uat.h>
#include <epan/oids.h>
#include "../globals.h"
#include "gtk/prefs_nameres.h"
#include "gtk/gtkglobals.h"
#include "gtk/prefs_dlg.h"

View File

@ -31,7 +31,6 @@
#include <epan/prefs.h>
#include "../globals.h"
#include "../print.h"
#include "../util.h"

View File

@ -31,7 +31,6 @@
#include <epan/prefs.h>
#include "../color.h"
#include "../globals.h"
#include "../print.h"
#include "gtk/color_utils.h"
@ -72,7 +71,7 @@ stream_prefs_show()
GtkWidget *main_vb, *main_tb, *label, *combo_box;
GtkWidget *sample, *colorsel;
int width, height, i;
const gchar *mt[] = {
const gchar *mt[] = {
"Marked packet foreground", /* MFG_IDX 0*/
"Marked packet background", /* MBG_IDX 1*/
"Ignored packet foreground", /* IFG_IDX 2*/

View File

@ -34,7 +34,6 @@
#include <epan/epan_dissect.h>
#include <epan/filesystem.h>
#include "../globals.h"
#include "../print.h"
#include "../alert_box.h"
#include "../simple_dialog.h"

View File

@ -34,7 +34,6 @@
#include <epan/prefs.h>
#include <epan/filesystem.h>
#include "../globals.h"
#include "../util.h"
#include "../simple_dialog.h"
#include "../disabled_protos.h"
@ -122,7 +121,7 @@ proto_cb(GtkWidget *w _U_, gpointer data _U_)
gtk_widget_show(proto_vb);
proto_sw = scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(proto_sw),
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(proto_sw),
GTK_SHADOW_IN);
gtk_box_pack_start(GTK_BOX(proto_vb), proto_sw, TRUE, TRUE, 0);
gtk_widget_show(proto_sw);

View File

@ -41,11 +41,9 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-radius.h>
#include "../register.h"
#include "../timestats.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "gtk/gui_stat_util.h"

View File

@ -46,7 +46,6 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-rlc-lte.h>
#include "../register.h"
#include "../simple_dialog.h"
#include "../stat_menu.h"
@ -160,7 +159,7 @@ typedef struct rlc_lte_common_stats {
typedef struct rlc_lte_ep {
struct rlc_lte_ep* next;
struct rlc_lte_row_data stats;
GtkTreeIter iter;
GtkTreeIter iter;
gboolean iter_valid;
} rlc_lte_ep_t;

View File

@ -43,7 +43,6 @@
#include <epan/dissectors/packet-rpc.h>
#include "../stat_menu.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"

View File

@ -44,8 +44,6 @@
#include "../stat_menu.h"
#include "../simple_dialog.h"
#include "../register.h"
#include "../globals.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/gui_utils.h"

View File

@ -63,7 +63,6 @@
#include <epan/strutil.h>
#include "../util.h"
#include "../register.h"
#include "../g711.h"
#include "../alert_box.h"
#include "../simple_dialog.h"
@ -993,7 +992,7 @@ static void dialog_graph_draw(user_data_t* user_data)
/*
* Calculate size of borders surrounding the plot
* The border on the right side needs to be adjusted depending
* on the width of the text labels.
* on the width of the text labels.
*/
print_time_scale_string(label_string, sizeof(label_string), max_y);
layout = gtk_widget_create_pango_layout(user_data->dlg.dialog_graph.draw_area, label_string);

View File

@ -48,7 +48,6 @@
#include <epan/addr_resolv.h>
#include "../globals.h"
#include "../register.h"
#include "../alert_box.h"
#include "../simple_dialog.h"
#include "../tap-rtp-common.h"
@ -59,9 +58,9 @@
#include "gtk/main.h"
/* The one and only global rtpstream_tapinfo_t structure for tshark and wireshark.
*/
static rtpstream_tapinfo_t the_tapinfo_struct =
{0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, 0, FALSE};
*/
static rtpstream_tapinfo_t the_tapinfo_struct =
{0, NULL, 0, TAP_ANALYSE, NULL, NULL, NULL, 0, FALSE};
/****************************************************************************/

View File

@ -6,23 +6,23 @@
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* 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.
*/
/* This module provides rpc call/reply SRT (Server Response Time) statistics
/* This module provides rpc call/reply SRT (Server Response Time) statistics
* to Wireshark.
*/
@ -49,7 +49,6 @@
#include "../simple_dialog.h"
#include "../globals.h"
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/gui_utils.h"
@ -139,7 +138,7 @@ scsistat_program_select(GtkWidget *w, gpointer key _U_)
default:
scsi_program = SCSI_DEV_SBC;
break;
}
}
}
static int
@ -266,7 +265,7 @@ gtk_scsistat_init(const char *optarg, void* userdata _U_)
vbox=gtk_vbox_new(FALSE, 3);
gtk_container_add(GTK_CONTAINER(rs->win), vbox);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
title_string = scsistat_gen_title(rs);
stat_label=gtk_label_new(title_string);
g_free(title_string);

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright 2004, Irene Ruengeler <i.ruengeler [AT] fh-muenster.de>
*
* $Id$
@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@ -36,7 +36,6 @@
#include "../globals.h"
#include "../simple_dialog.h"
#include "../stat_menu.h"
#include "../register.h"
#include "gtk/gui_stat_menu.h"
#include "gtk/dlg_utils.h"
@ -101,7 +100,7 @@ on_destroy(GtkObject *object _U_, gpointer user_data)
g_list_free(u_data->children);
u_data->children = NULL;
}
g_free(u_data->analyse_nb->page2);
g_free(u_data->analyse_nb->page3);
g_free(u_data->analyse_nb);
@ -149,7 +148,7 @@ static void on_close_dlg(GtkWidget *widget _U_, struct sctp_analyse* u_data)
static void on_chunk1_dlg(GtkWidget *widget _U_, struct sctp_analyse* u_data)
{
sctp_assoc_info_t* assinfo = NULL;
assinfo = g_malloc(sizeof(sctp_assoc_info_t));
assinfo = &static_assoc;
assinfo->addr_chunk_count = (static_assoc.addr_chunk_count);
@ -163,7 +162,7 @@ sctp_assoc_info_t* assinfo=NULL;
assinfo = g_malloc(sizeof(sctp_assoc_info_t));
assinfo = &static_assoc;
assinfo->addr_chunk_count = (static_assoc.addr_chunk_count);
assinfo->addr_chunk_count = (static_assoc.addr_chunk_count);
u_data->assoc = assinfo;
sctp_chunk_stat_dlg_show(2, u_data);
}
@ -198,13 +197,13 @@ update_analyse_dlg(struct sctp_analyse* u_data)
address *store = NULL;
GtkListStore *list_store = NULL;
GtkTreeIter iter;
if (u_data->assoc == NULL)
return;
if (u_data->window != NULL)
{
gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW
gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW
(u_data->analyse_nb->page2->clist))));
gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW
(u_data->analyse_nb->page3->clist))));
@ -253,7 +252,7 @@ update_analyse_dlg(struct sctp_analyse* u_data)
g_snprintf(field[0], 30, "%s", ip_to_str((const guint8 *)(store->data)));
}
else if (store->type == AT_IPv6)
{
{
g_snprintf(field[0], 40, "%s", ip6_to_str((const struct e_in6_addr *)(store->data)));
}
list_store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW (u_data->analyse_nb->page2->clist))); /* Get store */
@ -376,7 +375,7 @@ sctp_set_filter (GtkButton *button _U_, struct sctp_analyse* u_data)
sctp_assoc_info_t *selected_stream;
gchar *filter_string = NULL;
selected_stream=u_data->assoc;
if (selected_stream->check_address==FALSE)
{
f_string = g_strdup_printf("((sctp.srcport==%u && sctp.dstport==%u && ((sctp.verification_tag==0x%x && sctp.verification_tag!=0x0) || "
@ -458,7 +457,7 @@ sctp_set_filter (GtkButton *button _U_, struct sctp_analyse* u_data)
filter_string = gstring->str;
g_string_free(gstring,FALSE);
}
if (filter_string != NULL) {
gtk_entry_set_text(GTK_ENTRY(main_display_filter_widget), filter_string);
} else {
@ -469,7 +468,7 @@ sctp_set_filter (GtkButton *button _U_, struct sctp_analyse* u_data)
static void analyse_window_set_title(struct sctp_analyse *u_data)
{
char *title;
if(!u_data->window){
return;
}
@ -488,8 +487,8 @@ GtkWidget *create_list(void)
GtkTreeView *list_view;
list_store = gtk_list_store_new(1,
G_TYPE_STRING /* IP address */
);
);
/* Create a view */
list = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
@ -503,13 +502,13 @@ GtkWidget *create_list(void)
/* The view now holds a reference. We can get rid of our own reference */
g_object_unref (G_OBJECT (list_store));
/*
/*
* Create the first column packet, associating the "text" attribute of the
* cell_renderer to the first column of the model
* cell_renderer to the first column of the model
*/
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Address", renderer,
"text", 0,
column = gtk_tree_view_column_new_with_attributes ("Address", renderer,
"text", 0,
NULL);
gtk_tree_view_column_set_resizable(column, TRUE);
@ -518,7 +517,7 @@ GtkWidget *create_list(void)
/* Add the column to the view. */
gtk_tree_view_append_column (list_view, column);
gtk_tree_view_set_headers_visible(list_view, FALSE);
return list;
}
@ -696,7 +695,7 @@ static void create_analyse_window(struct sctp_analyse* u_data)
gtk_button_box_set_layout(GTK_BUTTON_BOX (h_button_box), GTK_BUTTONBOX_SPREAD);
gtk_box_set_spacing(GTK_BOX (h_button_box), 0);
gtk_widget_show(h_button_box);
chunk_bt1 = gtk_button_new_with_label("Chunk Statistics");
gtk_box_pack_start(GTK_BOX(h_button_box), chunk_bt1, FALSE, FALSE, 0);
gtk_widget_show(chunk_bt1);
@ -741,7 +740,7 @@ static void create_analyse_window(struct sctp_analyse* u_data)
gtk_widget_set_size_request(u_data->analyse_nb->page3->scrolled_window, 560, 100);
u_data->analyse_nb->page3->clist = create_list();
gtk_widget_show(u_data->analyse_nb->page3->clist);
gtk_widget_show(u_data->analyse_nb->page3->clist);
gtk_container_add(GTK_CONTAINER(u_data->analyse_nb->page3->scrolled_window),
u_data->analyse_nb->page3->clist);
@ -758,7 +757,7 @@ static void create_analyse_window(struct sctp_analyse* u_data)
vbox_l = gtk_vbox_new(FALSE, 3);
gtk_box_pack_start(GTK_BOX(hbox), vbox_l, TRUE, TRUE, 0);
hbox_l1 = gtk_hbox_new(FALSE,3);
gtk_box_pack_start(GTK_BOX(vbox_l), hbox_l1, TRUE, TRUE, 0);
@ -783,7 +782,7 @@ static void create_analyse_window(struct sctp_analyse* u_data)
gtk_misc_set_alignment (GTK_MISC(u_data->analyse_nb->page3->max_in),0,0);
u_data->analyse_nb->page3->min_in = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(vbox_r), u_data->analyse_nb->page3->min_in, TRUE, TRUE, 0);
gtk_misc_set_alignment (GTK_MISC(u_data->analyse_nb->page3->min_in),0,0);
gtk_misc_set_alignment (GTK_MISC(u_data->analyse_nb->page3->min_in),0,0);
u_data->analyse_nb->page3->max_out = gtk_label_new("");
gtk_box_pack_start(GTK_BOX(vbox_r), u_data->analyse_nb->page3->max_out, TRUE, TRUE, 0);
@ -800,12 +799,12 @@ static void create_analyse_window(struct sctp_analyse* u_data)
gtk_button_box_set_layout(GTK_BUTTON_BOX (h_button_box), GTK_BUTTONBOX_SPREAD);
gtk_box_set_spacing(GTK_BOX (h_button_box), 0);
gtk_widget_show(h_button_box);
chunk_bt1 = gtk_button_new_with_label("Chunk Statistics");
gtk_box_pack_start(GTK_BOX(h_button_box), chunk_bt1, FALSE, FALSE, 0);
gtk_widget_show(chunk_bt1);
g_signal_connect(chunk_bt1, "clicked", G_CALLBACK(on_chunk2_dlg), u_data);
graph_bt1 = gtk_button_new_with_label("Graph TSN");
gtk_box_pack_start(GTK_BOX(h_button_box), graph_bt1, FALSE, FALSE, 0);
gtk_widget_show(graph_bt1);
@ -986,7 +985,7 @@ void sctp_analyse_start(GtkWidget *w _U_, gpointer data _U_)
if (sctp_stat_get_info()->is_registered == FALSE)
register_tap_listener_sctp_stat();
/* (redissect all packets) */
sctp_stat_scan();
u_data = g_malloc(sizeof(struct sctp_analyse));

View File

@ -42,7 +42,6 @@
#include <epan/tap.h>
#include <epan/dissectors/packet-sctp.h>
#include "../register.h"
#include "../simple_dialog.h"
#include "../file.h"
#include "../globals.h"

View File

@ -37,8 +37,6 @@
#include <epan/strutil.h>
#include "../simple_dialog.h"
#include "../globals.h"
#include "../register.h"
#include "gtk/dlg_utils.h"
#include "gtk/sctp_stat.h"
@ -280,9 +278,9 @@ static sctp_assoc_info_t *calc_checksum(struct _sctp_info *check_data, sctp_asso
}
/* XXX: Some versions of gcc warn about "breaking strict aliasing rules"
/* XXX: Some versions of gcc warn about "breaking strict aliasing rules"
for 'a' in the following (given the way this function is called).
As a workaround we'll define the function parameters to match
As a workaround we'll define the function parameters to match
how this function is actually called. */
/*******
static gint sctp_assoc_vtag_cmp(gconstpointer aa, gconstpointer bb)
@ -460,7 +458,7 @@ static sctp_assoc_info_t * add_chunk_count(address * vadd, sctp_assoc_info_t * i
{
v = (address *) (ch->addr);
if (ADDRESSES_EQUAL(vadd, v))
{
{
if (IS_SCTP_CHUNK_TYPE(type))
ch->addr_count[type]++;
else
@ -490,7 +488,7 @@ static sctp_assoc_info_t * add_chunk_count(address * vadd, sctp_assoc_info_t * i
ch->addr_count[type]++;
else
ch->addr_count[OTHER_CHUNKS_INDEX]++;
info->addr_chunk_count = g_list_append(info->addr_chunk_count, ch);
return info;
}
@ -592,7 +590,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
tmp_info.dst.type = AT_NONE;
tmp_info.dst.len = 0;
}
addr = g_malloc(tmp_info.dst.len);
memcpy(addr, sctp_info->ip_dst.data, tmp_info.dst.len);
tmp_info.dst.data = addr;
@ -780,7 +778,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
info->initack = TRUE;
}
idx = tvb_get_guint8(sctp_info->tvb[0],0);
idx = tvb_get_guint8(sctp_info->tvb[0],0);
if (!IS_SCTP_CHUNK_TYPE(idx))
idx = OTHER_CHUNKS_INDEX;
@ -805,7 +803,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
}
for (chunk_number = 0; chunk_number < sctp_info->number_of_tvbs; chunk_number++)
{
idx = tvb_get_guint8(sctp_info->tvb[0],0);
idx = tvb_get_guint8(sctp_info->tvb[0],0);
if (!IS_SCTP_CHUNK_TYPE(idx))
idx = OTHER_CHUNKS_INDEX;
@ -1052,7 +1050,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
/*info->initack_dir=1;*/
info->tsn1 = g_list_prepend(info->tsn1, tsn);
}
idx = tvb_get_guint8(sctp_info->tvb[0],0);
if (!IS_SCTP_CHUNK_TYPE(idx))
idx = OTHER_CHUNKS_INDEX;
@ -1141,7 +1139,7 @@ packet(void *tapdata _U_, packet_info *pinfo , epan_dissect_t *edt _U_ , const v
tsn_s->offset = 0;
tsn_s->framenumber = framenumber;
tsn_s->length = length;
if (tsn->secs < info->min_secs)
{
info->min_secs = tsn->secs;

View File

@ -33,7 +33,6 @@
#include "epan/packet_info.h"
#include "../simple_dialog.h"
#include "../globals.h"
#include "gtk/service_response_time_table.h"
#include "gtk/filter_utils.h"
@ -306,7 +305,7 @@ static const char *ui_desc_service_resp_t_filter_popup =
" </popup>\n"
"</ui>\n";
/*
/*
* GtkActionEntry
* typedef struct {
* const gchar *name;
@ -316,15 +315,15 @@ static const char *ui_desc_service_resp_t_filter_popup =
* const gchar *tooltip;
* GCallback callback;
* } GtkActionEntry;
* const gchar *name; The name of the action.
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
* const gchar *label; The label for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* If label is NULL, the label of the stock item with id stock_id is used.
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* GCallback callback; The function to call when the action is activated.
* const gchar *name; The name of the action.
* const gchar *stock_id; The stock id for the action, or the name of an icon from the icon theme.
* const gchar *label; The label for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* If label is NULL, the label of the stock item with id stock_id is used.
* const gchar *accelerator; The accelerator for the action, in the format understood by gtk_accelerator_parse().
* const gchar *tooltip; The tooltip for the action. This field should typically be marked for translation,
* see gtk_action_group_set_translation_domain().
* GCallback callback; The function to call when the action is activated.
*
*/
static const GtkActionEntry service_resp_t__popup_entries[] = {
@ -374,24 +373,24 @@ srt_create_popup_menu(srt_stat_table *rst)
GtkActionGroup *action_group;
GError *error = NULL;
action_group = gtk_action_group_new ("ServiceRespTFilterPopupActionGroup");
action_group = gtk_action_group_new ("ServiceRespTFilterPopupActionGroup");
gtk_action_group_add_actions (action_group, /* the action group */
service_resp_t__popup_entries, /* an array of action descriptions */
G_N_ELEMENTS(service_resp_t__popup_entries),/* the number of entries */
rst); /* data to pass to the action callbacks */
ui_manager = gtk_ui_manager_new ();
gtk_ui_manager_insert_action_group (ui_manager,
action_group,
gtk_ui_manager_insert_action_group (ui_manager,
action_group,
0); /* the position at which the group will be inserted */
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_service_resp_t_filter_popup, -1, &error);
if (error != NULL)
{
fprintf (stderr, "Warning: building service responce time filter popup failed: %s\n",
error->message);
g_error_free (error);
error = NULL;
}
gtk_ui_manager_add_ui_from_string (ui_manager,ui_desc_service_resp_t_filter_popup, -1, &error);
if (error != NULL)
{
fprintf (stderr, "Warning: building service responce time filter popup failed: %s\n",
error->message);
g_error_free (error);
error = NULL;
}
rst->menu = gtk_ui_manager_get_widget(ui_manager, "/ServiceRespTFilterPopup");
g_signal_connect(rst->table, "button_press_event", G_CALLBACK(srt_show_popup_menu_cb), rst);
#endif /* SERVICE_RESP_USE_GUIMANAGER */

Some files were not shown because too many files have changed in this diff Show More