Make the signatures of functions passed to "register_tap_listener()"
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 1 Jan 2005 12:49:54 +0000 (12:49 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 1 Jan 2005 12:49:54 +0000 (12:49 +0000)
match what "register_tap_listener()" expects (rather than squelching
warnings about the differences by casting function pointers to "void
*").

Make static some functions not used outside the module in which they're
defined.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12913 f5534014-38df-0310-8fa8-9805f1628bb7

30 files changed:
epan/dissectors/packet-smb-sidsnooping.c
gtk/conversations_eth.c
gtk/conversations_fc.c
gtk/conversations_fddi.c
gtk/conversations_ip.c
gtk/conversations_ipx.c
gtk/conversations_table.c
gtk/conversations_table.h
gtk/conversations_tcpip.c
gtk/conversations_tr.c
gtk/conversations_udpip.c
gtk/conversations_wlan.c
gtk/h323_conversations.c
gtk/h323_conversations.h
gtk/hostlist_eth.c
gtk/hostlist_fc.c
gtk/hostlist_fddi.c
gtk/hostlist_ip.c
gtk/hostlist_ipx.c
gtk/hostlist_table.c
gtk/hostlist_table.h
gtk/hostlist_tcpip.c
gtk/hostlist_tr.c
gtk/hostlist_udpip.c
gtk/hostlist_wlan.c
gtk/rpc_progs.c
gtk/rpc_stat.c
gtk/rtp_stream.c
tap-iostat.c
tap-iousers.c

index c706c7623926aa9843280a1b4737789dbfc4c535..79997eb686bcdad62558541d3f9c2fa63afe2a9d 100644 (file)
@@ -62,8 +62,8 @@ static int ctx_handle_init_count = 200;
 static GHashTable *ctx_handle_table = NULL;
 
 
-static void *lsa_policy_information_flag = NULL;
-static void *samr_query_dispinfo_flag = NULL;
+static gboolean lsa_policy_information_tap_installed = FALSE;
+static gboolean samr_query_dispinfo_tap_installed = FALSE;
 
 
 char *
@@ -334,13 +334,13 @@ sid_snooping_init(void)
        header_field_info *hfi;
        GString *error_string;
 
-       if(lsa_policy_information_flag){
-               remove_tap_listener(lsa_policy_information_flag);
-               lsa_policy_information_flag=NULL;
+       if(lsa_policy_information_tap_installed){
+               remove_tap_listener(&lsa_policy_information_tap_installed);
+               lsa_policy_information_tap_installed=FALSE;
        }
-       if(samr_query_dispinfo_flag){
-               remove_tap_listener(samr_query_dispinfo_flag);
-               samr_query_dispinfo_flag=NULL;
+       if(samr_query_dispinfo_tap_installed){
+               remove_tap_listener(&samr_query_dispinfo_tap_installed);
+               samr_query_dispinfo_tap_installed=FALSE;
        }
 
        if(sid_name_table){
@@ -421,7 +421,7 @@ sid_snooping_init(void)
 
 
 
-       error_string=register_tap_listener("dcerpc", lsa_policy_information, "lsa.policy_information and ( lsa.info.level or lsa.domain or nt.domain_sid )", NULL, lsa_policy_information, NULL);
+       error_string=register_tap_listener("dcerpc", &lsa_policy_information_tap_installed, "lsa.policy_information and ( lsa.info.level or lsa.domain or nt.domain_sid )", NULL, lsa_policy_information, NULL);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */
 
@@ -430,9 +430,9 @@ sid_snooping_init(void)
                g_string_free(error_string, TRUE);
                exit(1);
        }
-       lsa_policy_information_flag=lsa_policy_information;
+       lsa_policy_information_tap_installed=TRUE;
 
-       error_string=register_tap_listener("dcerpc", samr_query_dispinfo, "samr and samr.opnum==40 and ( samr.hnd or samr.rid or samr.acct_name or samr.level )", NULL, samr_query_dispinfo, NULL);
+       error_string=register_tap_listener("dcerpc", &samr_query_dispinfo_tap_installed, "samr and samr.opnum==40 and ( samr.hnd or samr.rid or samr.acct_name or samr.level )", NULL, samr_query_dispinfo, NULL);
        if(error_string){
                /* error, we failed to attach to the tap. clean up */
 
@@ -441,7 +441,7 @@ sid_snooping_init(void)
                g_string_free(error_string, TRUE);
                exit(1);
        }
-       samr_query_dispinfo_flag=samr_query_dispinfo;
+       samr_query_dispinfo_tap_installed=TRUE;
 }
 
 void
@@ -454,4 +454,3 @@ void
 proto_reg_handoff_smb_sidsnooping(void)
 {
 }
-
index 681b64657eb58f48c44806546baf9a10f5dc81a8..4196f251248ae00c5365d07f27171e7ec9c6787f 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-eth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+eth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       eth_hdr *ehdr=vip;
+       const eth_hdr *ehdr=vip;
 
        add_conversation_table_data((conversations_table *)pct, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, SAT_ETHER, PT_NONE);
 
@@ -63,7 +63,7 @@ eth_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(TRUE, "Ethernet", "eth", filter, (void *)eth_conversation_packet);
+       init_conversation_table(TRUE, "Ethernet", "eth", filter, eth_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_eth_conversation(void)
        register_tap_menu_item("Ethernet", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            eth_endpoints_cb, NULL, NULL, NULL);
 
-       register_conversation_table(TRUE, "Ethernet", "eth", NULL /*filter*/, (void *)eth_conversation_packet);
+       register_conversation_table(TRUE, "Ethernet", "eth", NULL /*filter*/, eth_conversation_packet);
 }
-
index b584197063a64aaff37cd1d2cc09d0a50a726a3d..01b96625603559c4f9dd5651466b8a90c388dcf9 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       fc_hdr *fchdr=vip;
+       const fc_hdr *fchdr=vip;
 
        add_conversation_table_data((conversations_table *)pct, &fchdr->s_id, &fchdr->d_id, 0, 0, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
 
@@ -63,7 +63,7 @@ fc_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(TRUE, "Fibre Channel", "fc", filter, (void *)fc_conversation_packet);
+       init_conversation_table(TRUE, "Fibre Channel", "fc", filter, fc_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_fc_conversation(void)
        register_tap_menu_item("Fibre Channel", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            fc_endpoints_cb, NULL, NULL, NULL);
 
-       register_conversation_table(TRUE, "Fibre Channel", "fc", NULL /*filter*/, (void *)fc_conversation_packet);
+       register_conversation_table(TRUE, "Fibre Channel", "fc", NULL /*filter*/, fc_conversation_packet);
 }
-
index be6222652dfe75bd94385886f44a544de2565902..317423305b01d16900586c87779f2c8e4f6839b2 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       fddi_hdr *ehdr=vip;
+       const fddi_hdr *ehdr=vip;
 
        add_conversation_table_data((conversations_table *)pct, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, SAT_FDDI, PT_NONE);
 
@@ -63,7 +63,7 @@ fddi_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(TRUE, "FDDI", "fddi", filter, (void *)fddi_conversation_packet);
+       init_conversation_table(TRUE, "FDDI", "fddi", filter, fddi_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_fddi_conversation(void)
        register_tap_menu_item("FDDI", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            fddi_endpoints_cb, NULL, NULL, NULL);
 
-       register_conversation_table(TRUE, "FDDI", "fddi", NULL /*filter*/, (void *)fddi_conversation_packet);
+       register_conversation_table(TRUE, "FDDI", "fddi", NULL /*filter*/, fddi_conversation_packet);
 }
-
index 5a94f97f59bf306dda5c49a1b005c064cd581061..d2811801e4d5dd1354bd6baa497ca4bc126844af 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-ip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+ip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       e_ip *iph=vip;
+       const e_ip *iph=vip;
 
        add_conversation_table_data((conversations_table *)pct, &iph->ip_src, &iph->ip_dst, 0, 0, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
 
@@ -61,7 +61,7 @@ ip_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(TRUE, "IPv4", "ip", filter, (void *)ip_conversation_packet);
+       init_conversation_table(TRUE, "IPv4", "ip", filter, ip_conversation_packet);
 
 }
 
@@ -81,6 +81,5 @@ register_tap_listener_ip_conversation(void)
        register_tap_menu_item("IPv4", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            ip_endpoints_cb, NULL, NULL, NULL);
 
-       register_conversation_table(TRUE, "IPv4", "ip", NULL /*filter*/, (void *)ip_conversation_packet);
+       register_conversation_table(TRUE, "IPv4", "ip", NULL /*filter*/, ip_conversation_packet);
 }
-
index 4b90e2a3a24b99710c1d51a3aa4f2dce09d563cd..634d7d56e7e0dbcbbc169ea47b83eb3caa339970 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-ipx_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+ipx_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       ipxhdr_t *ipxh=vip;
+       const ipxhdr_t *ipxh=vip;
 
        add_conversation_table_data((conversations_table *)pct, &ipxh->ipx_src, &ipxh->ipx_dst, 0, 0, 1, pinfo->fd->pkt_len, SAT_NONE, PT_NONE);
 
@@ -63,7 +63,7 @@ ipx_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(TRUE, "IPX", "ipx", filter, (void *)ipx_conversation_packet);
+       init_conversation_table(TRUE, "IPX", "ipx", filter, ipx_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_ipx_conversation(void)
        register_tap_menu_item("IPX", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            ipx_endpoints_cb, NULL, NULL, NULL);
 
-       register_conversation_table(TRUE, "IPX", "ipx", NULL /*filter*/, (void *)ipx_conversation_packet);
+       register_conversation_table(TRUE, "IPX", "ipx", NULL /*filter*/, ipx_conversation_packet);
 }
-
index b79b0869da76650ae41cc0e101f16a4774961e5e..c460d55a45f77ffefe53f58f242de0d5467be60b 100644 (file)
 
 #include <gtk/gtk.h>
 
+#include <epan/packet_info.h>
+#include <epan/to_str.h>
+#include <epan/addr_resolv.h>
+#include <epan/tap.h>
+
 #include "compat_macros.h"
-#include "epan/packet_info.h"
-#include "epan/to_str.h"
-#include "epan/addr_resolv.h"
 #include "sat.h"
 #include "conversations_table.h"
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 #include "simple_dialog.h"
 #include "globals.h"
-#include <epan/tap.h>
 #include "gtk/find_dlg.h"
 #include "color.h"
 #include "gtk/color_dlg.h"
@@ -240,6 +241,11 @@ reset_ct_table_data(conversations_table *ct)
     ct->num_conversations=0;
 }
 
+static void
+reset_ct_table_data_cb(void *arg)
+{
+    reset_ct_table_data(arg);
+}
 
 void protect_thread_critical_region(void);
 void unprotect_thread_critical_region(void);
@@ -1051,15 +1057,20 @@ draw_ct_table_data(conversations_table *ct)
 
     }
        
-       draw_ct_table_addresses(ct);
+    draw_ct_table_addresses(ct);
        
     gtk_clist_sort(ct->table);
 
-       /* Allow table to redraw */
+    /* Allow table to redraw */
     gtk_clist_thaw(ct->table);
-       gtk_clist_freeze(ct->table);
+    gtk_clist_freeze(ct->table);
 }
 
