#include "epan/epan_dissect.h"
#include "epan/packet.h"
+#include "epan/proto_data.h"
+#include "epan/to_str.h"
#include "epan/dissectors/packet-sip.h"
#include "epan/dissectors/packet-h225.h"
#include "epan/dissectors/packet-h245.h"
+#include "epan/dissectors/packet-isup.h"
#include "epan/dissectors/packet-sdp.h"
#include "epan/dissectors/packet-mgcp.h"
+#include "epan/dissectors/packet-mtp3.h"
#include "epan/dissectors/packet-actrace.h"
+#include "epan/dissectors/packet-q931.h"
#include "epan/dissectors/packet-rtp.h"
#include "epan/dissectors/packet-rtp-events.h"
#include "epan/dissectors/packet-t38.h"
tap_id_offset_voip_
};
+#define REDRAW_ACTRACE (1 << tap_id_offset_actrace_)
+#define REDRAW_H225 (1 << tap_id_offset_h225_)
+#define REDRAW_H245DG (1 << tap_id_offset_h245dg_)
+#define REDRAW_H248 (1 << tap_id_offset_h248_)
+#define REDRAW_IAX2 (1 << tap_id_offset_iax2_)
+#define REDRAW_ISUP (1 << tap_id_offset_isup_)
+#define REDRAW_M3UA (1 << tap_id_offset_m3ua_)
+#define REDRAW_MEGACO (1 << tap_id_offset_megaco_)
+#define REDRAW_MGCP (1 << tap_id_offset_mgcp_)
+#define REDRAW_MTP3 (1 << tap_id_offset_mtp3_)
+#define REDRAW_Q931 (1 << tap_id_offset_q931_)
+#define REDRAW_RTP (1 << tap_id_offset_rtp_)
+#define REDRAW_RTP_EVENT (1 << tap_id_offset_rtp_event_)
+#define REDRAW_SCCP (1 << tap_id_offset_sccp_)
+#define REDRAW_SDP (1 << tap_id_offset_sdp_)
+#define REDRAW_SIP (1 << tap_id_offset_sip_)
+#define REDRAW_SKINNY (1 << tap_id_offset_skinny_)
+#define REDRAW_SUA (1 << tap_id_offset_sua_)
+#define REDRAW_T38 (1 << tap_id_offset_t38_)
+#define REDRAW_UNISTIM (1 << tap_id_offset_unistim_)
+#define REDRAW_VOIP (1 << tap_id_offset_voip_)
+
static inline void *
tap_base_to_id(voip_calls_tapinfo_t* tap_base, int offset) {
return GSIZE_TO_POINTER(GPOINTER_TO_SIZE(tap_base) + offset);
g_free(callsinfo->call_id);
g_free(callsinfo->from_identity);
g_free(callsinfo->to_identity);
- g_free((void *)(callsinfo->initial_speaker.data));
+ free_address(&callsinfo->initial_speaker);
g_free(callsinfo->protocol_name);
g_free(callsinfo->call_comment);
if(NULL!=tapinfo->callsinfo_hashtable[SIP_HASH])
g_hash_table_remove_all (tapinfo->callsinfo_hashtable[SIP_HASH]);
- /* free the graph data items first */
- if(NULL == tapinfo->graph_analysis) {
- tapinfo->graph_analysis = sequence_analysis_info_new();
- }
-
- sequence_analysis_list_free(tapinfo->graph_analysis);
-
/* free the strinfo data items first */
list = g_list_first(tapinfo->rtp_stream_list);
while(list)
{
strinfo = (rtp_stream_info_t *)list->data;
wmem_free(NULL, strinfo->payload_type_name);
+ wmem_free(NULL, strinfo->ed137_info);
list = g_list_next(list);
}
g_list_free(tapinfo->rtp_stream_list);
memset(tapinfo->h245_labels, 0, sizeof(h245_labels_t));
}
+ tapinfo->ncalls = 0;
+ tapinfo->start_packets = 0;
+ tapinfo->completed_calls = 0;
+ tapinfo->rejected_calls = 0;
+
return;
}
}
gai = (seq_analysis_item_t *)g_malloc0(sizeof(seq_analysis_item_t));
- gai->frame_number = pinfo->fd->num;
+ gai->frame_number = pinfo->num;
copy_address(&(gai->src_addr),src_addr);
copy_address(&(gai->dst_addr),dst_addr);
/****************************************************************************/
/* Append str to frame_label and comment in a graph item */
/* return 0 if the frame_num is not in the graph list */
-static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
+static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
{
seq_analysis_item_t *gai=NULL;
gchar *frame_label = NULL;
/****************************************************************************/
/* Change the frame_label and comment in a graph item if not NULL*/
/* return 0 if the frame_num is not in the graph list */
-static int change_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
+static int change_frame_graph(voip_calls_tapinfo_t *tapinfo, guint32 frame_num, const gchar *new_frame_label, const gchar *new_comment)
{
seq_analysis_item_t *gai=NULL;
gchar *frame_label = NULL;
/****************************************************************************/
/* Change all the graph items with call_num to new_call_num */
-static guint change_call_num_graph(voip_calls_tapinfo_t *tapinfo _U_, guint16 call_num, guint16 new_call_num)
+static guint change_call_num_graph(voip_calls_tapinfo_t *tapinfo, guint16 call_num, guint16 new_call_num)
{
seq_analysis_item_t *gai;
GList *list;
new_gai->comment = g_strdup("");
new_gai->conv_num=call_num;
new_gai->line_style=line_style;
- set_fd_time(edt->session, packet_list_get_row_data(frame_num), time_str);
+ set_fd_time(edt->session, pinfo->fd, time_str);
new_gai->time_str = g_strdup(time_str);
new_gai->display=FALSE;
return FALSE;
}
- tapinfo->rtp_evt_frame_num = pinfo->fd->num;
+ tapinfo->rtp_evt_frame_num = pinfo->num;
tapinfo->rtp_evt = pi->info_rtp_evt;
tapinfo->rtp_evt_end = pi->info_end;
this is to show multiple payload changes in the Graph for example for DTMF RFC2833 */
if ( tmp_listinfo->payload_type != rtp_info->info_payload_type ) {
tmp_listinfo->end_stream = TRUE;
+ } else if ( ( ( tmp_listinfo->ed137_info == NULL ) && (rtp_info->info_ed137_info != NULL) ) ||
+ ( ( tmp_listinfo->ed137_info != NULL ) && (rtp_info->info_ed137_info == NULL) ) ||
+ ( ( tmp_listinfo->ed137_info != NULL ) && (rtp_info->info_ed137_info != NULL) &&
+ ( 0!=strcmp(tmp_listinfo->ed137_info, rtp_info->info_ed137_info) )
+ )
+ ) {
+ /* if ed137_info has changed, create new stream */
+ tmp_listinfo->end_stream = TRUE;
} else {
strinfo = (rtp_stream_info_t*)(list->data);
break;
}
/* if this is a duplicated RTP Event End, just return */
- if ((tapinfo->rtp_evt_frame_num == pinfo->fd->num) && !strinfo && (tapinfo->rtp_evt_end == TRUE)) {
+ if ((tapinfo->rtp_evt_frame_num == pinfo->num) && !strinfo && (tapinfo->rtp_evt_end == TRUE)) {
return FALSE;
}
strinfo->setup_frame_number = rtp_info->info_setup_frame_num;
strinfo->call_num = -1;
strinfo->rtp_event = -1;
+ if (rtp_info->info_ed137_info != NULL) {
+ strinfo->ed137_info = wmem_strdup(NULL, rtp_info->info_ed137_info);
+ } else {
+ strinfo->ed137_info = NULL;
+ }
tapinfo->rtp_stream_list = g_list_prepend(tapinfo->rtp_stream_list, strinfo);
}
/* Add the info to the existing RTP stream */
strinfo->packet_count++;
strinfo->stop_fd = pinfo->fd;
+ strinfo->stop_rel_time = pinfo->rel_ts;
/* process RTP Event */
- if (tapinfo->rtp_evt_frame_num == pinfo->fd->num) {
+ if (tapinfo->rtp_evt_frame_num == pinfo->num) {
strinfo->rtp_event = tapinfo->rtp_evt;
if (tapinfo->rtp_evt_end == TRUE) {
strinfo->end_stream = TRUE;
}
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_RTP;
return FALSE;
}
new_gai->port_src = rtp_listinfo->src_port;
new_gai->port_dst = rtp_listinfo->dest_port;
duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_rel_time) - nstime_to_msec(&rtp_listinfo->start_rel_time));
- new_gai->frame_label = g_strdup_printf("%s (%s) %s",
+ new_gai->frame_label = g_strdup_printf("%s (%s) %s%s%s",
(rtp_listinfo->is_srtp)?"SRTP":"RTP",
rtp_listinfo->payload_type_name,
(rtp_listinfo->rtp_event == -1)?
- "":val_to_str_ext_const(rtp_listinfo->rtp_event, &rtp_event_type_values_ext, "Unknown RTP Event"));
+ "":val_to_str_ext_const(rtp_listinfo->rtp_event, &rtp_event_type_values_ext, "Unknown RTP Event"),
+ (rtp_listinfo->ed137_info!=NULL?" ":""),
+ (rtp_listinfo->ed137_info!=NULL?rtp_listinfo->ed137_info:"")
+ );
new_gai->comment = g_strdup_printf(comment_fmt,
(rtp_listinfo->is_srtp)?"SRTP":"RTP", rtp_listinfo->packet_count,
duration/1000,(duration%1000), rtp_listinfo->ssrc);
rtp_streams_list = g_list_next(rtp_streams_list);
} /* while (rtp_streams_list) */
- if (tapinfo->tap_draw) {
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_RTP)) {
tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_RTP;
}
}
#if 0
g_free(comment);
g_free(frame_label);
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_T38;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+t38_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_t38_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_T38)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_T38;
+ }
+}
+
/****************************************************************************/
void
t38_init_tap(voip_calls_tapinfo_t *tap_id_base)
0,
NULL,
t38_packet,
- NULL
+ t38_draw
);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
const sip_info_value_t *pi = (const sip_info_value_t *)SIPinfo;
- tapinfo->sip_frame_num = pinfo->fd->num;
+ tapinfo->sip_frame_num = pinfo->num;
/* do not consider packets without call_id */
if (pi->tap_call_id ==NULL) {
comment = g_strdup_printf("SIP Request CANCEL CSeq:%d", pi->tap_cseq_number);
} else {
/* comment = g_strdup_printf("SIP %s", pi->request_method); */
- tmp_sipinfo->invite_cseq = pi->tap_cseq_number;
- callsinfo->call_state = VOIP_CALL_SETUP;
comment = g_strdup_printf("SIP %s From: %s To:%s CSeq:%d",
pi->request_method,
callsinfo->from_identity,
add_to_graph(tapinfo, pinfo, edt, frame_label, comment, callsinfo->call_num, &(pinfo->src), &(pinfo->dst), 1);
g_free(comment);
g_free(frame_label);
- g_free((void *)tmp_src.data);
- g_free((void *)tmp_dst.data);
+ free_address(&tmp_src);
+ free_address(&tmp_dst);
/* add SDP info if apply */
- if ( (tapinfo->sdp_summary != NULL) && (tapinfo->sdp_frame_num == pinfo->fd->num) ) {
- append_to_frame_graph(tapinfo, pinfo->fd->num, tapinfo->sdp_summary, NULL);
+ if ( (tapinfo->sdp_summary != NULL) && (tapinfo->sdp_frame_num == pinfo->num) ) {
+ append_to_frame_graph(tapinfo, pinfo->num, tapinfo->sdp_summary, NULL);
g_free(tapinfo->sdp_summary);
tapinfo->sdp_summary = NULL;
}
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_SIP;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+sip_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sip_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_SIP)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_SIP;
+ }
+}
+
/****************************************************************************/
/* TAP INTERFACE */
/****************************************************************************/
0,
NULL,
sip_calls_packet,
- NULL
+ sip_calls_draw
);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
const isup_tap_rec_t *pi = (const isup_tap_rec_t *)isup_info;
/* check if the lower layer is MTP matching the frame number */
- if (tapinfo->mtp3_frame_num != pinfo->fd->num)
+ if (tapinfo->mtp3_frame_num != pinfo->num)
return FALSE;
/* check whether we already have a call with these parameters in the list */
g_free(frame_label);
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_ISUP;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+isup_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_isup_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_ISUP)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_ISUP;
+ }
+}
+
/****************************************************************************/
void
0,
NULL,
isup_calls_packet,
- NULL
+ isup_calls_draw
);
if (error_string != NULL) {
tapinfo->mtp3_opc = pi->addr_opc.pc;
tapinfo->mtp3_dpc = pi->addr_dpc.pc;
tapinfo->mtp3_ni = pi->addr_opc.ni;
- tapinfo->mtp3_frame_num = pinfo->fd->num;
+ tapinfo->mtp3_frame_num = pinfo->num;
return FALSE;
}
else
tapinfo->q931_called_number = g_strdup("");
tapinfo->q931_cause_value = pi->cause_value;
- tapinfo->q931_frame_num = pinfo->fd->num;
+ tapinfo->q931_frame_num = pinfo->num;
tapinfo->q931_crv = pi->crv;
while (list2)
{
h245_add=(h245_address_t *)list2->data;
- g_free((void *)h245_add->h245_address.data);
+ free_address(&h245_add->h245_address);
g_free(list2->data);
list2 = g_list_next(list2);
}
}
/* Add the H245 info if exists to the Graph */
- h245_add_to_graph(tapinfo, pinfo->fd->num);
+ h245_add_to_graph(tapinfo, pinfo->num);
break;
}
}
wmem_free(NULL, tmp_str);
g_free(comment);
- g_free((char *)pstn_add.data);
+ free_address(&pstn_add);
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_Q931;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+q931_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_q931_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_Q931)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_Q931;
+ }
+}
+
/****************************************************************************/
void
0,
NULL,
q931_calls_packet,
- NULL
+ q931_calls_draw
);
if (error_string != NULL) {
while (list2)
{
h245_address_t *h245_add=(h245_address_t *)list2->data;
- g_free((void *)h245_add->h245_address.data);
+ free_address(&h245_add->h245_address);
g_free(list2->data);
list2 = g_list_next(list2);
}
tmp_h323info->guid = (e_guid_t *)g_memdup(&pi->guid, sizeof pi->guid);
DUMP_PTR1(tmp_h323info->guid);
- tmp_h323info->h225SetupAddr.type = AT_NONE;
- tmp_h323info->h225SetupAddr.len = 0;
+ clear_address(&tmp_h323info->h225SetupAddr);
tmp_h323info->h245_list = NULL;
tmp_h323info->is_faststart_Setup = FALSE;
tmp_h323info->is_faststart_Proc = FALSE;
g_queue_push_tail(tapinfo->callsinfos, callsinfo);
}
- tapinfo->h225_frame_num = pinfo->fd->num;
+ tapinfo->h225_frame_num = pinfo->num;
tapinfo->h225_call_num = callsinfo->call_num;
/* let's analyze the call state */
/* this is still IPv4 only, because the dissector is */
if (pi->is_h245 == TRUE) {
h245_add = (h245_address_t *)g_malloc(sizeof (h245_address_t));
- h245_add->h245_address.type=AT_IPv4;
- h245_add->h245_address.len=4;
- h245_add->h245_address.data = g_malloc(sizeof(pi->h245_address));
- memcpy((void *)(h245_add->h245_address.data), &(pi->h245_address), 4);
+ alloc_address_wmem(NULL, &h245_add->h245_address, AT_IPv4, 4, &pi->h245_address);
h245_add->h245_port = pi->h245_port;
add_h245_Address(tmp_h323info, h245_add);
}
/* add to graph analysis */
/* if the frame number exists in graph, append to it*/
- if (!append_to_frame_graph(tapinfo, pinfo->fd->num, pi->frame_label, comment)) {
+ if (!append_to_frame_graph(tapinfo, pinfo->num, pi->frame_label, comment)) {
/* if not exist, add to the graph */
add_to_graph(tapinfo, pinfo, edt, frame_label, comment, callsinfo->call_num, &(pinfo->src), &(pinfo->dst), 1);
}
/* Add the H245 info if exists to the Graph */
- h245_add_to_graph(tapinfo, pinfo->fd->num);
+ h245_add_to_graph(tapinfo, pinfo->num);
g_free(frame_label);
g_free(comment);
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_H225;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+h225_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_h225_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_H225)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_H225;
+ }
+}
/****************************************************************************/
/* TAP INTERFACE */
0,
NULL,
h225_calls_packet,
- NULL
+ h225_calls_draw
);
if (error_string != NULL) {
/* increment the packets counter of all calls */
++(tapinfo->npackets);
/* if the frame number exists in graph, append to it*/
- if (!append_to_frame_graph(tapinfo, pinfo->fd->num, pi->frame_label, pi->comment)) {
+ if (!append_to_frame_graph(tapinfo, pinfo->num, pi->frame_label, pi->comment)) {
/* if not exist, add to the graph */
add_to_graph(tapinfo, pinfo, edt, pi->frame_label, pi->comment, callsinfo->call_num, &(pinfo->src), &(pinfo->dst), 1);
}
tunnel OFF but we did not matched the h245 add, in this case nobady will set this label
since the frame_num will not match */
- h245_add_label(tapinfo, pinfo->fd->num, (gchar *) pi->frame_label, (gchar *) pi->comment);
+ h245_add_label(tapinfo, pinfo->num, (gchar *) pi->frame_label, (gchar *) pi->comment);
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_H245DG;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+h245dg_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_h245dg_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_H245DG)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_H245DG;
+ }
+}
/****************************************************************************/
/* TAP INTERFACE */
0,
NULL,
h245dg_calls_packet,
- NULL
+ h245dg_calls_draw
);
if (error_string != NULL) {
to use it later
*/
g_free(tapinfo->sdp_summary);
- tapinfo->sdp_frame_num = pinfo->fd->num;
+ tapinfo->sdp_frame_num = pinfo->num;
/* Append to graph the SDP summary if the packet exists */
tapinfo->sdp_summary = g_strdup_printf("SDP (%s)", pi->summary_str);
- append_to_frame_graph(tapinfo, pinfo->fd->num, tapinfo->sdp_summary, NULL);
+ append_to_frame_graph(tapinfo, pinfo->num, tapinfo->sdp_summary, NULL);
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_SDP;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+sdp_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sdp_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_SDP)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_SDP;
+ }
+}
/****************************************************************************/
/* TAP INTERFACE */
0,
NULL,
sdp_calls_packet,
- NULL
+ sdp_calls_draw
);
if (error_string != NULL) {
g_free(frame_label);
/* add SDP info if apply */
- if ( (tapinfo->sdp_summary != NULL) && (tapinfo->sdp_frame_num == pinfo->fd->num) ) {
- append_to_frame_graph(tapinfo, pinfo->fd->num, tapinfo->sdp_summary, NULL);
+ if ( (tapinfo->sdp_summary != NULL) && (tapinfo->sdp_frame_num == pinfo->num) ) {
+ append_to_frame_graph(tapinfo, pinfo->num, tapinfo->sdp_summary, NULL);
g_free(tapinfo->sdp_summary);
tapinfo->sdp_summary = NULL;
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_MGCP;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+mgcp_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_mgcp_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_MGCP)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_MGCP;
+ }
+}
/****************************************************************************/
/* TAP INTERFACE */
TL_REQUIRES_PROTO_TREE,
NULL,
mgcp_calls_packet,
- NULL
+ mgcp_calls_draw
);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
voip_calls_info_t *tmp_listinfo;
voip_calls_info_t *callsinfo = NULL;
- tapinfo->actrace_frame_num = pinfo->fd->num;
+ tapinfo->actrace_frame_num = pinfo->num;
tapinfo->actrace_trunk = pi->trunk;
tapinfo->actrace_direction = pi->direction;
g_free(comment);
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_ACTRACE;
return TRUE; /* refresh output */
}
+/****************************************************************************/
+static void
+actrace_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_actrace_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_ACTRACE)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_ACTRACE;
+ }
+}
/****************************************************************************/
/* TAP INTERFACE */
0,
NULL,
actrace_calls_packet,
- NULL
+ actrace_calls_draw
);
if (error_string != NULL) {
static gboolean
-h248_calls_packet_common(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) {
+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;
voip_calls_info_t *callsinfo = NULL;
++(tapinfo->npackets);
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= redraw_bit;
return TRUE;
}
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_);
- return h248_calls_packet_common(tapinfo, pinfo, edt, prot_info);
+ return h248_calls_packet_common(tapinfo, pinfo, edt, prot_info, REDRAW_H248);
+}
+
+static void
+h248_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_h248_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_H248)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_H248;
+ }
}
static gboolean
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_);
- return h248_calls_packet_common(tapinfo, pinfo, edt, prot_info);
+ return h248_calls_packet_common(tapinfo, pinfo, edt, prot_info, REDRAW_MEGACO);
+}
+
+static void
+megaco_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_megaco_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_MEGACO)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_MEGACO;
+ }
}
void
0,
NULL,
megaco_calls_packet,
- NULL);
+ megaco_calls_draw);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
0,
NULL,
h248_calls_packet,
- NULL);
+ h248_calls_draw);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
const value_string* sccp_payload_values;
static gboolean
-sccp_calls(voip_calls_tapinfo_t *tapinfo, packet_info *pinfo, epan_dissect_t *edt, const void *prot_info) {
+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;
GList *list;
++(tapinfo->npackets);
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= redraw_bit;
return TRUE;
}
voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sccp_);
sccp_payload_values = sccp_message_type_acro_values;
- return sccp_calls(tapinfo, pinfo, edt, prot_info);
+ return sccp_calls(tapinfo, pinfo, edt, prot_info, REDRAW_SCCP);
}
+static void
+sccp_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sccp_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_SCCP)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_SCCP;
+ }
+}
static gboolean
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_sccp_);
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sua_);
sccp_payload_values = sua_co_class_type_acro_values;
- return sccp_calls(tapinfo, pinfo, edt, prot_info);
+ return sccp_calls(tapinfo, pinfo, edt, prot_info, REDRAW_SUA);
+}
+
+static void
+sua_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_sua_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_SUA)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_SUA;
+ }
}
void sccp_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
0,
NULL,
sccp_calls_packet,
- NULL);
+ sccp_calls_draw);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
0,
NULL,
sua_calls_packet,
- NULL);
+ sua_calls_draw);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
/* free data */
g_free(comment);
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_UNISTIM;
return TRUE;
}
+/****************************************************************************/
+static void
+unistim_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_unistim_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_UNISTIM)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_UNISTIM;
+ }
+}
+
/****************************************************************************/
/* TAP INTERFACE */
/****************************************************************************/
0,
NULL,
unistim_calls_packet,
- NULL
+ unistim_calls_draw
);
if (error_string != NULL) {
callsinfo->call_num, &(pinfo->src), &(pinfo->dst), 1);
g_free(comment);
+ tapinfo->redraw |= REDRAW_SKINNY;
+
return TRUE;
}
+/****************************************************************************/
+static void
+skinny_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_skinny_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_SKINNY)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_SKINNY;
+ }
+}
/****************************************************************************/
/* TAP INTERFACE */
TL_REQUIRES_PROTO_TREE,
NULL,
skinny_calls_packet,
- NULL
+ skinny_calls_draw
);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
add_to_graph(tapinfo, pinfo, edt, ii->messageName, "",
callsinfo->call_num, &(pinfo->src), &(pinfo->dst), 1);
+ tapinfo->redraw |= REDRAW_IAX2;
+
return TRUE;
}
+/****************************************************************************/
+static void
+iax2_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_iax2_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_IAX2)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_IAX2;
+ }
+}
/****************************************************************************/
/* TAP INTERFACE */
TL_REQUIRES_PROTO_TREE,
NULL,
iax2_calls_packet,
- NULL
+ iax2_calls_draw
);
if (error_string != NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "%s",
GList *list = NULL;
const voip_packet_info_t *pi = (const voip_packet_info_t *)VoIPinfo;
- /* VOIP_CALLS_DEBUG("num %u", pinfo->fd->num); */
+ /* VOIP_CALLS_DEBUG("num %u", pinfo->num); */
if (pi->call_id)
list = g_queue_peek_nth_link(tapinfo->callsinfos, 0);
while (list) {
/* add to the graph */
add_to_graph(tapinfo, pinfo, edt, (pi->frame_label)?pi->frame_label:"VoIP msg", pi->frame_comment, callsinfo->call_num, &(pinfo->src), &(pinfo->dst), 1);
- tapinfo->redraw = TRUE;
+ tapinfo->redraw |= REDRAW_VOIP;
return TRUE;
}
+/****************************************************************************/
+static void
+voip_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_voip_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_VOIP)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_VOIP;
+ }
+}
+
/****************************************************************************/
void
0,
NULL,
voip_calls_packet,
- NULL
+ voip_calls_draw
);
if (error_string != NULL) {
{
voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_prot_);
if (callsinfo!=NULL) {
- callsinfo->stop_abs = pinfo->fd->abs_ts;
+ callsinfo->stop_abs = pinfo->abs_ts;
callsinfo->stop_rel = pinfo->rel_ts;
- callsinfo->last_frame_num=pinfo->fd->num;
+ callsinfo->last_frame_num=pinfo->num;
++(callsinfo->npackets);
++(tapinfo->npackets);
}
- tapinfo->redraw = TRUE;
+ tapinfo->redraw = REDRAW_PROT;
return TRUE;
}
-#endif
/****************************************************************************/
-#if 0
+static void
+prot_calls_draw(void *tap_offset_ptr)
+{
+ voip_calls_tapinfo_t *tapinfo = tap_id_to_base(tap_offset_ptr, tap_id_offset_prot_);
+
+ if (tapinfo->tap_draw && (tapinfo->redraw & REDRAW_PROT)) {
+ tapinfo->tap_draw(tapinfo);
+ tapinfo->redraw &= ~REDRAW_PROT;
+ }
+}
+
+/****************************************************************************/
void
prot_calls_init_tap(voip_calls_tapinfo_t *tap_id_base)
{
NULL,
0,
NULL,
- prot__calls_packet,
- NULL
+ prot_calls_packet,
+ prot_calls_draw
);
if (error_string != NULL) {
g_string_free(error_string, TRUE);
}
}
-#endif
/****************************************************************************/
-#if 0
void
remove_tap_listener_prot__calls(voip_calls_tapinfo_t *tap_id_base)
{