2 * Graphic Analysis addition for Wireshark
6 * Copyright 2004, Verso Technologies Inc.
7 * By Alejandro Vaquero <alejandrovaquero@yahoo.com>
9 * based on rtp_analysis.c and io_stat
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
31 #ifndef __GRAPH_ANALYSIS_H__
32 #define __GRAPH_ANALYSIS_H__
36 #include <epan/address.h>
37 #include <ui/tap-sequence-analysis.h>
39 /** max number of nodes to display, each node will be an IP address */
40 #define MAX_NUM_COL_CONV 10
41 #define NUM_DISPLAY_ITEMS 1000
43 typedef struct _display_items
{
44 frame_data
*fd
; /**< Holds the frame number and time information */
47 gchar
*frame_label
; /**< the label on top of the arrow */
48 gchar
*time_str
; /**< timestamp */
49 gchar
*comment
; /**< a comment that appears at the right of the graph */
50 guint16 conv_num
; /**< the conversation number, each conversation will be colored */
51 guint16 src_node
; /**< this is used by graph_analysis.c to identify the node */
52 guint16 dst_node
; /**< a node is an IP address that will be displayed in columns */
53 guint16 line_style
; /**< the arrow line width in pixels*/
56 typedef struct _graph_analysis_dialog_data_t
{
59 gboolean needs_redraw
;
60 gboolean inverse
; /**< set the nodes in reverse mode as "dst <---- src" instead of "src ----> dst"*/
62 GtkWidget
*draw_area_time
;
64 GtkWidget
*draw_area_comments
;
65 #if GTK_CHECK_VERSION(2,22,0)
66 cairo_surface_t
*surface_time
;
67 cairo_surface_t
*surface_main
;
68 cairo_surface_t
*surface_comments
;
69 cairo_surface_t
*surface_tile_select
;
71 GdkPixmap
*pixmap_time
;
72 GdkPixmap
*pixmap_main
;
73 GdkPixmap
*pixmap_comments
;
74 GdkPixmap
*pixmap_tile_select
;
76 GtkWidget
*scroll_window
;
77 GtkWidget
*scroll_window_time
; /**< to enable mouse scroll from this area */
78 GtkWidget
*scroll_window_comments
; /**< to enable mouse scroll from this area */
79 GtkWidget
*v_scrollbar
;
80 GtkAdjustment
*v_scrollbar_adjustment
;
84 guint16 first_node
; /**< the first node on the left to show in the screen */
85 guint32 first_item
; /**< the first item (row) to show from the top */
86 guint32 last_item
; /**< the last item displayed (for correct mouse scroll handling) */
87 guint32 selected_item
; /**< the selected item */
88 display_items_t items
[NUM_DISPLAY_ITEMS
];
89 guint32 left_x_border
;
90 char *title
; /**< Graph analysis window's title */
91 } graph_analysis_dialog_data_t
;
93 typedef void (*destroy_user_data_cb
)(void *data
);
95 /** structure that holds general information and the dialog */
96 typedef struct _graph_analysis_data_t
{
98 seq_analysis_info_t
*graph_info
;
100 /**> dialog associated data */
101 graph_analysis_dialog_data_t dlg
;
103 destroy_user_data_cb on_destroy_user_data
; /**< callback info for destroy */
104 void *data
; /**< data to be passes when on destroy */
105 } graph_analysis_data_t
;
107 graph_analysis_data_t
* graph_analysis_init(seq_analysis_info_t
*sainfo
);
108 void graph_analysis_create(graph_analysis_data_t
* user_data
);
109 void graph_analysis_update(graph_analysis_data_t
* user_data
);
110 void graph_analysis_redraw(graph_analysis_data_t
* user_data
);
113 #endif /* __GRAPH_ANALYSIS_H__ */