+static void
+draw_ct_table_data_cb(void *arg)
+{
+    draw_ct_table_data(arg);
+}
 
 #if (GTK_MAJOR_VERSION >= 2)
 static void
@@ -1101,8 +1112,8 @@ copy_as_csv_cb(GtkWindow *win _U_, gpointer data)
 #endif
 
 
-gboolean
-init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+static gboolean
+init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     int i;
     column_arrows *col_arrows;
@@ -1209,7 +1220,7 @@ init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean
 #endif                 
 
     /* register the tap and rerun the taps on the packet list */
-    error_string=register_tap_listener(tap_name, conversations, filter, (void *)reset_ct_table_data, packet_func, (void *)draw_ct_table_data);
+    error_string=register_tap_listener(tap_name, conversations, filter, reset_ct_table_data_cb, packet_func, draw_ct_table_data_cb);
     if(error_string){
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str);
         g_string_free(error_string, TRUE);
@@ -1221,7 +1232,7 @@ init_ct_table_page(conversations_table *conversations, GtkWidget *vbox, gboolean
 
 
 void
-init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     conversations_table *conversations;
     char title[256];
@@ -1291,7 +1302,7 @@ ct_win_destroy_notebook_cb(GtkWindow *win _U_, gpointer data)
 
 
 static conversations_table *
-init_ct_notebook_page_cb(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+init_ct_notebook_page_cb(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     gboolean ret;
     GtkWidget *page_vbox;
@@ -1316,18 +1327,18 @@ init_ct_notebook_page_cb(gboolean hide_ports, char *table_name, char *tap_name,
 
 
 typedef struct {
-    gboolean hide_ports;    /* hide TCP / UDP port columns */
-    char *table_name;       /* GUI output name */
-    char *tap_name;         /* internal name */
-    char *filter;           /* display filter string (unused) */
-    void *packet_func;      /* function to be called for new incoming packets */
+    gboolean hide_ports;       /* hide TCP / UDP port columns */
+    char *table_name;          /* GUI output name */
+    char *tap_name;            /* internal name */
+    char *filter;              /* display filter string (unused) */
+    tap_packet_cb packet_func; /* function to be called for new incoming packets */
 } register_ct_t;
 
 
 static GSList *registered_ct_tables = NULL;
 
 void
-register_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+register_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     register_ct_t *table;
 
@@ -1451,9 +1462,9 @@ init_conversation_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
 
 
 void
-add_conversation_table_data(conversations_table *ct, address *src, address *dst, guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, SAT_E sat, int port_type)
+add_conversation_table_data(conversations_table *ct, const address *src, const address *dst, guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, SAT_E sat, int port_type)
 {
-    address *addr1, *addr2;
+    const address *addr1, *addr2;
     guint32 port1, port2;
     conversation_t *conversation=NULL;
     int conversation_idx=0;
@@ -1576,5 +1587,3 @@ add_conversation_table_data(conversations_table *ct, address *src, address *dst,
         draw_ct_table_address(ct, conversation_idx);
     }
 }
-
-
index a9786acf7a0600611c00ae2613cb35c74a772ce5..7ee2aadcd10ae389563a1472475cd0077bf336f3 100644 (file)
@@ -68,7 +68,7 @@ typedef struct _conversations_table {
  * @param filter the optional filter name or NULL
  * @param packet_func the function to be called for each incoming packet
  */
-extern void register_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func);
+extern void register_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
 
 /** Init the conversation table for the single conversation window.
  *
@@ -78,7 +78,7 @@ extern void register_conversation_table(gboolean hide_ports, char *table_name, c
  * @param filter the optional filter name or NULL
  * @param packet_func the function to be called for each incoming packet
  */
-extern void init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func);
+extern void init_conversation_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
 
 /** Callback for "Conversations" statistics item.
  *
@@ -99,5 +99,5 @@ extern void init_conversation_notebook_cb(GtkWidget *widget, gpointer data);
  * @param sat address type
  * @param port_type the port type (e.g. PT_TCP)
  */
-extern void add_conversation_table_data(conversations_table *ct, address *src, address *dst, 
+extern void add_conversation_table_data(conversations_table *ct, const address *src, const address *dst, 
                         guint32 src_port, guint32 dst_port, int num_frames, int num_bytes, SAT_E sat, int port_type);
index de201e87ef920ad4678c6694b66fc945a066b8ce..4e85e08964c771d8dd21aef58e96afced517fde5 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-tcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+tcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       struct tcpheader *tcphdr=vip;
+       const struct tcpheader *tcphdr=vip;
 
        add_conversation_table_data((conversations_table *)pct, &tcphdr->ip_src, &tcphdr->ip_dst, tcphdr->th_sport, tcphdr->th_dport, 1, pinfo->fd->pkt_len, SAT_NONE, PT_TCP);
 
@@ -63,7 +63,7 @@ tcpip_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(FALSE, "TCP", "tcp", filter, (void *)tcpip_conversation_packet);
+       init_conversation_table(FALSE, "TCP", "tcp", filter, tcpip_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_tcpip_conversation(void)
        register_tap_menu_item("TCP (IPv4 & IPv6)", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            tcpip_conversation_cb, NULL, NULL, NULL);
 
-       register_conversation_table(FALSE, "TCP", "tcp", NULL /*filter*/, (void *)tcpip_conversation_packet);
+       register_conversation_table(FALSE, "TCP", "tcp", NULL /*filter*/, tcpip_conversation_packet);
 }
-
index c01807fcbc3471393aedbc09c70c9aa6cf35878c..93d5a65a92c8ed07f8e64b3ad868b6c1479899a4 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-tr_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+tr_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       tr_hdr *trhdr=vip;
+       const tr_hdr *trhdr=vip;
 
        add_conversation_table_data((conversations_table *)pct, &trhdr->src, &trhdr->dst, 0, 0, 1, pinfo->fd->pkt_len, SAT_TOKENRING, PT_NONE);
 
@@ -63,7 +63,7 @@ tr_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(TRUE, "Token Ring", "tr", filter, (void *)tr_conversation_packet);
+       init_conversation_table(TRUE, "Token Ring", "tr", filter, tr_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_tr_conversation(void)
        register_tap_menu_item("Token Ring", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            tr_conversation_cb, NULL, NULL, NULL);
 
-    register_conversation_table(TRUE, "Token Ring", "tr", NULL /*filter*/, (void *)tr_conversation_packet);
+    register_conversation_table(TRUE, "Token Ring", "tr", NULL /*filter*/, tr_conversation_packet);
 }
-
index 5a695c0e1fcd20c991bd26f37248bde1f77b4bdc..a78b42550c4e2c6b6b04d1549c1f6b2371f4556d 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       e_udphdr *udphdr=vip;
+       const e_udphdr *udphdr=vip;
 
        add_conversation_table_data((conversations_table *)pct, &udphdr->ip_src, &udphdr->ip_dst, udphdr->uh_sport, udphdr->uh_dport, 1, pinfo->fd->pkt_len, SAT_NONE, PT_UDP);
 
@@ -63,7 +63,7 @@ udpip_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(FALSE, "UDP", "udp", filter, (void *)udpip_conversation_packet);
+       init_conversation_table(FALSE, "UDP", "udp", filter, udpip_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_udpip_conversation(void)
        register_tap_menu_item("UDP (IPv4 & IPv6)", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            udpip_conversation_cb, NULL, NULL, NULL);
 
-    register_conversation_table(FALSE, "UDP", "udp", NULL /*filter*/, (void *)udpip_conversation_packet);
+    register_conversation_table(FALSE, "UDP", "udp", NULL /*filter*/, udpip_conversation_packet);
 }
-
index ab57f76df28a273149a110c436335f48424587d1..0faf6132a9a11f91be19d3aa55bd149c49292747 100644 (file)
@@ -41,9 +41,9 @@
 
 
 static int
-wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       wlan_hdr *whdr=vip;
+       const wlan_hdr *whdr=vip;
 
        add_conversation_table_data((conversations_table *)pct, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, SAT_ETHER, PT_NONE);
 
@@ -63,7 +63,7 @@ wlan_conversation_init(char *optarg)
                filter=NULL;
        }
 
-       init_conversation_table(TRUE, "WLAN", "wlan", filter, (void *)wlan_conversation_packet);
+       init_conversation_table(TRUE, "WLAN", "wlan", filter, wlan_conversation_packet);
 
 }
 
@@ -83,6 +83,5 @@ register_tap_listener_wlan_conversation(void)
        register_tap_menu_item("WLAN", REGISTER_TAP_GROUP_CONVERSATION_LIST,
            wlan_endpoints_cb, NULL, NULL, NULL);
 
-       register_conversation_table(TRUE, "WLAN", "wlan", NULL /*filter*/, (void *)wlan_conversation_packet);
+       register_conversation_table(TRUE, "WLAN", "wlan", NULL /*filter*/, wlan_conversation_packet);
 }
-
index ec60f3eb15c47c8b82684a5455bc4e7b2251fb26..df6707f259ea2afda320780b3dc1164272c07ea5 100644 (file)
@@ -55,6 +55,8 @@
 
 #include <string.h>
 
+static void h245conversations_reset(void *arg);
+
 char *transport_prot_name[256] ={
        "","","","","","","tcp","","","",  /* 0 to 10 */
     "","","","","","","","udp","","",  /* 10 to 20 */
@@ -145,11 +147,16 @@ void h225conversations_reset(h323conversations_tapinfo_t *tapinfo)
        return;
 }
 
+static void h225conversations_reset_cb(void *arg)
+{
+       h225conversations_reset(arg);
+}
+
 /****************************************************************************/
 /* redraw the output */
-void h225conversations_draw(h323conversations_tapinfo_t *tapinfo _U_)
+static void h225conversations_draw(void *arg _U_)
 {
-/* XXX: see h323conversations_on_update in h323_conversationss_dlg.c for comments
+/* XXX: see h323conversations_on_update in h323_conversations_dlg.c for comments
        gtk_signal_emit_by_name(top_level, "signal_h225conversations_update");
 */
        h323conversations_dlg_update(the_tapinfo_struct.strinfo_list);
@@ -160,13 +167,14 @@ void h225conversations_draw(h323conversations_tapinfo_t *tapinfo _U_)
 
 /****************************************************************************/
 /* whenever a H225 packet is seen by the tap listener */
-int h225conversations_packet(h323conversations_tapinfo_t *tapinfo _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void *h225info)
+static int h225conversations_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *h225info)
 {
+       h323conversations_tapinfo_t *tapinfo = arg;
        h323_conversations_info_t tmp_strinfo;
        h323_conversations_info_t *strinfo = NULL;
        GList* list;
 
-       h225_packet_info *pi = h225info;
+       const h225_packet_info *pi = h225info;
        
        /* TODO: evaluate RAS Messages. Just ignore them for now*/
        if(pi->msg_type==H225_RAS)
@@ -295,7 +303,8 @@ h225conversations_init_tap(void)
        {
                /* don't register tap listener, if we have it already */
                error_string = register_tap_listener("h225", &the_tapinfo_struct, NULL,
-                       (void*)h225conversations_reset, (void*)h225conversations_packet, (void*)h225conversations_draw);
+                       h225conversations_reset_cb, h225conversations_packet,
+                       h225conversations_draw);
 
                if (error_string != NULL) {
                        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
@@ -328,9 +337,15 @@ remove_tap_listener_h225_conversations(void)
 /* ***************************TAP for h245 **********************************/
 /****************************************************************************/
 
+/****************************************************************************/
+static void h245conversations_reset(void *arg _U_)
+{
+       return;
+}
+
 /****************************************************************************/
 /* redraw the output */
-void h245conversations_draw(h323conversations_tapinfo_t *tapinfo _U_)
+static void h245conversations_draw(void *arg _U_)
 {
        h323conversations_dlg_update(the_tapinfo_struct.strinfo_list);
        return;
@@ -338,8 +353,9 @@ void h245conversations_draw(h323conversations_tapinfo_t *tapinfo _U_)
 
 /****************************************************************************/
 /* whenever a H245 packet is seen by the tap listener */
-int h245conversations_packet(h323conversations_tapinfo_t *tapinfo _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void *h245info _U_)
+static int h245conversations_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *h245info _U_)
 {
+       h323conversations_tapinfo_t *tapinfo = arg;
        GList* list;
        struct _h323_conversations_info* a;
        guint32 src, dst;
@@ -382,8 +398,8 @@ h245conversations_init_tap(void)
        { 
                /* don't register tap listener, if we have it already */
                error_string = register_tap_listener("h245", &the_tapinfo_struct,
-                       NULL,
-                       (void*)h245conversations_reset, (void*)h245conversations_packet, (void*)h245conversations_draw);
+                       NULL, h245conversations_reset, h245conversations_packet,
+                       h245conversations_draw);
 
                if (error_string != NULL) {
                        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
@@ -405,12 +421,3 @@ remove_tap_listener_h245_conversations(void)
        
        have_h245_tap_listener=FALSE;
 }
-
-
-/****************************************************************************/
-
-void h245conversations_reset(h323conversations_tapinfo_t *tapinfo _U_)
-{
-       return;
-}
-
index d20c19c6a660e84ec8ac12a34345bda54536ee71..ee8cf5b6487fc5263342de52e29478450ba9c9c2 100644 (file)
@@ -112,7 +112,6 @@ const h323conversations_tapinfo_t* h323conversations_get_info(void);
 * Cleans up memory of h323 conversationss tap.
 */
 void h225conversations_reset(h323conversations_tapinfo_t *tapinfo);
-void h245conversations_reset(h323conversations_tapinfo_t *tapinfo);
 
 /*
 * Marks all packets belonging to conversations.
index 814645c5b5a8bdf11df90762eb7097d289f47474..2a7ebfc502a292b024e05f1bf7a9e08bd7833770 100644 (file)
 
 
 static int
-eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       eth_hdr *ehdr=vip;
+       const eth_hdr *ehdr=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) 
@@ -68,7 +68,7 @@ gtk_eth_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(TRUE, "Ethernet Hosts", "eth", filter, (void *)eth_hostlist_packet);
+       init_hostlist_table(TRUE, "Ethernet Hosts", "eth", filter, eth_hostlist_packet);
 
 }
 
@@ -88,6 +88,5 @@ register_tap_listener_eth_hostlist(void)
        register_tap_menu_item("Ethernet", REGISTER_TAP_GROUP_ENDPOINT_LIST,
            gtk_eth_hostlist_cb, NULL, NULL, NULL);
 
-       register_hostlist_table(TRUE, "Ethernet", "eth", NULL /*filter*/, (void *)eth_hostlist_packet);
+       register_hostlist_table(TRUE, "Ethernet", "eth", NULL /*filter*/, eth_hostlist_packet);
 }
-
index e3b4c44687122554278369309fde77a9f59246ac..22b18e956e8dd6d09372780131532e95c2f7360e 100644 (file)
 
 
 static int
-fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       fc_hdr *fchdr=vip;
+       const fc_hdr *fchdr=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) 
@@ -68,7 +68,7 @@ gtk_fc_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(TRUE, "Fibre Channel Hosts", "fc", filter, (void *)fc_hostlist_packet);
+       init_hostlist_table(TRUE, "Fibre Channel Hosts", "fc", filter, fc_hostlist_packet);
 
 }
 
