2 * hostlist_rsvp.c August 2005, Manu Pathak <mapathak@cisco.com>
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #ifdef HAVE_SYS_TYPES_H
30 # include <sys/types.h>
35 #include "epan/packet.h"
36 #include <epan/stat_cmd_args.h>
37 #include "../stat_menu.h"
38 #include "gui_stat_menu.h"
40 #include "../register.h"
41 #include "hostlist_table.h"
42 #include <epan/dissectors/packet-rsvp.h>
46 rsvp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
48 hostlist_table *hosts=(hostlist_table *)pit;
49 const rsvp_conversation_info *rsvph = vip;
51 /* Take two "add" passes per packet, adding for each direction, ensures
52 * that all packets are counted properly (even if address is sending to
53 * itself). XXX - this could probably be done more efficiently inside
56 add_hostlist_table_data(hosts, &rsvph->source, 0, TRUE, 1,
57 pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
58 add_hostlist_table_data(hosts, &rsvph->destination, 0, FALSE, 1,
59 pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
64 gtk_rsvp_hostlist_init(const char *optarg, void* userdata _U_)
66 const char *filter=NULL;
68 if(!strncmp(optarg,"hosts,rsvp,",11)){
74 init_hostlist_table(TRUE, "RSVP Hosts", "rsvp", filter,
75 rsvp_hostlist_packet);
81 gtk_rsvp_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
83 gtk_rsvp_hostlist_init("hosts,rsvp",NULL);
88 register_tap_listener_rsvp_hostlist(void)
90 register_stat_cmd_arg("hosts,rsvp", gtk_rsvp_hostlist_init,NULL);
92 register_stat_menu_item("RSVP", REGISTER_STAT_GROUP_ENDPOINT_LIST,
93 gtk_rsvp_hostlist_cb, NULL, NULL, NULL);
95 register_hostlist_table(TRUE, "RSVP", "rsvp", NULL /*filter*/,
96 rsvp_hostlist_packet);