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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #ifndef __GRAPH_ANALYSIS_H__
32 #define __GRAPH_ANALYSIS_H__
36 #include <epan/address.h>
38 #define MAX_NUM_NODES 10
40 /* defines an entry in for the graph analysis */
41 typedef struct _graph_analysis_item {
42 guint32 frame_num; /* frame number used to "go to" that frame */
43 double time; /* frame time */
48 gchar *frame_label; /* the label on top of the arrow */
49 gchar *comment; /* a comment that appears at the left of the graph */
50 guint16 conv_num; /* the conversation number, each conversation will be colored */
51 gboolean display; /* indicate if the packet is displayed or not in the graph */
52 guint16 src_node; /* this is used by graph_analysis.c to identify the node */
53 guint16 dst_node; /* a node is an IP address that will be displayed in columns */
54 guint16 line_style; /* the arrow line width in pixels*/
55 } graph_analysis_item_t;
57 /* defines the graph analysis structure */
58 typedef struct _graph_analysis_info {
59 int nconv; /* number of conversations in the list */
60 GList* list; /* list with the graph analysis items */
61 } graph_analysis_info_t;
63 /* max number of nodes to display, each node will be an IP address */
64 #define MAX_NUM_COL_CONV 10
65 #define NODE_OVERFLOW MAX_NUM_NODES+1
66 #define NUM_DISPLAY_ITEMS 1000
68 typedef struct _display_items {
69 guint32 frame_num; /* frame number used to "go to" that frame */
70 double time; /* frame time */
73 gchar *frame_label; /* the label on top of the arrow */
74 gchar *comment; /* a comment that appears at the left of the graph */
75 guint16 conv_num; /* the conversation number, each conversation will be colored */
76 guint16 src_node; /* this is used by graph_analysis.c to identify the node */
77 guint16 dst_node; /* a node is an IP address that will be displayed in columns */
78 guint16 line_style; /* the arrow line width in pixels*/
81 typedef struct _graph_analysis_dialog_data_t {
84 gboolean needs_redraw;
85 gboolean inverse; /* set the nodes in reverse mode as "dst <---- src" instead of "src ----> dst"*/
87 GtkWidget *draw_area_time;
89 GtkWidget *draw_area_comments;
90 GdkPixmap *pixmap_time;
91 GdkPixmap *pixmap_main;
92 GdkPixmap *pixmap_comments;
93 GdkPixmap *pixmap_tile_select;
94 GtkWidget *scroll_window;
95 GtkWidget *v_scrollbar;
96 GtkAdjustment *v_scrollbar_adjustment;
98 GdkGC *div_line_gc[2];
99 GdkGC *bg_gc[MAX_NUM_COL_CONV+1];
102 guint16 first_node; /* the first node on the left to show in the screen */
103 guint32 first_item; /* the first item (row) to show from the top */
104 guint32 selected_item; /* the selected item */
105 display_items_t items[NUM_DISPLAY_ITEMS];
106 guint32 left_x_border;
108 char *title; /* Graph analysis window's title */
109 } graph_analysis_dialog_data_t;
111 typedef void (*destroy_user_data_cb)(void *data);
113 /* structure that holds general information and the dialog */
114 typedef struct _graph_analysis_data_t {
116 graph_analysis_info_t *graph_info;
118 /* dialog associated data */
119 graph_analysis_dialog_data_t dlg;
120 address nodes[MAX_NUM_NODES];
123 destroy_user_data_cb on_destroy_user_data; /* callback info for destroy */
124 void *data; /* data to be passes when on destroy */
125 } graph_analysis_data_t;
127 graph_analysis_data_t* graph_analysis_init(void);
128 void graph_analysis_create(graph_analysis_data_t* user_data);
129 void graph_analysis_update(graph_analysis_data_t* user_data);
130 void graph_analysis_redraw(graph_analysis_data_t* user_data);
133 #endif /* __GRAPH_ANALYSIS_H__ */