@@ -88,6 +88,5 @@ register_tap_listener_fc_hostlist(void)
        register_tap_menu_item("Fibre Channel", REGISTER_TAP_GROUP_ENDPOINT_LIST,
            gtk_fc_hostlist_cb, NULL, NULL, NULL);
 
-       register_hostlist_table(TRUE, "Fibre Channel", "fc", NULL /*filter*/, (void *)fc_hostlist_packet);
+       register_hostlist_table(TRUE, "Fibre Channel", "fc", NULL /*filter*/, fc_hostlist_packet);
 }
-
index 0ca976dd5d8ba7a7721c8fda91d54a00bfefdcdf..5f2083005d4095b04a0a1ea97fa808955a408ae5 100644 (file)
 
 
 static int
-fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       fddi_hdr *ehdr=vip;
+       const fddi_hdr *ehdr=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) 
@@ -68,7 +68,7 @@ gtk_fddi_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(TRUE, "FDDI Hosts", "fddi", filter, (void *)fddi_hostlist_packet);
+       init_hostlist_table(TRUE, "FDDI Hosts", "fddi", filter, fddi_hostlist_packet);
 
 }
 
@@ -88,6 +88,5 @@ register_tap_listener_fddi_hostlist(void)
        register_tap_menu_item("FDDI", REGISTER_TAP_GROUP_ENDPOINT_LIST,
            gtk_fddi_hostlist_cb, NULL, NULL, NULL);
 
