diff options
147 files changed, 788 insertions, 715 deletions
diff --git a/doc/README.tapping b/doc/README.tapping index 769c5dc4b4..a5af28e609 100644 --- a/doc/README.tapping +++ b/doc/README.tapping @@ -65,7 +65,7 @@ The two functions to start or stop tapping are register_tap_listener(const char *tapname, void *tapdata, const char *fstring, guint flags, void (*reset)(void *tapdata), - gboolean (*packet)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data), + tap_packet_status (*packet)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data), void (*draw)(void *tapdata), void (*finish)(void *tapdata)); @@ -135,14 +135,17 @@ listener that it is about to start [re]reading a capture file or a new capture from an interface and that your application should reset any state it has in the *tapdata instance. -gboolean (*packet)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data) +tap_packet_status (*packet)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data) This callback is used whenever a new packet has arrived at the tap and that it has passed the filter (if there were a filter). The *data structure type is specific to each tap. -This function returns an gboolean and it should return - TRUE, if the data in the packet caused state to be updated +This function returns a tap_packet_status enum and it should return + TAP_PACKET_REDRAW, if the data in the packet caused state to be updated (and thus a redraw of the window would later be required) - FALSE, if we don't need to redraw the window. + TAP_PACKET_DONT_REDRAW, if we don't need to redraw the window + TAP_PACKET_FAILED, if the tap failed and shouldn't be called again + in this pass (for example, if it's writing to a file and gets + an I/O error) NOTE: that (*packet) should be as fast and efficient as possible. Use this function ONLY to store data for later and do the CPU-intensive processing or GUI updates down in (*draw) instead. @@ -219,10 +222,10 @@ You can hand register_tap_listener() NULL for (*draw), (*reset) and (*finish) Perhaps you want an extension that will execute a certain command every time it sees a certain packet? Well, try this : - gboolean packet(void *tapdata,...) { + tap_packet_status packet(void *tapdata,...) { ... system("mail ..."); - return FALSE; + return TAP_PACKET_DONT_REDRAW; } register_tap_listener("tcp", struct, "tcp.port==57", NULL, packet, NULL, NULL); diff --git a/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c b/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c index 68b260f77f..7949e96fed 100644 --- a/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c +++ b/epan/dissectors/asn1/ansi_map/packet-ansi_map-template.c @@ -4474,7 +4474,7 @@ static void ansi_map_stat_init(stat_tap_table_ui* new_stat) } -static gboolean +static tap_packet_status ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -4485,7 +4485,7 @@ ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt /* Only tracking field values we know */ if (try_val_to_str(data_p->message_type, ansi_map_opr_code_strings) == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); @@ -4503,7 +4503,7 @@ ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt item_data->value.float_value = (float)total_bytes/(float)count; stat_tap_set_field_data(table, data_p->message_type, AVG_BYTES_COLUMN, item_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/asn1/camel/packet-camel-template.c b/epan/dissectors/asn1/camel/packet-camel-template.c index 7eabb317e2..11e19cd7db 100644 --- a/epan/dissectors/asn1/camel/packet-camel-template.c +++ b/epan/dissectors/asn1/camel/packet-camel-template.c @@ -345,7 +345,7 @@ camelstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static gboolean +static tap_packet_status camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi) { guint idx = 0; @@ -364,7 +364,7 @@ camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_srt_table_data(camel_srt_table, i, &pi->msginfo[i].req_time, pinfo); } } /* category */ - return TRUE; + return TAP_PACKET_REDRAW; } @@ -1239,7 +1239,7 @@ static void camel_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *csi_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -1250,12 +1250,12 @@ camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_ table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); if (csi->opcode >= table->num_elements) - return FALSE; + return TAP_PACKET_DONT_REDRAW; msg_data = stat_tap_get_field_data(table, csi->opcode, COUNT_COLUMN); msg_data->value.uint_value++; stat_tap_set_field_data(table, csi->opcode, COUNT_COLUMN, msg_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c b/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c index 90f7aee018..fe710ad362 100644 --- a/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c +++ b/epan/dissectors/asn1/gsm_map/packet-gsm_map-template.c @@ -2805,7 +2805,7 @@ static void gsm_map_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status gsm_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gmtr_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -2860,7 +2860,7 @@ gsm_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN); avg_data->value.float_value += (float) (fwd_bytes + rev_bytes) / (invokes + results); stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN, avg_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/asn1/h225/packet-h225-template.c b/epan/dissectors/asn1/h225/packet-h225-template.c index e0158a1716..2c0f41aada 100644 --- a/epan/dissectors/asn1/h225/packet-h225-template.c +++ b/epan/dissectors/asn1/h225/packet-h225-template.c @@ -174,7 +174,7 @@ typedef enum _ras_category { #define NUM_RAS_STATS 7 -static gboolean +static tap_packet_status h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi) { rtd_data_t* rtd_data = (rtd_data_t*)phs; @@ -186,7 +186,7 @@ h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, co if (pi->msg_type != H225_RAS || pi->msg_tag == -1) { /* No RAS Message or uninitialized msg_tag -> return */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } if (pi->msg_tag < 21) { @@ -196,7 +196,7 @@ h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, co } else { /* No SRT yet (ToDo) */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } switch(rasmsg_type) { @@ -228,9 +228,9 @@ h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, co break; default: - return FALSE; + return TAP_PACKET_DONT_REDRAW; } - return TRUE; + return TAP_PACKET_REDRAW; } #include "packet-h225-fn.c" @@ -659,7 +659,7 @@ static void h225_stat_init(stat_tap_table_ui* new_stat) other_idx = row_idx; } -static gboolean +static tap_packet_status h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *hpi_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -668,7 +668,7 @@ h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, int reason_idx = -1; if(hpi->msg_tag < 0) { /* uninitialized */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } switch (hpi->msg_type) { @@ -760,9 +760,9 @@ h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, stat_tap_set_field_data(table, reason_idx, COUNT_COLUMN, msg_data); } - return TRUE; + return TAP_PACKET_REDRAW; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } static void diff --git a/epan/dissectors/asn1/ldap/packet-ldap-template.c b/epan/dissectors/asn1/ldap/packet-ldap-template.c index 01132effdb..0942d3d633 100644 --- a/epan/dissectors/asn1/ldap/packet-ldap-template.c +++ b/epan/dissectors/asn1/ldap/packet-ldap-template.c @@ -302,7 +302,7 @@ ldapstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static int +static tap_packet_status ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi) { guint i = 0; @@ -312,11 +312,11 @@ ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const /* we are only interested in reply packets */ if(ldap->is_request){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* if we havnt seen the request, just ignore it */ if(!ldap->req_frame){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* only use the commands we know how to handle */ @@ -331,13 +331,13 @@ ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const case LDAP_REQ_EXTENDED: break; default: - return 0; + return TAP_PACKET_DONT_REDRAW; } ldap_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); add_srt_table_data(ldap_srt_table, ldap->protocolOpTag, &ldap->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } /* diff --git a/epan/dissectors/packet-afp.c b/epan/dissectors/packet-afp.c index 9297e404ec..1ac504b53e 100644 --- a/epan/dissectors/packet-afp.c +++ b/epan/dissectors/packet-afp.c @@ -1099,7 +1099,7 @@ afpstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static int +static tap_packet_status afpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -1109,14 +1109,14 @@ afpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi /* if we haven't seen the request, just ignore it */ if (!request_val) { - return 0; + return TAP_PACKET_DONT_REDRAW; } afp_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); add_srt_table_data(afp_srt_table, request_val->command, &request_val->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-ancp.c b/epan/dissectors/packet-ancp.c index e8a4bcc118..8a27d6d1c9 100644 --- a/epan/dissectors/packet-ancp.c +++ b/epan/dissectors/packet-ancp.c @@ -597,7 +597,7 @@ ancp_stats_tree_init(stats_tree *st) st_node_packets, STAT_DT_INT, TRUE); } -static int +static tap_packet_status ancp_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_ , const void* p) { @@ -611,7 +611,7 @@ ancp_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, stats_tree_tick_pivot(st, st_node_adj_pack_types, val_to_str(pi->ancp_adjcode, adj_code_names, "Unknown Adjacency packet (%d)")); - return 1; + return TAP_PACKET_REDRAW; } static int diff --git a/epan/dissectors/packet-ansi_a.c b/epan/dissectors/packet-ansi_a.c index 4d791d351c..955e1c8a3a 100644 --- a/epan/dissectors/packet-ansi_a.c +++ b/epan/dissectors/packet-ansi_a.c @@ -10597,7 +10597,7 @@ static void ansi_a_dtap_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status ansi_a_dtap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -10609,7 +10609,7 @@ ansi_a_dtap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *e if (data_p->pdu_type == BSSAP_PDU_TYPE_DTAP) { if (my_try_val_to_str_idx(data_p->message_type, ansi_a_dtap_strings, &idx) == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); @@ -10617,10 +10617,10 @@ ansi_a_dtap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *e dtap_data->value.uint_value++; stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data); - return TRUE; + return TAP_PACKET_REDRAW; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } static void @@ -10665,7 +10665,7 @@ static void ansi_a_bsmap_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status ansi_a_bsmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -10677,7 +10677,7 @@ ansi_a_bsmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t * if (data_p->pdu_type == BSSAP_PDU_TYPE_BSMAP) { if (my_try_val_to_str_idx(data_p->message_type, ansi_a_bsmap_strings, &idx) == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); @@ -10685,10 +10685,10 @@ ansi_a_bsmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t * dtap_data->value.uint_value++; stat_tap_set_field_data(table, data_p->message_type, COUNT_COLUMN, dtap_data); - return TRUE; + return TAP_PACKET_REDRAW; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* Register the protocol with Wireshark */ diff --git a/epan/dissectors/packet-ansi_map.c b/epan/dissectors/packet-ansi_map.c index b7933f8a6e..ae68d9c884 100644 --- a/epan/dissectors/packet-ansi_map.c +++ b/epan/dissectors/packet-ansi_map.c @@ -16123,7 +16123,7 @@ static void ansi_map_stat_init(stat_tap_table_ui* new_stat) } -static gboolean +static tap_packet_status ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -16134,7 +16134,7 @@ ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt /* Only tracking field values we know */ if (try_val_to_str(data_p->message_type, ansi_map_opr_code_strings) == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); @@ -16152,7 +16152,7 @@ ansi_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt item_data->value.float_value = (float)total_bytes/(float)count; stat_tap_set_field_data(table, data_p->message_type, AVG_BYTES_COLUMN, item_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c index da6a20776a..939875e6c5 100644 --- a/epan/dissectors/packet-bacapp.c +++ b/epan/dissectors/packet-bacapp.c @@ -6189,7 +6189,7 @@ bacapp_get_address_label(const char *tag, address *addr) return label_str; } -static int +static tap_packet_status bacapp_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int packets_for_this_dst; @@ -6230,7 +6230,7 @@ bacapp_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } /* Stat: BACnet Packets sorted by Service */ @@ -6243,7 +6243,7 @@ bacapp_service_stats_tree_init(stats_tree* st) st_node_packets_by_service = stats_tree_create_pivot(st, st_str_packets_by_service, 0); } -static int +static tap_packet_status bacapp_stats_tree_service(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int servicetype; @@ -6272,7 +6272,7 @@ bacapp_stats_tree_service(stats_tree* st, packet_info* pinfo, epan_dissect_t* ed wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } /* Stat: BACnet Packets sorted by Object Type */ @@ -6285,7 +6285,7 @@ bacapp_objectid_stats_tree_init(stats_tree* st) st_node_packets_by_objectid = stats_tree_create_pivot(st, st_str_packets_by_objectid, 0); } -static int +static tap_packet_status bacapp_stats_tree_objectid(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int servicetype; @@ -6313,7 +6313,7 @@ bacapp_stats_tree_objectid(stats_tree* st, packet_info* pinfo, epan_dissect_t* e wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } /* Stat: BACnet Packets sorted by Instance No */ @@ -6326,7 +6326,7 @@ bacapp_instanceid_stats_tree_init(stats_tree* st) st_node_packets_by_instanceid = stats_tree_create_pivot(st, st_str_packets_by_instanceid, 0); } -static int +static tap_packet_status bacapp_stats_tree_instanceid(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { int servicetype; @@ -6354,7 +6354,7 @@ bacapp_stats_tree_instanceid(stats_tree* st, packet_info* pinfo, epan_dissect_t* wmem_free(NULL, srcstr); wmem_free(NULL, dststr); - return 1; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-bluetooth.c b/epan/dissectors/packet-bluetooth.c index c89997a467..5605a09ae7 100644 --- a/epan/dissectors/packet-bluetooth.c +++ b/epan/dissectors/packet-bluetooth.c @@ -2818,7 +2818,7 @@ static const char* bluetooth_get_filter_type(hostlist_talker_t* host, conv_filte static hostlist_dissector_info_t bluetooth_dissector_info = {&bluetooth_get_filter_type}; -static int +static tap_packet_status bluetooth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_) { @@ -2827,11 +2827,11 @@ bluetooth_conversation_packet(void *pct, packet_info *pinfo, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &bluetooth_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } -static int +static tap_packet_status bluetooth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_) { @@ -2840,7 +2840,7 @@ bluetooth_hostlist_packet(void *pit, packet_info *pinfo, add_hostlist_table_data(hash, &pinfo->dl_src, 0, TRUE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &pinfo->dl_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &bluetooth_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static conversation_t * diff --git a/epan/dissectors/packet-camel.c b/epan/dissectors/packet-camel.c index c5b568835a..8390548341 100644 --- a/epan/dissectors/packet-camel.c +++ b/epan/dissectors/packet-camel.c @@ -1318,7 +1318,7 @@ camelstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static gboolean +static tap_packet_status camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi) { guint idx = 0; @@ -1337,7 +1337,7 @@ camelstat_packet(void *pcamel, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_srt_table_data(camel_srt_table, i, &pi->msginfo[i].req_time, pinfo); } } /* category */ - return TRUE; + return TAP_PACKET_REDRAW; } @@ -8255,7 +8255,7 @@ static void camel_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *csi_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -8266,12 +8266,12 @@ camel_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_ table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); if (csi->opcode >= table->num_elements) - return FALSE; + return TAP_PACKET_DONT_REDRAW; msg_data = stat_tap_get_field_data(table, csi->opcode, COUNT_COLUMN); msg_data->value.uint_value++; stat_tap_set_field_data(table, csi->opcode, COUNT_COLUMN, msg_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-collectd.c b/epan/dissectors/packet-collectd.c index 823aa3a15a..7534321d86 100644 --- a/epan/dissectors/packet-collectd.c +++ b/epan/dissectors/packet-collectd.c @@ -211,7 +211,7 @@ collectd_stats_tree_init (stats_tree *st) st_collectd_values); } /* void collectd_stats_tree_init */ -static int +static tap_packet_status collectd_stats_tree_packet (stats_tree *st, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *user_data) { @@ -220,7 +220,7 @@ collectd_stats_tree_packet (stats_tree *st, packet_info *pinfo _U_, td = (const tap_data_t *)user_data; if (td == NULL) - return (-1); + return (TAP_PACKET_DONT_REDRAW); tick_stat_node (st, "Packets", 0, FALSE); increase_stat_node (st, "Values", 0, TRUE, td->values_num); @@ -249,7 +249,7 @@ collectd_stats_tree_packet (stats_tree *st, packet_info *pinfo _U_, sc->string); } - return (1); + return (TAP_PACKET_REDRAW); } /* int collectd_stats_tree_packet */ static void diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index e9eea18ae0..57591c7d21 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -1940,7 +1940,7 @@ dcerpcstat_init(struct register_srt* srt, GArray* srt_array) } } -static int +static tap_packet_status dcerpcstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -1953,31 +1953,31 @@ dcerpcstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const tap_data = (dcerpcstat_tap_data_t*)dcerpc_srt_table->table_specific_data; if(!ri->call_data){ - return 0; + return TAP_PACKET_DONT_REDRAW; } if(!ri->call_data->req_frame){ /* we have not seen the request so we don't know the delta*/ - return 0; + return TAP_PACKET_DONT_REDRAW; } if(ri->call_data->opnum >= tap_data->num_procedures){ /* don't handle this since it's outside of known table */ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* we are only interested in reply packets */ if(ri->ptype != PDU_RESP){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* we are only interested in certain program/versions */ if( (!uuid_equal( (&ri->call_data->uuid), (&tap_data->uuid))) ||(ri->call_data->ver != tap_data->ver)){ - return 0; + return TAP_PACKET_DONT_REDRAW; } add_srt_table_data(dcerpc_srt_table, ri->call_data->opnum, &ri->call_data->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } static guint diff --git a/epan/dissectors/packet-dcm.c b/epan/dissectors/packet-dcm.c index 69fd5e9699..6056511042 100644 --- a/epan/dissectors/packet-dcm.c +++ b/epan/dissectors/packet-dcm.c @@ -417,7 +417,7 @@ typedef struct _dicom_eo_t { guint8 *payload_data; } dicom_eo_t; -static gboolean +static tap_packet_status dcm_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { @@ -442,9 +442,9 @@ dcm_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, object_list->add_entry(object_list->gui_data, entry); - return TRUE; /* State changed - window should be redrawn */ + return TAP_PACKET_REDRAW; /* State changed - window should be redrawn */ } else { - return FALSE; /* State unchanged - no window updates needed */ + return TAP_PACKET_DONT_REDRAW; /* State unchanged - no window updates needed */ } } diff --git a/epan/dissectors/packet-dhcp.c b/epan/dissectors/packet-dhcp.c index 71052d90aa..1975cb0122 100644 --- a/epan/dissectors/packet-dhcp.c +++ b/epan/dissectors/packet-dhcp.c @@ -6679,7 +6679,7 @@ static void dhcp_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status dhcp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -6691,14 +6691,14 @@ dhcp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, idx = str_to_val_idx(value, opt53_text); if (idx < 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); msg_data = stat_tap_get_field_data(table, idx, PACKET_COLUMN); msg_data->value.uint_value++; stat_tap_set_field_data(table, idx, PACKET_COLUMN, msg_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c index ce8ea404de..e606043c20 100644 --- a/epan/dissectors/packet-diameter.c +++ b/epan/dissectors/packet-diameter.c @@ -385,7 +385,7 @@ diameterstat_init(struct register_srt* srt _U_, GArray* srt_array) init_srt_table_row(diameter_srt_table, 0, "Unknown"); } -static int +static tap_packet_status diameterstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -398,7 +398,7 @@ diameterstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, cons * Unpaired diameter messages are currently not supported by statistics. * Return 0, since redraw is not needed. */ if(!diameter || diameter->processing_request || !diameter->req_frame) - return 0; + return TAP_PACKET_DONT_REDRAW; diameter_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); @@ -412,7 +412,7 @@ diameterstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_srt_table_data(diameter_srt_table, *idx, &diameter->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-dns.c b/epan/dissectors/packet-dns.c index 098e235ef9..a77a5fa35b 100644 --- a/epan/dissectors/packet-dns.c +++ b/epan/dissectors/packet-dns.c @@ -4181,7 +4181,7 @@ static void dns_stats_tree_init(stats_tree* st) st_node_service_rrt = stats_tree_create_node(st, st_str_service_rrt, st_node_service_stats, STAT_DT_FLOAT, FALSE); } -static int dns_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) +static tap_packet_status dns_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const struct DnsTap *pi = (const struct DnsTap *)p; tick_stat_node(st, st_str_packets, 0, FALSE); @@ -4237,7 +4237,7 @@ static int dns_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_di } } } - return 1; + return TAP_PACKET_REDRAW; } void diff --git a/epan/dissectors/packet-eth.c b/epan/dissectors/packet-eth.c index 986165b290..2c7b9f45f5 100644 --- a/epan/dissectors/packet-eth.c +++ b/epan/dissectors/packet-eth.c @@ -122,7 +122,7 @@ static const char* eth_conv_get_filter_type(conv_item_t* conv, conv_filter_type_ static ct_dissector_info_t eth_ct_dissector_info = {ð_conv_get_filter_type}; -static int +static tap_packet_status eth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -130,7 +130,7 @@ eth_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, add_conversation_table_data(hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, ð_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* eth_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -143,7 +143,7 @@ static const char* eth_host_get_filter_type(hostlist_talker_t* host, conv_filter static hostlist_dissector_info_t eth_host_dissector_info = {ð_host_get_filter_type}; -static int +static tap_packet_status eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -155,7 +155,7 @@ eth_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_hostlist_table_data(hash, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, ð_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, ð_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static gboolean diff --git a/epan/dissectors/packet-f5ethtrailer.c b/epan/dissectors/packet-f5ethtrailer.c index 557ccbf0d0..0736eb66cb 100644 --- a/epan/dissectors/packet-f5ethtrailer.c +++ b/epan/dissectors/packet-f5ethtrailer.c @@ -649,10 +649,11 @@ static void f5eth_tmmdist_stats_tree_init( * @param pinfo A pointer to the packet info. * @param edt Unused * @param data A pointer to the data provided by the tap - * @return 1 if the data was actually used to alter the statistics, 0 otherwise. + * @return TAP_PACKET_REDRAW if the data was actually used to alter + * the statistics, TAP_PACKET_DONT_REDRAW otherwise. * */ -static int f5eth_tmmdist_stats_tree_packet( +static tap_packet_status f5eth_tmmdist_stats_tree_packet( stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, @@ -667,12 +668,12 @@ static int f5eth_tmmdist_stats_tree_packet( char tmm_stat_name_buffer[PER_TMM_STAT_NAME_BUF_LEN]; if(tdata == NULL) - return 0; + return TAP_PACKET_DONT_REDRAW; /* Unnecessary since this tap packet function and the F5 Ethernet trailer dissector are both in * the same source file. If you are using this function as an example in a separate tap source * file, you should uncomment this. - if(check_f5eth_tap_magic(tdata) == 0) return 0; + if(check_f5eth_tap_magic(tdata) == 0) return TAP_PACKET_DONT_REDRAW; */ g_snprintf(tmm_stat_name_buffer, PER_TMM_STAT_NAME_BUF_LEN, "slot %3d,tmm %3d", @@ -734,7 +735,7 @@ static int f5eth_tmmdist_stats_tree_packet( increase_stat_node(st, st_str_tmm_flow_none, st_node_tmm_bytes, FALSE, 0); } - return 1; + return TAP_PACKET_REDRAW; } /* f5eth_tmmdist_stats_tree_packet() */ /*-----------------------------------------------------------------------------------------------*/ @@ -757,7 +758,7 @@ static void f5eth_virtdist_stats_tree_init( } /* f5eth_virtdist_stats_tree_init() */ /*-----------------------------------------------------------------------------------------------*/ -static int f5eth_virtdist_stats_tree_packet( +static tap_packet_status f5eth_virtdist_stats_tree_packet( stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, @@ -767,11 +768,11 @@ static int f5eth_virtdist_stats_tree_packet( guint32 pkt_len; if (tdata == NULL) - return 0; + return TAP_PACKET_DONT_REDRAW; /* Unnecessary since this tap packet function and the F5 Ethernet trailer dissector are both in * the same source file. If you are using this function as an example in a separate tap source * file, you should uncomment this. - if(check_f5eth_tap_magic(tdata) == 0) return 0; + if(check_f5eth_tap_magic(tdata) == 0) return TAP_PACKET_DONT_REDRAW; */ pkt_len = pinfo->fd->pkt_len - tdata->trailer_len; @@ -797,7 +798,7 @@ static int f5eth_virtdist_stats_tree_packet( increase_stat_node(st, tdata->virtual_name, st_node_virtbytedist, TRUE, pkt_len); } - return 1; + return TAP_PACKET_REDRAW; } /* f5eth_virtdist_stats_tree_packet() */ @@ -1373,7 +1374,7 @@ static void render_analysis( /*-----------------------------------------------------------------------------------------------*/ /** \brief Tap call back to retrieve information about the IP headers. */ -static gboolean ip_tap_pkt( +static tap_packet_status ip_tap_pkt( void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, @@ -1384,11 +1385,11 @@ static gboolean ip_tap_pkt( ad = (struct f5eth_analysis_data_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_f5ethtrailer, 0); - if(ad == NULL) return(FALSE); /* No F5 information */ - if(ad->ip_visited == 1) return(FALSE); + if(ad == NULL) return(TAP_PACKET_DONT_REDRAW); /* No F5 information */ + if(ad->ip_visited == 1) return(TAP_PACKET_DONT_REDRAW); ad->ip_visited = 1; - if(data == NULL) return(FALSE); + if(data == NULL) return(TAP_PACKET_DONT_REDRAW); iph = (const ws_ip4 *)data; /* Only care about TCP at this time */ @@ -1398,19 +1399,19 @@ static gboolean ip_tap_pkt( */ if(iph->ip_proto != IP_PROTO_TCP) { ad->ip_istcp = 0; - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } ad->ip_istcp = 1; ad->ip_isfrag = ((iph->ip_off & IP_OFFSET_MASK) || (iph->ip_off & IP_MF)) ? 1 : 0; - return(TRUE); + return(TAP_PACKET_REDRAW); } /* ip_tap_pkt() */ /*-----------------------------------------------------------------------------------------------*/ /** \brief Tap call back to retrieve information about the IPv6 headers. */ -static gboolean ipv6_tap_pkt( +static tap_packet_status ipv6_tap_pkt( void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, @@ -1421,11 +1422,11 @@ static gboolean ipv6_tap_pkt( ad = (struct f5eth_analysis_data_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_f5ethtrailer, 0); - if(ad == NULL) return(FALSE); /* No F5 information */ - if(ad->ip_visited == 1) return(FALSE); + if(ad == NULL) return(TAP_PACKET_DONT_REDRAW); /* No F5 information */ + if(ad->ip_visited == 1) return(TAP_PACKET_DONT_REDRAW); ad->ip_visited = 1; - if(data == NULL) return(FALSE); + if(data == NULL) return(TAP_PACKET_DONT_REDRAW); ipv6h = (const struct ws_ip6_hdr *)data; /* Only care about TCP at this time */ @@ -1439,18 +1440,18 @@ static gboolean ipv6_tap_pkt( * fragment, we don't care anyways (too much effort). */ if(ipv6h->ip6h_nxt != IP_PROTO_TCP) { ad->ip_istcp = 0; - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } ad->ip_istcp = 1; - return(TRUE); + return(TAP_PACKET_REDRAW); } /* ipv6_tap_pkt() */ /*-----------------------------------------------------------------------------------------------*/ /** \brief Tap call back to retrieve information about the TCP headers. */ -static gboolean tcp_tap_pkt( +static tap_packet_status tcp_tap_pkt( void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, @@ -1461,11 +1462,11 @@ static gboolean tcp_tap_pkt( ad = (struct f5eth_analysis_data_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_f5ethtrailer, 0); - if(ad == NULL) return(FALSE); /* No F5 information */ - if(ad->tcp_visited == 1) return(FALSE); + if(ad == NULL) return(TAP_PACKET_DONT_REDRAW); /* No F5 information */ + if(ad->tcp_visited == 1) return(TAP_PACKET_DONT_REDRAW); ad->tcp_visited = 1; - if(data == NULL) return(FALSE); + if(data == NULL) return(TAP_PACKET_DONT_REDRAW); tcph = (const tcp_info_t *)data; ad->tcp_synset = (tcph->th_flags & TH_SYN) ? 1 : 0; @@ -1491,7 +1492,7 @@ static gboolean tcp_tap_pkt( } } - return(TRUE); + return(TAP_PACKET_REDRAW); } /* tcp_tap_pkt() */ /* End of analysis functions */ diff --git a/epan/dissectors/packet-f5ethtrailer.h b/epan/dissectors/packet-f5ethtrailer.h index 02dec0d4e0..b3b3e10de3 100644 --- a/epan/dissectors/packet-f5ethtrailer.h +++ b/epan/dissectors/packet-f5ethtrailer.h @@ -167,7 +167,7 @@ static void f5fileinfo_tap_reset(void *p) # endif } /* f5fileinfo_tap_reset() */ -static gboolean f5fileinfo_tap_pkt( +static tap_packet_status f5fileinfo_tap_pkt( void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, @@ -181,7 +181,7 @@ static gboolean f5fileinfo_tap_pkt( if(fromtap->magic != F5FILEINFO_TAP_MAGIC) { /* Magic numbers do not match. f5ethtrailer plugin was compiled from * different source than this plugin. */ - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } if (s->ver[0] == fromtap->ver[0] && s->ver[1] == fromtap->ver[1] && @@ -190,7 +190,7 @@ static gboolean f5fileinfo_tap_pkt( s->ver[4] == fromtap->ver[4] && s->ver[5] == fromtap->ver[5]) { - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } s->ver[0] = fromtap->ver[0]; s->ver[1] = fromtap->ver[1]; @@ -201,7 +201,7 @@ static gboolean f5fileinfo_tap_pkt( # ifdef F5FILEINFO_TAP_POST_FUNC F5FILEINFO_TAP_POST_FUNC(s); # endif - return(TRUE); + return(TAP_PACKET_REDRAW); } /* f5fileinfo_tap_pkt() */ diff --git a/epan/dissectors/packet-fc.c b/epan/dissectors/packet-fc.c index 20b2cc9d5b..95cea82d5a 100644 --- a/epan/dissectors/packet-fc.c +++ b/epan/dissectors/packet-fc.c @@ -195,7 +195,7 @@ static const char* fc_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e static ct_dissector_info_t fc_ct_dissector_info = {&fc_conv_get_filter_type}; -static int +static tap_packet_status fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -203,7 +203,7 @@ fc_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c add_conversation_table_data(hash, &fchdr->s_id, &fchdr->d_id, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &fc_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* fc_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -216,7 +216,7 @@ static const char* fc_host_get_filter_type(hostlist_talker_t* host, conv_filter_ static hostlist_dissector_info_t fc_host_dissector_info = {&fc_host_get_filter_type}; -static int +static tap_packet_status fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -228,7 +228,7 @@ fc_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const add_hostlist_table_data(hash, &fchdr->s_id, 0, TRUE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &fchdr->d_id, 0, FALSE, 1, pinfo->fd->pkt_len, &fc_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } #define FC_NUM_PROCEDURES 256 @@ -248,7 +248,7 @@ fcstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static int +static tap_packet_status fcstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -258,17 +258,17 @@ fcstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void /* we are only interested in reply packets */ if(!(fc->fctl&FC_FCTL_EXCHANGE_RESPONDER)){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* if we havnt seen the request, just ignore it */ if ( (!fc->fc_ex) || (fc->fc_ex->first_exchange_frame==0) ){ - return 0; + return TAP_PACKET_DONT_REDRAW; } fc_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); add_srt_table_data(fc_srt_table, fc->type, &fc->fc_ex->fc_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-fddi.c b/epan/dissectors/packet-fddi.c index 2a52960f8e..fd79f479b3 100644 --- a/epan/dissectors/packet-fddi.c +++ b/epan/dissectors/packet-fddi.c @@ -154,7 +154,7 @@ static const char* fddi_conv_get_filter_type(conv_item_t* conv, conv_filter_type static ct_dissector_info_t fddi_ct_dissector_info = {&fddi_conv_get_filter_type}; -static int +static tap_packet_status fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -162,7 +162,7 @@ fddi_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, add_conversation_table_data(hash, &ehdr->src, &ehdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &fddi_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* fddi_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -175,7 +175,7 @@ static const char* fddi_host_get_filter_type(hostlist_talker_t* host, conv_filte static hostlist_dissector_info_t fddi_host_dissector_info = {&fddi_host_get_filter_type}; -static int +static tap_packet_status fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -187,7 +187,7 @@ fddi_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con add_hostlist_table_data(hash, &ehdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &ehdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &fddi_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static gboolean diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index 55de4126bb..966441692d 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -152,14 +152,14 @@ static dissector_table_t wtap_fts_rec_dissector_table; /****************************************************************************/ /* whenever a frame packet is seen by the tap listener */ /* Add a new frame into the graph */ -static gboolean +static tap_packet_status frame_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); if (!sai) - return FALSE; + return TAP_PACKET_DONT_REDRAW; sai->frame_number = pinfo->num; @@ -176,7 +176,7 @@ frame_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U g_queue_push_tail(sainfo->items, sai); - return TRUE; + return TAP_PACKET_REDRAW; } /* diff --git a/epan/dissectors/packet-gsm_a_common.c b/epan/dissectors/packet-gsm_a_common.c index 846b961fb7..e0beb6e3a2 100644 --- a/epan/dissectors/packet-gsm_a_common.c +++ b/epan/dissectors/packet-gsm_a_common.c @@ -3653,7 +3653,7 @@ static void gsm_a_sacch_rr_stat_init(stat_tap_table_ui* new_stat) "GSM A-I/F SACCH Statistics", gsm_a_rr_short_pd_msg_strings); } -static gboolean +static tap_packet_status gsm_a_stat_packet(void *tapdata, const void *gatr_ptr, guint8 pdu_type, int protocol_disc) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -3662,73 +3662,73 @@ gsm_a_stat_packet(void *tapdata, const void *gatr_ptr, guint8 pdu_type, int prot stat_tap_table_item_type* msg_data; guint i = 0; - if (gatr->pdu_type != pdu_type) return FALSE; - if (pdu_type == BSSAP_PDU_TYPE_DTAP && (int)gatr->protocol_disc != protocol_disc) return FALSE; - if (pdu_type == GSM_A_PDU_TYPE_SACCH && gatr->protocol_disc != 0) return FALSE; + if (gatr->pdu_type != pdu_type) return TAP_PACKET_DONT_REDRAW; + if (pdu_type == BSSAP_PDU_TYPE_DTAP && (int)gatr->protocol_disc != protocol_disc) return TAP_PACKET_DONT_REDRAW; + if (pdu_type == GSM_A_PDU_TYPE_SACCH && gatr->protocol_disc != 0) return TAP_PACKET_DONT_REDRAW; table = g_array_index(stat_data->stat_tap_data->tables, stat_tap_table*, i); msg_data = stat_tap_get_field_data(table, gatr->message_type, COUNT_COLUMN); msg_data->value.uint_value++; stat_tap_set_field_data(table, gatr->message_type, COUNT_COLUMN, msg_data); - return TRUE; + return TAP_PACKET_REDRAW; } -static gboolean +static tap_packet_status gsm_a_bssmap_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_BSSMAP, 0); } -static gboolean +static tap_packet_status gsm_a_dtap_mm_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_MM); } -static gboolean +static tap_packet_status gsm_a_dtap_rr_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_RR); } -static gboolean +static tap_packet_status gsm_a_dtap_cc_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_CC); } -static gboolean +static tap_packet_status gsm_a_dtap_gmm_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_GMM); } -static gboolean +static tap_packet_status gsm_a_dtap_sms_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_SMS); } -static gboolean +static tap_packet_status gsm_a_dtap_sm_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_SM); } -static gboolean +static tap_packet_status gsm_a_dtap_ss_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_SS); } -static gboolean +static tap_packet_status gsm_a_dtap_tp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, BSSAP_PDU_TYPE_DTAP, PD_TP); } -static gboolean +static tap_packet_status gsm_a_sacch_rr_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gatr_ptr) { return gsm_a_stat_packet(tapdata, gatr_ptr, GSM_A_PDU_TYPE_SACCH, 0); diff --git a/epan/dissectors/packet-gsm_map.c b/epan/dissectors/packet-gsm_map.c index a468c50312..8bea492d45 100644 --- a/epan/dissectors/packet-gsm_map.c +++ b/epan/dissectors/packet-gsm_map.c @@ -23700,7 +23700,7 @@ static void gsm_map_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status gsm_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *gmtr_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -23755,7 +23755,7 @@ gsm_map_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _ avg_data = stat_tap_get_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN); avg_data->value.float_value += (float) (fwd_bytes + rev_bytes) / (invokes + results); stat_tap_set_field_data(table, gmtr->opcode, AVG_BYTES_COLUMN, avg_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-gsm_osmux.c b/epan/dissectors/packet-gsm_osmux.c index f291814085..c0f042c956 100644 --- a/epan/dissectors/packet-gsm_osmux.c +++ b/epan/dissectors/packet-gsm_osmux.c @@ -383,8 +383,8 @@ static void osmux_stats_tree_init(stats_tree *st) st_osmux_stats_conn = stats_tree_create_node(st, st_str_conn, st_osmux_stats, STAT_DT_INT, TRUE); } -static int osmux_stats_tree_packet(stats_tree *st, packet_info *pinfo, - epan_dissect_t *edt _U_, const void *p _U_) +static tap_packet_status osmux_stats_tree_packet(stats_tree *st, + packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { gchar* stream_name; gchar* ft_name; @@ -463,7 +463,7 @@ static int osmux_stats_tree_packet(stats_tree *st, packet_info *pinfo, } - return 1; + return TAP_PACKET_REDRAW; } void proto_register_osmux(void) diff --git a/epan/dissectors/packet-gtp.c b/epan/dissectors/packet-gtp.c index bfe432e6e9..5a5c8cb8f3 100644 --- a/epan/dissectors/packet-gtp.c +++ b/epan/dissectors/packet-gtp.c @@ -2088,7 +2088,7 @@ gtpstat_init(struct register_srt* srt _U_, GArray* srt_array) init_srt_table_row(gtp_srt_table, 3, "Delete PDP context"); } -static int +static tap_packet_status gtpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -2099,11 +2099,11 @@ gtpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi /* we are only interested in reply packets */ if(gtp->is_request){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* if we have not seen the request, just ignore it */ if(!gtp->req_frame){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* Only use the commands we know how to handle, this is not a comprehensive list */ @@ -2122,13 +2122,13 @@ gtpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi case GTP_MSG_DELETE_PDP_REQ: idx=3; break; default: - return 0; + return TAP_PACKET_DONT_REDRAW; } gtp_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); add_srt_table_data(gtp_srt_table, idx, >p->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-h225.c b/epan/dissectors/packet-h225.c index 5d09e0acf6..63fbae7b00 100644 --- a/epan/dissectors/packet-h225.c +++ b/epan/dissectors/packet-h225.c @@ -1202,7 +1202,7 @@ typedef enum _ras_category { #define NUM_RAS_STATS 7 -static gboolean +static tap_packet_status h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi) { rtd_data_t* rtd_data = (rtd_data_t*)phs; @@ -1214,7 +1214,7 @@ h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, co if (pi->msg_type != H225_RAS || pi->msg_tag == -1) { /* No RAS Message or uninitialized msg_tag -> return */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } if (pi->msg_tag < 21) { @@ -1224,7 +1224,7 @@ h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, co } else { /* No SRT yet (ToDo) */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } switch(rasmsg_type) { @@ -1256,9 +1256,9 @@ h225rassrt_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, co break; default: - return FALSE; + return TAP_PACKET_DONT_REDRAW; } - return TRUE; + return TAP_PACKET_REDRAW; } @@ -8238,7 +8238,7 @@ static void h225_stat_init(stat_tap_table_ui* new_stat) other_idx = row_idx; } -static gboolean +static tap_packet_status h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *hpi_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -8247,7 +8247,7 @@ h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, int reason_idx = -1; if(hpi->msg_tag < 0) { /* uninitialized */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } switch (hpi->msg_type) { @@ -8339,9 +8339,9 @@ h225_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, stat_tap_set_field_data(table, reason_idx, COUNT_COLUMN, msg_data); } - return TRUE; + return TAP_PACKET_REDRAW; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } static void diff --git a/epan/dissectors/packet-hartip.c b/epan/dissectors/packet-hartip.c index 7a4a598a07..c4839e23eb 100644 --- a/epan/dissectors/packet-hartip.c +++ b/epan/dissectors/packet-hartip.c @@ -329,7 +329,7 @@ hartip_stats_tree_init(stats_tree* st) st_node_errors = stats_tree_create_node(st, st_str_errors, st_node_packets, STAT_DT_INT, TRUE); } -static int +static tap_packet_status hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { @@ -356,7 +356,7 @@ hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, message_type_node = st_node_errors; break; default: - return 0; /* Don't want to track invalid messages for now. */ + return TAP_PACKET_DONT_REDRAW; /* Don't want to track invalid messages for now. */ } message_id_node_str = val_to_str(tapinfo->message_id, @@ -367,7 +367,7 @@ hartip_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, tick_stat_node(st, message_type_node_str, st_node_packets, FALSE); tick_stat_node(st, message_id_node_str, message_type_node, FALSE); - return 1; + return TAP_PACKET_REDRAW; } static gint diff --git a/epan/dissectors/packet-hpfeeds.c b/epan/dissectors/packet-hpfeeds.c index 41fa3f9415..8ffb40ebb2 100644 --- a/epan/dissectors/packet-hpfeeds.c +++ b/epan/dissectors/packet-hpfeeds.c @@ -212,7 +212,7 @@ static void hpfeeds_stats_tree_init(stats_tree* st) channels_list = wmem_list_new(wmem_epan_scope()); } -static int hpfeeds_stats_tree_packet(stats_tree* st _U_, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) +static tap_packet_status hpfeeds_stats_tree_packet(stats_tree* st _U_, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const struct HpfeedsTap *pi = (const struct HpfeedsTap *)p; wmem_list_frame_t* head = wmem_list_head(channels_list); @@ -243,7 +243,7 @@ static int hpfeeds_stats_tree_packet(stats_tree* st _U_, packet_info* pinfo _U_, stats_tree_tick_pivot(st, st_node_opcodes, val_to_str(pi->opcode, opcode_vals, "Unknown opcode (%d)")); - return 1; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 8fd72e5aa2..4c0e5c9f1e 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -338,7 +338,7 @@ typedef struct _http_eo_t { const guint8 *payload_data; } http_eo_t; -static gboolean +static tap_packet_status http_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { export_object_list_t *object_list = (export_object_list_t *)tapdata; @@ -359,9 +359,9 @@ http_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const object_list->add_entry(object_list->gui_data, entry); - return TRUE; /* State changed - window should be redrawn */ + return TAP_PACKET_REDRAW; /* State changed - window should be redrawn */ } else { - return FALSE; /* State unchanged - no window updates needed */ + return TAP_PACKET_DONT_REDRAW; /* State unchanged - no window updates needed */ } } @@ -463,7 +463,7 @@ http_reqs_stats_tree_init(stats_tree* st) } /* HTTP/Load Distribution stats packet function */ -static int +static tap_packet_status http_reqs_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* edt _U_, const void* p) { const http_info_value_t* v = (const http_info_value_t*)p; @@ -491,7 +491,7 @@ http_reqs_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* wmem_free(NULL, ip_str); - return 1; + return TAP_PACKET_REDRAW; } else if (i != 0) { ip_str = address_to_str(NULL, &pinfo->src); @@ -507,10 +507,10 @@ http_reqs_stats_tree_packet(stats_tree* st, packet_info* pinfo, epan_dissect_t* wmem_free(NULL, ip_str); - return 1; + return TAP_PACKET_REDRAW; } - return 0; + return TAP_PACKET_DONT_REDRAW; } @@ -525,7 +525,7 @@ http_req_stats_tree_init(stats_tree* st) } /* HTTP/Requests stats packet function */ -static int +static tap_packet_status http_req_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const http_info_value_t* v = (const http_info_value_t*)p; @@ -542,10 +542,10 @@ http_req_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_ } } - return 1; + return TAP_PACKET_REDRAW; } - return 0; + return TAP_PACKET_DONT_REDRAW; } static const gchar *st_str_packets = "Total HTTP Packets"; @@ -588,7 +588,7 @@ http_stats_tree_init(stats_tree* st) } /* HTTP/Packet Counter stats packet function */ -static int +static tap_packet_status http_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const http_info_value_t* v = (const http_info_value_t*)p; @@ -633,7 +633,7 @@ http_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* e tick_stat_node(st, st_str_other, st_node_packets, FALSE); } - return 1; + return TAP_PACKET_REDRAW; } /* @@ -859,7 +859,7 @@ determine_http_location_target(const gchar *base_url, const gchar * location_url } /* HTTP/Request Sequences stats packet function */ -static int +static tap_packet_status http_seq_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const http_info_value_t* v = (const http_info_value_t*)p; @@ -915,7 +915,7 @@ http_seq_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_ current_node_id_p = parent_node_id_p; } } - return 0; + return TAP_PACKET_DONT_REDRAW; } diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c index 30d00f2513..1bcb7bb724 100644 --- a/epan/dissectors/packet-http2.c +++ b/epan/dissectors/packet-http2.c @@ -3369,14 +3369,14 @@ static void http2_stats_tree_init(stats_tree* st) } -static int http2_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) +static tap_packet_status http2_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const struct HTTP2Tap *pi = (const struct HTTP2Tap *)p; tick_stat_node(st, st_str_http2, 0, FALSE); stats_tree_tick_pivot(st, st_node_http2_type, val_to_str(pi->type, http2_type_vals, "Unknown type (%d)")); - return 1; + return TAP_PACKET_REDRAW; } void diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c index 276a01be48..b0f1912f7e 100644 --- a/epan/dissectors/packet-icmp.c +++ b/epan/dissectors/packet-icmp.c @@ -437,14 +437,14 @@ static const value_string interface_role_str[] = { /* whenever a ICMP packet is seen by the tap listener */ /* Add a new frame into the graph */ -static gboolean +static tap_packet_status icmp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); if (!sai) - return FALSE; + return TAP_PACKET_DONT_REDRAW; sai->frame_number = pinfo->num; @@ -470,7 +470,7 @@ icmp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_ g_queue_push_tail(sainfo->items, sai); - return TRUE; + return TAP_PACKET_REDRAW; } static conversation_t *_find_or_create_conversation(packet_info * pinfo) diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c index f7ac0290b9..55b6f22844 100644 --- a/epan/dissectors/packet-icmpv6.c +++ b/epan/dissectors/packet-icmpv6.c @@ -1339,14 +1339,14 @@ static const value_string ext_echo_reply_state_str[] = { /* whenever a ICMPv6 packet is seen by the tap listener */ /* Add a new frame into the graph */ -static gboolean +static tap_packet_status icmpv6_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *dummy _U_) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); if (!sai) - return FALSE; + return TAP_PACKET_DONT_REDRAW; sai->frame_number = pinfo->num; @@ -1372,7 +1372,7 @@ icmpv6_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _ g_queue_push_tail(sainfo->items, sai); - return TRUE; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index 854847a5b4..c951bf0ba4 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -6288,7 +6288,7 @@ wlan_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter) static ct_dissector_info_t wlan_ct_dissector_info = {&wlan_conv_get_filter_type}; -static int +static tap_packet_status wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -6296,7 +6296,7 @@ wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, add_conversation_table_data(hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &wlan_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* @@ -6310,7 +6310,7 @@ wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) static hostlist_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type}; -static int +static tap_packet_status wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -6322,7 +6322,7 @@ wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con add_hostlist_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 3ed55dc8e7..c4fa78b13b 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -152,7 +152,7 @@ typedef struct _imf_eo_t { gchar *payload_data; } imf_eo_t; -static gboolean +static tap_packet_status imf_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { export_object_list_t *object_list = (export_object_list_t *)tapdata; @@ -182,9 +182,9 @@ imf_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const object_list->add_entry(object_list->gui_data, entry); - return TRUE; /* State changed - window should be redrawn */ + return TAP_PACKET_REDRAW; /* State changed - window should be redrawn */ } else { - return FALSE; /* State unchanged - no window updates needed */ + return TAP_PACKET_DONT_REDRAW; /* State unchanged - no window updates needed */ } } diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c index 3362284fdf..d8d5e37d27 100644 --- a/epan/dissectors/packet-ip.c +++ b/epan/dissectors/packet-ip.c @@ -506,7 +506,7 @@ static const char* ip_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e static ct_dissector_info_t ip_ct_dissector_info = {&ip_conv_get_filter_type}; -static int +static tap_packet_status ip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -514,7 +514,7 @@ ip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c add_conversation_table_data(hash, &iph->ip_src, &iph->ip_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ip_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* ip_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -527,7 +527,7 @@ static const char* ip_host_get_filter_type(hostlist_talker_t* host, conv_filter_ static hostlist_dissector_info_t ip_host_dissector_info = {&ip_host_get_filter_type}; -static int +static tap_packet_status ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -538,7 +538,7 @@ ip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const XXX - this could probably be done more efficiently inside hostlist_table */ add_hostlist_table_data(hash, &iph->ip_src, 0, TRUE, 1, pinfo->fd->pkt_len, &ip_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &iph->ip_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ip_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static gboolean diff --git a/epan/dissectors/packet-ipv6.c b/epan/dissectors/packet-ipv6.c index e031ada19c..128955569f 100644 --- a/epan/dissectors/packet-ipv6.c +++ b/epan/dissectors/packet-ipv6.c @@ -426,7 +426,7 @@ static const char* ipv6_conv_get_filter_type(conv_item_t* conv, conv_filter_type static ct_dissector_info_t ipv6_ct_dissector_info = {&ipv6_conv_get_filter_type}; -static int +static tap_packet_status ipv6_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -436,7 +436,7 @@ ipv6_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ipv6_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* ipv6_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -449,7 +449,7 @@ static const char* ipv6_host_get_filter_type(hostlist_talker_t* host, conv_filte static hostlist_dissector_info_t ipv6_host_dissector_info = {&ipv6_host_get_filter_type}; -static int +static tap_packet_status ipv6_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -460,7 +460,7 @@ ipv6_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con add_hostlist_table_data(hash, &ip6->ip6_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ipv6_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static gboolean diff --git a/epan/dissectors/packet-ipx.c b/epan/dissectors/packet-ipx.c index 13aee9abce..b352c1ca88 100644 --- a/epan/dissectors/packet-ipx.c +++ b/epan/dissectors/packet-ipx.c @@ -148,7 +148,7 @@ static const char* ipx_conv_get_filter_type(conv_item_t* conv, conv_filter_type_ static ct_dissector_info_t ipx_ct_dissector_info = {&ipx_conv_get_filter_type}; -static int +static tap_packet_status ipx_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -156,7 +156,7 @@ ipx_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, add_conversation_table_data(hash, &ipxh->ipx_src, &ipxh->ipx_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ipx_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* ipx_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -169,7 +169,7 @@ static const char* ipx_host_get_filter_type(hostlist_talker_t* host, conv_filter static hostlist_dissector_info_t ipx_host_dissector_info = {&ipx_host_get_filter_type}; -static int +static tap_packet_status ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -181,7 +181,7 @@ ipx_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_hostlist_table_data(hash, &ipxh->ipx_src, 0, TRUE, 1, pinfo->fd->pkt_len, &ipx_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &ipxh->ipx_dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ipx_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } /* ================================================================= */ diff --git a/epan/dissectors/packet-isup.c b/epan/dissectors/packet-isup.c index 437e071745..d91c745e67 100644 --- a/epan/dissectors/packet-isup.c +++ b/epan/dissectors/packet-isup.c @@ -10424,7 +10424,7 @@ msg_stats_tree_init(stats_tree *st) st_node_dir = stats_tree_create_node(st, "Messages by Direction", 0, STAT_DT_INT, TRUE); } -static int +static tap_packet_status msg_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p) { const gchar *msg = try_val_to_str_ext(((const isup_tap_rec_t*)p)->message_type, &isup_message_type_value_acro_ext); @@ -10446,7 +10446,7 @@ msg_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U wmem_free(NULL, dir); - return 1; + return TAP_PACKET_REDRAW; } /*---------------------------------------------------------------------*/ diff --git a/epan/dissectors/packet-jxta.c b/epan/dissectors/packet-jxta.c index 0c39902ec7..67feda9a9b 100644 --- a/epan/dissectors/packet-jxta.c +++ b/epan/dissectors/packet-jxta.c @@ -183,7 +183,7 @@ static const char* jxta_conv_get_filter_type(conv_item_t* conv, conv_filter_type static ct_dissector_info_t jxta_ct_dissector_info = {&jxta_conv_get_filter_type}; -static int +static tap_packet_status jxta_conversation_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -192,7 +192,7 @@ jxta_conversation_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt add_conversation_table_data(hash, &jxtahdr->src_address, &jxtahdr->dest_address, 0, 0, 1, jxtahdr->size, NULL, NULL, &jxta_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* jxta_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -205,7 +205,7 @@ static const char* jxta_host_get_filter_type(hostlist_talker_t* host, conv_filte static hostlist_dissector_info_t jxta_host_dissector_info = {&jxta_host_get_filter_type}; -static int +static tap_packet_status jxta_hostlist_packet(void *pit, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -216,7 +216,7 @@ jxta_hostlist_packet(void *pit, packet_info *pinfo _U_, epan_dissect_t *edt _U_, XXX - this could probably be done more efficiently inside hostlist_table */ add_hostlist_table_data(hash, &jxtahdr->src_address, 0, TRUE, 1, jxtahdr->size, &jxta_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &jxtahdr->dest_address, 0, FALSE, 1, jxtahdr->size, &jxta_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static int uri_to_str(const address* addr, gchar *buf, int buf_len) diff --git a/epan/dissectors/packet-lbmc.c b/epan/dissectors/packet-lbmc.c index 654b94369f..208a117dca 100644 --- a/epan/dissectors/packet-lbmc.c +++ b/epan/dissectors/packet-lbmc.c @@ -6062,7 +6062,7 @@ typedef struct const gchar * description; } lbm_uim_stream_info_t; -static gboolean +static tap_packet_status lbm_uim_seq_analysis_packet(void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *uim_info) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; @@ -6078,7 +6078,7 @@ lbm_uim_seq_analysis_packet(void *ptr, packet_info *pinfo, epan_dissect_t *edt _ if (stream_info->endpoint_a.type != stream_info->endpoint_b.type) { - return TRUE; + return TAP_PACKET_DONT_REDRAW; } if (stream_info->endpoint_a.type == lbm_uim_instance_stream) { @@ -6187,7 +6187,7 @@ lbm_uim_seq_analysis_packet(void *ptr, packet_info *pinfo, epan_dissect_t *edt _ g_queue_push_tail(sainfo->items, sai); - return TRUE; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-lbmr.c b/epan/dissectors/packet-lbmr.c index 2898610a6d..f71b4183e0 100644 --- a/epan/dissectors/packet-lbmr.c +++ b/epan/dissectors/packet-lbmr.c @@ -2015,14 +2015,14 @@ static void lbmr_tag_free_cb(void * record) } } -static gboolean lbmr_match_packet(packet_info * pinfo, const lbmr_tag_entry_t * entry) +static tap_packet_status lbmr_match_packet(packet_info * pinfo, const lbmr_tag_entry_t * entry) { guint32 dest_addr_h; guint32 src_addr_h; if ((pinfo->dst.type != AT_IPv4) || (pinfo->dst.len != 4) || (pinfo->src.type != AT_IPv4) || (pinfo->src.len != 4)) - return (FALSE); + return (TAP_PACKET_DONT_REDRAW); dest_addr_h = pntoh32(pinfo->dst.data); src_addr_h = pntoh32(pinfo->src.data); @@ -2032,21 +2032,21 @@ static gboolean lbmr_match_packet(packet_info * pinfo, const lbmr_tag_entry_t * if ((dest_addr_h != entry->mc_incoming_address_val_h) && (dest_addr_h != entry->mc_outgoing_address_val_h)) { /* No match. */ - return (FALSE); + return (TAP_PACKET_DONT_REDRAW); } /* Check for the correct port. */ if ((dest_addr_h == entry->mc_incoming_address_val_h) && (pinfo->destport != entry->mc_incoming_udp_port)) { /* Wrong incoming port. */ - return (FALSE); + return (TAP_PACKET_DONT_REDRAW); } if ((dest_addr_h == entry->mc_outgoing_address_val_h) && (pinfo->destport != entry->mc_outgoing_udp_port)) { /* Wrong outgoing port. */ - return (FALSE); + return (TAP_PACKET_DONT_REDRAW); } /* Must be one of ours. */ - return (TRUE); + return (TAP_PACKET_REDRAW); } else { @@ -2059,11 +2059,11 @@ static gboolean lbmr_match_packet(packet_info * pinfo, const lbmr_tag_entry_t * || ((pinfo->srcport <= entry->uc_port_high) && (pinfo->srcport >= entry->uc_port_low)))) { /* One of ours, so handle it. */ - return (TRUE); + return (TAP_PACKET_REDRAW); } } } - return (FALSE); + return (TAP_PACKET_DONT_REDRAW); } static char * lbmr_tag_find(packet_info * pinfo) @@ -2843,7 +2843,7 @@ static void lbmr_topic_ads_topic_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_topic_ads_topic = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_ads_topic, 0, STAT_DT_INT, TRUE); } -static int lbmr_topic_ads_topic_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_topic_ads_topic_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_topic_advertisement_tap_info_t * info = (const lbm_lbmr_topic_advertisement_tap_info_t *) data; int topic_node; @@ -2855,7 +2855,7 @@ static int lbmr_topic_ads_topic_stats_tree_packet(stats_tree * tree, packet_info source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), topic_node, TRUE); full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" G_GUINT32_FORMAT "]", info->source, info->topic_index); tick_stat_node(tree, full_source_string, source_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -2870,7 +2870,7 @@ static void lbmr_topic_ads_source_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_topic_ads_source = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_ads_source, 0, STAT_DT_INT, TRUE); } -static int lbmr_topic_ads_source_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_topic_ads_source_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_topic_advertisement_tap_info_t * info = (const lbm_lbmr_topic_advertisement_tap_info_t *) data; int source_node; @@ -2882,7 +2882,7 @@ static int lbmr_topic_ads_source_stats_tree_packet(stats_tree * tree, packet_inf topic_node = tick_stat_node(tree, info->topic, source_node, TRUE); full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s[%" G_GUINT32_FORMAT "]", info->source, info->topic_index); tick_stat_node(tree, full_source_string, topic_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -2896,7 +2896,7 @@ static void lbmr_topic_ads_transport_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_topic_ads_transport = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_ads_transport, 0, STAT_DT_INT, TRUE); } -static int lbmr_topic_ads_transport_stats_tree_packet(stats_tree * tree, packet_info * pinfo _U_, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_topic_ads_transport_stats_tree_packet(stats_tree * tree, packet_info * pinfo _U_, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_topic_advertisement_tap_info_t * info = (const lbm_lbmr_topic_advertisement_tap_info_t *) data; int transport_node; @@ -2906,7 +2906,7 @@ static int lbmr_topic_ads_transport_stats_tree_packet(stats_tree * tree, packet_ transport_node = tick_stat_node(tree, info->source, lbmr_stats_tree_handle_topic_ads_transport, TRUE); full_source_string = wmem_strdup_printf(wmem_packet_scope(), "%s [%" G_GUINT32_FORMAT "]", info->topic, info->topic_index); tick_stat_node(tree, full_source_string, transport_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -2920,7 +2920,7 @@ static void lbmr_topic_queries_topic_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_topic_queries_topic = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_topic, 0, STAT_DT_INT, TRUE); } -static int lbmr_topic_queries_topic_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_topic_queries_topic_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_topic_query_tap_info_t * info = (const lbm_lbmr_topic_query_tap_info_t *) data; int topic_node; @@ -2928,7 +2928,7 @@ static int lbmr_topic_queries_topic_stats_tree_packet(stats_tree * tree, packet_ tick_stat_node(tree, lbmr_stat_tree_name_topic_queries_topic, 0, FALSE); topic_node = tick_stat_node(tree, info->topic, lbmr_stats_tree_handle_topic_queries_topic, TRUE); tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), topic_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -2942,7 +2942,7 @@ static void lbmr_topic_queries_receiver_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_topic_queries_receiver = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_receiver, 0, STAT_DT_INT, TRUE); } -static int lbmr_topic_queries_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_topic_queries_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_topic_query_tap_info_t * info = (const lbm_lbmr_topic_query_tap_info_t *) data; int receiver_node; @@ -2950,7 +2950,7 @@ static int lbmr_topic_queries_receiver_stats_tree_packet(stats_tree * tree, pack tick_stat_node(tree, lbmr_stat_tree_name_topic_queries_receiver, 0, FALSE); receiver_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_topic_queries_receiver, TRUE); tick_stat_node(tree, info->topic, receiver_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -2964,7 +2964,7 @@ static void lbmr_topic_queries_pattern_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_topic_queries_pattern = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_pattern, 0, STAT_DT_INT, TRUE); } -static int lbmr_topic_queries_pattern_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_topic_queries_pattern_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_pattern_query_tap_info_t * info = (const lbm_lbmr_pattern_query_tap_info_t *) data; int pattern_node; @@ -2976,7 +2976,7 @@ static int lbmr_topic_queries_pattern_stats_tree_packet(stats_tree * tree, packe val_to_str(info->type, lbm_wildcard_pattern_type_short, "UNKN[0x%02x]")); pattern_node = tick_stat_node(tree, pattern_str, lbmr_stats_tree_handle_topic_queries_pattern, TRUE); tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), pattern_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -2990,7 +2990,7 @@ static void lbmr_topic_queries_pattern_receiver_stats_tree_init(stats_tree * tre lbmr_stats_tree_handle_topic_queries_pattern_receiver = stats_tree_create_node(tree, lbmr_stat_tree_name_topic_queries_pattern_receiver, 0, STAT_DT_INT, TRUE); } -static int lbmr_topic_queries_pattern_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_topic_queries_pattern_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_pattern_query_tap_info_t * info = (const lbm_lbmr_pattern_query_tap_info_t *) data; int receiver_node; @@ -3002,7 +3002,7 @@ static int lbmr_topic_queries_pattern_receiver_stats_tree_packet(stats_tree * tr info->pattern, val_to_str(info->type, lbm_wildcard_pattern_type_short, "UNKN[0x%02x]")); tick_stat_node(tree, pattern_str, receiver_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -3016,7 +3016,7 @@ static void lbmr_queue_ads_queue_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_queue_ads_queue = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_ads_queue, 0, STAT_DT_INT, TRUE); } -static int lbmr_queue_ads_queue_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_queue_ads_queue_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_queue_advertisement_tap_info_t * info = (const lbm_lbmr_queue_advertisement_tap_info_t *) data; int queue_node; @@ -3026,7 +3026,7 @@ static int lbmr_queue_ads_queue_stats_tree_packet(stats_tree * tree, packet_info queue_node = tick_stat_node(tree, info->queue, lbmr_stats_tree_handle_queue_ads_queue, TRUE); str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" G_GUINT16_FORMAT, address_to_str(wmem_packet_scope(), &pinfo->net_src), info->port); tick_stat_node(tree, str, queue_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -3040,7 +3040,7 @@ static void lbmr_queue_ads_source_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_queue_ads_source = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_ads_source, 0, STAT_DT_INT, TRUE); } -static int lbmr_queue_ads_source_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_queue_ads_source_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_queue_advertisement_tap_info_t * info = (const lbm_lbmr_queue_advertisement_tap_info_t *) data; int source_node; @@ -3050,7 +3050,7 @@ static int lbmr_queue_ads_source_stats_tree_packet(stats_tree * tree, packet_inf source_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_queue_ads_source, TRUE); str = wmem_strdup_printf(wmem_packet_scope(), "%s:%" G_GUINT16_FORMAT, info->queue, info->port); tick_stat_node(tree, str, source_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -3064,7 +3064,7 @@ static void lbmr_queue_queries_queue_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_queue_queries_queue = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_queries_queue, 0, STAT_DT_INT, TRUE); } -static int lbmr_queue_queries_queue_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_queue_queries_queue_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_queue_query_tap_info_t * info = (const lbm_lbmr_queue_query_tap_info_t *) data; int queue_node = 0; @@ -3072,7 +3072,7 @@ static int lbmr_queue_queries_queue_stats_tree_packet(stats_tree * tree, packet_ tick_stat_node(tree, lbmr_stat_tree_name_queue_queries_queue, 0, FALSE); queue_node = tick_stat_node(tree, info->queue, lbmr_stats_tree_handle_queue_queries_queue, TRUE); tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), queue_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ @@ -3086,7 +3086,7 @@ static void lbmr_queue_queries_receiver_stats_tree_init(stats_tree * tree) lbmr_stats_tree_handle_queue_queries_receiver = stats_tree_create_node(tree, lbmr_stat_tree_name_queue_queries_receiver, 0, STAT_DT_INT, TRUE); } -static int lbmr_queue_queries_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) +static tap_packet_status lbmr_queue_queries_receiver_stats_tree_packet(stats_tree * tree, packet_info * pinfo, epan_dissect_t * edt _U_, const void * data) { const lbm_lbmr_queue_query_tap_info_t * info = (const lbm_lbmr_queue_query_tap_info_t *) data; int receiver_node; @@ -3094,7 +3094,7 @@ static int lbmr_queue_queries_receiver_stats_tree_packet(stats_tree * tree, pack tick_stat_node(tree, lbmr_stat_tree_name_queue_queries_receiver, 0, FALSE); receiver_node = tick_stat_node(tree, address_to_str(wmem_packet_scope(), &pinfo->net_src), lbmr_stats_tree_handle_queue_queries_receiver, TRUE); tick_stat_node(tree, info->queue, receiver_node, TRUE); - return (1); + return (TAP_PACKET_REDRAW); } /*----------------------------------------------------------------------------*/ diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c index d7105914a9..5ae1b937a4 100644 --- a/epan/dissectors/packet-ldap.c +++ b/epan/dissectors/packet-ldap.c @@ -516,7 +516,7 @@ ldapstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static int +static tap_packet_status ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const void *psi) { guint i = 0; @@ -526,11 +526,11 @@ ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const /* we are only interested in reply packets */ if(ldap->is_request){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* if we havnt seen the request, just ignore it */ if(!ldap->req_frame){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* only use the commands we know how to handle */ @@ -545,13 +545,13 @@ ldapstat_packet(void *pldap, packet_info *pinfo, epan_dissect_t *edt _U_, const case LDAP_REQ_EXTENDED: break; default: - return 0; + return TAP_PACKET_DONT_REDRAW; } ldap_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); add_srt_table_data(ldap_srt_table, ldap->protocolOpTag, &ldap->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } /* diff --git a/epan/dissectors/packet-megaco.c b/epan/dissectors/packet-megaco.c index 521660dbaa..7cfaf6bf75 100644 --- a/epan/dissectors/packet-megaco.c +++ b/epan/dissectors/packet-megaco.c @@ -329,14 +329,14 @@ megacostat_filtercheck(const char *opt_arg _U_, const char **filter _U_, char** } } -static int +static tap_packet_status megacostat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pmi) { rtd_data_t* rtd_data = (rtd_data_t*)pms; rtd_stat_table* ms = &rtd_data->stat_table; const gcp_cmd_t *mi=(const gcp_cmd_t*)pmi; nstime_t delta; - int ret = 0; + tap_packet_status ret = TAP_PACKET_DONT_REDRAW; switch (mi->type) { @@ -344,7 +344,7 @@ megacostat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const if(!mi->trx->initial) { /* Track Context is probably disabled, we cannot * measure service response time */ - return 0; + return TAP_PACKET_DONT_REDRAW; } else if(mi->trx->initial->framenum != mi->msg->framenum){ @@ -407,7 +407,7 @@ megacostat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const } time_stat_update(&(ms->time_stats[0].rtd[10]),&delta, pinfo); - ret = 1; + ret = TAP_PACKET_REDRAW; } break; diff --git a/epan/dissectors/packet-mgcp.c b/epan/dissectors/packet-mgcp.c index 2d7b601120..77ecd0188a 100644 --- a/epan/dissectors/packet-mgcp.c +++ b/epan/dissectors/packet-mgcp.c @@ -321,14 +321,14 @@ static const value_string mgcp_mesage_type[] = { { 0, NULL} }; -static int +static tap_packet_status mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pmi) { rtd_data_t* rtd_data = (rtd_data_t*)pms; rtd_stat_table* ms = &rtd_data->stat_table; const mgcp_info_t *mi = (const mgcp_info_t *)pmi; nstime_t delta; - int ret = 0; + tap_packet_status ret = TAP_PACKET_DONT_REDRAW; switch (mi->mgcp_type) { @@ -389,7 +389,7 @@ mgcpstat_packet(void *pms, packet_info *pinfo, epan_dissect_t *edt _U_, const vo time_stat_update(&(ms->time_stats[0].rtd[10]), &delta, pinfo); } - ret = 1; + ret = TAP_PACKET_REDRAW; } break; diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c index 390aa12ae1..8f69a98d6d 100644 --- a/epan/dissectors/packet-mtp3.c +++ b/epan/dissectors/packet-mtp3.c @@ -833,7 +833,7 @@ static void mtp3_stat_init(stat_tap_table_ui* new_stat) stat_tap_add_table(new_stat, table); } -static gboolean +static tap_packet_status mtp3_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *m3tr_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -852,7 +852,7 @@ mtp3_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, * we thought this si_code was not used ? * is MTP3_NUM_SI_CODE out of date ? */ - return(FALSE); + return TAP_PACKET_DONT_REDRAW; } /* @@ -941,7 +941,7 @@ mtp3_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, item_data->value.float_value = avg_bytes; stat_tap_set_field_data(table, element, AVG_BYTES_COLUMN, item_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-ncp.c b/epan/dissectors/packet-ncp.c index 9f34b6562d..ff7789ba23 100644 --- a/epan/dissectors/packet-ncp.c +++ b/epan/dissectors/packet-ncp.c @@ -439,7 +439,7 @@ ncpstat_init(struct register_srt* srt _U_, GArray* srt_array) init_srt_table("Subfunctions for NCP 131", "131", srt_array, NCP_NUM_PROCEDURES, NULL, "ncp.func==131 && ncp.subfunc", NULL); } -static int +static tap_packet_status ncpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -450,7 +450,7 @@ ncpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi /* if we haven't seen the request, just ignore it */ if(!request_val || request_val->ncp_rec==0){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* By Group */ @@ -609,7 +609,7 @@ ncpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi add_srt_table_data(ncp_srt_table, (request_val->req_nds_flags), &request_val->req_frame_time, pinfo); wmem_free(NULL, tmp_str); } - return 1; + return TAP_PACKET_REDRAW; } @@ -717,7 +717,7 @@ static const char* ncp_conv_get_filter_type(conv_item_t* conv _U_, conv_filter_t static ct_dissector_info_t ncp_ct_dissector_info = {&ncp_conv_get_filter_type}; -static int +static tap_packet_status ncp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -729,7 +729,7 @@ ncp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, add_conversation_table_data(hash, &pinfo->src, &pinfo->dst, connection, connection, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &ncp_ct_dissector_info, ENDPOINT_NCP); } - return 1; + return TAP_PACKET_REDRAW; } static const char* ncp_host_get_filter_type(hostlist_talker_t* host _U_, conv_filter_type_e filter) @@ -739,7 +739,7 @@ static const char* ncp_host_get_filter_type(hostlist_talker_t* host _U_, conv_fi static hostlist_dissector_info_t ncp_host_dissector_info = {&ncp_host_get_filter_type}; -static int +static tap_packet_status ncp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -751,7 +751,7 @@ ncp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_hostlist_table_data(hash, &pinfo->src, 0, TRUE, 1, pinfo->fd->pkt_len, &ncp_host_dissector_info, ENDPOINT_NCP); add_hostlist_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &ncp_host_dissector_info, ENDPOINT_NCP); - return 1; + return TAP_PACKET_REDRAW; } /* diff --git a/epan/dissectors/packet-radius.c b/epan/dissectors/packet-radius.c index 5f11f14d31..432c513096 100644 --- a/epan/dissectors/packet-radius.c +++ b/epan/dissectors/packet-radius.c @@ -305,7 +305,7 @@ static const value_string radius_message_code[] = { { 0, NULL} }; -static int +static tap_packet_status radiusstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) { rtd_data_t *rtd_data = (rtd_data_t *)prs; @@ -313,7 +313,7 @@ radiusstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const const radius_info_t *ri = (const radius_info_t *)pri; nstime_t delta; radius_category radius_cat = RADIUS_CAT_OTHERS; - int ret = 0; + tap_packet_status ret = TAP_PACKET_DONT_REDRAW; switch (ri->code) { case RADIUS_PKT_TYPE_ACCESS_REQUEST: @@ -403,7 +403,7 @@ radiusstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt _U_, const time_stat_update(&(rs->time_stats[RADIUS_CAT_OVERALL].rtd[0]),&delta, pinfo); time_stat_update(&(rs->time_stats[radius_cat].rtd[0]),&delta, pinfo); - ret = 1; + ret = TAP_PACKET_REDRAW; } break; diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index fcdf530ec8..bcb62a4327 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -365,7 +365,7 @@ rpcstat_init(struct register_srt* srt, GArray* srt_array) } } -static int +static tap_packet_status rpcstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -379,19 +379,19 @@ rpcstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi if ((int)ri->proc >= rpc_srt_table->num_procs) { /* don't handle this since its outside of known table */ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* we are only interested in reply packets */ if (ri->request) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* we are only interested in certain program/versions */ if ( (ri->prog != tap_data->program) || (ri->vers != tap_data->version) ) { - return 0; + return TAP_PACKET_DONT_REDRAW; } add_srt_table_data(rpc_srt_table, ri->proc, &ri->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } @@ -3922,7 +3922,7 @@ static void rpc_prog_stat_init(stat_tap_table_ui* new_stat) } -static gboolean +static tap_packet_status rpc_prog_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *rciv_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -3971,7 +3971,7 @@ rpc_prog_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt /* we are only interested in reply packets */ if (ri->request) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } item_data = stat_tap_get_field_data(table, element, CALLS_COLUMN); @@ -4000,7 +4000,7 @@ rpc_prog_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt item_data->value.float_value = item_data->user_data.float_value / call_count; stat_tap_set_field_data(table, element, AVG_SRT_COLUMN, item_data); - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-rsvp.c b/epan/dissectors/packet-rsvp.c index bb5c899f09..754936d044 100644 --- a/epan/dissectors/packet-rsvp.c +++ b/epan/dissectors/packet-rsvp.c @@ -2111,7 +2111,7 @@ static const char* rsvp_conv_get_filter_type(conv_item_t* conv, conv_filter_type static ct_dissector_info_t rsvp_ct_dissector_info = {&rsvp_conv_get_filter_type}; -static int +static tap_packet_status rsvp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -2120,7 +2120,7 @@ rsvp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, add_conversation_table_data(hash, &rsvph->source, &rsvph->destination, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &rsvp_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* rsvp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -2133,7 +2133,7 @@ static const char* rsvp_host_get_filter_type(hostlist_talker_t* host, conv_filte static hostlist_dissector_info_t rsvp_host_dissector_info = {&rsvp_host_get_filter_type}; -static int +static tap_packet_status rsvp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -2146,7 +2146,7 @@ rsvp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con */ add_hostlist_table_data(hash, &rsvph->source, 0, TRUE, 1, pinfo->fd->pkt_len, &rsvp_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &rsvph->destination, 0, FALSE, 1, pinfo->fd->pkt_len, &rsvp_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static inline int diff --git a/epan/dissectors/packet-rtsp.c b/epan/dissectors/packet-rtsp.c index eb91ae9f66..dc16c3c3fd 100644 --- a/epan/dissectors/packet-rtsp.c +++ b/epan/dissectors/packet-rtsp.c @@ -181,7 +181,7 @@ rtsp_stats_tree_init(stats_tree* st) } /* RTSP/Packet Counter stats packet function */ -static int +static tap_packet_status rtsp_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const rtsp_info_value_t *v = (const rtsp_info_value_t *)p; @@ -225,7 +225,7 @@ rtsp_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* e tick_stat_node(st, st_str_other, st_node_packets, FALSE); } - return 1; + return TAP_PACKET_REDRAW; } void proto_reg_handoff_rtsp(void); diff --git a/epan/dissectors/packet-sametime.c b/epan/dissectors/packet-sametime.c index 39e93edd12..0cd20ca01b 100644 --- a/epan/dissectors/packet-sametime.c +++ b/epan/dissectors/packet-sametime.c @@ -615,7 +615,7 @@ dissect_sametime_content(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo /* tick statistics */ -static int +static tap_packet_status sametime_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_t* edt _U_, const void* p) { const struct SametimeTap *pi = (const struct SametimeTap *)p; @@ -630,7 +630,7 @@ sametime_stats_tree_packet(stats_tree* st, packet_info* pinfo _U_, epan_dissect_ if (pi->user_status != -1) stats_tree_tick_pivot(st, st_node_user_status, val_to_str(pi->user_status, userstatusnames, "Unknown (0x%04x)")); - return 1; + return TAP_PACKET_REDRAW; } diff --git a/epan/dissectors/packet-scsi.c b/epan/dissectors/packet-scsi.c index f7b793cf13..910d80fd9b 100644 --- a/epan/dissectors/packet-scsi.c +++ b/epan/dissectors/packet-scsi.c @@ -964,7 +964,7 @@ scsistat_init(struct register_srt* srt, GArray* srt_array) } } -static int +static tap_packet_status scsistat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -978,19 +978,19 @@ scsistat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const vo /* we are only interested in response packets */ if (ri->type != SCSI_PDU_TYPE_RSP) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* we are only interested in a specific commandset */ if ( (!ri->itl) || ((ri->itl->cmdset&SCSI_CMDSET_MASK) != tap_data->cmdset) ) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* check that the opcode looks sane */ if ( (!ri->itlq) || (ri->itlq->scsi_opcode > 255) ) { - return 0; + return TAP_PACKET_DONT_REDRAW; } add_srt_table_data(scsi_srt_table, ri->itlq->scsi_opcode, &ri->itlq->fc_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } guint diff --git a/epan/dissectors/packet-sctp.c b/epan/dissectors/packet-sctp.c index fbf9b00629..e09e04304b 100644 --- a/epan/dissectors/packet-sctp.c +++ b/epan/dissectors/packet-sctp.c @@ -843,7 +843,7 @@ static const char* sctp_conv_get_filter_type(conv_item_t* conv, conv_filter_type static ct_dissector_info_t sctp_ct_dissector_info = {&sctp_conv_get_filter_type}; -static int +static tap_packet_status sctp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -853,7 +853,7 @@ sctp_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, sctphdr->sport, sctphdr->dport, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &sctp_ct_dissector_info, ENDPOINT_SCTP); - return 1; + return TAP_PACKET_REDRAW; } static const char* sctp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -897,7 +897,7 @@ static const char* sctp_host_get_filter_type(hostlist_talker_t* host, conv_filte static hostlist_dissector_info_t sctp_host_dissector_info = {&sctp_host_get_filter_type}; -static int +static tap_packet_status sctp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -909,7 +909,7 @@ sctp_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con add_hostlist_table_data(hash, &sctphdr->ip_src, sctphdr->sport, TRUE, 1, pinfo->fd->pkt_len, &sctp_host_dissector_info, ENDPOINT_SCTP); add_hostlist_table_data(hash, &sctphdr->ip_dst, sctphdr->dport, FALSE, 1, pinfo->fd->pkt_len, &sctp_host_dissector_info, ENDPOINT_SCTP); - return 1; + return TAP_PACKET_REDRAW; } static unsigned int diff --git a/epan/dissectors/packet-sip.c b/epan/dissectors/packet-sip.c index 7d1ec19f53..7276b09f05 100644 --- a/epan/dissectors/packet-sip.c +++ b/epan/dissectors/packet-sip.c @@ -5774,7 +5774,7 @@ static void sip_stat_init(stat_tap_table_ui* new_stat) } } -static gboolean +static tap_packet_status sip_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *siv_ptr) { stat_data_t* stat_data = (stat_data_t*) tapdata; @@ -5820,7 +5820,7 @@ sip_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, } } else { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } if (cur_table) { @@ -5867,7 +5867,7 @@ sip_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, } } - return TRUE; + return TAP_PACKET_REDRAW; } static void diff --git a/epan/dissectors/packet-sll.c b/epan/dissectors/packet-sll.c index d4f0feb206..4140e1ec95 100644 --- a/epan/dissectors/packet-sll.c +++ b/epan/dissectors/packet-sll.c @@ -175,7 +175,7 @@ static const char* sll_conv_get_filter_type(conv_item_t* conv, conv_filter_type_ static ct_dissector_info_t sll_ct_dissector_info = {&sll_conv_get_filter_type}; static address no_dst = {AT_NONE, 0, NULL, NULL}; -static int +static tap_packet_status sll_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -183,7 +183,7 @@ sll_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, add_conversation_table_data(hash, &tap_data->src_address, &no_dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &sll_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* sll_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -205,7 +205,7 @@ static const char* sll_host_get_filter_type(hostlist_talker_t* host, conv_filter static hostlist_dissector_info_t sll_host_dissector_info = {&sll_host_get_filter_type}; -static int +static tap_packet_status sll_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -213,7 +213,7 @@ sll_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_hostlist_table_data(hash, &tap_data->src_address, 0, TRUE, 1, pinfo->fd->pkt_len, &sll_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static gboolean diff --git a/epan/dissectors/packet-smb-sidsnooping.c b/epan/dissectors/packet-smb-sidsnooping.c index a052d1bd77..99e4af1bbe 100644 --- a/epan/dissectors/packet-smb-sidsnooping.c +++ b/epan/dissectors/packet-smb-sidsnooping.c @@ -67,7 +67,7 @@ add_sid_name_mapping(const char *sid, const char *name) * QueryDispInfo : * level 1 : user displayinfo 1 */ -static int +static tap_packet_status samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, const void *pri) { const dcerpc_info *ri=(const dcerpc_info *)pri; @@ -88,25 +88,25 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co gp=proto_get_finfo_ptr_array(edt->tree, hf_samr_level); if(!gp || gp->len!=1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } fi=(field_info *)gp->pdata[0]; info_level=fi->value.value.sinteger; if(info_level!=1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } if(!ri){ - return 0; + return TAP_PACKET_DONT_REDRAW; } if(!ri->call_data){ - return 0; + return TAP_PACKET_DONT_REDRAW; } if(ri->ptype == PDU_REQ){ gp=proto_get_finfo_ptr_array(edt->tree, hf_samr_hnd); if(!gp || gp->len!=1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } fi=(field_info *)gp->pdata[0]; @@ -119,28 +119,28 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co } g_hash_table_insert(ctx_handle_table, GINT_TO_POINTER(pinfo->num), old_ctx); - return 0; + return TAP_PACKET_DONT_REDRAW; } if(!ri->call_data->req_frame){ - return 0; + return TAP_PACKET_DONT_REDRAW; } old_ctx=g_hash_table_lookup(ctx_handle_table, GINT_TO_POINTER(ri->call_data->req_frame)); if(!old_ctx){ - return 0; + return TAP_PACKET_DONT_REDRAW; } if (!dcerpc_fetch_polhnd_data((e_ctx_hnd *)old_ctx, &pol_name, NULL, NULL, NULL, ri->call_data->req_frame)) { - return 0; + return TAP_PACKET_DONT_REDRAW; } if (!pol_name) - return 0; + return TAP_PACKET_DONT_REDRAW; sid=strstr(pol_name,"S-1-5"); if(!sid){ - return 0; + return TAP_PACKET_DONT_REDRAW; } for(sid_len=4;1;sid_len++){ @@ -155,12 +155,12 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co gp_rids=proto_get_finfo_ptr_array(edt->tree, hf_samr_rid); if(!gp_rids || gp_rids->len<1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } num_rids=gp_rids->len; gp_names=proto_get_finfo_ptr_array(edt->tree, hf_samr_acct_name); if(!gp_names || gp_names->len<1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } num_names=gp_names->len; @@ -180,7 +180,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co g_snprintf(sid_name_str+len, 256-len, "%d",fi_rid->value.value.sinteger); add_sid_name_mapping(sid_name_str, fi_name->value.value.string); } - return 1; + return TAP_PACKET_REDRAW; } /* @@ -189,7 +189,7 @@ samr_query_dispinfo(void *dummy _U_, packet_info *pinfo, epan_dissect_t *edt, co * level 5 : ACCOUNT_DOMAIN_INFO lsa.domain_sid -> lsa.domain * level 12 : DNS_DOMAIN_INFO lsa.domain_sid -> lsa.domain */ -static int +static tap_packet_status lsa_policy_information(void *dummy _U_, packet_info *pinfo _U_, epan_dissect_t *edt, const void *pri _U_) { GPtrArray *gp; @@ -200,7 +200,7 @@ lsa_policy_information(void *dummy _U_, packet_info *pinfo _U_, epan_dissect_t * gp=proto_get_finfo_ptr_array(edt->tree, hf_lsa_info_level); if(!gp || gp->len!=1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } fi=(field_info *)gp->pdata[0]; info_level=fi->value.value.sinteger; @@ -211,14 +211,14 @@ lsa_policy_information(void *dummy _U_, packet_info *pinfo _U_, epan_dissect_t * case 12: gp=proto_get_finfo_ptr_array(edt->tree, hf_lsa_domain); if(!gp || gp->len!=1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } fi=(field_info *)gp->pdata[0]; domain=fi->value.value.string; gp=proto_get_finfo_ptr_array(edt->tree, hf_nt_domain_sid); if(!gp || gp->len!=1){ - return 0; + return TAP_PACKET_DONT_REDRAW; } fi=(field_info *)gp->pdata[0]; sid=fi->value.value.string; @@ -226,7 +226,7 @@ lsa_policy_information(void *dummy _U_, packet_info *pinfo _U_, epan_dissect_t * add_sid_name_mapping(sid, domain); break; } - return 0; + return TAP_PACKET_DONT_REDRAW; } diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index b86f90229e..523f83b8ca 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -923,7 +923,7 @@ smbstat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static int +static tap_packet_status smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -933,11 +933,11 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi /* we are only interested in reply packets */ if (si->request) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* if we havnt seen the request, just ignore it */ if (!si->sip) { - return 0; + return TAP_PACKET_DONT_REDRAW; } if (si->cmd == 0xA0 && si->sip->extra_info_type == SMB_EI_NTI) { @@ -964,7 +964,7 @@ smbstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi add_srt_table_data(smb_srt_table, si->cmd, &si->sip->req_time, pinfo); } - return 1; + return TAP_PACKET_REDRAW; } @@ -1216,7 +1216,7 @@ find_incoming_file(GSList *GSL_active_files_p, active_file *incoming_file) return row; } -static gboolean +static tap_packet_status smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { export_object_list_t *object_list = (export_object_list_t *)tapdata; @@ -1357,7 +1357,7 @@ smb_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const } } - return TRUE; /* State changed - window should be redrawn */ + return TAP_PACKET_REDRAW; /* State changed - window should be redrawn */ } /* This is the eo_reset_cb function that is used in the export_object module diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index b4e0c6453d..f3c1747c84 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -831,7 +831,7 @@ smb2stat_init(struct register_srt* srt _U_, GArray* srt_array) } } -static int +static tap_packet_status smb2stat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv) { guint i = 0; @@ -841,16 +841,16 @@ smb2stat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const vo /* we are only interested in response packets */ if(!(si->flags&SMB2_FLAGS_RESPONSE)){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* We should not include cancel and oplock break requests either */ if (si->opcode == SMB2_COM_CANCEL || si->opcode == SMB2_COM_BREAK) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* if we haven't seen the request, just ignore it */ if(!si->saved){ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* SMB2 SRT can be very inaccurate in the presence of retransmissions. Retransmitted responses @@ -860,11 +860,11 @@ smb2stat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const vo * for the last received response accomplishes this goal without requiring the TCP pref * "Do not call subdissectors for error packets" to be set. */ if ((si->saved->frame_req == 0) || (si->saved->frame_res != pinfo->num)) - return 0; + return TAP_PACKET_DONT_REDRAW; smb2_srt_table = g_array_index(data->srt_array, srt_stat_table*, i); add_srt_table_data(smb2_srt_table, si->opcode, &si->saved->req_time, pinfo); - return 1; + return TAP_PACKET_REDRAW; } /* Structure for SessionID <=> SessionKey mapping for decryption. */ diff --git a/epan/dissectors/packet-smpp.c b/epan/dissectors/packet-smpp.c index 90697c8b18..c73a6396e2 100644 --- a/epan/dissectors/packet-smpp.c +++ b/epan/dissectors/packet-smpp.c @@ -1120,7 +1120,7 @@ smpp_stats_tree_init(stats_tree* st) } -static int +static tap_packet_status smpp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */ packet_info *pinfo _U_, epan_dissect_t *edt _U_, @@ -1145,7 +1145,7 @@ smpp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */ tick_stat_node(st, val_to_str(tap_rec->command_id, vals_command_id, "Unknown 0x%08x"), st_smpp_req, FALSE); } - return 1; + return TAP_PACKET_REDRAW; } /*! diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index 6c08f7e8d3..36e2cce2e2 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -745,7 +745,7 @@ static const char* tcp_conv_get_filter_type(conv_item_t* conv, conv_filter_type_ static ct_dissector_info_t tcp_ct_dissector_info = {&tcp_conv_get_filter_type}; -static int +static tap_packet_status tcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -754,10 +754,10 @@ tcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_ add_conversation_table_data_with_conv_id(hash, &tcphdr->ip_src, &tcphdr->ip_dst, tcphdr->th_sport, tcphdr->th_dport, (conv_id_t) tcphdr->th_stream, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &tcp_ct_dissector_info, ENDPOINT_TCP); - return 1; + return TAP_PACKET_REDRAW; } -static int +static tap_packet_status mptcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -768,7 +768,7 @@ mptcpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _ meta->sport, meta->dport, (conv_id_t) tcpd->mptcp_analysis->stream, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &tcp_ct_dissector_info, ENDPOINT_TCP); - return 1; + return TAP_PACKET_REDRAW; } static const char* tcp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -812,7 +812,7 @@ static const char* tcp_host_get_filter_type(hostlist_talker_t* host, conv_filter static hostlist_dissector_info_t tcp_host_dissector_info = {&tcp_host_get_filter_type}; -static int +static tap_packet_status tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -824,7 +824,7 @@ tcpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co add_hostlist_table_data(hash, &tcphdr->ip_src, tcphdr->th_sport, TRUE, 1, pinfo->fd->pkt_len, &tcp_host_dissector_info, ENDPOINT_TCP); add_hostlist_table_data(hash, &tcphdr->ip_dst, tcphdr->th_dport, FALSE, 1, pinfo->fd->pkt_len, &tcp_host_dissector_info, ENDPOINT_TCP); - return 1; + return TAP_PACKET_REDRAW; } static gboolean @@ -858,7 +858,7 @@ tcp_build_filter(packet_info *pinfo) /****************************************************************************/ /* whenever a TCP packet is seen by the tap listener */ /* Add a new tcp frame into the graph */ -static gboolean +static tap_packet_status tcp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *tcp_info) { seq_analysis_info_t *sainfo = (seq_analysis_info_t *) ptr; @@ -867,7 +867,7 @@ tcp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, seq_analysis_item_t *sai = sequence_analysis_create_sai_with_addresses(pinfo, sainfo); if (!sai) - return FALSE; + return TAP_PACKET_DONT_REDRAW; sai->frame_number = pinfo->num; @@ -896,7 +896,7 @@ tcp_seq_analysis_packet( void *ptr, packet_info *pinfo, epan_dissect_t *edt _U_, g_queue_push_tail(sainfo->items, sai); - return TRUE; + return TAP_PACKET_REDRAW; } @@ -1071,7 +1071,7 @@ check_follow_fragments(follow_info_t *follow_info, gboolean is_server, guint32 a return FALSE; } -static gboolean +static tap_packet_status follow_tcp_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { @@ -1138,7 +1138,7 @@ follow_tcp_tap_listener(void *tapdata, packet_info *pinfo, * because it was fully overlapping with previously received data). */ if (data_length == 0 || LT_SEQ(sequence, follow_info->seq[is_server])) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } follow_record = g_new0(follow_record_t, 1); @@ -1161,7 +1161,7 @@ follow_tcp_tap_listener(void *tapdata, packet_info *pinfo, /* Out of order packet (more preceding segments are expected). */ follow_info->fragments[is_server] = g_list_append(follow_info->fragments[is_server], follow_record); } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } #define EXP_PDU_TCP_INFO_DATA_LEN 19 diff --git a/epan/dissectors/packet-tftp.c b/epan/dissectors/packet-tftp.c index 852d33653e..61388fd643 100644 --- a/epan/dissectors/packet-tftp.c +++ b/epan/dissectors/packet-tftp.c @@ -157,7 +157,7 @@ typedef struct _tftp_eo_t { } tftp_eo_t; /* Tap function */ -static gboolean +static tap_packet_status tftp_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { export_object_list_t *object_list = (export_object_list_t *)tapdata; @@ -202,7 +202,7 @@ tftp_eo_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const /* Pass out entry to the GUI */ object_list->add_entry(object_list->gui_data, entry); - return TRUE; /* State changed - window should be redrawn */ + return TAP_PACKET_REDRAW; /* State changed - window should be redrawn */ } /* Clean up the stored parts of a single tapped entry */ diff --git a/epan/dissectors/packet-tls.c b/epan/dissectors/packet-tls.c index b457c361f9..ae71fac802 100644 --- a/epan/dissectors/packet-tls.c +++ b/epan/dissectors/packet-tls.c @@ -393,7 +393,7 @@ ssl_parse_old_keys(void) #endif /* HAVE_LIBGNUTLS */ -static gboolean +static tap_packet_status ssl_follow_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *ssl) { follow_info_t * follow_info = (follow_info_t*) tapdata; @@ -403,7 +403,7 @@ ssl_follow_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _ show_stream_t from = FROM_CLIENT; /* Skip packets without decrypted payload data. */ - if (!pi || !pi->records) return FALSE; + if (!pi || !pi->records) return TAP_PACKET_DONT_REDRAW; /* Compute the packet's sender. */ if (follow_info->client_port == 0) { @@ -455,7 +455,7 @@ ssl_follow_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _ follow_info->bytes_written[from] += appl_data->data_len; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /********************************************************************* diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c index ff758bda81..72cd30d086 100644 --- a/epan/dissectors/packet-tr.c +++ b/epan/dissectors/packet-tr.c @@ -136,7 +136,7 @@ static const char* tr_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e static ct_dissector_info_t tr_ct_dissector_info = {&tr_conv_get_filter_type}; -static int +static tap_packet_status tr_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -144,7 +144,7 @@ tr_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, c add_conversation_table_data(hash, &trhdr->src, &trhdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &tr_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* tr_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -157,7 +157,7 @@ static const char* tr_host_get_filter_type(hostlist_talker_t* host, conv_filter_ static hostlist_dissector_info_t tr_host_dissector_info = {&tr_host_get_filter_type}; -static int +static tap_packet_status tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -169,7 +169,7 @@ tr_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const add_hostlist_table_data(hash, &trhdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &tr_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &trhdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &tr_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } /* diff --git a/epan/dissectors/packet-ucp.c b/epan/dissectors/packet-ucp.c index 752e6ee468..38b22606f8 100644 --- a/epan/dissectors/packet-ucp.c +++ b/epan/dissectors/packet-ucp.c @@ -665,7 +665,7 @@ ucp_stats_tree_init(stats_tree* st) st_ucp_results_neg = stats_tree_create_node(st, st_str_neg, st_ucp_results, STAT_DT_INT, TRUE); } -static int +static tap_packet_status ucp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */ packet_info *pinfo _U_, epan_dissect_t *edt _U_, @@ -701,7 +701,7 @@ ucp_stats_tree_per_packet(stats_tree *st, /* st as it was passed to us */ } } - return 1; + return TAP_PACKET_REDRAW; } /*! diff --git a/epan/dissectors/packet-udp.c b/epan/dissectors/packet-udp.c index a475865530..bc7bb111f5 100644 --- a/epan/dissectors/packet-udp.c +++ b/epan/dissectors/packet-udp.c @@ -328,7 +328,7 @@ static const char* udp_conv_get_filter_type(conv_item_t* conv, conv_filter_type_ static ct_dissector_info_t udp_ct_dissector_info = {&udp_conv_get_filter_type}; -static int +static tap_packet_status udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pct; @@ -336,7 +336,7 @@ udpip_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_ add_conversation_table_data_with_conv_id(hash, &udphdr->ip_src, &udphdr->ip_dst, udphdr->uh_sport, udphdr->uh_dport, (conv_id_t) udphdr->uh_stream, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &udp_ct_dissector_info, ENDPOINT_UDP); - return 1; + return TAP_PACKET_REDRAW; } static const char* udp_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -382,7 +382,7 @@ static const char* udp_host_get_filter_type(hostlist_talker_t* host, conv_filter static hostlist_dissector_info_t udp_host_dissector_info = {&udp_host_get_filter_type}; -static int +static tap_packet_status udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -394,7 +394,7 @@ udpip_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, co add_hostlist_table_data(hash, &udphdr->ip_src, udphdr->uh_sport, TRUE, 1, pinfo->fd->pkt_len, &udp_host_dissector_info, ENDPOINT_UDP); add_hostlist_table_data(hash, &udphdr->ip_dst, udphdr->uh_dport, FALSE, 1, pinfo->fd->pkt_len, &udp_host_dissector_info, ENDPOINT_UDP); - return 1; + return TAP_PACKET_REDRAW; } static gboolean diff --git a/epan/dissectors/packet-usb.c b/epan/dissectors/packet-usb.c index 4a8cb4a5e0..dcd82a09e9 100644 --- a/epan/dissectors/packet-usb.c +++ b/epan/dissectors/packet-usb.c @@ -1769,13 +1769,13 @@ static const char* usb_conv_get_filter_type(conv_item_t* conv, conv_filter_type_ static ct_dissector_info_t usb_ct_dissector_info = {&usb_conv_get_filter_type}; -static int +static tap_packet_status usb_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_) { conv_hash_t *hash = (conv_hash_t*) pct; add_conversation_table_data(hash, &pinfo->src, &pinfo->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &usb_ct_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } static const char* usb_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter) @@ -1794,7 +1794,7 @@ usb_col_filter_str(const address* addr _U_, gboolean is_src) static hostlist_dissector_info_t usb_host_dissector_info = {&usb_host_get_filter_type}; -static int +static tap_packet_status usb_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip _U_) { conv_hash_t *hash = (conv_hash_t*) pit; @@ -1805,7 +1805,7 @@ usb_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, cons add_hostlist_table_data(hash, &pinfo->src, 0, TRUE, 1, pinfo->fd->pkt_len, &usb_host_dissector_info, ENDPOINT_NONE); add_hostlist_table_data(hash, &pinfo->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &usb_host_dissector_info, ENDPOINT_NONE); - return 1; + return TAP_PACKET_REDRAW; } /* SETUP dissectors */ diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c index 488b1c975f..a162b0d4bc 100644 --- a/epan/dissectors/packet-wsp.c +++ b/epan/dissectors/packet-wsp.c @@ -5619,7 +5619,7 @@ static void wsp_stat_init(stat_tap_table_ui* new_stat) unknown_sc_idx = table_idx; } -static gboolean +static tap_packet_status wsp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *wiv_ptr) { stat_data_t* stat_data = (stat_data_t*)tapdata; @@ -5664,7 +5664,7 @@ wsp_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, stat_tap_set_field_data(sc_table, element, PACKET_COLUMN, item_data); } - return TRUE; + return found? TAP_PACKET_REDRAW : TAP_PACKET_DONT_REDRAW; } static void diff --git a/epan/follow.c b/epan/follow.c index cf3d12cb6d..7617e01bf4 100644 --- a/epan/follow.c +++ b/epan/follow.c @@ -27,14 +27,14 @@ struct register_follow { follow_index_filter_func index_filter; /* generate stream/index filter to follow */ follow_address_filter_func address_filter; /* generate address filter to follow */ follow_port_to_display_func port_to_display; /* port to name resolution for follow type */ - follow_tap_func tap_handler; /* tap listener handler */ + tap_packet_cb tap_handler; /* tap listener handler */ }; static wmem_tree_t *registered_followers = NULL; void register_follow_stream(const int proto_id, const char* tap_listener, follow_conv_filter_func conv_filter, follow_index_filter_func index_filter, follow_address_filter_func address_filter, - follow_port_to_display_func port_to_display, follow_tap_func tap_handler) + follow_port_to_display_func port_to_display, tap_packet_cb tap_handler) { register_follow_t *follower; DISSECTOR_ASSERT(tap_listener); @@ -96,7 +96,7 @@ follow_port_to_display_func get_follow_port_to_display(register_follow_t* follow return follower->port_to_display; } -follow_tap_func get_follow_tap_handler(register_follow_t* follower) +tap_packet_cb get_follow_tap_handler(register_follow_t* follower) { return follower->tap_handler; } @@ -175,7 +175,7 @@ follow_info_free(follow_info_t* follow_info) g_free(follow_info); } -gboolean +tap_packet_status follow_tvb_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { @@ -207,7 +207,7 @@ follow_tvb_tap_listener(void *tapdata, packet_info *pinfo, follow_info->bytes_written[follow_record->is_server] += follow_record->data->len; follow_info->payload = g_list_prepend(follow_info->payload, follow_record); - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* diff --git a/epan/follow.h b/epan/follow.h index 81ce435a8b..a841273825 100644 --- a/epan/follow.h +++ b/epan/follow.h @@ -20,6 +20,7 @@ extern "C" { #include <epan/epan.h> #include <epan/packet.h> #include <epan/ipv6.h> +#include <epan/tap.h> #include <epan/wmem/wmem.h> #include "ws_symbol_export.h" @@ -102,12 +103,11 @@ typedef gchar* (*follow_conv_filter_func)(packet_info* pinfo, int* stream); typedef gchar* (*follow_index_filter_func)(int stream); typedef gchar* (*follow_address_filter_func)(address* src_addr, address* dst_addr, int src_port, int dst_port); typedef gchar* (*follow_port_to_display_func)(wmem_allocator_t *allocator, guint port); -typedef gboolean (*follow_tap_func)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data); WS_DLL_PUBLIC void register_follow_stream(const int proto_id, const char* tap_listener, follow_conv_filter_func conv_filter, follow_index_filter_func index_filter, follow_address_filter_func address_filter, - follow_port_to_display_func port_to_display, follow_tap_func tap_handler); + follow_port_to_display_func port_to_display, tap_packet_cb tap_handler); /** Get protocol ID from registered follower * @@ -161,15 +161,15 @@ WS_DLL_PUBLIC follow_port_to_display_func get_follow_port_to_display(register_fo /** Provide function that handles tap data (tap_packet_cb parameter of register_tap_listener) * * @param follower [in] Registered follower - * @return A tap data handler + * @return A tap packet handler */ -WS_DLL_PUBLIC follow_tap_func get_follow_tap_handler(register_follow_t* follower); +WS_DLL_PUBLIC tap_packet_cb get_follow_tap_handler(register_follow_t* follower); /** Tap function handler when dissector's tap provides follow data as a tvb. * Used by TCP, UDP and HTTP followers */ -WS_DLL_PUBLIC gboolean +WS_DLL_PUBLIC tap_packet_status follow_tvb_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data); /** Interator to walk all registered followers and execute func diff --git a/epan/stats_tree.c b/epan/stats_tree.c index f46527f69b..ad0b7eb040 100644 --- a/epan/stats_tree.c +++ b/epan/stats_tree.c @@ -374,7 +374,7 @@ stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter) } /* will be the tap packet cb */ -extern int +extern tap_packet_status stats_tree_packet(void *p, packet_info *pinfo, epan_dissect_t *edt, const void *pri) { stats_tree *st = (stats_tree *)p; @@ -387,7 +387,7 @@ stats_tree_packet(void *p, packet_info *pinfo, epan_dissect_t *edt, const void * if (st->cfg->packet) return st->cfg->packet(st,pinfo,edt,pri); else - return 0; + return TAP_PACKET_DONT_REDRAW; } extern stats_tree_cfg* diff --git a/epan/stats_tree.h b/epan/stats_tree.h index 5587d2f41b..8adf193279 100644 --- a/epan/stats_tree.h +++ b/epan/stats_tree.h @@ -46,10 +46,10 @@ extern "C" { typedef struct _stats_tree stats_tree; /* tap packet callback for stats_tree */ -typedef int (*stat_tree_packet_cb)(stats_tree*, - packet_info *, - epan_dissect_t *, - const void *); +typedef tap_packet_status (*stat_tree_packet_cb)(stats_tree*, + packet_info *, + epan_dissect_t *, + const void *); /* stats_tree initialization callback */ typedef void (*stat_tree_init_cb)(stats_tree *); diff --git a/epan/stats_tree_priv.h b/epan/stats_tree_priv.h index ec4b4de54d..4fe77293b4 100644 --- a/epan/stats_tree_priv.h +++ b/epan/stats_tree_priv.h @@ -178,7 +178,7 @@ WS_DLL_PUBLIC void stats_tree_presentation(void (*registry_iterator)(gpointer,gp WS_DLL_PUBLIC stats_tree *stats_tree_new(stats_tree_cfg *cfg, tree_pres *pr, const char *filter); /** callback for taps */ -WS_DLL_PUBLIC int stats_tree_packet(void*, packet_info*, epan_dissect_t*, const void *); +WS_DLL_PUBLIC tap_packet_status stats_tree_packet(void*, packet_info*, epan_dissect_t*, const void *); /** callback for reset */ WS_DLL_PUBLIC void stats_tree_reset(void *p_st); diff --git a/epan/tap.c b/epan/tap.c index 9355c86315..e0e3a22beb 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -80,6 +80,7 @@ typedef struct _tap_listener_t { struct _tap_listener_t *next; int tap_id; gboolean needs_redraw; + gboolean failed; guint flags; gchar *fstring; dfilter_t *code; @@ -310,12 +311,49 @@ tap_push_tapped_queue(epan_dissect_t *edt) if (!(tp->flags & TAP_PACKET_IS_ERROR_PACKET) || (tl->flags & TL_REQUIRES_ERROR_PACKETS)) { if(tp->tap_id==tl->tap_id){ - gboolean passed=TRUE; + if(!tl->packet){ + /* There isn't a per-packet + * routine for this tap. + */ + continue; + } + if(tl->failed){ + /* A previous call failed, + * meaning "stop running this + * tap", so don't call the + * packet routine. + */ + continue; + } + + /* If we have a filter, see if the + * packet passes. + */ if(tl->code){ - passed=dfilter_apply_edt(tl->code, edt); + if (!dfilter_apply_edt(tl->code, edt)){ + /* The packet didn't + * pass the filter. */ + continue; + } } - if(passed && tl->packet){ - tl->needs_redraw|=tl->packet(tl->tapdata, tp->pinfo, edt, tp->tap_specific_data); + + /* So call the per-packet routine. */ + tap_packet_status status; + + status = tl->packet(tl->tapdata, tp->pinfo, edt, tp->tap_specific_data); + + switch (status) { + + case TAP_PACKET_DONT_REDRAW: + break; + + case TAP_PACKET_REDRAW: + tl->needs_redraw=TRUE; + break; + + case TAP_PACKET_FAILED: + tl->failed=TRUE; + break; } } } @@ -380,6 +418,7 @@ reset_tap_listeners(void) tl->reset(tl->tapdata); } tl->needs_redraw=TRUE; + tl->failed=FALSE; } } @@ -490,6 +529,7 @@ register_tap_listener(const char *tapname, void *tapdata, const char *fstring, tl=(tap_listener_t *)g_malloc0(sizeof(tap_listener_t)); tl->needs_redraw=TRUE; + tl->failed=FALSE; tl->flags=flags; if(fstring){ if(!dfilter_compile(fstring, &code, &err_msg)){ diff --git a/epan/tap.h b/epan/tap.h index 986bfe8194..d45a45e412 100644 --- a/epan/tap.h +++ b/epan/tap.h @@ -22,8 +22,17 @@ extern "C" { #endif /* __cplusplus */ +/** + * Status returned by the per-packet callback. + */ +typedef enum { + TAP_PACKET_DONT_REDRAW, /**< Packet processing succeeded, no need to redraw */ + TAP_PACKET_REDRAW, /**< Packet processing succeeded, must redraw */ + TAP_PACKET_FAILED /**< Packet processing failed, stop calling this tap */ +} tap_packet_status; + typedef void (*tap_reset_cb)(void *tapdata); -typedef gboolean (*tap_packet_cb)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data); +typedef tap_packet_status (*tap_packet_cb)(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data); typedef void (*tap_draw_cb)(void *tapdata); typedef void (*tap_finish_cb)(void *tapdata); diff --git a/epan/wslua/wslua_listener.c b/epan/wslua/wslua_listener.c index 3159719806..094d9f2134 100644 --- a/epan/wslua/wslua_listener.c +++ b/epan/wslua/wslua_listener.c @@ -68,11 +68,11 @@ static int tap_packet_cb_error_handler(lua_State* L) { } -static gboolean lua_tap_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data) { +static tap_packet_status lua_tap_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data) { Listener tap = (Listener)tapdata; - gboolean retval = FALSE; + tap_packet_status retval = TAP_PACKET_DONT_REDRAW; - if (tap->packet_ref == LUA_NOREF) return FALSE; + if (tap->packet_ref == LUA_NOREF) return TAP_PACKET_DONT_REDRAW; /* XXX - report error and return TAP_PACKET_FAILED? */ lua_settop(tap->L,0); @@ -94,12 +94,15 @@ static gboolean lua_tap_packet(void *tapdata, packet_info *pinfo, epan_dissect_t switch ( lua_pcall(tap->L,3,1,1) ) { case 0: - retval = luaL_optinteger(tap->L,-1,1) == 0 ? FALSE : TRUE; + /* XXX - treat 2 as TAP_PACKET_FAILED? */ + retval = luaL_optinteger(tap->L,-1,1) == 0 ? TAP_PACKET_DONT_REDRAW : TAP_PACKET_REDRAW; break; case LUA_ERRRUN: + /* XXX - TAP_PACKET_FAILED? */ break; case LUA_ERRMEM: g_warning("Memory alloc error while calling listener tap callback packet"); + /* XXX - TAP_PACKET_FAILED? */ break; default: g_assert_not_reached(); diff --git a/plugins/epan/stats_tree/pinfo_stats_tree.c b/plugins/epan/stats_tree/pinfo_stats_tree.c index 710fb0beea..c45130abf1 100644 --- a/plugins/epan/stats_tree/pinfo_stats_tree.c +++ b/plugins/epan/stats_tree/pinfo_stats_tree.c @@ -106,18 +106,18 @@ static void ipv6_hosts_stats_tree_init(stats_tree *st) { st_node_ipv6 = stats_tree_create_node(st, st_str_ipv6, 0, STAT_DT_INT, TRUE); } -static int ip_hosts_stats_tree_packet(stats_tree *st, packet_info *pinfo, int st_node, const gchar *st_str) { +static tap_packet_status ip_hosts_stats_tree_packet(stats_tree *st, packet_info *pinfo, int st_node, const gchar *st_str) { tick_stat_node(st, st_str, 0, FALSE); tick_stat_node(st, address_to_str(pinfo->pool, &pinfo->net_src), st_node, FALSE); tick_stat_node(st, address_to_str(pinfo->pool, &pinfo->net_dst), st_node, FALSE); - return 1; + return TAP_PACKET_REDRAW; } -static int ipv4_hosts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv4_hosts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { return ip_hosts_stats_tree_packet(st, pinfo, st_node_ipv4, st_str_ipv4); } -static int ipv6_hosts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv6_hosts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { return ip_hosts_stats_tree_packet(st, pinfo, st_node_ipv6, st_str_ipv6); } @@ -154,23 +154,26 @@ static void ipv6_srcdst_stats_tree_init(stats_tree *st) { ip_srcdst_stats_tree_init(st, st_str_ipv6_src, &st_node_ipv6_src, st_str_ipv6_dst, &st_node_ipv6_dst); } -static int ip_srcdst_stats_tree_packet(stats_tree *st, packet_info *pinfo, - int st_node_src, const gchar *st_str_src, - int st_node_dst, const gchar *st_str_dst) { +static tap_packet_status ip_srcdst_stats_tree_packet(stats_tree *st, + packet_info *pinfo, + int st_node_src, + const gchar *st_str_src, + int st_node_dst, + const gchar *st_str_dst) { /* update source branch */ tick_stat_node(st, st_str_src, 0, FALSE); tick_stat_node(st, address_to_str(pinfo->pool, &pinfo->net_src), st_node_src, FALSE); /* update destination branch */ tick_stat_node(st, st_str_dst, 0, FALSE); tick_stat_node(st, address_to_str(pinfo->pool, &pinfo->net_dst), st_node_dst, FALSE); - return 1; + return TAP_PACKET_REDRAW; } -static int ipv4_srcdst_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv4_srcdst_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { return ip_srcdst_stats_tree_packet(st, pinfo, st_node_ipv4_src, st_str_ipv4_src, st_node_ipv4_dst, st_str_ipv4_dst); } -static int ipv6_srcdst_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv6_srcdst_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { return ip_srcdst_stats_tree_packet(st, pinfo, st_node_ipv6_src, st_str_ipv6_src, st_node_ipv6_dst, st_str_ipv6_dst); } @@ -188,14 +191,14 @@ static void ipv6_ptype_stats_tree_init(stats_tree *st) { st_node_ipv6_ptype = stats_tree_create_pivot(st, st_str_ipv6_ptype, 0); } -static int ipv4_ptype_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv4_ptype_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { stats_tree_tick_pivot(st, st_node_ipv4_ptype, port_type_to_str(pinfo->ptype)); - return 1; + return TAP_PACKET_REDRAW; } -static int ipv6_ptype_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv6_ptype_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { stats_tree_tick_pivot(st, st_node_ipv6_ptype, port_type_to_str(pinfo->ptype)); - return 1; + return TAP_PACKET_REDRAW; } /* a tree example @@ -217,7 +220,7 @@ static void ipv6_dsts_stats_tree_init(stats_tree *st) { st_node_ipv6_dsts = stats_tree_create_node(st, st_str_ipv6_dsts, 0, STAT_DT_INT, TRUE); } -static int dsts_stats_tree_packet(stats_tree *st, packet_info *pinfo, int st_node, const gchar *st_str) { +static tap_packet_status dsts_stats_tree_packet(stats_tree *st, packet_info *pinfo, int st_node, const gchar *st_str) { static gchar str[128]; int ip_dst_node; int protocol_node; @@ -227,14 +230,14 @@ static int dsts_stats_tree_packet(stats_tree *st, packet_info *pinfo, int st_nod protocol_node = tick_stat_node(st, port_type_to_str(pinfo->ptype), ip_dst_node, TRUE); g_snprintf(str, sizeof(str) - 1, "%u", pinfo->destport); tick_stat_node(st, str, protocol_node, TRUE); - return 1; + return TAP_PACKET_REDRAW; } -static int ipv4_dsts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv4_dsts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { return dsts_stats_tree_packet(st, pinfo, st_node_ipv4_dsts, st_str_ipv4_dsts); } -static int ipv6_dsts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status ipv6_dsts_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { return dsts_stats_tree_packet(st, pinfo, st_node_ipv6_dsts, st_str_ipv6_dsts); } @@ -259,12 +262,12 @@ static void plen_stats_tree_init(stats_tree *st) { } } -static int plen_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { +static tap_packet_status plen_stats_tree_packet(stats_tree *st, packet_info *pinfo, epan_dissect_t *edt _U_, const void *p _U_) { tick_stat_node(st, st_str_plen, 0, FALSE); stats_tree_tick_range(st, st_str_plen, 0, pinfo->fd->pkt_len); - return 1; + return TAP_PACKET_REDRAW; } /* register all pinfo trees */ diff --git a/rawshark.c b/rawshark.c index 738b521e89..c23d8020ac 100644 --- a/rawshark.c +++ b/rawshark.c @@ -1247,7 +1247,7 @@ static gboolean print_field_value(field_info *finfo, int cmd_line_index) return TRUE; } -static int +static tap_packet_status protocolinfo_packet(void *prs, packet_info *pinfo _U_, epan_dissect_t *edt, const void *dummy _U_) { pci_t *rs=(pci_t *)prs; @@ -1257,7 +1257,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo _U_, epan_dissect_t *edt, cons gp=proto_get_finfo_ptr_array(edt->tree, rs->hf_index); if(!gp){ printf(" n.a."); - return 0; + return TAP_PACKET_DONT_REDRAW; } /* @@ -1267,7 +1267,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo _U_, epan_dissect_t *edt, cons print_field_value((field_info *)gp->pdata[i], rs->cmd_line_index); } - return 0; + return TAP_PACKET_DONT_REDRAW; } int g_cmd_line_index = 0; diff --git a/sharkd_session.c b/sharkd_session.c index b1aff99a89..af4f9bdd52 100644 --- a/sharkd_session.c +++ b/sharkd_session.c @@ -1207,7 +1207,7 @@ sharkd_session_process_tap_expert_cb(void *tapdata) putchar(','); } -static gboolean +static tap_packet_status sharkd_session_packet_tap_expert_cb(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pointer) { struct sharkd_expert_tap *etd = (struct sharkd_expert_tap *) tapdata; @@ -1215,7 +1215,7 @@ sharkd_session_packet_tap_expert_cb(void *tapdata, packet_info *pinfo _U_, epan_ expert_info_t *ei_copy; if (ei == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; ei_copy = g_new(expert_info_t, 1); /* Note: this is a shallow copy */ @@ -1227,7 +1227,7 @@ sharkd_session_packet_tap_expert_cb(void *tapdata, packet_info *pinfo _U_, epan_ etd->details = g_slist_prepend(etd->details, ei_copy); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -1437,7 +1437,7 @@ sharkd_session_process_tap_rtp_free_cb(void *tapdata) g_free(rtp_req); } -static gboolean +static tap_packet_status sharkd_session_packet_tap_rtp_analyse_cb(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pointer) { struct sharkd_analyse_rtp *rtp_req = (struct sharkd_analyse_rtp *) tapdata; @@ -1471,7 +1471,7 @@ sharkd_session_packet_tap_rtp_analyse_cb(void *tapdata, packet_info *pinfo, epan rtp_req->packets = g_slist_append(rtp_req->packets, item); } - return TRUE; + return TAP_PACKET_REDRAW; } /** @@ -3072,15 +3072,16 @@ struct sharkd_iograph GString *error; }; -static gboolean +static tap_packet_status sharkd_iograph_packet(void *g, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_) { struct sharkd_iograph *graph = (struct sharkd_iograph *) g; int idx; + gboolean update_succeeded; idx = get_io_graph_index(pinfo, graph->interval); if (idx < 0 || idx >= SHARKD_IOGRAPH_MAX_ITEMS) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (idx + 1 > graph->num_items) { @@ -3102,7 +3103,9 @@ sharkd_iograph_packet(void *g, packet_info *pinfo, epan_dissect_t *edt, const vo graph->num_items = idx + 1; } - return update_io_graph_item(graph->items, idx, pinfo, edt, graph->hf_index, graph->calc_type, graph->interval); + update_succeeded = update_io_graph_item(graph->items, idx, pinfo, edt, graph->hf_index, graph->calc_type, graph->interval); + /* XXX - TAP_PACKET_FAILED if the item couldn't be updated, with an error message? */ + return update_succeeded ? TAP_PACKET_REDRAW : TAP_PACKET_DONT_REDRAW; } /** @@ -4147,7 +4150,7 @@ sharkd_rtp_download_decode(struct sharkd_download_rtp *req) g_hash_table_destroy(decoders_hash_); } -static gboolean +static tap_packet_status sharkd_session_packet_download_tap_rtp_cb(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { const struct _rtp_info *rtp_info = (const struct _rtp_info *) data; @@ -4155,7 +4158,7 @@ sharkd_session_packet_download_tap_rtp_cb(void *tapdata, packet_info *pinfo, epa /* do not consider RTP packets without a setup frame */ if (rtp_info->info_setup_frame_num == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (rtpstream_id_equal_pinfo_rtp_info(&req_rtp->id, pinfo, rtp_info)) { @@ -4177,7 +4180,7 @@ sharkd_session_packet_download_tap_rtp_cb(void *tapdata, packet_info *pinfo, epa req_rtp->packets = g_slist_append(req_rtp->packets, rtp_packet); } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /** diff --git a/ui/cli/tap-camelsrt.c b/ui/cli/tap-camelsrt.c index f3d81269e6..13b213e63d 100644 --- a/ui/cli/tap-camelsrt.c +++ b/ui/cli/tap-camelsrt.c @@ -50,10 +50,10 @@ static void camelsrt_reset(void *phs) } -static int camelsrt_packet(void *phs, - packet_info *pinfo _U_, - epan_dissect_t *edt _U_, - const void *phi) +static tap_packet_status camelsrt_packet(void *phs, + packet_info *pinfo _U_, + epan_dissect_t *edt _U_, + const void *phi) { struct camelsrt_t *hs = (struct camelsrt_t *)phs; const struct camelsrt_info_t * pi = (const struct camelsrt_info_t *)phi; @@ -75,7 +75,7 @@ static int camelsrt_packet(void *phs, } } } - return 1; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-diameter-avp.c b/ui/cli/tap-diameter-avp.c index f607ae2369..6815430dbc 100644 --- a/ui/cli/tap-diameter-avp.c +++ b/ui/cli/tap-diameter-avp.c @@ -112,10 +112,10 @@ diam_tree_to_csv(proto_node *node, gpointer data) return FALSE; } -static int +static tap_packet_status diameteravp_packet(void *pds, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pdi) { - int ret = 0; + tap_packet_status ret = TAP_PACKET_DONT_REDRAW; double resp_time = 0.; gboolean is_request = TRUE; guint32 cmd_code = 0; @@ -140,7 +140,7 @@ diameteravp_packet(void *pds, packet_info *pinfo, epan_dissect_t *edt _U_, const ds->frame = pinfo->num; ds->diammsg_toprocess = 0; } else { - ds->diammsg_toprocess += 1; + ds->diammsg_toprocess += 1; } /* Extract data from request/answer pair provided by diameter dissector.*/ diff --git a/ui/cli/tap-expert.c b/ui/cli/tap-expert.c index 3dc33aae2c..0d6bb99cbb 100644 --- a/ui/cli/tap-expert.c +++ b/ui/cli/tap-expert.c @@ -70,7 +70,7 @@ expert_stat_reset(void *tapdata) } /* Process stat struct for an expert frame */ -static gboolean +static tap_packet_status expert_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pointer) { @@ -99,12 +99,12 @@ expert_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U break; default: g_assert_not_reached(); - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* Don't store details at a lesser severity than we are interested in */ if (severity_level < lowest_report_level) { - return TRUE; + return TAP_PACKET_REDRAW; /* XXX - TAP_PACKET_DONT_REDRAW? */ } /* If a duplicate just bump up frequency. @@ -114,7 +114,7 @@ expert_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U if ((strcmp(ei->protocol, entry->protocol) == 0) && (strcmp(ei->summary, entry->summary) == 0)) { entry->frequency++; - return TRUE; + return TAP_PACKET_REDRAW; } } @@ -128,7 +128,7 @@ expert_stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U /* Store a copy of the expert entry */ g_array_append_val(data->ei_array[severity_level], tmp_entry); - return TRUE; + return TAP_PACKET_REDRAW; } /* Output for all of the items of one severity */ diff --git a/ui/cli/tap-gsm_astat.c b/ui/cli/tap-gsm_astat.c index ddd805c584..e56139b3bd 100644 --- a/ui/cli/tap-gsm_astat.c +++ b/ui/cli/tap-gsm_astat.c @@ -45,7 +45,7 @@ typedef struct _gsm_a_stat_t { } gsm_a_stat_t; -static int +static tap_packet_status gsm_a_stat_packet( void *tapdata, packet_info *pinfo _U_, @@ -92,7 +92,7 @@ gsm_a_stat_packet( /* * unsupported PD */ - return(0); + return(TAP_PACKET_DONT_REDRAW); } break; @@ -112,10 +112,10 @@ gsm_a_stat_packet( /* * unknown PDU type !!! */ - return(0); + return(TAP_PACKET_DONT_REDRAW); } - return(1); + return(TAP_PACKET_REDRAW); } diff --git a/ui/cli/tap-httpstat.c b/ui/cli/tap-httpstat.c index 184c0d98f2..dba569cf5b 100644 --- a/ui/cli/tap-httpstat.c +++ b/ui/cli/tap-httpstat.c @@ -197,7 +197,7 @@ httpstat_reset(void *psp ) } -static int +static tap_packet_status httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) { const http_info_value_t *value = (const http_info_value_t *)pri; @@ -218,7 +218,7 @@ httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con */ int i = value->response_code; if ((i < 100) || (i >= 600)) { - return 0; + return TAP_PACKET_DONT_REDRAW; } else if (i < 200) { key = 199; /* Hopefully, this status code will never be used */ @@ -239,7 +239,7 @@ httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con sp->hash_responses, GUINT_TO_POINTER(key)); if (sc == NULL) - return 0; + return TAP_PACKET_DONT_REDRAW; } sc->packets++; } @@ -259,9 +259,9 @@ httpstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con sc->packets++; } } else { - return 0; + return TAP_PACKET_DONT_REDRAW; } - return 1; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-icmpstat.c b/ui/cli/tap-icmpstat.c index d1dfebb77f..628e567350 100644 --- a/ui/cli/tap-icmpstat.c +++ b/ui/cli/tap-icmpstat.c @@ -102,10 +102,10 @@ static gint compare_doubles(gconstpointer a, gconstpointer b) * "icmp" tap, the third parameter type is icmp_transaction_t. * * function returns : - * FALSE: no updates, no need to call (*draw) later - * TRUE: state has changed, call (*draw) sometime later + * TAP_PACKET_DONT_REDRAW: no updates, no need to call (*draw) later + * TAP_PACKET_REDRAW: state has changed, call (*draw) sometime later */ -static gboolean +static tap_packet_status icmpstat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { icmpstat_t *icmpstat = (icmpstat_t *)tapdata; @@ -113,13 +113,13 @@ icmpstat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, double resp_time, *rt; if (trans == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (trans->resp_frame) { resp_time = nstime_to_msec(&trans->resp_time); rt = g_new(double, 1); if (rt == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; *rt = resp_time; icmpstat->rt_list = g_slist_prepend(icmpstat->rt_list, rt); icmpstat->num_resps++; @@ -135,9 +135,9 @@ icmpstat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, } else if (trans->rqst_frame) icmpstat->num_rqsts++; else - return FALSE; + return TAP_PACKET_DONT_REDRAW; - return TRUE; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-icmpv6stat.c b/ui/cli/tap-icmpv6stat.c index 04bcf973a8..517b704148 100644 --- a/ui/cli/tap-icmpv6stat.c +++ b/ui/cli/tap-icmpv6stat.c @@ -103,10 +103,10 @@ static gint compare_doubles(gconstpointer a, gconstpointer b) * "icmpv6" tap, the third parameter type is icmp_transaction_t. * * function returns : - * FALSE: no updates, no need to call (*draw) later - * TRUE: state has changed, call (*draw) sometime later + * TAP_PACKET_DONT_REDRAW: no updates, no need to call (*draw) later + * TAP_PACKET_REDRAW: state has changed, call (*draw) sometime later */ -static gboolean +static tap_packet_status icmpv6stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *data) { icmpv6stat_t *icmpv6stat = (icmpv6stat_t *)tapdata; @@ -114,13 +114,13 @@ icmpv6stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_ double resp_time, *rt; if (trans == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (trans->resp_frame) { resp_time = nstime_to_msec(&trans->resp_time); rt = g_new(double, 1); if (rt == NULL) - return FALSE; + return TAP_PACKET_DONT_REDRAW; *rt = resp_time; icmpv6stat->rt_list = g_slist_prepend(icmpv6stat->rt_list, rt); icmpv6stat->num_resps++; @@ -136,9 +136,9 @@ icmpv6stat_packet(void *tapdata, packet_info *pinfo _U_, epan_dissect_t *edt _U_ } else if (trans->rqst_frame) icmpv6stat->num_rqsts++; else - return FALSE; + return TAP_PACKET_DONT_REDRAW; - return TRUE; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-iostat.c b/ui/cli/tap-iostat.c index 1928f97e68..4c328a8c35 100644 --- a/ui/cli/tap-iostat.c +++ b/ui/cli/tap-iostat.c @@ -78,7 +78,7 @@ typedef struct _io_stat_item_t { static guint64 last_relative_time; -static int +static tap_packet_status iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_) { io_stat_t *parent; @@ -506,7 +506,7 @@ iostat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt, const void *du break; } } - return TRUE; + return TAP_PACKET_REDRAW; } static int diff --git a/ui/cli/tap-macltestat.c b/ui/cli/tap-macltestat.c index cb35ce89e0..6513dc65b7 100644 --- a/ui/cli/tap-macltestat.c +++ b/ui/cli/tap-macltestat.c @@ -207,7 +207,7 @@ static void update_ueid_rnti_counts(guint16 rnti, guint16 ueid, mac_lte_stat_t * /* Process stat struct for a MAC LTE frame */ -static int +static tap_packet_status mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *phi) { @@ -220,7 +220,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, const struct mac_lte_tap_info *si = (const struct mac_lte_tap_info *)phi; if (!hs) { - return 0; + return TAP_PACKET_DONT_REDRAW; } hs->common_stats.all_frames++; @@ -231,18 +231,18 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, hs->common_stats.pch_frames++; hs->common_stats.pch_bytes += si->single_number_of_bytes; hs->common_stats.pch_paging_ids += si->number_of_paging_ids; - return 1; + return TAP_PACKET_REDRAW; case SI_RNTI: hs->common_stats.sib_frames++; hs->common_stats.sib_bytes += si->single_number_of_bytes; - return 1; + return TAP_PACKET_REDRAW; case NO_RNTI: hs->common_stats.mib_frames++; - return 1; + return TAP_PACKET_REDRAW; case RA_RNTI: hs->common_stats.rar_frames++; hs->common_stats.rar_entries += si->number_of_rars; - return 1; + return TAP_PACKET_REDRAW; case C_RNTI: case SPS_RNTI: /* Drop through for per-UE update */ @@ -250,7 +250,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, default: /* Error */ - return 0; + return TAP_PACKET_DONT_REDRAW; } /* Check max UEs/tti counter */ @@ -304,7 +304,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, /* Really should have a row pointer by now */ if (!te) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* Update entry with details from si */ @@ -315,12 +315,12 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, if (si->direction == DIRECTION_UPLINK) { if (si->isPHYRetx) { te->stats.UL_retx_frames++; - return 1; + return TAP_PACKET_REDRAW; } if (si->crcStatusValid && (si->crcStatus != crc_success)) { te->stats.UL_CRC_errors++; - return 1; + return TAP_PACKET_REDRAW; } /* Update time range */ @@ -348,7 +348,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, else { if (si->isPHYRetx) { te->stats.DL_retx_frames++; - return 1; + return TAP_PACKET_REDRAW; } if (si->crcStatusValid && (si->crcStatus != crc_success)) { @@ -370,7 +370,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, /* Something went wrong! */ break; } - return 1; + return TAP_PACKET_REDRAW; } /* Update time range */ @@ -395,7 +395,7 @@ mac_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, } - return 1; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-protocolinfo.c b/ui/cli/tap-protocolinfo.c index e0c777b670..b5bd9d5958 100644 --- a/ui/cli/tap-protocolinfo.c +++ b/ui/cli/tap-protocolinfo.c @@ -31,7 +31,7 @@ typedef struct _pci_t { } pci_t; -static int +static tap_packet_status protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_) { pci_t *rs = (pci_t *)prs; @@ -48,6 +48,8 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo * * To prevent a crash, we check whether INFO column is writable * and, if not, we report that error and exit. + * + * XXX - report the error and just return TAP_PACKET_FAILED? */ if (!col_get_writable(pinfo->cinfo, COL_INFO)) { cmdarg_err("the proto,colinfo tap doesn't work if the INFO column isn't being printed."); @@ -55,7 +57,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo } gp = proto_get_finfo_ptr_array(edt->tree, rs->hf_index); if (!gp) { - return 0; + return TAP_PACKET_DONT_REDRAW; } for (i=0; i<gp->len; i++) { @@ -65,7 +67,7 @@ protocolinfo_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const vo wmem_free(NULL, str); } } - return 0; + return TAP_PACKET_DONT_REDRAW; } diff --git a/ui/cli/tap-protohierstat.c b/ui/cli/tap-protohierstat.c index 8009874725..dd1bed9229 100644 --- a/ui/cli/tap-protohierstat.c +++ b/ui/cli/tap-protohierstat.c @@ -53,7 +53,7 @@ new_phs_t(phs_t *parent) } -static int +static tap_packet_status protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const void *dummy _U_) { phs_t *rs = (phs_t *)prs; @@ -62,13 +62,13 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v field_info *fi; if (!edt) { - return 0; + return TAP_PACKET_DONT_REDRAW; } if (!edt->tree) { - return 0; + return TAP_PACKET_DONT_REDRAW; } if (!edt->tree->first_child) { - return 0; + return TAP_PACKET_DONT_REDRAW; } for (node=edt->tree->first_child; node; node=node->next) { @@ -112,7 +112,7 @@ protohierstat_packet(void *prs, packet_info *pinfo, epan_dissect_t *edt, const v } rs = rs->child; } - return 1; + return TAP_PACKET_REDRAW; } static void diff --git a/ui/cli/tap-rlcltestat.c b/ui/cli/tap-rlcltestat.c index b46345d5a9..b376e8f89c 100644 --- a/ui/cli/tap-rlcltestat.c +++ b/ui/cli/tap-rlcltestat.c @@ -151,7 +151,7 @@ static rlc_lte_ep_t *alloc_rlc_lte_ep(const struct rlc_lte_tap_info *si, packet_ /* Process stat struct for a RLC LTE frame */ -static int +static tap_packet_status rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, const void *phi) { @@ -164,7 +164,7 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, /* Need this */ if (!hs) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* Inc top-level frame count */ @@ -176,12 +176,12 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, case CHANNEL_TYPE_BCCH_DL_SCH: hs->common_stats.bcch_frames++; hs->common_stats.bcch_bytes += si->pduLength; - return 1; + return TAP_PACKET_REDRAW; case CHANNEL_TYPE_PCCH: hs->common_stats.pcch_frames++; hs->common_stats.pcch_bytes += si->pduLength; - return 1; + return TAP_PACKET_REDRAW; default: break; @@ -218,7 +218,7 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, /* Really should have a row pointer by now */ if (!te) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* Update entry with details from si */ @@ -262,7 +262,7 @@ rlc_lte_stat_packet(void *phs, packet_info *pinfo, epan_dissect_t *edt _U_, te->stats.DL_total_missing += si->missingSNs; } - return 1; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-rpcprogs.c b/ui/cli/tap-rpcprogs.c index 8581850b2e..02dcf4a200 100644 --- a/ui/cli/tap-rpcprogs.c +++ b/ui/cli/tap-rpcprogs.c @@ -46,7 +46,7 @@ typedef struct _rpc_program_t { static rpc_program_t *prog_list = NULL; static int already_enabled = 0; -static int +static tap_packet_status rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) { const rpc_call_info_value *ri = (const rpc_call_info_value *)pri; @@ -120,7 +120,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c /* we are only interested in reply packets */ if (ri->request || !rp) { - return 0; + return TAP_PACKET_DONT_REDRAW; } /* calculate time delta between request and reply */ @@ -160,7 +160,7 @@ rpcprogs_packet(void *dummy1 _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c } rp->num++; - return 1; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-rtspstat.c b/ui/cli/tap-rtspstat.c index 3db29ceaf6..5a2519c14b 100644 --- a/ui/cli/tap-rtspstat.c +++ b/ui/cli/tap-rtspstat.c @@ -126,7 +126,7 @@ rtspstat_reset(void *psp ) } -static int +static tap_packet_status rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) { const rtsp_info_value_t *value = (const rtsp_info_value_t *)pri; @@ -147,7 +147,7 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con */ int i = value->response_code; if ((i < 100) || (i >= 600)) { - return 0; + return TAP_PACKET_DONT_REDRAW; } else if (i < 200) { key = 199; /* Hopefully, this status code will never be used */ @@ -168,7 +168,7 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con sp->hash_responses, GINT_TO_POINTER(key)); if (sc == NULL) - return 0; + return TAP_PACKET_DONT_REDRAW; } sc->packets++; } @@ -188,9 +188,9 @@ rtspstat_packet(void *psp , packet_info *pinfo _U_, epan_dissect_t *edt _U_, con sc->packets++; } } else { - return 0; + return TAP_PACKET_DONT_REDRAW; } - return 1; + return TAP_PACKET_REDRAW; } diff --git a/ui/cli/tap-sctpchunkstat.c b/ui/cli/tap-sctpchunkstat.c index cfb3d5376a..45dd4b9511 100644 --- a/ui/cli/tap-sctpchunkstat.c +++ b/ui/cli/tap-sctpchunkstat.c @@ -92,7 +92,7 @@ alloc_sctp_ep(const struct _sctp_info *si) -static int +static tap_packet_status sctpstat_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *phi) { @@ -103,7 +103,7 @@ sctpstat_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons guint8 chunk_type; if (!hs) - return (0); + return (TAP_PACKET_DONT_REDRAW); hs->number_of_packets++; @@ -131,7 +131,7 @@ sctpstat_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons } if (!te) - return (0); + return (TAP_PACKET_DONT_REDRAW); if (si->number_of_tvbs > 0) { @@ -144,7 +144,7 @@ sctpstat_packet(void *phs, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons te->chunk_count[CHUNK_TYPE(si->tvb[tvb_number])]++; } } - return (1); + return (TAP_PACKET_REDRAW); } diff --git a/ui/cli/tap-sipstat.c b/ui/cli/tap-sipstat.c index 988da5a89a..8bc521c7d1 100644 --- a/ui/cli/tap-sipstat.c +++ b/ui/cli/tap-sipstat.c @@ -248,7 +248,7 @@ sipstat_reset(void *psp ) /* Main entry point to SIP tap */ -static int +static tap_packet_status sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) { const sip_info_value_t *value = (const sip_info_value_t *)pri; @@ -306,7 +306,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const if ((i < 100) || (i >= 700)) { /* Forget about crazy values */ - return 0; + return TAP_PACKET_DONT_REDRAW; } else if (i < 200) { @@ -337,7 +337,7 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const sc = (sip_response_code_t *)g_hash_table_lookup(sp->hash_responses, &key); if (sc == NULL) { - return 0; + return TAP_PACKET_DONT_REDRAW; } } sc->packets++; @@ -369,10 +369,10 @@ sipstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const else { /* No request method set. Just ignore */ - return 0; + return TAP_PACKET_DONT_REDRAW; } - return 1; + return TAP_PACKET_REDRAW; } static void diff --git a/ui/cli/tap-smbsids.c b/ui/cli/tap-smbsids.c index 039a5acc49..2f4c306be5 100644 --- a/ui/cli/tap-smbsids.c +++ b/ui/cli/tap-smbsids.c @@ -27,10 +27,10 @@ void register_tap_listener_smbsids(void); -static int +static tap_packet_status smbsids_packet(void *pss _U_, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *psi _U_) { - return 1; + return TAP_PACKET_REDRAW; } static void diff --git a/ui/cli/tap-sv.c b/ui/cli/tap-sv.c index 5899777711..0b75edb598 100644 --- a/ui/cli/tap-sv.c +++ b/ui/cli/tap-sv.c @@ -26,7 +26,7 @@ void register_tap_listener_sv(void); -static int +static tap_packet_status sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *pri) { int i; @@ -40,7 +40,7 @@ sv_packet(void *prs _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void printf("\n"); - return 0; + return TAP_PACKET_DONT_REDRAW; } static void diff --git a/ui/cli/tap-wspstat.c b/ui/cli/tap-wspstat.c index 3f8c21c8b3..34300e1613 100644 --- a/ui/cli/tap-wspstat.c +++ b/ui/cli/tap-wspstat.c @@ -116,13 +116,13 @@ index2pdut(gint pdut) return pdut + 81; return 0; } -static int +static tap_packet_status wspstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri) { wspstat_t *sp = (wspstat_t *)psp; const wsp_info_value_t *value = (const wsp_info_value_t *)pri; gint idx = pdut2index(value->pdut); - int retour = 0; + tap_packet_status retour = TAP_PACKET_DONT_REDRAW; if (value->status_code != 0) { wsp_status_code_t *sc; @@ -140,14 +140,14 @@ wspstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const } else { sc->packets++; } - retour = 1; + retour = TAP_PACKET_REDRAW; } if (idx != 0) { sp->pdu_stats[idx].packets++; - retour = 1; + retour = TAP_PACKET_REDRAW; } return retour; } diff --git a/ui/mcast_stream.c b/ui/mcast_stream.c index 61280bf082..9711c9fb16 100644 --- a/ui/mcast_stream.c +++ b/ui/mcast_stream.c @@ -131,7 +131,7 @@ mcaststream_draw(void *ti_ptr) /****************************************************************************/ /* whenever a udp packet is seen by the tap listener */ -static gboolean +static tap_packet_status mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2 _U_) { mcaststream_tapinfo_t *tapinfo = (mcaststream_tapinfo_t *)arg; @@ -150,16 +150,16 @@ mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const case AT_IPv4: /* 224.0.0.0/4 */ if (pinfo->net_dst.len == 0 || (((const guint8*)pinfo->net_dst.data)[0] & 0xf0) != 0xe0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; break; case AT_IPv6: /* ff00::/8 */ /* XXX This includes DHCPv6. */ if (pinfo->net_dst.len == 0 || ((const guint8*)pinfo->net_dst.data)[0] != 0xff) - return FALSE; + return TAP_PACKET_DONT_REDRAW; break; default: - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* gather infos on the stream this packet is part of */ @@ -276,7 +276,7 @@ mcaststream_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const buffusagecalc(tapinfo->allstreams, pinfo, mcast_stream_cumulemptyspeed*1000); /* end of sliding window */ - return 1; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.cpp b/ui/qt/bluetooth_att_server_attributes_dialog.cpp index 973c09d5ee..d13aa91cf4 100644 --- a/ui/qt/bluetooth_att_server_attributes_dialog.cpp +++ b/ui/qt/bluetooth_att_server_attributes_dialog.cpp @@ -32,7 +32,7 @@ static const int column_number_handle = 0; static const int column_number_uuid = 1; static const int column_number_uuid_name = 2; -static gboolean +static tap_packet_status btatt_handle_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { tapinfo_t *tapinfo = (tapinfo_t *) tapinfo_ptr; @@ -40,7 +40,7 @@ btatt_handle_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *e if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -225,7 +225,7 @@ void BluetoothAttServerAttributesDialog::tapReset(void *tapinfo_ptr) } -gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { tapinfo_t *tapinfo = static_cast<tapinfo_t *>(tapinfo_ptr); BluetoothAttServerAttributesDialog *dialog = static_cast<BluetoothAttServerAttributesDialog *>(tapinfo->ui); @@ -236,10 +236,10 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet gchar *addr = NULL; if (dialog->file_closed_) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->rec_type != REC_TYPE_PACKET) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) { gchar *interface; @@ -253,7 +253,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) { if (dialog->ui->interfaceComboBox->currentText() != interface) - return TRUE; + return TAP_PACKET_REDRAW; } } @@ -266,7 +266,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet if (addr && dialog->ui->deviceComboBox->currentIndex() > 0) { if (dialog->ui->deviceComboBox->currentText() != addr) - return TRUE; + return TAP_PACKET_REDRAW; } handle.sprintf("0x%04x", tap_handles->handle); @@ -282,7 +282,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet if (item->text(column_number_handle) == handle && item->text(column_number_uuid) == uuid && item->text(column_number_uuid_name) == uuid_name) - return TRUE; + return TAP_PACKET_REDRAW; ++i_item; } } @@ -297,7 +297,7 @@ gboolean BluetoothAttServerAttributesDialog::tapPacket(void *tapinfo_ptr, packet dialog->ui->tableTreeWidget->resizeColumnToContents(i); } - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothAttServerAttributesDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_att_server_attributes_dialog.h b/ui/qt/bluetooth_att_server_attributes_dialog.h index 5566b3676e..e8b35f7dbb 100644 --- a/ui/qt/bluetooth_att_server_attributes_dialog.h +++ b/ui/qt/bluetooth_att_server_attributes_dialog.h @@ -64,7 +64,7 @@ private: QMenu context_menu_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: void captureFileClosing(); diff --git a/ui/qt/bluetooth_device_dialog.cpp b/ui/qt/bluetooth_device_dialog.cpp index ff13eb646d..09d8c1a006 100644 --- a/ui/qt/bluetooth_device_dialog.cpp +++ b/ui/qt/bluetooth_device_dialog.cpp @@ -56,7 +56,7 @@ static const int row_number_page_timeout = 19; static const int row_number_simple_pairing_mode = 20; static const int row_number_voice_setting = 21; -static gboolean +static tap_packet_status bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { bluetooth_device_tapinfo_t *tapinfo = (bluetooth_device_tapinfo_t *) tapinfo_ptr; @@ -64,7 +64,7 @@ bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_ if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -359,7 +359,7 @@ void BluetoothDeviceDialog::saveItemData(QTableWidgetItem *item, } -gboolean BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { bluetooth_device_tapinfo_t *tapinfo = static_cast<bluetooth_device_tapinfo_t *>(tapinfo_ptr); BluetoothDeviceDialog *dialog = static_cast<BluetoothDeviceDialog *>(tapinfo->ui); @@ -375,14 +375,14 @@ gboolean BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, tableWidget = dialog->ui->tableWidget; if (!((!tap_device->is_local && tap_device->has_bd_addr) || (tap_device->is_local && tapinfo->is_local && tap_device->interface_id == tapinfo->interface_id && tap_device->adapter_id == tapinfo->adapter_id))) { - return TRUE; + return TAP_PACKET_REDRAW; } if (!tap_device->is_local && tap_device->has_bd_addr) { bd_addr.sprintf("%02x:%02x:%02x:%02x:%02x:%02x", tap_device->bd_addr[0], tap_device->bd_addr[1], tap_device->bd_addr[2], tap_device->bd_addr[3], tap_device->bd_addr[4], tap_device->bd_addr[5]); if (bd_addr != tapinfo->bdAddr) - return TRUE; + return TAP_PACKET_REDRAW; } if (tap_device->has_bd_addr) { @@ -616,7 +616,7 @@ gboolean BluetoothDeviceDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, dialog->ui->hintLabel->setText(QString(tr("%1 changes")).arg(*tapinfo->changes)); - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothDeviceDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_device_dialog.h b/ui/qt/bluetooth_device_dialog.h index b63acc1ac3..d5860a33f7 100644 --- a/ui/qt/bluetooth_device_dialog.h +++ b/ui/qt/bluetooth_device_dialog.h @@ -79,7 +79,7 @@ private: guint changes_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); static void updateChanges(QTableWidget *tableWidget, QString value, const int row, guint *changes, packet_info *pinfo); static void saveItemData(QTableWidgetItem *item, bluetooth_device_tap_t *tap_device, packet_info *pinfo); diff --git a/ui/qt/bluetooth_devices_dialog.cpp b/ui/qt/bluetooth_devices_dialog.cpp index 242edd424c..ec6043bcbf 100644 --- a/ui/qt/bluetooth_devices_dialog.cpp +++ b/ui/qt/bluetooth_devices_dialog.cpp @@ -43,7 +43,7 @@ static const int column_number_hci_revision = 7; static const int column_number_is_local_adapter = 8; -static gboolean +static tap_packet_status bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { bluetooth_devices_tapinfo_t *tapinfo = (bluetooth_devices_tapinfo_t *) tapinfo_ptr; @@ -51,7 +51,7 @@ bluetooth_device_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_ if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -253,7 +253,7 @@ void BluetoothDevicesDialog::tapReset(void *tapinfo_ptr) bluetooth_devices_dialog->ui->tableTreeWidget->clear(); } -gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { bluetooth_devices_tapinfo_t *tapinfo = static_cast<bluetooth_devices_tapinfo_t *>(tapinfo_ptr); BluetoothDevicesDialog *dialog = static_cast<BluetoothDevicesDialog *>(tapinfo->ui); @@ -264,10 +264,10 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo QTreeWidgetItem *item = NULL; if (dialog->file_closed_) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->rec_type != REC_TYPE_PACKET) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) { gchar *interface; @@ -281,7 +281,7 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) { if (dialog->ui->interfaceComboBox->currentText() != interface) - return TRUE; + return TAP_PACKET_REDRAW; } } @@ -370,7 +370,7 @@ gboolean BluetoothDevicesDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo dialog->ui->hintLabel->setText(QString(tr("%1 items; Right click for more option; Double click for device details")).arg(dialog->ui->tableTreeWidget->topLevelItemCount())); - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothDevicesDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_devices_dialog.h b/ui/qt/bluetooth_devices_dialog.h index 94d14043a1..4d07e1ec2f 100644 --- a/ui/qt/bluetooth_devices_dialog.h +++ b/ui/qt/bluetooth_devices_dialog.h @@ -65,7 +65,7 @@ private: QMenu context_menu_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: void captureFileClosing(); diff --git a/ui/qt/bluetooth_hci_summary_dialog.cpp b/ui/qt/bluetooth_hci_summary_dialog.cpp index 19b82f0542..044a6beb7d 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.cpp +++ b/ui/qt/bluetooth_hci_summary_dialog.cpp @@ -44,7 +44,7 @@ static const int column_number_reason = 7; static const int column_number_hardware_error = 8; static const int column_number_occurrence = 9; -static gboolean +static tap_packet_status bluetooth_hci_summary_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *edt, const void* data) { bluetooth_hci_summary_tapinfo_t *tapinfo = (bluetooth_hci_summary_tapinfo_t *) tapinfo_ptr; @@ -52,7 +52,7 @@ bluetooth_hci_summary_tap_packet(void *tapinfo_ptr, packet_info *pinfo, epan_dis if (tapinfo->tap_packet) tapinfo->tap_packet(tapinfo, pinfo, edt, data); - return TRUE; + return TAP_PACKET_REDRAW; } static void @@ -332,7 +332,7 @@ void BluetoothHciSummaryDialog::tapReset(void *tapinfo_ptr) dialog->item_hardware_errors_->setText(column_number_occurrence, "0"); } -gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) +tap_packet_status BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data) { bluetooth_hci_summary_tapinfo_t *tapinfo = static_cast<bluetooth_hci_summary_tapinfo_t *>(tapinfo_ptr); BluetoothHciSummaryDialog *dialog = static_cast<BluetoothHciSummaryDialog *>(tapinfo->ui); @@ -346,10 +346,10 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi QString name; if (dialog->file_closed_) - return FALSE; + return TAP_PACKET_DONT_REDRAW; if (pinfo->rec->rec_type != REC_TYPE_PACKET) - return FALSE; + return TAP_PACKET_DONT_REDRAW; name = tr("Unknown"); @@ -365,7 +365,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi if (interface && dialog->ui->interfaceComboBox->currentIndex() > 0) { if (dialog->ui->interfaceComboBox->currentText() != interface) - return TRUE; + return TAP_PACKET_REDRAW; } } @@ -377,7 +377,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi if (dialog->ui->adapterComboBox->currentIndex() > 0) { if (dialog->ui->adapterComboBox->currentText() != adapter) - return TRUE; + return TAP_PACKET_REDRAW; } switch (tap_hci->type) { @@ -768,7 +768,7 @@ gboolean BluetoothHciSummaryDialog::tapPacket(void *tapinfo_ptr, packet_info *pi dialog->ui->tableTreeWidget->resizeColumnToContents(i); } - return TRUE; + return TAP_PACKET_REDRAW; } void BluetoothHciSummaryDialog::interfaceCurrentIndexChanged(int) diff --git a/ui/qt/bluetooth_hci_summary_dialog.h b/ui/qt/bluetooth_hci_summary_dialog.h index 1d3c299a18..0595031ffa 100644 --- a/ui/qt/bluetooth_hci_summary_dialog.h +++ b/ui/qt/bluetooth_hci_summary_dialog.h @@ -79,7 +79,7 @@ private: QTreeWidgetItem *item_hardware_errors_; static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); private slots: void captureFileClosing(); diff --git a/ui/qt/gsm_map_summary_dialog.cpp b/ui/qt/gsm_map_summary_dialog.cpp index 0d37d75980..49aa13259a 100644 --- a/ui/qt/gsm_map_summary_dialog.cpp +++ b/ui/qt/gsm_map_summary_dialog.cpp @@ -337,7 +337,7 @@ gsm_map_summary_reset(void *tapdata) } -static gboolean +static tap_packet_status gsm_map_summary_packet(void *tapdata, packet_info *, epan_dissect_t *, const void *gmtr_ptr) { gsm_map_stat_t *gm_stat = (gsm_map_stat_t *)tapdata; @@ -354,7 +354,7 @@ gsm_map_summary_packet(void *tapdata, packet_info *, epan_dissect_t *, const voi gm_stat->size_rr[gm_tap_rec->opcode] += gm_tap_rec->size; } - return(FALSE); /* We have no draw callback */ + return(TAP_PACKET_DONT_REDRAW); /* We have no draw callback */ } void diff --git a/ui/qt/iax2_analysis_dialog.cpp b/ui/qt/iax2_analysis_dialog.cpp index 4e45127864..e1cf0117b8 100644 --- a/ui/qt/iax2_analysis_dialog.cpp +++ b/ui/qt/iax2_analysis_dialog.cpp @@ -613,21 +613,21 @@ void Iax2AnalysisDialog::tapReset(void *tapinfoptr) iax2_analysis_dialog->resetStatistics(); } -gboolean Iax2AnalysisDialog::tapPacket(void *tapinfoptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr) +tap_packet_status Iax2AnalysisDialog::tapPacket(void *tapinfoptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr) { Iax2AnalysisDialog *iax2_analysis_dialog = dynamic_cast<Iax2AnalysisDialog *>((Iax2AnalysisDialog*)tapinfoptr); - if (!iax2_analysis_dialog) return FALSE; + if (!iax2_analysis_dialog) return TAP_PACKET_DONT_REDRAW; const iax2_info_t *iax2info = (const iax2_info_t *)iax2info_ptr; - if (!iax2info) return FALSE; + if (!iax2info) return TAP_PACKET_DONT_REDRAW; /* we ignore packets that are not displayed */ if (pinfo->fd->passed_dfilter == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* we ignore packets that carry no data */ if (iax2info->payload_len < 1) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* is it the forward direction? */ else if ((cmp_address(&(iax2_analysis_dialog->fwd_id_.src_addr), &(pinfo->src)) == 0) @@ -645,7 +645,7 @@ gboolean Iax2AnalysisDialog::tapPacket(void *tapinfoptr, packet_info *pinfo, str iax2_analysis_dialog->addPacket(false, pinfo, iax2info); } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void Iax2AnalysisDialog::tapDraw(void *tapinfoptr) diff --git a/ui/qt/iax2_analysis_dialog.h b/ui/qt/iax2_analysis_dialog.h index 81f55875f9..e03a524e3d 100644 --- a/ui/qt/iax2_analysis_dialog.h +++ b/ui/qt/iax2_analysis_dialog.h @@ -108,7 +108,7 @@ private: // Tap callbacks static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, struct epan_dissect *, const void *iax2info_ptr); static void tapDraw(void *tapinfo_ptr); void resetStatistics(); diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp index 8edcd3ccfe..7f2f5e0cb1 100644 --- a/ui/qt/io_graph_dialog.cpp +++ b/ui/qt/io_graph_dialog.cpp @@ -2055,11 +2055,11 @@ void IOGraph::tapReset(void *iog_ptr) } // "tap_packet" callback for register_tap_listener -gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *) +tap_packet_status IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *) { IOGraph *iog = static_cast<IOGraph *>(iog_ptr); if (!pinfo || !iog) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } int idx = get_io_graph_index(pinfo, iog->interval_); @@ -2068,7 +2068,7 @@ gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *e /* some sanity checks */ if ((idx < 0) || (idx >= max_io_items_)) { iog->cur_idx_ = max_io_items_ - 1; - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* update num_items */ @@ -2092,7 +2092,7 @@ gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *e } if (!update_io_graph_item(iog->items_, idx, pinfo, adv_edt, iog->hf_index_, iog->val_units_, iog->interval_)) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } // qDebug() << "=tapPacket" << iog->name_ << idx << iog->hf_index_ << iog->val_units_ << iog->num_items_; @@ -2100,7 +2100,7 @@ gboolean IOGraph::tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *e if (recalc) { emit iog->requestRecalc(); } - return TRUE; + return TAP_PACKET_REDRAW; } // "tap_draw" callback for register_tap_listener diff --git a/ui/qt/io_graph_dialog.h b/ui/qt/io_graph_dialog.h index 036d84dd8f..184d3a97a3 100644 --- a/ui/qt/io_graph_dialog.h +++ b/ui/qt/io_graph_dialog.h @@ -92,7 +92,7 @@ signals: private: // Callbacks for register_tap_listener static void tapReset(void *iog_ptr); - static gboolean tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *data); + static tap_packet_status tapPacket(void *iog_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *data); static void tapDraw(void *iog_ptr); void calculateScaledValueUnit(); diff --git a/ui/qt/lbm_lbtrm_transport_dialog.cpp b/ui/qt/lbm_lbtrm_transport_dialog.cpp index 24657869a0..dc593d8bd3 100644 --- a/ui/qt/lbm_lbtrm_transport_dialog.cpp +++ b/ui/qt/lbm_lbtrm_transport_dialog.cpp @@ -1323,7 +1323,7 @@ void LBMLBTRMTransportDialog::resetTap(void * tap_data) info->clearMaps(); } -gboolean LBMLBTRMTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) +tap_packet_status LBMLBTRMTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) { if (pinfo->fd->passed_dfilter == 1) { @@ -1332,7 +1332,7 @@ gboolean LBMLBTRMTransportDialog::tapPacket(void * tap_data, packet_info * pinfo info->processPacket(pinfo, tapinfo); } - return (TRUE); + return (TAP_PACKET_REDRAW); } void LBMLBTRMTransportDialog::drawTreeItems(void *) diff --git a/ui/qt/lbm_lbtrm_transport_dialog.h b/ui/qt/lbm_lbtrm_transport_dialog.h index 0c208b274f..b19f800bf7 100644 --- a/ui/qt/lbm_lbtrm_transport_dialog.h +++ b/ui/qt/lbm_lbtrm_transport_dialog.h @@ -18,6 +18,7 @@ #include "cfile.h" #include <epan/packet_info.h> +#include <epan/tap.h> #include <QDialog> class QHeaderView; @@ -65,7 +66,7 @@ class LBMLBTRMTransportDialog : public QDialog void resetReceiversDetail(void); void fillTree(void); static void resetTap(void * tap_data); - static gboolean tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); + static tap_packet_status tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); static void drawTreeItems(void * tap_data); void loadSourceDataDetails(LBMLBTRMSourceTransportEntry * transport); void loadSourceRXDataDetails(LBMLBTRMSourceTransportEntry * transport); diff --git a/ui/qt/lbm_lbtru_transport_dialog.cpp b/ui/qt/lbm_lbtru_transport_dialog.cpp index 2052318134..920287b622 100644 --- a/ui/qt/lbm_lbtru_transport_dialog.cpp +++ b/ui/qt/lbm_lbtru_transport_dialog.cpp @@ -1742,7 +1742,7 @@ void LBMLBTRUTransportDialog::resetTap(void * tap_data) info->clearMaps(); } -gboolean LBMLBTRUTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) +tap_packet_status LBMLBTRUTransportDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * tap_info) { if (pinfo->fd->passed_dfilter == 1) { @@ -1751,7 +1751,7 @@ gboolean LBMLBTRUTransportDialog::tapPacket(void * tap_data, packet_info * pinfo info->processPacket(pinfo, tapinfo); } - return (TRUE); + return (TAP_PACKET_REDRAW); } void LBMLBTRUTransportDialog::drawTreeItems(void *) diff --git a/ui/qt/lbm_lbtru_transport_dialog.h b/ui/qt/lbm_lbtru_transport_dialog.h index 84bdd467bb..cb57c70fed 100644 --- a/ui/qt/lbm_lbtru_transport_dialog.h +++ b/ui/qt/lbm_lbtru_transport_dialog.h @@ -18,6 +18,7 @@ #include "cfile.h" #include <epan/packet_info.h> +#include <epan/tap.h> #include <QDialog> class QHeaderView; @@ -67,7 +68,7 @@ class LBMLBTRUTransportDialog : public QDialog void resetReceiversDetail(void); void fillTree(void); static void resetTap(void * tap_data); - static gboolean tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); + static tap_packet_status tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); static void drawTreeItems(void * tap_data); void loadSourceDataDetails(LBMLBTRUSourceTransportEntry * transport); void loadSourceRXDataDetails(LBMLBTRUSourceTransportEntry * transport); diff --git a/ui/qt/lbm_stream_dialog.cpp b/ui/qt/lbm_stream_dialog.cpp index 732c59d393..c93d1958e2 100644 --- a/ui/qt/lbm_stream_dialog.cpp +++ b/ui/qt/lbm_stream_dialog.cpp @@ -399,7 +399,7 @@ void LBMStreamDialog::resetTap(void * tap_data) dialog->m_ui->lbm_stream_TreeWidget->clear(); } -gboolean LBMStreamDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * stream_info) +tap_packet_status LBMStreamDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t *, const void * stream_info) { if (pinfo->fd->passed_dfilter == 1) { @@ -408,7 +408,7 @@ gboolean LBMStreamDialog::tapPacket(void * tap_data, packet_info * pinfo, epan_d info->processPacket(pinfo, tapinfo); } - return (TRUE); + return (TAP_PACKET_REDRAW); } void LBMStreamDialog::drawTreeItems(void *) diff --git a/ui/qt/lbm_stream_dialog.h b/ui/qt/lbm_stream_dialog.h index 8e1eb595b6..1ba87c75b1 100644 --- a/ui/qt/lbm_stream_dialog.h +++ b/ui/qt/lbm_stream_dialog.h @@ -18,6 +18,7 @@ #include "cfile.h" #include <epan/packet_info.h> +#include <epan/tap.h> #include <QDialog> namespace Ui @@ -49,7 +50,7 @@ class LBMStreamDialog : public QDialog void fillTree(void); static void resetTap(void * tap_data); - static gboolean tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); + static tap_packet_status tapPacket(void * tap_data, packet_info * pinfo, epan_dissect_t * edt, const void * stream_info); static void drawTreeItems(void * tap_data); private slots: diff --git a/ui/qt/lte_mac_statistics_dialog.cpp b/ui/qt/lte_mac_statistics_dialog.cpp index 012f65f1fb..b356364d28 100644 --- a/ui/qt/lte_mac_statistics_dialog.cpp +++ b/ui/qt/lte_mac_statistics_dialog.cpp @@ -712,14 +712,14 @@ void LteMacStatisticsDialog::tapReset(void *ws_dlg_ptr) //--------------------------------------------------------------------------------------- // Process tap info from a new packet. -// Returns TRUE if a redraw is needed. -gboolean LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *mac_lte_tap_info_ptr) +// Returns TAP_PACKET_REDRAW if a redraw is needed, TAP_PACKET_DONT_REDRAW otherwise. +tap_packet_status LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *mac_lte_tap_info_ptr) { // Look up dialog and tap info. LteMacStatisticsDialog *ws_dlg = static_cast<LteMacStatisticsDialog *>(ws_dlg_ptr); const mac_lte_tap_info *mlt_info = (const mac_lte_tap_info *) mac_lte_tap_info_ptr; if (!ws_dlg || !mlt_info) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } // Update common stats. @@ -727,7 +727,7 @@ gboolean LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info // Nothing more to do if tap entry isn't for a UE. if ((mlt_info->rntiType != C_RNTI) && (mlt_info->rntiType != SPS_RNTI)) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } // Look for an existing UE to match this tap info. @@ -757,7 +757,7 @@ gboolean LteMacStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info // Update the UE item with info from tap! mac_ue_ti->update(mlt_info); - return TRUE; + return TAP_PACKET_REDRAW; } // Return total number of frames tapped. diff --git a/ui/qt/lte_mac_statistics_dialog.h b/ui/qt/lte_mac_statistics_dialog.h index 8ba8ec15cc..79f79306e4 100644 --- a/ui/qt/lte_mac_statistics_dialog.h +++ b/ui/qt/lte_mac_statistics_dialog.h @@ -52,7 +52,7 @@ private: // Callbacks for register_tap_listener static void tapReset(void *ws_dlg_ptr); - static gboolean tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *mac_lte_tap_info_ptr); + static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *mac_lte_tap_info_ptr); static void tapDraw(void *ws_dlg_ptr); virtual const QString filterExpression(); diff --git a/ui/qt/lte_rlc_statistics_dialog.cpp b/ui/qt/lte_rlc_statistics_dialog.cpp index 36ce1b127f..e87d703df3 100644 --- a/ui/qt/lte_rlc_statistics_dialog.cpp +++ b/ui/qt/lte_rlc_statistics_dialog.cpp @@ -771,14 +771,14 @@ void LteRlcStatisticsDialog::tapReset(void *ws_dlg_ptr) } // Process the tap info from a dissected RLC PDU. -// Returns TRUE if a redraw is needed. -gboolean LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *rlc_lte_tap_info_ptr) +// Returns TAP_PACKET_REDRAW if a redraw is needed, TAP_PACKET_DONT_REDRAW otherwise. +tap_packet_status LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info *, epan_dissect *, const void *rlc_lte_tap_info_ptr) { // Look up dialog. LteRlcStatisticsDialog *ws_dlg = static_cast<LteRlcStatisticsDialog *>(ws_dlg_ptr); const rlc_lte_tap_info *rlt_info = (const rlc_lte_tap_info *) rlc_lte_tap_info_ptr; if (!ws_dlg || !rlt_info) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } ws_dlg->incFrameCount(); @@ -807,7 +807,7 @@ gboolean LteRlcStatisticsDialog::tapPacket(void *ws_dlg_ptr, struct _packet_info // Update the UE from the information in the tap structure. ue_ti->update(rlt_info); - return TRUE; + return TAP_PACKET_REDRAW; } void LteRlcStatisticsDialog::tapDraw(void *ws_dlg_ptr) diff --git a/ui/qt/lte_rlc_statistics_dialog.h b/ui/qt/lte_rlc_statistics_dialog.h index 659350d808..aedaa22bd8 100644 --- a/ui/qt/lte_rlc_statistics_dialog.h +++ b/ui/qt/lte_rlc_statistics_dialog.h @@ -47,7 +47,7 @@ private: // Callbacks for register_tap_listener static void tapReset(void *ws_dlg_ptr); - static gboolean tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *rlc_lte_tap_info_ptr); + static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *rlc_lte_tap_info_ptr); static void tapDraw(void *ws_dlg_ptr); void updateHeaderLabels(); diff --git a/ui/qt/models/expert_info_model.cpp b/ui/qt/models/expert_info_model.cpp index 6f16fec56d..7cb5848cc1 100644 --- a/ui/qt/models/expert_info_model.cpp +++ b/ui/qt/models/expert_info_model.cpp @@ -375,23 +375,23 @@ void ExpertInfoModel::tapReset(void *eid_ptr) model->clear(); } -gboolean ExpertInfoModel::tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data) +tap_packet_status ExpertInfoModel::tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data) { ExpertInfoModel *model = static_cast<ExpertInfoModel*>(eid_ptr); expert_info_t *expert_info = (expert_info_t *) data; - gboolean draw_required = FALSE; + tap_packet_status status = TAP_PACKET_DONT_REDRAW; if (!pinfo || !model || !expert_info) - return FALSE; + return TAP_PACKET_DONT_REDRAW; model->addExpertInfo(*expert_info); if (model->numEvents((enum ExpertSeverity)expert_info->severity) < 1) - draw_required = TRUE; + status = TAP_PACKET_REDRAW; model->eventCounts_[(enum ExpertSeverity)expert_info->severity]++; - return draw_required; + return status; } void ExpertInfoModel::tapDraw(void *eid_ptr) diff --git a/ui/qt/models/expert_info_model.h b/ui/qt/models/expert_info_model.h index 50c9c61dae..ce22fb8d74 100644 --- a/ui/qt/models/expert_info_model.h +++ b/ui/qt/models/expert_info_model.h @@ -20,6 +20,7 @@ #include <ui/qt/capture_file.h> #include <epan/expert.h> +#include <epan/tap.h> #include <epan/column-utils.h> class ExpertPacketItem @@ -112,7 +113,7 @@ public: // Callbacks for register_tap_listener static void tapReset(void *eid_ptr); - static gboolean tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data); + static tap_packet_status tapPacket(void *eid_ptr, struct _packet_info *pinfo, struct epan_dissect *, const void *data); static void tapDraw(void *eid_ptr); private: diff --git a/ui/qt/mtp3_summary_dialog.cpp b/ui/qt/mtp3_summary_dialog.cpp index 199fd99433..5c5f6ee270 100644 --- a/ui/qt/mtp3_summary_dialog.cpp +++ b/ui/qt/mtp3_summary_dialog.cpp @@ -298,7 +298,7 @@ mtp3_summary_reset( } -static gboolean +static tap_packet_status mtp3_summary_packet( void *tapdata, packet_info *, @@ -314,8 +314,9 @@ mtp3_summary_packet( /* * we thought this si_code was not used ? * is MTP3_NUM_SI_CODE out of date ? + * XXX - if this is an error, report it and return TAP_PACKET_FAILED. */ - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } /* @@ -341,8 +342,9 @@ mtp3_summary_packet( { /* * too many + * XXX - report an error and return TAP_PACKET_FAILED? */ - return(FALSE); + return(TAP_PACKET_DONT_REDRAW); } mtp3_num_used++; @@ -353,7 +355,7 @@ mtp3_summary_packet( (*stat_p)[i].mtp3_si_code[data_p->mtp3_si_code].num_msus++; (*stat_p)[i].mtp3_si_code[data_p->mtp3_si_code].size += data_p->size; - return(TRUE); + return(TAP_PACKET_REDRAW); } void diff --git a/ui/qt/rtp_analysis_dialog.cpp b/ui/qt/rtp_analysis_dialog.cpp index 46046cf787..51b6547bfe 100644 --- a/ui/qt/rtp_analysis_dialog.cpp +++ b/ui/qt/rtp_analysis_dialog.cpp @@ -656,20 +656,20 @@ void RtpAnalysisDialog::tapReset(void *tapinfo_ptr) rtp_analysis_dialog->resetStatistics(); } -gboolean RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) +tap_packet_status RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) { RtpAnalysisDialog *rtp_analysis_dialog = dynamic_cast<RtpAnalysisDialog *>((RtpAnalysisDialog*)tapinfo_ptr); - if (!rtp_analysis_dialog) return FALSE; + if (!rtp_analysis_dialog) return TAP_PACKET_DONT_REDRAW; const struct _rtp_info *rtpinfo = (const struct _rtp_info *)rtpinfo_ptr; - if (!rtpinfo) return FALSE; + if (!rtpinfo) return TAP_PACKET_DONT_REDRAW; /* we ignore packets that are not displayed */ if (pinfo->fd->passed_dfilter == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* also ignore RTP Version != 2 */ else if (rtpinfo->info_version != 2) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* is it the forward direction? */ else if (rtpstream_id_equal_pinfo_rtp_info(&(rtp_analysis_dialog->fwd_statinfo_.id),pinfo,rtpinfo)) { @@ -680,7 +680,7 @@ gboolean RtpAnalysisDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epa rtp_analysis_dialog->addPacket(false, pinfo, rtpinfo); } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void RtpAnalysisDialog::tapDraw(void *tapinfo_ptr) diff --git a/ui/qt/rtp_analysis_dialog.h b/ui/qt/rtp_analysis_dialog.h index 652058f1ac..2e1971c430 100644 --- a/ui/qt/rtp_analysis_dialog.h +++ b/ui/qt/rtp_analysis_dialog.h @@ -115,7 +115,7 @@ private: // Tap callbacks static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); static void tapDraw(void *tapinfo_ptr); void resetStatistics(); diff --git a/ui/qt/rtp_player_dialog.cpp b/ui/qt/rtp_player_dialog.cpp index d6d2c1f6e1..52fe9d93aa 100644 --- a/ui/qt/rtp_player_dialog.cpp +++ b/ui/qt/rtp_player_dialog.cpp @@ -557,24 +557,24 @@ void RtpPlayerDialog::setPlayPosition(double secs) } } -gboolean RtpPlayerDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) +tap_packet_status RtpPlayerDialog::tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr) { RtpPlayerDialog *rtp_player_dialog = dynamic_cast<RtpPlayerDialog *>((RtpPlayerDialog*)tapinfo_ptr); - if (!rtp_player_dialog) return FALSE; + if (!rtp_player_dialog) return TAP_PACKET_DONT_REDRAW; const struct _rtp_info *rtpinfo = (const struct _rtp_info *)rtpinfo_ptr; - if (!rtpinfo) return FALSE; + if (!rtpinfo) return TAP_PACKET_DONT_REDRAW; /* we ignore packets that are not displayed */ if (pinfo->fd->passed_dfilter == 0) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* also ignore RTP Version != 2 */ else if (rtpinfo->info_version != 2) - return FALSE; + return TAP_PACKET_DONT_REDRAW; rtp_player_dialog->addPacket(pinfo, rtpinfo); - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void RtpPlayerDialog::addPacket(packet_info *pinfo, const _rtp_info *rtpinfo) diff --git a/ui/qt/rtp_player_dialog.h b/ui/qt/rtp_player_dialog.h index d9e2581059..c1bc38c6be 100644 --- a/ui/qt/rtp_player_dialog.h +++ b/ui/qt/rtp_player_dialog.h @@ -118,7 +118,7 @@ private: // Tap callbacks // static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *rtpinfo_ptr); static void tapDraw(void *tapinfo_ptr); void addPacket(packet_info *pinfo, const struct _rtp_info *rtpinfo); diff --git a/ui/qt/voip_calls_dialog.cpp b/ui/qt/voip_calls_dialog.cpp index a39a900613..c72200949b 100644 --- a/ui/qt/voip_calls_dialog.cpp +++ b/ui/qt/voip_calls_dialog.cpp @@ -157,14 +157,14 @@ void VoipCallsDialog::changeEvent(QEvent *event) // voip_calls_tapinfo_t *tapinfo = (voip_calls_tapinfo_t *) tapinfo_ptr; //} -gboolean VoipCallsDialog::tapPacket(void *, packet_info *, epan_dissect_t *, const void *) +tap_packet_status VoipCallsDialog::tapPacket(void *, packet_info *, epan_dissect_t *, const void *) { #ifdef QT_MULTIMEDIA_LIB // voip_calls_tapinfo_t *tapinfo = (voip_calls_tapinfo_t *) tapinfo_ptr; // add_rtp_packet for voip player. -// return TRUE; +// return TAP_PACKET_REDRAW; #endif - return FALSE; + return TAP_PACKET_DONT_REDRAW; } void VoipCallsDialog::tapDraw(void *tapinfo_ptr) diff --git a/ui/qt/voip_calls_dialog.h b/ui/qt/voip_calls_dialog.h index 658be731d8..ef29cf829a 100644 --- a/ui/qt/voip_calls_dialog.h +++ b/ui/qt/voip_calls_dialog.h @@ -69,7 +69,7 @@ private: // Tap callbacks // static void tapReset(void *tapinfo_ptr); - static gboolean tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); + static tap_packet_status tapPacket(void *tapinfo_ptr, packet_info *pinfo, epan_dissect_t *, const void *data); static void tapDraw(void *tapinfo_ptr); void updateCalls(); diff --git a/ui/qt/wireless_timeline.cpp b/ui/qt/wireless_timeline.cpp index baac452847..c222bb14e3 100644 --- a/ui/qt/wireless_timeline.cpp +++ b/ui/qt/wireless_timeline.cpp @@ -349,14 +349,14 @@ void WirelessTimeline::tap_timeline_reset(void* tapdata) timeline->radio_packet_list = g_hash_table_new(g_direct_hash, g_direct_equal); } -gboolean WirelessTimeline::tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt _U_, const void *data) +tap_packet_status WirelessTimeline::tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt _U_, const void *data) { WirelessTimeline* timeline = (WirelessTimeline*)tapdata; const struct wlan_radio *wlan_radio_info = (const struct wlan_radio *)data; /* Save the radio information in our own (GUI) hashtable */ g_hash_table_insert(timeline->radio_packet_list, GUINT_TO_POINTER(pinfo->num), (gpointer)wlan_radio_info); - return FALSE; + return TAP_PACKET_DONT_REDRAW; } struct wlan_radio* WirelessTimeline::get_wlan_radio(guint32 packet_num) diff --git a/ui/qt/wireless_timeline.h b/ui/qt/wireless_timeline.h index 2c2d83913a..9a2972f067 100644 --- a/ui/qt/wireless_timeline.h +++ b/ui/qt/wireless_timeline.h @@ -28,6 +28,7 @@ #include <epan/prefs.h> #include <epan/plugin_if.h> +#include <epan/tap.h> #include <epan/timestamp.h> #include <epan/dissectors/packet-ieee80211-radio.h> @@ -71,7 +72,7 @@ public slots: protected: static void tap_timeline_reset(void* tapdata); - static gboolean tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt, const void *data); + static tap_packet_status tap_timeline_packet(void *tapdata, packet_info* pinfo, epan_dissect_t* edt, const void *data); struct wlan_radio* get_wlan_radio(guint32 packet_num); diff --git a/ui/qt/wireshark_dialog.cpp b/ui/qt/wireshark_dialog.cpp index 2c7498a56e..d9535b7524 100644 --- a/ui/qt/wireshark_dialog.cpp +++ b/ui/qt/wireshark_dialog.cpp @@ -100,7 +100,7 @@ void WiresharkDialog::updateWidgets() setWindowTitleFromSubtitle(); } -bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void(*tap_reset)(void *), gboolean(*tap_packet)(void *, struct _packet_info *, struct epan_dissect *, const void *), void(*tap_draw)(void *)) +bool WiresharkDialog::registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void (*tap_reset)(void *), tap_packet_status (*tap_packet)(void *, struct _packet_info *, struct epan_dissect *, const void *), void (*tap_draw)(void *)) { GString *error_string = register_tap_listener(tap_name, tap_data, filter, flags, tap_reset, tap_packet, tap_draw, NULL); diff --git a/ui/qt/wireshark_dialog.h b/ui/qt/wireshark_dialog.h index 57ec1eacb6..a91e6c5659 100644 --- a/ui/qt/wireshark_dialog.h +++ b/ui/qt/wireshark_dialog.h @@ -26,6 +26,8 @@ // BaseCaptureDialog, CaptureHelperDialog (or rename CaptureFileDialog to something else - WiresharkFileDialog). // TapDialog might make sense as well. +#include <epan/tap.h> + #include "capture_file.h" #include "geometry_state_dialog.h" @@ -93,7 +95,7 @@ protected: bool registerTapListener(const char *tap_name, void *tap_data, const char *filter, guint flags, void (*tap_reset)(void *tapdata), - gboolean (*tap_packet)(void *tapdata, struct _packet_info *pinfo, struct epan_dissect *edt, const void *data), + tap_packet_status (*tap_packet)(void *tapdata, struct _packet_info *pinfo, struct epan_dissect *edt, const void *data), void (*tap_draw)(void *tap_data)); /** diff --git a/ui/qt/wlan_statistics_dialog.cpp b/ui/qt/wlan_statistics_dialog.cpp index d6ecd64614..4e84a401f7 100644 --- a/ui/qt/wlan_statistics_dialog.cpp +++ b/ui/qt/wlan_statistics_dialog.cpp @@ -558,17 +558,17 @@ void WlanStatisticsDialog::tapReset(void *ws_dlg_ptr) ws_dlg->packet_count_ = 0; } -gboolean WlanStatisticsDialog::tapPacket(void *ws_dlg_ptr, _packet_info *, epan_dissect *, const void *wlan_hdr_ptr) +tap_packet_status WlanStatisticsDialog::tapPacket(void *ws_dlg_ptr, _packet_info *, epan_dissect *, const void *wlan_hdr_ptr) { WlanStatisticsDialog *ws_dlg = static_cast<WlanStatisticsDialog *>(ws_dlg_ptr); const wlan_hdr_t *wlan_hdr = (const wlan_hdr_t *)wlan_hdr_ptr; - if (!ws_dlg || !wlan_hdr) return FALSE; + if (!ws_dlg || !wlan_hdr) return TAP_PACKET_DONT_REDRAW; guint16 frame_type = wlan_hdr->type & 0xff0; if (!((frame_type == 0x0) || (frame_type == 0x20) || (frame_type == 0x30)) || ((frame_type == 0x20) && DATA_FRAME_IS_NULL(wlan_hdr->type))) { /* Not a management or non null data or extension frame; let's skip it */ - return FALSE; + return TAP_PACKET_DONT_REDRAW; } ws_dlg->packet_count_++; @@ -595,7 +595,7 @@ gboolean WlanStatisticsDialog::tapPacket(void *ws_dlg_ptr, _packet_info *, epan_ } wn_ti->update(wlan_hdr); - return TRUE; + return TAP_PACKET_REDRAW; } void WlanStatisticsDialog::tapDraw(void *ws_dlg_ptr) diff --git a/ui/qt/wlan_statistics_dialog.h b/ui/qt/wlan_statistics_dialog.h index 1dc2507741..2bc1233e45 100644 --- a/ui/qt/wlan_statistics_dialog.h +++ b/ui/qt/wlan_statistics_dialog.h @@ -32,7 +32,7 @@ private: // Callbacks for register_tap_listener static void tapReset(void *ws_dlg_ptr); - static gboolean tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *wlan_hdr_ptr); + static tap_packet_status tapPacket(void *ws_dlg_ptr, struct _packet_info *, struct epan_dissect *, const void *wlan_hdr_ptr); static void tapDraw(void *ws_dlg_ptr); virtual const QString filterExpression(); diff --git a/ui/tap-rlc-graph.c b/ui/tap-rlc-graph.c index af1a982451..354ee9499e 100644 --- a/ui/tap-rlc-graph.c +++ b/ui/tap-rlc-graph.c @@ -50,7 +50,7 @@ gboolean compare_rlc_headers(guint16 ueid1, guint16 channelType1, guint16 channe /* This is the tap function used to identify a list of channels found in the current frame. It is only used for the single, currently selected frame. */ -static gboolean +static tap_packet_status tap_lte_rlc_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip) { int n; @@ -85,7 +85,7 @@ tap_lte_rlc_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, c th->num_hdrs++; } - return FALSE; /* i.e. no immediate redraw requested */ + return TAP_PACKET_DONT_REDRAW; /* i.e. no immediate redraw requested */ } /* Return an array of tap_info structs that were found while dissecting the current frame @@ -170,7 +170,7 @@ rlc_lte_tap_info *select_rlc_lte_session(capture_file *cf, } /* This is the tapping function to update stats when dissecting the whole packet list */ -static gboolean rlc_lte_tap_for_graph_data(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) +static tap_packet_status rlc_lte_tap_for_graph_data(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { struct rlc_graph *graph = (struct rlc_graph *)pct; const rlc_lte_tap_info *rlchdr = (const rlc_lte_tap_info*)vip; @@ -224,7 +224,7 @@ static gboolean rlc_lte_tap_for_graph_data(void *pct, packet_info *pinfo, epan_d graph->last_segment = segment; } - return FALSE; /* i.e. no immediate redraw requested */ + return TAP_PACKET_DONT_REDRAW; /* i.e. no immediate redraw requested */ } /* If don't have a channel, try to get one from current frame, then read all frames looking for data diff --git a/ui/tap-rtp-common.c b/ui/tap-rtp-common.c index d5a991fd14..d8d04f1583 100644 --- a/ui/tap-rtp-common.c +++ b/ui/tap-rtp-common.c @@ -355,7 +355,7 @@ static void rtp_write_sample(rtpdump_info_t* rtpdump_info, FILE* file) /****************************************************************************/ /* whenever a RTP packet is seen by the tap listener */ -int rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2) +tap_packet_status rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const void *arg2) { rtpstream_tapinfo_t *tapinfo = (rtpstream_tapinfo_t *)arg; const struct _rtp_info *rtpinfo = (const struct _rtp_info *)arg2; @@ -428,7 +428,7 @@ int rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, /* increment the packets counter of all streams */ ++(tapinfo->npackets); - return 1; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } else if (tapinfo->mode == TAP_SAVE) { if (rtpstream_info_cmp(&new_stream_info, tapinfo->filter_stream_fwd)==0) { @@ -448,7 +448,7 @@ int rtpstream_packet_cb(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, tapinfo->tap_mark_packet(tapinfo, pinfo->fd); } } - return 0; + return TAP_PACKET_DONT_REDRAW; } /****************************************************************************/ diff --git a/ui/tap-rtp-common.h b/ui/tap-rtp-common.h index a15cf722f1..a51264224f 100644 --- a/ui/tap-rtp-common.h +++ b/ui/tap-rtp-common.h @@ -119,7 +119,7 @@ void rtpstream_reset(rtpstream_tapinfo_t *tapinfo); void rtpstream_reset_cb(void*); void rtp_write_header(rtpstream_info_t*, FILE*); -int rtpstream_packet_cb(void*, packet_info*, epan_dissect_t *, const void *); +tap_packet_status rtpstream_packet_cb(void*, packet_info*, epan_dissect_t *, const void *); /** * Evaluate rtpstream_info_t calculations diff --git a/ui/tap-sctp-analysis.c b/ui/tap-sctp-analysis.c index 3747f4df3a..1694f29fe0 100644 --- a/ui/tap-sctp-analysis.c +++ b/ui/tap-sctp-analysis.c @@ -320,7 +320,7 @@ add_address(address *vadd, sctp_assoc_info_t *info, guint16 direction) return info; } -static gboolean +static tap_packet_status packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data) { const struct _sctp_info *sctp_info = (const struct _sctp_info *)data; @@ -1229,7 +1229,7 @@ packet(void *tapdata _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const voi tsn_free(sack); free_address(&tmp_info.src); free_address(&tmp_info.dst); - return TRUE; + return TAP_PACKET_REDRAW; } diff --git a/ui/tap-tcp-stream.c b/ui/tap-tcp-stream.c index 036f775525..f0ce7144cd 100644 --- a/ui/tap-tcp-stream.c +++ b/ui/tap-tcp-stream.c @@ -36,7 +36,7 @@ typedef struct _tcp_scan_t { } tcp_scan_t; -static gboolean +static tap_packet_status tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip) { tcp_scan_t *ts = (tcp_scan_t *)pct; @@ -96,7 +96,7 @@ tapall_tcpip_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, cons ts->last = segment; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* here we collect all the external data we will ever need */ @@ -227,7 +227,7 @@ typedef struct _th_t { struct tcpheader *tcphdrs[MAX_SUPPORTED_TCP_HEADERS]; } th_t; -static gboolean +static tap_packet_status tap_tcpip_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *vip) { int n; @@ -261,7 +261,7 @@ tap_tcpip_packet(void *pct, packet_info *pinfo _U_, epan_dissect_t *edt _U_, con th->num_hdrs++; } - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* XXX should be enhanced so that if we have multiple TCP layers in the trace diff --git a/ui/tap_export_pdu.c b/ui/tap_export_pdu.c index b5e12b2693..5d5a11986f 100644 --- a/ui/tap_export_pdu.c +++ b/ui/tap_export_pdu.c @@ -24,7 +24,7 @@ #include "tap_export_pdu.h" /* Main entry point to the tap */ -static gboolean +static tap_packet_status export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const void *data) { const exp_pdu_data_t *exp_pdu_data = (const exp_pdu_data_t *)data; @@ -62,7 +62,7 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const } /* XXX: should the rec.rec_header.packet_header.pseudo_header be set to the pinfo's pseudo-header? */ - /* XXX: report errors! */ + /* XXX: report errors and return TAP_PACKET_FAILED! */ if (!wtap_dump(exp_pdu_tap_data->wdh, &rec, packet_buf, &err, &err_info)) { switch (err) { @@ -78,7 +78,7 @@ export_pdu_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt, const g_free(packet_buf); g_free(rec.opt_comment); - return FALSE; /* Do not redraw */ + return TAP_PACKET_DONT_REDRAW; /* Do not redraw */ } int diff --git a/ui/voip_calls.c b/ui/voip_calls.c index 566a4e29eb..ae305ad101 100644 --- a/ui/voip_calls.c +++ b/ui/voip_calls.c @@ -497,7 +497,7 @@ static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo, packet_info *pinf /****************************************************************************/ /* whenever a rtp event packet is seen by the tap listener */ -static int +static tap_packet_status rtp_event_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *rtp_event_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_rtp_event_); @@ -505,14 +505,14 @@ rtp_event_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _ /* do not consider RTP events packets without a setup frame */ if (pi->info_setup_frame_num == 0) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } tapinfo->rtp_evt_frame_num = pinfo->num; tapinfo->rtp_evt = pi->info_rtp_evt; tapinfo->rtp_evt_end = pi->info_end; - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /****************************************************************************/ @@ -580,7 +580,7 @@ rtp_reset(void *tap_offset_ptr) /****************************************************************************/ /* whenever a RTP packet is seen by the tap listener */ -static gboolean +static tap_packet_status rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void const *rtp_info_ptr) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_rtp_); @@ -593,7 +593,7 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c /* do not consider RTP packets without a setup frame */ if (rtp_info->info_setup_frame_num == 0) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } if (tapinfo->tap_packet) { @@ -629,7 +629,7 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c /* if this is a duplicated RTP Event End, just return */ if ((tapinfo->rtp_evt_frame_num == pinfo->num) && !strinfo && (tapinfo->rtp_evt_end == TRUE)) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* not in the list? then create a new entry */ @@ -681,7 +681,7 @@ rtp_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, void c tapinfo->redraw |= REDRAW_RTP; - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /****************************************************************************/ @@ -876,7 +876,7 @@ remove_tap_listener_rtp(voip_calls_tapinfo_t *tap_id_base) /****************************************************************************/ /* whenever a T38 packet is seen by the tap listener */ -static gboolean +static tap_packet_status t38_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *t38_info_ptr) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_t38_); @@ -958,7 +958,7 @@ t38_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const /* at this point we should have found the call num for this t38 packets belong */ if (conv_num == -1) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /* add the item to the graph list */ @@ -1024,7 +1024,7 @@ t38_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const tapinfo->redraw |= REDRAW_T38; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -1081,7 +1081,7 @@ free_sip_info(gpointer p) { /****************************************************************************/ /* whenever a SIP packet is seen by the tap listener */ -static gboolean +static tap_packet_status sip_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt , const void *SIPinfo) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sip_); @@ -1102,7 +1102,7 @@ sip_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt , /* do not consider packets without call_id */ if (pi->tap_call_id ==NULL) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } key=pi->tap_call_id; /* init the hash table */ @@ -1252,7 +1252,7 @@ TODO: is useful but not perfect, what is appended is truncated when displayed in tapinfo->redraw |= REDRAW_SIP; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -1303,7 +1303,7 @@ remove_tap_listener_sip_calls(voip_calls_tapinfo_t *tap_id_base) /****************************************************************************/ /* whenever a isup_ packet is seen by the tap listener */ -static gboolean +static tap_packet_status isup_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *isup_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_isup_); @@ -1321,7 +1321,7 @@ isup_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, /* check if the lower layer is MTP matching the frame number */ if (tapinfo->mtp3_frame_num != pinfo->num) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* check whether we already have a call with these parameters in the list */ list = g_queue_peek_nth_link(tapinfo->callsinfos, 0); @@ -1453,7 +1453,7 @@ isup_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, tapinfo->redraw |= REDRAW_ISUP; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -1506,7 +1506,7 @@ remove_tap_listener_isup_calls(voip_calls_tapinfo_t *tap_id_base) /****************************************************************************/ /* whenever a mtp3_ packet is seen by the tap listener */ -static gboolean +static tap_packet_status mtp3_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *mtp3_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_mtp3_); @@ -1519,10 +1519,10 @@ mtp3_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt tapinfo->mtp3_ni = pi->addr_opc.ni; tapinfo->mtp3_frame_num = pinfo->num; - return FALSE; + return TAP_PACKET_DONT_REDRAW; } -static gboolean +static tap_packet_status m3ua_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *mtp3_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_m3ua_); @@ -1535,7 +1535,7 @@ m3ua_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt tapinfo->mtp3_ni = pi->addr_opc.ni; tapinfo->mtp3_frame_num = pinfo->num; - return FALSE; + return TAP_PACKET_DONT_REDRAW; } /****************************************************************************/ @@ -1595,7 +1595,7 @@ static const e_guid_t guid_allzero = {0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } }; /****************************************************************************/ /* whenever a q931_ packet is seen by the tap listener */ -static gboolean +static tap_packet_status q931_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *q931_info) { GList *list,*list2; @@ -1852,7 +1852,7 @@ q931_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, tapinfo->redraw |= REDRAW_Q931; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -1934,7 +1934,7 @@ free_h225_info(gpointer p) { } /****************************************************************************/ /* whenever a H225 packet is seen by the tap listener */ -static gboolean +static tap_packet_status h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *H225info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_h225_); @@ -1952,12 +1952,12 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, /* OR, if not guid and is H225 return because doesn't belong to a call */ if ((memcmp(&pi->guid, &guid_allzero, GUID_LEN) == 0)) if ( ((pi->msg_type == H225_RAS) && ((pi->msg_tag < 18) || (pi->msg_tag > 20))) || (pi->msg_type != H225_RAS) ) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* if it is RAS LCF or LRJ*/ if ( (pi->msg_type == H225_RAS) && ((pi->msg_tag == 19) || (pi->msg_tag == 20))) { /* if the LCF/LRJ doesn't match to a LRQ, just return */ - if (!pi->request_available) return FALSE; + if (!pi->request_available) return TAP_PACKET_DONT_REDRAW; /* check whether we already have a call with this request SeqNum */ list = g_queue_peek_nth_link(tapinfo->callsinfos, 0); @@ -2144,7 +2144,7 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, tapinfo->redraw |= REDRAW_H225; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -2243,7 +2243,7 @@ h245_add_label(voip_calls_tapinfo_t *tapinfo, guint32 new_frame_num, const gchar /****************************************************************************/ /* whenever a H245dg packet is seen by the tap listener (when H245 tunneling is ON) */ -static gboolean +static tap_packet_status h245dg_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *H245info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_h245dg_); @@ -2305,7 +2305,7 @@ h245dg_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *ed tapinfo->redraw |= REDRAW_H245DG; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -2362,7 +2362,7 @@ remove_tap_listener_h245dg_calls(voip_calls_tapinfo_t *tap_id_base) /****************************TAP for SDP PROTOCOL ***************************/ /****************************************************************************/ /* whenever a SDP packet is seen by the tap listener */ -static gboolean +static tap_packet_status sdp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *SDPinfo) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sdp_); @@ -2380,7 +2380,7 @@ sdp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _ tapinfo->redraw |= REDRAW_SDP; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -2542,7 +2542,7 @@ mgcp_dialed_digits(gchar *signalStr, gchar **dialedDigits) /****************************************************************************/ /* whenever a MGCP packet is seen by the tap listener */ -static gboolean +static tap_packet_status mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *MGCPinfo) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_mgcp_); @@ -2603,7 +2603,7 @@ mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, fromEndpoint = FALSE; newcall = TRUE; } - if (!newcall) return FALSE; + if (!newcall) return TAP_PACKET_DONT_REDRAW; } } else if ( ((pi->mgcp_type == MGCP_RESPONSE) && pi->request_available) || ((pi->mgcp_type == MGCP_REQUEST) && pi->is_duplicate) ) { @@ -2635,8 +2635,8 @@ mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, listGraph = g_list_next(listGraph); } /* if there is not a matching request, just return */ - if (callsinfo == NULL) return FALSE; - } else return FALSE; + if (callsinfo == NULL) return TAP_PACKET_DONT_REDRAW; + } else return TAP_PACKET_DONT_REDRAW; /* not in the list? then create a new entry */ if (callsinfo==NULL) { @@ -2758,7 +2758,7 @@ mgcp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, tapinfo->redraw |= REDRAW_MGCP; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -2815,7 +2815,7 @@ remove_tap_listener_mgcp_calls(voip_calls_tapinfo_t *tap_id_base) /****************************************************************************/ /* whenever a ACTRACE packet is seen by the tap listener */ -static gboolean +static tap_packet_status actrace_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *ACTRACEinfo) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_actrace_); @@ -2891,7 +2891,7 @@ actrace_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e tapinfo->redraw |= REDRAW_ACTRACE; - return TRUE; /* refresh output */ + return TAP_PACKET_REDRAW; /* refresh output */ } /****************************************************************************/ @@ -2947,7 +2947,7 @@ remove_tap_listener_actrace_calls(voip_calls_tapinfo_t *tap_id_base) type == GCP_CMD_CTX_ATTR_AUDIT_REQ ) -static gboolean +static tap_packet_status h248_calls_packet_common(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info, guint32 redraw_bit) { const gcp_cmd_t *cmd = (const gcp_cmd_t *)prot_info; GList *list; @@ -2957,7 +2957,7 @@ h248_calls_packet_common(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan gchar mgw_addr[128]; if (cmd->ctx->id == NULL_CONTEXT || cmd->ctx->id == ALL_CONTEXTS ) { - return FALSE; + return TAP_PACKET_DONT_REDRAW; } if ( gcp_is_req(cmd->type) ) { @@ -3040,10 +3040,10 @@ h248_calls_packet_common(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan tapinfo->redraw |= redraw_bit; - return TRUE; + return TAP_PACKET_REDRAW; } -static gboolean +static tap_packet_status h248_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_h248_); @@ -3061,7 +3061,7 @@ h248_calls_draw(void *tap_offset_ptr) } } -static gboolean +static tap_packet_status megaco_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_megaco_); @@ -3133,7 +3133,7 @@ static const voip_protocol sccp_proto_map[] = { #define SP2VP(ap) ((ap) < SCCP_PLOAD_NUM_PLOADS ? sccp_proto_map[(ap)] : TEL_SCCP) const value_string* sccp_payload_values; -static gboolean +static tap_packet_status sccp_calls(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info, guint32 redraw_bit) { const sccp_msg_info_t* msg = (const sccp_msg_info_t *)prot_info; sccp_assoc_info_t* assoc = msg->data.co.assoc; @@ -3233,10 +3233,10 @@ sccp_calls(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *ed tapinfo->redraw |= redraw_bit; - return TRUE; + return TAP_PACKET_REDRAW; } -static gboolean +static tap_packet_status sccp_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sccp_); @@ -3255,7 +3255,7 @@ sccp_calls_draw(void *tap_offset_ptr) } } -static gboolean +static tap_packet_status sua_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sua_); @@ -3319,7 +3319,7 @@ remove_tap_listener_sccp_calls(voip_calls_tapinfo_t *tap_id_base) /****************************TAP for UNISTIM ********************************/ /****************************************************************************/ -static gboolean +static tap_packet_status unistim_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *unistim_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_unistim_); @@ -3778,7 +3778,7 @@ unistim_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *e tapinfo->redraw |= REDRAW_UNISTIM; - return TRUE; + return TAP_PACKET_REDRAW; } /****************************************************************************/ @@ -3847,7 +3847,7 @@ static const voip_call_state skinny_tap_voip_state[] = { VOIP_REJECTED }; -static gboolean +static tap_packet_status skinny_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *skinny_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_skinny_); @@ -3859,7 +3859,7 @@ skinny_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *ed gchar *comment; if (si == NULL || (si->callId == 0 && si->passThroughPartyId == 0)) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* check whether we already have this context in the list */ list = g_queue_peek_nth_link(tapinfo->callsinfos, 0); while (list) @@ -3939,7 +3939,7 @@ skinny_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *ed tapinfo->redraw |= REDRAW_SKINNY; - return TRUE; + return TAP_PACKET_REDRAW; } /****************************************************************************/ @@ -4004,7 +4004,7 @@ static void free_iax2_info(gpointer p) { /****************************************************************************/ /* whenever a IAX2 packet is seen by the tap listener */ -static gboolean +static tap_packet_status iax2_calls_packet( void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *iax2_info) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_iax2_); @@ -4015,7 +4015,7 @@ iax2_calls_packet( void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt iax2_info_t *tmp_iax2info; if (ii == NULL || ii->ptype != IAX2_FULL_PACKET || (ii->scallno == 0 && ii->dcallno == 0)) - return FALSE; + return TAP_PACKET_DONT_REDRAW; /* check whether we already have this context in the list */ list = g_queue_peek_nth_link(tapinfo->callsinfos, 0); while (list) @@ -4037,7 +4037,7 @@ iax2_calls_packet( void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt if (callsinfo==NULL) { /* We only care about real calls, i.e., no registration stuff */ if (ii->ftype != AST_FRAME_IAX || ii->csub != IAX_COMMAND_NEW) - return FALSE; + return TAP_PACKET_DONT_REDRAW; callsinfo = (voip_calls_info_t *)g_malloc0(sizeof(voip_calls_info_t)); callsinfo->call_state = VOIP_NO_STATE; callsinfo->call_active_state = VOIP_ACTIVE; @@ -4077,7 +4077,7 @@ iax2_calls_packet( void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt tapinfo->redraw |= REDRAW_IAX2; - return TRUE; + return TAP_PACKET_REDRAW; } @@ -4138,7 +4138,7 @@ remove_tap_listener_iax2_calls(voip_calls_tapinfo_t *tap_id_base) /****************************************************************************/ /* voip_calls_packet and voip_calls_init_tap appear to be dead code. We don't have a "voip" tap. */ -static gboolean +static tap_packet_status voip_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, const void *VoIPinfo) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_voip_); @@ -4202,7 +4202,7 @@ voip_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt, tapinfo->redraw |= REDRAW_VOIP; - return TRUE; + return TAP_PACKET_REDRAW; } /****************************************************************************/ @@ -4254,7 +4254,7 @@ remove_tap_listener_voip_calls(voip_calls_tapinfo_t *tap_id_base) /****************************************************************************/ /* whenever a prot_ packet is seen by the tap listener */ #if 0 -static gboolean +static tap_packet_status prot_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prot_info _U_) { voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_prot_); @@ -4268,7 +4268,7 @@ prot_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt tapinfo->redraw = REDRAW_PROT; - return TRUE; + return TAP_PACKET_REDRAW; } /****************************************************************************/ |