aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2006-03-19 20:45:45 +0000
committerGuy Harris <guy@alum.mit.edu>2006-03-19 20:45:45 +0000
commit7db8eea5c68284a468924639eecc2ca8959225d0 (patch)
tree8615d9607a760ce4721551cd031660083076cd49 /gtk
parent624db0dc41ab9bad1bacbd95462d6dffa4afba61 (diff)
Make the GUIDs in various data structures e_guid_t's rather than arrays
of 16 bytes. Use "sizeof" for the size of e_guid_t's, and use structure assignment to copy GUID values. Make functions such as append_h225ras_call() and new_h225ras_call() take pointers to e_guid_t's as arguments. Define GUID_LEN in epan/guid-utils.h and use it as the length of a GUID in a packet. (Note that "sizeof e_guid_t" is not guaranteed to be 16, although it is guaranteed to be the size of an e_guid_t.) When constructing a display filter that matches a GUID, use guid_to_str() to construct the string for the GUID. svn path=/trunk/; revision=17676
Diffstat (limited to 'gtk')
-rw-r--r--gtk/voip_calls.c11
-rw-r--r--gtk/voip_calls.h3
-rw-r--r--gtk/voip_calls_dlg.c13
3 files changed, 13 insertions, 14 deletions
diff --git a/gtk/voip_calls.c b/gtk/voip_calls.c
index 73aa105fc0..12c7eee41d 100644
--- a/gtk/voip_calls.c
+++ b/gtk/voip_calls.c
@@ -1319,8 +1319,7 @@ remove_tap_listener_mtp3_calls(void)
/* ***************************TAP for Q931 **********************************/
/****************************************************************************/
void h245_add_to_graph(guint32 new_frame_num);
-#define GUID_LEN 16
-static const guint8 guid_allzero[GUID_LEN] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+static const e_guid_t guid_allzero = {0, 0, 0, { 0, 0, 0, 0, 0, 0, 0, 0 } };
/* defines specific H323 data */
static gchar *q931_calling_number;
@@ -1421,7 +1420,7 @@ q931_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
/* check if the called number match a LRQ/LCF */
if ( (strcmp(strinfo->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 */
strinfo->npackets += change_call_num_graph(tapinfo, tmp_listinfo->call_num, strinfo->call_num);
@@ -1668,7 +1667,7 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
/* if not guid and RAS and not LRQ, LCF or LRJ return because did not belong to a call */
/* 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 ((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 0;
@@ -1699,7 +1698,7 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
tmp_listinfo=list->data;
if (tmp_listinfo->protocol == VOIP_H323){
tmp_h323info = tmp_listinfo->prot_info;
- 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) ){
strinfo = (voip_calls_info_t*)(list->data);
break;
}
@@ -1726,7 +1725,7 @@ H225calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, con
strinfo->protocol=VOIP_H323;
strinfo->prot_info=g_malloc(sizeof(h323_calls_info_t));
tmp_h323info = strinfo->prot_info;
- tmp_h323info->guid = (guint8 *) g_memdup(pi->guid,GUID_LEN);
+ tmp_h323info->guid = g_memdup(&pi->guid, sizeof pi->guid);
tmp_h323info->h225SetupAddr.type = AT_NONE;
tmp_h323info->h225SetupAddr.len = 0;
tmp_h323info->h245_list = NULL;
diff --git a/gtk/voip_calls.h b/gtk/voip_calls.h
index 7f260ce42f..e24221cbea 100644
--- a/gtk/voip_calls.h
+++ b/gtk/voip_calls.h
@@ -39,6 +39,7 @@
#include <glib.h>
#include <stdio.h>
#include <epan/address.h>
+#include <epan/guid-utils.h>
/****************************************************************************/
/* defines voip call state */
@@ -100,7 +101,7 @@ typedef struct _h245_address {
/* defines specific H323 data */
typedef struct _h323_calls_info {
- guint8 *guid; /* Call ID to identify a H225 */
+ e_guid_t *guid; /* Call ID to identify a H225 */
GList* h245_list; /* list of H245 Address and ports for tunneling off calls*/
address h225SetupAddr; /* we use the SETUP H225 IP to determine if packets are forward or reverse */
gboolean is_h245;
diff --git a/gtk/voip_calls_dlg.c b/gtk/voip_calls_dlg.c
index 7b4e154d12..f626c6977a 100644
--- a/gtk/voip_calls_dlg.c
+++ b/gtk/voip_calls_dlg.c
@@ -317,13 +317,12 @@ voip_calls_on_filter (GtkButton *button _U_,
case VOIP_H323:
tmp_h323info = selected_call_fwd->prot_info;
g_string_sprintfa(filter_string_fwd,
- "((h225.guid == %x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x:%x || q931.call_ref == %x:%x || q931.call_ref == %x:%x) ",
- (guint8)tmp_h323info->guid[0], (guint8)tmp_h323info->guid[1], (guint8)tmp_h323info->guid[2],
- (guint8)tmp_h323info->guid[3], (guint8)tmp_h323info->guid[4], (guint8)tmp_h323info->guid[5], (guint8)tmp_h323info->guid[6],
- (guint8)tmp_h323info->guid[7], (guint8)tmp_h323info->guid[8], (guint8)tmp_h323info->guid[9], (guint8)tmp_h323info->guid[10],
- (guint8)tmp_h323info->guid[11], (guint8)tmp_h323info->guid[12], (guint8)tmp_h323info->guid[13], (guint8)tmp_h323info->guid[14],
- (guint8)tmp_h323info->guid[15], (guint8)(tmp_h323info->q931_crv & 0xff), (guint8)((tmp_h323info->q931_crv & 0xff00)>>8)
- , (guint8)(tmp_h323info->q931_crv2 & 0xff), (guint8)((tmp_h323info->q931_crv2 & 0xff00)>>8));
+ "((h225.guid == %s || q931.call_ref == %x:%x || q931.call_ref == %x:%x) ",
+ guid_to_str(&tmp_h323info->guid[0]),
+ (guint8)(tmp_h323info->q931_crv & 0xff),
+ (guint8)((tmp_h323info->q931_crv & 0xff00)>>8),
+ (guint8)(tmp_h323info->q931_crv2 & 0xff),
+ (guint8)((tmp_h323info->q931_crv2 & 0xff00)>>8));
list = g_list_first(tmp_h323info->h245_list);
while (list)
{