-       register_hostlist_table(TRUE, "FDDI", "fddi", NULL /*filter*/, (void *)fddi_hostlist_packet);
+       register_hostlist_table(TRUE, "FDDI", "fddi", NULL /*filter*/, fddi_hostlist_packet);
 }
-
index 0f95fcce5190425df6b728251b0f731f01df126c..cc6294e4bab32b3b46395a313e65ff104b21cc11 100644 (file)
 
 
 static int
-ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       e_ip *iph=vip;
+       const e_ip *iph=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) 
@@ -67,7 +67,7 @@ gtk_ip_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(TRUE, "IPv4 Hosts", "ip", filter, (void *)ip_hostlist_packet);
+       init_hostlist_table(TRUE, "IPv4 Hosts", "ip", filter, ip_hostlist_packet);
 
 }
 
@@ -87,6 +87,5 @@ register_tap_listener_ip_hostlist(void)
        register_tap_menu_item("IPv4", REGISTER_TAP_GROUP_ENDPOINT_LIST,
                gtk_ip_hostlist_cb, NULL, NULL, NULL);
 
-       register_hostlist_table(TRUE, "IPv4", "ip", NULL /*filter*/, (void *)ip_hostlist_packet);
+       register_hostlist_table(TRUE, "IPv4", "ip", NULL /*filter*/, ip_hostlist_packet);
 }
