The table containing payload types and payload dissectors are now sparse
[obnox/wireshark/wip.git] / gtk / hostlist_tr.c
index 5149f77f699426a71e2e971b4e259710a66bfd1a..1cac21c34f8d3b26ffcd70df5fbf29649645c5a0 100644 (file)
@@ -1,7 +1,7 @@
 /* hostlist_tr.c   2004 Ian Schorr
  * modified from endpoint_talkers_tr.c   2003 Ronnie Sahlberg
  *
- * $Id: hostlist_tr.c,v 1.2 2004/02/22 18:44:02 ulfl Exp $
+ * $Id$
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
 #include <string.h>
 #include "epan/packet.h"
 #include "tap_menu.h"
-#include "../tap.h"
+#include <epan/tap.h>
 #include "../register.h"
 #include "hostlist_table.h"
-#include "packet-tr.h"
+#include <epan/dissectors/packet-tr.h>
 
 
 static int
-tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       tr_hdr *trhdr=vip;
+       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) 
@@ -62,13 +62,13 @@ gtk_tr_hostlist_init(char *optarg)
 {
        char *filter=NULL;
 
-       if(!strncmp(optarg,"conv,tr,",8)){
-               filter=optarg+8;
+       if(!strncmp(optarg,"hosts,tr,",9)){
+               filter=optarg+9;
        } else {
                filter=NULL;
        }
 
-       init_hostlist_table(TRUE, "Token Ring", "tr", filter, (void *)tr_hostlist_packet);
+       init_hostlist_table(TRUE, "Token Ring Hosts", "tr", filter, tr_hostlist_packet);
 
 }
 
@@ -76,16 +76,17 @@ gtk_tr_hostlist_init(char *optarg)
 static void
 gtk_tr_hostlist_cb(GtkWidget *w _U_, gpointer d _U_)
 {
-       gtk_tr_hostlist_init("conv,tr");
+       gtk_tr_hostlist_init("hosts,tr");
 }
 
 
 void
 register_tap_listener_tr_hostlist(void)
 {
-       register_ethereal_tap("conv,tr", gtk_tr_hostlist_init);
+       register_ethereal_tap("hosts,tr", gtk_tr_hostlist_init);
 
-       register_tap_menu_item("Token Ring/Host List", REGISTER_TAP_LAYER_DATA_LINK,
+       register_tap_menu_item("Token Ring", REGISTER_TAP_GROUP_ENDPOINT_LIST,
            gtk_tr_hostlist_cb, NULL, NULL, NULL);
-}
 
+    register_hostlist_table(TRUE, "Token Ring", "tr", NULL /*filter*/, tr_hostlist_packet);
+}