aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-04-04 16:55:14 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-04-04 16:55:14 +0000
commita95dd5cda7a9785380ef5e6ab565dc02517900e6 (patch)
tree88981f40fe21fe92a9294c249ab7e7259ec62da5 /ui/gtk
parentcc9f72e246827762b3d13d0f24bb67e80e2fa0bd (diff)
Fix CID 615: strinfo can't be NULL here so don't check for it being NULL.
svn path=/trunk/; revision=41933
Diffstat (limited to 'ui/gtk')
-rw-r--r--ui/gtk/voip_calls.c288
1 files changed, 143 insertions, 145 deletions
diff --git a/ui/gtk/voip_calls.c b/ui/gtk/voip_calls.c
index 6566c1dfc3..a289dcadad 100644
--- a/ui/gtk/voip_calls.c
+++ b/ui/gtk/voip_calls.c
@@ -230,7 +230,7 @@ void voip_calls_reset(voip_calls_tapinfo_t *tapinfo)
}
/****************************************************************************/
-void graph_analysis_data_init(void){
+void graph_analysis_data_init(void) {
the_tapinfo_struct.graph_analysis = g_malloc(sizeof(graph_analysis_info_t));
the_tapinfo_struct.graph_analysis->nconv = 0;
the_tapinfo_struct.graph_analysis->list = NULL;
@@ -279,16 +279,16 @@ static int append_to_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 fram
if(NULL!=tapinfo->graph_analysis->ht)
gai=g_hash_table_lookup(tapinfo->graph_analysis->ht, &frame_num);
- if(gai){
+ if(gai) {
frame_label = gai->frame_label;
comment = gai->comment;
- if (new_frame_label != NULL){
+ if (new_frame_label != NULL) {
gai->frame_label = g_strdup_printf("%s %s", frame_label, new_frame_label);
g_free(frame_label);
}
- if (new_comment != NULL){
+ if (new_comment != NULL) {
gai->comment = g_strdup_printf("%s %s", comment, new_comment);
g_free(comment);
}
@@ -308,16 +308,16 @@ static int change_frame_graph(voip_calls_tapinfo_t *tapinfo _U_, guint32 frame_n
if(NULL!=tapinfo->graph_analysis->ht)
gai=g_hash_table_lookup(tapinfo->graph_analysis->ht, &frame_num);
- if(gai){
+ if(gai) {
frame_label = gai->frame_label;
comment = gai->comment;
- if (new_frame_label != NULL){
+ if (new_frame_label != NULL) {
gai->frame_label = g_strdup(new_frame_label);
g_free(frame_label);
}
- if (new_comment != NULL){
+ if (new_comment != NULL) {
gai->comment = g_strdup(new_comment);
g_free(comment);
}
@@ -339,7 +339,7 @@ static guint change_call_num_graph(voip_calls_tapinfo_t *tapinfo _U_, guint16 ca
while (list)
{
gai = list->data;
- if (gai->conv_num == call_num){
+ if (gai->conv_num == call_num) {
gai->conv_num = new_call_num;
items_changed++;
}
@@ -383,7 +383,7 @@ static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo _U_, packet_info *
while (list)
{
gai = list->data;
- if (gai->fd->num > frame_num){
+ if (gai->fd->num > frame_num) {
the_tapinfo_struct.graph_analysis->list = g_list_insert(the_tapinfo_struct.graph_analysis->list, new_gai, item_num);
g_hash_table_insert(tapinfo->graph_analysis->ht, &new_gai->fd->num, new_gai);
inserted = TRUE;
@@ -393,7 +393,7 @@ static void insert_to_graph_t38(voip_calls_tapinfo_t *tapinfo _U_, packet_info *
item_num++;
}
- if (!inserted){
+ if (!inserted) {
tapinfo->graph_analysis->list = g_list_prepend(tapinfo->graph_analysis->list, new_gai);
g_hash_table_insert(tapinfo->graph_analysis->ht, &new_gai->fd->num, new_gai);
}
@@ -416,7 +416,7 @@ rtp_event_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
const struct _rtp_event_info *pi = rtp_event_info;
/* do not consider RTP events packets without a setup frame */
- if (pi->info_setup_frame_num == 0){
+ if (pi->info_setup_frame_num == 0) {
return 0;
}
@@ -505,7 +505,7 @@ RTP_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void cons
const struct _rtp_info *pi = RTPinfo;
/* do not consider RTP packets without a setup frame */
- if (pi->info_setup_frame_num == 0){
+ if (pi->info_setup_frame_num == 0) {
return 0;
}
@@ -520,7 +520,7 @@ RTP_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void cons
{
tmp_listinfo=list->data;
if ( (tmp_listinfo->setup_frame_number == pi->info_setup_frame_num)
- && (tmp_listinfo->ssrc == pi->info_sync_src) && (tmp_listinfo->end_stream == FALSE)){
+ && (tmp_listinfo->ssrc == pi->info_sync_src) && (tmp_listinfo->end_stream == FALSE)) {
/* if the payload type has changed, we mark the stream as finished to create a new one
this is to show multiple payload changes in the Graph for example for DTMF RFC2833 */
if ( tmp_listinfo->pt != pi->info_payload_type ) {
@@ -539,7 +539,7 @@ RTP_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void cons
}
/* not in the list? then create a new entry */
- if (strinfo==NULL){
+ if (strinfo==NULL) {
strinfo = g_malloc(sizeof(voip_rtp_stream_info_t));
COPY_ADDRESS(&(strinfo->src_addr), &(pinfo->src));
strinfo->src_port = pinfo->srcport;
@@ -570,17 +570,15 @@ RTP_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, void cons
tapinfo->list = g_list_prepend(tapinfo->list, strinfo);
}
- if (strinfo!=NULL){
- /* Add the info to the existing RTP stream */
- strinfo->npackets++;
- strinfo->stop_fd = pinfo->fd;
+ /* Add the info to the existing RTP stream */
+ strinfo->npackets++;
+ strinfo->stop_fd = pinfo->fd;
- /* process RTP Event */
- if (rtp_evt_frame_num == pinfo->fd->num) {
- strinfo->rtp_event = rtp_evt;
- if (rtp_evt_end == TRUE) {
- strinfo->end_stream = TRUE;
- }
+ /* process RTP Event */
+ if (rtp_evt_frame_num == pinfo->fd->num) {
+ strinfo->rtp_event = rtp_evt;
+ if (rtp_evt_end == TRUE) {
+ strinfo->end_stream = TRUE;
}
}
@@ -612,12 +610,12 @@ static void RTP_packet_draw(void *prs _U_)
/* voip_calls_graph_list = g_list_first(the_tapinfo_struct.graph_analysis->list); */
gai = g_hash_table_lookup(the_tapinfo_struct.graph_analysis->ht, &rtp_listinfo->setup_frame_number);
- if(gai != NULL){
+ if(gai != NULL) {
/* Found the setup frame*/
conv_num = gai->conv_num;
/* if RTP was already in the Graph, just update the comment information */
gai = g_hash_table_lookup(the_tapinfo_struct.graph_analysis->ht, &rtp_listinfo->start_fd->num);
- if(gai != NULL){
+ if(gai != NULL) {
duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts));
g_free(gai->comment);
gai->comment = g_strdup_printf("%s Num packets:%u Duration:%u.%03us SSRC:0x%X",
@@ -675,14 +673,14 @@ static void RTP_packet_draw(void *prs _U_)
gai = voip_calls_graph_list->data;
conv_num = gai->conv_num;
/* if we get the setup frame number, then get the time position to graph the RTP arrow */
- if (rtp_listinfo->setup_frame_number == gai->fd->num){
+ if (rtp_listinfo->setup_frame_number == gai->fd->num) {
/* look again from the begining because there are cases where the Setup frame is after the RTP */
voip_calls_graph_list = g_list_first(the_tapinfo_struct.graph_analysis->list);
item = 0;
- while(voip_calls_graph_list){
+ while(voip_calls_graph_list) {
gai = voip_calls_graph_list->data;
/* if RTP was already in the Graph, just update the comment information */
- if (rtp_listinfo->start_fd->num == gai->fd->num){
+ if (rtp_listinfo->start_fd->num == gai->fd->num) {
duration = (guint32)(nstime_to_msec(&rtp_listinfo->stop_fd->rel_ts) - nstime_to_msec(&rtp_listinfo->start_fd->rel_ts));
g_free(gai->comment);
gai->comment = g_strdup_printf("%s Num packets:%u Duration:%u.%03us SSRC:0x%X",
@@ -696,7 +694,7 @@ static void RTP_packet_draw(void *prs _U_)
if (!voip_calls_graph_list) item++;
/* add the RTP item to the graph if was not there*/
- if (rtp_listinfo->start_fd->num<gai->fd->num || !voip_calls_graph_list){
+ if (rtp_listinfo->start_fd->num<gai->fd->num || !voip_calls_graph_list) {
new_gai = g_malloc(sizeof(graph_analysis_item_t));
new_gai->fd = rtp_listinfo->start_fd;
COPY_ADDRESS(&(new_gai->src_addr),&(rtp_listinfo->src_addr));
@@ -795,7 +793,7 @@ T38_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
while (voip_calls_graph_list)
{
tmp_gai = voip_calls_graph_list->data;
- if (pi->setup_frame_number == tmp_gai->fd->num){
+ if (pi->setup_frame_number == tmp_gai->fd->num) {
gai = tmp_gai;
break;
}
@@ -809,13 +807,13 @@ T38_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
* in this case we create a "voip" call that only have t38 media (no signaling)
* OR if we have not found the Setup message in the graph.
*/
- if ( (pi->setup_frame_number == 0) || (gai == NULL) ){
+ if ( (pi->setup_frame_number == 0) || (gai == NULL) ) {
/* check whether we already have a call with these parameters in the list */
list = g_list_first(tapinfo->callsinfo_list);
while (list)
{
tmp_listinfo=list->data;
- if (tmp_listinfo->protocol == MEDIA_T38){
+ if (tmp_listinfo->protocol == MEDIA_T38) {
callsinfo = (voip_calls_info_t*)(list->data);
break;
}
@@ -823,7 +821,7 @@ T38_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
}
/* not in the list? then create a new entry */
- if (callsinfo==NULL){
+ if (callsinfo==NULL) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_active_state = VOIP_ACTIVE;
callsinfo->call_state = VOIP_UNKNOWN;
@@ -857,7 +855,7 @@ T38_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
comment = g_strdup_printf("t38:t30 Ind:%s",val_to_str(pi->t30ind_value, t38_T30_indicator_vals, "Ukn (0x%02X)") );
line_style = 1;
} else if (pi->type_msg == 1) { /* 1=data */
- switch(pi->Data_Field_field_type_value){
+ switch(pi->Data_Field_field_type_value) {
case 0: /* hdlc-data */
break;
case 2: /* hdlc-fcs-OK */
@@ -964,7 +962,7 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
const sip_info_value_t *pi = SIPinfo;
/* do not consider packets without call_id */
- if (pi->tap_call_id ==NULL){
+ if (pi->tap_call_id ==NULL) {
return 0;
}
key=pi->tap_call_id;
@@ -980,8 +978,8 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
callsinfo = g_hash_table_lookup(tapinfo->callsinfo_hashtable[SIP_HASH], key);
/* not in the hash? then create a new entry if the message is INVITE -i.e. if this session is a call*/
- if ((callsinfo==NULL) &&(pi->request_method!=NULL)){
- if (strcmp(pi->request_method,"INVITE")==0){
+ if ((callsinfo==NULL) &&(pi->request_method!=NULL)) {
+ if (strcmp(pi->request_method,"INVITE")==0) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_active_state = VOIP_ACTIVE;
callsinfo->call_state = VOIP_CALL_SETUP;
@@ -1006,7 +1004,7 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
}
}
- if (callsinfo!=NULL){
+ if (callsinfo!=NULL) {
tmp_sipinfo = callsinfo->prot_info;
/* let's analyze the call state */
@@ -1014,15 +1012,15 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
COPY_ADDRESS(&(tmp_src), &(pinfo->src));
COPY_ADDRESS(&(tmp_dst), &(pinfo->dst));
- if (pi->request_method == NULL){
+ if (pi->request_method == NULL) {
frame_label = g_strdup_printf("%u %s", pi->response_code, pi->reason_phrase );
comment = g_strdup("SIP Status");
- if ((tmp_sipinfo && pi->tap_cseq_number == tmp_sipinfo->invite_cseq)&&(ADDRESSES_EQUAL(&tmp_dst,&(callsinfo->initial_speaker)))){
- if ((pi->response_code > 199) && (pi->response_code<300) && (tmp_sipinfo->sip_state == SIP_INVITE_SENT)){
+ if ((tmp_sipinfo && pi->tap_cseq_number == tmp_sipinfo->invite_cseq)&&(ADDRESSES_EQUAL(&tmp_dst,&(callsinfo->initial_speaker)))) {
+ if ((pi->response_code > 199) && (pi->response_code<300) && (tmp_sipinfo->sip_state == SIP_INVITE_SENT)) {
tmp_sipinfo->sip_state = SIP_200_REC;
}
- else if ((pi->response_code>299)&&(tmp_sipinfo->sip_state == SIP_INVITE_SENT)){
+ else if ((pi->response_code>299)&&(tmp_sipinfo->sip_state == SIP_INVITE_SENT)) {
callsinfo->call_state = VOIP_REJECTED;
tapinfo->rejected_calls++;
}
@@ -1032,24 +1030,24 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
else{
frame_label = g_strdup(pi->request_method);
- if ((strcmp(pi->request_method,"INVITE")==0)&&(ADDRESSES_EQUAL(&tmp_src,&(callsinfo->initial_speaker)))){
+ if ((strcmp(pi->request_method,"INVITE")==0)&&(ADDRESSES_EQUAL(&tmp_src,&(callsinfo->initial_speaker)))) {
tmp_sipinfo->invite_cseq = pi->tap_cseq_number;
callsinfo->call_state = VOIP_CALL_SETUP;
comment = g_strdup_printf("SIP From: %s To:%s", callsinfo->from_identity, callsinfo->to_identity);
}
else if ((strcmp(pi->request_method,"ACK")==0)&&(pi->tap_cseq_number == tmp_sipinfo->invite_cseq)
&&(ADDRESSES_EQUAL(&tmp_src,&(callsinfo->initial_speaker)))&&(tmp_sipinfo->sip_state==SIP_200_REC)
- &&(callsinfo->call_state == VOIP_CALL_SETUP)){
+ &&(callsinfo->call_state == VOIP_CALL_SETUP)) {
callsinfo->call_state = VOIP_IN_CALL;
comment = g_strdup("SIP Request");
}
- else if (strcmp(pi->request_method,"BYE")==0){
+ else if (strcmp(pi->request_method,"BYE")==0) {
callsinfo->call_state = VOIP_COMPLETED;
tapinfo->completed_calls++;
comment = g_strdup("SIP Request");
}
else if ((strcmp(pi->request_method,"CANCEL")==0)&&(pi->tap_cseq_number == tmp_sipinfo->invite_cseq)
- &&(ADDRESSES_EQUAL(&tmp_src,&(callsinfo->initial_speaker)))&&(callsinfo->call_state==VOIP_CALL_SETUP)){
+ &&(ADDRESSES_EQUAL(&tmp_src,&(callsinfo->initial_speaker)))&&(callsinfo->call_state==VOIP_CALL_SETUP)) {
callsinfo->call_state = VOIP_CANCELLED;
tmp_sipinfo->sip_state = SIP_CANCEL_SENT;
comment = g_strdup("SIP Request");
@@ -1071,7 +1069,7 @@ SIPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
g_free((void *)tmp_dst.data);
/* add SDP info if apply */
- if ( (sdp_summary != NULL) && (sdp_frame_num == pinfo->fd->num) ){
+ if ( (sdp_summary != NULL) && (sdp_frame_num == pinfo->fd->num) ) {
append_to_frame_graph(tapinfo, pinfo->fd->num, sdp_summary, NULL);
g_free(sdp_summary);
sdp_summary = NULL;
@@ -1167,30 +1165,30 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
{
right_pair = TRUE;
tmp_listinfo=list->data;
- if ((tmp_listinfo->protocol == VOIP_ISUP)&&(tmp_listinfo->call_active_state==VOIP_ACTIVE)){
+ if ((tmp_listinfo->protocol == VOIP_ISUP)&&(tmp_listinfo->call_active_state==VOIP_ACTIVE)) {
tmp_isupinfo = tmp_listinfo->prot_info;
if ((tmp_isupinfo->cic == pinfo->circuit_id)&&(tmp_isupinfo->ni == mtp3_ni)) {
- if ((tmp_isupinfo->opc == mtp3_opc)&&(tmp_isupinfo->dpc == mtp3_dpc)){
+ if ((tmp_isupinfo->opc == mtp3_opc)&&(tmp_isupinfo->dpc == mtp3_dpc)) {
forward = TRUE;
- } else if ((tmp_isupinfo->dpc == mtp3_opc)&&(tmp_isupinfo->opc == mtp3_dpc)){
+ } else if ((tmp_isupinfo->dpc == mtp3_opc)&&(tmp_isupinfo->opc == mtp3_dpc)) {
forward = FALSE;
} else{
right_pair = FALSE;
}
- if (right_pair){
+ if (right_pair) {
/* if there is an IAM for a call that is not in setup state, that means the previous call in the same
cic is no longer active */
- if (tmp_listinfo->call_state == VOIP_CALL_SETUP){
+ if (tmp_listinfo->call_state == VOIP_CALL_SETUP) {
found = TRUE;
- } else if (pi->message_type != 1){
+ } else if (pi->message_type != 1) {
found = TRUE;
} else{
tmp_listinfo->call_active_state=VOIP_INACTIVE;
}
}
- if (found){
+ if (found) {
callsinfo = (voip_calls_info_t*)(list->data);
break;
}
@@ -1203,7 +1201,7 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
-i.e. if this session is a call*/
- if ((callsinfo==NULL) &&(pi->message_type==1)){
+ if ((callsinfo==NULL) &&(pi->message_type==1)) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_active_state = VOIP_ACTIVE;
callsinfo->call_state = VOIP_UNKNOWN;
@@ -1211,10 +1209,10 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
callsinfo->selected=FALSE;
callsinfo->start_fd=pinfo->fd;
callsinfo->protocol=VOIP_ISUP;
- if (pi->calling_number!=NULL){
+ if (pi->calling_number!=NULL) {
callsinfo->from_identity=g_strdup(pi->calling_number);
}
- if (pi->called_number!=NULL){
+ if (pi->called_number!=NULL) {
callsinfo->to_identity=g_strdup(pi->called_number);
}
callsinfo->prot_info=g_malloc(sizeof(isup_calls_info_t));
@@ -1230,7 +1228,7 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
}
- if (callsinfo!=NULL){
+ if (callsinfo!=NULL) {
callsinfo->stop_fd = pinfo->fd;
++(callsinfo->npackets);
@@ -1238,14 +1236,14 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
frame_label = g_strdup(val_to_str_ext_const(pi->message_type, &isup_message_type_value_acro_ext, "Unknown"));
- if (callsinfo->npackets == 1){ /* this is the first packet, that must be an IAM */
+ if (callsinfo->npackets == 1) { /* this is the first packet, that must be an IAM */
- if ((pi->calling_number!=NULL)&&(pi->called_number !=NULL)){
+ if ((pi->calling_number!=NULL)&&(pi->called_number !=NULL)) {
comment = g_strdup_printf("Call from %s to %s",
pi->calling_number, pi->called_number);
}
- } else if (callsinfo->npackets == 2){ /* in the second packet we show the SPs */
- if (forward){
+ } else if (callsinfo->npackets == 2) { /* in the second packet we show the SPs */
+ if (forward) {
comment = g_strdup_printf("%i-%i -> %i-%i. Cic:%i",
mtp3_ni, mtp3_opc,
mtp3_ni, mtp3_dpc, pinfo->circuit_id);
@@ -1257,7 +1255,7 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
}
- switch(pi->message_type){
+ switch(pi->message_type) {
case 1: /* IAM */
callsinfo->call_state=VOIP_CALL_SETUP;
break;
@@ -1266,8 +1264,8 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
callsinfo->call_state=VOIP_IN_CALL;
break;
case 12: /* RELEASE */
- if (callsinfo->call_state==VOIP_CALL_SETUP){
- if (forward){
+ if (callsinfo->call_state==VOIP_CALL_SETUP) {
+ if (forward) {
callsinfo->call_state=VOIP_CANCELLED;
}
else{
@@ -1275,7 +1273,7 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
tapinfo->rejected_calls++;
}
}
- else if (callsinfo->call_state == VOIP_IN_CALL){
+ else if (callsinfo->call_state == VOIP_IN_CALL) {
callsinfo->call_state = VOIP_COMPLETED;
tapinfo->completed_calls++;
}
@@ -1493,7 +1491,7 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
while (list)
{
tmp_listinfo=list->data;
- if ( (tmp_listinfo->protocol == VOIP_H323) && (tmp_listinfo->call_num == h225_call_num) ){
+ if ( (tmp_listinfo->protocol == VOIP_H323) && (tmp_listinfo->call_num == h225_call_num) ) {
tmp_h323info = tmp_listinfo->prot_info;
callsinfo = (voip_calls_info_t*)(list->data);
@@ -1512,11 +1510,11 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
comment = NULL;
if (h225_cstype == H225_SETUP) {
/* set te calling and called number from the Q931 packet */
- if (q931_calling_number != NULL){
+ if (q931_calling_number != NULL) {
g_free(callsinfo->from_identity);
callsinfo->from_identity=g_strdup(q931_calling_number);
}
- if (q931_called_number != NULL){
+ if (q931_called_number != NULL) {
g_free(callsinfo->to_identity);
callsinfo->to_identity=g_strdup(q931_called_number);
}
@@ -1529,12 +1527,12 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
while (list)
{
tmp_listinfo=list->data;
- if (tmp_listinfo->protocol == VOIP_H323){
+ if (tmp_listinfo->protocol == VOIP_H323) {
tmp2_h323info = tmp_listinfo->prot_info;
/* check if the called number match a LRQ/LCF */
if ( (strcmp(callsinfo->to_identity, tmp_listinfo->to_identity)==0)
- && (memcmp(&tmp2_h323info->guid, &guid_allzero, GUID_LEN) == 0) ){
+ && (memcmp(&tmp2_h323info->guid, &guid_allzero, GUID_LEN) == 0) ) {
/* change the call graph to the LRQ/LCF to belong to this call */
callsinfo->npackets += change_call_num_graph(tapinfo, tmp_listinfo->call_num, callsinfo->call_num);
@@ -1565,7 +1563,7 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
(h225_is_faststart==TRUE?"on":"off"));
} else if (h225_cstype == H225_RELEASE_COMPLET) {
/* get the Q931 Release cause code */
- if (q931_cause_value != 0xFF){
+ if (q931_cause_value != 0xFF) {
comment = g_strdup_printf("H225 Q931 Rel Cause (%i):%s", q931_cause_value,
val_to_str_ext_const(q931_cause_value, &q931_cause_code_vals_ext, "<unknown>"));
} else { /* Cause not set */
@@ -1590,9 +1588,9 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
while (list)
{
tmp_listinfo=list->data;
- if (tmp_listinfo->protocol == VOIP_H323){
+ if (tmp_listinfo->protocol == VOIP_H323) {
tmp_h323info = tmp_listinfo->prot_info;
- if ( ((tmp_h323info->q931_crv == q931_crv) || (tmp_h323info->q931_crv2 == q931_crv)) && (q931_crv!=-1)){
+ if ( ((tmp_h323info->q931_crv == q931_crv) || (tmp_h323info->q931_crv2 == q931_crv)) && (q931_crv!=-1)) {
/* if the frame number exists in graph, append to it*/
if (!append_to_frame_graph(tapinfo, q931_frame_num, NULL, NULL)) {
/* if not exist, add to the graph */
@@ -1620,7 +1618,7 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
while (list)
{
tmp_listinfo=list->data;
- if ( tmp_listinfo->protocol == VOIP_AC_ISDN ){
+ if ( tmp_listinfo->protocol == VOIP_AC_ISDN ) {
tmp_actrace_isdn_info = tmp_listinfo->prot_info;
/* TODO: Also check the IP of the Blade, and if the call is complete (no active) */
if ( (tmp_actrace_isdn_info->crv == q931_crv) && (tmp_actrace_isdn_info->trunk == actrace_trunk) ) {
@@ -1659,7 +1657,7 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
/* increment the packets counter of all calls */
++(tapinfo->npackets);
- switch(pi->message_type){
+ switch(pi->message_type) {
case Q931_SETUP:
comment = g_strdup_printf("AC_ISDN trunk:%u Calling: %s Called:%s", actrace_trunk, q931_calling_number, q931_called_number);
callsinfo->call_state=VOIP_CALL_SETUP;
@@ -1670,19 +1668,19 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
case Q931_RELEASE_COMPLETE:
case Q931_RELEASE:
case Q931_DISCONNECT:
- if (callsinfo->call_state==VOIP_CALL_SETUP){
- if (ADDRESSES_EQUAL(&(callsinfo->initial_speaker), actrace_direction?&pstn_add:&(pinfo->src) )){ /* forward direction */
+ if (callsinfo->call_state==VOIP_CALL_SETUP) {
+ if (ADDRESSES_EQUAL(&(callsinfo->initial_speaker), actrace_direction?&pstn_add:&(pinfo->src) )) { /* forward direction */
callsinfo->call_state=VOIP_CANCELLED;
}
else{ /* reverse */
callsinfo->call_state=VOIP_REJECTED;
tapinfo->rejected_calls++;
}
- } else if ( (callsinfo->call_state!=VOIP_CANCELLED) && (callsinfo->call_state!=VOIP_REJECTED) ){
+ } else if ( (callsinfo->call_state!=VOIP_CANCELLED) && (callsinfo->call_state!=VOIP_REJECTED) ) {
callsinfo->call_state=VOIP_COMPLETED;
tapinfo->completed_calls++;
}
- if (q931_cause_value != 0xFF){
+ if (q931_cause_value != 0xFF) {
comment = g_strdup_printf("AC_ISDN trunk:%u Q931 Rel Cause (%i):%s", actrace_trunk, q931_cause_value,
val_to_str_ext_const(q931_cause_value, &q931_cause_code_vals_ext, "<unknown>"));
} else { /* Cause not set */
@@ -1813,7 +1811,7 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
{
tmp_listinfo=list->data;
g_assert(tmp_listinfo != NULL);
- if (tmp_listinfo->protocol == VOIP_H323){
+ if (tmp_listinfo->protocol == VOIP_H323) {
tmp_h323info = tmp_listinfo->prot_info;
if (tmp_h323info->requestSeqNum == pi->requestSeqNum) {
callsinfo = (voip_calls_info_t*)(list->data);
@@ -1828,10 +1826,10 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
while (list)
{
tmp_listinfo=list->data;
- if (tmp_listinfo->protocol == VOIP_H323){
+ if (tmp_listinfo->protocol == VOIP_H323) {
tmp_h323info = tmp_listinfo->prot_info;
g_assert(tmp_h323info != NULL);
- if ( (memcmp(tmp_h323info->guid, &guid_allzero, GUID_LEN) != 0) && (memcmp(tmp_h323info->guid, &pi->guid,GUID_LEN)==0) ){
+ if ( (memcmp(tmp_h323info->guid, &guid_allzero, GUID_LEN) != 0) && (memcmp(tmp_h323info->guid, &pi->guid,GUID_LEN)==0) ) {
callsinfo = (voip_calls_info_t*)(list->data);
break;
}
@@ -1844,7 +1842,7 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
h225_is_faststart = pi->is_faststart;
/* not in the list? then create a new entry */
- if (callsinfo==NULL){
+ if (callsinfo==NULL) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_active_state = VOIP_ACTIVE;
callsinfo->call_state = VOIP_UNKNOWN;
@@ -1876,7 +1874,7 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
tapinfo->callsinfo_list = g_list_prepend(tapinfo->callsinfo_list, callsinfo);
}
- if (callsinfo!=NULL){
+ if (callsinfo!=NULL) {
h225_frame_num = pinfo->fd->num;
h225_call_num = callsinfo->call_num;
@@ -1893,10 +1891,10 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
g_assert(tmp_h323info != NULL);
/* change the status */
- if (pi->msg_type == H225_CS){
+ if (pi->msg_type == H225_CS) {
/* this is still IPv4 only, because the dissector is */
- if (pi->is_h245 == TRUE){
+ if (pi->is_h245 == TRUE) {
h245_add = g_malloc(sizeof (h245_address_t));
h245_add->h245_address.type=AT_IPv4;
h245_add->h245_address.len=4;
@@ -1910,7 +1908,7 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
frame_label = g_strdup(pi->frame_label);
- switch(pi->cs_type){
+ switch(pi->cs_type) {
case H225_SETUP:
tmp_h323info->is_faststart_Setup = pi->is_faststart;
@@ -1928,8 +1926,8 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
(pi->is_faststart==TRUE?"on":"off"));
break;
case H225_RELEASE_COMPLET:
- if (callsinfo->call_state==VOIP_CALL_SETUP){
- if (ADDRESSES_EQUAL(&(tmp_h323info->h225SetupAddr),&(pinfo->src))){ /* forward direction */
+ if (callsinfo->call_state==VOIP_CALL_SETUP) {
+ if (ADDRESSES_EQUAL(&(tmp_h323info->h225SetupAddr),&(pinfo->src))) { /* forward direction */
callsinfo->call_state=VOIP_CANCELLED;
}
else{ /* reverse */
@@ -1955,10 +1953,10 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
}
}
- else if (pi->msg_type == H225_RAS){
- switch(pi->msg_tag){
+ else if (pi->msg_type == H225_RAS) {
+ switch(pi->msg_tag) {
case 18: /* LRQ */
- if (!pi->is_duplicate){
+ if (!pi->is_duplicate) {
g_free(callsinfo->to_identity);
callsinfo->to_identity=g_strdup(pi->dialedDigits);
tmp_h323info->requestSeqNum = pi->requestSeqNum;
@@ -2109,7 +2107,7 @@ H245dgcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
while (list)
{
tmp_listinfo=list->data;
- if (tmp_listinfo->protocol == VOIP_H323){
+ if (tmp_listinfo->protocol == VOIP_H323) {
tmp_h323info = tmp_listinfo->prot_info;
list2 = g_list_first(tmp_h323info->h245_list);
@@ -2117,7 +2115,7 @@ H245dgcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
{
h245_add=list2->data;
if ( (ADDRESSES_EQUAL(&(h245_add->h245_address),&(pinfo->src)) && (h245_add->h245_port == pinfo->srcport))
- || (ADDRESSES_EQUAL(&(h245_add->h245_address),&(pinfo->dst)) && (h245_add->h245_port == pinfo->destport)) ){
+ || (ADDRESSES_EQUAL(&(h245_add->h245_address),&(pinfo->dst)) && (h245_add->h245_port == pinfo->destport)) ) {
callsinfo = (voip_calls_info_t*)(list->data);
++(callsinfo->npackets);
@@ -2134,7 +2132,7 @@ H245dgcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
}
/* Tunnel is OFF, and we matched the h245 add so we add it to graph */
- if (callsinfo!=NULL){
+ if (callsinfo!=NULL) {
++(callsinfo->npackets);
/* increment the packets counter of all calls */
++(tapinfo->npackets);
@@ -2392,16 +2390,16 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
const mgcp_info_t *pi = MGCPinfo;
- if ((pi->mgcp_type == MGCP_REQUEST) && !pi->is_duplicate ){
+ if ((pi->mgcp_type == MGCP_REQUEST) && !pi->is_duplicate ) {
/* check whether we already have a call with this Endpoint and it is active*/
list = g_list_first(tapinfo->callsinfo_list);
while (list)
{
tmp_listinfo=list->data;
- if ((tmp_listinfo->protocol == VOIP_MGCP) && (tmp_listinfo->call_active_state == VOIP_ACTIVE)){
+ if ((tmp_listinfo->protocol == VOIP_MGCP) && (tmp_listinfo->call_active_state == VOIP_ACTIVE)) {
tmp_mgcpinfo = tmp_listinfo->prot_info;
- if (pi->endpointId != NULL){
- if (g_ascii_strcasecmp(tmp_mgcpinfo->endpointId,pi->endpointId) == 0){
+ if (pi->endpointId != NULL) {
+ if (g_ascii_strcasecmp(tmp_mgcpinfo->endpointId,pi->endpointId) == 0) {
/*
check first if it is an ended call. We can still match packets to this Endpoint 2 seconds
after the call has been released
@@ -2424,12 +2422,12 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
}
/* there is no call with this Endpoint, lets see if this a new call or not */
- if (callsinfo == NULL){
- if ( (strcmp(pi->code, "NTFY") == 0) && isSignal("hd", pi->observedEvents) ){ /* off hook transition */
+ if (callsinfo == NULL) {
+ if ( (strcmp(pi->code, "NTFY") == 0) && isSignal("hd", pi->observedEvents) ) { /* off hook transition */
/* this is a new call from the Endpoint */
fromEndpoint = TRUE;
new = TRUE;
- } else if (strcmp(pi->code, "CRCX") == 0){
+ } else if (strcmp(pi->code, "CRCX") == 0) {
/* this is a new call from the MGC */
fromEndpoint = FALSE;
new = TRUE;
@@ -2444,14 +2442,14 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
while (listGraph)
{
gai = listGraph->data;
- if (gai->fd->num == pi->req_num){
+ if (gai->fd->num == pi->req_num) {
/* there is a request that match, so look the associated call with this call_num */
list = g_list_first(tapinfo->callsinfo_list);
while (list)
{
tmp_listinfo=list->data;
- if (tmp_listinfo->protocol == VOIP_MGCP){
- if (tmp_listinfo->call_num == gai->conv_num){
+ if (tmp_listinfo->protocol == VOIP_MGCP) {
+ if (tmp_listinfo->call_num == gai->conv_num) {
tmp_mgcpinfo = tmp_listinfo->prot_info;
callsinfo = (voip_calls_info_t*)(list->data);
break;
@@ -2468,7 +2466,7 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
} else return 0;
/* not in the list? then create a new entry */
- if (callsinfo==NULL){
+ if (callsinfo==NULL) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_active_state = VOIP_ACTIVE;
callsinfo->call_state = VOIP_CALL_SETUP;
@@ -2499,10 +2497,10 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
switch (pi->mgcp_type)
{
case MGCP_REQUEST:
- if ( (strcmp(pi->code, "NTFY") == 0) && (pi->observedEvents != NULL) ){
+ if ( (strcmp(pi->code, "NTFY") == 0) && (pi->observedEvents != NULL) ) {
frame_label = g_strdup_printf("%s ObsEvt:%s",pi->code, pi->observedEvents);
- if (tmp_mgcpinfo->fromEndpoint){
+ if (tmp_mgcpinfo->fromEndpoint) {
/* use the Dialed digits to fill the "To" for the call, but use the first NTFY */
if (callsinfo->to_identity[0] == '\0') mgcpDialedDigits(pi->observedEvents, &(callsinfo->to_identity));
@@ -2512,7 +2510,7 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
/* hung up signal */
if (isSignal("hu", pi->observedEvents)) {
- if ((callsinfo->call_state == VOIP_CALL_SETUP) || (callsinfo->call_state == VOIP_RINGING)){
+ if ((callsinfo->call_state == VOIP_CALL_SETUP) || (callsinfo->call_state == VOIP_RINGING)) {
callsinfo->call_state = VOIP_CANCELLED;
} else {
callsinfo->call_state = VOIP_COMPLETED;
@@ -2548,8 +2546,8 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
if there is a DLCX in a call To an Endpoint and the call was not connected, we use
the DLCX as the end of the call
*/
- if (!tmp_mgcpinfo->fromEndpoint){
- if ((callsinfo->call_state == VOIP_CALL_SETUP) || (callsinfo->call_state == VOIP_RINGING)){
+ if (!tmp_mgcpinfo->fromEndpoint) {
+ if ((callsinfo->call_state == VOIP_CALL_SETUP) || (callsinfo->call_state == VOIP_RINGING)) {
callsinfo->call_state = VOIP_CANCELLED;
}
}
@@ -2579,7 +2577,7 @@ MGCPcalls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
g_free(frame_label);
/* add SDP info if apply */
- if ( (sdp_summary != NULL) && (sdp_frame_num == pinfo->fd->num) ){
+ if ( (sdp_summary != NULL) && (sdp_frame_num == pinfo->fd->num) ) {
append_to_frame_graph(tapinfo, pinfo->fd->num, sdp_summary, NULL);
g_free(sdp_summary);
sdp_summary = NULL;
@@ -2660,7 +2658,7 @@ ACTRACEcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
actrace_trunk = pi->trunk;
actrace_direction = pi->direction;
- if (pi->type == 1){ /* is CAS protocol */
+ if (pi->type == 1) { /* is CAS protocol */
address pstn_add;
gchar *comment = NULL;
@@ -2669,7 +2667,7 @@ ACTRACEcalls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
while (list)
{
tmp_listinfo=list->data;
- if ( tmp_listinfo->protocol == VOIP_AC_CAS ){
+ if ( tmp_listinfo->protocol == VOIP_AC_CAS ) {
tmp_actrace_cas_info = tmp_listinfo->prot_info;
/* TODO: Also check the IP of the Blade, and if the call is complete (no active) */
if ( (tmp_actrace_cas_info->bchannel == pi->cas_bchannel) && (tmp_actrace_cas_info->trunk == actrace_trunk) ) {
@@ -2807,8 +2805,8 @@ static int h248_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *
{
voip_calls_info_t* tmp_listinfo = list->data;
- if (tmp_listinfo->protocol == TEL_H248){
- if (tmp_listinfo->prot_info == cmd->ctx){
+ if (tmp_listinfo->protocol == TEL_H248) {
+ if (tmp_listinfo->prot_info == cmd->ctx) {
callsinfo = (voip_calls_info_t*)(list->data);
break;
}
@@ -2816,7 +2814,7 @@ static int h248_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *
list = g_list_next (list);
}
- if (callsinfo==NULL){
+ if (callsinfo==NULL) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_state = VOIP_NO_STATE;
@@ -2957,13 +2955,13 @@ static int sccp_calls(packet_info *pinfo, const void *prot_info) {
/* check whether we already have this assoc in the list */
for(list = g_list_first(tapinfo->callsinfo_list) ; list ; list = g_list_next (list) ) {
- if ( ((voip_calls_info_t*)(list->data))->prot_info == assoc ){
+ if ( ((voip_calls_info_t*)(list->data))->prot_info == assoc ) {
callsinfo = (voip_calls_info_t*)(list->data);
break;
}
}
- if (callsinfo==NULL){
+ if (callsinfo==NULL) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_state = VOIP_CALL_SETUP;
callsinfo->call_active_state = VOIP_ACTIVE;
@@ -3143,15 +3141,15 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
{
tmp_listinfo = list->data;
- if(tmp_listinfo->protocol == VOIP_UNISTIM){
+ if(tmp_listinfo->protocol == VOIP_UNISTIM) {
tmp_unistim_info = tmp_listinfo->prot_info;
/* Search by termid if possible, otherwise use ni/it ip + port.. */
- if(pi->termid != 0){
- if(tmp_unistim_info->termid == pi->termid){
+ if(pi->termid != 0) {
+ if(tmp_unistim_info->termid == pi->termid) {
/* If the call has ended, then we can reuse it.. */
- if(tmp_listinfo->call_state == VOIP_COMPLETED || tmp_listinfo->call_state == VOIP_UNKNOWN){
+ if(tmp_listinfo->call_state == VOIP_COMPLETED || tmp_listinfo->call_state == VOIP_UNKNOWN) {
/* Do nothing */
} else {
callsinfo = (voip_calls_info_t*)(list->data);
@@ -3160,8 +3158,8 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
}
} else {
/* If no term id use ips / port to find entry */
- if(ADDRESSES_EQUAL(&tmp_unistim_info->it_ip, &pinfo->dst) && ADDRESSES_EQUAL(&tmp_unistim_info->ni_ip,&pinfo->src) && (tmp_unistim_info->it_port == pinfo->destport)){
- if(tmp_listinfo->call_state == VOIP_COMPLETED || tmp_listinfo->call_state == VOIP_UNKNOWN){
+ if(ADDRESSES_EQUAL(&tmp_unistim_info->it_ip, &pinfo->dst) && ADDRESSES_EQUAL(&tmp_unistim_info->ni_ip,&pinfo->src) && (tmp_unistim_info->it_port == pinfo->destport)) {
+ if(tmp_listinfo->call_state == VOIP_COMPLETED || tmp_listinfo->call_state == VOIP_UNKNOWN) {
/* Do nothing previous call */
} else {
callsinfo = (voip_calls_info_t*)(list->data);
@@ -3169,7 +3167,7 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
}
}
else if(ADDRESSES_EQUAL(&tmp_unistim_info->it_ip, &pinfo->src) && ADDRESSES_EQUAL(&tmp_unistim_info->ni_ip,&pinfo->dst) && (tmp_unistim_info->it_port == pinfo->srcport)) {
- if(tmp_listinfo->call_state == VOIP_COMPLETED || tmp_listinfo->call_state == VOIP_UNKNOWN){
+ if(tmp_listinfo->call_state == VOIP_COMPLETED || tmp_listinfo->call_state == VOIP_UNKNOWN) {
/* Do nothing, it ain't our call.. */
} else {
callsinfo = (voip_calls_info_t*)(list->data);
@@ -3183,15 +3181,15 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
list = g_list_next(list);
}
- if(pi->payload_type == 2 || pi->payload_type == 1){
+ if(pi->payload_type == 2 || pi->payload_type == 1) {
- if(pi->key_state == 1 || pi->hook_state == 1){
+ if(pi->key_state == 1 || pi->hook_state == 1) {
/* If the user hits a button,
Session will be SETUP */
/* If new add to list */
- if (callsinfo==NULL){
+ if (callsinfo==NULL) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_active_state = VOIP_ACTIVE;
@@ -3252,9 +3250,9 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
++(tapinfo->npackets);
/* Key was depressed.. update key buffer.. */
- if(pi->key_val >= 0 && pi->key_val <= 11){
+ if(pi->key_val >= 0 && pi->key_val <= 11) {
- if(tmp_unistim_info->key_buffer != NULL){
+ if(tmp_unistim_info->key_buffer != NULL) {
/* assign to temp variable */
g_string_assign(g_tmp,tmp_unistim_info->key_buffer);
@@ -3299,7 +3297,7 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
/* Set label and comment for graph */
comment = g_strdup_printf("Key Input Sent: RIGHT (%d)", pi->sequence);
} else if(pi->key_val == 15) {
- if(pi->key_buffer != NULL){
+ if(pi->key_buffer != NULL) {
/* Get data */
g_string_assign(g_tmp,pi->key_buffer);
@@ -3418,7 +3416,7 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
/* ?? means we're not quite sure if this is accurate. Since Unistim isn't a true
Call control protocol, we can only guess at the destination by messing with
key buffers. */
- if(tmp_unistim_info->key_buffer != NULL){
+ if(tmp_unistim_info->key_buffer != NULL) {
callsinfo->to_identity = g_strdup_printf("?? %s",tmp_unistim_info->key_buffer);
}
@@ -3497,7 +3495,7 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
/* ?? means we're not quite sure if this is accurate. Since Unistim isn't a true
Call control protocol, we can only guess at the destination by messing with
key buffers. */
- if(tmp_unistim_info->key_buffer != NULL){
+ if(tmp_unistim_info->key_buffer != NULL) {
callsinfo->to_identity = g_strdup_printf("?? %s",tmp_unistim_info->key_buffer);
}
@@ -3524,7 +3522,7 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
tmp_unistim_info->sequence = pi->sequence;
- if(callsinfo->call_state == VOIP_IN_CALL){
+ if(callsinfo->call_state == VOIP_IN_CALL) {
callsinfo->call_active_state = VOIP_INACTIVE;
callsinfo->call_state = VOIP_COMPLETED;
} else {
@@ -3579,7 +3577,7 @@ unistim_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
static gboolean have_unistim_tap_listener=FALSE;
/****************************************************************************/
void
-unistim_calls_init_tap(void){
+unistim_calls_init_tap(void) {
GString *error_string;
@@ -3656,10 +3654,10 @@ skinny_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
while (list)
{
voip_calls_info_t* tmp_listinfo = list->data;
- if (tmp_listinfo->protocol == VOIP_SKINNY){
+ if (tmp_listinfo->protocol == VOIP_SKINNY) {
tmp_skinnyinfo = tmp_listinfo->prot_info;
if (tmp_skinnyinfo->callId == si->callId ||
- tmp_skinnyinfo->callId == si->passThruId){
+ tmp_skinnyinfo->callId == si->passThruId) {
callsinfo = (voip_calls_info_t*)(list->data);
break;
}
@@ -3672,7 +3670,7 @@ skinny_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_,
else
phone = &(pinfo->src);
- if (callsinfo==NULL){
+ if (callsinfo==NULL) {
callsinfo = g_malloc0(sizeof(voip_calls_info_t));
callsinfo->call_state = VOIP_NO_STATE;
callsinfo->call_active_state = VOIP_ACTIVE;
@@ -3851,10 +3849,10 @@ iax2_calls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
while (list)
{
voip_calls_info_t* tmp_listinfo = list->data;
- if (tmp_listinfo->protocol == VOIP_IAX2){
+ if (tmp_listinfo->protocol == VOIP_IAX2) {
tmp_iax2info = tmp_listinfo->prot_info;
if (tmp_iax2info->scallno == ii->scallno ||
- tmp_iax2info->scallno == ii->dcallno){
+ tmp_iax2info->scallno == ii->dcallno) {
callsinfo = (voip_calls_info_t*)(list->data);
break;
}
@@ -3864,7 +3862,7 @@ iax2_calls_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, c
phone = &(pinfo->src);
- if (callsinfo==NULL){
+ 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 0;
@@ -4080,7 +4078,7 @@ static int
prot_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prot_info _U_)
{
voip_calls_tapinfo_t *tapinfo = &the_tapinfo_struct;
- if (callsinfo!=NULL){
+ if (callsinfo!=NULL) {
callsinfo->stop_abs = pinfo->fd->abs_ts;
callsinfo->stop_rel = pinfo->fd->rel_ts;
callsinfo->last_frame_num=pinfo->fd->num;