-
index a59a85d5f0fefdc15d6da2568f356e1e140ab580..a266796fcdbeb62c85d1d7180d60b86283837605 100644 (file)
 
 
 static int
-ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       ipxhdr_t *ipxh=vip;
+       const ipxhdr_t *ipxh=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) 
@@ -68,7 +68,7 @@ gtk_ipx_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(TRUE, "IPX Hosts", "ipx", filter, (void *)ipx_hostlist_packet);
+       init_hostlist_table(TRUE, "IPX Hosts", "ipx", filter, ipx_hostlist_packet);
 
 }
 
@@ -88,6 +88,5 @@ register_tap_listener_ipx_hostlist(void)
        register_tap_menu_item("IPX", REGISTER_TAP_GROUP_ENDPOINT_LIST,
            gtk_ipx_hostlist_cb, NULL, NULL, NULL);
 
-       register_hostlist_table(TRUE, "IPX", "ipx", NULL /*filter*/, (void *)ipx_hostlist_packet);
+       register_hostlist_table(TRUE, "IPX", "ipx", NULL /*filter*/, ipx_hostlist_packet);
 }
-
index afe9540c3ee3d9c5036b4a27b0997ce1c0cd679c..0e867bd72f61d459908476e0f0c692789fc05afd 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <math.h>
+
 #include <gtk/gtk.h>
+
+#include <epan/packet_info.h>
+#include <epan/to_str.h>
+#include <epan/addr_resolv.h>
+#include <epan/tap.h>
+
 #include "compat_macros.h"
-#include "epan/packet_info.h"
-#include "epan/to_str.h"
-#include "epan/addr_resolv.h"
 #include "hostlist_table.h"
 #include "image/clist_ascend.xpm"
 #include "image/clist_descend.xpm"
 #include "simple_dialog.h"
 #include "globals.h"
-#include <epan/tap.h>
 #include "gtk/find_dlg.h"
 #include "color.h"
 #include "gtk/color_dlg.h"
@@ -170,7 +173,11 @@ reset_hostlist_table_data(hostlist_table *hosts)
     hosts->num_hosts=0;
 }
 
-
+static void
+reset_hostlist_table_data_cb(void *arg)
+{
+    reset_hostlist_table_data(arg);
+}
 
 void protect_thread_critical_region(void);
 void unprotect_thread_critical_region(void);
@@ -542,13 +549,19 @@ draw_hostlist_table_data(hostlist_table *hl)
 
     }
        
-       draw_hostlist_table_addresses(hl);
+    draw_hostlist_table_addresses(hl);
        
     gtk_clist_sort(hl->table);
 
-       /* Allow table to redraw. */
+    /* Allow table to redraw. */
     gtk_clist_thaw(hl->table);
-       gtk_clist_freeze(hl->table);
+    gtk_clist_freeze(hl->table);
+}
+
+static void
+draw_hostlist_table_data_cb(void *arg)
+{
+    draw_hostlist_table_data(arg);
 }
 
 #if (GTK_MAJOR_VERSION >= 2)
@@ -592,7 +605,7 @@ copy_as_csv_cb(GtkWindow *win _U_, gpointer data)
 
 
 static gboolean
-init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     int i;
     column_arrows *col_arrows;
@@ -691,7 +704,7 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
 #endif
 
     /* register the tap and rerun the taps on the packet list */
-    error_string=register_tap_listener(tap_name, hosttable, filter, (void *)reset_hostlist_table_data, packet_func, (void *)draw_hostlist_table_data);
+    error_string=register_tap_listener(tap_name, hosttable, filter, reset_hostlist_table_data_cb, packet_func, draw_hostlist_table_data_cb);
     if(error_string){
         simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str);
         g_string_free(error_string, TRUE);
