Remove file_dlg_win32.c and print_win32.c from the checkapi target.
[obnox/wireshark/wip.git] / gtk / conversations_jxta.c
1 /* conversations_jxta.c
2  * conversations_jxta  copyright (c) 2005 Mike Duigou <bondolo@jxta.org>
3  * copied from conversations_sctp.c
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 # include "config.h"
28 #endif
29
30 #ifdef HAVE_SYS_TYPES_H
31 # include <sys/types.h>
32 #endif
33 #include <string.h>
34
35 #include <gtk/gtk.h>
36
37 #include <epan/packet.h>
38 #include <epan/stat_cmd_args.h>
39 #include <epan/tap.h>
40 #include <epan/dissectors/packet-jxta.h>
41
42 #include "../stat_menu.h"
43
44 #include "gtk/gui_stat_menu.h"
45 #include "gtk/conversations_table.h"
46
47
48 static int
49 jxta_conversation_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip)
50 {
51         const jxta_tap_header *jxtahdr = (const jxta_tap_header *) vip;
52
53         add_conversation_table_data((conversations_table *)pct,
54                 &jxtahdr->src_address,
55                 &jxtahdr->dest_address,
56                 0,
57                 0,
58                 1,
59                 jxtahdr->size,
60                NULL,
61                 SAT_JXTA,
62                 PT_NONE);
63
64
65         return 1;
66 }
67
68 static void
69 jxta_conversation_init(const char *optarg, void* userdata _U_)
70 {
71         const char *filter=NULL;
72
73         if(!strncmp(optarg,"conv,jxta,",10)){
74                 filter=optarg+10;
75         } else {
76                 filter=NULL;
77         }
78
79         init_conversation_table(TRUE, "JXTA", "jxta", filter, jxta_conversation_packet);
80
81 }
82
83
84 static void
85 jxta_conversation_cb(GtkWidget *w _U_, gpointer d _U_)
86 {
87         jxta_conversation_init("conv,jxta",NULL);
88 }
89
90
91 void
92 register_tap_listener_jxta_conversation(void)
93 {
94         register_stat_cmd_arg("conv,jxta", jxta_conversation_init,NULL);
95
96         register_stat_menu_item("JXTA", REGISTER_STAT_GROUP_CONVERSATION_LIST,
97             jxta_conversation_cb, NULL, NULL, NULL);
98
99         register_conversation_table(TRUE, "JXTA", "jxta", NULL /*filter*/, jxta_conversation_packet);
100 }