@@ -704,7 +717,7 @@ init_hostlist_table_page(hostlist_table *hosttable, GtkWidget *vbox, gboolean hi
 
 
 void
-init_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+init_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     hostlist_table *hosttable;
     char title[256];
@@ -773,7 +786,7 @@ hostlist_win_destroy_notebook_cb(GtkWindow *win _U_, gpointer data)
 
 
 static hostlist_table *
-init_hostlist_notebook_page_cb(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+init_hostlist_notebook_page_cb(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     gboolean ret;
     GtkWidget *page_vbox;
@@ -798,18 +811,18 @@ init_hostlist_notebook_page_cb(gboolean hide_ports, char *table_name, char *tap_
 
 
 typedef struct {
-    gboolean hide_ports;    /* hide TCP / UDP port columns */
-    char *table_name;       /* GUI output name */
-    char *tap_name;         /* internal name */
-    char *filter;           /* display filter string (unused) */
-    void *packet_func;      /* function to be called for new incoming packets */
+    gboolean hide_ports;       /* hide TCP / UDP port columns */
+    char *table_name;          /* GUI output name */
+    char *tap_name;            /* internal name */
+    char *filter;              /* display filter string (unused) */
+    tap_packet_cb packet_func; /* function to be called for new incoming packets */
 } register_hostlist_t;
 
 
 static GSList *registered_hostlist_tables = NULL;
 
 void
-register_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func)
+register_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func)
 {
     register_hostlist_t *table;
 
@@ -935,7 +948,7 @@ init_hostlist_notebook_cb(GtkWidget *w _U_, gpointer d _U_)
 
 
 void
-add_hostlist_table_data(hostlist_table *hl, address *addr, guint32 port, gboolean sender, int num_frames, int num_bytes, SAT_E sat, int port_type)
+add_hostlist_table_data(hostlist_table *hl, const address *addr, guint32 port, gboolean sender, int num_frames, int num_bytes, SAT_E sat, int port_type)
 {
     hostlist_talker_t *talker=NULL;
     int talker_idx=0;
@@ -1026,4 +1039,3 @@ add_hostlist_table_data(hostlist_table *hl, address *addr, guint32 port, gboolea
                draw_hostlist_table_address(hl, talker_idx);
     }
 }
-
index 7076c421871dde4fb4e347ad8a2d9ae74462f90a..73ae442e501b2bf8a80c73bce5c2872072dbe8fd 100644 (file)
@@ -66,7 +66,7 @@ typedef struct _hostlist_table {
  * @param filter the optional filter name or NULL
  * @param packet_func the function to be called for each incoming packet
  */
-extern void register_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func);
+extern void register_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
 
 /** Init the hostlist table for the single hostlist window.
  *
@@ -76,7 +76,7 @@ extern void register_hostlist_table(gboolean hide_ports, char *table_name, char
  * @param filter the optional filter name or NULL
  * @param packet_func the function to be called for each incoming packet
  */
-extern void init_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, void *packet_func);
+extern void init_hostlist_table(gboolean hide_ports, char *table_name, char *tap_name, char *filter, tap_packet_cb packet_func);
 
 /** Callback for "Endpoints" statistics item.
  *
@@ -96,5 +96,5 @@ extern void init_hostlist_notebook_cb(GtkWidget *w, gpointer d);
  * @param sat address type
  * @param port_type the port type (e.g. PT_TCP)
  */
-void add_hostlist_table_data(hostlist_table *hl, address *addr,
+void add_hostlist_table_data(hostlist_table *hl, const address *addr,
                              guint32 port, gboolean sender, int num_frames, int num_bytes, SAT_E sat, int port_type);
index 049086666784e1b3648944d4fb6486caa1c39a2a..13a4ae0e215accaed37fbf8fb8c3ecef7ed02586 100644 (file)
 
 
 static int
-tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       struct tcpheader *tcphdr=vip;
+       const struct tcpheader *tcphdr=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) 
@@ -68,7 +68,7 @@ gtk_tcpip_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(FALSE, "TCP Endpoints", "tcp", filter, (void *)tcpip_hostlist_packet);
+       init_hostlist_table(FALSE, "TCP Endpoints", "tcp", filter, tcpip_hostlist_packet);
 
 }
 
@@ -88,6 +88,5 @@ register_tap_listener_tcpip_hostlist(void)
        register_tap_menu_item("TCP (IPv4 & IPv6)", REGISTER_TAP_GROUP_ENDPOINT_LIST,
            gtk_tcpip_hostlist_cb, NULL, NULL, NULL);
 
-       register_hostlist_table(FALSE, "TCP", "tcp", NULL /*filter*/, (void *)tcpip_hostlist_packet);
+       register_hostlist_table(FALSE, "TCP", "tcp", NULL /*filter*/, tcpip_hostlist_packet);
 }
-
index 3109521fefab01b53528b644b3c1d1f70da0f727..1cac21c34f8d3b26ffcd70df5fbf29649645c5a0 100644 (file)
 
 
 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) 
@@ -68,7 +68,7 @@ gtk_tr_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(TRUE, "Token Ring Hosts", "tr", filter, (void *)tr_hostlist_packet);
+       init_hostlist_table(TRUE, "Token Ring Hosts", "tr", filter, tr_hostlist_packet);
 
 }
 
@@ -88,6 +88,5 @@ register_tap_listener_tr_hostlist(void)
        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*/, (void *)tr_hostlist_packet);
+    register_hostlist_table(TRUE, "Token Ring", "tr", NULL /*filter*/, tr_hostlist_packet);
 }
-
index b7c048051efdd9f20a99ea9c1a1911f081799122..1e4ecebc04596defc5f6f3fbd51420b71bfc4fba 100644 (file)
 
 
 static int
-udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
        hostlist_table *hosts=(hostlist_table *)pit;
-       e_udphdr *udphdr=vip;
+       const e_udphdr *udphdr=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) 
@@ -68,7 +68,7 @@ gtk_udpip_hostlist_init(char *optarg)
                filter=NULL;
        }
 
-       init_hostlist_table(FALSE, "UDP Endpoints", "udp", filter, (void *)udpip_hostlist_packet);
+       init_hostlist_table(FALSE, "UDP Endpoints", "udp", filter, udpip_hostlist_packet);
 
 }
 
@@ -88,6 +88,5 @@ register_tap_listener_udpip_hostlist(void)
        register_tap_menu_item("UDP (IPv4 & IPv6)", REGISTER_TAP_GROUP_ENDPOINT_LIST,
            gtk_udpip_hostlist_cb, NULL, NULL, NULL);
 
-       register_hostlist_table(FALSE, "UDP", "udp", NULL /*filter*/, (void *)udpip_hostlist_packet);
+       register_hostlist_table(FALSE, "UDP", "udp", NULL /*filter*/, udpip_hostlist_packet);
 }
-
index 5b17aa83e0c5ec8e247753ea58113bfacd4b416e..00034c5863be184a23fbfa0fdba372a9aeac1c55 100644 (file)
 
 
 static int
-wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
         hostlist_table *hosts=(hostlist_table *)pit;
-        wlan_hdr *whdr=vip;
+        const wlan_hdr *whdr=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)
@@ -66,7 +66,7 @@ gtk_wlan_hostlist_init(char *optarg)
                 filter=NULL;
         }
 
-        init_hostlist_table(TRUE, "WLAN Hosts", "wlan", filter, (void *)wlan_hostlist_packet);
+        init_hostlist_table(TRUE, "WLAN Hosts", "wlan", filter, wlan_hostlist_packet);
 
 }
 
@@ -86,5 +86,5 @@ register_tap_listener_wlan_hostlist(void)
         register_tap_menu_item("WLAN", REGISTER_TAP_GROUP_ENDPOINT_LIST,
             gtk_wlan_hostlist_cb, NULL, NULL, NULL);
 
-        register_hostlist_table(TRUE, "WLAN", "wlan", NULL /*filter*/, (void *)wlan_hostlist_packet);
+        register_hostlist_table(TRUE, "WLAN", "wlan", NULL /*filter*/, wlan_hostlist_packet);
 }
index b12ee9c3c2236ceaef2e48b3d93eaf78b1b5b652..2567b8b898f248f767d29d6cef911f6513949e8d 100644 (file)
@@ -154,8 +154,9 @@ add_new_program(rpc_program_t *rp)
 
 
 static int
-rpcprogs_packet(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt _U_, rpc_call_info_value *ri)
+rpcprogs_packet(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg)
 {
+       const rpc_call_info_value *ri = arg;
        nstime_t delta;
        rpc_program_t *rp;
 
@@ -384,7 +385,7 @@ gtk_rpcprogs_init(char *optarg _U_)
        gtk_table_attach_defaults(GTK_TABLE(table), tmp, 5,6,0,1);
        gtk_label_set_justify(GTK_LABEL(tmp), GTK_JUSTIFY_RIGHT);
 
-       error_string=register_tap_listener("rpc", win, NULL, (void*)rpcprogs_reset, (void*)rpcprogs_packet, (void*)rpcprogs_draw);
+       error_string=register_tap_listener("rpc", win, NULL, rpcprogs_reset, rpcprogs_packet, rpcprogs_draw);
        if(error_string){
                fprintf(stderr, "ethereal: Couldn't register rpc,programs tap: %s\n",
                    error_string->str);
index 004f3a3cd950104cedb988fe2534622121c9f2de..2c192976b8b974a27291775e31a104a6897eface 100644 (file)
@@ -82,16 +82,21 @@ rpcstat_set_title(rpcstat_t *rs)
 }
 
 static void
-rpcstat_reset(rpcstat_t *rs)
+rpcstat_reset(void *arg)
 {
+       rpcstat_t *rs = arg;
+
        reset_srt_table_data(&rs->srt_table);
        rpcstat_set_title(rs);
 }
 
 
 static int
-rpcstat_packet(rpcstat_t *rs, packet_info *pinfo, epan_dissect_t *edt _U_, rpc_call_info_value *ri)
+rpcstat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2)
 {
+       rpcstat_t *rs = arg;
+       const rpc_call_info_value *ri = arg2;
+
        /* we are only interested in reply packets */
        if(ri->request){
                return 0;
@@ -123,8 +128,10 @@ rpcstat_packet(rpcstat_t *rs, packet_info *pinfo, epan_dissect_t *edt _U_, rpc_c
 }
 
 static void
-rpcstat_draw(rpcstat_t *rs)
+rpcstat_draw(void *arg)
 {
+       rpcstat_t *rs = arg;
+
        draw_srt_table_data(&rs->srt_table);
 }
 
@@ -254,7 +261,7 @@ gtk_rpcstat_init(char *optarg)
        gtk_container_add(GTK_CONTAINER(rs->win), vbox);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);
        
-    title_string = rpcstat_gen_title(rs);
+       title_string = rpcstat_gen_title(rs);
        stat_label=gtk_label_new(title_string);
        g_free(title_string);
        gtk_box_pack_start(GTK_BOX(vbox), stat_label, FALSE, FALSE, 0);
@@ -278,7 +285,7 @@ gtk_rpcstat_init(char *optarg)
        }
 
 
-       error_string=register_tap_listener("rpc", rs, filter, (void*)rpcstat_reset, (void*)rpcstat_packet, (void*)rpcstat_draw);
+       error_string=register_tap_listener("rpc", rs, filter, rpcstat_reset, rpcstat_packet, rpcstat_draw);
        if(error_string){
                simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string->str);
                g_string_free(error_string, TRUE);
@@ -292,15 +299,15 @@ gtk_rpcstat_init(char *optarg)
        gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
 
        close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE);
-    window_set_cancel_button(rs->win, close_bt, window_cancel_button_cb);
+       window_set_cancel_button(rs->win, close_bt, window_cancel_button_cb);
 
-    SIGNAL_CONNECT(rs->win, "delete_event", window_delete_event_cb, NULL);
+       SIGNAL_CONNECT(rs->win, "delete_event", window_delete_event_cb, NULL);
        SIGNAL_CONNECT(rs->win, "destroy", win_destroy_cb, rs);
 
-    gtk_widget_show_all(rs->win);
-    window_present(rs->win);
+       gtk_widget_show_all(rs->win);
+       window_present(rs->win);
 
-    retap_packets(&cfile);
+       retap_packets(&cfile);
 }
 
 
@@ -534,4 +541,3 @@ register_tap_listener_gtkrpcstat(void)
        register_tap_menu_item("ONC-RPC...", REGISTER_TAP_GROUP_RESPONSE_TIME,
            gtk_rpcstat_cb, NULL, NULL, NULL);
 }
-
index 9b015b904cb90ba0d85e1a8a56b75f02bdfb66ac..f5caf80e74c195f94a31879788d9b1546d0c4667 100644 (file)
@@ -116,9 +116,14 @@ void rtpstream_reset(rtpstream_tapinfo_t *tapinfo)
        return;
 }
 
+static void rtpstream_reset_cb(void *arg)
+{
+       rtpstream_reset(arg);
+}
+
 /****************************************************************************/
 /* redraw the output */
-void rtpstream_draw(rtpstream_tapinfo_t *tapinfo _U_)
+void rtpstream_draw(void *arg _U_)
 {
 /* XXX: see rtpstream_on_update in rtp_streams_dlg.c for comments
        gtk_signal_emit_by_name(top_level, "signal_rtpstream_update");
@@ -197,8 +202,10 @@ static void rtp_write_sample(rtp_sample_t* sample, FILE* file)
 
 /****************************************************************************/
 /* whenever a RTP packet is seen by the tap listener */
-int rtpstream_packet(rtpstream_tapinfo_t *tapinfo _U_, packet_info *pinfo, epan_dissect_t *edt _U_, struct _rtp_info *rtpinfo _U_)
+static int rtpstream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2)
 {
+       rtpstream_tapinfo_t *tapinfo = arg;
+       const struct _rtp_info *rtpinfo = arg2;
        rtp_stream_info_t tmp_strinfo;
        rtp_stream_info_t *strinfo = NULL;
        GList* list;
@@ -397,8 +404,8 @@ register_tap_listener_rtp_stream(void)
                register_ethereal_tap("rtp", rtpstream_init_tap);
 
                error_string = register_tap_listener("rtp", &the_tapinfo_struct,
-                       NULL,
-                       (void*)rtpstream_reset, (void*)rtpstream_packet, (void*)rtpstream_draw);
+                       NULL, rtpstream_reset_cb, rtpstream_packet,
+                       rtpstream_draw);
 
                if (error_string != NULL) {
                        simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
index da84b631f6a0ddc5a46435447314607aaff46e4d..e9cdac6284ccd0dc71bff568927f038d6f5f282a 100644 (file)
@@ -67,8 +67,9 @@ typedef struct _io_stat_item_t {
 
 
 static int
-iostat_packet(io_stat_item_t *mit, packet_info *pinfo, epan_dissect_t *edt _U_, void *dummy _U_)
+iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, void *dummy _U_)
 {
+       io_stat_item_t *mit = arg;
        io_stat_item_t *it;
        gint32 current_time;
        GPtrArray *gp;
@@ -249,8 +250,9 @@ iostat_packet(io_stat_item_t *mit, packet_info *pinfo, epan_dissect_t *edt _U_,
 }
 
 static void
-iostat_draw(io_stat_item_t *mit)
+iostat_draw(void *arg)
 {
+       io_stat_item_t *mit = arg;
        io_stat_t *iot;
        io_stat_item_t **items;
        guint32 *frames;
@@ -561,7 +563,7 @@ CALC_TYPE_MAX       4
 CALC_TYPE_AVG  5
 */
 
-       error_string=register_tap_listener("frame", &io->items[i], flt, NULL, (void*)iostat_packet, i?NULL:(void*)iostat_draw);
+       error_string=register_tap_listener("frame", &io->items[i], flt, NULL, iostat_packet, i?NULL:iostat_draw);
        if(error_string){
                g_free(io->items);
                g_free(io);
@@ -650,4 +652,3 @@ register_tap_listener_iostat(void)
 {
        register_ethereal_tap("io,stat,", iostat_init);
 }
-
index b63100ff6fb7b37b919903b6d7f6cd893bb1ecaf..e1a93d07df5039810db01aa4aaa889aeef62819a 100644 (file)
@@ -68,9 +68,10 @@ typedef struct _io_users_item_t {
 
 
 static int
-iousers_udpip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vudph)
+iousers_udpip_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vudph)
 {
-       e_udphdr *udph=vudph;
+       io_users_t *iu=arg;
+       const e_udphdr *udph=vudph;
        char name1[256],name2[256];
        io_users_item_t *iui;
        int direction=0;
@@ -127,9 +128,10 @@ iousers_udpip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_
 
 
 static int
-iousers_tcpip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vtcph)
+iousers_tcpip_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vtcph)
 {
-       struct tcpheader *tcph=vtcph;
+       io_users_t *iu=arg;
+       const struct tcpheader *tcph=vtcph;
        char name1[256],name2[256];
        io_users_item_t *iui;
        int direction=0;
@@ -186,10 +188,11 @@ iousers_tcpip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_
 
 
 static int
-iousers_ip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vip)
+iousers_ip_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
 {
-       e_ip *iph=vip;
-       address *addr1, *addr2;
+       io_users_t *iu=arg;
+       const e_ip *iph=vip;
+       const address *addr1, *addr2;
        io_users_item_t *iui;
 
        if(CMP_ADDRESS(&iph->ip_src, &iph->ip_dst)>0){
@@ -233,10 +236,11 @@ iousers_ip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, v
 }
 
 static int
-iousers_ipx_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vipx)
+iousers_ipx_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vipx)
 {
-       ipxhdr_t *ipxh=vipx;
-       address *addr1, *addr2;
+       io_users_t *iu=arg;
+       const ipxhdr_t *ipxh=vipx;
+       const address *addr1, *addr2;
        io_users_item_t *iui;
 
        if(CMP_ADDRESS(&ipxh->ipx_src, &ipxh->ipx_dst)>0){
@@ -280,10 +284,11 @@ iousers_ipx_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_,
 }
 
 static int
-iousers_fc_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vfc)
+iousers_fc_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vfc)
 {
-       fc_hdr *fchdr=vfc;
-       address *addr1, *addr2;
+       io_users_t *iu=arg;
+       const fc_hdr *fchdr=vfc;
+       const address *addr1, *addr2;
        io_users_item_t *iui;
 
        if(CMP_ADDRESS(&fchdr->s_id, &fchdr->d_id)<0){
@@ -327,10 +332,11 @@ iousers_fc_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, v
 }
 
 static int
-iousers_eth_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *veth)
+iousers_eth_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *veth)
 {
-       eth_hdr *ehdr=veth;
-       address *addr1, *addr2;
+       io_users_t *iu=arg;
+       const eth_hdr *ehdr=veth;
+       const address *addr1, *addr2;
        io_users_item_t *iui;
 
        if(CMP_ADDRESS(&ehdr->src, &ehdr->dst)<0){
@@ -374,10 +380,11 @@ iousers_eth_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_,
 }
 
 static int
-iousers_fddi_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *veth)
+iousers_fddi_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *veth)
 {
-       fddi_hdr *ehdr=veth;
-       address *addr1, *addr2;
+       io_users_t *iu=arg;
+       const fddi_hdr *ehdr=veth;
+       const address *addr1, *addr2;
        io_users_item_t *iui;
 
        if(CMP_ADDRESS(&ehdr->src, &ehdr->dst)<0){
@@ -421,10 +428,11 @@ iousers_fddi_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_,
 }
 
 static int
-iousers_tr_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, void *vtr)
+iousers_tr_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vtr)
 {
-       tr_hdr *trhdr=vtr;
-       address *addr1, *addr2;
+       io_users_t *iu=arg;
+       const tr_hdr *trhdr=vtr;
+       const address *addr1, *addr2;
        io_users_item_t *iui;
 
        if(CMP_ADDRESS(&trhdr->src, &trhdr->dst)<0){
@@ -468,8 +476,9 @@ iousers_tr_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_, v
 }
 
 static void
-iousers_draw(io_users_t *iu)
+iousers_draw(void *arg)
 {
+       io_users_t *iu = arg;
        io_users_item_t *iui;
        guint32 last_frames, max_frames;
 
@@ -514,7 +523,7 @@ iousers_init(char *optarg)
 {
        char *filter=NULL;
        char *tap_type, *tap_type_name;
-       static int (*packet_func)(io_users_t *, packet_info *, epan_dissect_t *, void *);
+       tap_packet_cb packet_func;
        io_users_t *iu=NULL;
        GString *error_string;
 
@@ -614,7 +623,7 @@ iousers_init(char *optarg)
                iu->filter=NULL;
        }
 
-       error_string=register_tap_listener(tap_type, iu, filter, NULL, (void*)packet_func, (void*)iousers_draw);
+       error_string=register_tap_listener(tap_type, iu, filter, NULL, packet_func, iousers_draw);
        if(error_string){
                if(iu->items){
                        g_free(iu->items);
@@ -633,4 +642,3 @@ register_tap_listener_iousers(void)
 {
        register_ethereal_tap("conv,", iousers_init);
 }
-